As you may know you have to apply a subdivision node to vray maya objects in order to render subd surfaces. You can do this manually per object but that could take a very long time if you have a lot.
So go to maya menu select>objects by type>geometry
to select all the objects in your scene. then paste this into the MEL port of your script editor and hit enter.
Boom they will all have the subD node now!
{
string $sel[] = `ls -sl -dag -s`;
for ($each in $sel){
if (`nodeType $each`=="mesh"){
print ("// adding VRay subdivision attributes to "+$each+"\n");
vrayAddAttr($each, "vraySubdivEnable");
vrayAddAttr($each, "vraySubdivUVsAtBorders");
}
}
}
You could modify other attributes like the subD count etc by using commands at the end.
Autodesk Maya, Unity, VR, Playmaker, Blender, After Effects and V-ray for Maya tutorials, tips and tricks
Search Maya Zest
Thursday, August 29, 2019
Friday, February 15, 2019
Maya render setting blank!
Just switch the script type in the bottom left corner of maya from Python to MEL,
paste this into the field
deleteUI unifiedRenderGlobalsWindow;
buildNewSceneUI;
Press Enter and the windows should refresh.
Thursday, October 4, 2018
Script to select random faces on your object (MAYA)
Select your object, Copy this into your mel script into the mel box and hit enter it will take a moment and select random faces!
string $faces[] = {};
float $selectPercent = 0.10;
for($each in `ls -sl`)
{
int $nFaces[] = `polyEvaluate -f $each`;
int $sFaces = $nFaces[0] * $selectPercent;
for($i=0;$i<$sFaces;$i++)
{
string $rFace = $each + ".f[" + int(`rand 0 $nFaces[0]`) + "]";
while(stringArrayContains($rFace, $faces) == 1)
{
$rFace = $each + ".f[" + int(`rand 0 $nFaces[0]`) + "]";
}
$faces[size($faces)] = $rFace;
}
}
select -r $faces;
Change $selectPercent = 0.10 to whatever percentage you’d like. It’s currently at 10%. This works across multiple objects and will select a percentage of faces per object, not a percentage of the total faces.
This was graciously created by Byterunner
https://forums.cgsociety.org/t/script-to-select-random-faces-on-object/1384634/4
Thanks buddy!
Friday, December 8, 2017
Create handheld camera shake After Effects with a simple wiggle expression.
You can use a simple wiggle expression on position to emulate some nice camera shake in after effects very easily.
The first two properties supplied to wiggle (frequency and amplitude) are required for the expression to work, the rest of them are optional. If you supply a value for the 3rd property in the wiggle you can increase the number of octaves from the default:
wiggle(1, 10, 3);
You can pull up the graph editor to see the wave form that is created!
The above, for example, will wiggle with a frequency of 1 Hz, an amplitude of 10 but with 3 octaves. This is similar to the "Complexity" of the Fractal Noise effect. It will preserve the overall effect of the wiggle but create additional "sub-wiggles" that add detail.

Here's an image of a wiggle() with 1 octave:
And here's a wiggle() with 3 octaves:

Note that both curves follow the same basic path, but the one with 3 octaves has more "sub-wiggles." If you want to reduce or increase the effect that these additional octaves have you can add a 4th property to wiggle():
wiggle(1, 10, 3, 0.2);
The default value is 0.5. A value of 0.2 would reduce the effect that the additional octaves have on the total wiggle.
For more control functionality you can create a slider control and then pick whip from one of the numbers in your wiggle set to the slider control, to make keyable changes in the motion.
Special thanks to Darby Edelen, I gleaned this from a forum post he made.
Subscribe to:
Posts (Atom)