unreal.SubobjectDataSubsystem
¶
- class unreal.SubobjectDataSubsystem(outer=None, name='None')¶
Bases:
unreal.EngineSubsystem
The Subobject Data Subsystem will produce the reflected subobject data based on a given root object. A root object can be anything, an actor instance clicked on via the level editor, a UBlueprint* by opening an asset, or something piped in from python or other scripting languages.
C++ Source:
Module: SubobjectDataInterface
File: SubobjectDataSubsystem.h
- add_new_subobject(params) -> (SubobjectDataHandle, fail_reason=Text)¶
Add a new subobject as a child to the given parent object
- Parameters
params (AddNewSubobjectParams) – Options to consider when adding this subobject
- Returns
FSubobjectDataHandle Handle to the newly created subobject, Invalid handle if creation failed
fail_reason (Text):
- Return type
- attach_subobject(owner_handle, child_to_add_handle) bool ¶
Add the given subobject to a new owner. This will remove the subobject from its previous owner if necessary.
- Parameters
owner_handle (SubobjectDataHandle) – The new owner to attach to
child_to_add_handle (SubobjectDataHandle) – Handle to the subobject that will become a child of the owner
- Returns
true if the child was added successfully
- Return type
- can_copy_subobjects(handles) bool ¶
Returns true if the given array of handles represents subobjects that can be copied.
- Parameters
handles (Array(SubobjectDataHandle)) –
- Return type
- can_paste_subobjects(root_handle, bp_context=None) bool ¶
Can Paste Subobjects
- Parameters
root_handle (SubobjectDataHandle) –
bp_context (Blueprint) –
- Return type
- change_subobject_class(handle, new_class) bool ¶
Attempts to change the subclass of a native component
- Parameters
handle (SubobjectDataHandle) – Handle to the subobject to change class of
new_class (type(Class)) – The new class that is desired for the given subobject
- Returns
True if the class change was successful, false otherwise.
- Return type
- copy_subobjects(handles, bp_context) None ¶
Copy Subobjects
- Parameters
handles (Array(SubobjectDataHandle)) –
bp_context (Blueprint) –
- classmethod create_new_bp_component(component_class, new_class_path, new_class_name)¶
Creates a new Blueprint component from the specified class type The user will be prompted to pick a new subclass name and a blueprint asset will be created
- classmethod create_new_cpp_component(component_class, new_class_path, new_class_name)¶
Creates a new C++ component from the specified class type The user will be prompted to pick a new subclass name and code will be recompiled
- delete_subobject(context_handle, subobject_to_delete, bp_context=None) int32 ¶
Attempts to delete the given subobject from its blueprint context
- Parameters
context_handle (SubobjectDataHandle) – The owning context of the subobjects that should be removed
subobject_to_delete (SubobjectDataHandle) – The subobject handles that should be deleted
bp_context (Blueprint) – The blueprint context for the given
- Returns
The number of subobjects successfully deleted
- Return type
int32
- delete_subobjects(context_handle, subobjects_to_delete, bp_context=None) int32 ¶
Attempts to delete the given array of subobjects from their context
- Parameters
context_handle (SubobjectDataHandle) – The owning context of the subobjects that should be removed
subobjects_to_delete (Array(SubobjectDataHandle)) – Array of subobject handles that should be deleted
bp_context (Blueprint) – The blueprint context for the given
- Returns
The number of subobjects successfully deleted
- Return type
int32
- detach_subobject(owner_handle, child_to_remove) bool ¶
Remove the child subobject from the owner
- Parameters
owner_handle (SubobjectDataHandle) –
child_to_remove (SubobjectDataHandle) –
- Returns
True if the child was successfully removed.
- Return type
- find_handle_for_object(context, object_to_find, bp_context=None) SubobjectDataHandle ¶
Attempt to find an existing handle for the given object.
- Parameters
context (SubobjectDataHandle) – The context that the object to find is within
object_to_find (Object) – The object that you want to find the handle for within the context
bp_context (Blueprint) –
- Returns
FSubobjectDataHandle The subobject handle for the object, Invalid handle if not found.
- Return type
- is_valid_rename(handle, new_text) Text or None ¶
Returns true if the given new text is a valid option to rename the subobject with the given handle. Populates the OutErrorMessage if it is not valid.
- Parameters
handle (SubobjectDataHandle) – Handle to the subobject that is being checked
new_text (Text) – The new name that is desired
- Returns
True if the rename is valid
out_error_message (Text): The reasoning for an invalid name
- Return type
Text or None
- k2_delete_subobject_from_instance(context_handle, subobject_to_delete) int32 ¶
Attempts to delete the given subobject from its context
- Parameters
context_handle (SubobjectDataHandle) – The owning context of the subobjects that should be removed
subobject_to_delete (SubobjectDataHandle) – The subobject handles that should be deleted
- Returns
The number of subobjects successfully deleted
- Return type
int32
- k2_delete_subobjects_from_instance(context_handle, subobjects_to_delete) int32 ¶
Attempts to delete the given array of subobjects from their context
- Parameters
context_handle (SubobjectDataHandle) – The owning context of the subobjects that should be removed
subobjects_to_delete (Array(SubobjectDataHandle)) – Array of subobject handles that should be deleted
- Returns
The number of subobjects successfully deleted
- Return type
int32
- k2_find_subobject_data_from_handle(handle) SubobjectData or None ¶
Attempt to find the subobject data for a given handle. OutData will only be valid if the function returns true.
- Parameters
handle (SubobjectDataHandle) – Handle of the subobject data you want to acquire
- Returns
bool true if the data was found
out_data (SubobjectData): Reference to the subobject data to populate
- Return type
SubobjectData or None
- k2_gather_subobject_data_for_blueprint(context)¶
Gather all subobjects that the given Blueprint context has. Populates an array of handles that will have the given context and all it’s subobjects.
- Parameters
context (Blueprint) – Object to gather subobjects for
- Returns
out_array (Array(SubobjectDataHandle)): Array to populate (will be emptied first)
- Return type
- k2_gather_subobject_data_for_instance(context)¶
Gather all subobjects that the given actor instance has. Populates an array of handles that will have the given context and all it’s subobjects.
- Parameters
context (Actor) – Object to gather subobjects for
- Returns
out_array (Array(SubobjectDataHandle)): Array to populate (will be emptied first)
- Return type
- make_new_scene_root(context, new_scene_root, bp_context) bool ¶
Make New Scene Root
- Parameters
context (SubobjectDataHandle) –
new_scene_root (SubobjectDataHandle) –
bp_context (Blueprint) –
- Return type
- rename_subobject(handle, new_name) bool ¶
Attempts to rename the given subobject to the new name.
- Parameters
handle (SubobjectDataHandle) – Handle to the subobject to rename
new_name (Text) – The new name that is desired for the given subobject
- Returns
True if the rename was successful, false otherwise.
- Return type
- classmethod rename_subobject_member_variable(bp_context, handle, new_name) None ¶
Rename Subobject Member Variable
- Parameters
bp_context (Blueprint) –
handle (SubobjectDataHandle) –
new_name (Name) –
- reparent_subobject(params, to_reparent_handle) bool ¶
Attempts to reparent the given subobject to the new parent
- Parameters
params (ReparentSubobjectParams) –
to_reparent_handle (SubobjectDataHandle) – The handle of the subobject that will get moved
- Returns
True if the reparent was successful, false otherwise.
- Return type
- reparent_subobjects(params, handles_to_move) bool ¶
Attempts to reparent all subobjects in the HandlesToMove array to the new parent handle.
- Parameters
params (ReparentSubobjectParams) –
handles_to_move (Array(SubobjectDataHandle)) –
- Return type