Notifications
Clear all

[Closed] Scripted Line

Why is it not possible to have a scripted Line shape and do simple Spline operations on it?
While a normal Line shape can have Spline operations on it, a scripted Line cannot.
I don’t seem to get anything done on a scripted Line shape.

Davy

8 Replies

Are you making sure to run


update [spline]

After knot operations?

 JHN

Tyson, I think you mean

updateShape $

-Johan

well, I know to update the shape but I cannot add a new spline to my scripted Line.

addNewSpline does not work because its not a shape or editable spline…while it is since it’s based on a Line shape.

Davy

Sorry, you’re right

 JHN

Time to show some code, I guess.

-Johan

That will make a scripted Line plugin:

plugin shape ExtentedLine
name:"ExtendedLine"
classID:#(1, 1)
extends:Line
category:"Splines"
(
)

Executing this on a created ExtendedLine:

addNewSpline $

Errors out: “– Runtime error: Spline operation on non-spline: ExtendedLine”

It works on a regular Line shape but not on the scripted Line.

Davy

 JHN

Alright, looks like a bug or a limitation to me. I can indeed add knots or splines to a standard line, but extending a line disables that possibilities. Converting it to a splineshape does work, but I guess you don’t want that.

-Johan

I have read before that no one is actually getting anything out of a scripted Line object so I was just checking to make sure.

Well I don’t mind an editable spline but how would one turn it into a plugin that stores information and can rebuild or adjust the spline based on parameters?

Scripting is not good enough cause you miss out having a true object.

Davy