Compare commits
3 commits
c0d0451236
...
a2df2e1a47
| Author | SHA1 | Date | |
|---|---|---|---|
| a2df2e1a47 | |||
| b422998e25 | |||
| b89eccb62d |
7 changed files with 12 additions and 6 deletions
Binary file not shown.
|
|
@ -3,7 +3,7 @@
|
|||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://ctp31vgapr25x"
|
||||
uid="uid://grb3q5nd2uds"
|
||||
path="res://.godot/imported/character_fem.blend-e169cb46816e89cf00aa8e7f988a0574.scn"
|
||||
|
||||
[deps]
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Binary file not shown.
|
|
@ -3,7 +3,6 @@ extends EditorScenePostImport
|
|||
|
||||
var regular_outline_material : StandardMaterial3D
|
||||
var character_outline_material : StandardMaterial3D
|
||||
var outline_disable_flag : String = "-nooutline"
|
||||
|
||||
func _post_import(root : Node):
|
||||
regular_outline_material = ResourceLoader.load("res://assets/style/base_outline_material.tres") as StandardMaterial3D
|
||||
|
|
@ -11,13 +10,20 @@ func _post_import(root : Node):
|
|||
apply_outline_recursive(root)
|
||||
return root
|
||||
|
||||
func get_flag(node : Node, flag : String) -> bool:
|
||||
if node.name.contains(flag):
|
||||
node.name = node.name.erase(node.name.find(flag), flag.length())
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
func apply_outline_recursive(node : Node):
|
||||
if node != null:
|
||||
if node.name.contains(outline_disable_flag):
|
||||
node.name = node.name.erase(node.name.find(outline_disable_flag), outline_disable_flag.length())
|
||||
elif node is MeshInstance3D:
|
||||
var outline : bool = not get_flag(node, "-nooutline")
|
||||
if outline and node is MeshInstance3D:
|
||||
var detail : bool = get_flag(node, "-detailoutline")
|
||||
var mesh : MeshInstance3D = (node as MeshInstance3D)
|
||||
if mesh.skeleton and character_outline_material:
|
||||
if detail and character_outline_material:
|
||||
mesh.material_overlay = character_outline_material
|
||||
elif regular_outline_material:
|
||||
mesh.material_overlay = regular_outline_material
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue