Skip to content

Commit

Permalink
Merge branch 'release/v3.1.0'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Plugins/Android/libplateau.so
#	Plugins/Linux/x86_64/libplateau.so
#	Plugins/MacOS/arm64/libOpenMeshCore.8.0.dylib
#	Plugins/MacOS/arm64/libOpenMeshCore.dylib
#	Plugins/MacOS/arm64/libOpenMeshTools.8.0.dylib
#	Plugins/MacOS/arm64/libOpenMeshTools.dylib
#	Plugins/MacOS/arm64/libplateau.dylib
#	Plugins/MacOS/arm64/libz.1.2.13.dylib
#	Plugins/MacOS/arm64/libz.1.dylib
#	Plugins/MacOS/arm64/libz.dylib
#	Plugins/MacOS/x86_64/libOpenMeshCore.8.0.dylib
#	Plugins/MacOS/x86_64/libOpenMeshCore.dylib
#	Plugins/MacOS/x86_64/libOpenMeshTools.8.0.dylib
#	Plugins/MacOS/x86_64/libOpenMeshTools.dylib
#	Plugins/MacOS/x86_64/libplateau.dylib
#	Plugins/MacOS/x86_64/libz.1.2.13.dylib
#	Plugins/MacOS/x86_64/libz.1.dylib
#	Plugins/MacOS/x86_64/libz.dylib
#	Plugins/Windows/x86_64/plateau.dll
#	Plugins/iOS/plateau.framework/plateau
#	README.md
#	Runtime/CityAdjust/NonLibData/ContourMeshesMaker.cs
#	Runtime/CityAdjust/NonLibData/InstancedCityModelDict.cs
#	package.json
  • Loading branch information
linoal committed Nov 6, 2024
2 parents 104dade + b1d77e0 commit e005788
Show file tree
Hide file tree
Showing 495 changed files with 30,401 additions and 7,912 deletions.
6 changes: 3 additions & 3 deletions Documentation~/manual/ModelAdjust.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PLATEAUウィンドウの`モデル調整`では、インポートした都市

## 「Assetsに保存」機能

![](../resources/manual/cityAdjust/saveToAssets.png)
![assets png](https://github.com/user-attachments/assets/23089dce-3ccd-466f-b5be-8b077074b198)

### できること

Expand Down Expand Up @@ -58,7 +58,7 @@ PLATEAUウィンドウの`モデル調整`では、インポートした都市

## ゲームオブジェクトON/OFF機能

![](../resources/manual/cityAdjust/gameObjOnOff.png)
![Modeladjust](https://github.com/user-attachments/assets/e1a17cd7-4867-40a0-903b-3ec19bbc51f3)
- 条件指定をしてフィルタリングできます。
- ここでいうフィルタリングとは、条件に合致するゲームオブジェクトをアクティブにし、そうでないものを非アクティブにすることを指します。
- 「重複する地物を表示」にチェックを入れた場合、フィルタリング後に重複している地物について、
Expand All @@ -78,7 +78,7 @@ PLATEAUウィンドウの`モデル調整`では、インポートした都市
## 分割・結合・マテリアル分け機能

![](../resources/manual/cityAdjust/materialByType.png)
![material](https://github.com/user-attachments/assets/8c556a8e-8d63-479b-9f97-576c94246054)

### できること

Expand Down
3 changes: 2 additions & 1 deletion Editor/PLATEAU.Editor.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"references": [
"Unity.Formats.Fbx.Editor",
"libplateau",
"PLATEAU.Runtime"
"PLATEAU.Runtime",
"Unity.Splines"
],
"includePlatforms": [
"Editor"
Expand Down
2 changes: 1 addition & 1 deletion Samples.meta → Editor/RoadNetwork/CityObject.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using PLATEAU.RoadNetwork.CityObject;
using PLATEAU.RoadNetwork.CityObject.Drawer;
using PLATEAU.RoadNetwork.Util;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;

namespace PLATEAU.Editor.RoadNetwork.CityObject
{
[CustomEditor(typeof(PLATEAUSubDividedCityObjectGroup))]
public class PLATEAUSubDividedCityObjectGroupEditor : UnityEditor.Editor
{
private class SubDividedCityObjectInstanceHelper : SubDividedCityObjectDebugEditorWindow.IInstanceHelper
{
private PLATEAUSubDividedCityObjectGroup target;

public SubDividedCityObjectInstanceHelper(PLATEAUSubDividedCityObjectGroup target)
{
this.target = target;
}

public PLATEAUSubDividedCityObjectGroup GetCityObjects()
{
return target;
}

public bool IsTarget(SubDividedCityObject cityObject)
{
return RnEx.IsEditorSceneSelected(cityObject.CityObjectGroup);
}

private PLATEAUSubDividedCityObjectDrawerDebug DebugDrawer =>
target.GetComponent<PLATEAUSubDividedCityObjectDrawerDebug>();

public HashSet<SubDividedCityObject> TargetCityObjects
{
get
{
if (DebugDrawer)
return DebugDrawer.TargetCityObjects;
return new HashSet<SubDividedCityObject>();
}
}
}

public override void OnInspectorGUI()
{
var obj = target as PLATEAUSubDividedCityObjectGroup;
if (!obj)
return;

base.OnInspectorGUI();

GUILayout.Label($"ConvertedCityObjectVertexCount : {obj.CityObjects?.Sum(c => c.Meshes.Sum(m => m.Vertices.Count)) ?? 0}");

if (GUILayout.Button("Open Editor"))
SubDividedCityObjectDebugEditorWindow.OpenWindow(new SubDividedCityObjectInstanceHelper(obj), true);
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 112 additions & 0 deletions Editor/RoadNetwork/CityObject/SubDividedCityObjectDebugEditorWindow.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
using PLATEAU.RoadNetwork.CityObject;
using PLATEAU.RoadNetwork.Graph;
using PLATEAU.RoadNetwork.Util;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;

namespace PLATEAU.Editor.RoadNetwork.CityObject
{
public class SubDividedCityObjectDebugEditorWindow : EditorWindow
{
public interface IInstanceHelper
{
// グラフ取得
PLATEAUSubDividedCityObjectGroup GetCityObjects();

bool IsTarget(SubDividedCityObject cityObject);

HashSet<SubDividedCityObject> TargetCityObjects { get; }

// モデル作成する
// void CreateRnModel();

//void CreateTranMesh();
}

private const string WindowName = "SubDividedCityObject Editor";

public IInstanceHelper InstanceHelper { get; set; }

public void EditSubDividedCityObject(SubDividedCityObject e)
{
if (e == null)
return;
RnEditorUtil.TargetToggle($"{e.Name}", InstanceHelper.TargetCityObjects, e);
using (new EditorGUI.IndentLevelScope())
{
EditorGUILayout.EnumFlagsField("SelfRoadType", e.SelfRoadType);
EditorGUILayout.EnumFlagsField("ParentRoadType", e.ParentRoadType);
foreach (var root in e.CityObjects.rootCityObjects)
{
RnEditorUtil.Separator();
EditorGUILayout.LabelField(root.GmlID);
EditorGUILayout.EnumFlagsField("Type", root.GetRoadType());
}
}

RnEditorUtil.Separator();
EditorGUILayout.LabelField("Children");
using (new EditorGUI.IndentLevelScope())
{
foreach (var child in e.Children)
{
RnEditorUtil.Separator();
using (new EditorGUI.IndentLevelScope())
{
EditSubDividedCityObject(child);
}
}
}

}

/// <Summary>
/// ウィンドウのパーツを表示します。
/// </Summary>
private void OnGUI()
{
if (InstanceHelper == null)
return;

var cityObjects = InstanceHelper.GetCityObjects();
if (!cityObjects || !(cityObjects.CityObjects?.Any() ?? false))
{
return;
}


RnEditorUtil.Separator();

using (new EditorGUI.DisabledScope(true))
{
EditorGUILayout.IntField("CityObjects", cityObjects.CityObjects.Count);
}

RnEditorUtil.Separator();
foreach (var cog in cityObjects.CityObjects)
{
if (InstanceHelper.IsTarget(cog) || InstanceHelper.TargetCityObjects.Contains(cog))
{
RnEditorUtil.Separator();
EditSubDividedCityObject(cog);
}
}
}


/// <summary>
/// ウィンドウを取得する、存在しない場合に生成する
/// </summary>
/// <param name="instance"></param>
/// <param name="focus"></param>
/// <returns></returns>
public static SubDividedCityObjectDebugEditorWindow OpenWindow(IInstanceHelper instance, bool focus)
{
var ret = GetWindow<SubDividedCityObjectDebugEditorWindow>(WindowName, focus);
ret.InstanceHelper = instance;
return ret;
}

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e005788

Please sign in to comment.