Genesis object parts are always null. Why?

var node = Scene.getPrimarySelection();
var object = node.getObject();

If currently selected object in scene is "Genesis", it works fine;
But if I select any of the parts, like "Hip", object returns is null all the time.

Is that a bug? How come Genesis parts have no obects with them associated? I tested the same for Genesis 2 and other body parts. And the worst thing is - I remember that it worked before >____< I'm under latest Daz Studio 4.6

Post edited by assignator_da12fd057f on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,949
    edited December 1969

    Figures are single skin, even imported legacy figures - the mesh belongs to the root node, such as Genesis, not to a bone. You would need something like

    var node = Scene.getPrimarySelection();
    var object = node.getObject();
    if ( node.inherits( "DzBone" ) ) {
         var fig = node.getSkeleton();
         if ( fig ) {
              object = fig.getObject();
         }
    }
  • edited January 2014

    Thanks for the reply!!! Actually, I already did try that and many other ways using scripts which I had found on this forum archives.
    The reason is - there is NO WAY to get object of subpart;

    "getSkeleton" will always return the root, I tried it.


    I even tried going other way - collectig all scene metarials, and traversing into their shapes, hoping to get node names which uses those shapes. Same result - no WAY to get node from the shape (in docs I can see getNode() function, but in reality it does not exist).

    OMG, I'm really stuck here >____<</p>

    Post edited by assignator_da12fd057f on
  • Richard HaseltineRichard Haseltine Posts: 100,949
    edited December 1969

    Ah, thought you problem was simply getting the OBJ. No, you can't get the object for a body part directly - there may not be mesh specific to a body part, though usually there will be (if the item was originally a Poser figure, or if it is made to work in Poser with the DSON Importer for sure). If you get the shape from the group, check it's a PolyShape, get the PolyMesh from that, then you can work through the FaeGroups I think - however I seem to recall there have been changes in the workflow in DS4 (I'm looking at the DS3 docs right now), and I'm not off hand sure where you'd get the selection group for the mesh which is the thing that will be tied to a bone.

  • edited January 2014

    Hmm, I see. From my end, I traversed every single property I can in the docs, but just couldn't find a way to those damn surfaces. It must be some huge design mistake >_< But hope is not lost, I'll look into those PolyShapes, thanks :)

    Still, I want to undetstand the theory behind this.


    Hip is a body part. But not an object. Its a node without object. But it has geometry and shape. Correct?
    So, basically, Daz Studio missed a function, which allows to get shape directly from node? And, because body parts are nodes without objects (?), I can't workarund it?

    I just wonder, how Daz studio does it internally >_< I can't even traverse to node label from material->shape->node, because shape function getNode() is absent in application, while it is in docs.

    Post edited by assignator_da12fd057f on
  • edited January 2014

    I see now, that going other way around:

    
    var mat = new DzShaderMaterial; 
    var n = mat.getNumMaterials(); 
    var aMList= new Array(); 
    for (var i = 0; i 0)
       {
        print(shapes[0].className()); //DzGraftingFigureShape
       }
    } 
    
    ....
    

    I am getting DzGraftingFigureShape, but this class is not documented in 4.6 :/

    EDIT: Ah, don't mind, I can just look throught C++ header files;
    EDIT2: Dead end :/ It leads to DzFacetShape , which leads to GzGeometry, and no object or node for me again.
    EDIT3: Sight, I give up.. DzGraftingFigureShape extends DzFacetShape which extends DzShape which has DzNode* getNode(); defined in C++ header, and still shapes[0].getNode() yield undefined;

    Post edited by assignator_da12fd057f on
  • JonnyRayJonnyRay Posts: 1,744
    edited December 1969

    It seems to me that part of the problem may be in how you're thinking of the rigging of bones in relation to the mesh object. There is only one object mesh for the figure. The bones control portions of that mesh, but there is no specific mesh attached to the bone.

  • edited December 1969

    Oh, now it totally makes sense. What I tried to accomplish was doomed from the start. I'll try to think of other way of setting specific body parts not visible to the renderer, when custom shaders are used and default setVisibleInRender option is not working. Here I was thinking to do it via surface opacity, but now I see that I can't get surface this way.

Sign In or Register to comment.