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
keyboard_arrow_down
Properties (34)
keyboard_arrow_down
Methods (93)