NVIDIA DeepLearning Dataset Synthesizer (NDDS)
 All Classes Namespaces Functions Variables Typedefs Pages
RandomMaterialParam_TextureComponent.h
1 /*
2 * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * NVIDIA CORPORATION and its licensors retain all intellectual property
5 * and proprietary rights in and to this software, related documentation
6 * and any modifications thereto. Any use, reproduction, disclosure or
7 * distribution of this software and related documentation without an express
8 * license agreement from NVIDIA CORPORATION is strictly prohibited.
9 */
10 
11 #pragma once
12 
13 #include "DomainRandomizationDNNPCH.h"
14 #include "RandomMaterialParameterComponentBase.h"
15 #include "DRUtils.h"
16 #include "RandomMaterialParam_TextureComponent.generated.h"
17 
18 /// @cond DOXYGEN_SUPPRESSED_CODE
19 UCLASS(Blueprintable, ClassGroup = (NVIDIA), meta = (BlueprintSpawnableComponent))
20 /// @endcond DOXYGEN_SUPPRESSED_CODE
22 {
23  GENERATED_BODY()
24 
25 public:
27 
28 protected:
29  virtual void PostLoad() override;
30  virtual void BeginPlay() override;
31  virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
32  virtual void UpdateMaterial(UMaterialInstanceDynamic* MaterialToMofidy) override;
33 
34  bool HasAssetToRandomize() const;
35 
36 protected: // Editor properties
37  // DEPRECATED_FORGAME(4.16, "Use MaterialParameterNames instead")
38  UPROPERTY()
39  FName TextureParameterName;
40 
41  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Randomization)
42  bool bUseAllTextureInAFolder;
43 
44  // Path to the directory where we want to use textures from
45  UPROPERTY()
46  FDirectoryPath TextureDirectory;
47 
48  // List of directories where we want to use the static meshes from
49  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Randomization, meta = (EditCondition = "bUseAllTextureInAFolder", RelativeToGameContentDir))
50  TArray<FDirectoryPath> TextureDirectories;
51 
52  // List of the texture that the owner mesh's material will change through
53  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Randomization, meta = (EditCondition = "!bUseAllTextureInAFolder"))
54  TArray<UTexture*> TextureList;
55 
56 protected:
57  UPROPERTY(Transient)
58  FRandomAssetStreamer TextureStreamer;
59 };