Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
I think IK queries are supposed to work sort of like this:
import poser<br></br><br></br>
scene = poser.Scene()<br></br><br></br>
def run():<br></br>
fig = scene.CurrentFigure()<br></br>
if not fig:<br></br>
return<br></br>
if
fig.NumIkChains(): <br></br>
for i in
range(fig.NumIkChains()):<br></br>
print fig.IkNames()[i], fig.IkStatus(i)<br></br>
#fig.SetIkStatus(i,0)<br></br><br></br>
run()<br></br>
There doesn't seem to be a way to determine what actors make up a chain, much less what the goal actor is. So if you specifically want to query the leg IK status, say, on an undetermined figure, I guess you'd have to get the list of names and make some guesses about which chains are for the legs. Or allow a user to specify handling. Or parse a .cr2 for the information, perhaps, but I think that would require user input to select the .cr2.
===========================sigline======================================================
Cage can be an opinionated jerk who posts without thinking. He apologizes for this. He's honestly not trying to be a turkeyhead.
Cage had some freebies, compatible with Poser 11 and below. His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.
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.
Hi,
ussualy I can make the script for myself but I havent used python lately and I'm not a programmer so it would take ages to go through all docs again.
Script itself is simply (but it shoud have small GUI).
Scene:
- there is a figure in the scene (feet IK on),
- we are in frame 1,
- figure has some pose applied to it (so all IK goal actors have key frame),
- now we skip to frame 11,
- apply another pose (so all IK goal actors have key frame),
while in frame 11:
- make sure that actor with IK goal is selected - it will be "anchor" actor,
- run script.
shortly about the script:
script should "offset" second pose (all IK goals actors which are "on" + hip) so "anchor" actor in frame 11 moves to exact position from frame 1 and all other IK goals actors (which are "on" + hip) shift the same distance as "anchor" actor did.
GUI:
start frame - which is always actual frame (but should be editable - just in case),
end frame - initially blank - focus on that field when window appears - if you write here any number greater then actual frame then whole range should be affected by this script - if it is left empty then actual frame is taken as end frame so only actual frame will be shifted.
check box - trans x
check box - trans y
check box - trans z
all of them set to "on" by default
it should be possible to skip between GUI entries with TAB or ENTER key
Script should be executed after pressing CTR ENTER.
I made similar script for myself long time ago - it works perfect but I have to put all numbers manually (so first I need to use calculator to find out offset and then I have to run it each time for each direction: x, y, z).
Thanks.
ps:
it is really short script - only MY description is such loooong.:)