/
/
RenderContent

RenderContent class

Base class for all RenderContent - RenderMaterial, RenderTexture and RenderEnvironment Contents have a unique type id which is the same for all instances of the same class and an instance id which is unique for each instance.They know how to provide a shader for rendering, how to read and write their state as XML and how to create their own user interfaces. There are two flavors of content in the RDK -- temporary and persistent.It is very important to understand the distinction between a temporary content instance and a persistent content instance, and the fact that a temporary instance (and all its children) can become persistent.Persistent content is registered with a document and is usually(but not always) owned by it. Temporary contents get created and deleted very often during the normal operation of the RDK.In fact, just about anything the user clicks on might result in a temporary content being created and deleted again.They are created by the content browser, the thumbnail rendering, and so on.They are 'free floating' and are owned by whomever created them.They do not appear in the modeless UI, they do not get saved in the 3dm file, and they can freely be deleted again after use. Contrast this with persistent contents which are attached to a document.They are always owned by RDK, appear in the modeless UI and get saved in the 3dm file. Pointers to persistent contents should never be stored by clients; you should only store their instance ids and look them up again using RenderContent.FromId. They can be deleted only after detaching them from the document. RenderContent::Create is the highest-level function for creating a content.It creates it, initializes it, adds it to the document and sends many events.It even records undo.You cannot call this method from just anywhere. It must only be called by 'UI code'; scripts or buttons on a dialog.It results in a persistent (usually top-level) content being attached to the document and appearing in all the RDK UI elements that display contents, like the thumbnail and tree views.If you call this method and specify a parent and child-slot name, your new content will be attached to the document-resident parent as a child and the UI will be updated accordingly. The important point is that everything is temporary while the content structure is being built. Only after the whole structure is complete will the top-level parent be attached to the document making the whole structure persistent.

Derived Classes: RenderEnvironmentRenderMaterialRenderTexture

Namespace: Rhino.Render
RenderContent: references

Hidden

 
Gets or sets the render content's 'hidden' state. This feature only works for top-level render contents because it hides the entire hierarchy. It is normally used for 'implementation detail' render contents. For expert use only. Hidden render contents are never shown in the UI, with the exception of the Object (or Layer) Material Properties UI which always shows whatever is assigned to the object (or layer). In the Object (or Layer) Material Properties UI, if the user drops down the list, hidden render contents are not listed. Hidden render contents, being part of the document content list, will be listed by any scripts or other code that iterates over the document render content list. It is recommended that you set IsHidden once when you create your render content and leave it on to prevent flicker or slow performance.

BeginCreateDynamicFields(bool automatic)

 
Automatic Dynamic Field support. Dynamic fields are typically created in the constructor of RenderContent and they are therefore created automatically whenever the content is created. However, some advanced users require the fields to be created in response to some user action which occurs much later. This creates the problem that the fields do not exist by default and therefore cannot be loaded when the document is loaded. These methods are provided to solve that problem by making it possible to automatically create the dynamic fields on loading if they don't already exist. Dynamic fields that have this auto-create-on-load behavior are referred to as automatic dynamic fields. Dynamic fields that do not require the advanced automatic feature can still be created by using these methods (recommended), or they can be created manually (legacy usage). You must call this before creating any dynamic fields. Calls to this method are counted; you must call EndCreateDynamicFields() once for every call to BeginCreateDynamicFields().

Nothing found