Loading...
Searching...
No Matches
SCR_SocketSpawnerPlugin Interface Reference

Socket Spawner - GUID-based Workbench plugin Processes selected prefab (.et) assets from the Resource Browser. More...

Inheritance diagram for SCR_SocketSpawnerPlugin:
SCR_SocketSpawnerPluginWE

Public Member Functions

override void Configure ()
 Display configuration dialog with plugin settings and usage instructions.
 
override void Run ()
 Main execution method - processes selected prefabs and spawns entities at socket bones.
 

Protected Member Functions

void Execute ()
 Execute button handler - triggers the plugin execution.
 
bool Close ()
 Close button handler - closes the configuration dialog.
 
void GetSelectedResources (out array< ResourceName > selectedResources)
 Get selected resources from Resource Browser Can be overridden by inherited classes to use different selection methods.
 
bool ProcessSelectedPrefabs (out array< ResourceName > outPrefabs)
 Collect selected resources from Resource Browser and filter to .et prefabs.
 
bool ProcessSinglePrefab (ResourceName prefabResource, WorldEditor worldEditor, bool clearExistingChildren)
 Process a single prefab: create temp entity, optionally clear children, scan bones, spawn children.
 
bool RefreshBoneMatrixMap (notnull IEntitySource entitySource, notnull out map< string, ref array< vector > > boneMatrixMap, WorldEditorAPI api)
 Build a map of bone names to their transformation matrices from entity animation data Based on RefreshBoneMatrixMap pattern used in SCR_PrefabSocketProcessorPlugin.c.
 
bool ExtractGuidFromBoneName (string boneName, out string guid16, out string suffix)
 Extract GUID16 from bone name pattern: "socket_<GUID16>_<suffix>" (case-insensitive)
 
bool CreateEntityAtBone (string boneName, string guid16, vector position, array< vector > boneMatrix, WorldEditor worldEditor, IEntitySource parentEntitySource)
 Create a child entity at a bone location using GUID-based ResourceName "{GUID16}".
 
void ShowResults ()
 Display results summary in console and dialog box.
 

Protected Attributes

bool m_bClearChildren
 
bool m_bVerboseOutput
 
int m_iProcessedPrefabs
 
int m_iCreatedEntities
 
int m_iTotalSockets
 
ref array< string > m_aErrors
 

Detailed Description

Socket Spawner - GUID-based Workbench plugin Processes selected prefab (.et) assets from the Resource Browser.

Scans bones named like "socket_<GUID16>_<suffix>" and spawns children using ResourceName "{GUID}".

Member Function Documentation

◆ Close()

bool SCR_SocketSpawnerPlugin.Close ( )
protected

Close button handler - closes the configuration dialog.

◆ Configure()

override void SCR_SocketSpawnerPlugin.Configure ( )

Display configuration dialog with plugin settings and usage instructions.

◆ CreateEntityAtBone()

bool SCR_SocketSpawnerPlugin.CreateEntityAtBone ( string boneName,
string guid16,
vector position,
array< vector > boneMatrix,
WorldEditor worldEditor,
IEntitySource parentEntitySource )
protected

Create a child entity at a bone location using GUID-based ResourceName "{GUID16}".

Parameters
boneNameName of the socket bone (for logging)
guid1616-character GUID hex string to construct resource name
positionWorld position for the new entity
boneMatrix4x4 transformation matrix from bone (used for rotation)
worldEditorWorldEditor module instance
parentEntitySourceParent entity source to attach the new entity to
Returns
True if entity created successfully, false on error

◆ Execute()

void SCR_SocketSpawnerPlugin.Execute ( )
protected

Execute button handler - triggers the plugin execution.

◆ ExtractGuidFromBoneName()

bool SCR_SocketSpawnerPlugin.ExtractGuidFromBoneName ( string boneName,
out string guid16,
out string suffix )
protected

Extract GUID16 from bone name pattern: "socket_<GUID16>_<suffix>" (case-insensitive)

Parameters
boneNameThe bone name to parse
guid16Output: extracted GUID as uppercase hex string (16 characters)
suffixOutput: optional suffix after the GUID (text after second underscore)
Returns
True if valid GUID16 pattern found, false otherwise

◆ GetSelectedResources()

void SCR_SocketSpawnerPlugin.GetSelectedResources ( out array< ResourceName > selectedResources)
protected

Get selected resources from Resource Browser Can be overridden by inherited classes to use different selection methods.

Parameters
selectedResourcesOutput array to receive selected resource names

Implemented in SCR_SocketSpawnerPluginWE.

◆ ProcessSelectedPrefabs()

bool SCR_SocketSpawnerPlugin.ProcessSelectedPrefabs ( out array< ResourceName > outPrefabs)
protected

Collect selected resources from Resource Browser and filter to .et prefabs.

Parameters
outPrefabsOutput array to receive filtered prefab resource names
Returns
True if at least one prefab is found, false otherwise

◆ ProcessSinglePrefab()

bool SCR_SocketSpawnerPlugin.ProcessSinglePrefab ( ResourceName prefabResource,
WorldEditor worldEditor,
bool clearExistingChildren )
protected

Process a single prefab: create temp entity, optionally clear children, scan bones, spawn children.

Parameters
prefabResourceThe prefab resource to process
worldEditorWorldEditor module instance
clearExistingChildrenIf true, removes existing prefab children before spawning new ones
Returns
True if processing succeeded, false on error

◆ RefreshBoneMatrixMap()

bool SCR_SocketSpawnerPlugin.RefreshBoneMatrixMap ( notnull IEntitySource entitySource,
notnull out map< string, ref array< vector > > boneMatrixMap,
WorldEditorAPI api )
protected

Build a map of bone names to their transformation matrices from entity animation data Based on RefreshBoneMatrixMap pattern used in SCR_PrefabSocketProcessorPlugin.c.

Parameters
entitySourceThe entity source to extract bone data from
boneMatrixMapOutput map of bone names to 4x4 transformation matrices (as array of 4 vectors)
apiWorldEditorAPI instance for entity operations
Returns
True if at least one bone was found, false otherwise

◆ Run()

override void SCR_SocketSpawnerPlugin.Run ( )

Main execution method - processes selected prefabs and spawns entities at socket bones.

◆ ShowResults()

void SCR_SocketSpawnerPlugin.ShowResults ( )
protected

Display results summary in console and dialog box.

Member Data Documentation

◆ m_aErrors

ref array<string> SCR_SocketSpawnerPlugin.m_aErrors
protected

◆ m_bClearChildren

bool SCR_SocketSpawnerPlugin.m_bClearChildren
protected

◆ m_bVerboseOutput

bool SCR_SocketSpawnerPlugin.m_bVerboseOutput
protected

◆ m_iCreatedEntities

int SCR_SocketSpawnerPlugin.m_iCreatedEntities
protected

◆ m_iProcessedPrefabs

int SCR_SocketSpawnerPlugin.m_iProcessedPrefabs
protected

◆ m_iTotalSockets

int SCR_SocketSpawnerPlugin.m_iTotalSockets
protected

The documentation for this interface was generated from the following file: