diff --git a/core/IvmiNode.gd b/core/IvmiNode.gd index ecb8ea4d2a93f455e155b2aa7779066db60a112f..a53a245e3547f70f615c1c9064c8ae0ce21d5a9e 100644 --- a/core/IvmiNode.gd +++ b/core/IvmiNode.gd @@ -136,7 +136,7 @@ func _get_ivmi_type(): return _ivmi_type func _process(delta): - if !Engine.is_editor_hint(): + if is_inside_tree(): #get cam dist if needed if _properties["distance_to_camera"]._listen: var cam_pos = get_viewport().get_camera_3d().to_global(Vector3(0,0,0)) diff --git a/techniques/control/Tunnel/Tunnel.gd b/techniques/control/Tunnel/Tunnel.gd index 5c201300dbe8ac131bb5b106fe8ba2f4a758d283..b538e250340c9386e10317962c08bfeca6584795 100644 --- a/techniques/control/Tunnel/Tunnel.gd +++ b/techniques/control/Tunnel/Tunnel.gd @@ -56,11 +56,14 @@ func _update_slices() : s.scale.z = 0.5 s.rotation_degrees.x = 0 for param in tunnel_preset_array[_preset_index]: - var value + var value : float if param.data_type == DATA_TYPE.array: value = _find_value_in_array(ratio,param.array) else: value = param.curve.sample(ratio) + + if value > 1.0 : + value/=127 match param.name: "tunnel_color_scale" : @@ -94,6 +97,8 @@ func _physics_process(delta): value = _find_value_in_array(ratio,param.array) else: value = param.curve.sample(ratio) + if value > 1.0 : + value/=127 col.set_property(param.name, [value]) func get_extent(): @@ -101,10 +106,11 @@ func get_extent(): # Find the highest vec.x < x in the array func _find_value_in_array(x,array): + var val : float = array[array.size()-1].y for vec in array: - if x<=vec.x: - return vec.y - return array[array.size()-1].y + if vec.x<=x: + val = vec.y + return val func _cycle_preset(): _preset_index = (_preset_index+1)%tunnel_preset_array.size() diff --git a/techniques/control/Tunnel/TunnelPreset.tscn b/techniques/control/Tunnel/TunnelPreset.tscn index c64e9478bf4fb61b9e586ec879b4608a168b60cf..89a083a4237a7d6c013c4256fd92e52784bfc2f5 100644 --- a/techniques/control/Tunnel/TunnelPreset.tscn +++ b/techniques/control/Tunnel/TunnelPreset.tscn @@ -1,6 +1,6 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=2 format=3 uid="uid://dnssxrdl7c38r"] -[ext_resource path="res://addons/ivmi-builder/techniques/control/Tunnel/TunnelPreset.gd" type="Script" id=1] +[ext_resource type="Script" path="res://addons/ivmi-builder/techniques/control/Tunnel/TunnelPreset.gd" id="1"] [node name="TunnelPreset" type="Node3D"] -script = ExtResource( 1 ) +script = ExtResource("1")