How does one create a custom modifier?


#1

Hello all,

I’m a bit surprised the search function couldn’t find a single topic on this.

I would like to create a new modifier for 3ds Max. To start with something easy, its function would be relatively simple: it would select all open edges of a model (all edges belonging to a single face only), and then turn that into a vertex selection. Or even a simpler modifier which would just deselect anything that is currently selected (vertices/edges/faces).

But as said, I haven’t been able to find any instructions on how to get started with making new, custom modifiers. Neither have I been able to edit any existing modifiers since their contents are a non-plain text with gibberish characters, suggesting that some sort of a specialized software may be required for this task.


#2

[font=System]The term “Start with something easy” is relative :slight_smile:

To begin:
[/font][font=System]Open the Maxscript Help and search for “Developing Scripted Plug-ins”. The is a section on developing a scripted material modifier.[/font]
[font=System]
Next you can search [/font][font=System]for selecting open edges on a Poly object[/font][font=System]:[/font]
<bool>PolyToolsSelect.NumericEdge <bool>withinSel
[font=System][size=3]
then look into a convertSelection[/size][/font] to convert edge selection to vertex[font=System][size=3]:
[/size][/font][size=-0][size=2][font=Courier New][size=2]<integer><EditablePoly>.ConvertSelection <enum>fromSelLevel <enum>toSelLevel [requireAll:<bool>][/size][/font][/size][/size]
[font=Arial]
[font=System][size=3]That should at least get you started :)[/font]
[/size][/font]


#3

Thank you Sir! I’ll have a look at it, and see how far I can… uh oh, I spot a brick wall on the horizon!

Well, hopefully not. :wink:


#4

I did manage to create a modifier which selects faces which are using a certain material ID, controlled by a spinner in the UI.

However, now that I’m trying to write a modifier to select all open edges in the object, I can’t seem to figure out how to write a UI-less modifier. For example, here’s my code for a simple UI-less modifier which should select edges 1 - 40 in the editable poly object, but which instead results in the following error message: “Syntax error: at path name, expected Plugin clause”:


plugin modifier myMod
name:"Select open edges"
classID:#(685325,201103)

( 
		$.EditablePoly.SetSelection #Edge #{1..40}
)

The previous modifier I wrote used rollouts and a “when spinner changes value do the following” action. It worked fine, but this one has me stumped.


#5

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.