extrudeEdge in simpleObject

extrudeEdge in simpleObject

bhnh
Advocate Advocate
619 Views
9 Replies
Message 1 of 10

extrudeEdge in simpleObject

bhnh
Advocate
Advocate
I'm experimenting with my first geometric simpleObject plugin. For one step (or two, technically) I'd like to Extrude an array of edges in the same fashion as the ExtrudeEdge tool of an EPoly; in other words, set both the extrusion height and the base width by dragging the mouse. I can't seem to find an Extrude method in the Reference that would do this. Help, please? Many thanks.

Edit: It occurs to me that, for my purposes, using the mouse as a tool is optional. I'd be just as happy to enter all the parameters in a rollout and then click a "Create" button.
0 Likes
620 Views
9 Replies
Replies (9)
Message 2 of 10

Steve_Curley
Mentor
Mentor
Short answer? meshop.extrudeEdges

Slightly longer answer. You'll have to hop around the MaxScipt Help a bit to gather all the required info, but basically a "Scripted SimpleObject Plugin" creates a TriMesh so you need to use the TriMesh (Editable Mesh) functions to do what you want. The mouse-related stuff is described in the "Scripted SimpleObject Plugin" topic - within the "tool create ()" procedure there's an "on mousePoint click" and an "on mouseMove click" section which (AFAICT) deals with what happens during the initial click-drag-release and a subsequent move-click.

This might not be exactly what you're after, but should give you some ideas.

Have fun 🙂

meshop.extrudeEdges is on the "Meshop Edge Methods" help page

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 10

bhnh
Advocate
Advocate
meshop.extrudeEdges is what I was originally looking at, Steve. But what I don't see there is the creation of the base width...


meshop.extrudeEdges <Mesh mesh> <edgelist> <float height> \ dir:<{<point3 dir> | #independent | #common}=#independent> \ node:<node=unsupplied


When I extrude an EPoly edge four new verts are created to comprise the base. As far as I can see (and yes, I've tried it) with the meshop.extrudeEdges method only two new verts are created; there's no base width. Or am I missing something?

BTW, are you equipped to view .swfs on your machine? Someone, seems it was either you or Don, had mentioned he didn't have a FlashPlayer installed.
0 Likes
Message 4 of 10

Steve_Curley
Mentor
Mentor
That would be me - I do have flash on the Max pc, not on this one (which I use for the 'net). I can view them if necessary.

Looking at the example shown in the help there should be a way to do what you want - it looks like it's more of a bevel than an extrude
(like the bevel does an extrude on an EPoly polygon). Or maybe I'm seeing the example differently to you - it sure looks like the extruded
edge is larger than the one it was extruded from.

As for the vertices - I honestly don't know. An edge (by definition) already has 2 vertices, so extruding it should use those 2 plus 2
new ones - I would think. That assumes you're extruding an existing edge, of course. Post a link by all means - It would help to see
exactly what you're trying to do.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 10

bhnh
Advocate
Advocate
For what it's worth, here's a simulation of what I'm eventually after... simpleObject simulation. I'm thinking this may well be done by extending Cylinder.

Happy New Year, BTW. Shouldn't you be imbibing right about now?
0 Likes
Message 6 of 10

Steve_Curley
Mentor
Mentor
Hmmm - I see what you mean. I think the "bevel" effect is being done by separating the X and Y motion of the mouse and affecting the result appropriately. I'll have a look tomorrow and see if I can work it out, but I've not really played with plugins much, so this is "Terra Incognita" for me as well.

And you're quite correct - the bottle and glass are right here, ready and waiting 🙂

Happy New Year!

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 7 of 10

bhnh
Advocate
Advocate
OK, Steve, I believe I've tracked the reference down... MAXScript Ref > Contents > MAXScript Language Reference > 3ds Max Objects > Modifier: MAXWrapper and SpacewarpModifier: MAXWrapper > Modifier and Spacewarpmodifier Types > Modifiers > Mesh Editing > Edit_Poly: Modifier (whew!). Under Edit Vertices/Edges/Borders/Polygons/Elements...


<Edit_Poly>.extrudeEdgeHeight Float default: 0.0 -- animatable; world units; Edge_Extrude_Height

<Edit_Poly>.extrudeEdgeWidth Float default: 0.0 -- animatable; world units; Edge_Extrude_Width


How to use this, I haven't a clue at the moment. Just finding it calls for a bit of a lie-down.
0 Likes
Message 8 of 10

Steve_Curley
Mentor
Mentor
Nice bit of detective work there Bruce 🙂
Sorry for the late reply, got a bit sidetracked 😞

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 9 of 10

bhnh
Advocate
Advocate
got a bit sidetracked


What? Taking time off on a holiday?? Shameful!

While this stuff's been tracked down, I'm not finding how to utilize it.
0 Likes
Message 10 of 10

bhnh
Advocate
Advocate
First off, thanks for indulging me as I feel my way along with this. I wish there were more sample scripts in the Help files; as it's set up now, it's like getting a detailed description list of every part of car without describing how to put the parts together, IMHO. Oh well, be that as it may...

I've progressed a bit more on script-invoking operations in the Modify panel. The following selects all the length edges on a cylinder:

-- create a cylinder
c = cylinder height:50 heightsegs:1 sides:8
-- convert it to an EPoly
convertToPoly(c)
-- select the first length edge (this is presuming the number of sides will be a variable)
polyop.setEdgeSelection c #{6}
-- select the cylinder
select c
-- access the Modify panel
max modify mode
-- go to the Edge subobject level
subobjectlevel = 2
-- invoke the "Ring" button
c.ButtonOp #SelectEdgeRing


Next step is to figure out how to invoke the Extrude operation.

I once did an animated greeting card which ended with a swarm of bees forming the words, "Happy Birthday". My wife, in trying to figure out how it was done, speculated that I had added a line of code which read, "bees.spellOutHappyBirthday". I guess I'm still in the process of looking for the MAXScript equivalent for that command. :roll:
0 Likes