Notifications
Clear all

[Closed] splineOps outside of stack

I’m trying to script some shape editing. Mainly inserting vertices and deleting segments. Some of the operations I have tried work fine without having the spline object selecting in the stack, but some don’t.

See this example code:

(
	testCut = circle radius:10
	convertToSplineShape testCut
	
	setSegSelection testCut 1 #(3,4)
	splineOps.delete testCut
)

The deletion at the end will only work with the stack selected. Strangely enough, it will not give errors when running it otherwise. Do I really have to move in and out of the stack if I want to script splineOps? polyOps don’t act that way, do they?

Thanks!

2 Replies

According to the documentation the Node must be selected in order to use the splineOps structure methods:

“…These methods reside in the splineOps global structure. These methods effectively “push the button” in the Modify panel. In order to use these methods, the node must be selected and the Modify panel open…”

However, you can use other methods which do not require the Node to be selected such as:addNewSpline(), addKnot(), deleteSpline(), deleteKnot(), etc., but more advanced operations like Outline among others, would need to be manually implemented in Maxscript.

Thanks!

Surprised at the inconsistency here, with polyOps allowing you to work outside of the stack. Well well, I managed to find a workaround for my specific case