Godot: Distinguish between 2d and 3d scenes

Created on 16 Dec 2016  路  8Comments  路  Source: godotengine/godot

Currently, Godot uses the same format to store 3d scenes, making 2d scenes much larger than required, just because Node2D derivatives still have the 3D properties available but set to null. If they are separated, it could cut down on file size, and it wouldn't make much of an impact because very few people actually use 2D in 3D (or vice versa), except in techdemos. Another thing that could be done is engine.cfg could contain whether the project is for 2D or 3D, making them distinguishable in the project list.

archived discussion core

Most helpful comment

Is this a thing? Do you have an example? Node2D has no 3D base classes, there are absolutely no reasons it would have 3D stuff saved with them.

I don't see useless properties here, or maybe I misunderstood?

[gd_scene load_steps=2 format=1]

[ext_resource path="res://icon.png" type="Texture" id=1]

[node name="Node" type="Node"]

[node name="MeshInstance" type="MeshInstance" parent="."]

_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
layers = 1
geometry/visible = true
geometry/material_override = null
geometry/cast_shadow = 1
geometry/receive_shadows = true
geometry/range_begin = 0.0
geometry/range_end = 0.0
geometry/extra_cull_margin = 0.0
geometry/billboard = false
geometry/billboard_y = false
geometry/depth_scale = false
geometry/visible_in_all_rooms = false
geometry/use_baked_light = false
geometry/baked_light_tex_id = 0
mesh/mesh = null
mesh/skeleton = NodePath("..")

[node name="Sprite" type="Sprite" parent="."]

texture = ExtResource( 1 )

All 8 comments

I personally like current state, can combine 2d and 3d in one scene.
It would be disaster if I can't put 2d and 3d in the same scene.
even 3d game, 2d UI is necessary.

Is this a thing? Do you have an example? Node2D has no 3D base classes, there are absolutely no reasons it would have 3D stuff saved with them.

I don't see useless properties here, or maybe I misunderstood?

[gd_scene load_steps=2 format=1]

[ext_resource path="res://icon.png" type="Texture" id=1]

[node name="Node" type="Node"]

[node name="MeshInstance" type="MeshInstance" parent="."]

_import_transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
layers = 1
geometry/visible = true
geometry/material_override = null
geometry/cast_shadow = 1
geometry/receive_shadows = true
geometry/range_begin = 0.0
geometry/range_end = 0.0
geometry/extra_cull_margin = 0.0
geometry/billboard = false
geometry/billboard_y = false
geometry/depth_scale = false
geometry/visible_in_all_rooms = false
geometry/use_baked_light = false
geometry/baked_light_tex_id = 0
mesh/mesh = null
mesh/skeleton = NodePath("..")

[node name="Sprite" type="Sprite" parent="."]

texture = ExtResource( 1 )

My understanding of Godot is same with @Zylann
Godot has different base class for 2D and 3D.
What kind of 3D only property can you access with 2D nodes?

Don't have one to hand, but 2D objects have null in the transform. Seems to work fine, just an extra few bytes. I'll check to see if there's any certain condition when this happens, and put up a file when I can (at school at the moment)

@geordieF Were you able to put that file up. (pretty bump)

First of all thank you for your report and sorry for the delay.

We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.

We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about it here?

For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.

Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.

Thanks in advance.

Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.

Is this issue still relevant? As of 3.1, default properties are no longer saved in scene files, making them smaller.

Doesn't seem relevant anymore, and the original issue is unclear too. 2D nodes do not include 3D-specific properties.

Was this page helpful?
0 / 5 - 0 ratings