Wed, Nov 27, 6: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: Is there a clothes fitting script?


miked123 ( ) posted Mon, 14 March 2005 at 4:58 PM · edited Sun, 24 November 2024 at 4:44 AM

I have been using the autoconform script to add clothes to selected figure and it works very nicely, but is it possible to transfer body morphs (full or partial) to the clothes appropriately. I assume that the clothing has the required morphs but may only have pbms where the main figure has fbms. This would essentially remove all the tedium of using clothing enhanced by Megianstorms products for example. If a full body morphs exists on the parent then if exist on it would be copied to the clothes fbm if it exists. Otherwise it would be copied to pbms for each part that contains the named morph. I don't know if this is possible but if so it would come in very handy. Thanks.

Message edited on: 03/14/2005 17:00


duckmango ( ) posted Tue, 15 March 2005 at 1:08 AM

Ok, just few questions for clarification: 1) By 'transfer' or 'copy' morphs, are you envisioning something like Daz's Tailor program? Or is it more like, transfer or copy the value of the dials from the base figure to equivalent dials on the clothes? (I think you mean the second, but I just want to make sure.) 2) I assume this is for P5, because FBMs between parent figure and the clothes in PP would have crosstalk, so part of this hypothetical python script wouldn't be needed in PP. 3) I don't have any Megianstorm products, but it just comes with pbms but no fbms? FWIW, I think the autoconform script you're referring to is the one that I wrote. I did follow up that script with a P5 version that also introduced some (limited) crosstalk between figure and clothes in P5. I'll post a link if you're interested.


miked123 ( ) posted Tue, 15 March 2005 at 8:45 AM · edited Tue, 15 March 2005 at 8:47 AM
  1. the script would only copy the values of the morph dials.
  2. I am using PPP and the crosstalk doesn't help because the fbms of the character do not apply to the partial morphs of the clothes.
  3. Megaionstorms products only come with fbms.

Here is a snippet from his readme:

Hints:

  1. How can i fit the clothing to the breastsize of my character ?

Example: Breastsize5 = 0.75
Set the dial value from the lcollar/breastsize5, rcollar/breastsize5,
chest/pbmbreastsize5_lc and chest/pbmbreastsize5_rc to the same value as you used in
your character.

Why must i set the pbm-morphs too ?
The influence reaches from the collars into the chest !

  1. How can i fit the clothing to the barbarian1 and muscular2 values of my character ?
    Set the morphs dial values in all parts of the clothing to the same values you used in your
    character.

Example: You used barbarian1 = 0.5 and muscular2 = 1 in your character
It's necessary that you set all barbarian1 morph dials in the different clothing
parts to 0.5 and all muscular2 morph dials to 1.
It's not necessary to set the pbm-morphs too !

I hope you understand the different between situation 1) and 2) !

Message edited on: 03/15/2005 08:47


duckmango ( ) posted Tue, 15 March 2005 at 1:20 PM

Ok, I think I got it. I've got RL stuff for the rest of the week, but maybe I'll be able to code something this weekend.


miked123 ( ) posted Tue, 15 March 2005 at 2:31 PM

That would be great! Thanks. I will be happy to test it out for you.


an0malaus ( ) posted Sat, 19 March 2005 at 4:02 AM

miked123, this brings to mind something I was playing with when looking at ockham's jiggles script. At one point, a body part morph value is modified by a little bit to determine the average direction the morph moves and then set back to its previous value. Unfortunately, what Poser Python (at least in P5) gives you for the morph.Value() is NOT that body part's morph dial setting, but the accumulated effect of PBM and JCM influences in addition to the local dial setting. If you have any active PBM or JCM effects, a loop getting and setting the morph value for the body part repeatedly will exponentially increase the effect. To try and counteract this, I developed a little function which takes a morph (actor.parameter), gets its current value and splits that into PBM/JCM (delta) and local dial parts and returns them, resetting the value without modification. def DialAndDelta(Morph): val1 = Morph.Value() # read value Morph.SetValue(val1) # set same value val2 = Morph.Value() # get new value delta = val2 - val1 # find FBM or JCM delta influence val0 = val1 - delta # find original parameter dial value for this actor Morph.SetValue(val0) # reset to original value return (val0, delta) example using DialAndDelta: for OneMorph in TheActor.Parameters(): if OneMorph.IsMorphTarget(): (dial, delta) = DialAndDelta(OneMorph) OneMorph.SetValue(-delta+0.001) # Set morph upward a bit without delta influence ... For a given body part, you could traverse back up the actor parent chain collecting all the PBM dial values for a given morph. Hope this is useful :-)



My ShareCG Stuff

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


duckmango ( ) posted Sat, 19 March 2005 at 12:44 PM

gwhicks:
That's one excellent explanation for something that's always puzzled me -- up until now, I've just assumed Value() had a bug in it. Thanks for posting.

Ok, thinking out loud, I was going to modify my Autoconform script to copy the appropriate dial settings from figure to clothes while conforming them -- that's not too tricky. If it's only a one-time copy (ie. the user never changes the figure's FBMs), I probably wouldn't have to worry about these delta influences.

However, I also wanted to loop so that if the user spun the figure FBMs dials, the clothes dials would also appropriatedly change ... OK, I probably do need to track these deltas. Yep, very interesting.

I'll try to post something Sunday night/Monday morning.


duckmango ( ) posted Mon, 21 March 2005 at 12:47 AM

file_200422.jpg

miked123: OK, here's the beta script that does part 1 of your request. It's the same autoconform script, now modified to copy the FBMs dial values of the figure to the clothes corresponding FBM dials. After the clothes are conformed and 'fitted', you can spin the dials on the figure and the changes are reflected in the clothes.

I wanted to make sure this is what you had in mind before I added part 2 of your request, which will be to set PBM dials in the clothes if it doesn't have the FBM dial.

I haven't added gwhick's tip yet, but that's on the to-do list.


miked123 ( ) posted Mon, 21 March 2005 at 1:28 PM

Thanks, I will try it tonight and let you know how it works.


miked123 ( ) posted Wed, 23 March 2005 at 1:59 PM

I tried the script and it seems to work, but I really need the lower level morphs. I loaded V3 and added some FBM's. I then activated the script and loaded some clothing that also had the same FBM's (V3 bikini). The bikini acquired the same morphs. I believe that it does this already though due to cross talk. What I really need is for when there is no morph at the body level to propagate the target body morph down to the individual parts of the clothing that have the same morph. I really appreciate your efforts and think maybe you should contact Megaionstorm as well because this script could greatly enhance his products.


duckmango ( ) posted Wed, 23 March 2005 at 2:35 PM

Howdy miked123: I was writing this while you posted: I picked up a megaionstorm product (for a BillyT swimsuit) from the Rendo marketplace because I didn't own any pbm-only clothes that could be used for testing purposes. Well, after following his/her readme and making the new cr2 with the pbm morphs, I'm seeing a problem. Basically, for any body part, there are more similiarly named morph dials than I anticipated. For example, in the chest, there's a pbmBreastSize5_rc and a pbmBreastSize5_lc, which of course is mentioned in the readme you posted. However, there's also a third dial that's simply named BreastSize5, which frankly, I didn't expect to see. So, following megaionstorm's readme, the script will have to ignore the dial whose name matches the FBM in the figure and find the pbm dials. However, for the Barbarian1 morph, in the chest there's dials named 'Barbarian1', 'pbmBarbarian1_rC' and 'pbmBarbarian1_ab'. (There's probably a 'pbmBarbarian1_lc' as well.) Anyway, again according to the readme, the script is now supposed to find the Barbarian1 dial and ignore the pbm dials -- pretty much the opposite of the BreastSize5 morph. So basically, I didn't expect these excess dials in the body parts -- you don't see these things in the Daz's morphing clothes that I own. I was anticipating a script that only needed some simple matching and copying between the figure's FBM dial name and the clothes PBM dial name; now it's "well, if the FBM has 'breast' in it, follow rule 1; else, follow rule 2". The upshot of this is : 1) Since megaionstorm products actually don't have any FBMs in the clothes, the beta I posted won't do anything on them. But, FWIW, it's works great in P5 on clothes with matching FBMs to the figures. 2) Is some sort of fitting script for megaionstorm products still doable? Sure, but it'll be only useful for that merchant's product line, and as long as the merchant maintains the morphing/naming conventions. The script is going to look more like a kludge, but it's still doable. 3) Honestly, I started to think that I'd drop this script and leave this problem for megaionstorm. (No, I haven't contacted him.) But you know, since I'm extremely skeptical that anything I write will have any impact on anyone's buying decisions, and since I'm just killing time until my P6 arrives, I think I'll still work on it. Have a good one...I'll post something if it looks promising.


miked123 ( ) posted Thu, 24 March 2005 at 10:03 AM

Most of the megaionstorm morphs that I have do not have the multiple versions like the BillyT swimsuit one obviously does. What I have seen mostly is just the standard morph name and possibly one with pbm as prefix. Probably could have a very useful script that didn't bother with the alternative morphs like you mentioned. Anyways thanks a lot, and I hope you see something positive in this. If megaionstorm's sales are high there could be a lot of people who could use this script.


megaionstorm ( ) posted Thu, 24 March 2005 at 10:17 AM

A very nice discussion ! 1) Yes, there are no morphs in the body section of the clothings. The 'morph manager' can't copy them.


megaionstorm ( ) posted Thu, 24 March 2005 at 10:34 AM

Ok ! In the chest you can found three morphs: Breastsize6, pbmBreastSize6_lC, pbmBreastSize6_rC. For the 'BreastSize6' morph you can found a 'pbmBreastSize6_lC' morph, in the left collar, and a 'pbmBreastSize6_rC' morph, in the right collar. The 'pbmBreastSize6_lC' morph is for the 'BreastSize6' morph in the left collar. The 'pbmBreastSize6_rC' morph is for the 'BreastSize6' morph in the right collar.


duckmango ( ) posted Thu, 24 March 2005 at 11:04 AM · edited Thu, 24 March 2005 at 11:05 AM

Megaionstorm:
I don't model clothes, so forgive my ignorance, but I hope you can clarify a few things:

Why do you have a specific 'Breastsize6' dial in the chest bodypart if user is instructed to ignore it and just spin the two pbm Breastsize6 dials instead? Or am I confused on your readme instructions? (See post 3 above -- I'm referring to your readme snippet #1)

Also, how many breast morphs does snippet #1 apply to? Breastsize1 through Breastsize8, I assume, but what about morphs like 'BreastDiameter'? Can I assume that snippet #1 applies to all morphs with the word 'breast' in them?

Thanks

Message edited on: 03/24/2005 11:05


megaionstorm ( ) posted Thu, 24 March 2005 at 11:15 AM

If you used a character with the same breastsize on 2 sides then is the first way the right way. With the other 2 ways you can use 2 different sizes.


megaionstorm ( ) posted Thu, 24 March 2005 at 11:21 AM · edited Thu, 24 March 2005 at 11:29 AM

Snippet #1 is a example for all breastsize morphs.
I have used in my example the nr. 5.
But it's equal for all other sizes.
But don't mix breastsize6 with pbmbreastsize1_lC etc.

Message edited on: 03/24/2005 11:29


megaionstorm ( ) posted Thu, 24 March 2005 at 11:27 AM · edited Thu, 24 March 2005 at 11:31 AM

Not all poser user used a poser version who can use phyton scripts.
Poser 4.03 and lower can't used this scripts !!!
And this poser users can i help with my 'clothing morph' sets !

And a price $5.- is the lowest price who is posible in the renderosity marketplace.

Message edited on: 03/24/2005 11:30

Message edited on: 03/24/2005 11:31


duckmango ( ) posted Thu, 24 March 2005 at 12:45 PM

megaionstorm: I certainly wasn't complaining about the price you charge for your products. I was just mulling over whether I wanted to write a script that focused exclusively on a single merchant's product line. And the short answer is: sure, why not? I think it's analogous to people who create free textures for someone else's clothing sets. Nothing wrong with that. And, of course, you are right -- a python script is only useful to those with PP, P5 or P6. mike: I should have something new posted this weekend.


duckmango ( ) posted Sun, 27 March 2005 at 12:49 AM

file_200428.jpg

I think you'll be encouraged by these results. I think the 'regular' FBMs like Barbarian1, Pinup, etc work well. The breastsize morphs may need a little tweaking, but I think I've followed Megaionstorm's directions pretty well. Have a good weekend...I think I'm also going to post a more generalized version of this script for P5 users, maybe in a new forum thread.


megaionstorm ( ) posted Sun, 27 March 2005 at 6:23 AM

I have get the script and i try it in the next days !


miked123 ( ) posted Wed, 30 March 2005 at 10:44 AM

I tried the script last night and it worked great. Thanks much. This is sure to be a great timesaver.


duckmango ( ) posted Wed, 30 March 2005 at 2:33 PM

That's good to hear. Don't be surprised if I end up posting version 3 of this script -- there won't be any functional difference (unless you find some bugs/problems), but I've seen some lines of code that I think I should tighten up.


AtelierAriel ( ) posted Sun, 01 May 2005 at 8:31 PM

Does this script work with P5 and 6?


duckmango ( ) posted Mon, 02 May 2005 at 3:38 PM

From my tests, yes, this script runs on P5 and P6 Windows versions. It won't work with Macs, because of the same old Tkinter compatibility issues.


megaionstorm ( ) posted Sat, 07 May 2005 at 6:57 AM

Ok, i have try it a lot of days ! But ther eis a little problem in the script. The hip and buttock morphs aren't set to the correct values !


megaionstorm ( ) posted Fri, 09 December 2005 at 10:23 AM

I hope that MIKE123 don't try to hunt down my sales on renderosity with his comments !!!


johnjdesigns ( ) posted Wed, 21 December 2005 at 8:48 AM

Is this script working? Any updates?

JohnJDesigns - Digital Fabrics for 3D
Commercial Portfolio
Poser Art Portfolio
Renderosity Store


ToolmakerSteve ( ) posted Mon, 02 January 2006 at 4:13 PM

.


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.