[Closed] helper objects
Does anyone know how to create custom helper objects. I would like to create a dummy type object in the shape of an arrow.
regards
Nebille
The MAXScript Reference shows how to create a scripted Helper plug-in with custom mesh display… You can build any mesh as in scripted geometry plugins and return it from the on GetDisplayMesh do () handler which was added in Max 7.
If you are using Max 6 or earlier, you cannot use that.
thanks bobo.
In order to create the mesh do i have to build it using script or can i build in the viewport conventionally. The reason i ask is because it would be alot quicker for me to build the object in the viewport rather than script it.
regards
Nebille
What I have done is written a script that reads in the data about an existing mesh and writes out the code about how it should be build. Then I can use that in the code for the helper.
I made the same thing, PEN – but there are a lot of exceptions and things it doesnt do. would you be willing to share that?
Nebille,
there’s Great script that will do that
with click of a button (some options included)
It’s scripted plugin called “Ghost”.
http://www.scriptspot.com/scripts/web_upload/Rodrigo%20Flores/Ghost.zip
Cheers
I just downloaded that Ghost plugin but it doesn’t seem to do this at all, it just makes a non-renderable version of the mesh…it does not generate the script that you would need.
Anyway, I have written a short one today that will generate the script for any spline object…I’m going to use it for this purpose, should be helpful.
fn readSpline ss=
(
output = newscript()
pos = getKnotPoint ss 1 1
format "ss = SplineShape pos:%
" pos to:output
splineCount = (numSplines ss)
--splineCount = 1
for iSpline = 1 to splineCount do
(
format "addNewSpline ss
" to:output
knotCount = numKnots ss iSpline
for iKnot = 1 to knotCount do
(
type = getKnotType ss iSpline iKnot
pos = getKnotPoint ss iSpline iKnot
if (type==#bezier or type==#bezierCorner) then
(
inVec = getInVec ss iSpline iKnot
outVec = getOutVec ss iSpline iKnot
format "addKnot ss % % #curve % % %
" iSpline type pos inVec outVec to:output
) else
format "addKnot ss % % #curve %
" iSpline type pos to:output
)
format "close ss %
" iSpline to:output
)
format "updateShape ss
" to:output
)
Ok, it’s not the same thing,
but I couldn’t agree with you that ” it doesn’t seem to do this at all “.
It’s just a quick way for creating helpers.
Cheers
You’re right, there are different ways to interpret his question…did he want to create a helper object for using in the scene, or as a plugin…
That ghost script does the same as mine and I also have one for spline for creating control objects. I have to go back and see if I can add more things to my helper creator and clean it up into a tool so that people know what to do with it. At the moment it is like most of my scripts and it is a collection of functions.
Heya nebille,
Michale comet has written a tool called spline to mxs which will output the maxscript code to make whatever spline shape you currently have selected – you can draw your custom shape, use the spline2mxs script to output its code and then anywhere you have a position for a vertex in the spline, make sure you put in a multiplier variable to control the scale of the shape so the following co-ordinates for a point [100.00,350.00,500.00] become [100.00scale,350.00scale,500.00*scale] – the scale value can be controlled using the mousetool command in maxscript – you record the point the user has clicked on to begin making the custom shape, and then record the distance their mouse has travelled whicle holding the mouse button – the difference between these two values drives the shape variable and your custom shape will be created in the viewport as you drag. I’ve done this with a few simple shapes for my own helpers and it worked fairly well.
John