Notifications
Clear all

[Closed] copy track between 2 object

hello all,

I would like to create a script for facial control setup, wich copy a specific track from an object (for example the position.x track of a bone) and paste instance to an another specific tracktrack (the posx attribute I have previously define in an attributes holder)

I have spend hours reading the maxscript help and I haven’t find the correct syntax for this task. If anyone have an idea of the method I could use, It would be very helpfull

3 Replies

Say we have two box objects.

You could do it like this:

$Box01.position.controller.x_position.controller = Box02.position.controller.x_position.controller

-Dave

Yes, this is correct apart from a small typo (“$” is missing in front of “Box02” ). But it also makes Box01 follow Box02 concerning the x axis because their instances refer to the same controller. If you want to have a unique controller on each object use this…

$Box01.position.controller.x_position.controller = copy $Box02.position.controller.x_position.controller

thanks a lot for your reply

by the way, searching through the forum I have found the answer on another post.

using this I have write this piece of code:


ctrlmouth = box lengthsegs:1 widthsegs:1 heightsegs:1 length:0.45 width:0.50 height:0.2 transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [1.25,0.1,0.075]) wireColor:[176,26,26] name:[size=1]"ctrlmouth"

[/size]addModifier ctrlmouth (PEN_Attribute_Holder_2 ())

caExe =[size=1]"ca = attributes PersoMouth
"

[/size]caExe +=[size=1]"(
"

[/size]caExe +=[size=1]" parameters mouth
"

[/size]caExe +=[size=1]"(
"

[/size][size=1]for[/size] i = 1 [size=1]to[/size] $.count [size=1]do

[/size](

objname=$[i].name

[size=1]for[/size] j = 1 [size=1]to[/size] 6 [size=1]do

[/size](

caExe += objname

caExe += j [size=1]as[/size] string

caExe +=[size=1]" type:#float
"

[/size])

)

caExe +=[size=1]")
"

[/size]caExe +=[size=1]")
"

[/size]execute caExe

custAttributes.add ctrlmouth .modifiers[1] ca

[size=1]for[/size] i = 1 [size=1]to[/size] $.count [size=1]do

[/size](

objname=$[i].name

[size=1]for[/size] j = 1 [size=1]to[/size] 3 [size=1]do

[/size](

strExe = [size=1]"ctrlmouth.modifiers[1].PersoMouth."

[/size]strExe += objname

strExe += j [size=1]as[/size] string

strExe +=[size=1]".controller=$["

[/size]strExe += i [size=1]as[/size] string

strExe +=[size=1]"].controller[1][2]["

[/size]strExe += j [size=1]as[/size] string

strExe +=[size=1]"].controller"

[/size]

execute strExe

)



[size=1]for[/size] j = 1 [size=1]to[/size] 3 [size=1]do

[/size](

strExe = [size=1]"ctrlmouth.modifiers[1].PersoMouth."

[/size]strExe += objname

strExe += (j+3) [size=1]as[/size] string

strExe +=[size=1]".controller=$["

[/size]strExe += i [size=1]as[/size] string

strExe +=[size=1]"].controller[2][2]["

[/size]strExe += j [size=1]as[/size] string

strExe +=[size=1]"].controller"

[/size]

execute strExe

)

)