Jump to content
sortofsleepy

instancepoint() is undefined - ?

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

Share this post


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

Share this post


Link to post
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!

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

×