PDA

View Full Version : how to make a button on a rollout that "only" delete any kind of spline obj


Tinson
10-18-2008, 07:42 PM
Hi! I made a rollout like this

try(destroyDialog test001)catch()
rollout test001 "Test"
(
group "Make things:"
(
button mkbox "make box" width:100
button mkcircle "make circle" width: 100
button mkstar "make start" width: 100
button deleteSpObj "deleteSlpineObj" width: 90
)

on mkbox pressed do
(
b1=box()
)
on mkcircle pressed do
(
c1=circle()
)
on mkstar pressed do
(
s1=star()
)
on deleteSpObj pressed do
(
***????????What should i type here??????????????????????***
)
)
createDialog test001

as you can see, this rollout can make box, circle and star. I want to make a button that only delete spline objects and the box stay in the scene. Just click the "deleteSlpineObj" button once and all spline objects will be gone.

I don't know how to do that. Thanks in advance

fudongmu
10-20-2008, 01:01 AM
delete shape

LoneRobot
10-20-2008, 07:53 AM
not sure that would work, it is better to screen the objects via the superclass shape and remove them!


on deleteSpObj pressed do
(
for o in objects do
(
if superclassof o == shape do delete o
)
)

ZeBoxx2
10-20-2008, 01:04 PM
problematic either way are NURBS curves... they're in the shapes group -and- their superclass is shape.. but it's not a spline shape.

Tinson... gotta wonder, though... do you really want to delete -all- spline shapes in a scene... or only those created through you rollout/interface/tool ?

Gravey
10-20-2008, 01:23 PM
how about: delete (for o in objects where o.category == #Splines OR o.category == #Extended_Splines OR o.category == #shape collect o) The above will delete all splines and filter out NURBS

LoneRobot
10-20-2008, 02:50 PM
problematic either way are NURBS curves...

does anyone still use them Rich? :D good point though.

Tinson
10-21-2008, 07:56 AM
To: ZeBoxx2
i think I want to delete all the spline objects in the scene......no matter which are created from script or by mouse(click and drag).

To everyone:
After reading all the replies, i think "delete shape" is good for now. Frankly, I just started learning max. I just realize there are many ways to delete spline objects according to what LoneRobot and Gravey said. It takes time for me to understand every single word you typed there. I will try those method in the future.

Thanks very much to you all for solving my problem.

JHN
10-21-2008, 10:37 AM
does anyone still use them Rich? :D good point though.

Definitly, have you ever noticed the difference of a camera on a spline path or a nurb curve? If you get small jitters with a spline, try a nurb!

But that's all really :)

-Johan

CGTalk Moderation
10-21-2008, 10:37 AM
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.