forked from enriccorona/MEL-database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrepare_environment_to_save_jeans_info.mel
57 lines (42 loc) · 2.24 KB
/
Prepare_environment_to_save_jeans_info.mel
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
51
52
53
54
55
56
57
//Importar pantalons:
string $cloth = "Jeans";
file -import "/Users/ecorona/Downloads/jeans.obj";
setAttr "defaultRenderGlobals.imageFormat" 4;
string $cloth2 = $cloth
// Seleccionar pantalons:
select -r $cloth ;
// Canviar pantalons a ncloth:
createNCloth 0;
setAttr "nClothShape1.stretchResistance" 1;
setAttr "nClothShape1.compressionResistance" 0.1;
setAttr "nClothShape1.bendResistance" 0.025;
int $k[] = `polyEvaluate -vertex $cloth`;
// Create 36 cameras:
for( $i=0; $i<36; ++$i){
camera -centerOfInterest 5 -focalLength 35 -lensSqueezeRatio 1 -cameraScale 1 -horizontalFilmAperture 1.41732 -horizontalFilmOffset 0 -verticalFilmAperture 0.94488 -verticalFilmOffset 0 -filmFit Fill -overscan 1 -motionBlur 0 -shutterAngle 144 -nearClipPlane 0.1 -farClipPlane 10000 -orthographic 0 -orthographicWidth 30 -panZoomEnabled 0 -horizontalPan 0 -verticalPan 0 -zoom 1 -horizontalFieldOfView 43 -verticalFieldOfView 57; objectMoveCommand; cameraMakeNode 1 "";
float $x = 150*cos (($i*10)*3.14159/180);
float $z = 150*sin (($i*10)*3.14159/180);
move -r $x 0 $z;
float $rotation = (90 - $i*10);
rotate -r -os -fo 0 $rotation 0;
string $instruction = "cameraShape"+($i+1) + ".mask";
setAttr $instruction 0;
string $instruction = "cameraShape"+($i+1) + ".locatorScale";
setAttr $instruction 10;
}
// Create DepthLayer
createRenderLayer -noRecurse -name DepthLayer -global;
--------------------------------------------------------------------------------------------------------------------------------------------------------------
// Now by hand:
// Channel Box / Layer Editor TAB -> Right click on DepthLayer -> Attributes -> Presets -> Luminance Depth
// Now, rather execute:
disconnectAttr samplerInfo1.cameraNearClipPlane setRange1.oldMinX;
disconnectAttr samplerInfo1.cameraFarClipPlane setRange1.oldMaxX;
setAttr "setRange1.oldMinX" 120;
setAttr "setRange1.oldMaxX" 180;
setAttr "setRange1.oldMinY" 0;
setAttr "setRange1.oldMaxY" 0;
setAttr "setRange1.oldMinZ" 0;
setAttr "setRange1.oldMaxZ" 0;
// Or by hand: select setRange1 Tab -> Right click on Old Min -> Break connection, write 110; Right click on Old Max -> Break connection, write 180;
// Max could be 6500 to have an output of milimeters