Is it possible to use Maxscript to extract the Custom Section of a Sweep Modifier ?

I have a batch of sweep objects I want to go through so that I can process them in some way.

The first step I need to accomplish is to go through my set of selected objects (each object is just a shape with a Sweep Modifier).

I want this script to do the following;

For each selected object;

1) Set the current layer to the layer of the currently worked on Selected Object.

2) Store the name of that currently worked on Selected Object.

3) Extract an Instance of the Custom Section that is of that Sweep Modifier and *name* that Instance as the stored name of the currently worked on Selected Object but with the Suffix "_SP".

4) Assign that Instanced Custom Section back to the currently worked on Selected Object.

Repeat for all other Selected Objects.

Please can someone help me write this - I am looking through the manuals but really not getting very far :(

Many thanks for any help you can give.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
JezUK's picture

That's it! That's exactly

That's it!

That's exactly what I wanted :)

Thank you so, so, so, so much :)

JezUK's picture

Happy to pay for someone to

Happy to pay for someone to do this if need be :)

jahman's picture

.

1) Set the current layer to the layer of the currently worked on Selected Object.
2) Store the name of that currently worked on Selected Object.

could you decipher that? you want to move new shape to object's layer?

max create mode
for s in selection do
(
	for m in s.modifiers where isKindOf m sweep do
	(
		if m.CustomShape == 1 and m.Shapes[1] != undefined do
		(
			local shp = SplineShape name:(s.Name + "_SP")
			shp.baseobject = m.Shapes[1]
			updateShape shp
 
			m.CustomShape = 1
			m.Shapes[1] = shp
 
			s.layer.addnode shp
		)		
	)	
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.