Api Sandbox ModelRenderer
class

ModelRenderer

public class ModelRenderer : Renderer

Renders a model in the world

Constructors

ModelRenderer()

Properties

Name Type Description
Bounds BBox
LocalBounds BBox
Model virtual Model
Tint Color
CreateAttachments Boolean
BodyGroups UInt64
HasBodyGroups Boolean
MaterialGroup String
HasMaterialGroups Boolean
RenderType ShadowRenderType
LodOverride Int32? Force a level of detail.
SceneObject SceneObject
MaterialOverride Material
Materials MaterialAccessor Access to the materials

Methods

GameObject GetAttachmentObject(String name)

Get the GameObject of a specific attachment.

GameObject GetAttachmentObject(Attachment attachment)

Get the GameObject of a specific attachment.

virtual GameObject GetBoneObject(Bone bone)
Void SetBodyGroup(String name, Int32 value)

Set body group value by name

Void SetBodyGroup(String name, String choice)

Set body group value by name and choice

Void SetBodyGroup(Int32 part, Int32 value)

Set body group value by index

Int32 GetBodyGroup(String name)

Get body group value by name

Int32 GetBodyGroup(Int32 part)

Get body group value by index

virtual Void SetMaterial(Material material, Int32 triangle = -1)
virtual Material GetMaterial(Int32 triangle = -1)
virtual Void CopyFrom(Renderer other)

Copy everything from another renderer

Void ClearMaterialOverrides()

Completely stop overriding materials

Void SetMaterialOverride(Material material, String target)

Set a material override for a material with a specific attribute set. For example, if you have a model with lots of different materials, but one of them has an attribute "skin" set to "1", then calling this with a material and "skin" will override only that material.

Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.ModelRenderer