editor.physicsasset

Physics Asset body and constraint editing

← API Reference

editor.physicsasset.getInfo

Returns basic information about a physics asset.

Parameters:

Name Type Required Description
asset_pathstringYesPhysicsAsset path

Returns:

Name Type Description
num_bodiesnumberNumber of physics bodies
num_constraintsnumberNumber of constraints
skeletal_mesh_pathstringAssociated skeletal mesh path

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.physicsasset.getInfo", "params": { "asset_path": "/Game/Characters/Hero_PhysicsAsset" } }

editor.physicsasset.getBodies

Returns all physics bodies in a physics asset.

Parameters:

Name Type Required Description
asset_pathstringYesPhysicsAsset path

Returns:

Name Type Description
bodiesarrayEach: {body_name, bone_name, collision_type, mass, num_shapes}

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.physicsasset.getBodies", "params": { "asset_path": "/Game/Characters/Hero_PhysicsAsset" } }

editor.physicsasset.getConstraints

Returns all constraints in a physics asset.

Parameters:

Name Type Required Description
asset_pathstringYesPhysicsAsset path

Returns:

Name Type Description
constraintsarrayEach: {constraint_name, parent_bone, child_bone, constraint_type, is_enabled}

Example Request:

{ "jsonrpc": "2.0", "id": 1, "method": "editor.physicsasset.getConstraints", "params": { "asset_path": "/Game/Characters/Hero_PhysicsAsset" } }

editor.physicsasset.setBodyProperty

Sets a property on a physics body.

Parameters:

Name Type Required Description
asset_pathstringYesPhysicsAsset path
body_namestringYesBody name
propertystringYes"mass" (number), "collision_enabled" (bool), or "physics_type" (string: "Default", "Kinematic", "Simulated")
valuevariesYesProperty value

Returns:

Name Type Description
successboolWhether property was set

Example Request:

{
  "jsonrpc": "2.0", "id": 1, "method": "editor.physicsasset.setBodyProperty",
  "params": { "asset_path": "/Game/Characters/Hero_PhysicsAsset", "body_name": "spine_01", "property": "mass", "value": 10.0 }
}

editor.physicsasset.setConstraintProperty

Sets a property on a physics constraint.

Parameters:

Name Type Required Description
asset_pathstringYesPhysicsAsset path
constraint_namestringYesConstraint name
propertystringYes"disable_collision" (bool), "parent_dominates" (bool), "enable_projection" (bool), "swing1_limit" (number), "swing2_limit" (number), "twist_limit" (number)
valuevariesYesProperty value

Returns:

Name Type Description
successboolWhether property was set

Example Request:

{
  "jsonrpc": "2.0", "id": 1, "method": "editor.physicsasset.setConstraintProperty",
  "params": { "asset_path": "/Game/Characters/Hero_PhysicsAsset", "constraint_name": "spine_01_spine_02", "property": "swing1_limit", "value": 30.0 }
}

editor.physicsasset.setAllBodiesSimulatePhysics

Sets physics simulation mode for all bodies in a physics asset.

Parameters:

Name Type Required Description
asset_pathstringYesPhysicsAsset path
simulateboolYesWhether to enable physics simulation

Returns:

Name Type Description
successboolWhether operation succeeded
bodies_updatednumberNumber of bodies updated

Example Request:

{
  "jsonrpc": "2.0", "id": 1, "method": "editor.physicsasset.setAllBodiesSimulatePhysics",
  "params": { "asset_path": "/Game/Characters/Hero_PhysicsAsset", "simulate": true }
}