Last active
July 12, 2018 21:12
-
-
Save mattcox/4559150 to your computer and use it in GitHub Desktop.
This snippet is to demonstrate how to write to a matrix channel in modo from an eval modifier. This is the correct way to write to a matrix. This does assume that you have set the matrix channel you want to drive as a channel for the modifier, using eval.AddChan(item_loc, LXsICHAN_XFRMCORE_WPOSMATRIX, LXfECHAN_WRITE); in your modifier constructo…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This snippet is to demonstrate how to write to a matrix channel | |
in modo from an eval modifier. This is the correct way to write | |
to a matrix. This does assume that you have set the matrix channel | |
you want to drive as a channel for the modifier, using something like: | |
eval.AddChan(item_loc, LXsICHAN_XFRMCORE_WPOSMATRIX, LXfECHAN_WRITE); | |
in your modifier constructor. This method will drive the matrix | |
channel directly, so instead of using the local channels to calculate | |
the world SRT, it'll use the values the modifier provides it with. | |
*/ | |
void modifier_element::Eval(CLxUser_Evaluation &eval, CLxUser_Attributes &attr) | |
{ | |
CLxUser_Matrix output_matrix; | |
LXtMatrix4 output_matrix4; | |
// Assuming you have done something to set the value of the output_matrix4 here. | |
// Write to the matrix. | |
attr.ObjectRW (chan_index, output_matrix); // ObjectRW gets an item for writing to. | |
output_matrix.Set4 (output_matrix4); // Set the value of the output_matrix. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment