Jump to content

getattribute function in houdini ...........


Recommended Posts

hi evryone i want to know if there are some function in houdini like the getattr in maya and i need this function to make the wheel rotating when it move so i need to get the position in the previose fram

thanks for all.........................................

Link to comment
Share on other sites

Guest Swann

hi evryone i want to know if there are some function in houdini like the getattr in maya and i need this function to make the wheel rotating when it move so i need to get the position in the previose fram

thanks for all.........................................

You can get attrib from previous frame with help of timeshiftSOP. Then use expresion like point(), prim(), detail() to extract it. In attached file last node shows actual position and position in previous frame.

previousFrame.hipnc

Link to comment
Share on other sites

Guest Swann

I supose something like this should work. Just extracted global position with origin() expression and drives with it some object on SOP level. There you can measure like in previous example position now and before with timeShift.

origin.hipnc

Link to comment
Share on other sites

you can use chf() and cht() to access channel at different frame/time

or bring it to CHOPs where you have curve for the whole animation range

it however depends on how you want to use it, because i don't thing that recursive usage is allowed e.g. if you want to use previous frame of the same channel to calculate next, but you can use DOPs for that

Link to comment
Share on other sites

oh, i've now noticed your intention

you can use CHOPs especially Slope CHOP to calculate velocity of moving object, then use that to calculate rotation amount, it should be fairly easy

but chf() should work great as well

Link to comment
Share on other sites

you do not heed to use chopf() if you are using it with $F, just use chop()

if you are using chop() or chopf(), do not export from chops, those are two different things, you can either export channel, or import with chop() expression

here is example file with two possible solutions to your problem

one using chops to calculate driven distance and using that to calculate rotation

second is using position parameter of your path constraint and total length of the curve to calculate distance

for traveling along path the second method is better since backward motion will work as well and you need less nodes

however if you don't have path but animating position other way, the first method is better (but needs to be ehanced a little to work for any situation)

radius in both examples is hardcoded 1.5, but you can easily reference radius parameter in expression once you create one

rotating_wheel_along_path.hip

Link to comment
Share on other sites

ok, so the updating problem was probably because i was reading object's translation through object CHOP and then reading it in rotation of the same object, which was causing sort of evaluating cycle. Not causing error however, even working if you just set the expression, but it was wery likely to stop working

so i updated the file so that null object is following the path and chops are reading it's position and torus is null's child and it's rotation is driven by chops result

it worked for me even with reloading the scene, try

Link to comment
Share on other sites

anim in your file i couldn't understand the chop method i think there is some thing wrong. there is no channal named length in the chop node if you can see your attached file .you wrote this expression chop("../chopnet1/OUT/length") that i can't understand .

Link to comment
Share on other sites

yes, there is

right after Vector CHOP, there is only one channel named "length"

but if you are using version less than 10.0.473, then you can have a problem because there was no Vector CHOP before that version so you've probably got warning and it was replaced by incomplete definition or merge CHOP or something and therefore it does not function

Link to comment
Share on other sites

One thing you can't do easily with the expression method is burn-outs and have proper accumulation of the rotates. We all have to support burn-outs right? Why even bother if you can't. ;)

Oh I completely forgot about the new vector CHOP snuck in there with the ForEach CHOP last November. I updated my file to use this as it greatly simplifies the network.

See the attached file.

Note: There is a bug in Houdini where some CHOP networks don't properly initialize. Please see the red note in the file to get CHOPs to work properly.

I re-submitted the bug again.

rolling_wheel_v04.hip

Link to comment
Share on other sites

  • 1 year later...

hi evry one and it is necessary to rise this post again ,

i have a problem in wheel rigging in the chop method and this problem is : the chop give me the total distance travelled in world and this is alawys positive and in this case when the wheel start to go in back way on the path or in the opessit direction the rotation direction still the same and no way to change it to fit all the possible case,see the attached file .

rotation_CHOP_METHOD.hip

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