Copy SOP & Instancing Attributes

   56527   17   15
User Avatar
Member
4256 posts
Joined: July 2005
Offline
Here is some centralized info on the Copy SOP and Instancing. (The help is lacking, and the information that does exist is a bit scattered.)

Copy SOP and Instancing
When you are instancing geometry onto points, (via the Copy SOP or during IFD generation on the Object's Render Tab), Houdini looks for specific attributes in order to build a unique transform for each piece of geometry being instanced.

Supported Attributes:
This is a list of the point attributes that are used with the Copy SOP and point instancing.

Attrib - Data Type
—————————–
orient - float4 (quaternion)
pscale - float
scale - float3
N - vector
up - vector
v - vector
rot - float4 (quaternion)
trans - vector


Axis Alignment and Positioning:
  • If the orient attribute exists, N, v, and up are ignored.

  • If the orient attribute does not exist:
  • The geometry's +z-axis is aligned to point down N or v.
  • If both N and v exist, v is ignored and N is used.
  • If the up attribute exists then the geo's +y-axis is aligned to it.

    Construction of the transform matrix is as follows:

    Key:
    O = orient matrix
    S = scale matrix (scale * pscale)
    L = alignment matrix (*)
    R = rot matrix
    T = trans matrix (trans + P)

    (*) The alignment matrix (L) is defined by N or v and up.

    IF N exists AND up exists and isn't {0,0,0}:
    L = mlookatup(N,0,up)
    ELSE IF N exists:
    L = dihedral({0,0,1},N)
    ELSE IF v exists AND up exists and isn't {0,0,0}:
    L = mlookatup(v,0,up)
    ELSE IF v exists:
    L = dihedral({0,0,1},v)
    END

    IF orient exists:
    Transform = O*R*S*T
    ELSE:
    Transform = S*L*R*T
    END

    Motion Blur:
    No Blur- No motion blur

    Velocity Blur- The shutter open transform is based off the Axis Alignment and Positioning stated above. For the shutter close transform the shutter open transform is used plus the vector v/$FPS * shutter_speed. In the cases where that you have N and a v attribute, N is used to align but v is still used to blur.
    Note: v is independent of the transform constructed for the Axis Alignment and Positioning. You can rotate, scale and skew all you want but v = (0,0,1) then your object will be blurred in the z direction.

    Transform Blur- Same as Velocity Blur but the Object level transform is also taken into account.

    Deformation Blur- The Axis Alignment and Positioning transform is constructed for both shutter open and close, the object level transform is also taken into account. This method is the most ‘accurate’.
Edited by - Oct. 11, 2007 23:19:43

Attachments:
Instancing.jpg (671.2 KB)

if(coffees<2,round(float),float)
User Avatar
Member
4256 posts
Joined: July 2005
Offline
I thought a follow up to the spam above was in order.

After having to deal with Point Instancing on an almost daily basis for quite some time I found myself wishing for some additional utilities to help debug and tune scenes. I had a little bit of free time over the weekend so I answered some of my wishes and I figured it would be nice to share. :wink:
  • VEX InstanceAttributes (SOP)
    This node can add any of the instancing attributes to your points. Its mainly a debugging tool since it doesn't support the $PT variable, which makes it hard to have different settings per point. However it is quite useful for quickly seeing how the attributes will affect your instanced geometry. In addition the input method for the rot and orient is easier since you can use Euler angles or a angle & axis instead of a straight quaternion.



  • VEX InstanceMatrix (SOP)
    This node reads all the instancing attributes then constructs a transform matrix that represents the same transform the Copy SOP applies to your geometry. The node can create this transform in two different ways. The first is a straight forward 4x4 transform matrix which you can use to multiply vectors with. The other output method is the ‘cracked’ version of this. It will create 3 vector attributes which represents Translate, Rotate and Scale. This is format is handy if you want to use the point() expression in conjunction with a Transform SOP. In addition you can output the matrix in one of three ways: Regular Matrix, Inverse Matrix and Inverse Transpose Matrix (for those pesky normals).



  • Extract Instance (Object)
    This is a object node that constructs the same transform as the Copy SOP at the object level. This is quite handy when you have a particle that you want to to turn into a Hero and alter it slightly. Since the transforms are taking place at the object level, just like when you are Point Instancing with Mantra, you can be confident that you are rendering the same thing as before. Quite often you try to convert a particle into a Hero using the Copy SOP you get shading issues since the transform is occurring in SOP land instead of Object Space.


Attachments:
InstanceMatrix.otl (33.3 KB)
Instancing.hip (134.6 KB)

if(coffees<2,round(float),float)
User Avatar
Member
321 posts
Joined: July 2005
Offline
Thanks for the ultra-clear and detailed explanation. I know what it takes to develop this kind of understanding about various parts of Houdini. Thank you for sharing.
Antoine Durr
Floq FX
antoine@floqfx.com
_________________
User Avatar
Member
7024 posts
Joined: July 2005
Offline
Wow, if only all of Houdini's docs were like this… Thanks Jim!

Cheers,

Peter B
User Avatar
Member
56 posts
Joined: March 2007
Offline
This is great! Gonna save the page to disk right after this post!

Alvin
User Avatar
Member
141 posts
Joined: July 2005
Offline
Thanks Jim for spending the time to write this up.

This post should be turned into a sticky until it's completely integrated in the online help!
/Rick
User Avatar
Member
575 posts
Joined: Nov. 2005
Offline
thanks jim for this real cool sumup. it helps a lot.
martin
User Avatar
Staff
462 posts
Joined: July 2005
Offline
Do you mind if I use this as the basis for the online help?
User Avatar
Member
4256 posts
Joined: July 2005
Offline
Go for it. Feel free to copy as much as you want.



Sadly I don't have the hip file that generated the above image any more. It got lost during one of my over zealous hard drive cleanings. :cry:
if(coffees<2,round(float),float)
User Avatar
Member
73 posts
Joined: Feb. 2006
Offline
The help page in 9.5 for the copy sop no longer has any of this very useful information.
:x
- resist or serve -
User Avatar
Member
519 posts
Joined:
Offline
It never had…just bookmark this page for future references.
User Avatar
Member
73 posts
Joined: Feb. 2006
Offline
Pagefan
It never had…just bookmark this page for future references.

There was some of it in the help in 9.0 and 9.1
This info is missing from the 9.5 help page.

Attachments:
houdinihelpcopy.png (54.9 KB)

- resist or serve -
User Avatar
Member
696 posts
Joined: March 2006
Offline
bug ID=32550
Stephen Tucker
VFXTD
User Avatar
Member
52 posts
Joined: July 2007
Offline
volume smoke example in doc disappeared too.
User Avatar
Member
73 posts
Joined: Feb. 2006
Offline
Allegro
bug ID=32550

v11 now, still missing…
- resist or serve -
User Avatar
Member
454 posts
Joined: July 2005
Offline
Great resource.
Still not in docs…
User Avatar
Member
10 posts
Joined: May 2017
Offline
Thank you for your information. this is so great.
I wish if side FX people add your post into official document.
User Avatar
Member
359 posts
Joined: April 2017
Offline
this thread is over ten years old. it's in the documentation now.
http://www.sidefx.com/docs/houdini/copy/instanceattrs.html [www.sidefx.com]
MOPs (Motion Operators for Houdini): http://www.motionoperators.com [www.motionoperators.com]
  • Quick Links