ModelRendererclass

Renders a model in the world

object→Renderer→ModelRenderer
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.ModelRenderer : Sandbox.Renderer

Constructors1

Showing 1 constructors

Methods17

Showing 17 methods

public void ClearMaterialOverrides()PUBLIC

Completely stop overriding materials

Returns:void—

public virtual void CopyFrom(Sandbox.Renderer other)PUBLICVIRTUAL

Copy everything from another renderer

ParameterTypeDescription
otherRenderer—
Returns:void—

protected virtual Sandbox.SceneObject CreateSceneObject(Sandbox.Model model)PROTECTEDVIRTUAL

Creates the scene representation needed by this renderer's current deformation state.

ParameterTypeDescription
modelModel—
Returns:SceneObject—

public virtual sealed Sandbox.Material GetMaterial(int triangle = -1)PUBLICVIRTUAL

ParameterTypeDescription
triangle = -1int—
Returns:Material—

protected virtual void OnEnabled()PROTECTEDVIRTUALLIFECYCLE

Returns:void—

protected virtual void OnRenderOptionsChanged()PROTECTEDVIRTUAL

Returns:void—

public virtual sealed void SetMaterial(Sandbox.Material material, int triangle = -1)PUBLICVIRTUAL

ParameterTypeDescription
materialMaterial—
triangle = -1int—
Returns:void—

public void SetMaterialOverride(Sandbox.Material material, string target)PUBLIC

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.

ParameterTypeDescription
materialMaterial—
targetstring—
Returns:void—

protected virtual void UpdateObject()PROTECTEDVIRTUALPER-FRAME

Returns:void—

Properties14

Showing 14 properties

public bool Sandbox.ModelRenderer.CreateAttachments { get; set; }PUBLICGETSET

Returns:bool—

public bool Sandbox.ModelRenderer.HasBodyGroups { get; set; }PUBLICGETSET

Returns:bool—

public bool Sandbox.ModelRenderer.HasMaterialGroups { get; set; }PUBLICGETSET

Returns:bool—

public System.Nullable`1<int> Sandbox.ModelRenderer.LodOverride { get; set; }PUBLICGETSET

Force a level of detail. Unset uses automatic LOD.

Returns:Nullable<int>—

public string Sandbox.ModelRenderer.MaterialGroup { get; set; }PUBLICGETSET

Returns:string—

On this page

Constructorspublic ModelRenderer()Methodspublic System.Void ClearMaterialOverrides()public virtual System.Void CopyFrom(Sandbox.Renderer other)protected virtual Sandbox.SceneObject CreateSceneObject(Sandbox.Model model)public Sandbox.GameObject GetAttachmentObject(Sandbox.ModelAttachments.Attachment attachment)public Sandbox.GameObject GetAttachmentObject(System.String name)public System.Int32 GetBodyGroup(System.Int32 part)public System.Int32 GetBodyGroup(System.String name)public virtual Sandbox.GameObject GetBoneObject(Sandbox.BoneCollection.Bone bone)public virtual sealed Sandbox.Material GetMaterial(System.Int32 triangle = -1)protected virtual System.Void OnEnabled()protected virtual System.Void OnRenderOptionsChanged()public System.Void SetBodyGroup(System.Int32 part, System.Int32 value)public System.Void SetBodyGroup(System.String name, System.Int32 value)public System.Void SetBodyGroup(System.String name, System.String choice)public virtual sealed System.Void SetMaterial(Sandbox.Material material, System.Int32 triangle = -1)public System.Void SetMaterialOverride(Sandbox.Material material, System.String target)protected virtual System.Void UpdateObject()Propertiespublic System.UInt64 Sandbox.ModelRenderer.BodyGroups { get; set; }public BBox Sandbox.ModelRenderer.Bounds { get; set; }public System.Boolean Sandbox.ModelRenderer.CreateAttachments { get; set; }public System.Boolean Sandbox.ModelRenderer.HasBodyGroups { get; set; }public System.Boolean Sandbox.ModelRenderer.HasMaterialGroups { get; set; }public BBox Sandbox.ModelRenderer.LocalBounds { get; set; }public System.Nullable`1<System.Int32> Sandbox.ModelRenderer.LodOverride { get; set; }public System.String Sandbox.ModelRenderer.MaterialGroup { get; set; }public Sandbox.Material Sandbox.ModelRenderer.MaterialOverride { get; set; }public Sandbox.Engine.MaterialAccessor Sandbox.ModelRenderer.Materials { get; set; }public virtual sealed Sandbox.Model Sandbox.ModelRenderer.Model { get; set; }public Sandbox.ModelRenderer.ShadowRenderType Sandbox.ModelRenderer.RenderType { get; set; }public Sandbox.SceneObject Sandbox.ModelRenderer.SceneObject { get; set; }public Color Sandbox.ModelRenderer.Tint { get; set; }Metadata