[Bf-python] blender python script error

Bassam Kurdali bassam at urchn.org
Thu Nov 7 18:01:20 CET 2013


Try

bpy.context.scene.frame_set()

Operators rely on context so it can get hard to satisfy them (you could also try making a timeline window visible). You can override context by paying an optional dict to the operator but I've found this tricky to get right in practice.
Oh, and welcome to this blender thing,
Bassam

 "Cook, Rich" <cook47 at llnl.gov> wrote:

>Hi,I'mnewtothishereblenderthingie.Iwastryingsomecodeouttoimportafewmeshesfromasciencerun,andamgettinganerrorIcannotgetpast.Iwasgoingtoimportthetimestepsasseparatemeshes,thensetkeyframesonvisibilityforeachmeshatdifferenttimestepsinordertoanimatethem.Perhttp://blenderscripting.blogspot.de/2011/07/scripted-keyframing-of-hide-hide-render.htmlIamgettingthefollowingerror:bpy.ops.anim.change_frame(frame=5)Traceback(mostrecentcalllast):Fileblender_console,line1,inmoduleFile/Volumes/MacProHD/cook47-stuff/Programs/graphics/Blender/blender.app/Contents/MacOS/2.68/scripts/modules/bpy/ops.py,line188,in__call__ret=op_call(self.idname_py(),None,kw)RuntimeError:Operatorbpy.ops.anim.change_frame.poll()Expectedantimeline/animationareatobeactiveIdohaveatimelinevisibleintheGUI.I'mnotsurewhatblenderistryingtotellme.I'mprobablygoingtochangeapproachesandjustloadonemeshatatime,setupthescene,render,andmovetothenext,etc.However,mytechnicalcuriosityhasthebestofmehere.I'dliketounderstandwhyIcannotsetatimestephere.Thanks!<spanclass="Apple-style-span"style="border-collapse:separate;-webkit-border-horizontal-spacing:0px;-webkit-border-vertical-spacing:0px;color:rgb(0,0,0);font-family:Monaco;font-size:13px;font
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20131107/fe285f10/attachment.html>


More information about the Bf-python mailing list