Import .obj from Blender with proper origen and axis?

lukon100lukon100 Posts: 818

Is there a totorial explaining how to transfer a model from Blender to Daz Studio via .obj format and have the Blender defined object origen be the pivot points for rotation in Daz Studio?

And also get the axis translation right?

Post edited by lukon100 on

Comments

  • lukon100lukon100 Posts: 818

    Here is an attached screen shot of my immediate problem. It shows my .obj wheel loaded into DAZ Studio with the pivot point (in green) on the floor instead of the rotation axis of the wheel.

    I know I can fix this with the Joint Editor. But I'm hoping to offer this wheel as a freebie for others. And I'm worried that when others download the wheel and put it in DAZ Studio, they too will have the axis of rotation in the wrong place. And few DAZ Users know about fixing this in the Joint Editor.

    Off Center Problem.jpg
    1280 x 1024 - 458K
  • The only way I have found for static objects that you don't intend to rig is to place a null object where you want the pivot point to be and then parent the object (your wheel) to the null.  Now rotate/translate the null object.  Sadly, there's no easy way to locate the 'center of mass' of an object in DS to place your null object at (or the center point of a bone for that matter).

  • lukon100 said:

    Here is an attached screen shot of my immediate problem. It shows my .obj wheel loaded into DAZ Studio with the pivot point (in green) on the floor instead of the rotation axis of the wheel.

    I know I can fix this with the Joint Editor. But I'm hoping to offer this wheel as a freebie for others. And I'm worried that when others download the wheel and put it in DAZ Studio, they too will have the axis of rotation in the wrong place. And few DAZ Users know about fixing this in the Joint Editor.

    Adjust the origin, then File>Save As>Support Assets>Figure Prop Asset - the names you enter in the Options dialogue will determine the names of the folders in the /data folder, you need those and the preset you saved in the file dialogue (and any textures, but not the OBJ) in the zip you share.

  • 3WC3WC Posts: 1,114

    It is best to change it in Blender before import. You can probably still change it, then just go to Scene tab in DS, right click, Edit/Geometry/Update Base Geometry.

  • lukon100lukon100 Posts: 818

    Thanks Richard.

    I presume your recommendation produces a DAZ Studio specific formated asset, instead of an .obj formatted file that other programs can use. And that's cool. I'd like to include a DAZ Studio specific version in my download .zip.

  • lukon100lukon100 Posts: 818
    edited November 2018

    Thanks 3DC.

    Do you happen to know how to change it in Blender as you suggest? I'm a Blender newbie and lack knowlwdge of many things.

    Here is what it looks like in Blender:

    Off Center Problem 2.jpg
    1280 x 1024 - 565K
    Post edited by lukon100 on
  • lukon100lukon100 Posts: 818

    place a null object where you want the pivot point to be and then parent the object (your wheel) to the null.

    Thanks andya.

    Ya. I do that all the time in my own image composition work. I download a lot of free things with pivot axes in the wrong place or flipped. And I have to parent them to nulls all the time.

    I just don't want people who download MY thing to have to do that.

  • lukon100 said:

    Thanks Richard.

    I presume your recommendation produces a DAZ Studio specific formated asset, instead of an .obj formatted file that other programs can use. And that's cool. I'd like to include a DAZ Studio specific version in my download .zip.

    Yes, that's right.

  • lukon100 said:

    Do you happen to know how to change it in Blender as you suggest? I'm a Blender newbie and lack knowlwdge of many things.

    It looks as if you have the origin at the center of the geometry.  DS always seems to place the pivot point at the middle of the bottom 'face' of the bounding box.  You can move the origin in Blender to the 3D cursor, and with Object->Transform-Origin to 3D Cursor available in object mode you can therefore move the origin to anywhere you can put the 3D cursor.  A useful method to place the origin somewhere on the mesh is to select a vertex in edit mode, then do Shift+S and choose Cursor to Selected.  The 3D cursor is now at your selected vertex, and you can tab into object mode to use Origin to 3D cursor.

    But as far as I am aware, DS will pretty much ignore the position of the origin on an importe OBJ unless there is import option I have overlooked.

  • lukon100lukon100 Posts: 818

    "DS will pretty much ignore the position of the origin on an imported OBJ"

    So there's no fix for this.

    But here's a work-around I'm gonna try:

    I will include nulls in my .obj model download. One null for steering. And the other for spinning. And I'll possibly have them parented: Steering Null>Spinning Null>Wheel Rim

  • See my post here Altering G3 or G8 mesh in Blender.

    This should answer the question about the axis translation. You flip it around in Blender Import and Export. In Blender the Z axis is Up while in DazStudio the Y axis is Up.

    About the issue with the origin point, I see the rim object in Blender is centered to the world center thats fine. Now if you import this to DazStudio the position didn't change and you can go to the Tool Settings pane with the Joint Editor tool selected and zero the origin / pivot point there its called Center Point and is represented as a green dot in the viewport.

    [Quote] Move object to center of another object

    By importing geometry with OBJs into DazStudio the "origin point" (Joint Editor > Center Point of Item Root Node - the red no its the green dot in the viewport) will be automaticly placed at the bottom of the geometry and not at the world origin (the zero point) as you may think.

    If this isn't what you want use a script like this mcjZeroOrigin.

    It's a little handy timesaver if you don't like to go into the Tool Settings pane with the Joint Editor tool active and type the zeros in there. I'm not shure but you may want to use Memorize Rigging from the Geometry Editor right-click at viewport menu after that to have the new origin point memorized as default value.

    /*================================================================================Source code it's as simple as...================================================================================*/var node = Scene.getPrimarySelection();if( node ) {   beginUndo();   node.setOrigin( DzVec3( 0, 0, 0 ) );   acceptUndo( "mcjZeroOrigin" );}

Sign In or Register to comment.