Convert Utility to Plugin

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Search this Thread Display Modes
Old 04 April 2014   #1
Convert Utility to Plugin

I have scripted a Utility that creates powerlines from a selection of masts (with dummy children to indicate wire attachment points) and a spline where a mast is placed at each vertex. For ease of use, I decided to try converting it into a plugin that could reside in the Create Panel.

The creation process for these objects require only the selection of source objects (like a compound object) and leaves only instances of generic geometry (like a ring array object). None of the allowed superclasses for "plugin" seem 100% right for my use, but I gave it a try using the "geometry" superclass. This superclass requires a create-tool, even if I don't really want to click-and-drag or similar. My rollout contain pick-buttons, and I can get the rollout to show up if I include an empty create-tool, but after using one of the pick-buttons, the rollout closes.

Is this attempt misguided, or can I get the behaviour I need from a plugin script? I'm unable to find a good, relevant example, and the documentation doesn't seem to cater for my needs.
 
Old 04 April 2014   #2
Bump. There are perhaps not that many who could answer this with confidence, but any ideas are welcome.
 
Old 04 April 2014   #3
The creation process for these objects require only the selection of source objects


the mouse tool should create these "dummy" control objects on every click, these are collected by by the plugin, much as if you were build a spline. The user can then plonk them anywhere and the drag them to position or use snaps to position them correctly at create time.
 
Old 04 April 2014   #4
Yes, but I don't want to create anything interactively with the mouse, I just want to click on a few pick-buttons in the rollout and select objects from the scene. Alternatively, the selected object could become one of the sources upon creation of the rollout. Finally I want to click a "Create" button in my rollout that will generate new objects based on the sources I've picked. Kinda like the workflow for creating a Loft for example.
 
Old 04 April 2014   #5
have you tried adding a "do nothing" mouseAbort to your tool ?

on mouseAbort arg do () 
 
Old 04 April 2014   #6
That is exactly the kind of thinking I'm looking for... unfortunately this doesn't seem to help any; the rollout still closes, after doing "nothing" first.
 
Old 04 April 2014   #7
you need to create something even if it's an empty mesh.
 
Old 04 April 2014   #8
So... I might be better off with a helper plugin, extending "Dummy" then?
 
Old 04 April 2014   #9
what is the final object type for the power line ? if its mesh you're best going off simpleObject
 
Old 04 April 2014   #10
Found this in the pickbutton section of maxscript help:

Note: Due to limitations in 3ds Max, you cannot specify a node using a Pickbutton in the Create panel, for example in a scripted Geometry plugin. The work-around is to only enable the Pickbutton when the object is open in the Modify Panel.

So that means I would definitely have to define some kind of permanent, custom object to hold the parameters/interface. I don't think I want to go there for this type of object.

The result is any number of clones of the original mast, pluss a spline of the wires.

But thank you for the effort!
 
Old 04 April 2014   #11
If you had a scripted utility, why not turn it into a real C++ utility?
There are tons of examples in the SDK for that.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:29 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.