Skip to content

Commit

Permalink
Private variables update
Browse files Browse the repository at this point in the history
  • Loading branch information
irajsb committed Feb 25, 2023
1 parent 145fdd8 commit 79f2d58
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Source/UE_Assimp/Private/AIScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ UAIScene* UAIScene::InternalConstructNewScene(UObject* Parent, const aiScene* Sc

// If assimp scene does not have UnitScaleFactor in metadata, presume 1.0f
bool success = SceneObject->scene->mMetaData->Get("UnitScaleFactor", SceneObject->SceneScale);

if (!success) {
SceneObject->SceneScale = 1.0f;
UE_LOG(LogAssimp, Warning, TEXT("No UnitScaleFactor in metadata."));
Expand Down Expand Up @@ -281,3 +282,8 @@ EPixelFormat UAIScene::GetPixelFormat(const aiTexture* Texture)
}
return EPixelFormat::PF_Unknown;
}

float UAIScene::GetSceneScale()
{
return SceneScale;
}
11 changes: 7 additions & 4 deletions Source/UE_Assimp/Public/AIScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ class UE_ASSIMP_API UAIScene : public UObject
UTexture2D* GetEmbeddedTexture(FString FilePath, bool bIsNormalMap);
UPROPERTY(BlueprintReadOnly)
FString FullFilePath;
UFUNCTION(BlueprintCallable,BlueprintPure)
float GetSceneScale();


float SceneScale;


static EPixelFormat GetPixelFormat(const aiTexture* Texture);


private:
//For Object Creation
UPROPERTY(Transient)
TArray<UAIMesh*> OwnedMeshes;
Expand All @@ -85,7 +87,8 @@ class UE_ASSIMP_API UAIScene : public UObject
UPROPERTY(Transient)
TArray<UAIMaterial*> OwnedMaterials;
aiScene* scene;


virtual void BeginDestroy() override;
float SceneScale;
};


0 comments on commit 79f2d58

Please sign in to comment.