Ttanasart-pt / Pixel-Composer

Node base VFX editor for pixel art.
MIT License
681 stars 30 forks source link

[Bug] (1.1.0.1) Crash When Connecting Surface Output to Gradient Data Node's Sample Input #29

Closed Synthoid closed 1 year ago

Synthoid commented 1 year ago

Connecting a surface output to the Gradient data node's Sample input connector throws the error below and causes a crash. I've also included an example file and a screenshot of the affected nodes.

___________________________________________
############################################################################################
ERROR in
action number 1
of  Step Event1
for object o_main:

Illegal array use############################################################################################
gml_Script_gradient_eval (line 49)
gml_Script_anon_Node_Gradient_Out_gml_GlobalScript_node_gradient_output_666496_Node_Gradient_Out_gml_GlobalScript_node_gradient_output (line 28)
gml_Script_anon_Node_gml_GlobalScript_node_data_3360314_Node_gml_GlobalScript_node_data (line 159)
gml_Script_Render (line 79)
gml_Object_o_main_Step_1 (line 40)

Nodes Involved:

image

ProceduralTest.txt

Ttanasart-pt commented 1 year ago

You shouldn't be able to do that... sample property is use to get a single color from a position in gradient [0-1]. Connecting surface to it shouldn't do anything.

The crash is probably caused by surface-number conversion. I will make it so the sample property reject surface datatype.

Synthoid commented 1 year ago

Makes sense. I was experimenting with different ways to apply color gradients and was expecting the connection to be rejected like you said. I believe a similar crash occurred when attempting to connect a surface output to a Vector split node.

Synthoid commented 1 year ago

Both crashes are fixed in 1.11.0