When I load my curve through a loader and use ls() I get the same result.
The Knots is different from what i seen in the egg file.
Well, i tried “egg-load-old-curves 0” to see my curve. It looks as it should. And when i tried to replace the Knots values in the file on the values from pview, curve looks different.
Yes, but in “visible” mode it’s looks similar as original in Blender, i.e. in “visible” mode knots are not changing, but in “visible” ls() not output information to verify this.
OK, so the problem is with the older NurbsCurve interface in Panda, which supports only nurbs curves that begin and end exactly at their endpoints. This requires that the initial and final 4 knot values all have the same value, so it quietly enforces this.
The good news is that the newer NurbsCurveInterface (and its companion RopeNode) interface in Panda supports fully-general nurbs curves, such as this one. To use the newer interface instead of the old one, set:
egg-load-old-curves 0
and be sure to empty your model-cache so it reloads the egg file. You’ll find that the RopeNode contains a NurbsCurveInterface object that actually has all of the specified knot values.
The only downside to the newer interface is that it doesn’t integrate with the Mopath interface, so you’ll have to write your own task or LerpFunctionInterval if you want to fly an object along this curve.
um, why?
I mean its not like its hard to write a task, it’s just convenience (like working with Sequences/Parallels), we don’t need any intervals since we have task, but its nicer.
Hmm, you’re right, looks like something about RopeNode doesn’t work with the cache. I’ll fix it, but for the meantime you can use loader.loadModel(‘curve.egg’, noCache=True).
Right, it’s not at all difficult to make Mopath support RopeNode, but no one has volunteered to do it yet. Would you like to be the person who does it?
You know, Im not a C++ user. I think this is the things the original devs should add when they get the time, as most people don’t know of this issue to begin with.
Not quite - if I’ll specify the correct number of subdividing (> = number of control points), then the visualisation of the rope will changing respectively.
That parameter doesn’t really have any meaning, except as a hint to Mopath. In the old NurbsCurve days it was preserved through the egg loader and available as a parameter on NurbsCurve for Mopath to find and read. Maybe today it should become a tag on the node.
setPos, setHpr, etc. should certainly work on RopeNode; it’s a node like anything else.