Skip to content

Commit

Permalink
minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
i-saint committed Jun 22, 2017
1 parent c472de4 commit 157a3d6
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,11 +263,14 @@ void DrawEditPanel()
}
else
{
settings.selectFrontSideOnly = EditorGUILayout.Toggle("Front Side Only", settings.selectFrontSideOnly);
if(settings.selectMode == SelectMode.Single)
{
settings.selectTriangle = EditorGUILayout.Toggle("Triangle", settings.selectTriangle);
GUILayout.BeginHorizontal();
settings.selectVertex = GUILayout.Toggle(settings.selectVertex, "Vertex", "Button");
settings.selectTriangle = GUILayout.Toggle(settings.selectTriangle, "Triangle", "Button");
GUILayout.EndHorizontal();
}
settings.selectFrontSideOnly = EditorGUILayout.Toggle("Front Side Only", settings.selectFrontSideOnly);
}
EditorGUILayout.Space();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ int HandleMouseEvent(Event e, EventType et, int id)
if (!e.shift && !e.control)
System.Array.Clear(m_selection, 0, m_selection.Length);

if (SelectSingle(e, selectSign, settings.selectFrontSideOnly))
if (settings.selectVertex && SelectVertex(e, selectSign, settings.selectFrontSideOnly))
{
handled = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class SelectionSet
public SelectMode selectMode = SelectMode.Single;
public MirrorMode mirrorMode = MirrorMode.None;
public bool selectFrontSideOnly = true;
public bool selectVertex = true;
public bool selectTriangle = true;
public bool rotatePivot = false;
public bool brushUseSelection = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,15 +444,15 @@ public static Vector2 ScreenCoord11(Vector2 v)
(v.y / pixelRect.height * rect.height * 2.0f - 1.0f) * -1.0f);
}

public bool SelectSingle(Event e, float strength, bool frontFaceOnly)
public bool SelectVertex(Event e, float strength, bool frontFaceOnly)
{
var center = e.mousePosition;
var size = new Vector2(15.0f, 15.0f);
var r1 = center - size;
var r2 = center + size;
return SelectSingle(r1, r2, strength, frontFaceOnly);
return SelectVertex(r1, r2, strength, frontFaceOnly);
}
public bool SelectSingle(Vector2 r1, Vector2 r2, float strength, bool frontFaceOnly)
public bool SelectVertex(Vector2 r1, Vector2 r2, float strength, bool frontFaceOnly)
{
var cam = SceneView.lastActiveSceneView.camera;
if (cam == null) { return false; }
Expand Down
8 changes: 4 additions & 4 deletions Plugin/NormalPainter.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<IncludePath>C:\Program Files\Autodesk\FBX\FBX SDK\2017.1\include;$(SolutionDir);$(IncludePath)</IncludePath>
<IncludePath>C:\Program Files\Autodesk\FBX\FBX SDK\2018.1.1\include;$(SolutionDir);$(IncludePath)</IncludePath>
<OutDir>$(SolutionDir)_out\$(ProjectName)_$(Platform)_$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_tmp\$(ProjectName)_$(Platform)_$(Configuration)\</IntDir>
<LibraryPath>C:\Program Files\Autodesk\FBX\FBX SDK\2017.1\lib\vs2015\x64\release;$(LibraryPath)</LibraryPath>
<LibraryPath>C:\Program Files\Autodesk\FBX\FBX SDK\2018.1.1\lib\vs2015\x64\release;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Master|x64'">
<IncludePath>C:\Program Files\Autodesk\FBX\FBX SDK\2017.1\include;$(SolutionDir);$(IncludePath)</IncludePath>
<IncludePath>C:\Program Files\Autodesk\FBX\FBX SDK\2018.1.1\include;$(SolutionDir);$(IncludePath)</IncludePath>
<OutDir>$(SolutionDir)_out\$(ProjectName)_$(Platform)_$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)_tmp\$(ProjectName)_$(Platform)_$(Configuration)\</IntDir>
<LibraryPath>C:\Program Files\Autodesk\FBX\FBX SDK\2017.1\lib\vs2015\x64\release;$(LibraryPath)</LibraryPath>
<LibraryPath>C:\Program Files\Autodesk\FBX\FBX SDK\2018.1.1\lib\vs2015\x64\release;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PostBuildEvent>
Expand Down
Binary file removed doc/MeshSyncServer.png
Binary file not shown.
Binary file removed doc/normal_editing.png
Binary file not shown.

0 comments on commit 157a3d6

Please sign in to comment.