Tue, Nov 19, 9:23 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: Add morph from deltas


EnglishBob ( ) posted Thu, 22 September 2011 at 9:59 AM · edited Tue, 19 November 2024 at 9:21 AM

I want to add morphs to an object in the scene, using pre-computed deltas. Since the object will have been generated procedurally rather than loaded from a library file, my options are limited...

I can't use a pose file since that requires channels to exist already, and there are none.

A PMD injection works, but it requires the object's internal name to match that expected in the PMD, and that can't be guaranteed. I want to be able to apply the same morph deltas to a number of objects which will all have unique internal names.

That leaves Python, reportedly. However I can only find methods for adding morphs using the current state of the vertices (spawnTarget), or from an external geometry (SpawnTargetFromGeometry). I can't use either of these a) because I don't have a deformed object in the scene or b) because the object will have an arbitrary shape, although the vertex count and order will be consistent.

Any cunning ideas? It would need to run under Poser 7, so a fairly old-hat implementation is probably required. :) 


PhilC ( ) posted Thu, 22 September 2011 at 10:46 AM

Try adding a morph with SpawnTargetFromGeometry() using itself as the geomety.

Then use SetMorphTargetDelta(index,dx,dy,dz)


markschum ( ) posted Thu, 22 September 2011 at 1:17 PM

You could also write an obj and calculate the vertices, then use it to load the morph.


colorcurvature ( ) posted Fri, 23 September 2011 at 1:41 AM

Speaking of it, did anyone ever succeed in deleting a morph target with poser python? I do not know what I am doing wrong but the API call would run through but the target is not getting deleted.


EnglishBob ( ) posted Fri, 23 September 2011 at 3:17 AM

Quote - Try adding a morph with SpawnTargetFromGeometry() using itself as the geomety. Then use SetMorphTargetDelta(index,dx,dy,dz)

Thanks Phil. That has the required amount of cunningness - I like it. :) 


EnglishBob ( ) posted Fri, 23 September 2011 at 3:19 AM

Quote - Speaking of it, did anyone ever succeed in deleting a morph target with poser python? I do not know what I am doing wrong but the API call would run through but the target is not getting deleted.

I found some references to this while I was searching, but they said it wasn't possible. Of course it wasn't the subject I was looking for so I may have overlooked some new development. 


EnglishBob ( ) posted Fri, 23 September 2011 at 8:57 AM

I got it to work - that's the good news. Thanks again Phil for the pointers.

The bad news is that the pre-computed deltas are only effective over a small range of object shapes (which I'd have realised if I'd thought about it a bit more thoroughly, duh). I really need to calculate the deltas according to the shape of the object.

Unfortunately that makes it more trouble than it's worth, given my level of trigonometrical expertise. The project is highly specific and unlikely to be of general interest, I think, so I won't beg for assistance in this forum. :)


markschum ( ) posted Fri, 23 September 2011 at 9:08 AM

Go on , ask, ya know you want too. ;)


EnglishBob ( ) posted Fri, 23 September 2011 at 2:43 PM

I wanted to add morphs to loops made by Cage's Mr.Looper script, over and above the optional 'fatness' morph that the script can do. Now I've thought about it, I can see that it would be better to do that in the script itself - but I don't think my abilities are up to it right now. :)


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.