Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
Note: Thread editor trashes my indentation and formatting - you should be able to make sense of this even though the Python engine may not.
Note: My Vector/Vertex class (not shown here) has x, y, z, u, v, and uvd (uv direction used in various obscure transformations) arguments.
UP = Vector(0, 1, 0)
DOWN = Vector(0, -1, 0)
WEST = Vector(-1, 0, 0)
EAST = Vector(1, 0, 0)
NORTH = Vector(0, 0, -1)
SOUTH = Vector(0, 0, 1)
ZEROVEC = Vector(0, 0, 0)
class Transform(object):
def init(self, x = EAST, y = UP, z = SOUTH, w = ZEROVEC):
self.x = x
self.y = y
self.z = z
self.w = w
def applyTo(self, v):
w = self.w
return Vertex(v.dot(self.x) + w.x, v.dot(self.y) + w.y, v.dot(self.z) + w.z, v.u + w.u, v.v + w.v, v.uvd)
def dsc(angle):
angle = radians(angle)
return sin(angle), cos(angle)
def XRot(angle): s, c = dsc(angle) return Transform(EAST, Vector(0, c, -s), Vector(0, s, c))
def YRot(angle): s, c = dsc(angle) return Transform(Vector(c, 0, s), UP, Vector(-s, 0, c))
def ZRot(angle): s, c = dsc(angle) return Transform(Vector(c, -s, 0), Vector(s, c, 0), SOUTH)
In my vector/vertex class the method dot does dot product.
def dot(self, that): return self.x * that.x + self.y * that.y + self.z * that.z
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 idea is to take an object whose parameters you have already defined (written down) to be scaled, rotated and transitioned so it can be placed precisely into place upon import. This way after you import into Poser you don't have to input the same data (numbers) manually everytime.
Then save that data for future use.
I understand most people would make everything properly to scale and in place in a modeling program but... ya know.
Know what I'm saying.
Quote - Note: Thread editor trashes my indentation and formatting - you should be able to make sense of this even though the Python engine may not.
BB, if you open the "HTML" editor via the button, add a
, and paste between that, I think it should preserve your formatting.(sorry for the off topic, but maybe consider it a bump as well :) )
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 posted this in another forum but thought perhaps it could be better served if the idea was posted more openly.
Ahem:
Repetitive object importing into Poser.
I had an idea that I thought might be useful. As much for myself but probably for anyone that might be doing repetitive object importing into Poser like myself. The image diagram I've provided better represents the idea I had in mind.
Someone else also suggested a batch process addition.
Maybe some budding or experienced programmer might find it interesting to do if it hasn't already been done before.