本文整理汇总了C#中pb_Face.SetUV方法的典型用法代码示例。如果您正苦于以下问题:C# pb_Face.SetUV方法的具体用法?C# pb_Face.SetUV怎么用?C# pb_Face.SetUV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_Face
的用法示例。
在下文中一共展示了pb_Face.SetUV方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetFaceUV
/**
* \brief Sets the pb_Face uvSettings param to match the passed #pv_UV _uv
*/
public void SetFaceUV(pb_Face face, pb_UV uvParams)
{
face.SetUV(uvParams);
if(face.uv.useWorldSpace)
{
Vector3[] v = new Vector3[face.distinctIndices.Length];
for(int i = 0; i < v.Length; i++)
v[i] = _vertices[face.distinctIndices[i]];
SetUVs(face, pb_UVUtility.PlanarMap( v, face.uv) );
}
else
SetUVs(face, pb_UVUtility.PlanarMap( face.GetDistinctVertices(_vertices), face.uv) );
}
示例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;
}