Origin points in exports

How are people handling exporting instances from Open Brush to Unity? Is there a way in Open Brush to export the transforms of grouped objects? Say I draw an object made up of a few strokes (like the smiley face here) and I group it and duplicate the group a bunch of times in my scene, how can I export a list of transforms so that in Unity I can swap them for prefabs? I'm noticing that when I export a sketch, the JSON metadata file includes raw transforms for imported models, but not for meshes that I draw within Open Brush. I also notice that groups inside FBX and GLB files all have frozen identity transforms, so the data isn't there. Perhaps the data is saved in another format?
No description
4 Replies
andybak
andybak12mo ago
That's a good question. I'm currently working on revamping the exporter and possibly adding some more functionality to the Unity SDK/toolkit. Adding transforms to groups is a bit tricky on export as groups don't currently really "exist" in the scene at runtime. I'm leaning towards handling this during import. Layers on the other hand will be much simpler to work with as they are pretty much just a mirror of the internal scene hierarchy With the current exporter, groups are preserved as gameobjects (if I recall correctly?) so you could just reset the pivot for each game object. (as I type this I just realised that will only give you translations - not rotations or scale changes)
davidbk
davidbkOP12mo ago
I didn't know about the Unity SDK and toolkit so I will check that out and do a test. When I was looking at the exported fbx and glb files in Blender, I did see that groups were preserved, but the transforms on these groups had position and rotation set to zero, scale set to one. Perhaps the Unity SDK behaves differently. I will get back to you.
andybak
andybak12mo ago
I'm pretty sure it doesn't. But it should....
davidbk
davidbkOP12mo ago
I added the Unity SDK Package to a my Unity project and imported a .glb file hoping to see transforms on the groups, but unfortunately all transforms were set to zero. Then I tried one of the toolkit scripts geometry_json_to_fbx.py, thinking it might retrieve additional data in the file, but no luck there either, all the transforms were set to zero. I tested a number of other export formats in both Blender and Unity (FBX, OBJ, USD) and none of them seem to have any transform data on groups. As far as I can tell, this data isn't being saved out anywhere. I just posted a feature suggestion here: https://discord.com/channels/783806589991780412/1189764827539836938 I'd love to see this feature included in a future build. If there's anything I can do to move this issue along, offering testing or otherwise, let me know. I worked on a script in the past that did something similar from Gravity Sketch to Unreal Engine, if that is any use. I think GS has a switch on export to use Groups or Layers for the scene hierarchy.
Want results from more Discord servers?
Add your server