Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions CesiumForUnreal.uplugin
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@
{
"Name": "Water",
"Enabled": true
},
{
"Name": "EditorScriptingUtilities",
"Enabled": true
}
}
]
}
1 change: 0 additions & 1 deletion Source/CesiumRuntime/CesiumRuntime.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ public CesiumRuntime(ReadOnlyTargetRules Target) : base(Target)
"SlateCore",
"WorldBrowser",
"ContentBrowser",
"EditorScriptingUtilities",
"MaterialEditor"
}
);
Expand Down
32 changes: 18 additions & 14 deletions Source/CesiumRuntime/Private/CesiumEncodedMetadataComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
#include "ComponentReregisterContext.h"
#include "Containers/Map.h"
#include "ContentBrowserModule.h"
#include "EditorAssetLibrary.h"
#include "Factories/MaterialFunctionMaterialLayerFactory.h"
#include "IContentBrowserSingleton.h"
#include "MaterialEditorUtilities.h"
#include "Materials/Material.h"
#include "Materials/MaterialExpressionCustom.h"
#include "Materials/MaterialExpressionFunctionInput.h"
Expand All @@ -32,6 +30,8 @@
#include "Modules/ModuleManager.h"
#include "Subsystems/AssetEditorSubsystem.h"
#include "UObject/Package.h"

extern UNREALED_API class UEditorEngine* GEditor;
#endif

void UCesiumEncodedMetadataComponent::AutoFill() {
Expand Down Expand Up @@ -863,19 +863,23 @@ void UCesiumEncodedMetadataComponent::GenerateMaterial() {
// FMaterialResource created when we make a new UMaterial in place
FGlobalComponentReregisterContext RecreateComponents;

// Save the asset
UEditorAssetLibrary::SaveLoadedAsset(this->TargetMaterialLayer, true);

// Open updated material in editor.
FAssetData assetData(this->TargetMaterialLayer);
FMaterialEditorUtilities::OnOpenFunction(assetData);

TArray<UObject*> AssetsToHighlight;
AssetsToHighlight.Add(this->TargetMaterialLayer);
if (GEditor) {
UAssetEditorSubsystem* pAssetEditor =
GEditor->GetEditorSubsystem<UAssetEditorSubsystem>();
if (pAssetEditor) {
pAssetEditor->OpenEditorForAsset(this->TargetMaterialLayer);
}
}

FContentBrowserModule& ContentBrowserModule =
FModuleManager::Get().LoadModuleChecked<FContentBrowserModule>(
FContentBrowserModule* pContentBrowserModule =
FModuleManager::Get().GetModulePtr<FContentBrowserModule>(
"ContentBrowser");
ContentBrowserModule.Get().SyncBrowserToAssets(AssetsToHighlight);
if (pContentBrowserModule) {
TArray<UObject*> AssetsToHighlight;
AssetsToHighlight.Add(this->TargetMaterialLayer);
pContentBrowserModule->Get().SyncBrowserToAssets(AssetsToHighlight);
}
}
#endif

#endif // WITH_EDITOR
2 changes: 2 additions & 0 deletions Source/CesiumRuntime/Public/CesiumEncodedMetadataComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ class CESIUMRUNTIME_API UCesiumEncodedMetadataComponent
*/
UFUNCTION(CallInEditor, Category = "EncodeMetadata")
void GenerateMaterial();
#endif

#if WITH_EDITORONLY_DATA
/**
* @brief This is the target UMaterialFunctionMaterialLayer that the
* boiler-plate material generation will use. When pressing
Expand Down
10 changes: 6 additions & 4 deletions Source/CesiumRuntime/Public/CesiumExclusionZone.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@

#include "CesiumExclusionZone.generated.h"

struct UE_DEPRECATED(
4.26,
"Exclusion Zones have been deprecated. Please use Cartographic Polygon actor instead.")
FCesiumExclusionZone;

/**
* A region that should be excluded from a tileset.
*
* This is **experimental**, and may change in future releases.
*/
USTRUCT()
struct UE_DEPRECATED(
4.26,
"Exclusion Zones have been deprecated. Please use Cartographic Polygon actor instead.")
FCesiumExclusionZone {
struct CESIUMRUNTIME_API FCesiumExclusionZone {
GENERATED_BODY()

/**
Expand Down
10 changes: 6 additions & 4 deletions Source/CesiumRuntime/Public/CesiumMetadataFeatureTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ struct Accessor;
struct FeatureTable;
} // namespace CesiumGltf

struct UE_DEPRECATED(
4.26,
"FCesiumMetadataFeatureTable is deprecated, use FCesiumFeatureTable instead.")
FCesiumMetadataFeatureTable;

/**
* A Blueprint-accessible wrapper for a glTF feature table. A feature table is a
* collection of properties for each feature ID in the mesh. It also knows how
* to look up the feature ID associated with a given mesh vertex.
*/
USTRUCT(BlueprintType)
struct UE_DEPRECATED(
4.26,
"FCesiumMetadataFeatureTable is deprecated, use FCesiumFeatureTable instead.")
CESIUMRUNTIME_API FCesiumMetadataFeatureTable {
struct CESIUMRUNTIME_API FCesiumMetadataFeatureTable {
GENERATED_USTRUCT_BODY()

using FeatureIDAccessorType = std::variant<
Expand Down