Problem: add point to an ipocurve (script with blender 2.32)

Hi !

I’ve got some problem to add points to an ipo curve. this is a code that I’ve wrote (it was just an exercise to understand how it works) but it doesn’t work :frowning:



		polyObj = NMesh.PutRaw(poly)
		anIpoBlock = Blender.Ipo.New( 'Object', "Ipo" )

		LocX = anIpoBlock.addCurve( 'LocX' )
		LocY = anIpoBlock.addCurve( 'LocY' )
		LocZ = anIpoBlock.addCurve( 'LocZ' )
		
		LocX.setExtrapolation('Constant')
		LocX.setInterpolation('Bezier')
		LocY.setExtrapolation('Constant')
		LocY.setInterpolation('Bezier')
		LocZ.setExtrapolation('Constant')
		LocZ.setInterpolation('Bezier')
		
		LocX.addBezier((1.0,0.0))
		LocX.addBezier((100.0,13.4284982681))
		LocY.addBezier((1.0,0.0))
		LocY.addBezier((100.0,-5.33330392838))
		LocZ.addBezier((1.0,0.0))
		LocZ.addBezier((100.0,0.0))
		
		
		polyObj.setIpo(anIpoBlock)

it’s working +/- : an ipo block named “Ipo” is linked to the object poly but this ipo block haven’t got any curve. The curves are un a other ipo block name obIpo and I don’t know where does it come from !

How can I do to add the curves in te right ipo bllock ?

By the way, what does it mean :


anIpoBlock = Blender.Ipo.New( 'Object', "Ipo" )

I know that an ipo block named ‘Ipo’ is create but I don’t what is 'Object" and which value can it take.

Somebody can help me ?

By the way, what does it mean :


anIpoBlock = Blender.Ipo.New( 'Object', "Ipo" )


I know that an ipo block named 'Ipo' is create but I don't what is 'Object" and which value can it take.

This part is easy. Let’s look at the documentation for the Ipo module!

New(type, name)
Creates a new Ipo.
Parameters:
type - The Ipo’s blocktype. Depends on the object the ipo will be linked to. Currently supported types are Object, Camera, World, Material.
(type=string)
name - The name for this Ipo.
(type=string)
Returns:
The created Ipo.
(type=Blender Ipo)

So the first param is the type of Ipo we want to create: Object, Camera, etc.

The other part of your problem appears to be a bug in Ipo.addCurve(). I’m looking into this. I’ll have more for you later.

thanks for your help

Yep, it was a bug in Ipo.addCurve(). Normally, I would nag you about submitting a bug report on blender.org, but since the fix is already in CVS, there is no need. It will be available in the next release which is somewhat planned for this weekend.

The doc text I quoted was from the CVS version, by the way, so it may differ from the last release doc.

thank you very much