Jellyfish1
Aug 21, 2012
Post id: 310536 Report Item

Hi all,

hopefully someone can help.


I am exporting a maya model, that is animated to smoke to be comped.

The model i am going to export will have various textures, these will be applied in smoke.

I am currently using the 'mental ray baking options' to bake in specular but this does it for one frame only

Is there a way to bake it dynamically per frame basis or would it be a case of scripting this?


Any help would be amazing!


Running jr



Dashboard_avatar
Aug 21, 2012
Post id: 310537 Report Item

Mostly a script and what dynamics does is the same thing












1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50


/*jooCCRequestedBatchBakeAllFramesInRange.mel  0.1
 
Author: Janne 'Joojaa' Ojala
Testing: Briefly tested
License: Creative Commons, Attribute.
Request by: Dil Bhakar
 
 
About:
Simple script script for batch baking multiple frames. Frame
numbers are prefixed to the bake name.
 
Install Instructions:
place this text in a file named:
jooCCRequestedBatchBakeAllFramesInRange.mel
that resides in your personal Maya script directory.
 
Usage:
Assign all your baking need into bake sets then run:
 
jooCCRequestedBatchBakeAllFramesInRange 1 12;
 
from a command line. where 1 is the frame to start from
and 12 where to end.
 
Known issues:
Script can not be interrupted.
 
Changelist:
21.08.2012 - created
 
*****************************************************************/

 
 
 
proc jooCCRequestedBatchBakeAllFramesInRange(int $startFrame, int $endFrame){
string $prefix[];
string $bakesets[] = `ls -et textureBakeSet`;
for($b = 0; $b < size($bakesets);$b++)
$prefix[$b] = (string)`getAttr ($bakesets[$b]+".prefix")`;
for ($i = $startFrame; $i <= $endFrame; $i++){
currentTime $i;
for($b = 0; $b < size($bakesets);$b++)
setAttr -type "string" ($bakesets[$b]+".prefix") ("frm_"+$i+"_"+$prefix[$b]);
print `convertLightmapSetup -camera persp -ulb -keepOrgSG -showcpv -bakeAll`;
}
for($b = 0; $b < size($bakesets);$b++)
setAttr -type "string" ($bakesets[$b]+".prefix") $prefix[$b];
}