Forum: Poser - OFFICIAL


Subject: How to randomize prop rotation values?

pitklad opened this issue on Nov 30, 2012 · 5 posts


markschum posted Fri, 30 November 2012 at 6:47 PM

the line  "for actor in scene.Actors():" is going to go through every prop, light, camera etxc in the scene.

def main():<br></br><br></br>       actor = scene.CurrentActor()<br></br><br></br>        # ues try/except to avoid trying to rotating actors that can not.<br></br><br></br>        try:<br></br><br></br>            if actor.IsProp():<br></br><br></br>                print actor.Name()<br></br><br></br>                actor.ParameterByCode(poser.kParmCodeXROT).SetValue(rnd())<br></br><br></br>                actor.ParameterByCode(poser.kParmCodeYROT).SetValue(rnd())<br></br><br></br>                actor.ParameterByCode(poser.kParmCodeZROT).SetValue(rnd())<br></br><br></br>        except:<br></br><br></br>            pass<br></br><br></br>make the change and get the indentations right and it will do only the selected actor (prop)<br></br><br></br><br></br>