Fri, Nov 22, 5:15 PM CST

Renderosity Forums / Poser 11 / Poser Pro 11 OFFICIAL Technical



Welcome to the Poser 11 / Poser Pro 11 OFFICIAL Technical Forum

Forum Moderators: nerd

Poser 11 / Poser Pro 11 OFFICIAL Technical F.A.Q (Last Updated: 2024 Nov 17 7:07 pm)

banner

Welcome to the Poser Forums! Need help with these versions, advice on upgrading? Etc...you've arrived at the right place!


Looking for Poser Tutorials? Find those HERE



Subject: In Poser 11 Python, how can I move the currently selected object?


Anthony Appleyard ( ) posted Sat, 28 July 2018 at 8:56 AM · edited Fri, 22 November 2024 at 12:32 PM

In a Poser 11 Python script., how can I move the currently selected object by (dx, dy, dz)?

In a Poser 11 Python script, how can I rotate the currently selected object by (dX, dY, dZ) about its rotation axes?


ockham ( ) posted Thu, 02 August 2018 at 4:17 AM · edited Thu, 02 August 2018 at 4:19 AM

Here's a simple example that includes all three rotations and translations. First, set each of the translations and rotations to a new value.


import poser

scene = poser.Scene()

a = scene.CurrentActor()

xt = a.ParameterByCode(poser.kParmCodeXTRAN)

yt = a.ParameterByCode(poser.kParmCodeYTRAN)

zt = a.ParameterByCode(poser.kParmCodeZTRAN)

xr = a.ParameterByCode(poser.kParmCodeXROT)

yr = a.ParameterByCode(poser.kParmCodeYROT)

zr = a.ParameterByCode(poser.kParmCodeZROT)

xt.SetValue(0.1)

yt.SetValue(0.2)

zt.SetValue(0.3)

xr.SetValue(30)

yr.SetValue(60)

zr.SetValue(90)


Below is code to set each parameter to an arbitrary CHANGE from the current value.


import poser

scene = poser.Scene()

a = scene.CurrentActor()

xt = a.ParameterByCode(poser.kParmCodeXTRAN)

yt = a.ParameterByCode(poser.kParmCodeYTRAN)

zt = a.ParameterByCode(poser.kParmCodeZTRAN)

xr = a.ParameterByCode(poser.kParmCodeXROT)

yr = a.ParameterByCode(poser.kParmCodeYROT)

zr = a.ParameterByCode(poser.kParmCodeZROT)

xt.SetValue(xt.Value() + 0.1)

yt.SetValue(yt.Value() + 0.1)

zt.SetValue(zt.Value() + 0.1)

xr.SetValue(xr.Value() - 30)

yr.SetValue(yr.Value() - 30)

zr.SetValue(zr.Value() - 30)

My python page
My ShareCG freebies


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.