Sat, Nov 9, 5:23 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: GetIdType(...)


Bastep ( ) posted Fri, 03 November 2023 at 2:15 PM · edited Fri, 08 November 2024 at 7:33 AM

In the Poser API, there is the GetIdType() method under the object definition for SceneObjectType. This returns an integer. Is there a list of this ID?
Regards

class SceneObjectType(builtins.object)
             Methods defined here:

GetIdType(...)
    Return the exact type of this scene object.
    <IntType> GetIdType()



Bastep ( ) posted Sat, 04 November 2023 at 7:09 PM

I created a list for GetIdType(...) myself. Is this list complete? Who knows. If I find something new I will add to the list.

Here the list:

ID_TYPE_BODY_ACTOR      =   7
ID_TYPE_CAMERA               =   8
ID_TYPE_LIGHT                   =   9
ID_TYPE_PROPS                 =   12
ID_TYPE_BASE                    =   16 # Magnet
ID_TYPE_DEFORMER         =   18 # Magnet
ID_TYPE_ZONE                   =   21 # Magnet
ID_TYPE_HAIRPROP           =   23 # Only applies to hair done in the Hairroom.
ID_TYPE_IS_CONTROL_PROP =   28
ID_TYPE_GROUPING          =   29
ID_TYPE_MEASUREMENT  =   34

# The following ID covers various scene objects.
# CenterOfMass
# GoalCenterOfMass
# BackgroundMaterialActor
# AtmosphereMaterialActor
# FocusDistanceControl
ID_TYPE_VARIOUS         =   26




an0malaus ( ) posted Thu, 16 November 2023 at 8:16 PM · edited Thu, 16 November 2023 at 8:17 PM

Here's what I've been able to determine:

PPM_GETIDTYPE = 'GetIdType'

ActorTypeNames = {  7 : 'actor',

8 : 'camera',

9 : 'light',

12 : 'prop', # IsPropInstance

15 : 'curveProp',

16 : 'baseProp',

18 : 'magnetDeformerProp',

19 : 'waveDeformerProp',

21 : 'sphereZoneProp',

23 : 'hairProp',

24 : 'uniformForceFieldProp',

25 : 'coneForceFieldProp',

26 : 'controlProp',

28 : 'controlHandleProp',

29 : 'groupingObject',

34 : 'measurementLine',

35 : 'measurementAngle',

36 : 'measurementCircle',

37 : 'measurementPolyline',

}

Not every valid IdType has a defined poser constant, though.



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


an0malaus ( ) posted Thu, 16 November 2023 at 8:19 PM

Ugh! I've spent too long away from this forum. Can't remember all the formatting settings. [Sigh] ;-)



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


Bastep ( ) posted Fri, 17 November 2023 at 5:17 AM

Hello, very nice to see more entries in the list. As I see it, there are no poser constants for the GetIdType method in the API.

I would like to make one comment. Number 7 is not just an Actor, it is a BodyActor. This could otherwise lead to confusion.

Kind regards



an0malaus ( ) posted Sat, 18 November 2023 at 3:01 AM

Yup. I should note that my dict is intended to ease the writing of Poser files. Every low-level object in a Poser scene is an "actor", including cameras, lights, the UNIVERSE actor, props, and, of course figure body parts. Only the "body actors" get the string "actor" in poser files as their TypeId string. 

Poser has a long and storied history of using terms which later lead to confusion by varied usage. "Actor" is just one of many, sadly.
Early ideas were built upon, and later features introduced to Poser file syntax which rendered prior naming illogical, though they were initially logical, e.g. targetGeom channels (or morph targets) have an "indexes" attribute. Initially, this was the only attribute before the list of deltas, indicating the length of the list. However, that did not accurately indicate that zero deltas could be omitted, so, instead of repurposing "indexes" to indicate the range of valid indices or the number of vertices in the actor's geometry, a new attribute "numbDeltas" was added to (confusingly) indicate the number of geometry vertices, instead of a count of the number of non-zero deltas present.

Poser is fraught with contradictions due to the avoidance of backward incompatibility.

That, and the absolute absence of complete, detailed, official documentation of the Poser file formats and their syntax has been a hindrance which we struggle to overcome.

Understandable commercial pressures on the string of owners has also prevented this coming to fruition. We are lucky to have had such a supportive community willing to share their discoveries (even speculative) without ever having sighted a single line of code (Though some lists of constants have been known to be shared to help script developers).



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


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.