Python script for Unreal Engine 4 (UE4) and Datasmith.
The script changes the mobility of Static Mesh Actors.
Use the Web Helper to generate a Python file.
Simply follow the instructions on the website and click "Download Python Script".
Given an Autodesk Revit model.
Assume one wants to create a game/application in UE4 where users can try interact with the world geometry.
E.g. Try different room layouts by moving the furnitures around.
By using Datasmith, one could import said Revit file to UE4.
A problem occurs when working with the objects in the level.
All imported Revit objects are stationary by defualt.
Their movability should be set to MOVABLE.
This scripts sets the mobility from STATIC to MOVABLE for all selected objects.
In summary, one does not have to click on each individual object.
The Collab Viewer Template joins multiple people together in a shared experience of the same 3D content.
It's intended to make it easier and quicker for your team to review and communicate about designs in realtime, so that you can identify problems and iterate on the content more efficiently.
If you want to transform (i.e. move) certain objects, these objects should be set to MOVABLE.
The Python Script might come in handy.
N.B. Datasmith should be included with 4.24. Read more
Make sure the Python Editor Script Plugin
and the Datasmith Importer Plugin
are enabled.
- Export Datasmith Content from Revit
- Import Datasmith Conent into EU4
- Enable Python in UE4
- Run the script in UE4 via
File->Execute Python Script
.
Set the mobily state by changing the variable:
mobility = mobilityStates[state]
where state
is one of the following:
- 0 = STATIC
- 1 = STATIONARY
- 2 = MOVABLE
E.g. mobility = mobilityStates[2]
sets the mobility to MOVABLE.
Set which element categories should be affected:
metadataValues = ["Cat1", "Cat2", "Cat3"]
E.g. metadataValues = ["Furniture"]
will only affect objects that are categorized as furnitures.
Further documentation can be found inside each folder.
- Aleksi Torhamo - Using
__import__
to dynamically import modules - Ned Batchelder - Security warnings regarding
Eval()
- Victor - Calling php function with AJAX and jQuery