unreal.MetaHumanCharacterEditorSubsystem

class unreal.MetaHumanCharacterEditorSubsystem(outer: Object | None = None, name: Name | str = 'None')

Bases: EditorSubsystem

Subsystem used to interface with the UMetaHumanCharacter asset. Any edits to a MetaHumanCharacter that may need to be exposed as an API should be done as part of this class, as UFUNCTIONs declared here are automatically exposed

C++ Source:

  • Plugin: MetaHumanCharacter

  • Module: MetaHumanCharacterEditor

  • File: MetaHumanCharacterEditorSubsystem.h

assemble_for_preview(character) None

Runs the editor pipeline (Preview quality) for the given character. Use whenever changes are made that should be reflected in the preview

Parameters:

character (MetaHumanCharacter)

build_meta_human(character, params) None

brief: Assemble a MetaHuman Character. Which type of assembly and configuration options can be set using InParams

Parameters:
can_build_meta_human(character, log_error=False) bool

brief: Checks if MetaHuman character is ready for assembly. If the character is not ready a message with the reason why can be printed in the logs using bInLogError.

Parameters:
  • character (MetaHumanCharacter) – The character to verify

  • log_error (bool) – Set to log an error message if the character can’t be built

Returns:

true if the character can be built and false otherwise

Return type:

bool

commit_body_state(character) None

Commits the Body State of the given Character to be serialized. This needs to be done after after using the sculpting or blending APIs to persist the changes Requires the character to be added for edit using TryAddObjectToEdit

Parameters:

character (MetaHumanCharacter)

commit_eyes_settings(character, eyes_settings) None

brief: Commits the eyes settings to the character and updates the associated actors

Parameters:
commit_face_state(character) None

Commits the Face State of the given Character to be serialized. This needs to be done after after using the sculpting or blending APIs to persist the changes Requires the character to be added for edit using TryAddObjectToEdit

Parameters:

character (MetaHumanCharacter)

commit_head_model_settings(meta_human_character, head_model_settings) None

Set all the Head Model settings to the character and apply the changes to all the registered actors.

Parameters:
commit_makeup_settings(character, makeup_settings) None

brief: Commits the makeup settings to the character and updates the associated actors

Parameters:
commit_skin_settings(character, skin_settings) None

Set all the skin settings to the character and apply the changes to all registered actors. This will synthesize textures if needed based on skin settings. This will also discard any high resolution textures currently stored in the Character

Parameters:
compare_body_state(character1, character2, tolerance) bool

Evaluate the body state for each of the supplied characters, and compare the vertices and vertex normals Requires the characters to have been added for edit using TryAddObjectToEdit Returns true if all corresponding vertices and vertex normals are within InTolerance of each other in terms of vector norm

Parameters:
Return type:

bool

compare_face_state(character1, character2, tolerance) bool

Evaluate the face state for each of the supplied characters, and compare the vertices and vertex normals Requires the characters to have been added for edit using TryAddObjectToEdit Returns true if all corresponding vertices and vertex normals are within InTolerance of each other in terms of vector norm

Parameters:
Return type:

bool

classmethod compare_face_textures(character1, character2, pixel_tolerance) bool

Compare the face textures for the two supplied characters Does NOT require the characters to have been added for edit Returns true if face textures are identical to within the specified tolerance for each channel of each pixel, false otherwise

Parameters:
Return type:

bool

fit_state_to_target_vertices(character, params) bool

brief: Fit the character to the supplied vertices. Requires the character to be added for edit using TryAddObjectToEdit

Parameters:
Returns:

true if successful, false otherwise

Return type:

bool

get_body_constraints(character, scale_measurement_ranges_with_height=False) Array[MetaHumanCharacterBodyConstraint]

brief: Gets the list of body constrains from the underlying parametric body model Requires the character to be added for edit using TryAddObjectToEdit

Parameters:
  • character (MetaHumanCharacter) – the character to retrieve the body constraints for

  • scale_measurement_ranges_with_height (bool) – scale the measurement ranges by height to help stay within realistic model proportions

Returns:

the list of body constraints provided by the underlying parametric body model

Return type:

Array[MetaHumanCharacterBodyConstraint]

get_face_landmarks(character) Array[Vector]

brief: Gets the positions of the face landmarks for a given character. Requires the character to be added for edit using TryAddObjectToEdit

Parameters:

character (MetaHumanCharacter) – The character to obtain the landmarks for

Returns:

out_face_landmarks (Array[Vector]): the list with the face landmarks positions

Return type:

Array[Vector]

import_from_face_dna(character, dna_file_path, import_params) ImportErrorCode

brief: Either fits the Character face state to the input face DNA, or imports the DNA as-is, depending on options Requires the character to be added for edit using TryAddObjectToEdit

Parameters:
  • character (MetaHumanCharacter) – The character to import the DNA to

  • dna_file_path (str) – Path to the DNA file to be imported

  • import_params (ImportFromDNAParams) – Options for how to perform the import operation

Returns:

code indicating success or failure

Return type:

ImportErrorCode

import_from_template(character, template_mesh, template_left_eye_mesh, template_right_eye_mesh, template_teeth_mesh, import_params) ImportErrorCode

brief: Fits the Character face state to the conformed mesh of the input asset, which must be a SkelMesh or Static Mesh which has the correct number of vertices. In addition, the user can (optionally) in the case of a StaticMesh pass in up to three additional meshes for left eye, right eye and teeth, which if not null will be used in the fitting. Note that for the StaticMesh, if the extra meshes are present, they will be used and the flags in the import options will be ignored. Eye and Teeth meshes must contain the correct number of vertices for a MetaHuman.

Parameters:
  • character (MetaHumanCharacter) – The character to import the template mesh(es) to

  • template_mesh (Object) – The head mesh (either StaticMesh or SkelMesh) which much match the topology of a MetaHuman head mesh

  • template_left_eye_mesh (Object) – If not nullptr, must be a StaticMesh for the left eye which much match the topology of a MetaHuman left eye mesh

  • template_right_eye_mesh (Object) – If not nullptr, must be a StaticMesh for the right eye which much match the topology of a MetaHuman right eye mesh

  • template_teeth_mesh (Object) – If not nullptr, must be a StaticMesh for the teeth which much match the topology of a MetaHuman teeth mesh

  • import_params (ImportFromTemplateParams) – the parameters used during the fitting process

Returns:

code indicating success or failure

Return type:

ImportErrorCode

is_object_added_for_editing(character) bool

Returns true if the object is registered for editing

Parameters:

character (MetaHumanCharacter)

Return type:

bool

remove_object_to_edit(character) None

Tells the subsystem that a character is no longer being edited. Unloads the texture synthesis model when the last object being edited is removed from the subsystem

Parameters:

character (MetaHumanCharacter)

request_auto_rigging(character, params=[MetaHumanRigType.JOINTS_ONLY, True, False]) None

brief: Make a request to auto-rig a character Requires the character to be added for edit using TryAddObjectToEdit

Parameters:
request_texture_sources(character, params=[True, False]) None

brief: Request high resolution textures for the given character. This function does nothing if there is already a pending request

Parameters:
set_body_constraints(character, body_constraints) None

brief: Set body constraints and evaluate the parametric body Requires the character to be added for edit using TryAddObjectToEdit

Parameters:
spawn_meta_human_actor(character) Actor

brief: Spawns a MetaHuman Editor Actor in the main editor level The spawned actor will reflect any changes made to the character while its added to the subsystem

Parameters:

character (MetaHumanCharacter)

Return type:

Actor

translate_face_landmarks(character, landmark_indices, deltas) None

brief: Translates the face landmarks by the given deltas Requires the character to be added for edit using TryAddObjectToEdit The number of landmark indices and deltas must match

Parameters:
  • character (MetaHumanCharacter) – the character to translate the landmarks for

  • landmark_indices (Array[int32]) – The index of each landmark to be translated

  • deltas (Array[Vector]) – the list of translation deltas to apply to each landmark

try_add_object_to_edit(character) bool

Registers an object to be edited. The first object registered will also load the Texture Synthesis model to make it to be used

Most functions taking a Character on this class require the Character to be registered for editing first.

Call RemoveObjectToEdit when done editing. If TryAddObjectToEdit returns false, the Character is not registered, so there’s no need to call RemoveObjectToEdit.

Parameters:

character (MetaHumanCharacter)

Return type:

bool