def setAnimation(self,obj,animation,transition=None,force=False):
self.ensureModelData(obj)<EOL>data = obj._modeldata<EOL>if animation not in self.modeldata["<STR_LIT>"]:<EOL><INDENT>raise ValueError("<STR_LIT>"%(animation,self.modelname))<EOL><DEDENT>if data.get("<STR_LIT>",{}).get("<STR_LIT>",None)==animation and not force:<EOL><INDENT>return <EOL><DEDENT>anim = self.modeldata["<STR_LIT>"][animation]<EOL>if transition is None:<EOL><INDENT>transition = anim.default_jt<EOL><DEDENT>anim.startAnimation(data,transition)<EOL>if "<STR_LIT>" not in data:<EOL><INDENT>data["<STR_LIT>"]={}<EOL><DEDENT>adata = data["<STR_LIT>"]<EOL>adata["<STR_LIT>"]=animation<EOL>if "<STR_LIT>" in adata:<EOL><INDENT>pyglet.clock.unschedule(adata["<STR_LIT>"])<EOL><DEDENT>def schedfunc(*args):<EOL><INDENT>anim.tickEntity(data)<EOL><DEDENT>pyglet.clock.schedule_interval(schedfunc,<NUM_LIT:1.>/(anim.kps if anim.atype=="<STR_LIT>" else <NUM_LIT>))<EOL>adata["<STR_LIT>"] = schedfunc<EOL>
Sets the animation to be used by the object.

See :py:meth:`Actor.setAnimation()` for more information.