Getting World Space Coordinates

Other than writing a script, is there a way (i.e. through the Studio UI) to obtain the world coordinates of a particular item?  (As opposed to the coordinates relative to its parent, which is what shows up in the UI?)

I've just been bitten by the "iRay doesn't render nicely away from the origin" pain-in-the-ass bug, and I need to shift things around so that deeply parented objects are near the origin.  The problem is figuring out where they are.  And I have more than one scene in which I have to do this.  Sigh.

(I guess I could un-parent "in place", write down the coords, and then "undo", but we know how long parenting and unparenting figures can take sometimes...)

Comments

  • I'm not exactly shure why you want the coordinates, do you want to manualy change the x and z coordinates of every single item in the scene? That sounds like you think of this too complicated.

    Why don't you simply create a Null or Group object with default settings? It will appear in the world center - the origin also primitives will be created there. This could be an visual orientation where the world center is.

    Otherwise while talking about groups, you could also parent all items and figures (in Place) to that group or even parent sub-groups to a master group and then move the whole scene with that, while watching for some other Null or primitive that stays unparented at the world center.

    If you are using the same environment /props in more that one scene you could save a Scene SubSet to load this modified set to the other scenes.

    You could also select everything that should be parented to the Group first and select the Automaticly Parent Selected Items in the create Group options, but I don't like that the Group created with this gets placed in the center of all items selected.

    If I work on scenes everything gets a group the lights, the cameras, the environment/props and every character so you can hide or move them easily by clicking the eye icon in the Scene pane, with this all parented items get hidden as well.

  • rames44rames44 Posts: 336

    I have situations in which my scenes consist of only 2-3 top-level groups, so, yes - the idea is that I want to alter the x/y coordinates of those items to bring a nested item to (0,0). (So it’s not too much trouble, once I know how far I need to offset things.) The trick is figuring out how far to shift them. And shifting all of them exactly the same amount so they stay in alignment. (Which is straightforward to do, since DS will accept math in the parameter settings.)

    So the trick is just finding the amount of offset to apply. My thought was that if I knew the world coordinates of the nested object, I just need to subtract the (x,y) values. But that requires knowing them.

    But your comment about using a null has suggested a solution - which is possibly a rephrasing of what you intended.  Create the null at (0,0) world coordinates, then parent it in place to the item I need to center. That should update the null’s coordinates to be the position, relative to the null’s parent, of the (0,0) point, which is exactly what I need. And that “parent” operation will execute very quickly. 

    So thank you for the suggestion.

    Alternately, maybe I’ll venture into DS scripting and write a “move everything to center this” script. Be a good exercise.

  • Alternatively, if this is for props that figures will hold (weapons, coffee cups, drum sticks, etc), you can put them in the scene and parent them to the figure before you move the figure to its final location.

  • Syrus_DanteSyrus_Dante Posts: 983
    edited September 2018

    Alternately, maybe I’ll venture into DS scripting and write a “move everything to center this” script. Be a good exercise.

    We wellcome every one who writes useful scripts for this software. I tried scripting myself, to easily export an OBJ of only what is selected with resolution set to base.

    But before you stat writing scripts have a look around what others already have done and what options you already have within DazStudio.

    I can highly recomment those Mcasual scripts I in the bottom list. Once you understand what each script does some common tasks in DazStudio might become easier.

    I wasn't thinking about parenting everything to a null in the center but I'm glad I could give you an idea. I was thinking about to move the whole scene in a variable offset to the world center for to have different render locations for iRay to work propperly. You could use the timeline pane to define keyframes for these render locations within the same scene file.

    You may want to turn off Parent in Place quickly to have the nulls, groups or any other item snap to the same position. I've palced those "toggle actions" like the Parent Items in Place to my top ToolBar to see its state immediately. Or you could have selected them and used Zero Selected Items from the main menu.

    You can even change the origin of any item by modifying the Center Point in the Joint Editor tool with the Tool Settings pane open.

    Figuring out this parenting and the offsets is one thing, using the various commands in DazStudio efficiently is another thing. I have customized the DazStudio interface to my needs for easier acces these important comands Zero, Memorize, Restore, Clear and Un-Lock by adding them to the main menu. You can also see the shortcuts I changed to quickly Memorize and Restore Figures and Items with F3 to F6. BTW the definition of Items includes all objects with or without geometry like props, cameras, lights, DFormer ect. even a selection of bone joints of a figure counts as items.

    With this its easier for me to select the right timeline frame then memorize the Figures/Items with F4 + F5 and select Clear Figure/Item in the menu.

    How to Customize Daz Studio - to speed up Workflow

    How to Customize Daz Studio - to speed up Workflow

     

    MCasual scripts for item placement:

    mcjJump for DS1,2,3,4

    mcjUnparentInPlace

    mcjComeHere

    mcjComethHere

    mcjDropToTop DS 1,2,3,4

    mcjDropToTerrain

    mcjPlaceUnder for DS 1, 2, 3, 4

     

    These have proven to become very useful for me:

    mcjHideAllBut

    mcjZeroOrigin

    mcjSelectTopParent

     

    For Animation purposes or working on the timeline (haven't tied all of them yet):

    UnAnimate / ReAnimate DS 1,2,3,4

    mcjMemorizeRestoreFigurePose

    mcjFreezeThings

    mcjFreezeMaterials

    mcjUnlock for DS 1,2,3,4

    mcjUnlockAllBones

    mcjAutoRange

    mcjRepeatAction

    CamSeq for DS 2,3,4

    mcjSlerp for DS 1,2,3,4

    mcjKeepOrient for DS 1,2,3,4

    PinMeDown for DS 1,2,3,4

    mcjShoesOnFloor

    mcjSelectCurrentCam

    Post edited by Syrus_Dante on
  • rames44rames44 Posts: 336

    I was thinking about to move the whole scene in a variable offset to the world center for to have different render locations for iRay to work propperly. You could use the timeline pane to define keyframes for these render locations within the same scene file.

    Yes, this is exactly what I’m doing - shifting the entire scene. The challenge as figuring out how much it needed to be shifted. 

    Thanks for all the references - I’m well aware of mCasual’s awesome work - I use several of his (her?) scripts regularly.  This just seemed like a good task for me to learn something about scripting, since it’s relatively straightforward. (Even if somebody had already done it. We all have to start somewhere, right? LOL)

Sign In or Register to comment.