feat: expanded style test
This commit is contained in:
parent
b34aae1bda
commit
c0d0451236
19 changed files with 135 additions and 5 deletions
|
|
@ -1,6 +1,9 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://cd4vnmrmj8cj7"]
|
||||
|
||||
[resource]
|
||||
transparency = 2
|
||||
alpha_scissor_threshold = 0.5
|
||||
alpha_antialiasing_mode = 0
|
||||
cull_mode = 1
|
||||
shading_mode = 0
|
||||
diffuse_mode = 3
|
||||
|
|
@ -9,6 +12,6 @@ vertex_color_use_as_albedo = true
|
|||
albedo_color = Color(0.121152334, 0.121152334, 0.121152334, 1)
|
||||
grow = true
|
||||
grow_amount = 0.02
|
||||
proximity_fade_distance = 0.2
|
||||
proximity_fade_distance = 0.1
|
||||
stencil_mode = 3
|
||||
stencil_outline_thickness = 0.029
|
||||
|
|
|
|||
17
project/assets/style/character_outline_material.tres
Normal file
17
project/assets/style/character_outline_material.tres
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[gd_resource type="StandardMaterial3D" format=3 uid="uid://02s3lq67141v"]
|
||||
|
||||
[resource]
|
||||
transparency = 2
|
||||
alpha_scissor_threshold = 0.5
|
||||
alpha_antialiasing_mode = 0
|
||||
cull_mode = 1
|
||||
shading_mode = 0
|
||||
diffuse_mode = 3
|
||||
specular_mode = 2
|
||||
vertex_color_use_as_albedo = true
|
||||
albedo_color = Color(0.121152334, 0.121152334, 0.121152334, 1)
|
||||
grow = true
|
||||
grow_amount = 0.02
|
||||
proximity_fade_enabled = true
|
||||
proximity_fade_distance = 0.25
|
||||
stencil_outline_thickness = 0.029
|
||||
|
|
@ -1,16 +1,25 @@
|
|||
@tool
|
||||
extends EditorScenePostImport
|
||||
|
||||
var outline_material : StandardMaterial3D
|
||||
var regular_outline_material : StandardMaterial3D
|
||||
var character_outline_material : StandardMaterial3D
|
||||
var outline_disable_flag : String = "-nooutline"
|
||||
|
||||
func _post_import(root : Node):
|
||||
outline_material = ResourceLoader.load("res://assets/style/base_outline_material.tres") as StandardMaterial3D
|
||||
regular_outline_material = ResourceLoader.load("res://assets/style/base_outline_material.tres") as StandardMaterial3D
|
||||
character_outline_material = ResourceLoader.load("res://assets/style/character_outline_material.tres") as StandardMaterial3D
|
||||
apply_outline_recursive(root)
|
||||
return root
|
||||
|
||||
func apply_outline_recursive(node : Node):
|
||||
if node != null:
|
||||
if node is MeshInstance3D and outline_material:
|
||||
(node as MeshInstance3D).material_overlay = outline_material
|
||||
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 mesh : MeshInstance3D = (node as MeshInstance3D)
|
||||
if mesh.skeleton and character_outline_material:
|
||||
mesh.material_overlay = character_outline_material
|
||||
elif regular_outline_material:
|
||||
mesh.material_overlay = regular_outline_material
|
||||
for child in node.get_children():
|
||||
apply_outline_recursive(child)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue