Implement 3D layers#840
Conversation
… top when exporting
Seems like they were created when I copied from the old 3D Options.tscn panel to the new 3D Shape Edit tool.
Torus isn't currently supported in Godot 3.5, but it is in 3.6 and 4.0, so this is just future-proofing. May break compatibility with .pxo files that were exported with 3D layers before this change.
| elif layer is GroupLayer: | ||
| layer_image.copy_from(layer.blend_children(frame, Vector2.ZERO)) | ||
| elif layer is Layer3D: | ||
| layer_image.copy_from(frame.cels[export_layers - 2].get_image()) |
There was a problem hiding this comment.
I think this part could probably be:
if layer is GroupLayer:
layer_image.copy_from(layer.blend_children(frame, Vector2.ZERO))
else:
layer_image.copy_from(frame.cels[export_layers - 2].get_image())
right?
There was a problem hiding this comment.
Right, I changed it.
| continue | ||
| if layer is PixelLayer: | ||
| var cel: PixelCel = frame.cels[layer.index] | ||
| if layer is PixelLayer or layer is Layer3D: |
There was a problem hiding this comment.
Something like if not layer is GroupLayer might be nicer to make it not need every other layer type, but I guess it doesn't work because of the comment "Only if layer is GroupLayer, cannot define this due to cyclic reference error" on the else below. Does doing if not layer is get_script() work? If it does I guess the condition should be flipped to not have not in front
There was a problem hiding this comment.
Yup, it seems to be working. I changed it.
Can occur when multiple cels are selected, some of them 3D and some of them pixel
Breaks compatibility with previous .pxo files that had 3D layers. Also introduces serialize() and deserialize() methods to BaseCel
Regression from c2f6bf0
…gic to 3DShapeEdit
This makes importing projects with 3D layers to other software, such as Godot using godot_pixelorama_importer easier.
…en it got removed with undo
Leftovers from even before #840 was merged.
Bringing the power of Godot's 3D engine into Pixelorama. Introducing a new layer type, 3D layers! 3D layers allow for the usage of 3D objects into Pixelorama, in 2D space. They get automatically pixelated, depending on the size of the canvas. Artists can now use a variety of 3D shapes, including boxes, spheres, capsules, cylinders, prisms and even 3D text! It is also possible to import custom .obj models (thanks to gd-obj). For lighting, you can use directional lights, spotlights and point lights.
Current features include:
This PR also makes the following changes:
To-do:
Future improvements outside the scope of this PR:
(The above image is a sphere object, illuminated by a directional light. I merged it into a pixel layer, and applied a Gradient Map with constant interpolation on it to achieve this effect. Not the best workflow at the moment, but it will improve tremendously when Layers FX are implemented.)