use 3d reference model as exactly-positioned reference scene

Is there a way to import a reference model not as a moveable/scalable reference but as a fixed "scene" to sketch over? Alternatively, when adding a reference 3d model to a sketch, have its position and scale set from the original model's origin/scale? My current workflow is using unity realtimeCSG to rough out a scene/collision mesh, export the model as FBX, import into OpenBrush, and then try to roughly match the scale. Then I add brush embellishment, export the sketch from OpenBrush back into unity, and manually re-align the brush strokes to my original CSG mesh. I figure I can probably edit the sketch file with the reference mesh in it to exactly position/scale it, but wondering if there's an easier way.
8 Replies
hiina7736
hiina77362y ago
FTR, it is possible to edit the imported model transform back to 0,0,0 and 1.0 scale, here just with vim. However, since the format is based on zip (https://docs.openbrush.app/developer-notes/open-brush-file-format) you have to be careful to keep the length the same, which is easiest by replacing any long decimals with all zeroes (then opening/resaving the sketch in openbrush to reserialize back to nice numbers).
andybak
andybak2y ago
That's clever but there's probably easier ways to achieve that. The API should be able to do it (if not - i need to fix it!) https://docs.openbrush.app/user-guide/open-brush-api Snapping really helps to accurately position imported models but scale doesn't currently snap. And "pinning" is useful to avoid accidentally moving them: https://docs.openbrush.app/user-guide/using-the-open-brush-tools-quick-tools-and-menu-panels#model-pin
hiina7736
hiina77362y ago
hmm, glancing through the api I see an import.model, but how do you translate/scale the resulting model to 0,0,0, 1x scale? ( and model Y to world Y i guess). I did find the pinning, which is helpfully in the metadata.json (pinStates).
andybak
andybak2y ago
hmm, glancing through the api I see an import.model, but how do you translate/scale the resulting model to 0,0,0, 1x scale?
That might be in the beta or my working branch. Coming soon! (i really need people to nag me about missing API features. There's so few of us using it and I rarely get feedback from people)
hiina7736
hiina77362y ago
sounds good. in this case however, I dunno if I really want an api. I feel like it's more of a "custom scene" functionality. like instead of the "pedestal" scene I want my custom model. or potentially like a whole gltf scene graph, fixed in place. Whatever it takes for this "openbrush embellishment" workflow I have. "import model as sketch starting point" perhaps.
andybak
andybak2y ago
We're talking about "easiest way to get around a missing feature" and I guess I'm saying "using the API is probably easier than editing the tilt file" (rather undermined by the fact that the API command is currently missing too 😉 ) thing is - I can add a missing api command usually pretty quickly - adding a proper user-facing feature is a bit harder as it has to meet higher standards. Now - in terms of the missing proper user-facing feature - that's a separate discussion. we've got lots of plans for improved 3d model support but we need to get the next release out of the way first. It's got me thinking though.
andybak
andybak17mo ago
Marking this as "solved" as it's not a bug per se. This will help with positioning and it should be part of the beta fairly soon: https://docs.openbrush.app/alternate-and-experimental-builds/transform-panel - if you think there's anything additional then feel free to post to #feature-suggestions
andybak
andybak17mo ago
@hiina7736 ☝️