Sun, Oct 6, 6:34 AM CDT

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: Applying a new material without deleting the old nodes?


Angelouscuitry ( ) posted Thu, 26 April 2007 at 9:47 PM · edited Tue, 23 July 2024 at 10:21 PM

I've been working with bagginsbills's Matmatic Chainmail, by altering the a couple of it's Scale properties, and generting new Material files over and over.

I'm working with it in order to incorporate my Alpha Garment Node Setup.

I just realized when I try to apply my clothing nodes, the matmatic nodes dissapear.  So, I need to switch over to an element with the clothing nodes, select each node I need, Copy, switch back to the Matmatic Material, paste, and reorder.

I know the nodes could be readily inserted, where needed, but I do'nt know how Tromnek did this for me.  I'd just rather not continually ask him to revamp the script. 


bagginsbill ( ) posted Fri, 27 April 2007 at 7:51 AM

Inserting into complex shaders is tough. I have to wonder why you want to bother, when you could so easily just describe the entire shader in the Matmatic script?


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)


Angelouscuitry ( ) posted Sun, 29 April 2007 at 5:26 AM · edited Sun, 29 April 2007 at 5:29 AM

Hi bagginsbill!

It's taken me a couple days, but I think I see where you're coming from!

*"So, draw a transmap sort of image identifying where the "bra" is in white. Leave the rest black. Supposing you store this in a file called "bramask.jpg" or similar, you could do somethink like this in the script (I suggest you make a copy first and edit this copy):

bramask = ImageMap(":Runtime:blahblah_your_path_here:bramask.jpg")
NumLinks = Blend(70, 200, bramask)

So what will happen is where the bramask is black, you'll get 70 links per UVunit. Where the bramask is white, you'll get 200 links per UVunit. Of course I don't know if 200 is right - you'll have to experiment.**So what will happen is where the bramask is black, you'll get 70 links per UVunit. Where the bramask is white, you'll get 200 links per UVunit. Of course I don't know if 200 is right - you'll have to experiment.

Again if the transition zone is visible (not masked out) then there will be some crazy harmonics going as the signal is modulated from 70 to 200 links per unit. This is called frequency modulation and if you know anything about radio signals, you'll know it creates extraneous information all over the spectrum. Visually you get crazy high-frequency stripes in the transition zone."*

The first time I read this, over at my Matmatic Chainmail thread, it went right over my head.  
 
Where in the script would  I add this?

Would somehting like this work for Thickness(just wondering?)

V3's arms have three zones between her hand and bicept.  What if the the Transistion Lines, bewteen two Material Zones, is part of a Black and White Gradient(Actually more %25Grey to %75Grey?)  Would'nt two like Greys, at the end of one Zone, and the beginning of the next, be enough to avoid crazy harmonics?

I definatley agree with you about Insertion being tough, and I think it is inevitable.  How realistic would turning to Matmatic, to combne two materials be?  I'm imagining needing to convert each material to a Matmatic script, and then havie quite a substantial knowledge of Matmatic?

I'll bet future versions of Poser would do well to suit Insertion of nodes, and am surprised there is none of this to date.  Even with a script  as simple as to just compile the nodes. of two materials, for stringing by hand.


bagginsbill ( ) posted Mon, 30 April 2007 at 3:48 PM

Content Advisory! This message contains nudity

file_376294.jpg

*Where in the script would  I add this?*

Exactly where the NumLinks is set now. The point is that instead of a single number, the NumLinks becomes the result of a calculation, so it can be different instead of the same everywhere.

*Would somehting like this work for Thickness(just wondering?)
*Yes you can have variable thickeness, variable depth, variable colors, variable everything. Anywhere in matmatic that you see a number, you can use nodes instead.

Would'nt two like Greys, at the end of one Zone, and the beginning of the next, be enough to avoid crazy harmonics?
Actually it's not a question of mismatch at seams, but rather the transition itself, that causes harmonics. Anytime the frequency of something changes, it is the area where it's smoothly changing that gets distorted. However, it's not as bad as i made it out to be. I did some experiments and you can actually modulate the NumLinks pretty well if you do it smoothly.

*How realistic would turning to Matmatic, to combne two materials be?
*Well of course since I write my materials as Matmatic scripts anyway I don't have to "convert" them. It is easy to mix surfaces in Matmatic. Once you have two surfaces, and some sort of mask, you just say Mix(a, b, mask) and it's done.

In the attached image, I took my latest V3 shader and Mixed it with the Chainmail shader, using masks that you provided me several months ago. Not bad huh? I should have used the nipples gone morph, but I was pressed for time.

One of the requests on my back burner is to read an existing shader and turn it into a Matmatic script. This is called "reverse compiling" and is a neat idea. Once a shader has been turned into script objects, you could then manipulate them in Matmatic and produce new shaders that combine two or more. This would allow automatic insertion with very fine control over everything. Keep it in your wishlist.


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)


bagginsbill ( ) posted Mon, 30 April 2007 at 4:21 PM · edited Mon, 30 April 2007 at 4:23 PM

file_376296.jpg

Here's a demonstration of what happens to the material when you try to modulate the NumLinks, or in otherwords the link frequency changes across the material.

The square has 5 sections. The first and last are the same and have a constant NumLinks of 20. The middle section has a constant NumLinks of 30. The second and fourth section are transition zones, smoothly varying the NumLinks from 20 to 30, and then back down from 30 to 20.

This is what I meant by crazy harmonics.


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)


bagginsbill ( ) posted Mon, 30 April 2007 at 4:25 PM

You know what else is interesting? JPG compression works by recognizing harmonics in the pattern, and reducing the image based on a minimal set of harmonics. When I saved this image the first time, and tried to post it, it exceeded the size limit - it was almost 400K. Usually, images of this size are well below 200K when saved with 90% quality in Photoshop. But this time, I had to reduce the quality to 50%!!! That means there is a lot of harmonic information in the image and it cannot be compressed without significantly degrading the quality due to throwing some of that information away.

Interesting, huh?


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)


Angelouscuitry ( ) posted Mon, 30 April 2007 at 8:10 PM · edited Mon, 30 April 2007 at 8:12 PM

O' Boy, bagginsbill, this was beautiful reply!  I owe you even more gratitude, thank you, again!

"...using masks that you provided me several months ago."

Wonderful!  I was'nt sure if I'd sent a copy.  I've the whole scene for you!  And updates for the mask!  I thought I might try finishing with the chainmail script, before I send, but you're working on this much too!  Just let me know and I'll send is straight away!

"Keep it in your wishlist."
Absolutely!

"Here's a demonstration of what happens to the material when you try to modulate the NumLinks...'
Would you post the image you used for modulation, if you still happen to know where it is?  I'd like to try my hand at modulating V3 considerebaly.  I'm guessing the 2nd and 4th colmns are different, and would like to see by how much before I get started.

*"But this time, I had to reduce the quality to 50%!!!"
* I ca'nt speak for why, but I often reduce the .JPGs, I post here, to about %50-%55.  Actually without much visible change.


bagginsbill ( ) posted Mon, 30 April 2007 at 9:12 PM

Would you post the image you used for modulation,
I didn't use an image. I used a Matmatic function to create the modulation information. However, an image would have done the same thing. Here is what I did:

NumLinks = Interpolate(U, [20, 20, 30, 30, 20, 20])

That says interpolate the U coordinate (from 0 to 1) so that it starts at 20, says at 20 until 1/5 of the way across, goes to 30 at 2/5, stays at 30 to 3/5, drops to 20 at 4/5, and stays at 20 after that.

*I'm guessing the 2nd and 4th colmns are different
*They aren't supposed to be. But now you have me wondering if I have incorrectly implemented the Matmatic Interpolate function. I will check that tomorrow. But I doubt it because I've used it a lot and graphed displacements with it. When using Interpolate to generate displacement, it is very easy to visually detect things that aren't what you expected.

I'm pretty sure that the Interpolate function was producing symmetric values and the asymmetrical distortion is a result of the fact that underlying the Chainmail algorithm is a modulus wave (saw tooth) and that is not symmetrical under acceleration versus deceleration.


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)


Angelouscuitry ( ) posted Tue, 01 May 2007 at 8:02 PM

Depth is working really well, for modesty! 

But I'm still needing to insert/rig nodes by hand.  This may be a nice thing to know how to do with Matmatic, how wold I define the trim map in gold?

=  )


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.