Notifications
Clear all

[Closed] Quick Help with animation offset of Bend modifier.

So I played a little. If I remove the “if != undefined” i get a message, that insertTime is not possible for undefied objects.
If I interpret that right, max isn’t finding any keys on the bend modifier, therefore it cannot offset it?

Kind of. In some instances, modifiers being one, max only assigns a controller to a property if that property is animated. So the script loops thru all of the bend properties but attempts to inserttime to only those that have been animated. Hence the != undefined check

Ok. I feel stupid for not realizing this earlier, but the solution is much simpler. If you want to inserttime on every controller on an object, you can just pass the inserttime function the object itself. so try this. . .

for s in selection do
(
	theOffset = random 0 100
	insertTime s 0 theOffset
)
1 Reply
(@holzi)
Joined: 11 months ago

Posts: 0

That gives me the same result as earlier. Vertices get screwed; bend is missing.
Seriously, how hard can it be 2 guys being unable to find a solution for this
I’ll try it with 2010 later as you said something about a bug that might be the reason.

I just realized something: After applying your first script (ehich killed the vertex animation and the bend) I realized that the pages aren’t in a still position but somehow moving very slowly. So i change the timeslider and around frame 2000 (so way out of the original 300) the vertices get pulled up again to where they SHOULD be, and the bend happens (unmodified – meaning all pages at once).

So it does not delete the animation, it just moves them 2000 Frames back (where it still is not being offset individually).

I played a little more. I only tried to offset the bend modifier and found the following: if i change the “(random 0 100)” to lets say “(random 0 10)” it moves the bend modifier back, not all the way to frame 2000, but to around 150. But for all 30 pages, the bend starts and stops at exactly the same moment. So there is no randomization going on.

I am stupid!
The array i used (with a slight rotation so pages lie above each other) was instanced, not copied. Therefore the bend controller was an instance, ergo there is only one bend modifier. That had an offset. but since it was ONE controller for all pages it always loocked as before. Stupid stupid stupid…

Final script, in case anyone is searching something similar is as follows:


sel = selection as array

for o in sel do 
(
	theOffset = (random 0 100)
	insertTime o.transform.controller 0 theOffset
	insertTime o.bend 0 theOffset
	for i = 1 to o.numverts do
	(
		if o.baseobject[#Master_Point_Controller][i].controller != undefined then
		(
			insertTime o.baseobject[#Master_Point_Controller][i].controller 0 theOffset
		)
	) 
)

Thanks jonlauf for bearing with me

Ah, you figured it out. good work!

Yeah, the problem occurred to me on my way into work, and you’re on the right track. The issue is that you’ve instanced the pages instead of making copies of them. Instances will get unique transform controllers but will instance all other controllers such as vertex and modifier (bend controllers). Which, in turn means that an offset is being applied to the same controller that is shared among the pages over and over again. That is why the keys show up with no randomization down the line.

To fix this, reopen the file, select all the pages and right click on the stack in the modifier menu. Select “make unique”, reply yes to the dialog when prompted, then run the following code:

sel = selection as array
for o in sel do 
(
	theOffset = (random 0 100) 
	insertTime o.transform.controller 4 theOffset
	for i = 1 to o.numverts do
	(
		if o.baseobject[#Master_Point_Controller][i].controller != undefined then
		(
			insertTime o.baseobject[#Master_Point_Controller][i].controller 4 theOffset
		)
	)
	for b in (getPropNames o.bend) where (isPropertyAnimatable o.bend b) do
	(
		theController = getpropertycontroller o.bend b
		if theController != undefined then
		(
			insertTime theController 4 theOffset
		)
	)
)

that should do the trick.

Page 2 / 2