Create Plane aligned&centered with selected faces.

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Display Modes
  08 August 2012
Create Plane aligned&centered with selected faces.

How would I go around creating a plane and aligning it to a face or a group of faces that are currently selected to be used as a reference aid.

This is as far as I have got, Im trying to work out how to use the setLayerTo to turn the layer in to a reference layer and set it to unshaded.

Im a mel noob be gentle

Thanks

//
$objectArray =  `polyPlane -ax 0 0 0 -sx 15 -sy 15 -w 15 -h 15`;
//      Select the polyplane.
//
select $objectArray[0];
//      Create a layer but only put the polyplane in the layer.
//
createDisplayLayer -noRecurse -name "ReferenceLayer";
//
//

Last edited by KaMate : 08 August 2012 at 07:34 PM.
 
  08 August 2012
Is there a reason not use Maya's Live system?
 
  08 August 2012
Originally Posted by Hamburger: Is there a reason not use Maya's Live system?



It doesn't seem to work on a group of selected faces, and unless im missing something you cant add divisions to construction planes.
 
  08 August 2012
How do I select the display layer named ReferenceLayer so that the last 2 setlayerto commands can work?

Thanks


//
$objectArray =  `polyPlane -ax 0 0 0 -sx 15 -sy 15 -w 15 -h 15`;
//      Select the polyplane.
//
select $objectArray[0];
//      Create a layer but only put the polyplane in the layer.
//
createDisplayLayer -noRecurse -name "ReferenceLayer";
//
// Sets the selected layer to Reference
setLayerTo selected".displayType" 2;
//
// Sets the selected layer to unshaded
setLayerTo selected".shading" 0;
 
  08 August 2012
display layers are like everything else, a node. so you can use the "select" command.

select -r "MyDisplayLayer";

you can also just use "setAttr" command to directly set the display options of the layer instead of relying on the "setLayerTo" mel function.
 
  08 August 2012
Originally Posted by rgkovach123: display layers are like everything else, a node. so you can use the "select" command.

select -r "MyDisplayLayer";

you can also just use "setAttr" command to directly set the display options of the layer instead of relying on the "setLayerTo" mel function.


The select command is not selecting a layer

//
$objectArray =  `polyPlane -ax 0 0 0 -sx 15 -sy 15 -w 15 -h 15`;
//      Select the polyplane.
//
select $objectArray[0];
//      Create a layer but only put the polyplane in the layer.
//
createDisplayLayer -noRecurse -name "ReferenceLayer";
//
//
editDisplayLayerGlobals -cdl "ReferenceLayer";
//
// Sets the layer to Reference
setLayerTo selected".displayType" 2;
//
// Sets the layer to unshaded
setLayerTo selected".shading" 0;


I can select it with this but then the setlayerTo commands dont work but they do work if all run individually.
 
  08 August 2012
Where possible, I would try to avoid selecting things in scripts.
Why not create an empty layer, then use editDisplayLayerMembers to add the object?

string $objArray[] = `polySphere -r 1 -sx 8 -sy 8 -ax 0 1 0 -cuv 2 -ch 1`;
createDisplayLayer -empty -n "MyRefLayer";
editDisplayLayerMembers "MyRefLayer" $objArray[0];
setAttr "MyRefLayer.shading" 0;


David
__________________
http://www.djx.com.au
 
  08 August 2012
[QUOTE=djx]Where possible, I would try to avoid selecting things in scripts.
Why not create an empty layer, then use editDisplayLayerMembers to add the object?

Thank you that simplifies it, It's probably going to help for me to find a Mel for Dummies book.

Just got to fathom out how to align it to the selected face/faces

string $objArray[] = `polyPlane -ax 0 0 0 -sx 15 -sy 15 -w 15 -h 15`;
createDisplayLayer -empty -n "MyRefLayer";
editDisplayLayerMembers "MyRefLayer" $objArray[0];
setAttr "MyRefLayer.displayType" 2;
setAttr "MyRefLayer.shading" 0;
 
  08 August 2012
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 08:42 PM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.