From d5f1a61a6cc55817594a649935c210a4afde0d9c Mon Sep 17 00:00:00 2001 From: Tanasart Date: Thu, 16 Nov 2023 18:01:59 +0700 Subject: [PATCH] - Add 3D transform node. --- PixelComposer.resource_order | 2 +- PixelComposer.yyp | 2 +- objects/o_dialog_add_node/Create_0.gml | 3 +++ scripts/d3d_group/d3d_group.gml | 2 ++ scripts/node_3d_transform/node_3d_transform.gml | 11 ++++++++--- scripts/node_registry/node_registry.gml | 1 + 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index e3ac2806d..4e6084a46 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -127,6 +127,7 @@ {"name":"for sort","order":5,"path":"folders/nodes/data/iterate/for sort.yy",}, {"name":"lua","order":12,"path":"folders/nodes/data/lua.yy",}, {"name":"misc","order":10,"path":"folders/nodes/data/misc.yy",}, + {"name":"PC effects","order":24,"path":"folders/nodes/data/PC effects.yy",}, {"name":"PCX","order":15,"path":"folders/nodes/data/PCX.yy",}, {"name":"array","order":6,"path":"folders/nodes/data/PCX/array.yy",}, {"name":"flow control","order":7,"path":"folders/nodes/data/PCX/flow control.yy",}, @@ -240,7 +241,6 @@ {"name":"button","order":34,"path":"folders/widgets/button.yy",}, {"name":"rotator","order":35,"path":"folders/widgets/rotator.yy",}, {"name":"text","order":36,"path":"folders/widgets/text.yy",}, - {"name":"PC effects","order":24,"path":"folders/nodes/data/PC effects.yy",}, ], "ResourceOrderSettings": [ {"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index c996f990d..2c86ba583 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -155,6 +155,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"for","folderPath":"folders/nodes/data/iterate/for.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"lua","folderPath":"folders/nodes/data/lua.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/nodes/data/misc.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"PC effects","folderPath":"folders/nodes/data/PC effects.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"PCX","folderPath":"folders/nodes/data/PCX.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"array","folderPath":"folders/nodes/data/PCX/array.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"flow control","folderPath":"folders/nodes/data/PCX/flow control.yy",}, @@ -275,7 +276,6 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"button","folderPath":"folders/widgets/button.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"rotator","folderPath":"folders/widgets/rotator.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"text","folderPath":"folders/widgets/text.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"PC effects","folderPath":"folders/nodes/data/PC effects.yy",}, ], "IncludedFiles": [ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",}, diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index a81dee540..fa25925cb 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -409,6 +409,7 @@ event_inherited(); for(var index = 0; index < node_count; index++) { var _node = _list[| index]; if(is_undefined(_node)) continue; + if(is_instanceof(_node, NodeObject) && _node.is_patreon_extra && !IS_PATREON) continue; if(is_string(_node)) { if(!PREFERENCES.dialog_add_node_grouping) @@ -527,6 +528,7 @@ event_inherited(); for(var i = 0; i < node_count; i++) { var _node = _list[| i]; if(is_undefined(_node)) continue; + if(is_instanceof(_node, NodeObject) && _node.is_patreon_extra && !IS_PATREON) continue; if(is_string(_node)) { if(!PREFERENCES.dialog_add_node_grouping) @@ -678,6 +680,7 @@ event_inherited(); if(is_string(_node)) continue; if(ds_map_exists(search_map, _node)) continue; if(struct_try_get(_node, "deprecated")) continue; + if(is_instanceof(_node, NodeObject) && _node.is_patreon_extra && !IS_PATREON) continue; var match = string_partial_match(string_lower(_node.getName()), search_lower); var param = ""; diff --git a/scripts/d3d_group/d3d_group.gml b/scripts/d3d_group/d3d_group.gml index 2efbb23b9..bd8baf6e9 100644 --- a/scripts/d3d_group/d3d_group.gml +++ b/scripts/d3d_group/d3d_group.gml @@ -8,6 +8,7 @@ function __3dGroup() constructor { var _i = 0; for( var i = 0, n = array_length(objects); i < n; i++ ) { + if(!is_struct(objects[i])) continue; var _c = objects[i].getCenter(); if(_c == noone) continue; _v._add(objects[i].getCenter()); @@ -27,6 +28,7 @@ function __3dGroup() constructor { var _cc = getCenter(); for( var i = 0, n = array_length(objects); i < n; i++ ) { + if(!is_struct(objects[i])) continue; var _c = objects[i].getCenter(); var _b = objects[i].getBBOX(); diff --git a/scripts/node_3d_transform/node_3d_transform.gml b/scripts/node_3d_transform/node_3d_transform.gml index 9bd015f5d..0f2c9558f 100644 --- a/scripts/node_3d_transform/node_3d_transform.gml +++ b/scripts/node_3d_transform/node_3d_transform.gml @@ -11,9 +11,14 @@ function Node_3D_Transform(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _gro ]; static processData = function(_output, _data, _output_index, _array_index = 0) { #region - var _mesh = _data[in_d3d + 0].clone(); - setTransform(_mesh, _data); + var _mesh = _data[in_d3d + 0]; - return _mesh; + var _scene = new __3dGroup(); + if(!is_struct(_mesh)) return _scene; + + setTransform(_scene, _data); + _scene.addObject(_mesh); + + return _scene; } #endregion } \ No newline at end of file diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 54307e233..de6943752 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -522,6 +522,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio ds_list_add(d3d, "Modify"); addNodeObject(d3d, "Discretize vertex", s_node_3d_discretize, "Node_3D_Round_Vertex", [1, Node_3D_Round_Vertex]).setVersion(11560); addNodeObject(d3d, "Set Material", s_node_3d_set_material, "Node_3D_Set_Material", [1, Node_3D_Set_Material]).setVersion(11560); + addNodeObject(d3d, "Transform", s_node_3d_transform, "Node_3D_Transform", [1, Node_3D_Transform]).setVersion(11570); addNodeObject(d3d, "Transform Scene", s_node_3d_transform_scene, "Node_3D_Transform_Scene", [1, Node_3D_Transform_Scene]).setVersion(11570); addNodeObject(d3d, "UV Remap", s_node_uv_remap, "Node_3D_UV_Remap", [1, Node_3D_UV_Remap]).setVersion(11570); ///**/ addNodeObject(d3d, "3D Instancer", s_node_3d_set_material, "Node_3D_Instancer", [1, Node_3D_Instancer]).setVersion(11560);