CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
reply share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 04-09-2014, 08:27 AM   #1
Neuro69
PRO
portfolio
Steinar
Lyngdal, Norway
 
Join Date: May 2008
Posts: 94
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-11-2014, 07:33 AM   #2
Neuro69
PRO
portfolio
Steinar
Lyngdal, Norway
 
Join Date: May 2008
Posts: 94
Bump. There are perhaps not that many who could answer this with confidence, but any ideas are welcome.
 
Old 04-11-2014, 08:45 AM   #3
Klvnk
Expert
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 721
Code:
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-11-2014, 09:01 AM   #4
Neuro69
PRO
portfolio
Steinar
Lyngdal, Norway
 
Join Date: May 2008
Posts: 94
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-11-2014, 09:20 AM   #5
Klvnk
Expert
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 721
have you tried adding a "do nothing" mouseAbort to your tool ?
Code:
on mouseAbort arg do ()
 
Old 04-11-2014, 10:57 AM   #6
Neuro69
PRO
portfolio
Steinar
Lyngdal, Norway
 
Join Date: May 2008
Posts: 94
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-11-2014, 11:07 AM   #7
Klvnk
Expert
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 721
you need to create something even if it's an empty mesh.
 
Old 04-11-2014, 11:10 AM   #8
Neuro69
PRO
portfolio
Steinar
Lyngdal, Norway
 
Join Date: May 2008
Posts: 94
So... I might be better off with a helper plugin, extending "Dummy" then?
 
Old 04-11-2014, 11:12 AM   #9
Klvnk
Expert
 
Klvnk's Avatar
portfolio
Klunk
United Kingdom
 
Join Date: Feb 2014
Posts: 721
what is the final object type for the power line ? if its mesh you're best going off simpleObject
 
Old 04-11-2014, 11:54 AM   #10
Neuro69
PRO
portfolio
Steinar
Lyngdal, Norway
 
Join Date: May 2008
Posts: 94
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-11-2014, 03:39 PM   #11
AlpineMan
Frequenter
 
AlpineMan's Avatar
Chris Johnson
USA
 
Join Date: Aug 2003
Posts: 283
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 10:25 PM.


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