SceneObjectclass

A model scene object that can be rendered within a `Sandbox.SceneWorld`.

objectSceneObject
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.SceneObject

Constructors4

Showing 4 constructors

Methods9

Showing 9 methods

public void AddChild(string name, Sandbox.SceneObject child)PUBLIC

Add a named child scene object to this one. The child scene object will have its parent set.

Note

The name can be used to look up children by name, but it is not bound. (SceneObject_FindChild)

ParameterTypeDescription
namestring
childSceneObject
Returns:void

public void ClearMaterialOverride()PUBLIC

Clear all material replacements.

Returns:void

public void Delete()PUBLIC

Delete this scene object. You shouldn't access it anymore.

Returns:void

public Sandbox.GameObject GetGameObject()PUBLICOBSOLETE

Obsolete: Use GameObject property

Returns:GameObject

public void RemoveChild(Sandbox.SceneObject child)PUBLIC

Unlink given scene object as a child from this one. The child scene object will have its parent set to null. It will not be deleted.

ParameterTypeDescription
childSceneObject
Returns:void

public void SetComponentSource(Sandbox.Component c)PUBLICOBSOLETE

Obsolete: Use Component property

ParameterTypeDescription
cComponent
Returns:void

public void SetMaterialGroup(string name)PUBLIC

Set material group to replace materials of the model as set up in ModelDoc.

ParameterTypeDescription
namestring
Returns:void

Properties16

Showing 16 properties

public bool Sandbox.SceneObject.Batchable { get; set; }PUBLICGETSET

This object is not batchable by material for some reason ( example: has dynamic attributes that affect rendering )

Returns:bool

public BBox Sandbox.SceneObject.Bounds { get; set; }PUBLICGETSET

Set or get the axis aligned bounding box for this object.

Returns:BBox

public Color Sandbox.SceneObject.ColorTint { get; set; }PUBLICGETSET

Color tint of this scene object.

Returns:Color

public BBox Sandbox.SceneObject.LocalBounds { get; set; }PUBLICGETSET

Set the axis aligned bounding box by transforming by this objects transform.

Returns:BBox

public ulong Sandbox.SceneObject.MeshGroupMask { get; set; }PUBLICGETSET

State of all bodygroups of this object's model. You might be looking for `Sandbox.SceneModel.SetBodyGroup(System.String,System.Int32)`.

Returns:ulong

public Vector3 Sandbox.SceneObject.Position { get; set; }PUBLICGETSET

Position of this scene object, relative to its `Sandbox.SceneObject.Parent`, or `Sandbox.SceneWorld` if parent is not set.

Returns:Vector3

public bool Sandbox.SceneObject.RenderingEnabled { get; set; }PUBLICGETSET

Whether this scene object should render or not.

Returns:bool

public Sandbox.SceneRenderLayer Sandbox.SceneObject.RenderLayer { get; set; }PUBLICGETSET

For a layer to draw this object, the target layer must match (or be unset) and the flags must match

Returns:SceneRenderLayer

public Rotation Sandbox.SceneObject.Rotation { get; set; }PUBLICGETSET

Rotation of this scene object, relative to its `Sandbox.SceneObject.Parent`, or `Sandbox.SceneWorld` if parent is not set.

Returns:Rotation

public Sandbox.ITagSet Sandbox.SceneObject.Tags { get; set; }PUBLICGETSET

List of tags for this scene object.

Returns:ITagSet

public Transform Sandbox.SceneObject.Transform { get; set; }PUBLICGETSET

Transform of this scene object, relative to its `Sandbox.SceneObject.Parent`, or `Sandbox.SceneWorld` if parent is not set.

Returns:Transform

On this page

Constructorspublic SceneObject(Sandbox.SceneWorld sceneWorld, Sandbox.Model model, Transform transform)public SceneObject(Sandbox.SceneWorld sceneWorld, Sandbox.Model model)public SceneObject(Sandbox.SceneWorld sceneWorld, System.String modelName, Transform transform)public SceneObject(Sandbox.SceneWorld sceneWorld, System.String modelName)Methodspublic System.Void AddChild(System.String name, Sandbox.SceneObject child)public System.Void ClearMaterialOverride()public System.Void Delete()public Sandbox.GameObject GetGameObject()public System.Void RemoveChild(Sandbox.SceneObject child)public System.Void SetComponentSource(Sandbox.Component c)public System.Void SetMaterialGroup(System.String name)public System.Void SetMaterialOverride(Sandbox.Material material, System.String attributeName, System.Int32 attributeValue = 1)public System.Void SetMaterialOverride(Sandbox.Material material)Propertiespublic Sandbox.RenderAttributes Sandbox.SceneObject.Attributes { get; set; }public System.Boolean Sandbox.SceneObject.Batchable { get; set; }public BBox Sandbox.SceneObject.Bounds { get; set; }public Color Sandbox.SceneObject.ColorTint { get; set; }public Sandbox.SceneObject.SceneObjectFlagAccessor Sandbox.SceneObject.Flags { get; set; }public BBox Sandbox.SceneObject.LocalBounds { get; set; }public System.UInt64 Sandbox.SceneObject.MeshGroupMask { get; set; }public Sandbox.Model Sandbox.SceneObject.Model { get; set; }public Sandbox.SceneObject Sandbox.SceneObject.Parent { get; set; }public Vector3 Sandbox.SceneObject.Position { get; set; }public System.Boolean Sandbox.SceneObject.RenderingEnabled { get; set; }public Sandbox.SceneRenderLayer Sandbox.SceneObject.RenderLayer { get; set; }public Rotation Sandbox.SceneObject.Rotation { get; set; }public Sandbox.ITagSet Sandbox.SceneObject.Tags { get; set; }public Transform Sandbox.SceneObject.Transform { get; set; }public Sandbox.SceneWorld Sandbox.SceneObject.World { get; set; }Metadata