[Random Rotation] Now convert scalar, vec2 value into constant angle and angle range respectively.

This commit is contained in:
Tanasart 2024-12-22 15:47:33 +07:00
parent 1ce0c47f18
commit 2947485630
3 changed files with 27 additions and 14 deletions

View file

@ -427,7 +427,6 @@
{"name":"__node_shader","order":22,"path":"scripts/__node_shader/__node_shader.yy",},
{"name":"__node_surface_filter","order":15,"path":"scripts/__node_surface_filter/__node_surface_filter.yy",},
{"name":"__node_template","order":20,"path":"scripts/__node_template/__node_template.yy",},
{"name":"__node_value_array","order":12,"path":"scripts/__node_value_array/__node_value_array.yy",},
{"name":"__node_value_object","order":3,"path":"scripts/__node_value_object/__node_value_object.yy",},
{"name":"__node_value_processor","order":5,"path":"scripts/__node_value_processor/__node_value_processor.yy",},
{"name":"__node_VFX_effector","order":8,"path":"scripts/__node_VFX_effector/__node_VFX_effector.yy",},
@ -1183,7 +1182,7 @@
{"name":"node_tunnel_out","order":1,"path":"scripts/node_tunnel_out/node_tunnel_out.yy",},
{"name":"node_twirl","order":4,"path":"scripts/node_twirl/node_twirl.yy",},
{"name":"node_unicode","order":1,"path":"scripts/node_unicode/node_unicode.yy",},
{"name":"node_value_area","order":10,"path":"scripts/node_value_area/node_value_area.yy",},
{"name":"node_value_area","order":11,"path":"scripts/node_value_area/node_value_area.yy",},
{"name":"node_value_audioBit","order":1,"path":"scripts/node_value_audioBit/node_value_audioBit.yy",},
{"name":"node_value_base","order":2,"path":"scripts/node_value_base/node_value_base.yy",},
{"name":"node_value_bool","order":3,"path":"scripts/node_value_bool/node_value_bool.yy",},
@ -1195,11 +1194,11 @@
{"name":"node_value_d3_mesh","order":3,"path":"scripts/node_value_d3_mesh/node_value_d3_mesh.yy",},
{"name":"node_value_d3_scene","order":4,"path":"scripts/node_value_d3_scene/node_value_d3_scene.yy",},
{"name":"node_value_dimension","order":20,"path":"scripts/node_value_dimension/node_value_dimension.yy",},
{"name":"node_value_enum_button","order":6,"path":"scripts/node_value_enum_button/node_value_enum_button.yy",},
{"name":"node_value_enum_scroll","order":7,"path":"scripts/node_value_enum_scroll/node_value_enum_scroll.yy",},
{"name":"node_value_enum_button","order":7,"path":"scripts/node_value_enum_button/node_value_enum_button.yy",},
{"name":"node_value_enum_scroll","order":8,"path":"scripts/node_value_enum_scroll/node_value_enum_scroll.yy",},
{"name":"node_value_fdomain","order":8,"path":"scripts/node_value_fdomain/node_value_fdomain.yy",},
{"name":"node_value_gradient","order":1,"path":"scripts/node_value_gradient/node_value_gradient.yy",},
{"name":"node_value_int","order":1,"path":"scripts/node_value_int/node_value_int.yy",},
{"name":"node_value_int","order":2,"path":"scripts/node_value_int/node_value_int.yy",},
{"name":"node_value_mesh","order":5,"path":"scripts/node_value_mesh/node_value_mesh.yy",},
{"name":"node_value_output","order":1,"path":"scripts/node_value_output/node_value_output.yy",},
{"name":"node_value_padding","order":16,"path":"scripts/node_value_padding/node_value_padding.yy",},
@ -1209,10 +1208,10 @@
{"name":"node_value_path","order":34,"path":"scripts/node_value_path/node_value_path.yy",},
{"name":"node_value_pathnode","order":5,"path":"scripts/node_value_pathnode/node_value_pathnode.yy",},
{"name":"node_value_quarterion","order":19,"path":"scripts/node_value_quarterion/node_value_quarterion.yy",},
{"name":"node_value_range","order":2,"path":"scripts/node_value_range/node_value_range.yy",},
{"name":"node_value_rotation_random","order":11,"path":"scripts/node_value_rotation_random/node_value_rotation_random.yy",},
{"name":"node_value_rotation_range","order":9,"path":"scripts/node_value_rotation_range/node_value_rotation_range.yy",},
{"name":"node_value_rotation","order":8,"path":"scripts/node_value_rotation/node_value_rotation.yy",},
{"name":"node_value_range","order":3,"path":"scripts/node_value_range/node_value_range.yy",},
{"name":"node_value_rotation_random","order":12,"path":"scripts/node_value_rotation_random/node_value_rotation_random.yy",},
{"name":"node_value_rotation_range","order":10,"path":"scripts/node_value_rotation_range/node_value_rotation_range.yy",},
{"name":"node_value_rotation","order":9,"path":"scripts/node_value_rotation/node_value_rotation.yy",},
{"name":"node_value_sdf","order":6,"path":"scripts/node_value_sdf/node_value_sdf.yy",},
{"name":"node_value_slider_range","order":13,"path":"scripts/node_value_slider_range/node_value_slider_range.yy",},
{"name":"node_value_struct","order":7,"path":"scripts/node_value_struct/node_value_struct.yy",},
@ -1224,10 +1223,10 @@
{"name":"node_value_types","order":3,"path":"scripts/node_value_types/node_value_types.yy",},
{"name":"node_value_validators","order":4,"path":"scripts/node_value_validators/node_value_validators.yy",},
{"name":"node_value_vec2_range","order":14,"path":"scripts/node_value_vec2_range/node_value_vec2_range.yy",},
{"name":"node_value_vec2","order":3,"path":"scripts/node_value_vec2/node_value_vec2.yy",},
{"name":"node_value_vec2","order":4,"path":"scripts/node_value_vec2/node_value_vec2.yy",},
{"name":"node_value_vec3_range","order":15,"path":"scripts/node_value_vec3_range/node_value_vec3_range.yy",},
{"name":"node_value_vec3","order":4,"path":"scripts/node_value_vec3/node_value_vec3.yy",},
{"name":"node_value_vec4","order":5,"path":"scripts/node_value_vec4/node_value_vec4.yy",},
{"name":"node_value_vec3","order":5,"path":"scripts/node_value_vec3/node_value_vec3.yy",},
{"name":"node_value_vec4","order":6,"path":"scripts/node_value_vec4/node_value_vec4.yy",},
{"name":"node_value","order":1,"path":"scripts/node_value/node_value.yy",},
{"name":"node_vector_cross_3D","order":1,"path":"scripts/node_vector_cross_3D/node_vector_cross_3D.yy",},
{"name":"node_vector_dot","order":2,"path":"scripts/node_vector_dot/node_vector_dot.yy",},
@ -2249,6 +2248,7 @@
{"name":"s_node_feedback_output","order":9,"path":"sprites/s_node_feedback_output/s_node_feedback_output.yy",},
{"name":"s_node_feedback","order":3,"path":"sprites/s_node_feedback/s_node_feedback.yy",},
{"name":"s_node_FFT","order":5,"path":"sprites/s_node_FFT/s_node_FFT.yy",},
{"name":"node_value_float","order":1,"path":"scripts/node_value_float/node_value_float.yy",},
{"name":"s_node_filter_array","order":28,"path":"sprites/s_node_filter_array/s_node_filter_array.yy",},
{"name":"s_node_flip_render","order":10,"path":"sprites/s_node_flip_render/s_node_flip_render.yy",},
{"name":"s_node_flip","order":12,"path":"sprites/s_node_flip/s_node_flip.yy",},

View file

@ -2,9 +2,11 @@ function Node_Path_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) construc
name = "Path Shape";
setDimension(96, 48);
newInput(0, nodeValue_Vec2("Position", self, [ 0, 0 ]));
newInput(0, nodeValue_Vec2("Position", self, [ .5, .5 ]))
.setUnitRef(function() /*=>*/ {return DEF_SURF}, VALUE_UNIT.reference);
newInput(1, nodeValue_Vec2("Half Size", self, [ 32, 32 ]));
newInput(1, nodeValue_Vec2("Half Size", self, [ .5, .5 ]))
.setUnitRef(function() /*=>*/ {return DEF_SURF}, VALUE_UNIT.reference);
newInput(2, nodeValue_Rotation("Rotation", self, 0));

View file

@ -4,5 +4,16 @@ function nodeValue_Rotation_Random(_name, _node, _value, _tooltip = "") { return
function __NodeValue_Rotation_Random(_name, _node, _value, _tooltip = "") : __NodeValue_Array(_name, _node, _value, _tooltip, ROTATION_RANDOM_LENGTH) constructor {
setDisplay(VALUE_DISPLAY.rotation_random);
def_length = 5;
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) {
getValueRecursive(self.__curr_get_val, _time);
var val = __curr_get_val[0];
var nod = __curr_get_val[1];
if(!is_array(val)) return [ 0, val, val, 0, 0 ];
if(array_length(val) == 2) return [ 0, val[0], val[1], 0, 0 ];
return array_verify(val, 5);
}
}