Saturday, July 2, 2016

FBX batch export for UE4 (with saved PIVOT)


This simple MEL script will :

  • take the name of the each mesh group (collision + mesh) 
  • snap it to zero world zero location 
  • export it as fbx (using your last export settings)
  • and zero out you translations after (assuming your transformation were freezed in first place)


string $fbxPath = "C:/Users/yourname/Desktop/"; ///make sure it's / not \
///^^^type the path to files here^^^///

string $selection[] = `ls -sl`; /// List selected

for($item in $selection) {
    
string $fullTempPath = $fbxPath + $item ; ///create full path + name of the group

select -r $item;  ///have the item selected
move -rpr 0 0 0 ;  ///move to 0 position
SnapToGrid; dR_enterForSnap;
file -force -options "groups=1;ptgroups=1;materials=0;smoothing=1;normals=1" -typ "FBX export" -pr -es $fullTempPath; ///save the file
setAttr ($item +".translateZ") 0;
setAttr ($item +".translateX") 0;
setAttr ($item +".translateY") 0; /// move back to right position

}

-this way you can organize all of your repetitive meshes in one scene , laying them out anywhere on the grid.Making changes later on would be easier assuming the path of your meshes didn't change , just by clicking Reimport buttom in UE4

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

Monday, September 28, 2015

Uvs and extra stuff

Adding some extra parts to fit the concept , also done with main retopo and Uv tiling , it's going to be 5 x 5 , 2048px

Sunday, September 27, 2015

Almost done with retopo....

    Took a break for a while but almost finished retopo , some parts are left then I'l need to create and pack all of the UV's , bake all of the maps , pose the character , simulate cloth , retopo uv bake that and figure a goo way to make hair
   Totally 34500 faces so approximately 17000 faces of manual retopo

Wednesday, September 23, 2015

And more retopo

Fixing the hands and more retopo work , they will need more polygons because I don't want to deal with displacement problems later, so I have smooth it once