This script exports a 28 point model from 3ds MAX to a PointLightLab model file format ( 2D version for V4 of PLL)
macroScript TM_LeftFacing_Exporter category:"DuncansTools" ( -- number of points to export num_dummies = 28 -- array to hold the dummy refs dummy_array = #() --scaling factor scale = 0.3 output_name = getSaveFileName caption:"PointLightLab Model File" types:"Models (*.pllm)|*.pllm|All Files (*.*)|*.*|" if output_name != undefined then ( output_file = createfile output_name --create the array of dummies for dummies = 1 to num_dummies do ( dummy_array[dummies] = execute ((if dummies < 10 then ("$Dummy0" ) else ("$Dummy")) + dummies as string) ) --Write the file header-- format "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\" ?>\n" to:output_file format "<!DOCTYPE DuncansModelFile SYSTEM \"C:\\Program Files\\DuncansTools\\PointLightLab\\configuration\\ModelFormatv4.dtd\">\n" to:output_file format "<DuncansModelFile Version=\"4.0\">\n\n" to:output_file for t = animationrange.start to animationrange.end do ( format "<FrameSet>\n" to:output_file for dummies = 1 to num_dummies do ( at time t obj_1 = dummy_array[dummies].center format "<FramePoint Xpos=\"" to:output_file format "%" (obj_1.y * scale ) to:output_file format "\" Ypos=\"" to:output_file format "%" (obj_1.z * scale ) to:output_file format "\"/>\n" to:output_file ) format "</FrameSet>\n\n" to:output_file ) format "\n</DuncansModelFile>" to:output_file close output_file edit output_name )--end if )--end macroScript
No comments:
Post a Comment