Pixel-Composer/scripts/node_3d_scene/node_3d_scene.gml

27 lines
801 B
Plaintext
Raw Normal View History

2023-08-14 19:22:04 +02:00
function Node_3D_Scene(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor {
name = "3D Scene";
2024-09-04 03:57:11 +02:00
newOutput(0, nodeValue_Output("Scene", self, VALUE_TYPE.d3Scene, noone));
2023-08-14 19:22:04 +02:00
2023-08-16 20:16:31 +02:00
object_lists = [];
2024-05-23 10:59:39 +02:00
static createNewInput = function() {
2024-08-08 06:57:51 +02:00
var index = array_length(inputs);
2024-08-18 09:13:41 +02:00
newInput(index, nodeValue_D3Mesh("Object", self, noone))
2023-08-14 19:22:04 +02:00
.setVisible(true, true);
2024-08-08 06:57:51 +02:00
return inputs[index];
2024-05-23 10:59:39 +02:00
} setDynamicInput(1, true, VALUE_TYPE.d3Mesh);
2023-08-14 19:22:04 +02:00
2024-10-20 04:12:27 +02:00
static processData = function(_output, _data, _output_index, _array_index = 0) {
2023-08-17 16:56:54 +02:00
var _scene = new __3dGroup();
2023-08-16 20:16:31 +02:00
2024-08-08 06:57:51 +02:00
for( var i = input_fix_len, n = array_length(inputs); i < n; i += data_length ) {
2023-08-17 16:56:54 +02:00
var _obj = _data[i];
if(is_instanceof(_obj, __3dObject) || is_instanceof(_obj, __3dGroup))
_scene.addObject(_obj);
2023-08-14 19:22:04 +02:00
}
2023-08-17 16:56:54 +02:00
return _scene;
2024-10-20 04:12:27 +02:00
}
2023-08-14 19:22:04 +02:00
}