Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

ChristopherC

$OBJID variable

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.

 

post-12907-0-55872800-1435661226_thumb.g

 

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

Share this post


Link to post
Share on other sites

$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.

Share this post


Link to post
Share on other sites

Yeah so the ground plane would be dop object zero...

You can also use objscreatedby() to return the dopobject of the particles object.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now