Chain Link Fence Asset problem

   5348   9   1
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!
I was yesterday trying to see how works the “Chain Link Fence Asset” form old school blog (http://www.sidefx.com/index.php?option=com_content&task=view&id=688&Itemid=216 [sidefx.com]) -> hip file.
Unfortunately this asset doesn't work in houdini 10 (I was trying to figure how to fix it but I can't understeand why there appear errors)
(I've got right now problem with internet on my computer and I'm writing this post from my girlfriend's computer and I have now no houdini to exactly write the names where problem occurs)
So the error appears when we're trying to read the variables $TANGENTX, ..Y and ..Z, but when I middlemouse button the previous nodes I can see that there is mapping of TANGENT variable.

I would be very grateful for help and information why it doesn't work Thank you
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!
Once again I really please about help in this topic, so the exactly place where error appears is:
/obj/fence/chain_link_fence1/tangent1/
nodes:
point__tangent_in_normals
point__tangent_in_velocity
point__tangent_in_up

and the error is:
Unable to evaluate expression ( Undefined variable /obj/fence/chain_link_fence1/tangent1/point__tangent_in_normals/nx ,..ny, .. nz)

I don't understeand why Houdini doesn't see these variables. (I'm attaching the hip file too)

Attachments:
chain_link_fence_3dworld.hip (532.8 KB)

User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Having a brief look at the scene

1) tangent1 is an embedded asset , MMB on the node to see this.Dive inside

2)Node attribcreate__tangent_varmap creates an attribute called tangent , look its values

3 Information is being passed from the attribute create nodes through various switch nodes , if you look at the top level of the asset there is a menu control a choice for these switch nodes.

4) If you set the HDAs tangent Method to Accurate Tangents ( slower ) .Note a warning in the point SOP point__tangent_in_up goes away.

After this I really ran out of time to debug the assert further. I would next start to delete some of those menu choices. ie strip down the asset to the basics !

rob
Gone fishing
User Avatar
Member
678 posts
Joined: July 2005
Offline
Try this version. Added notes what changed. If it doesn't work by default, load added tangentOTL (but I think I chked "save definition to HIP, so it should work without additional loading).

Attachments:
chain.rar (107.5 KB)

User Avatar
Member
277 posts
Joined: July 2006
Offline
circusmonkey -> thank you.

Swann_ -> thank you very very much! it works great
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!
sorry, that I'm bumping this tread.
I'm happy that this file, which is send by Swann_ wokrs - but there the node named “tangent” is repleced by Swann_'s node.
My probelm is - that I simply don't undrsteand why this previous node doesn't worked well …
So lets consider the file I've send previously.
When I mmb click on the /obj/fence/chain_link_fence1/tangent1/switch_accurate_tangents
I see:

2 point attributes: tangent radial
1 Detail Attributes: varmap
—————————
custom variable mapping:
radial->RADIAL
tangent->TANGENT


so why the next node cannot evaluate expression
$TANGENTX
?


edit:
and it works when i write (after switching to python):
pwd().curPoint().attribValue('tangent')
so why it doesn't work with $TANGENTX ?
User Avatar
Member
678 posts
Joined: July 2005
Offline
If you look into details view, you will see that tangent is not writen as x,y,and z vector like P but as ,,.

Change X,Y,Z on the end of $TANGENT to 1,2,3 and it will work. Later you will see error in next node where $RADIAL will report error, do the same there (so change $RADIALX2 to $RADIAL12 etc).

What I'm curious is why this is no working as 0, 1, 2. Anybody ?
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
Swann_
If you look into details view, you will see that tangent is not writen as x,y,and z vector like P but as ,,.

Change X,Y,Z on the end of $TANGENT to 1,2,3 and it will work. Later you will see error in next node where $RADIAL will report error, do the same there (so change $RADIALX2 to $RADIAL12 etc).

What I'm curious is why this is no working as 0, 1, 2. Anybody ?


The above will give you correct access to this attribute, but… A tangent vector is really much more similar to a Normal, rather than a float attribute, so it really should be defined as a vector rather than a float. So what you actually want to modify is the vop network that creates the radial and tangent attributes.

Go into:
/obj/fence/chain_link_fence1/tangent1/build_tangent
and change the addattribute for tangent and radial to:
type modifier -> vector

Now the attributes will be treated as proper vector attributes rather than float.

This is why it is important:

For instance N (the normals of an object) or v (the velocity of an object) are both defined as vectors. Which means that in a transform node if you were to rotate your object (inside sops), the transformation matrix will also be applied to the normals, so the normals get updated (which is what you want for the tangents as well…).

So what a happens if it is a float:

For instance float can represent the color (Cd) of an object. Color is actually an exception because it is accessed with $CR, $CG $CB. But it is easier to visualize “the problem” with color. Imagine that color was also a vector. If you were to apply a rotation to the object with a transform (in sops), the transformation matrix will now be applied to the colors as well… this is bad. You want your colors to “stick” to your points. You do not want them to change as you rotate the object.



My guess as to why the attribute needs to be accessed as $MYCOLOR1, $MYCOLOR2, $MYCOLOR3, rather than $MYCOLOR0, $MYCOLOR1, $MYCOLOR2
is that $MYCOLOR0 is internally reserved. Perhaps it is used for the float or int version of an attribute, or perhaps it has to do with the way the varmap maps it. I do not know exactly either – perhaps somebody thought array arithmetic was a bad idea for an end user but I doubt it .
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
These days when it comes to tangents there's a better approach than using Jeff's old Tangent asset. You can now use the PolyFrame SOP. It does it all for you quickly, accurately and in a single operator.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
277 posts
Joined: July 2006
Offline
Thnak you
I know that now there are better ways to do these operations, but I'm trying to learn houdini and trying to see how can I make something like that without those operators
  • Quick Links