AutoKey - Animation Converter(Dev)

Hi, i'm trying to remake AutoKey script, it's currently able to copy from one object to another - exact same XYZ position key's.
But problem is that i have a rigged skeleton with animation and it has about 30+ bones and script can't work with more then 2 objects( 1 without anim and 2 with anim)
This is what i was able to do

on alignSource pressed do
	(	
		(
		sticks = #()
		append sticks $ 
		)
		for i = 1 to sticks.count do
 
		(global object1 = sticks[i]
		 objNames = for obj in selection collect obj.name
		objNames = makeUniqueArray objNames
		uniObjs = objNames as string
			AlignSource.text = uniObjs
 
 
 
 
 
		)
	)
	on alignDest pressed  do
		(	
		(
		vecs = #()
		append vecs $ 
		)
		for i = 1 to vecs.count do
 
		(global object2 = vecs[i]
		 objNames = for obj in selection collect obj.name
		objNames = makeUniqueArray objNames
		uniObjs = objNames as string
		alignDest.text = uniObjs
 
		)
	)
 
)

The result is same(working with 1 selecetion on each menu) only change is that http://i.shotnes.com/a/09/zw1rkbus.ko3_522e5062a76e4.png
object's that where seleceted are displaying in text box.

But if there is more then 2 objects selected i get this error.

If you can help with it please, i waisted a lot of time on this issue and ruined a project because of time it taked.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
barigazy's picture

...

U can add many objects in array but theses array need to have same number of items ei. same count.

bga

draging's picture

Hi.. if I look at your

Hi..
if I look at your picture, I just thought ...you may need motion mapping, map track to track.
but it already exists on the save and load animations in the main menu.

DolVai's picture

Thx for reply, script is

Thx for reply, script is working with 1 object to another without any erros, problem accure when i try apply animation from 2 object's( In list, like on screenshot) on other 2(from second menu)
Here is some code, and if you dont want to download i attached whole script,

		startFrame.value = (startFrame.value - 1 )
		endFrame.value = endFrame.value
		done.text = "computing..."
		sliderTime = startFrame.value
		------------------------------------------------------------
			if selPosition.checked do addNewKey object1.position.controller startFrame.value
			if selRotation.checked do addNewKey object1.rotation.controller startFrame.value
			if selScale.checked do addNewKey object1.scale.controller startFrame.value
			startFrame.value += 1
			sliderTime += 1
			progress.value = ( 100 * startFrame.value ) / endFrame.value			
		------------------------------------------------------------
 
		if selPosition.checked do
			(
			object1.pos = object2.pivot
			)
 
			if selPosition.checked do addNewKey object1.position.controller startFrame.value

The problem is i dont understand which module i should create instead of object1.position.controller
object1.pos = object2.pivot

so script could be applyed for more then 2 objects(from selection).

I Would be very glad if someone could write some cod and help me out.

P.S. Sorry for my broken english

AttachmentSize
sniperscripts-autokeyer_old.txt 3.78 KB
barigazy's picture

...

Are you try this tool
http://www.scriptspot.com/3ds-max/scripts/key-transfer
I think that your main problem is parent coordinate space of the bones.
Open the file in attachment. The scene contains two teapots and box.
Velvet Teapot is parented to box and animated. Run this code if you want to mach
animation of two teapots

t1 = $Teapot001
t2 = $Teapot002
t2.pos = t1.pos
t2.parent = t1.parent
t2[3].track = t1[3].track

Also this is useful thread for you
http://forums.cgsociety.org/showthread.php?f=98&t=1076519&highlight=copy...

AttachmentSize
test.max 204 KB

bga

DolVai's picture

So any Help, i need to make

So any Help, i need to make this script usable for multy objects, like shown on screenshot http://i.shotnes.com/a/09/zw1rkbus.ko3_522e5062a76e4.png
Animatin From LeftArm is assigning to dummy017, anim from Leftforearm is assigned to dummy018.
I'm not so sure how to do this, i'm less skilled in max scripting.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.