Thu, Nov 7, 10:08 AM 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: Adv Object Import Utility (proposal)


Inception8 ( ) posted Wed, 04 July 2012 at 9:32 AM · edited Thu, 07 November 2024 at 9:36 AM

file_483382.jpg

 

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.


PhilC ( ) posted Wed, 04 July 2012 at 11:51 AM

Does anyone know/understand the Matrix equations for rotation? The rest is pretty straightforward.


bagginsbill ( ) posted Wed, 04 July 2012 at 12:34 PM · edited Wed, 04 July 2012 at 12:42 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)


Inception8 ( ) posted Wed, 04 July 2012 at 12:50 PM · edited Wed, 04 July 2012 at 12:52 PM
  1. 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.

  2. 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.


markschum ( ) posted Wed, 04 July 2012 at 1:53 PM

I had a script that just imported every obj file in a specified folder. It was toimport all the parts of a model before making it a figure.

 

@philc, do you really need the matrix calculation for the rotation part ?


Inception8 ( ) posted Mon, 16 July 2012 at 7:35 AM

Was it something I said?


3doutlaw ( ) posted Tue, 17 July 2012 at 10:22 AM

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  :)  )


Inception8 ( ) posted Tue, 17 July 2012 at 12:02 PM

Quote - (sorry for the off topic, but maybe consider it a bump as well  :)  )

 

The only kind of bump that would save the topic of this thread would probably fall under 'divine intervention'. Which is probably how this halted.


Inception8 ( ) posted Thu, 26 July 2012 at 9:46 AM

semidieu took care of this and did an awesome job. ;o)


PhilC ( ) posted Fri, 27 July 2012 at 3:18 PM

file_484390.jpg

He beat me to it :)

 


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.