Jump to content

$OBJID variable


ChristopherC

Recommended Posts

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

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...