s&box docs

public class Sandbox.SceneObject

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

Broader workflow and conceptual references connected to this API.

Constructors

Showing 4 constructors

Methods

Showing 9 methods

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

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)

public void ClearMaterialOverride()

Clear all material replacements.

public void Delete()

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

public Sandbox.GameObject GetGameObject()Obsolete

Obsolete: Use GameObject property

public void RemoveChild(Sandbox.SceneObject child)

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.

public void SetComponentSource(Sandbox.Component c)Obsolete

Obsolete: Use Component property

public void SetMaterialGroup(string name)

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

Properties

Showing 16 properties

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

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

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

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

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

Color tint of this scene object.

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

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

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

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

public Sandbox.SceneObject Sandbox.SceneObject.Parent { get; set; }

Movement parent of this scene object, if any.

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

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

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

Whether this scene object should render or not.

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

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

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

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

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

List of tags for this scene object.

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

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

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.SceneObject

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