make import road painter materials for maps
First implementation for applying road painter materials to imported maps. However, the user still has to access the road painter blueprint and click on the "Paint all roads button"
This commit is contained in:
parent
d6b0493b23
commit
6f7ba077cb
|
@ -59,14 +59,11 @@ UPrepareAssetsForCookingCommandlet::UPrepareAssetsForCookingCommandlet()
|
|||
"Material'/Game/Carla/Static/GenericMaterials/Grass/M_Grass01.M_Grass01'"));
|
||||
static ConstructorHelpers::FObjectFinder<UMaterial> SidewalkNode(TEXT(
|
||||
"Material'/Game/Carla/Static/GenericMaterials/CheapMaterials/M_SideWalkCheap01'"));
|
||||
static ConstructorHelpers::FObjectFinder<UClass> RoadPainterBlueprint(TEXT(
|
||||
"Blueprint'/Game/Carla/Blueprints/LevelDesign/RoadPainterPreset.RoadPainterPreset_C'"));
|
||||
|
||||
MarkingNodeMaterial = (UMaterialInstance *) MarkingNode.Object;
|
||||
RoadNodeMaterial = (UMaterialInstance *) RoadNode.Object;
|
||||
MarkingNodeMaterialAux = (UMaterialInstance *) RoadNodeAux.Object;
|
||||
SidewalkNodeMaterial = (UMaterial *) SidewalkNode.Object;
|
||||
RoadPainterSubclass = RoadPainterBlueprint.Object;
|
||||
#endif
|
||||
}
|
||||
#if WITH_EDITORONLY_DATA
|
||||
|
|
|
@ -161,10 +161,6 @@ private:
|
|||
UPROPERTY()
|
||||
UMaterialInstance *MarkingNodeMaterial;
|
||||
|
||||
/// Material used by RoadPainter
|
||||
UPROPERTY()
|
||||
UMaterialInstance *RoadNodeMaterialInstance;
|
||||
|
||||
/// Workaround material for the RoadNode mesh
|
||||
UPROPERTY()
|
||||
UMaterialInstance *RoadNodeMaterial;
|
||||
|
@ -181,10 +177,6 @@ private:
|
|||
UPROPERTY()
|
||||
UMaterial *SidewalkNodeMaterial;
|
||||
|
||||
/// Subclass for acquiring the RoadPainter blueprint
|
||||
UPROPERTY()
|
||||
TSubclassOf<ARoadPainterWrapper> RoadPainterSubclass;
|
||||
|
||||
/// Saves @a Package in .umap format in path @a PackagePath inside Unreal
|
||||
/// Content folder
|
||||
bool SavePackage(const FString &PackagePath, UPackage *Package) const;
|
||||
|
@ -193,4 +185,4 @@ private:
|
|||
/// @a PackageName
|
||||
FString GetFirstPackagePath(const FString &PackageName) const;
|
||||
|
||||
};
|
||||
};
|
|
@ -424,13 +424,19 @@ def import_assets_from_json_list(json_list):
|
|||
prepare_maps_commandlet_for_cooking(package_name, only_prepare_maps=True)
|
||||
|
||||
# We apply the carla materials to the imported maps
|
||||
# load_asset_materials_commandlet(package_name)
|
||||
load_asset_materials_commandlet(package_name)
|
||||
|
||||
def load_asset_materials_commandlet(package_name):
|
||||
commandlet_name = "LoadAssetMaterials"
|
||||
commandlet_arguments = ["-PackageName=%s" % package_name]
|
||||
invoke_commandlet(commandlet_name, commandlet_arguments)
|
||||
|
||||
|
||||
def load_asset_materials_commandlet(package_name):
|
||||
commandlet_name = "LoadAssetMaterials"
|
||||
commandlet_arguments = ["-PackageName=%s" % package_name]
|
||||
invoke_commandlet(commandlet_name, commandlet_arguments)
|
||||
|
||||
def prepare_maps_commandlet_for_cooking(package_name, only_prepare_maps):
|
||||
commandlet_name = "PrepareAssetsForCooking"
|
||||
commandlet_arguments = ["-PackageName=%s" % package_name]
|
||||
|
|
Loading…
Reference in New Issue