PDA

View Full Version : how to add custom shapes to the sweep mod?


antonv
04-04-2006, 06:18 AM
Hi all,

I was reading through the reference about the sweep modifier and it seems like you can add custom shape classes to the sweep.ini file. I've opened it and I couldn't figure out how it works (first time dealing with shape classes and plugins...).

Can anybody give me a hint in which direction to go, or show me an example of a new shape added to the modifier?

Thanks alot!
Anton

rdg
04-04-2006, 02:18 PM
vasilescu_anton,

I took a look at it:

add the name of your custom section in the [Global] section of sweep.ini seperated by a comma.
Add at the end of the file a section named like your custom section.
Assign a unique ClassID
if you have a custom iconfile refence it in the next line, or just copy the line from some other entry
Specifiy the IconIndex in the next line
Specify the number of default values you will pass in the next line using: NumDefaults.
Specify all default Values in this syntax: Default[n] = n-1, type, value
After this restart max and your custom section is available in the built-in section dropdown, but will show no effect on your path.

I guess you also need to create a scripted shape ...

The default values corrspond to the arguments you pass to your shape.

maybe this helps.

Georg

antonv
04-04-2006, 02:21 PM
Thanks rdg, this helps alot with the setup part but any idea on how to make the scripted shape?
I'll read some more and if I come up with something I'll post it here too.

Thanks!

rdg
04-04-2006, 02:33 PM
the classID is not a random unique value, but somehow connected to the classID of the shape you are using.

If you copy some existing classID from ie Wide Flange then this Shape will be used.

Question:
How to convert the classID generated by genClassID() to the format used in the sweep.ini ?


Georg

Bobo
04-04-2006, 06:43 PM
the classID is not a random unique value, but somehow connected to the classID of the shape you are using.

If you copy some existing classID from ie Wide Flange then this Shape will be used.

Question:
How to convert the classID generated by genClassID() to the format used in the sweep.ini ?


Georg

Easy.

Ask the class for its classID :)

angle.classid
#(-1826262992, 0)
rectangle.classid
#(4197, 0)
etc.

These are the same numbers used in the Sweep.ini for Angle and Bar... Same for the rest.

rdg
04-04-2006, 07:40 PM
Thanks Bobo.
Seems this was really the easy part.

As soon as I enter the correct classID MAX crashes when choosing my shape.
I tried the Extended_Rect from the reference.

Maybe this is not suposed to work and one can only use the existing shapes and give them default values ?

-- edit
it works with the default shapes. this gives a lot of possibilities ...
maybe custom shapes need to be compiled and not scripted.
-- edit

Georg

CGTalk Moderation
04-04-2006, 07:40 PM
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.