overwriting jiggle attribute in chops?

   2905   7   4
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
Hi,

I would like to overwrite the “stiff” attribute of the jiggle chop with an painted attribute. Can't make that work.

All suggestions are welcome.

Enclosed a hip file.


Thanks!

Attachments:
attributeToChops.hipnc (71.3 KB)

User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
No one?


Any comments could help.
User Avatar
Member
691 posts
Joined: June 2006
Offline
Look at this file.

Maybe there are a better solution.

Cheers!!!

Attachments:
attributetochops_109.hipnc (91.9 KB)

Feel The Knowledge, Kiss The Goat!!!
http://www.linkedin.com/in/alejandroecheverry [linkedin.com]
http://vimeo.com/lordpazuzu/videos [vimeo.com]
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Alejandro got to it first and has the same solution.

—-

Only a few CHOPs handle local variables in expressions. The Jiggle CHOP doesn't support local variables in expressions. The Math CHOP does if you want to look at the help to see what they are.

Since the Jiggle CHOP doesn't support local variables, you can't use expressions indexing in to channel samples directly.

The only way to do this is with the ForEach CHOP.

The ForEach CHOP can process each point in turn quite easily. Once inside the ForEach CHOP, you see the four channels being fed in for the first point. Now it is straightforward to index in to the stiffness channel using the ic() expression:
ic(“../Foreach_Iteration”, 3, $F)
where the sample rate of the channels is one per frame predicated by the $F.

See the Example File.

Note that in H12, the Motion View pane does not update correctly at all while inside CHOPs for some reason. Once you jump up to SOPs, the motion view will correctly display the channels.

This technique will allow you to vary any parameter on any chop by groups of channels.

Submitted the bug. ID=48277

Attachments:
attributetochops_109_foreach_chop.zip (16.9 KB)

There's at least one school like the old school!
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
thanks a lot!!!
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
I dont get the ic expression. the texport stuff is just to short…at least for me.

ic(“../Foreach_Iteration”, 3, $F)
ic(0,3,0)


What does the 3(float channel_index) refer to. And why to use $F although each sop is cooked at each frame anyway?! if I put in an arbitrary number it doesn't change anything?

Thanks a lot!
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
mickyblue
ic(“../Foreach_Iteration”, 3, $F)
ic(0,3,0)

What does the 3(float channel_index) refer to. And why to use $F although each sop is cooked at each frame anyway?! if I put in an arbitrary number it doesn't change anything?
The <float channel index> is where you specify my index or number starting at zero which shannel you wish to sample the value from.

Usage
ic(input_index, channel_index, index)

Is a function that Is used only in a chop parameter. You can't use it anywhere else.
It is used to fetch a value from any chop by specifying in order:
- which CHOP input to use starting at 0
- which channel in that CHOP to use starting at 0
- which specific sample in the specified channel to read

What should really work is:
ic(0, 3, $F)
but I was a bit taken by a couple bugs and update issues so I accidentally attached the wrong. Version of the file.

The function above reads:
Fetch the value from the first CHOP input to me and from the fourth channel in that chop (the channel you wish to sample), fetch the value from the sample at the current frame assuming that the current sample rate of the incoming channels matches the default frame rate in the current scene.
I believe there are a couple update bugs that are causing some confusion.

This CHOP doesn't support local variables like $I or the current sample ring evaluated as a common form of ic() is:
ic(0, 3, $I)
But with no $I, either assume the sample rate is the same as frame rate and use $F or use the chopr() expression ant point it at the input chop to fetch the sample rate of the CHOP And divide by $FPS which is the frame rate of the scene to index properly.

Where ic() starts to prove real useful is in it's ability to sample a CHOP curve at a sample index int the past or in the future by shifting the sample index. You could do $I-1 or $F-1 to read the previous sample from the target curve.

Hope that helps and I need to investigate if the above is still holds true in H12.
There's at least one school like the old school!
User Avatar
Member
217 posts
Joined: Sept. 2009
Offline
thanks Jeff! that helped a lot!!!
  • Quick Links