本文整理汇总了C#中pb_Object.SetSelectedFaces方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Object.SetSelectedFaces方法的具体用法?C# pb_Object.SetSelectedFaces怎么用?C# pb_Object.SetSelectedFaces使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_Object
的用法示例。
在下文中一共展示了pb_Object.SetSelectedFaces方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectEdges
private static bool ConnectEdges(pb_Object pb, pb_Edge[] edgesToConnect)
{
int len = edgesToConnect.Length;
List<EdgeConnection> splits = new List<EdgeConnection>();
for(int i = 0; i < len; i++)
{
foreach(pb_Face face in pbMeshUtils.GetConnectedFaces(pb, edgesToConnect[i]))
{
if(!splits.Contains((EdgeConnection)face))
{
List<pb_Edge> faceEdges = new List<pb_Edge>();
foreach(pb_Edge e in edgesToConnect)
{
int localEdgeIndex = face.edges.IndexOf(e, pb.sharedIndices);
if(localEdgeIndex > -1)
faceEdges.Add(face.edges[localEdgeIndex]);
}
if(faceEdges.Count > 1)
splits.Add(new EdgeConnection(face, faceEdges));
}
}
}
pb_Face[] faces;
if(pb.ConnectEdges(splits, out faces))
{
pb.SetSelectedFaces(faces);
pb.GenerateUV2(true);
pb.Refresh();
return true;
}
return false;
}
示例2: ClickShortcutCheck
/**
* return true if shortcut should eat the event
*/
internal bool ClickShortcutCheck(pb_Object pb, pb_Face selectedFace)
{
Event e = Event.current;
// Copy UV settings
if(e.modifiers == (EventModifiers.Control | EventModifiers.Shift))
{
// get first selected Auto UV face
pb_Object firstObj;
pb_Face source;
pb_Editor.instance.GetFirstSelectedFace(out firstObj, out source);
if( source != null )
{
pbUndo.RecordObject(pb, "Copy UV Settings");
selectedFace.SetUV( new pb_UV(source.uv) );
selectedFace.SetMaterial( source.material );
pb_Editor_Utility.ShowNotification("Copy UV Settings");
pb.ToMesh();
pb.Refresh();
pb.Optimize();
RefreshUVCoordinates();
Repaint();
return true;
}
else
{
return false;
}
}
else
if(e.modifiers == EventModifiers.Control)
{
int len = pb.SelectedFaces == null ? 0 : pb.SelectedFaces.Length;
if(len < 1)
return false;
pb_Face anchor = pb.SelectedFaces[len-1];
if(anchor == selectedFace) return false;
pbUndo.RecordObject(pb, "AutoStitch");
pb.ToMesh();
bool success = pbUVOps.AutoStitch(pb, anchor, selectedFace);
if(success)
{
RefreshElementGroups(pb);
pb.SetSelectedFaces(new pb_Face[]{selectedFace});
// // only need to do this for one pb_Object...
// for(int i = 0; i < selection.Length; i++)
// selection[i].RefreshUV( editor.SelectedFacesInEditZone[i] );
pb.Refresh();
pb.Optimize();
SetSelectedUVsWithSceneView();
RefreshUVCoordinates();
pb_Editor_Utility.ShowNotification("Autostitch");
if(editor != null)
editor.UpdateSelection(false);
Repaint();
}
else
{
pb.Refresh();
pb.Optimize();
}
return success;
}
return false;
}