Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
I just ran into this myself the other day. The Actors() method returns all actors, despite what the doc says.
So to find all actors, there is no need to loop over figures.
To filter out things from figures, you actually have to do more than check IsBodyPart. DAZ Vickie 4.2, for example, causes the list to return a bunch of things that are not body parts, but other things that are parts of figures. Things like bases, zones, deformers, goalcenterofmass, etc.
The things we actually see in Poser UI for choosing the current actor include body parts and what I call "ordinary props". You can test for IsBodyPart pretty easily, but there is no handy IsOrdinaryProp, such as the list you get in Poser when you choose a Prop.
Then, of course, there are cameras and lights, etc.
So I wrote this function to determine if an actor is an ordinary prop. Seems to work.
def isOrdinaryProp(actor):<br></br>
if actor.IsCamera() or actor.IsLight() or actor.IsBase() or
actor.IsBodyPart() or actor.IsZone() or actor.IsDeformer() or not
itemHasMaterials(actor):<br></br>
return False<br></br>
return True<br></br>
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
The itemHasMaterials method is this:
def itemHasMaterials(item):<br></br>
try:<br></br>
return item.Materials()<br></br>
except:<br></br>
pass<br></br>
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)
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.
I have Poser 7.0.4.220 . I am writing a Poser script which includes:
scn = poser.Scene()
...
acs=scn.Actors()
for ac in acs:
and my Poser's Python manual saps for screentype.Actors() -:
Get a list of the non-figure actor objects in the scene. Actors are items that populate the scene such as props, cameras, lights, or deformers. They can also be body-parts of a figure, although body-part actors will not be returned in this list. To get a list of actors belonging to a figure, use the Actors() method for a figure object.
but when I ran the script it listed all actors including those that were parts of a character who was on stage. How can a Python script separate actors thart are part of a character from other actors? If I loop over all figures, then in each figure I loop across all actors which are in that figure, I would miss any actors which are not part of a figure.