WIP Parchment, make an editor script and set value on Warcraft scene

This commit is contained in:
stilobique-i7
2021-05-25 16:44:55 +02:00
parent 3b6a70596e
commit d8e1f4721c
6 changed files with 18 additions and 23 deletions
-20
View File
@@ -1,20 +0,0 @@
extends Spatial
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
export var paper = false
func _init():
$sm_paperparchment_lod0.set_visible(paper)
print("[Parchment] Set is visibility > " + paper)
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
+15
View File
@@ -0,0 +1,15 @@
tool
extends Spatial
export(bool) var paper = false setget activatePaper
func activatePaper(showPaper):
if Engine.editor_hint:
paper = showPaper
print("[Parchment] Editor value " +String(showPaper))
$sm_paperparchment_lod0.set_visible(paper)
func _ready():
print("[Parchment] Paper bool " +String(paper))
$sm_paperparchment_lod0.set_visible(paper)
+1 -2
View File
@@ -1,12 +1,11 @@
[gd_scene load_steps=4 format=2] [gd_scene load_steps=4 format=2]
[ext_resource path="res://assets/props/parchment/sm_wood_parchment_lod1.mesh" type="ArrayMesh" id=1] [ext_resource path="res://assets/props/parchment/sm_wood_parchment_lod1.mesh" type="ArrayMesh" id=1]
[ext_resource path="res://assets/props/parchment/gd_parchment.gd" type="Script" id=2] [ext_resource path="res://assets/props/parchment/parchment.gd" type="Script" id=2]
[ext_resource path="res://assets/props/parchment/sm_paperparchment_lod0.mesh" type="ArrayMesh" id=3] [ext_resource path="res://assets/props/parchment/sm_paperparchment_lod0.mesh" type="ArrayMesh" id=3]
[node name="sm_parchment" type="Spatial"] [node name="sm_parchment" type="Spatial"]
script = ExtResource( 2 ) script = ExtResource( 2 )
paper = true
[node name="sm_wood_parchment_lod1" type="MeshInstance" parent="."] [node name="sm_wood_parchment_lod1" type="MeshInstance" parent="."]
use_in_baked_light = true use_in_baked_light = true
Binary file not shown.
Binary file not shown.
+2 -1
View File
@@ -447,10 +447,10 @@ transform = Transform( 0.0876426, 0, -0.996152, 0, 1, 0, 0.996152, 0, 0.0876426,
[node name="sm_parchment" parent="Main Scene Props" instance=ExtResource( 15 )] [node name="sm_parchment" parent="Main Scene Props" instance=ExtResource( 15 )]
transform = Transform( 0.796076, 0.00917861, -0.605127, 0, 0.999885, 0.0151663, 0.605197, -0.0120736, 0.795984, 0.543303, 0.962739, 0.755265 ) transform = Transform( 0.796076, 0.00917861, -0.605127, 0, 0.999885, 0.0151663, 0.605197, -0.0120736, 0.795984, 0.543303, 0.962739, 0.755265 )
paper = true
[node name="sm_parchment2" parent="Main Scene Props" instance=ExtResource( 15 )] [node name="sm_parchment2" parent="Main Scene Props" instance=ExtResource( 15 )]
transform = Transform( -0.596381, 0.0184557, 0.802489, 0.0225364, 0.999726, -0.00624354, -0.802385, 0.0143617, -0.596634, 0.281044, 0.958449, -0.253034 ) transform = Transform( -0.596381, 0.0184557, 0.802489, 0.0225364, 0.999726, -0.00624354, -0.802385, 0.0143617, -0.596634, 0.281044, 0.958449, -0.253034 )
paper = false
[node name="sm_candle_d2" type="MeshInstance" parent="Main Scene Props"] [node name="sm_candle_d2" type="MeshInstance" parent="Main Scene Props"]
transform = Transform( -0.927966, 1.10978e-07, -0.372664, 6.91459e-08, 1, 1.25617e-07, 0.372664, 9.08001e-08, -0.927966, 0.457262, 1.00485, -0.058084 ) transform = Transform( -0.927966, 1.10978e-07, -0.372664, 6.91459e-08, 1, 1.25617e-07, 0.372664, 9.08001e-08, -0.927966, 0.457262, 1.00485, -0.058084 )
@@ -527,6 +527,7 @@ shape = SubResource( 7 )
[node name="dagger" type="MeshInstance" parent="Hidden Objects Items"] [node name="dagger" type="MeshInstance" parent="Hidden Objects Items"]
transform = Transform( -0.625025, -0.777847, 0.0655765, 0, 0.0840072, 0.996466, -0.780606, 0.622816, -0.0525065, 0.69073, -0.117415, 0.830941 ) transform = Transform( -0.625025, -0.777847, 0.0655765, 0, 0.0840072, 0.996466, -0.780606, 0.622816, -0.0525065, 0.69073, -0.117415, 0.830941 )
use_in_baked_light = true use_in_baked_light = true
generate_lightmap = false
mesh = ExtResource( 14 ) mesh = ExtResource( 14 )
material/0 = ExtResource( 19 ) material/0 = ExtResource( 19 )