Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
I now think it may be ka=10 which is apparently an obscure maths formula used to raise things by powers of 10.
But then how does ka=10 + k make sense?
Adding import math to the script header does not make the script run.
Learn the Secrets of Poser 11 and Line-art Filters.
from what I can tell, both ka and h would need a value, there is nothing telling the script what ka is - it is not a poser object or you would see something like
scene.SetFrame(poser.kCMDka * 10 + h)
it is likely a frame counter as in :
scene.SetFrame( ka * 10 + h )
Since setframe requires a frame number
SetFrame
Explanation
Set the current frame number. All frame numbers in PoserPython are relative to
a starting frame of 0. For this reason, a frame number in Python is 1 less than the
equivalent frame as referenced from the Poser GUI.
Arguments
Enter a valid frame number.
Syntax
SetFrame( frame )
Example
scene.SetFrame(23)
and the only options available are the increments :
SetFrameOptions
Explanation
Set the values for frame rate and increment.
Arguments
Enter two integer values, for frame rate and frame increment respectively
Syntax
SetFrameOptions( rate, increment )
Example
moviemaker.SetFrameOptions(24, 4)
so ka is likely the start frame, multiply that 10 and add h for the resulting frame number ( I am sure there is a typo with the " = " )
Locked Out
Thanks very much. I've got a little further, but I'm at the point where I'm just guessing now. Still, the only error being thrown by the non-working script seen below is that there is " an unsupported operand type(s) for * ".
Learn the Secrets of Poser 11 and Line-art Filters.
# Auto walker, to be used with Poser Walk Designer
import math
import poser
scene = poser.Scene()
actor = scene.CurrentActor()
sceneFigure = "Andy2"
figure = scene.Figure("Andy2")
body = figure.Actor("Body")
yRotateParam = body.Parameter ("yRotate")
frames = scene.SetNumFrames(360)
ka = actor.SetRangeConstant(10,349)
# Figure walks 10 frames then turns, then walks ten frames
for angle in range(10,360,10):
scene.SetFrame( ka * 10 + h )
yRotateParam.SetValue(angle)
scene.DrawAll ()
Learn the Secrets of Poser 11 and Line-art Filters.
Test of HTML pre and code :
<pre>Your code here</pre>
<code>Your code here</code>
No, that doesn't work.
'''
does this
'''
No, that doesn't work either.
Learn the Secrets of Poser 11 and Line-art Filters.
```
Can code be enclosed in backticks?
```
Or in [code]bracketed code blocks[/code]?
No, those don't work either.
Learn the Secrets of Poser 11 and Line-art Filters.
ok first you have no value for h
multiplying a tuple (ka) will loop the tuple between the 2 numbers x times
e.g.
print( 10 * (36, 30) )
results in the output
(36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30, 36, 30)
trying to add the h
results in an error
>>> ka = (10, 349)
>>> h = 90
>>> print (ka * 10 + h)
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
print (ka * 10 + h)
TypeError: can only concatenate tuple (not "int") to tuple
>>>
to make a turn at the end of each 10 frames doesn't need a complicated formula
Locked Out
# Auto walker, to be used with Poser Walk Designerimport poserscene = poser.Scene()class Anim:def createanim(self, parm, frame):for i in range(0, 4):frame += 10scene.SetFrame(frame)parm.SetValue(parm.Value() + 90)scene.DrawAll()body = scene.Figure(scene.CurrentFigure().Name()).Actor("Body")if body:yRotateParam = body.Parameter("yRotate")frames = scene.SetNumFrames(360)# Figure walks 10 frames then turns, then walks ten framesAnim().createanim(yRotateParam, 0)
Locked Out
An auto walker, eh?
For use with Poser Walk Designer ?
D'you think it'd work for a millipede ? 😃
I couldn't find any info on the walk designer (well, to be honest I didn't actually look) and ended up cobbling together a load of callbacks over there The first four segments of a millipede - not sure if this'll go anywhere :) | HiveWire 3D Community
So I'm intrigued by what you're doing here as it may be a better approach...
The 3Dcheapskate* occasionally posts sensible stuff. Usually by accident.
And it usually uses Poser 11, with units set to inches. Except when it's using Poser 6 or PP2014, or when its units are set to PNU.
*also available in ShareCG, DAZ, and HiveWire3D flavours (the DeviantArt and CGBytes flavour have been discontinued).
Thanks Structure, I'll test that soon when I have time. So, it sounds like the mystery line was being used by the scripter to save having to write/calculate a string of numbers.
3dcheapskate - the original video was by Bill Nye. He made a 10-frame walk cycle with the Poser Walk Designer, and then every ten frames had the script rotate the figure. He was making flat-colour 'psuedo 3D' walking sprites for Flash.
I assume if you have a maybe five frame walk for each leg of a millipede, simply swinging back and forth, then you could apply that to all legs, but then stagger the timing on each so as to get the flowing 'ripple effect' of a millipede's legs? Once you have that, then the whole creature could be made to walk around in a circle. How you would then make it wiggle a bit I don't know.
Learn the Secrets of Poser 11 and Line-art Filters.
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.
In the 2018 YouTube Poser video "Python Scripting Poser for Pseudo 3D" we see this (just about, as it was very badly filmed):
Which I have out of curiosity reconstructed as this:
What is the curious scene.setFrame increment command being used here (partly circled in red)? It looks like a Greek letter?
Learn the Secrets of Poser 11 and Line-art Filters.