- Tue Feb 19, 2008 8:59 pm
#261724
i had the idea for the script when reading this thread here:
http://www.maxwellrender.com/forum/viewtopic.php?t=593
i just wrote a little script that helps modeling edge highlights.
just select meshes or edges or faces...
be sure to use either meters or centimeters. ( if the script is needed for inches tell me. )
if there are any questions or bugs, just post here.
* * *
code: just save the text as d_edgeTreatmentWin_V1.mel
* * *
http://www.maxwellrender.com/forum/viewtopic.php?t=593
i just wrote a little script that helps modeling edge highlights.
just select meshes or edges or faces...
be sure to use either meters or centimeters. ( if the script is needed for inches tell me. )
if there are any questions or bugs, just post here.
* * *
code: just save the text as d_edgeTreatmentWin_V1.mel
* * *
d_edgeTreatmentWin;
d_calcUnitMultiplyer;
global proc d_edgeTreatmentWin(){
if (`window -exists "d_edgeTreatmentWin"` == 1){deleteUI "d_edgeTreatmentWin";}
window -t "edge treatment window V1.0" d_edgeTreatmentWin;
columnLayout -adjustableColumn 1;
//INFO AND USE
frameLayout -label "INFO AND USE" -cll true -collapse 1 infoLayout;
columnLayout;
text -l "scripted by deadalvs, feb 2008";
text -l "questions concerning the scripts or workflow:";
text -l "send to:";
text -l "matthias.buehler(at)mac.com";
text -l "";
text -l "use as basic unit: [m] or [cm]";
text -l "use \"keep faces together\" option if needed";
setParent ..;
setParent ..;
frameLayout -label "bevel" -cll true -collapse 0 bevelLayout;
columnLayout;
text -l "bevel width [m%] or [cm%]";
floatField -w 300 -v 0.01 bevelWidthFloatField;
text -l "bevel segments";
intField -w 300 -v 1 bevelSegmentsIntField;
text -l "";
button -w 300 -h 40 -l "bevel selected geometry" -c "d_bevelSelectedGeometry();";
setParent ..;
setParent ..;
frameLayout -label "offset" -cll true -collapse 0 offsetLayout;
columnLayout;
text -l "offset width [m%] or [cm%]";
floatField -w 300 -v 0.01 offsetWidthFloatField;
button -w 300 -h 40 -l "offset selected geometry" -c "d_offsetSelectedGeometry();";
setParent ..;
setParent ..;
frameLayout -label "extrude (with offset)" -cll true -collapse 0 extrudeLayout;
columnLayout;
text -l "extrude width [m%] or [cm%]";
floatField -w 300 -v 0.01 extrudeWidthFloatField;
text -l "offset width [m%] or [cm%]";
floatField -w 300 -v 0.01 extrudeOffsetWidthFloatField;
button -w 300 -h 40 -l "extrude selected geometry" -c "d_extrudeSelectedGeometry();";
setParent ..;
setParent ..;
showWindow d_edgeTreatmentWin;
//end d_edgeTreatmentWin
}
////////////////////////////////////////////////////////////////////////////////////////////
global proc d_bevelSelectedGeometry(){
d_calcUnitMultiplyer;
global float $bevelWidth;
$bevelWidth = `floatField -q -v bevelWidthFloatField`;
global float $bevelSegments;
$bevelSegments = `intField -q -v bevelSegmentsIntField`;
string $selectedEdgesArray[] = `ls -sl`;
polyBevel -offset $bevelWidth -offsetAsFraction 0 -autoFit 1 -segments $bevelSegments -worldSpace 1 -uvAssignment 0 -fillNgons 1 -mergeVertices 1 -mergeVertexTolerance 0.0001 -smoothingAngle 30 -miteringAngle 180 -angleTolerance 180 -ch 0;
//end d_bevelSelectedGeometry
}
////////////////////////////////////////////////////////////////////////////////////////////
global proc d_offsetSelectedGeometry(){
d_calcUnitMultiplyer;
global float $offsetWidth;
$offsetWidth = `floatField -q -v offsetWidthFloatField`;
global float $unitMultiplyer;
polyExtrudeFacet -constructionHistory 0 -keepFacesTogether 0 -pvx 0 -pvy 0 -pvz 0 -divisions 1 -twist 0 -taper 1 -off ($offsetWidth * $unitMultiplyer) -smoothingAngle 30;
//end d_offsetSelectedGeometry
}
////////////////////////////////////////////////////////////////////////////////////////////
global proc d_extrudeSelectedGeometry(){
d_calcUnitMultiplyer;
global float $extrudeOffsetWidth;
$extrudeOffsetWidth = `floatField -q -v extrudeOffsetWidthFloatField`;
global float $unitMultiplyer;
polyExtrudeFacet -constructionHistory 0 -keepFacesTogether 0 -pvx 0 -pvy 0 -pvz 0 -divisions 1 -twist 0 -taper 1 -off ($extrudeOffsetWidth * $unitMultiplyer) -smoothingAngle 30;
global float $extrudeWidth;
$extrudeWidth = `floatField -q -v extrudeWidthFloatField`;
string $selectedFacesArray[] = `ls -sl`;
for ($eachFace in $selectedFacesArray){
global float $extrudeWidth;
select -r $eachFace;
ConvertSelectionToVertices;
string $selectedCVArray[] = `ls -sl -fl`;
int $numberOfCVs = size ($selectedCVArray);
global string $normalFlags;
$normalFlags= "";
for ($counter = 0; $counter < $numberOfCVs; $counter++){
global float $extrudeWidth;
global string $normalFlags;
$normalFlags= ($normalFlags + "-n " + ($extrudeWidth) + " ");
//print $normalFlags
}
eval ("moveVertexAlongDirection " + $normalFlags);
}
select -r $selectedFacesArray;
//end d_offsetSelectedGeometry
}
////////////////////////////////////////////////////////////////////////////////////////////
global proc d_calcUnitMultiplyer(){
string $currentLinearUnit = `currentUnit -query -linear`;
global float $unitMultiplyer;
//cm = 1
//m = 100
if ($currentLinearUnit == "m"){
global float $unitMultiplyer;
$unitMultiplyer = 100;
}
if ($currentLinearUnit == "cm"){
global float $unitMultiplyer;
$unitMultiplyer = 1;
}
//end d_calcUnitMultiplyer
}
////////////////////////////////////////////////////////////////////////////////////////////
Last edited by deadalvs on Tue Feb 19, 2008 9:30 pm, edited 3 times in total.