Notifications
Clear all

[Closed] MaxScript : Lightwave Smoothwires – please help

WTF one minute you maxers say you hate lightwave and the next minute you are trying to steal some of lightwave stuff. As an lightwave user i have to say that you need to make up your mind and stop using lightwave stuff if you say it is crap.

cracker…

Go rant somewhere else please, this has nothing to do with that and it’s not the purpose of this thread nor is it constructive.

Some people here like to use lightwave as well and would like to see something similar in Max, that’s all. It’s really not the kind of issue you are making it out to be…

Don’t turn this into some kind of software war issue!

Originally posted by googlo
[B]cracker…

Go rant somewhere else please, this has nothing to do with that and it’s not the purpose of this thread nor is it constructive.

Some people here like to use lightwave as well and would like to see something similar in Max, that’s all. It’s really not the kind of issue you are making it out to be…

Don’t turn this into some kind of software war issue! [/B]

Hey i wasn’t trying to come off in a bad way. sometime iam no good with words. all i was doing was stating some facts. But the script stays true to lightwave subpacth. Great work. And soory again for getting anyone mad.

xasteycracker: lose this attitude please.

It’s ok,

Hey everyone check this out! This version updates automatically! the only place (of those that i’ve tested) that doesn’t work right is the ‘slice plane’ option in the geometry rollout for the polyobject, the other slicing options seeme to be working. It ‘deson’t crash or anything it just boots out the slice plane without there being any effect, but it seems to work with most all the poly editing features like ‘bevel’ ‘extrued’ ‘poly hinge around edge’ ‘connect edges’, cut, etc… Even cutting works so far

I haven’t set up the interface of the script to be anything speical, but it works really good I think.

Remember in order to use it, copy the script text from the quote below holidng it all and either run it directly in Max by pasting it into a new maxscript editor window and then pressing Ctrl-e at the same time to start it, or copy and past it into a new maxscript editor window and then click-drag the entire contents of the script onto a blank space of a toolbar (like the helper one–it has a lot of extra space on it) then it will become available as a push button just like a macroscript. if you want to name it right click on the macroscript and then choose “Edit appearanc” there you can select the naming option and give ithe macroscript button a name.

The script basically uses two timer items available for you use in rollouts; one to check the mesh for topology changes every millisecond and another one to handle when the auto-updating should occur to the mesh. They ‘signal’ each other when to activate and when to deactate.

Anyway, here it is:

–Beginning of polylines script

rollout quickOutliner “Polylines”
(

local x,y,z
local OM
local originalss

checkbutton dotracker “Activate Polylines”
button updater “Update Polylines” enabled:false
checkBox cageshow “Show Poly Cage” enabled:false
checkBox autoupdater “Auto Update” enabled:false
timer topochecker interval:1 active:false
timer topoedit interval:1 active:false

on quickOutliner open do (

try (If $.showcage=true then cageshow.checked=true else cageshow.checked=false)\
catch (messageBox “Must have an editable poly object
selected first.”)
)

on cageshow changed arg1 do ( if arg1 \
then ($.showcage=true) else ($.showcage=false)
)

on dotracker changed arg1 do (

undo off ( – prevents enclosed code from crashing max
– when trying to undy history to the object
– but doesn’t actually affect undo history
– of anything else outside of the paranthesis
– i.e. actual editing history of the
– editable poly is safe

originalss=subObjectLevel –*used so the utility can
– can keep track of user
– subselections

try (

if arg1 then (

OM=($.mesh).numverts

dotracker.caption=“Deactivate Polylines”
autoupdater.enabled=true
cageshow.enabled=true
updater.enabled=true
modPanel.addModToSelection (Edit_Mesh name:“Polylines”) ui:on –*applies editMesh modifier to polyobject
z=copy $.baseObject –*Stores poly info in variable
polyOp.setEdgeSelection z #All –*sets poly edges internally
z.surfsubdivide=$.baseObject.surfSubDivide; –*performs what has happend
z.iterations=$.baseObject.iterations –to the poly object in Max
–to the poly object in the
–variable
y=z.mesh; –*Convert and store the poly object into y
– NURMS Results ‘baked’ into mesh object and as a result
– poly subobject selections are carried over
– as well
yes=getEdgeSelection y – get the mesh edges that are selected

setEdgeSelection $ $.modifiers[“Polylines”] -yes –*Invert selection and apply to
– them to the editMesh modifier
modPanel.setCurrentObject $.modifiers[“Polylines”] –*Make all selected edges in
subobjectLevel = 2 –mesh modifier invisible
meshOps.invisibleEdge $.modifiers[“Polylines”]
subObjectLevel = 0
modPanel.setCurrentObject $.baseObject –*resets the modify panel back to the
subObjectLevel=originalss – the poly object level and user
– subobject selection
showendresult=true –*Places focus at top of the modifier stack so smooth
– polylines will be seen while still at editable poly
– level

)
else(
try(–*this causes the utility to not explode if there isn’t
autoupdater.checked=false
autoupdater.enabled=false
topochecker.active=false
deleteModifier $ $.modifiers[“Polylines”]– a modifer to delete (editMesh)
updater.enabled=false
cageshow.enabled=false
dotracker.caption=“Activate Polylines”
showendresult=true
subObjectLevel=originalss
)catch()
)
)
catch(
messageBox “Select an object that is at it’s
base level an Editable Poly”
deleteModifier $ $.modifiers[“Polylines”]
doTracker.state=false
)

) – undo context end
)– dotracker button end

on updater pressed do (
undo off (
originalss=subObjectLevel
modPanel.addModToSelection (Edit_Mesh name:“Polylines”) ui:on
deleteModifier $ $.modifiers[“Polylines”]
z=copy $.baseObject
polyOp.setEdgeSelection z #All
z.surfsubdivide=$.baseObject.surfSubDivide;
z.iterations=$.baseObject.iterations
y=z.mesh
yes=getEdgeSelection y
setEdgeSelection $ $.modifiers[“Polylines”] -yes

modPanel.setCurrentObject $.modifiers[“Polylines”]
subobjectLevel = 2
meshOps.invisibleEdge $.modifiers[“Polylines”]
subObjectLevel = 0
modPanel.setCurrentObject $.baseObject
subObjectLevel=originalss
showendresult=true
)
) – end updater button
–===============================THIS PART HANDLES THE TOPOLOGY CHECKING AND Auto-UPDATING==========================
on autoupdater changed arg1 do (
if arg1 then topochecker.active=true else (topochecker.active=false;topoedit.active=false)
) – end of autoupdater check box

on topochecker tick do (
–print “topochecker, checking…”
if (OM!=($.mesh).numverts) then (topoedit.active=true;topochecker.active=false)
if topochecker.ticks==5000 then gc()
) – end of mtopopchecker timer

on topoedit tick do (
state1=(mouse.buttonStates[1]==true and (mouse.mode==2 or mouse.mode==1))
state2=(mouse.buttonStates[1]==false and (mouse.mode==2 or mouse.mode==1))
state3=(mouse.buttonStates[1]==true and mouse.buttonStates[3]==true)
–print “topedit checking…”

if state3 then (topochecker.active=true;topoedit.active=false) else (

if (state1 or state2) then () else (–print “update Mesh”

undo off(
originalss=subObjectLevel
modPanel.addModToSelection (Edit_Mesh name:“Polylines”) ui:on
deleteModifier $ $.modifiers[“Polylines”]
z=copy $.baseObject
polyOp.setEdgeSelection z #All
z.surfsubdivide=$.baseObject.surfSubDivide;
z.iterations=$.baseObject.iterations
y=z.mesh
yes=getEdgeSelection y
setEdgeSelection $ $.modifiers[“Polylines”] -yes
modPanel.setCurrentObject $.modifiers[“Polylines”]
subobjectLevel = 2
meshOps.invisibleEdge $.modifiers[“Polylines”]
subObjectLevel = 0
modPanel.setCurrentObject $.baseObject
subObjectLevel=originalss

showendresult=true;
)

OM=($.mesh).numverts;topochecker.active=true;topoedit.active=false

)

if topoedit.ticks==5000 then gc()
) – end of topoedit timer

)
)
createDialog quickOutliner style:#style_toolwindow

–End of polyline script

googlo

really great. it works.
btw. you forgot a ” ) ” before the createdialog command.

Thanks Proteus.

thanks for catching that error too, I edited the post and fixed it

I should also have said that the ‘auto update’ has to be turned by checking the “auto update’ option in the dialog that appears.

I left the manual update button in just in case it was needed for updating where the automatic way might fail.

another issue i found

the auto update increases the memory usage. the gc() function seems not to work as it should. open task manager and take a look at the memory usage.

i have pasted the script and run it… the poly lines…but it doesnt work…asks for a entity…that is an editable poly at its base mesh…

so i make a box… set it to edit poly… than use the script… but it doesnt do anything??!

it just gives another sort of edit poly modifier…dont see the differents in them…

yep same here… nothing changes… ehere do i have to put it in the stack? i had it over the epoly and on top of the stack, nothing happened

Page 9 / 15