PoserPython: Query/set the "locked" flag for actors



  • Hello,

    I couldn't find this anywhere in the Python manual:
    Is there a code to query and set the "locked" flag on a figure's actors/body parts?
    I'm talking about the little checkmark you can set in the Poser menu: "Object > Lock Object".

    I have an idea for a script which must access and set this flag.

    Thank you!
    Karina



  • lock = { 'Lock Hand Parts' : 1442 ,
    'Lock Figure' : 1492 ,
    'Lock Actor' : 1497 }

    poser.ProcessCommand( lock )

    I have a full script you can take a look at if you wish.



  • my last comment wont work correctly -

    lock = { 'Lock Hand Parts' : 1442 ,
    'Lock Figure' : 1492 ,
    'Lock Actor' : 1497 }
    l ='Lock Actor'
    poser.ProcessCommand( lock[ l ] )

    or - you can try this https://sharecg.com/v/91733/browse/8/Script/Poser-Python-Hide-and-Lock-actors-figures



  • @structure:

    Thank you very much - it works!
    But there's a typo in the code:
    The number to lock an actor is 1491 - NOT 1497.

    Here's my (simplified) version to lock a single actor:
    the actual code will have a for{} loop which iterates through all actors as specified in a list.

    scene = poser.Scene()
    scene.SelectActor(scene.CurrentFigure().ActorByInternalName('whatsItsName'))
    poser.ProcessCommand(1491)
    

    Karina



  • thanks for pointing out the error - glad it worked for you