PDA

View Full Version : Script for copying setup values


kursad_pileksuz
04-02-2008, 06:42 AM
This script will copy first object`s move channels and paste to second selection in setup. This works only for setup values thou. You can modify this script to copy rotation values as well, or any other channel values. Just modify the "channel" section of the commands. Also check out scripts text file inside messiah for how to use these commands.

GetSetupValue(first,channel)

SetSetupValue(last, channel, first_x_pos, 0)



Just copy the tex below and put into modules/script directory. In messiah press F7 to recompile your scripts. After then you can either use in the command prompt or custom command shortcuts.

Thanks to Ulven for object selection order tip.


--script starts here---


//#messiahscript
//#define SCRIPT_LAUNCH_ACTIVATION 0







int main()
{

object first;
double first_x_pos;
double first_y_pos;
double first_z_pos;

object last;
double last_x_pos;
double last_y_pos;
double last_z_pos;



first=CurObj;
last=GetFirstSelectedObj;


if ( first == last )
{
last = GetLastSelectedObj;
}
if ( first == last )
{
return(0);
}

first_x_pos=GetSetupValue(first,0);
first_y_pos=GetSetupValue(first,1);
first_z_pos=GetSetupValue(first,2);





last_x_pos=SetSetupValue(last, 0, first_x_pos, 0);
last_y_pos=SetSetupValue(last, 1, first_y_pos, 0);
last_z_pos=SetSetupValue(last, 2, first_z_pos, 0);

return(1);
}

CGTalk Moderation
04-02-2008, 06:42 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.