Forum: Poser Python Scripting


Subject: automatic texture loading

ice-boy opened this issue on May 04, 2011 · 12 posts


ice-boy posted Wed, 04 May 2011 at 2:17 PM

i think  i talked with bagginsbill about this but i can not find the thread.

 

i am wondering if we can writte a script that would automatic load the textures to the material room and connect them into diffuse ,bump,specular.

now  you are asking yourself how would poser know which texture to load on which figure and  in what material_group.so for example  you have a figure called Ben. and he has 3 material groups .

-ben_head

-ben_arms

-ben_legs

 

so all the textures would have the same name like the material groups.so for example  textures:

ben_arm_bmp

ben_legs_bmp

ben_head_bmp

ben_arm_col

ben_legs_col

ben_head_col

 

col = color

bmp = bump

spc = specular

 

so could a python script recognize the names and load all the textures in the right place? i think this script could be used by everyone who is using poser. poser has for one figure or object more then 3 material groups. loading 3 textures per object and igure takes hours.

 

thanks

 


bagginsbill posted Wed, 04 May 2011 at 2:25 PM

I don't remember a previous thread. The functions exist to do each step, so yes it could be done. But all daz figures have multiple materials, with different names that need the same files. How would that work? Also, the texture sets that are out there are not named this way. Are you just thinking of this for new sets, assuming they must follow the naming convention?


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)


semidieu posted Wed, 04 May 2011 at 2:26 PM

Yes, this is possible.

How would you select the textures ? Select them one bo one or just give a folder containing all the textures ?

 

Edit: BB was faster :)


ice-boy posted Wed, 04 May 2011 at 2:40 PM

Quote - I don't remember a previous thread. The functions exist to do each step, so yes it could be done. But all daz figures have multiple materials, with different names that need the same files. How would that work? Also, the texture sets that are out there are not named this way. Are you just thinking of this for new sets, assuming they must follow the naming convention?

i was thinking this for new sets.i learned from a Gnomon tutorial to name textures with bmp,col,spc. of course if someoen wants to do it different i respect this.

 

what Daz is doing is not good IMO.


ice-boy posted Wed, 04 May 2011 at 2:42 PM

Quote -  

How would you select the textures ? Select them one bo one or just give a folder containing all the textures ?

i was thinking by selecting the folder with all the textures.  

 


markschum posted Wed, 04 May 2011 at 3:26 PM

er, Thats really what mat pose or material collections are for.   Do it manually once and save a material collection and then use that.

 

A poser script that lets you specify what image map for what material zone could be done or perhaps a generic loader specific to the v4/m4 figures.


semidieu posted Thu, 05 May 2011 at 12:13 AM

I think the idea here is to automate the creation of material collection (or MAT pose).

What version of Poser ? (just to know how I will do it).


ice-boy posted Thu, 05 May 2011 at 5:35 AM

poser pro 2010.


semidieu posted Thu, 05 May 2011 at 9:12 AM

Here is a little script that will do what needed (I hope)

 

I made a simple configuration for Victoria 4. FIlenames should be (no need to have all):

nameblablabla_body_color.jpg

nameblablabla_body_displ.jpg

nameblablabla_body_spec.jpg

nameblablabla_body_bump.jpg

nameblablabla_arm_color.jpg

nameblablabla_arm_displ.jpg

nameblablabla_arm_spec.jpg

nameblablabla_arm_displ.jpg

 

Save the attached file on your desktop and rename the extension .txt to .py

 

Open Poser and load V4 - be sure to have the figure selected.

From File menu, run python scripts and browse for the attached file (alternatively, you can add the script in your scripts menu).

You will be asked to locate the folder where the files are.

 

 

Now, how to customize...

Open the file in a text editor and follow the instructions... hope it's clear enough (the script is commented).

Last thing... I only added the ability to add the texture and change the default value (diffuse color, specular color, bump and displacement).


ice-boy posted Fri, 06 May 2011 at 5:07 AM

can i change this to m4? i dont have V4 installed .


nruddock posted Fri, 06 May 2011 at 12:55 PM

Quote - can i change this to m4? i dont have V4 installed .

If M4 has the same material zone naming as V4, then there shouldn't be any changes needed (unless you want to deal with the genitals which is a seperate figure).


semidieu posted Fri, 06 May 2011 at 1:48 PM

nruddock is right :)

 

And it will work with any figure... just change the materials in the file (edit the file and read the instruction...)