Jump to content

instancepoint() is undefined - ?


sortofsleepy

Recommended Posts

Hey all, 

Just starting my journey into Houdini after years doing Processing, Cinder, oF, trying to learn the basics and figure out certain things I was doing via code, but in Houdini.

First thing I thought I'd try is instancing and I'm already off to a bit of a bad start ha. 
I have instances of my geometry all set up with and instance node and I'm trying to pass per-instance attributes to each instance. 

However, whenever I call `instancepoint` in an attribute wrangle, Houdini errors out and tells me `instancepoint` is undefined. 

Can someone point me in the right direction? As far as I can tell the function hasn't been deprecated or anything like that.

Thanks!

Edited by sortofsleepy
clarification
Link to comment
Share on other sites

Hi and welcome on odforce planet!

There are a couple of gotchas here, which is easy since lots of Houdini's functionality evolves with time and/or overlap with each other:

1) pointinstance() is a hscript expression function, not VEX one, so you can't use it in an attribute wrangler. 

2) You can't also use it in any parameter in SOP level, as stipulated in docs. It is meant to be used on /obj level to vary instance parameters (mostly xfrom. 

3) It's an oldish method dealing with instancing (described here), good for things like planting trees or houses with limited variations and in moderate number. If you want to explore instancing using geometry (points) attributes  you might try to play with packet primitives. Here's link with general explanation and here are details about using point attributes to transform packet prims. 

4) Strictly speaking the attributes described in last link should work also with the Instance Object (instances will be oriented according to point attributes), but it's less interactive than using CopytoPointSOP and packet prims. Technically instances generated by InstanceOBJ are evaluated in soho prior to render phase, and support for them in the viewport is limited. Bottom line is: packet prims == more fun.

skk.

 

ps setting transformation attribute in VEX can be done "manually" as described in last link or more in common with CopytoPointSOP with new instance() method. 

Link to comment
Share on other sites

2 hours ago, symek said:

Hi and welcome on odforce planet!

There are a couple of gotchas here, which is easy since lots of Houdini's functionality evolves with time and/or overlap with each other:

1) pointinstance() is a hscript expression function, not VEX one, so you can't use it in an attribute wrangler. 

2) You can't also use it in any parameter in SOP level, as stipulated in docs. It is meant to be used on /obj level to vary instance parameters (mostly xfrom. 

3) It's an oldish method dealing with instancing (described here), good for things like planting trees or houses with limited variations and in moderate number. If you want to explore instancing using geometry (points) attributes  you might try to play with packet primitives. Here's link with general explanation and here are details about using point attributes to transform packet prims. 

4) Strictly speaking the attributes described in last link should work also with the Instance Object (instances will be oriented according to point attributes), but it's less interactive than using CopytoPointSOP and packet prims. Technically instances generated by InstanceOBJ are evaluated in soho prior to render phase, and support for them in the viewport is limited. Bottom line is: packet prims == more fun.

skk.

 

ps setting transformation attribute in VEX can be done "manually" as described in last link or more in common with CopytoPointSOP with new instance() method. 

AH.. gotcha, that unfortunately wasn't immediately clear.

Thanks for taking the time to explain things!

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