Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

spline: Section: Create Shape in maxscript

spline: Section: Create Shape in maxscript

Anonymous
Not applicable
2,612 Views
7 Replies
Message 1 of 8

spline: Section: Create Shape in maxscript

Anonymous
Not applicable

How do I effect a Create Shape in a Section spline?   equivalent to:

cap.png

0 Likes
Accepted solutions (2)
2,613 Views
7 Replies
Replies (7)
Message 2 of 8

drew_avis
Autodesk
Autodesk
Accepted solution

I believe convertToSplineShape() is what you're looking for.  See the example in this help topic:

https://help.autodesk.com/view/MAXDEV/2021/ENU/?guid=GUID-026FCDF6-0944-4A22-A233-61506F67C58C

 

Hope that helps,

Drew



Drew Avis
Content Experience Designer
0 Likes
Message 3 of 8

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
(
	s = instance $ name:#blah
	converttosplineshape s
)
0 Likes
Message 4 of 8

Swordslayer
Advisor
Advisor

That is not the same thing, the Create button does a cleanup of overlapping segments and welds the parts into usable shape, while converting to spline does none of those things.

Message 5 of 8

denisT.MaxDoctor
Advisor
Advisor

@Swordslayer wrote:

That is not the same thing, the Create button does a cleanup of overlapping segments and welds the parts into usable shape, while converting to spline does none of those things.


true... thanks!

 

Message 6 of 8

denisT.MaxDoctor
Advisor
Advisor

@Swordslayer wrote:

That is not the same thing, the Create button does a cleanup of overlapping segments and welds the parts into usable shape, while converting to spline does none of those things.


I've looked at the related code (example in SDK) ...
Yes, the developers do additional processing and optimization of the resulting spline object, although they themselves admit its dubious value. In general, if the conversion to splineshape is not sufficient for the task and cannot be solved by the splineshape methods after conversion, then it is unlikely that "Create Shape" will do much better.

 

0 Likes
Message 7 of 8

istan
Advisor
Advisor

I used sectioning recently in a customer project and ended up writing a lot of MXS code (also for working around of AD bugs). Honestly, If I need sectioning again, I will start with my own algorithms in C++.

0 Likes
Message 8 of 8

Anonymous
Not applicable

Thanks I was looking at this function but didn't think it would do as expected.   And making an instance copy preserved the Section for later use, as I'm wanting to slice a Displace(d) image plane at several Z levels (think: Mount Rushmore).

I'll post my script for others when done, like:

for z = min to max by zincr do (
s = instance $ name:#blah+z
converttosplineshape s
select s
modPanel.addModToSelection(SplineRelax()) ui:on
$.modifiers[#Spline_Relax].showknots = on
$.modifiers[#Spline_Relax].amount = 1.0
modPanel.addModToSelection(Optimize_Spline()) ui:on
$.modifiers[#Spline_Relax].showknots = on
$.modifiers[#Spline_Relax].PERCENT = 80
modPanel.addModToSelection(Extrude()) ui:on
$.modifiers[#Spline_Relax].amount = 2.0
	modPanel.addModToSelection (Cap_Holes ()) ui:on
)
0 Likes