Complex UV Layout in Maya
Over the last couple of years UV layout in Maya has changed for the better. In this course we're going to be taking a look at some of those changes as we UV map an entire character
# 1 23-07-2011 , 10:44 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095

logistic issue - texture variations at rendertime

Ahoi everyone,

I have a huge task to tackle within the next weeks and need some creative input from you. My next project is about to render 80-something objects, and each of them with 260-something different textures applied. (20-30k renderings in the end...) My logistic setup would be to create a render layer system for the objects and when submitting to our renderfarm all different textures will be auto-connected once and be rendered.

Now I am already experienced with mental ray renderflags and I also have a little knowledge of mel. Questions:

Can I attach a mel script to my scene file which is then called at rendertime?

Is it better to create 260 shaders or just one (since I only need one shader) and connect all 260 textures at render time?

Is this even possible?

thanks in advance for input!

Falott


everything starts and ends in the right place at the right time.
# 2 23-07-2011 , 10:54 AM
ben hobden's Avatar
Subscriber
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
without being able to help you, can i ask... how come there are so many textures? are they for animated texture sequences or something? am very curious.

hope someone can help.

# 3 23-07-2011 , 01:52 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
it´s for a online shop where you can assamble your own clothes. lots of variations...


everything starts and ends in the right place at the right time.
# 4 25-07-2011 , 02:31 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
oki, solved a little something so far

string $currentFrame = "pattern_" + `currentTime -q`;
connectAttr -force ($currentFrame + ".outColor") shader_pattern.color;


this 2 lines of code I´ve entered in the Pre render frame MEL field from render globals.
if rendering single files maya connects the textures alright. but when batch rendering only the currently connected texture is used. either the Pre render MEL section is buggy (Maya 8.5) or I don´t know. I´ve tried all fields -

Pre render MEL
Pre render layer MEL
Pre render frame MEL

none of them are called at rendertime.

any ideas?


edit:
more modifications..

setAttr -type "string" defaultRenderGlobals.imageFilePrefix "<$currentFrame>";

I still need to figure out a way to tell maya to render files into custom folders related to the frames in the timeline. since I got 260 textures and pre render MEL tells maya to connect a different texture at each frame, it would also be necessary to output everything into folders like: FRAME1, FRAME2, ... with the renderings names derived from the render layer names.


everything starts and ends in the right place at the right time.

Last edited by Falott; 25-07-2011 at 03:18 PM.
# 5 26-07-2011 , 02:02 AM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
I had tried something similar and I scrapped it. The script worked but wouldn't execute during batch. I took great care to make sure nothing was UI dependent and tried 2 ways ...

Have one file node in the scene and have the script cycle through the files it finds in a folder on every frame change then dumps them in another array that is checked on each cycle so there are no repeats.

Then I tried having all the textures in the scene and had the script make a list of those and cycle through them making connections based on the same terms.

I even later added a current and previous frame# check. Worked fine within Maya, I'd hit render, then scrub forward, hit render, different texture but still nothing in batch, preFrame, postFrame, preRender etc nothing. I even tried a simple glow increase with each frame and that didn't work so I don't know what I missed.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
# 6 26-07-2011 , 06:42 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
that doesn´t sound good.. but explains the trouble I´m in pretty well. I will do some tests with the render farm now (vertex muster). there must be a solution!

it can´t be that pre render mel is completely not working..!!


everything starts and ends in the right place at the right time.
# 7 17-08-2011 , 11:30 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
Name the textures like this... texture.####.tga

Then, create a new file texture node. Load the first frame. Key the image number, from the lowest to the highest. Render. It will now change each frame (provided you made it change per frame)


Imagination is more important than knowledge.

Last edited by NextDesign; 17-08-2011 at 11:40 PM.
# 8 20-08-2011 , 06:24 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
stupid me!

file load per frame must really be the easiest solution to it. sometimes I need someone to point at the obvious...

now only one task remains - outputting renderings into a specific folder per frame. since we are using vertex muster for renderfarming I can use a custom outputpath, but only per renderjob. this project grew huge and will end up with like 800.000 renderings. I don´t want to sort them out manually in the end....
more help is much appreciated!

thanks so far


everything starts and ends in the right place at the right time.
# 9 20-08-2011 , 10:25 AM
Gen's Avatar
Super Moderator
Join Date: Dec 2006
Location: South FL
Posts: 3,522
Animated textures duh lol how did I not think of that! Good call.


- Genny
__________________
::|| My CG Blog ||::
::|| My Maya FAQ ||::
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads