Wed, Nov 20, 3:35 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2024 Nov 18 10:25 pm)



Subject: Python script to enable/disable all IK in a scene?


kuroyume0161 ( ) posted Sun, 25 May 2008 at 1:06 AM · edited Wed, 20 November 2024 at 3:26 AM

Ockham, svdl, markschum, eh, eh? ;)

Anyone have such a script and where do I get it?  The IK support in my plugin isn't reliable at replicating the results seen in Poser with IK so my usual take is not to use IK.  But I'd like users to be able to disable IK, save the scene, and then be able to reenable it for further modifications incurring the least amount of suffering (Poser's method makes the fires of hell seem like a pleasant vacation).

Thanks!

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


PhilC ( ) posted Sun, 25 May 2008 at 5:29 AM · edited Sun, 25 May 2008 at 5:32 AM

This is one of the many example scripts found in my Comprehensive Python Manual.

# turn all IK's ON-OFF
#
# by PhilC

import poser<br></br>
scene = poser.Scene()

def setIK(flag):<br></br>
 fig = scene.CurrentFigure()<br></br>
 if fig:<br></br>
  IKlist = fig.IkNames()<br></br>
  ik = 0<br></br>
  while ik < len(IKlist):<br></br>
   fig.SetIkStatus(ik, flag) <br></br>
   ik = ik + 1

setIK(1) # 0 = off, 1 = on<br></br>
In the manual I also show how you can run the script using a keyboard shortcut.


kuroyume0161 ( ) posted Sun, 25 May 2008 at 1:33 PM

And a book plug to boot, ay, Phil. ;)

It's a bit steep on price for my limited use of Poser Python but may do it any way as I have a plan which would only work if the functionality was: disable all IK (noting enabled IK chains), save scene, enable previously enabled IK chains. :D

C makes it easy to shoot yourself in the foot. C++ makes it harder, but when you do, you blow your whole leg off.

 -- Bjarne Stroustrup

Contact Me | Kuroyume's DevelopmentZone


Privacy Notice

This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.