Difference between revisions of "Maya Mel"

From Antoine Vienne | Wiki
Jump to navigation Jump to search
(Easy install tip)
Line 14: Line 14:
 
</pre>
 
</pre>
  
=== Easy install tip ===
+
=== Maxwell particles sequence ===
 
<pre>
 
<pre>
//stolen from advanced skeleton file and other scripts
+
//This expression force Maya to reload an Alembic particles file at each frame - there is no other way in Maxwell Render to read a particles sequence in .abc
//basically call 'whatIs' on a procedure that you just sourced so you know when the current mel file is
 
//useful for dragging and dropping files in viewport for installation
 
  
global proc installDir (){}
+
global int $current_frame;
string $p = `whatIs installDir`;
+
$current_frame = `currentTime -query`;
 
+
print $current_frame;
string $fullPath=`substring $p 25 999`;
+
{
string $buffer[];
+
setAttr -type "string" maxwellRFRKParticles1.file ("/prod/project/SGF_GENERIQUE_18_1525/sequences/001/001_0002/sfx/work/houdini/geo/sandV15.0" + $current_frame + ".abc");
string $slash="/";
+
}
if (`gmatch $p "*\\\\*"`)//sourced from ScriptEditor
 
$slash="\\";
 
int $numTok=`tokenize $fullPath $slash $buffer`;
 
int $numLetters=size($fullPath);
 
int $numLettersLastFolder=size($buffer[$numTok-1]);
 
string $scriptLocation=`substring $fullPath 1 ($numLetters-$numLettersLastFolder)`;
 
print $scriptLocation;
 
  
 
</pre>
 
</pre>

Revision as of 00:34, 8 June 2019

My mels

Octane Render Baking group id - Assign id to multiple objects shapes

// 0 is for Red, 2 for Green, 4 for Blue
// 3, 5 and 6 for Cyan, Magenta and Yellow
// Replace the number "0" by the number of your choice
// Baking group id is also avalaible in Attribute Spreadsheet Editor

for ( $object in `ls -sl -l` ) {
    print($object+"\n");
    setAttr ($object + ".octBakGrId") (0);
}

Maxwell particles sequence

//This expression force Maya to reload an Alembic particles file at each frame - there is no other way in Maxwell Render to read a particles sequence in .abc

global int $current_frame;
$current_frame = `currentTime -query`;
print $current_frame;
{
setAttr -type "string" maxwellRFRKParticles1.file ("/prod/project/SGF_GENERIQUE_18_1525/sequences/001/001_0002/sfx/work/houdini/geo/sandV15.0" + $current_frame + ".abc");
}