View Full Version : Mouse click Geometry tools.
03-02-2009, 02:55 PM
Is it possible to create a bunch of objects(models)...let's say like a stop sign a fire hydrant etc. and then somehow make these objects into a maxscript. Let me start over....i'm looking at the mouse tool event handlers in the help...and essentially i want to model a few objects and have them be buttons that i can just click on and place in the scene as needed. Let me know if i need to clarify anymore. Thanks guys.
Yes, and there is more than one way to do this. You can make a "simple maxscript plugin" and load it with max. You can make your own custom macroscript and use a tool clause to click the geometry that you can merge in from any file.
"How To ... Create Scripted Geometry Plug-in" in the mxs help
Basicly generate a vert/face array and save it with the file and rebuild your mesh in the setmesh function. I think scriptspot has examples of those. For the custom floater and paint approach, there are some simple painter script on scriptspot also, I'd check them out!
03-02-2009, 03:37 PM
You could also try Martin Breidt's Plug-O-Matic (http://scripts.breidt.net/#plugomatic) script.Takes any geometric object and converts it to a new object plugin for future use, just like any other standard primitive.
New in 2.0: Speed optimization; Now supports texture coordinates; Objects need not to be converted to EditableMesh before plugin generation; Updated creation tool; generated objects have new mesh data options for-Eric
03-02-2009, 06:38 PM
Thanks guys....will look into it!
03-04-2009, 07:03 PM
Just another quick question. Do you need a separate class ID for each object that you create. For instance:
plugin MVA_Object Hydropole
plugin MVA_Object FireHydrant
....each of these being separate exported scripts....or does the class id stay the same? Thanks again guys!
03-04-2009, 07:39 PM
If they are different plugins then they should have an unique ID. However, if both items were available from the same plugin then you would only have 1 ID, since it is only one plugin.
From the Maxscript Help (Scripted Plug-ins):classID:#(<integer>,<integer>)
You supply the classID:#(<integer>,<integer>) parameter if you want the plug-in to be creatable and storable in the scene. This ID becomes the permanent ID for the class and is used by 3ds Max to identify objects as they are saved and loaded in the scene. You don't need to supply a class ID value if the plug-in is to be like a System object that only creates other types of objects in the scene. The class ID is basically a pair of numbers, chosen randomly so that (hopefully) they won’t conflict with another plug-in. MAXScript provides a method to generate a fresh random class ID each time you run it:
This method generates a random class ID similar to #(0x9b7ea231, 0xb6db86ef), and prints it by default to Listener. You can cut and paste this class ID into your script to use the generated ID.
In 3ds Max 6 and higher, if returnValue is true, the classid is not printed to the Listener, rather a 2 element array containing the 2 parts of the class ID is returned.-Eric
03-04-2009, 07:48 PM
I must have read that too fast in the help..it makes more sense now. Two maxscripts, two objects means two different class id's. Thanks for helping me gt my head outta my....
03-05-2009, 03:11 PM
Hmmm....i'm using Martins script and basically running it and generating multiple objects/scripts. Placing these scripts in the startup gives me an error...not sure whats up. They have different class ID's. Ideally i would like to just have buttons in a floater for each object. Goin to have to take a look at that "How to" in the maxscript help to see if its possible.
03-05-2009, 03:40 PM
What is the error you are getting? What if you place the scripts in your plugins folder instead of the startup scripts folder? Since they are plugins (extensions) treat them like a plugin and not like a script.
03-05-2009, 03:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.