/************************************************************** Author: Sebastian H. Schmidt Web: subsites.org Contact: sschmidt subsites org functions for sequential export of Geometry to OBJ Files Frame Wise Export SHS_export2ObjFW ("Path/Filename.###.extention", "ExportGeometry",Startframe,Endframe) Sub Frame Wise Export SHS_export2ObjSFW_RR ("Path/Filename.###.%%%.extention", "ExportGeometry",(Startframe * 10),(Endframe * 10),Step) Startframe: Multiply by 10, because we could go in 1/10 Subframe Steps Endframe: Multiply by 10, because we could go in 1/10 Subframe Steps Step: 1 = 1/10 Frames per Step 10= 1 Frames per Step Sub Frame Wise Export for Royal Renderer SHS_export2ObjSFW_RR ("Path/Filename.###.extention", "ExportGeometry",(Startframe * 10),(Endframe * 10),Step) Startframe: Multiply by 10, because we could go in 1/10 Subframe Steps Endframe: Multiply by 10, because we could go in 1/10 Subframe Steps Step: 1 = 1/10 Frames per Step 10= 1 Frames per Step **************************************************************/ global proc string SHS_TransformBackshlashes(string $path) { string $ret_val = `fromNativePath $path`; print ($ret_val +"\n"); return $ret_val; } global proc SHS_export2ObjFW (string $exportPath, string $SelObject,int $exp_start, int $exp_end) { $exportPath = `SHS_TransformBackshlashes $exportPath`; select -r $SelObject; if (($exp_start==0) && ($exp_end==0)) { $exp_start =`playbackOptions -q -min`; $exp_end =`playbackOptions -q -max`; } int $i; for ($i=$exp_start;$i<=($exp_end-1);$i++) { currentTime $i; // Set Current Time to i string $number = $i; string $exportPath = `substitute "###" $exportPath $number`; string $exp_path = $exportPath; file -op "groups=1;ptgroups=1;materials=1;smoothing=1;normals=1" -typ "OBJexport" -pr -es $exp_path; } } global proc SHS_export2ObjSFW (string $exportPath,string $SelObject, int $exp_start, int $exp_end, float $step) { select -r $SelObject; $exportPath = `SHS_TransformBackshlashes $exportPath`; if (($exp_start==0) && ($exp_end==0)) { $exp_start =`playbackOptions -q -min`; $exp_end =`playbackOptions -q -max`; } float $i = $exp_start; while ($i<=$exp_end) { print (" i is " + $i + "\n"); currentTime $i; // Set Current Time to i int $ibZ = $i; int $iaZ = ($i - $ibZ) * 10.0; string $bZ = $ibZ; string $aZ = $iaZ; string $exp_path = `substitute "###" $exportPath $bZ`; $exp_path = `substitute "%%%" $exp_path $aZ`; print ("exporting "+ $exp_path + "\n"); file -op "groups=1;ptgroups=1;materials=1;smoothing=1;normals=1" -typ "OBJexport" -pr -es $exp_path; print ("incrementing from " + $i + "\n"); $i = $i + $step; print (" to " + $i + "\n"); } } global proc SHS_export2ObjSFW_RR (string $exportPath,string $SelObject, int $exp_start, int $exp_end, int $step) { select -r $SelObject; $exportPath = `SHS_TransformBackshlashes $exportPath`; //return; if (($exp_start==0) && ($exp_end==0)) { $exp_start =`playbackOptions -q -min`; $exp_end =`playbackOptions -q -max`; } int $i = $exp_start; while ($i<=$exp_end) { print (" i is " + $i + "\n"); float $iF = $i; float $cTime = $iF/10.0; print ( " current Time is " + $cTime + "\n"); currentTime $cTime; // Set Current Time to i string $number = $i; print ("current Number is " + $i +"\n"); string $exp_path = `substitute "###" $exportPath $number`; print ("exporting "+ $exp_path + "\n"); file -op "groups=1;ptgroups=1;materials=1;smoothing=1;normals=1" -typ "OBJexport" -pr -es $exp_path; print ("incrementing from " + $i + "\n"); $i = $i + $step; print (" to " + $i + "\n"); } } //select -r liquida_ref:liquida_geo1Shape ; //SHS_export2ObjSFW_RR "c:\\temp\\bla.###.obj" "liquida_ref:liquida_geo1Shape" 0 100 5; //SHS_export2ObjSFW "c:\\temp\\bla.###.%%%.obj" "liquida_ref:liquida_geo1Shape" 0 10 0.5; //string $path = `fromNativePath( "\\\\gandalf\\sebastian\\TD_Projects\\frequenzmorph\\Maya\\Export_Tests\\data\\RRExport\\LiQuida_RRTest.###.obj" )`; //string $object = "liquida_ref:liquida_geo1Shape"; //SHS_export2ObjSFW_RR"\\\\gandalf\\sebastian\\TD_Projects\\frequenzmorph\\Maya\\Export_Tests\\data\\RRExport\\LiQuida_RRTest.###.obj" "liquida_ref:liquida_geo1Shape" 51 96 5