Primitive Maker

76 votes
Version: 
1.1
Date Updated: 
01/01/2011
Author Name: 
Garp

Creates a new Primitive from a template object.

Additional Info: 

This script creates a simpleObject plugin and registers the new primitive. Works with both geometry and shape objects. In the case of shapes, the primitive is of geometry type, based on the renderable version of the template shape as defined by the settings in the Rendering rollout, even if the Enable options are off.

The script supports smoothing groups, material IDs and mapping coordinates for all map channels (except -1 and -2, respectively alpha and illum).

The only parameter for the new primitive is Size. Its value corresponds to whichever dimension of the object's bounding box is the largest.

The Original Size button resets the size to that of the original object.

The Show Location button displays the path and name of the plugin's file.

The Sub-Folder from Category option creates a new folder in the current location - if it doesn't already exist - based on the primitive's category.

The Discard Mapping Coords option ensures that no mapping coordinates are passed from the template.

The name of the plugin file is of the form name_category.ms as entered in the dialog. Edit it at your own risks!

To make the primitive permanent, choose as location one of max's startup folders, like \$max\plugins (the default).

You can easily edit the various default values (default folder, legal characters for Name and Category  and option states) in the script's file. These are set at the top of the code for easy access.

Each new primitive class is scriptable. Just replace any eventual space in its name by an underscore. If the size property is not specified, the size of the original template object is used.

In the same fashion, there is also a Helper Maker.

 

v. 1.1: fixed a few loose ends.

v. 1.2: fixed a major bug that prevented cloning correctly (thanks to gramx for finding it).

Version Requirement: 
max 9 and above
AttachmentSize
PrimitiveMaker.ms14.43 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dan_cole's picture

Thanks!

Thanks for the fast reply Garp,

At first I was getting a run time error but worked out it was because my plugin folder on C: wasn't writeable too, because I don't often remember to run Max as an Admin.

Made a new folder else where and it all works great. This is really good, thanks so much for sharing. Telling all my classmates about this when I get off term break.

Thanks again!

Garp's picture

Download and save the

Download and save the PrimitiveMaker.ms file somewhere on your hard drive.
From max, go to the maxscript menu, choose 'run' and browse to where you stored the script.
When it's running, enter a name and category for the new primitive, pick an object you've already modeled (and eventually mapped) and hit the 'make primitive plugin' button. Then choose a folder for the plugin's file.
If everything goes well, you can see the new category in the drop-down list of the command panel (when set to 'geometry'). Choose it and you now have a button for the new primitive.

dan_cole's picture

Max Script

Hey,

I came across this by total accident while Googling, what a great piece of code.

Unfortunately I am a complete and utter beginer when it comes to maxscript, other than press F11 within Max I can't do anything.

Can some one please kindly take me through the steps to create this plugin with the ms file please?

Hope you all had a good new year and thanks in advance

Dan

Garp's picture

Hey, I'd recognize that boxy

Hey, I'd recognize that boxy car anywhere!
Glad you like it, Joey. Nice to see you here ;)

Joe007's picture

Very handy Garp. Thanks!!

Very handy Garp. Thanks!!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.