The Magic $ Sign
Launch 3ds Max.
First of all, we need Maxscript Listener to type and execute Maxscript. There are a few ways to open it.
You can open from the Scripting menu or press F11 key
Or, right click the Mini listener at the bottom right of the dialog.The white area is the Scripting listener.
This is what it looks like.
Download the above file and open the file. You should see this.
Select all 5 objects. Go to the scripting listener and type the following line and press Enter in the num pad.
$.radius = 5
What just happened? Let's break it down.
- $ - The dollar sign in Maxscript means selection or selected objects.
- . - The dot operator is used for accessing property.
- radius - It is a property name. It can also be referred to as "attributes," "parameters," or "options." It represents a value that defines a specific characteristic of an object.
- = - In programming, the equals sign represents assignment, not equality. It indicates that the value on the right side of the sign will be assigned to the property specified on the left side.
So, what you just did is saying "Set selected object's radius property to 5".
Okay, let's give it another go. Just pick one sphere and one teapot. and Type the following line and press Enter in the num pad.
$.radius = 30
The only objects you selected will grow big!
Note that, as with most of Maxscript, the case of the property name doesn’t matter. So, whether you use $.radius, $.RADIUS, or $Radius, they all mean the same thing.
Try a few more times with different objects selected.
Summary
$
means the current selection$.propertyName = propertyValue
to set property value
That's it! Easy!