ChristopherC Posted June 30, 2015 Share Posted June 30, 2015 Hey! I've got difficulties in understanding the values returned by the `OBJID` variable and such. I've set up a simple scene to illustrate my problem. The DOP network contains a `POP Object` named `particles` that sources 10 points from the SOP level, as well as a `Static Object` named `ground` that sources a box made of 200 points. In the DOP network, there is an expression on the null that counts the number of points passed in the `particles` object using the `$OBJID` variable. I intuitively expect it to point to the `particles` object but instead the expression returns the number of points from the ground, that is 200. As far as I understand, the `popsource1` data branch should only be applied to the `particles` object, so why does the `OBJID` variable seems to return the `ground` object? How can I get this simple expression to work without having to use the object name, which might not be unique? Thanks! objid.hipnc Quote Link to comment Share on other sites More sharing options...
pbarua Posted June 30, 2015 Share Posted June 30, 2015 $OBJID returns dopobject's(all the dops under Objects tab menu) ID. POPOBJECT is a single dop so you will get OBJID based on number of object in dop network in order from left to right. You can't get number of points using $OBJID. Quote Link to comment Share on other sites More sharing options...
Annon Posted June 30, 2015 Share Posted June 30, 2015 Yeah so the ground plane would be dop object zero... You can also use objscreatedby() to return the dopobject of the particles object. Quote Link to comment Share on other sites More sharing options...
ChristopherC Posted June 30, 2015 Author Share Posted June 30, 2015 Thanks for the answers! I didn't know about the left-to-right ordering, that's good to know! In the past I've successfully used the `dopobjscreatedby` function in the `Object Merge` tab of the `Dop Network` node, but it doesn't seem to work when used inside a string parameter of my null object. And even if it did, I'm not sure how to use it with `Copy Objects`. To illustrate this, I've attached another scene—basically I'm trying to source only a group of particles depending on the copied object number (`CopyInfo/copynum`), which (I think?) needs to be referenced using the `dopoption` function and the `OBJID` variable. Unfortunately, this doesn't seem to work (there should be an object with 4 points and another with 6). Is this some kind of limitation to be aware of or am I missing something? Note that I could instead delete the particles in a `SOP Solver` but I would prefer another approach if possible (especially since I might have other uses for it). I can't even figure out how to postfix the name of each copy of the `particles` object with the copy number. objid-2.hipnc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.