maxscript - How do I save Images of objects I just rendered?

I am new to scripting and I'm, trying to export objects in my scene and render images of all selected objects individually.Right now my code can only export FBX files based on whatever name my object has and can render one image. for current in geometry do( select current newFileName = current.name newFilePath = pathConfig.GetDir #Export completeFilePath = (newFilePath + "/" + newFileName) exportFile completeFilePath #noPrompt selectedOnly:true using:FBXEXP render renderType:#selected --render current frame:1 outputfile:"t...Read more

MaxScript how to capture current rotaion

This is my first time trying to write a script for 3ds max. I'm trying to set the selected objects pivot point rotation to (90,0,0). So far I've managed to add 90 to the the rotation everytime i run the script. I then found a solution online but I get the error: "unknown property objectoffsetrot ". Here is the script: ( fn RotatePivotOnly obj rotation = ( local rotValInv=inverse (rotation as quat) animate off in coordsys local obj.rotation = RotValInv obj.objectoffsetrot *=RotValInv obj.objectoffsetpos *= RotValInv)fn RotatePivot...Read more

How can I call the position of a group of selected vertices in maxscript?

I am in the midst of creating a GUI that will create a spline along a premade hose tube. The purpose of this is to simulate moving hoses in a hydraulic powered machine rig. This script is meant to make it more efficient to create the lines instead of having to manually position them within the 3 default viewports. What I am asking is how I can be able to call upon the value shown within the view window after I have selected a group of vertices. Here is an example of what I mean:My goal is to take the average value of all selected vertices and p...Read more

call maxscript from another maxscript

I'm trying to write a function that calls an external script but am not having any luck with the syntaxscripts_folder = "C:\\Program Files\\Autodesk\\3ds Max 2008\\Scripts"var script1 = "hello_world.ms"-- use function to call scriptscallScript(script1)-- function callScriptfunction callScript script =(getFiles scripts_folder + "\\" + script)...Read more

Use transform details of object in maxscript upon selection

I want to use the position value of the object I select in max script. I understand it is easily possible via '$.pos.X' and few more methods. But the only limitation is that I have to click a button to run that script or have to link it to some function. I am looking to use the details real time, as soon as I select any object it should display the properties in a text box. Any help on this would be highly appreciated. Many thanks in advance.....Read more

Sending data from C/C++ to MaxScript

I want to use the data coming from the multiple sensors coming through the serial port to rotate a box in 3DS Max . The data is first filtered using the KAlman filter and is set in the proper form but i dont know how can i use the reformed data in the Max Script to do the rotation . I know the max script to rotate but i dont know how do i send the data from somewhere else to MaxScript . Please help me out...Read more

MaxScript - Simple Script, Attachment Controler

I am begginer with Maxscript. I am trying to make a simple script in Max Script, for animated scene. Tried using macro recorder but it doesn't record that action that I need.So, I have a number of points in a scene that all have Attachment Constraint Controller,I need to uncheck checkbox 'Align to Surface' using script.After I tried with macro recorder I explore scripts on Scriptspot and documentation but couldn't find and example that I can learn fromcheckbox chk_align "Align To Surface" checked:falsereturns errorI appreciate help with this p...Read more

Maxscript label string

The code below work fine, only I want to dynamically change the label text before the rollout is created, not afterwards. I'm trying to pass a variable (rolloutlabel) as a string in the rollout, only I can't seem do that without having to code around it by updating it with a button.The (unhelpful) error I get if uncomment the 6th line is "syntax error: at =, expected name"rolloutlabel = "label"rollout rolloutDialog "Rollout" width:100 height:50( label alabel "" pos:[10,10] width:90 height:16 button updateBTN "Update label" pos:[10,25] wid...Read more

Maxscript with modfiers

From creating a cube the following code should select the top two triangles, invert that selection and then delete those newly selected faces. So far so good. However, I seem to run into trouble when there’s a modifier (or more) on the base cube.(--clear the listener clearListener() theObj = $ -- init. an array to collect faces selArray = #{} invArray = #{} append selArray 3 append selArray 4 -- get the number of faces in the object theMeshCount = theObj.numfaces -- invert the array for f = 1 to theMeshCount do ( if (selArray[f] == false) then ...Read more

Maxscript's function to remove degenerative faces in 3DS MAX

How can I call removeDegenerateFaces on particular model? I'm unable to understand what's on autodesk documentation, since it is basically only line belowmeshop.removeDegenerateFaces <Mesh mesh>http://docs.autodesk.com/3DSMAX/15/ENU/MAXScript-Help/index.html?url=files/GUID-EF78FA1A-A382-4BED-BA10-7C856A7551A5.htm,topicNumber=d30e365344let's assume I have object called body, how could I call that function on it?I triedbody.removeDegenerateFaces <Mesh mesh>, but there was: error '<factor> expected'..Thanks a lot...Read more

maxscript - Callback function in Slate Material Editor

Is there any callback function available, which is triggered while we attach a texture map to a material using the slate material editor.Reason:I have a custom material and if the user don't have a valid license I don't want him to attach any texture to the custom material. In the Compact material editor I achieved this by disabling the UI to create map. But when I am using the Slate material editor I can connect a texture to my material.So my idea is if I get a call back function from slate material editor when I tries to attach a map, I can p...Read more

MaxScript - Spline Smooth?

I tried to make this script in 3dsmax 2017 using listener but it does not record just that action for spline - smooth (like in the screenshot).When I select subobject level - Vertex, and select all, then I right click and choose smooth, , I got result I need.I need to make it using script because I have a number of splines that need to be smooth.any help appreciated.select $Line001subobjectLevel = 1modPanel.setCurrentObject $.baseObjectI tried couple of script that I find online but they don't work in 3dsmax 2017.So if you have solution example...Read more