Friday, October 30, 2015

Meshfusion Substance test

Been busy lately and had to leave the troll for a while , but I've found some interesting stuff

Thursday, October 1, 2015

Script for manual UDIMS in Maya for Vray

Found out that the only way to use 32bit UDIM displacement in maya is to create a network of file nodes , because using actual UDIM setting will remove "negative colors" and your model will only go out not in :(


This script will create a UV UDIM tiles offset each one of them ,turn off UV wrap,allow negative colors , set color space to Linear (for 32bit), connect to default color them in order, filter type mipmap (for tiled .EXRs) and filter to 0.1 .

All you need to change is $ColPatchN and $RowPatchN  to size you need to match your UDIMS and attach each texture file to correct number. Maybe I'l update it later if there won't be better solutions for that (or maybe there already is something idn)
Here's the script itself:

//Create Attributes
string $filename = "dFile1_";
string $placerN = "tPlacer1_";
int $tempRow;
int $tFrameU = 1 ;
int $tFrameV = 0 ;
int $RowN = "1001";
int $ColN = "10";
int $ColPatchN = "8"; //number of columns
int $RowPatchN = "2"; //number of rows
int $lastCount = $RowPatchN - 1 ; //number to attach lasr cell from rows
int $secondTime = 0 ; //skip first one

///////////    GUTS    //////////////
//////////////////////////////////////////////////////Create loop 1
for ($t1 = 0 ; $t1 < $RowPatchN; $t1 = $t1 + 1  ){
//////////////////////////////////////////////////////Create loop 2
for ($t2 = 0 ; $t2 < $ColPatchN; $t2 = $t2 + 1  ){
//Create ,name ,set attr for file and placement nodes
shadingNode -asTexture file;
rename "temp_01";
setAttr "temp_01.filterType" 1;
setAttr "temp_01.alphaIsLuminance" 1;
setAttr "temp_01.filter" 0.1;
//Allow vray negative colors
    vray addAttributesFromGroup temp_01 vray_file_allow_neg_colors 1;
    vrayAddAttr temp_01 vrayFileAllowNegColors;
//Texture input gamma
        vrayAddAttr temp_01 vrayFileGammaEnable;
        vrayAddAttr temp_01 vrayFileColorSpace;
        vrayAddAttr temp_01 vrayFileGammaValue;
        setAttr "temp_01.vrayFileColorSpace" 0;
//renaming
            rename "temp_01" ($filename + $RowN) ;
                shadingNode -asUtility place2dTexture;
                rename "tempP_01";
                rename "tempP_01" ($placerN + $RowN) ;

//Connect placement and file attr
connectAttr -f ($placerN + $RowN + ".translateFrame") ($filename + $RowN + ".translateFrame") ;
connectAttr -f ($placerN + $RowN  + ".rotateFrame") ($filename + $RowN  + ".rotateFrame");
connectAttr -f ($placerN + $RowN  + ".mirrorU") ($filename + $RowN  + ".mirrorU");
connectAttr -f ($placerN + $RowN  + ".mirrorV") ($filename + $RowN  + ".mirrorV");
connectAttr -f ($placerN + $RowN  + ".stagger") ($filename + $RowN  + ".stagger");
connectAttr -f ($placerN + $RowN  + ".wrapU") ($filename + $RowN  + ".wrapU");
connectAttr -f ($placerN + $RowN  + ".wrapV") ($filename + $RowN  + ".wrapV");
setAttr ($placerN + $RowN  + ".wrapU") 0;
setAttr ($placerN + $RowN  + ".wrapV") 0;
connectAttr -f ($placerN + $RowN  + ".repeatUV") ($filename + $RowN  + ".repeatUV");
connectAttr -f ($placerN + $RowN  + ".offset") ($filename + $RowN  + ".offset");
connectAttr -f ($placerN + $RowN  + ".rotateUV") ($filename + $RowN  + ".rotateUV");
connectAttr -f ($placerN + $RowN  + ".noiseUV") ($filename + $RowN  + ".noiseUV");
connectAttr -f ($placerN + $RowN  + ".vertexUvOne") ($filename + $RowN  + ".vertexUvOne");
connectAttr -f ($placerN + $RowN  + ".vertexUvTwo") ($filename + $RowN  + ".vertexUvTwo");
connectAttr -f ($placerN + $RowN  + ".vertexUvThree") ($filename + $RowN  + ".vertexUvThree");
connectAttr -f ($placerN + $RowN  + ".vertexCameraOne") ($filename + $RowN  + ".vertexCameraOne");
connectAttr ($placerN + $RowN  + ".outUV") ($filename + $RowN  + ".uv");
connectAttr ($placerN + $RowN  + ".outUvFilterSize") ($filename + $RowN  + ".uvFilterSize");
                            //Change FrameV
                            setAttr ($placerN + $RowN + ".translateFrameV") $tFrameV;
                            //attack 1002 to 1001 no so on
                            if ($secondTime > 0 )
                            {
                            int $prevRow = $RowN - 1;
                            defaultNavigation -ce -source ($filename + $RowN ) -destination ($filename + $prevRow + ".defaultColor");
                            setAttr ($placerN + $RowN + ".translateFrameU") $tFrameU;
                            $tFrameU = $tFrameU + 1;
                            };
                                        //count if second time
                                        $secondTime = 1;
                                        //name next one
                                        $RowN = $RowN + 1;
};
//reset second time for next row
$secondTime = 0;
//Create new row
$RowN = $RowN - $ColPatchN;
$RowN = $RowN+$ColN;
//reset frame in U
$tFrameU = 1 ;
//Change frave in V
$tFrameV = $tFrameV + 1 ;
};
//Attach last cell to new row
$RowN = "1001";
int $changedROW = 0 ;//add if row changed
for ($t3 = 0 ; $t3 < $lastCount; $t3 = $t3 + 1  ){
defaultNavigation -ce -source ($filename + ($RowN + $changedROW + 10)) -destination ($filename + ($RowN  + $ColPatchN + $changedROW - 1) + ".defaultColor");
///                                         1001  +    0     +  10                              1001  +   6        +    0        -   1
$changedROW = $changedROW + 10 ;
};

Progress

All parts assembled , I have a rigging class next term but I've tried to make a simple one for posing right now, next steps >

1.Looks like displacement gives to better results than I thought , so more more surface detailing !
2.Rebake reimport , make a usable rig and pose
3.Cloth and cloth related details on the pose
4.Shave and haircut