WIP : Props placement & lighting test
This commit is contained in:
@@ -14,7 +14,8 @@ namespace FBXImporter
|
||||
{
|
||||
static AssetDeleteResult OnWillDeleteAsset(string path, RemoveAssetOptions options)
|
||||
{
|
||||
if (!path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase))
|
||||
if (!path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) &&
|
||||
!path.EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase))
|
||||
return AssetDeleteResult.DidNotDelete;
|
||||
|
||||
// Resolve GUID now, while the file still exists
|
||||
|
||||
@@ -22,7 +22,8 @@ namespace FBXImporter
|
||||
string rootNode = "",
|
||||
string originalSourceFolder = "")
|
||||
{
|
||||
if (!fbxAssetPath.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) ||
|
||||
if ((!fbxAssetPath.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) &&
|
||||
!fbxAssetPath.EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase)) ||
|
||||
!fbxAssetPath.StartsWith("Assets/"))
|
||||
{
|
||||
Debug.LogWarning($"[FBXImporter] Skipped: {fbxAssetPath}");
|
||||
|
||||
@@ -11,7 +11,8 @@ namespace FBXImporter
|
||||
foreach (var obj in Selection.objects)
|
||||
{
|
||||
string path = AssetDatabase.GetAssetPath(obj);
|
||||
if (!path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase)) continue;
|
||||
if (!path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) &&
|
||||
!path.EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase)) continue;
|
||||
var source = FBXSourceDetector.Detect(path);
|
||||
FBXImportDialog.Show(path, source);
|
||||
}
|
||||
@@ -20,7 +21,8 @@ namespace FBXImporter
|
||||
[MenuItem("Assets/FBX Importer/Process this FBX", true)]
|
||||
static bool ProcessSingleValidate() =>
|
||||
Selection.objects.Any(o => AssetDatabase.GetAssetPath(o)
|
||||
.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase));
|
||||
.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) ||
|
||||
AssetDatabase.GetAssetPath(o).EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
[MenuItem("Assets/FBX Importer/Remove from registry", false, 1001)]
|
||||
static void RemoveFromRegistry()
|
||||
@@ -28,15 +30,17 @@ namespace FBXImporter
|
||||
foreach (var obj in Selection.objects)
|
||||
{
|
||||
string path = AssetDatabase.GetAssetPath(obj);
|
||||
if (path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase))
|
||||
if (path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) ||
|
||||
path.EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase))
|
||||
ProcessedFBXRegistry.Unregister(path);
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Assets/FBX Importer/Remove from registry", true)]
|
||||
static bool RemoveFromRegistryValidate() =>
|
||||
Selection.objects.Any(o => AssetDatabase.GetAssetPath(o)
|
||||
.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase));
|
||||
Selection.objects.Any(o => AssetDatabase.GetAssetPath(o)
|
||||
.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) ||
|
||||
AssetDatabase.GetAssetPath(o).EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
[MenuItem("Assets/FBX Importer/Create Asset Folder Structure", false, 1020)]
|
||||
static void CreateFolderStructure()
|
||||
|
||||
@@ -47,7 +47,8 @@ namespace FBXImporter
|
||||
if (_selectedFBX == null) return;
|
||||
|
||||
string path = AssetDatabase.GetAssetPath(_selectedFBX);
|
||||
if (!path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase))
|
||||
if (!path.EndsWith(".fbx", System.StringComparison.OrdinalIgnoreCase) &&
|
||||
!path.EndsWith(".obj", System.StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
EditorGUILayout.HelpBox("Not a .fbx file.", MessageType.Warning);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user