This script core dumps blender 2.28, what am I doing wrong?

I am trying to put an sphere to spin around its axis, like a planet. The last line was originally


 ob.setIpo(ipo)

but the new python API complains that it’s not allowed, so I tried to link the objects (last line) then crash!. Any hint?


from Blender import Ipo, Object
from math import *

ipo = Ipo.New('Object', 'ObIpo')                   
curve = ipo.addCurve('RotZ')                     
curve.setInterpolation('Linear')     
curve.setExtrapolation('Cyclic')    

curve.addBezier((0.0, 0.0))          
curve.addBezier((100.0, 2*pi))     

curve.update()                              

ob = Object.get('Planet')
ob.link(ipo)

I forgot to say that the original script worked on 2.27, didn’t worked on 2.28 and worked again (until before the last line) with 2.28a.

try to remove update line…

Segfaults! But if I insert a rot keyframe by hand, and run it, it aparently works, I can see lines in the ipo window, but the object still doesn’t move.


curve.setInterpolation('Linear')
curve.setExtrapolation('Cyclic_extrapolation')

curve.addBezier((0.0, 0.0))
curve.addBezier((100.0,9.0))      

This worked fine in 2.28a.

Hi,

can you send me a .blend file that causes the crash? I’ve tried your script, but at my system, I cannot get it to crash. (e-mail: [email protected])

Blender should under no circumstances crash. When a user makes an error, this should be notified in a nicer way :slight_smile:

Thanks in advance,
Michel

crashes on my pc too, like such ‘link’ lines did on 228
simplistic workaround:

when you create an object, just add an ipo to it in f6 window. Then just addCurve-s and points to it’s already present ipo (which acts as a sort of placeholder and prevents ‘link’ crashes) and do curve.update() via your script. Works smooth for me. I guess simpler=better in such turbulent times :-).

btw: there is a plea for rvk help down in the forum. Can some of gurus ‘p l e a s e’ look at it, contemplate it and ‘please again’ post some sort of working snippet. (this is above my comprehention plus, it kills my time badly)