guillaumechereau / goxel

Goxel: Free and Open Source 3D Voxel Editor
GNU General Public License v3.0
2.83k stars 226 forks source link

Request: Ability to specify the pivot point per layer. #335

Open jerobarraco opened 10 months ago

jerobarraco commented 10 months ago

What the title says. and also let that pivot point be at points smaller than a cube. e.g. the center of a cube, or top-center.

guillaumechereau commented 10 months ago

Trying to implement this now, I am thinking of putting this in the 'move' tool, so we can set it when we apply rotation or scale. Would that work for your use case or you had something else in mind?

jerobarraco commented 10 months ago

Hmm i'm not trying to move it. let me explain: I'm making these characters (and other composite objects) using layers. i need to have them as separate meshes so that i can manipulate in game. when importing to unreal they get put on different meshes (good). if i dump the meshes on the level, they get the correct position (kinda good). BUT the origin of each mesh is the same. (e.g. 0,0)

i know each mesh can have it's origin (pivot) set to an arbitrary place. and currently i do that in ue. but everytime i re-import the mesh (due to a change in the gox file) i have to re do. and would be also easier to do on goxel (i think). i had a video where i actually went through that process but i can't find it atm.

guillaumechereau commented 10 months ago

Ok I think I understand. I’ll try to add a layer origin that’s taken into account during gltf export.

On Sun, Jan 14, 2024 at 1:20 PM Jeronimo Barraco-Marmol < @.***> wrote:

Hmm i'm not trying to move it. let me explain: I'm making these characters (and other composite objects) using layers. i need to have them as separate meshes so that i can manipulate in game. when importing to unreal they get put on different meshes (good). if i dump the meshes on the level, they get the correct position (kinda good). BUT the origin of each mesh is the same. (e.g. 0,0)

i know each mesh can have it's origin (pivot) set to an arbitrary place. and currently i do that in ue. but everytime i re-import the mesh (due to a change in the gox file) i have to re do. and would be also easier to do on goxel (i think). i had a video where i actually went through that process but i can't find it atm.

— Reply to this email directly, view it on GitHub https://github.com/guillaumechereau/goxel/issues/335#issuecomment-1890851474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2JH64RZ342XV25ZIYD4DYONTINAVCNFSM6AAAAABBKUSOL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJQHA2TCNBXGQ . You are receiving this because you commented.Message ID: @.***>

jerobarraco commented 10 months ago

thanks a lot, that sounds good. a visual indicator of where the point lies in the scene would be good. (like a dot in the scene).

just for clarification here are some more info

Char07.g.zip (C) jeronimo barraco-marmol 2023

here's in goxel image

imported on ue image

here's the structure, and how things are parented in ue. notice where the 3 arrows are shown in the main viewport that's the pivot for the arm and where it rotates around image

and this is the tool i use inside ue to modify the pivot. I have to manually do this piece by piece and it's cumbersome. and once i re-import the model i loose the changes. image

jerobarraco commented 10 months ago

Also that tool is available only on ue 5.2+ which, despite being counter-intuitive, a lot of professional projects still are stuck on older versions.

thanks a lot for the help and the hard work. the bugs (vertex glitches and colors glitches) are the most important for me and then this is my next priority in case you want to know.

guillaumechereau commented 10 months ago

I started to work on the pivot support. Added some inputs to specify the origin in the move tool:

Screenshot 2024-01-17 at 5 18 16 PM

Still very experimental.

jerobarraco commented 10 months ago

I'll give it a try thanks! It would be amazing to have a floating point for the origin. so that it can be centered at a voxel. i do need to do that often. at least to be centered (or aligned to an axis' center)

jerobarraco commented 10 months ago

for example image image

jerobarraco commented 1 month ago

I've tried this on 1.51 AppImage but after exporting the pivot seems to be at the origin again. Maybe i don't understand how to use this functionality.