Notifications
Clear all

[Closed] modifity transform in timer tick event

I wrote a little tool to help me do my keyframe animation.
I put the calculation in timer tick event with a “LOCK” checkButton to active it.

here’s the code (part of it)


on lock_ckb changed stat do
(
	if stat do
	(
		loc_trsObjTMs = for obj in transObj collect obj.transform * inverse pivotObj.transform					
	)
	
	lock_tim.active = stat
	
)
		
on lock_tim tick do
(			
	for i = 1 to transObj.count do
	(
		obj = transObj[i]
		old_loc_trsTM = loc_trsObjTMs[i]
		
		obj.transform = old_loc_trsTM * pivotObj.transform
	)
	
	loc_trsObjTMs = for obj in transObj collect obj.transform * inverse pivotObj.transform
)

it work but with some weird behavior. seems every time you transform the pivotObj. the other box transform to original position first then transform to calculate position.
you can see it in the video (0:16)
http://www.youtube.com/watch?v=UcrPOdV2cD4

Is there a way to avoid the jitter ? Or a another way to do similar thing?

PS:I’ve try another way using When Constructs. but you can’t change obj transform in when transform attributes. it causes some axis lock effect.

1 Reply

Well the jitters happens because it is updating the transforms only when it ticks so it looks like its playign catch up at least that is what it looks like to me.