This will give you the name of the data members of the object. If you want to find the members of a specific classs, you can do the following: showclass "cone.*" note the double quotes is necessary and won't work without it. The string is allowed to include the wildcard (*) character and behaves as you would expect a wildcard character to behave.įor example, if you want to find all objects with the word "material" in it, you can use: showclass "*material*" Showclass is a function you can call to find the poperties of an object as well as objects with a certain name showclass However, the macro recorder does give us hints as to things like names of modifiers. Observe how the ui flashes as it plays through the loop.Ī much better solution is as follows: for i = 1 to 100 do(Īs you can see the second version is much faster and doesn't cause ui to flicker. The following snippet will cause our ui to flicker as it runs and it would be much slower than it needs to be: for i = 1 to 100 do( If we applied the script exactly as our results would be very slow and behave wierdly. ![]() Similarly the $ refers to the selected object. The modPanel.addModToSelection has to do with accessing the modifier from the modifier panel in the UI. Unfortunately the way this is done is how it is done interactively. using this script I have to manualy go to every boxs first keyframe and then execute the script. the second two llines adds the modifer Bend() then changes the angle of that modifier.Cone is the name of the cone object, it shows you the parameters that you can set to create the object.ModPanel.addModToSelection (Bend ()) ui:on It also operates based on selection and this is not always useful when you actually have to write code as it can have undersirable results.įor example, create a cone with 5 height segments and apply the bend modifier to it and change the bend angle to 45 degrees If you do this, your macro recorder will show something like the following: Cone smooth:on heightsegs:5 capsegs:1 sides:24 height:24.6557 radius1:10.6764 radius2:-4.67522 mapcoords:on pos: isSelected:on One thing to note about the macro recorder is that it records not only creation and changes to object but also changes to things like selection states or the UI. You will see the maxscript code in the macro recorder area ![]() Once you have enabled it, try drawing an object in the viewport. ![]() Make sure the macro-recorder is enabled (in the MacroRecorder menu of listener or in the maxscript menu of the main window). If you don't see pink, it is because the divider is right at the top of the window so pull it down. This is the area that is in pink at the top of the listener window One of the easiest ways to find the script code needed to create an object is to use the maxscript macro recorder. This chapter will cover a few objects but more importantly it will show you how to find more information about objects. There are many builtin objects and it is important to find out how to access it or find more information on it. MaxScript gives you script access to pretty much everything you can do using max's interactive ui.
0 Comments
Leave a Reply. |