Note: This class is not available in Autodesk VIZ.
The morph key functions operate on MAXScript key values that are accessed on Barycentric morph controllers in the same way as keys on other keyable controllers. For Barycentric_Morph_Controller keys, the following properties and methods are accessible:
Time value or number (interpreted as frames). Read-only.
Specifies whether the key is selected. Read/write access.
Returns the given morph key’s time.
setMKTime <morph_key> <time>
Sets the time of the given morph key.
getMKWeight <morph_key> <target_index_integer>
Gets the weight as a percentage for the numbered target on the given morph key. Targets are numbered in order as seen in the target list in the morph key Track View dialog. This is the order in which the targets were added.
setMKWeight <morph_key> <target_index_integer> <pcnt_float> <keep100%_boolean>
Sets the percentage weight of the numbered target on the given morph key. The last argument is a boolean, if true adjusts other target weights so the maximum is 100%.
When using the addnewkey() method to create a key for the Barycentric_Morph_Controller controller, the time component of the key value returned is usually not correct. Use the getMKKey() method to access the created key.
sel1 = sphere radius:30 -- target 1
sel2 = sphere radius:50 -- target 2
createMorphObject sel1 -- create the morph object from sel1
mobj1= sel1.morph -- grab morph controller
addmorphtarget mobj1 sel2 3 -- add sel2 as target - creates key with
-- target weights of 0 and 100%
k=mobj1.keys -- grab the key
setMKWeight k 1 100 true -- set target 1 to 100%, keep total 100%
addnewkey mobj1 50 -- create morph key at frame 50
k=getMKKey mobj1 50 -- grab the key
setMKWeight k 2 100 true -- set target 2 to 100%, keep total 100%
$Sphere:Sphere01 @ [0.0,0.0,0.0] -- result line 1
$Sphere:Sphere02 @ [0.0,0.0,0.0] -- result line 2
$Editable_Mesh:Sphere01 @ [0.0,0.0,0.0] -- result line 3
Controller:Barycentric_Morph_Controller -- result line 4
2 -- result line 5
#Barycentric Morph Controller key(1 @ 0f) -- result line 7
1 -- result line 8
#Barycentric Morph Controller key(0 @ 50f) -- result line 9
#Barycentric Morph Controller key(2 @ 50f) -- result line 10
Key Common Properties, Operators, and Methods
Value Common Properties, Operators, and Methods