Welcome to the Poser Forum

Forum Moderators:  Boni, Kendra    Forum Coordinators:  darknewt, Jules53757, SpookieLilOne, gmm2

Poser F.A.Q (Updated: 2016 Nov 29 4:50 pm)


 Subject: Poser 6: How can I make a material (MT5/MC6/PZ2) to JUST change U/V_Scale...

3dcheapskate opened this issue on Feb 22, 2012 · 23 posts

Top of Forum Print

  3dcheapskate    ( ) ( posted at 5:17AM Wed, 22 February 2012 · edited on 5:21AM Wed, 22 February 2012

Full title was too long, should be:

Poser 6: How can I make a material (MT5/MC6/PZ2) to JUST change U/V_Scale, or Image_Source?

Any hints on how to create a material (either MT5, MC6 or PZ2 MAT pose) that will ONLY change one or two of the material parameters, leaving the others as they were?

I've just released another tileable texture freebie, and thanks to previous advice on these forums I've got the Poser and DS mats sorted out properly. So I decided to try to add a couple of extra 'partial-materials' to...

  1. Just change the size of the tiling (U_Scale and V_Scale), leaving everything else at it was.

  2. Change all the texture images, leaving everything else as it was.

But everything I tried ended up changing all the other parameters and/or disconnecting/deleting the nodes (I just have the same three Image_Map nodes in all the materials).

So am I asking the impossible, or missing something obvious? (Hopefully, and going from past experience most likely, the latter!)

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  bagginsbill    ( ) ( posted at 6:22AM Wed, 22 February 2012  · @3898390

Asking the impossible. Material files cannot describe changes to existing nodes. They describe the whole material - all nodes, all parameters. There are no partial shaders.

However, a Python script could do it.

And there are some scripts that help create material changing scripts.

I have never used this one but it is free and it makes partial shaders of some kind.

http://www.runtimedna.com/Advanced-Shaders.html


Renderosity forum reply notifications have been wonky in the past. I'm testing the waters to see if it's working now. If you ask me something and I don't come back, it probably isn't. (Updated January 17, 2017)

  3dcheapskate    ( ) ( posted at 9:43AM Wed, 22 February 2012  · @3898466

Fairly definitive answer - thanks.

Semidieu's script at RDNA looks promising but it needs Poser 8+, and I'm still using Poser 6. So it looks like I'm going to have to get to grips with Python if I want to do this.

Thanks again.

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  parrotdolphin    ( ) ( posted at 10:24PM Wed, 22 February 2012  · @3898717

I have a script  in my free stuff here, which will scale the tile size for the currently selected material (you need to be in the Material Room). You can use it in Poser 6 and up.


  RobynsVeil    ( ) ( posted at 1:40AM Thu, 23 February 2012  · @3898746

Poser 8 isn't really out of reach, you know:

http://www.purplus.net/poser8.html

Mint18/Sierra/Win7Pro-Blender2.78c-PoserPro 11(inches)-FinalCutProX

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[we realise that people hold in contempt that which they do not understand] 


  3dcheapskate    ( ) ( posted at 3:49AM Fri, 24 February 2012  · @3899105

parrotdolphin - thanks, I've grabbed that and I'll try it out. I'll add a link on my tileable texture pages if it's all okay. Nice short script too, so it's a good starting point for me to (re)learn how to program - maybe I'll be producing my own scripts soon!**
**

RobynsVeil - Woo-HOO! I'd more-or-less abandoned the idea of upgrading Poser because of postal charges (see my thread here http://www.renderosity.com/mod/forumpro/showthread.php?message_id=3855440) - but that PurPlus link states that they ship internationally via USPS International Airmail (see bagginsbill's last comment on that thread). I just checked it out and I've grabbed a copy of Poser 8 for $49.95 (including shipping to the UK - Thailand's not on their list). So a big, big  THANK YOU!

(provided of course that (i) they charge my credit card what they said, (ii) it actually arrives )

 

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  RobynsVeil    ( ) ( posted at 6:20AM Fri, 24 February 2012 · edited on 6:21AM Fri, 24 February 2012 · @3899124

Please do let me know how you go with this, 3DCh... I would hate recommending something that turns out to be a dud, but from what I've read on here they have a fair-few satisfied customers in Poserdom...

Mint18/Sierra/Win7Pro-Blender2.78c-PoserPro 11(inches)-FinalCutProX

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[we realise that people hold in contempt that which they do not understand] 


  3dcheapskate    ( ) ( posted at 7:47AM Fri, 24 February 2012  · @3899136

Will do - I'll post back here (and on the thread I mentioned). I did have a quick check around for any warning signals before actually placing the order - Googling the site's name, checking their WOT rating, etc. There's a few unhappy customers, but as far as I can tell the majority seem happy enough. fingers crossed.

parrotdolphin - your script works like a charm! Thanks. Now if it did all materials in the selected object in one go...

 

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  parrotdolphin    ( ) ( posted at 11:38AM Fri, 24 February 2012  · @3899209

I don't mind if you add a link to the script or even include it in your zip file. Feel free to use it however you like. Mat zones on an item aren't always UV mapped so that the scale is the same for each zone. That's why I prefer to have it run for just a single material at a time. But, there are scripts out there that run though all material zones to perform whatever task and I guess my script could be adapted to do that.


  3dcheapskate    ( ) ( posted at 10:58PM Fri, 24 February 2012 · edited on 10:59PM Fri, 24 February 2012 · @3899384

Quote - Mat zones on an item aren't always UV mapped so that the scale is the same for each zone

Good point. Indeed for the tileable mail textures that prompted this question I use different U/V_Scales for different materials.I did this so that the scales (as in scale armour/dragon scales) from different materials looked roughly the same size in the render.

I envisioned users thinking "oh, those scales (as in scale armour/dragon scales) look a bit too small, I'll just make them all a bit bigger". So applying the same percentage to all materials would be perfect in this particular situation. (My cobbled-together DS 'set tiling' scripts set an absolute value - I'll have to amend that)

The Poser 6 PoserPython Methods PDF I found on my laptop looks fairly good, so with that and your script as a starting point I should be able to work out how to do what I want.

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  parrotdolphin    ( ) ( posted at 11:16PM Fri, 24 February 2012  · @3899385

Sounds good. Good luck with your Python scripting.


  3dcheapskate    ( ) ( posted at 4:30AM Mon, 27 February 2012 · edited on 4:34AM Mon, 27 February 2012 · @3900034

Not as difficult as I thought it would be. I've now got a script that does exactly what I wanted - I basically just needed to pick up the materials list from the current actor:

matsList = act.Materials()
j=len(matsList)
for i in range(j):

So now the script could easily set just the selected material, or all materials, or let the user select Yes/No for each material in turn. And now I can play with all those other material/shader parameters - Pandora's Box indeed!

Any objections to me uploading my modified version of your script? (Renderosity/ShareCG freestuff as usual, and probably as the first useful thing on my new website)

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  parrotdolphin    ( ) ( posted at 6:52AM Mon, 27 February 2012  · @3900054

Fantastic! I have no objection at all.


  markschum    ( ) ( posted at 8:09AM Mon, 27 February 2012  · @3900076

you can loop through all materials by doing this

 

mats = act.Materials()

for mat in mats:

      * do stuff *

 


  3dcheapskate    ( ) ( posted at 8:52PM Tue, 28 February 2012  · @3900670

markschum: yes indeed, and thanks. My programming skills may be very rusty, but all they need is a bit of oiling! I'm sure that I'd have realised sooner or later (probably later) that my 'j' was unnecessary, so a nudge in the right direction is always handy.

parrotdolphin: I'd almost forgotten how much 'fun' programming was! ;o)

bagginsbill: as usual your advice has turned out to be spot on! Python scripting definitely seems to be the best way to do this.

Hopefully I'll upload the modified script(s) in the next few days

(Note to self: if syntax error check for colon at end of loop/conditional statement)

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  RobynsVeil    ( ) ( posted at 9:11PM Tue, 28 February 2012  · @3900677

Quote - ... (Note to self: if syntax error check for colon at end of loop/conditional statement)

If Python, also check indentation is correct. Tab is not the same to Python as space and whilst they may look identical, if you bring up all the non-printing characters, you can quickly spot the flaw.

Mint18/Sierra/Win7Pro-Blender2.78c-PoserPro 11(inches)-FinalCutProX

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[we realise that people hold in contempt that which they do not understand] 


  3dcheapskate    ( ) ( posted at 8:30AM Wed, 29 February 2012  · @3900807

Thanks - noted.

Btw I just found this enlightening Changing Alternate_Diffuse value thread on the Poser Python Scripting forum (when I popped by to ask a really stupid question). Seems you've recently done something very similar to what I'm trying here. More examples to learn from!

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  3dcheapskate    ( ) ( posted at 2:56AM Thu, 01 March 2012  · @3901201

Almost done - I've posted the whole script over on the Poser Python Sxcripting forum under Script for setting U/V_Scale of image maps in current figure/actor (nearly done) - feedback much appreciated.

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  3dcheapskate    ( ) ( posted at 6:37AM Sat, 03 March 2012  · @3901966

Btw - I should have mentioned that I'm still debugging and tidying up the script. When that's complete I'll post it on the Renderosity Freestuff.

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  3dcheapskate    ( ) ( posted at 7:07AM Sat, 03 March 2012  · @3901970

Just got a message that my package from PurPlus has arrived in the UK. Just over a week - not bad.

Can't check it myself since I'm still in Thailand, so getting a relative to do that for me. Hopefully it'll be all present and correct.

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  RobynsVeil    ( ) ( posted at 4:03PM Sat, 03 March 2012  · @3902138

Thanks for the update - sheesh, a week. In this day and age. I guess that isn't bad.

Mint18/Sierra/Win7Pro-Blender2.78c-PoserPro 11(inches)-FinalCutProX

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[we realise that people hold in contempt that which they do not understand] 


  3dcheapskate    ( ) ( posted at 9:11AM Tue, 06 March 2012  · @3903129

Script uploaded to Renderosity Freestuff, pending approval. Should appear soon.

Pete Williams (aka the 3DCheapskate) still posts stupid stuff at all the usual places



  RobynsVeil    ( ) ( posted at 4:15PM Tue, 06 March 2012  · @3903276

Thanks for that... 😄 looking forward to it!

Mint18/Sierra/Win7Pro-Blender2.78c-PoserPro 11(inches)-FinalCutProX

Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[we realise that people hold in contempt that which they do not understand] 


 To create a post you must first sign in or register an account.