public class Sandbox.ModelRenderer : Sandbox.Renderer
Renders a model in the world
Related Guides
Broader workflow and conceptual references connected to this API.
If you want a specific file/asset type to have a custom Thumbnail/Inspector Preview, you can simply create an AssetPreview. An AssetPreview initializes a SceneWorld and SceneCamera, rendering the Camera to the Preview output, so all you need to do is populate it and/or position the Camera to your liking.
Sometimes you know what you're looking for, but you don't know where it is.
A Component is added to a GameObject to provide functionality. This functionality can vary wildly.
You can define movies and play them back using C#.
You can record gameplay into a MovieClip, which can be played back or imported into Movie Maker for editing. This could be useful for killcams in shooters, leaderboard replays in racing games, or for capturing gameplay to edit into a trailer.
A [scene]() is a collection of [GameObjects].
Constructors
Showing 1 constructors
public ModelRenderer()
No results match this filter.
Methods
Showing 16 methods
public void ClearMaterialOverrides()
Completely stop overriding materials
public virtual void CopyFrom(Sandbox.Renderer other)
Copy everything from another renderer
public virtual Sandbox.GameObject GetBoneObject(Sandbox.BoneCollection.Bone bone)
public virtual sealed Sandbox.Material GetMaterial(int triangle = -1)
Parameters
triangle: Default: -1
protected virtual void OnEnabled()
Implementations
protected virtual void OnRenderOptionsChanged()
public virtual sealed void SetMaterial(Sandbox.Material material, int triangle = -1)
Parameters
triangle: Default: -1
public void SetMaterialOverride(Sandbox.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.
protected virtual void UpdateObject()
No results match this filter.
Properties
Showing 14 properties
public ulong Sandbox.ModelRenderer.BodyGroups { get; set; }
public BBox Sandbox.ModelRenderer.Bounds { get; set; }
public bool Sandbox.ModelRenderer.CreateAttachments { get; set; }
public bool Sandbox.ModelRenderer.HasBodyGroups { get; set; }
public bool Sandbox.ModelRenderer.HasMaterialGroups { get; set; }
public BBox Sandbox.ModelRenderer.LocalBounds { get; set; }
public System.Nullable`1<int> Sandbox.ModelRenderer.LodOverride { get; set; }
Force a level of detail.
public string Sandbox.ModelRenderer.MaterialGroup { get; set; }
public Sandbox.Material Sandbox.ModelRenderer.MaterialOverride { get; set; }
public Sandbox.Engine.MaterialAccessor Sandbox.ModelRenderer.Materials { get; set; }
Access to the materials
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; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.ModelRenderer |