[Closed] 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.
Bump. There are perhaps not that many who could answer this with confidence, but any ideas are welcome.
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.
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.
have you tried adding a “do nothing” mouseAbort to your tool ?
on mouseAbort arg do ()
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.
So… I might be better off with a helper plugin, extending “Dummy” then?
what is the final object type for the power line ? if its mesh you’re best going off simpleObject
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!