Giter VIP home page Giter VIP logo

pythonsamples's Introduction

PythonSamples

This folder contains some python samples to script the editor in Unreal Engine.

The samples cover diverse functions of the editor: asset manipulation, data import, scene manipulation, etc. The python API evolves over versions and is still prone to changes. Files initially commited were working with UE 4.26.

The examples are provided to illustrate usage of the API. No particular care was given to meet python coding standards or homogenize the coding styles from the different authors.

Animation

Look into your installation folder \Engine\Plugins\MovieScene\SequencerScripting\Content\Python for samples.

Asset

  • Change_Lightmass_Resolution.py : Change the lightmass resolution on static meshes of selected actors.
  • Commit_on_Dataprep.py : load and execute a dataprep asset.
  • Consolidate_material_instances.py : Consolidate (remove duplicate) materials that have identical names.
  • Edit_a_light_component.py : change the IES texture of a light component of filtered actors.
  • Edit_Blueprint_asset_properties.py : edit default value of a blueprint (Class editing and not instance editing).
  • get_property.py : show how to filter actors by label and read a property on the actor.

Creation

  • Create_a_basic_material.py : Create a material and add a base color property in the graph.
  • Create_and_connect_material_parameter_expression.py : Add and link material parameter expression inside a material graph.
  • Create_Import_update_material_parameters.py : Show how to import texture, create material and material instance, reparent material and set parameters on a material instance.
  • Create_new_blueprint.py : Create a new Blueprint.

Import / Export

  • Asset_Import_task.py : import all ies files contained in a directory.
  • Batch_JT_Import.py : batch import all JT files from a folder using a slow task.
  • CAD_importer.py : simple CAD import.
  • Deltagen_Import_look_variants.py : for variant import in UE from Deltagen exports, read and create look variants.
  • Deltagen_Import_package_variants.py : for variant import in UE from Deltagen exports, read and create dependencies in package variants.
  • Export_selected_actors_to_FBX.py : Export all selected actors into a FBX file.
  • import_ABC.py : import an alembic file.
  • Import_CAD_and_re-export_as_FBX_or_OBJ.py : import CAD file, merge static meshes and export as FBX or OBJ format.
  • Import_Datasmith_CAD_and_set_LODs.py : multiple import of CAD file with different tessellation settings to use them as LOD on the final static mesh.
  • Import_Datatable.py : import JSON file following structure define in project as datatable.
  • import_FBX.py : import FBX.
  • DataprepOperation.py : example of a custom Dataprep Operation made in python, add tags to static mesh actor with specific string in actor label.
  • Interchange_Pipeline.py : example of a custom Interchange Pipeline made in python, override compression settings based on texture name suffix.

Level

  • Generate_Box_UV_on_selected_actors.py : generate box style UV on all selected actors in the level.
  • Line_Trace_Place_Actor.py : perform line trace on convex geometry to spawn actor on surface.
  • Merge_and_proxy.py : generate a merged and proxy mesh from selection, then use proxy mesh as LOD1 of the merged mesh. Replace selection with merged mesh and its proxy LOD.
  • Merge_hierarchy_and_replace_them_by_instance_based_on_metadata.py : Detect repetitive sub hierarchies based on SU.GUID, merge first instance as static mesh, and replace all instances with new static meshes actors. Simplify hierarchy.
  • Rename_components_on_a_selected_BP_actor_in_the_level.py : Rename static mesh components of selected actors in the level.
  • Substitute_actor_with_a_given_tag.py : spawn actors in place of filtered components with given tag.
  • Substitute_assets_with_consolidate_assets.py : replace material and consolidate.

Miscellaneous

  • ExamplePythonMenus.py : Adds custom menus in main toolbar, on right-click actions on assets, in custom editor window such as texture editor window menu.
  • Register_your_python_code_to_run_at_a_later_time.py : execute python callback on pre tick.
  • TakeHighResScreenshot_from_all_cam.py : demonstrate how to break down screenshot capture and perform them on tick.
  • tick_in_python.py : demonstrate how to break down some work and perform it on tick.
  • Validate_pointLight.py : show how to use asset or log while testing for light properties.

External resources

pythonsamples's People

Contributors

flavienpicon avatar ue-flavienp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pythonsamples's Issues

AttributeError: module 'unreal' has no attribute 'EditorAssetLibrary'

Hello I got problem while running 'Create_a_basic_material.py' in unreal5

LogPython: Error: Traceback (most recent call last):
LogPython: Error: File "C:/Users/User/Desktop/Create_a_basic_material.py", line 6, in
LogPython: Error: if unreal.EditorAssetLibrary.does_directory_exist(test_dir):
LogPython: Error: AttributeError: module 'unreal' has no attribute 'EditorAssetLibrary'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.