RenderContent
ReferencesBase 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.
Finalizer
Properties
Returns the localized display name of the child slot name
public nint CppPointer { get; }
obsoleteUse DocumentOwner
Obsolete. Do not use. You should use DocumentOwner instead.
If this render content is associated with a document in any way, the document will be returned. This includes copies of render contents that were attached to a document when the copy was made. Otherwise returns null.
If this render content is owned by a document, the document will be returned. This is the same as getting the document the render content is attached to. Otherwise returns null.
obsoleteUse DocumentOwner
Obsolete. Do not use. You should use DocumentOwner instead.
Rhino.Render.Fields FieldDictionary which provides access to setting and retrieving field values.
If the content is file based, this function can be overridden to deal with setting/getting the filename. Corresponds to IRhRdkFileBasedContent in the C++ SDK
A string array of full paths to files used by the content that may be embedded in .3dm files and library files (.rmtl, .renv, .rtex). The default implementation returns an empty string list. Override this to return the file name or file names used by your content. This is typically used by textures that reference files containing the texture imagery.
Return First child of this content or null if none.
Checks if render content is default instance.
Set this property to true prior to adding content to the document to lock the content browser editing UI methods. Setting this to true will keep the browser from allowing things like deleting, renaming or changing content. This is useful for custom child content that you want to be editable but persistent. Setting this after adding content to the document will cause an exception to be thrown.
Exceptions:
| Exception | IsLocked must be called prior to adding content to the document |
Units used by this instance on length fields.
Return First sibling of this content or null if none.
Returns the top content in this parent/child chain.
The Content type should not be shown in the UI if Private is true
Render hash for the content hierarchy. It iterates over children and includes a caching mechanism which means the hash value can be retrieved quickly if it hasn't changed. The cache is invalidated when Changed() is called. You can override the CalculateRenderHash(ulong) method to provide a custom hash value.
Returns true if this content has no parent, false if it is the child of another content.
Returns the top content in this parent/child chain.
Description for your content type. i.e., "Procedural checker pattern"
Name for your content type. i.e., "My .net Texture"
Methods
Add a new automatic user interface section, Field values which include prompts will be automatically added to this section.
obsoleteThis method is obsolete and simply calls SetChild
Parameters:
| renderContent (RenderContent) | |
| childSlotName (string) |
obsoleteThis method is obsolete and simply calls SetChild
Parameters:
| renderContent (RenderContent) |
obsoleteUse RhinoDoc.RenderMaterials.Add
Add a material, environment or texture to the internal RDK document lists as top level content. The content must have been returned from RenderContent::MakeCopy, NewContentFromType or a similar function that returns a non-document content. Obsolete - use RhinoDoc.RenderMaterials.Add or similar.
Parameters:
| renderContent (RenderContent) | The render content. |
Returns: true on success.
obsoleteUse RhinoDoc.RenderMaterials.Add
Add a material, environment or texture to the internal RDK document lists as top level content. The content must have been returned from RenderContent::MakeCopy, NewContentFromType or a similar function that returns a non-document content. Obsolete - use RhinoDoc.RenderMaterials.Add or similar.
Parameters:
| document (RhinoDoc) | The document to attach the render content to. |
| renderContent (RenderContent) | The render content. |
Returns: true on success.
Parameters:
| section (ICollapsibleSection) |
public UserInterfaceSection AddUserInterfaceSection(Type classType, string caption, bool createExpanded, bool createVisible)
obsoleteUse AddUserInterfaceSection(Rhino.UI.Controls.ICollapsibleSection) below instead. This function will not work on the Mac and is not type-safe.
Add a new .NET control to an content expandable tab section, the height of the createExpanded tabs client area will be the initial height of the specified control.
Parameters:
| classType (Type) | The control class to create and embed as a child window in the expandable tab client area. This class type must be derived from IWin32Window or this method will throw an ArgumentException. Implement the IUserInterfaceSection interface in your classType to get UserInterfaceSection notification. |
| caption (string) | Expandable tab caption. |
| createExpanded (bool) | If this value is true then the new expandable tab section will initially be expanded, if it is false it will be collapsed. |
| createVisible (bool) | If this value is true then the new expandable tab section will initially be visible, if it is false it will be hidden. |
Returns: Returns the UserInterfaceSection object used to manage the new user control object.
Begins a change or batch of changes. It may also make a copy of the content state allowing EndChange() to send an event with the old and new contents. Calls to this method are counted; you must call EndChange() once for every call to BeginChange(). Note: If Changed() was called between the calls to BeginChange() and EndChange(), the last call to EndChange() may cause the ContentChanged event to be sent.
Parameters:
| changeContext (RenderContent.ChangeContexts) | the change context. If this is ChangeContexts.UI, ChangeContexts.Program,ChangeContexts.Drop or ChangeContexts.Tree, the content will be copied. EndChange() will then send the copy as 'old' in the OnContentChanged event. EndChange() ContentChanged |
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().
Parameters:
| automatic (bool) | automatic specifies if the dynamic fields are automatic. If so, they will be created automatically during loading of the document. |
Use bindings to automatically wire parameters to fields
Parameters:
| parameterName (string) | |
| field (Field) | |
| setEvent (RenderContent.ChangeContexts) |
public void BindParameterToField(string parameterName, string childSlotName, Field field, ChangeContexts setEvent)
Use bindings to automatically wire parameters to fields
Parameters:
| parameterName (string) | |
| childSlotName (string) | |
| field (Field) | |
| setEvent (RenderContent.ChangeContexts) |
CalculateRenderHash
#obsoleteUse CalculateRenderHash2
Override this method to calculate the render hash of the state that affects how the content is rendered. Does not include children or perform any caching. Render hash values are now automatically cached by the content framework and you do not have to worry about caching. You also do not have to worry about iterating into children. This method is now only called internally by the framework, use the RenderHash property to get the current hash value.
Parameters:
| rcrcFlags (ulong) |
CalculateRenderHash2
#[CLSCompliant(false)]
protected virtual uint CalculateRenderHash2(CrcRenderHashFlags flags, string[] excludeParameterNames)
Parameters:
| flags (CrcRenderHashFlags) | |
| excludeParameterNames (string[]) |
obsoleteThis method is obsolete and simply calls SetChild
Parameters:
| oldContent (RenderContent) | |
| newContent (RenderContent) |
Gets the amount property for the texture in the specified child slot.
Parameters:
| childSlotName (string) | The child slot name of the texture. |
Returns: The requested amount value. Values are typically from 0.0 to 100.0
A "child slot" is the specific "slot" that a child (usually a texture) occupies. This is generally the "use" of the child - in other words, the thing the child operates on. Some examples are "color", "transparency".
Parameters:
| paramName (string) | The name of a parameter field. Since child textures will usually correspond with some parameter (they generally either replace or modify a parameter over UV space) these functions are used to specify which parameter corresponded with child slot. If there is no correspondence, return the empty string. |
Returns: The default behavior for these functions is to return the input string. Sub-classes may (in the future) override these functions to provide different mappings.
Gets the on-ness property for the texture in the specified child slot.
Parameters:
| childSlotName (string) | The child slot name of the texture. |
Returns: true if successful, else false.
Modify your content so that it is converted from meters into the units of the unit system. No need to call the base class when you override this, and no need to recurse into children.
Parameters:
| from (LengthUnit) | |
| to (LengthUnit) |
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual void ConvertUnits(UnitSystem from, UnitSystem to)
obsolete. Use ConvertUnits with LengthUnit instead, and don't override this virtual function
Modify your content so that it is converted from meters into the units of the unit system. No need to call the base class when you override this, and no need to recurse into children.
Parameters:
| from (UnitSystem) | |
| to (UnitSystem) |
public static RenderContent Create(Guid type, RenderContent parent, string childSlotName, ShowContentChooserFlags flags, RhinoDoc doc)
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
Parameters:
| type (Guid) | The type of the content to create. |
| parent (RenderContent) | Parent is the parent content. If not null, this must be an RDK-owned content that is attached to the document (either top-level or child). The new content then becomes its child. If null, the new content is added to the top-level document content list instead. |
| childSlotName (string) | ChildSlotName is the unique child identifier to use for the new content when creating it as a child of parent (i.e., when parent is not null) |
| flags (RenderContent.ShowContentChooserFlags) | Flags for future use (please always pass ShowContentChooserFlags::None). |
| doc (RhinoDoc) | The Rhino document to attach the new render content to. |
Returns: A new document-resident render content.
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
Parameters:
| type (Guid) | The type of the content to create. |
| flags (RenderContent.ShowContentChooserFlags) | Flags for future use (please always pass ShowContentChooserFlags::None). |
| doc (RhinoDoc) | The Rhino document to attach the new render content to. |
Returns: A new document-resident render content.
public static RenderContent Create(RhinoDoc doc, Guid type, RenderContent parent, string childSlotName)
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
Parameters:
| doc (RhinoDoc) | The Rhino document to attach the new render content to. |
| type (Guid) | The type of the content to create. |
| parent (RenderContent) | Parent is the parent content. If not null, this must be an RDK-owned content that is attached to the document (either top-level or child). The new content then becomes its child. If null, the new content is added to the top-level document content list instead. |
| childSlotName (string) | ChildSlotName is the unique child identifier to use for the new content when creating it as a child of parent (i.e., when parent is not null) |
Returns: A new document-resident render content.
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
public static RenderContent Create(RhinoDoc doc, Type type, RenderContent parent, string childSlotName)
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
Parameters:
| doc (RhinoDoc) | The Rhino document to attach the new render content to. |
| type (Type) | The type of the content to create. |
| parent (RenderContent) | The parent content. If not null, this must be an RDK-owned content that is attached to the document (either top-level or child). The new content then becomes its child. If null, the new content is added to the top-level document content list instead. |
| childSlotName (string) | ChildSlotName is the unique child identifier to use for the new content when creating it as a child of parent (i.e., when parent is not null) |
Returns: A new document-resident render content.
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
public static RenderContent Create(Type type, RenderContent parent, string childSlotName, ShowContentChooserFlags flags, RhinoDoc doc)
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
Parameters:
| type (Type) | The type of the content to create. |
| parent (RenderContent) | The parent content. If not null, this must be an RDK-owned content that is attached to the document (either top-level or child). The new content then becomes its child. If null, the new content is added to the top-level document content list instead. |
| childSlotName (string) | ChildSlotName is the unique child identifier to use for the new content when creating it as a child of parent (i.e., when parent is not null) |
| flags (RenderContent.ShowContentChooserFlags) | Flags for future use (please always pass ShowContentChooserFlags::None). |
| doc (RhinoDoc) | The Rhino document to attach the new render content to. |
Returns: A new document-resident render content.
Constructs a new content of the specified type and attaches it to a document. This function cannot be used to create temporary content that you delete after use. Content created by this function is owned by RDK and appears in the content editor. To create a temporary content which is owned by you, call RenderContentType.NewContentFromTypeId().
Parameters:
| type (Type) | The type of the content to create. |
| flags (RenderContent.ShowContentChooserFlags) | Flags for future use (please always pass ShowContentChooserFlags::None). |
| doc (RhinoDoc) | The Rhino document to attach the new render content to. |
Returns: A new document-resident render content.
public bool CreateDynamicField(string internalName, string localName, string englishName, object value, object minValue, object maxValue, int sectionId)
Create a dynamic field with an initial value and min and max limits.
Parameters:
| internalName (string) | is the internal name of the field. Not localized. |
| localName (string) | is the localized user-friendly name of the field. |
| englishName (string) | is the English user-friendly name of the field. |
| value (object) | is the initial value of the field. |
| minValue (object) | is the minimum value of the field. Must be the same type as vValue. |
| maxValue (object) | is the maximum value of the field. Must be the same type as vValue. |
| sectionId (int) | is used for filtering fields between sections. Zero if not needed. |
Parameters:
| changeContexts (RenderContent.ChangeContexts) |
Parameters:
| childSlotName (string) | |
| changeContexts (RenderContent.ChangeContexts) |
public void Dispose()
Parameters:
| size (Size) | |
| bitmap (out Bitmap) | |
| usage (DynamicIconUsage) |
This method allows a render content hierarchy to be edited using a modal (AKA 'pop-up') editor. If the original render content is in a document, it will remain there, and the edited one will be 'free-floating'. Therefore it is the caller's responsibility to do any replacement in the document if required. The returned new content will be owned by the caller.
Returns: Returns an edited version of the content hierarchy if successful, else null. The method always edits the entire hierarchy. It places a copy of the hierarchy in the editor and selects the copied item that corresponds to this one. Therefore, editing a child will return a top-level render content, not a child.
public void EndChange()
Ends a change or batch of changes. Calls to this method are counted; you must call this method once for every call to BeginChange(RenderContent.ChangeContexts). Note: If BeginChange(RenderContent.ChangeContexts) was called with ChangeContexts.UI, ChangeContexts.Program, ChangeContexts.Drop or ChangeContexts.UI.Tree and Changed() was called between the calls to BeginChange(RenderContent.ChangeContexts) and EndChange(), the last call to EndChange() will raise the ContentChanged event.
public void EndCreateDynamicFields()
You must call this after creating dynamic fields. Calls to this method are counted; you must call BeginCreateDynamicFields() once for every call to EndCreateDynamicFields().
Parameters:
| childSlotName (string) |
**** This method is for proxies and will be marked obsolete in the future **** The only place a single proxy can be displayed is in the New Content Control main thumbnail. All other attempts to use a single proxy in a UI require it to be replaced with the corresponding multi proxy. Single proxies override this to find the corresponding multi proxy.
Returns: The render content.
Search for a content object based on its Id
Creates a new content from the XML data. The resulting content will not be attached to the document.
obsoleteUse other FromXml method
Parameters:
| xml (string) |
public static Bitmap GenerateQuickContentPreview(LinearWorkflow lw, RenderContent c, int width, int height, PreviewSceneServer psc, bool bSuppressLocalMapping, int reason, ref Result result)
Generate a quick render content preview
Parameters:
| lw (LinearWorkflow) | Linear workflow |
| c (RenderContent) | Render Content |
| width (int) | Image width |
| height (int) | Image height |
| psc (PreviewSceneServer) | PreviewSceneServer |
| bSuppressLocalMapping (bool) | SuppressLocalMapping |
| reason (int) | ContentChanged = 0, ViewChanged = 1, RefreshDisplay = 2, Other = 99 |
| result (ref Result) | Rhino.Command.Result value for successfull quick image creation |
Returns: The Bitmap of the quick render content preview
public static Bitmap GenerateQuickContentPreview(RenderContent c, int width, int height, PreviewSceneServer psc, bool bSuppressLocalMapping, int reason, ref Result result)
Generate a quick render content preview
Parameters:
| c (RenderContent) | Render Content |
| width (int) | Image width |
| height (int) | Image height |
| psc (PreviewSceneServer) | PreviewSceneServer |
| bSuppressLocalMapping (bool) | SuppressLocalMapping |
| reason (int) | ContentChanged = 0, ViewChanged = 1, RefreshDisplay = 2, Other = 99 |
| result (ref Result) | Rhino.Command.Result value for successfull quick image creation |
Returns: The Bitmap of the quick render content preview
public static Bitmap GenerateRenderContentPreview(LinearWorkflow lwf, RenderContent c, int width, int height, bool bSuppressLocalMapping, PreviewJobSignature pjs, PreviewAppearance pa, ref PreviewRenderResult result)
Generate a render content preview
Parameters:
| lwf (LinearWorkflow) | Linear Workflow |
| c (RenderContent) | Render Content |
| width (int) | Image width |
| height (int) | Image height |
| bSuppressLocalMapping (bool) | Suppress Local Mapping |
| pjs (PreviewJobSignature) | Preivew Job Signature |
| pa (PreviewAppearance) | Preivew Appearance |
| result (ref Utilities.PreviewRenderResult) | Reference to PreviewRenderResult value |
Returns: The Bitmap of the render content preview
public virtual object GetChildSlotParameter(string contentParameterName, string extraRequirementParameter)
Extra requirements are a way of specifying extra functionality on parameters in the automatic UI. Override this function to specify additional functionality for automatic UI sections or the texture summary. See IAutoUIExtraRequirements.h in the C++ RDK SDK for string definitions for the parameter names. Call the base class from your override if you do not support the extra requirement parameter. Please do not call this function. It is only retained for backward compatibility. You should instead call GetExtraRequirementParameter().
Parameters:
| contentParameterName (string) | The parameter or field internal name to which this query applies. |
| extraRequirementParameter (string) | The extra requirement parameter, as listed in IAutoUIExtraRequirements.h in the C++ RDK SDK. |
Returns: The value of the requested extra requirement parameter or null if the parameter does not exist. Current supported return values are (int, bool, float, double, string, Guid, Color, Vector3d, Point3d, DateTime).
public object GetExtraRequirementParameter(string contentParameterName, string extraRequirementParameter)
Extra requirements are a way of specifying extra functionality on parameters in the automatic UI. See IAutoUIExtraRequirements.h in the C++ RDK SDK for string definitions for the parameter names.
Parameters:
| contentParameterName (string) | The parameter or field internal name to which this query applies. |
| extraRequirementParameter (string) | The extra requirement parameter, as listed in IAutoUIExtraRequirements.h in the C++ RDK SDK. |
Returns: The value of the requested extra requirement parameter or null if the parameter does not exist. Current supported return values are (int, bool, float, double, string, Guid, Color, Vector3d, Point3d, DateTime).
Query the content instance for the value of a given named parameter. If you do not support this parameter, call the base class.
Parameters:
| parameterName (string) | Name of the parameter |
Returns: IConvertible. Note that you can't directly cast from object, instead you have to use the Convert mechanism.
This allows a content to have more than one UI for the same content type.
Returns: Default is zero and is ignored.
Parameters:
| collection (RenderContentCollection) |
obsoleteThis method should not be called.
Parameters:
| renderEngineId (Guid) |
Parameters:
| factory (ContentFactory) | |
| childSlotName (string) |
public virtual bool IsFactoryProductAcceptableAsChild(Guid kindId, string factoryKind, string childSlotName)
Override this method to restrict the type of acceptable child content. The default implementation of this method returns true if the factory kind is 'texture'.
Query whether or not the content or any of its ancestors is a reference content.
Returns: true if the content is a reference, else false
obsoleteThis method is deprecated and no longer called. For more information see CalculateRenderHash
This method is deprecated and no longer called. For more information see CalculateRenderHash(ulong)
Returns: bool
Loads content from a library file. Does not add the content to the document. Use RhinoDoc.RenderMaterials.Add or similar.
Parameters:
| filename (string) | full path to the file to be loaded. |
Returns: The loaded content or null if an error occurred.
Create a copy of the render content. All content is the same, except for the instance Id.
Returns: The new RenderContent
Create an 'instance' of the content hierarchy and group the new hierarchy with this hierarchy. If the instance is subsequently attached to the same document, the state of all members of the group will be kept synchronized. With the exception of the instance ids, all state is exactly preserved in the new instance hierarchy. \note The grouping will have no effect until the new instance is attached to the same document.
Returns: A grouped instance of the content hierarchy.
Implement to transfer data from another content to this content during creation.
Parameters:
| oldContent (RenderContent) | An old content object from which the implementation may harvest data. |
Returns: Information about how much data was matched.
ModifyRenderContentStyles
#protected void ModifyRenderContentStyles(RenderContentStyles stylesToAdd, RenderContentStyles stylesToRemove)
ModifyRenderContentStyles
Parameters:
| stylesToAdd (RenderContentStyles) | |
| stylesToRemove (RenderContentStyles) |
Gets the PreviewSceneServer of the content
Parameters:
| ssd (SceneServerData) | SceneServerData |
OnAddUserInterfaceSections
#protected virtual void OnAddUserInterfaceSections()
Override to provide UI sections to display in the editor.
OnGetDefaultsInteractive
#Override this method to prompt user for information necessary to create a new content object. For example, if you are created a textured material you may prompt the user for a bitmap file name prior to creating the textured material.
Returns: If true is returned the content is created otherwise the creation is aborted.
OnMakeCopy
#Override this function to supplement the standard copying behavour for your RenderContent.
Parameters:
| newContent (ref RenderContent) | Is the content that will be returned from MakeCopy. |
Call this method to open the content in the relevant thumbnail editor and select it for editing by the user. The content must be in the document or the call will fail.
Returns: Returns true on success or false on error.
obsoleteObsolete, use Edit a version that returns a RenderContent
Call this method to open the content in the a modal version of the editor. The content must be in the document or the call will fail.
Returns: Returns true on success or false on error.
A "child slot" is the specific "slot" that a child (usually a texture) occupies. This is generally the "use" of the child - in other words, the thing the child operates on. Some examples are "color", "transparency".
Parameters:
| childSlotName (string) | The named of the child slot to receive the parameter name for. |
Returns: The default behavior for these functions is to return the input string. Sub-classes may (in the future) override these functions to provide different mappings.
Call RegisterContent in your plug-in's OnLoad function in order to register all of the custom RenderContent classes in your assembly.
Call RegisterContent in your plug-in's OnLoad function in order to register all of the custom RenderContent classes in your assembly.
Parameters:
| plugin (PlugIn) |
Returns: array of render content types registered on success. null on error.
[CLSCompliant(false)]
public uint RenderHashExclude(CrcRenderHashFlags flags, string excludeParameterNames, LinearWorkflow lw)
As RenderHash, but allows you to specify flags and exclude specific parameters. Use this version of the function to calculate a render hash when you have the linear workflow information and you are not running on the main thread. Access to LinearWorkflow data requires document access. CrcRenderHashFlags.ExcludeLinearWorkflow must be specified.
Parameters:
| flags (CrcRenderHashFlags) | Flags to finely control the render hash. |
| excludeParameterNames (string) | Semicolon-delimited string of parameter names to exclude. |
| lw (LinearWorkflow) | Linear Workflow to use. |
Returns: The render hash.
[CLSCompliant(false)]
public uint RenderHashExclude(CrcRenderHashFlags flags, string excludeParameterNames)
As RenderHash, but allows you to specify flags and exclude specific parameters.
Parameters:
| flags (CrcRenderHashFlags) | Flags to finely control the render hash. |
| excludeParameterNames (string) | Semicolon-delimited string of parameter names to exclude. |
Returns: The render hash.
[CLSCompliant(false)]
public uint RenderHashExclude(TextureRenderHashFlags flags, string excludeParameterNames)
This method is deprecated in favor of the one that takes CrcRenderHashFlags.
Parameters:
| flags (TextureRenderHashFlags) | |
| excludeParameterNames (string) |
Parameters:
| newcontent (RenderContent) |
Saves content to a file - RMTL, RENV or RTEX.
Parameters:
| filename (string) | Full path to the file to be saved. |
| embedFilesChoice (RenderContent.EmbedFilesChoice) |
Returns: The loaded content or null if an error occurred.
public bool SetChild(RenderContent renderContent, string childSlotName, ChangeContexts changeContexts)
obsoleteUse SetChild without ChangeContexts and Begin/EndChange
Set another content as a child of this content. This content may or may not be attached to a document. If this content already has a child with the specified child slot name, that child will be deleted. If this content is not attached to a document, the child will be added without sending any events. If this content is attached to a document, the necessary events will be sent to update the UI. Note: Do not call this method to add children in your constructor. If you want to add default children, you should override Initialize() and add them there.
Parameters:
| renderContent (RenderContent) | Child content to add to this content. If pChild is NULL, the function will fail. If pChild is already attached to a document, the function will fail. If pChild is already a child of this or another content, the function will fail. |
| childSlotName (string) | The name that will be assigned to this child slot. The child slot name cannot be an empty string. If it is, the function will fail. |
| changeContexts (RenderContent.ChangeContexts) |
Returns: Returns true if the content was added or the child slot with this name was modified otherwise; returns false.
Set another content as a child of this content. This content may or may not be attached to a document. If this content already has a child with the specified child slot name, that child will be deleted. If this content is not attached to a document, the child will be added without sending any events. If this content is attached to a document, the necessary events will be sent to update the UI. Note: Do not call this method to add children in your constructor. If you want to add default children, you should override Initialize() and add them there.
Parameters:
| renderContent (RenderContent) | Child content to add to this content. If renderContent is null, the function will fail. If renderContent is already attached to a document, the function will fail. If renderContent is already a child of this or another content, the function will fail. |
| childSlotName (string) | The name that will be assigned to this child slot. The child slot name cannot be an empty string. If it is, the function will fail. |
Returns: Returns true if the content was added or the child slot with this name was modified, otherwise returns false.
Sets the amount property for the texture in the specified child slot.
Parameters:
| childSlotName (string) | The child slot name of the texture. |
| amount (double) | The texture amount. Values are typically from 0.0 to 100.0 |
| cc (RenderContent.ChangeContexts) | The context of the change. |
Sets the on-ness property for the texture in the specified child slot.
Parameters:
| childSlotName (string) | The child slot name of the texture. |
| bOn (bool) | Value for the on-ness property. |
| cc (RenderContent.ChangeContexts) | Context of the change |
public virtual bool SetChildSlotParameter(string contentParameterName, string extraRequirementParameter, object value, ExtraRequirementsSetContexts sc)
Extra requirements are a way of specifying extra functionality on parameters in the automatic UI. Override this function to support values being set from automatic UI sections or the texture summary. See IAutoUIExtraRequirements.h in the C++ RDK SDK for string definitions for the parameter names. Call the base class from your override if you do not support the extra requirement parameter. Please do not call this function. It is only retained for backward compatibility. You should instead call SetExtraRequirementParameter().
Parameters:
| contentParameterName (string) | The parameter or field internal name to which this query applies. |
| extraRequirementParameter (string) | The extra requirement parameter, as listed in IAutoUIExtraRequirements.h in the C++ RDK SDK. |
| value (object) | The value to set this extra requirement parameter. You will typically use System.Convert to convert the value to the type you need. |
| sc (RenderContent.ExtraRequirementsSetContexts) | The context of this operation. |
Returns: true if successful, else false.
public bool SetExtraRequirementParameter(string contentParameterName, string extraRequirementParameter, object value, ExtraRequirementsSetContexts sc)
Extra requirements are a way of specifying extra functionality on parameters in the automatic UI. See IAutoUIExtraRequirements.h in the C++ RDK SDK for string definitions for the parameter names.
Parameters:
| contentParameterName (string) | The parameter or field internal name to which this query applies. |
| extraRequirementParameter (string) | The extra requirement parameter, as listed in IAutoUIExtraRequirements.h in the C++ RDK SDK. |
| value (object) | The value to set this extra requirement parameter. You will typically use System.Convert to convert the value to the type you need. |
| sc (RenderContent.ExtraRequirementsSetContexts) | The context of this operation. |
Returns: true if successful, else false.
By default, RenderHash recurses into children when computing the render hash. However, some applications may require children to be excluded from the render hash calculation. Call this method to enable or disable recursing into children. see RenderHash
Parameters:
| recursive (bool) |
Set instance name for this content
obsoleteUse SetParameter without ChangeContexts and Begin/EndChange
Set the named parameter value for this content instance. If you do not support this parameter, call the base class.
Parameters:
| parameterName (string) | |
| value (object) | |
| changeContext (RenderContent.ChangeContexts) |
Set the named parameter value for this content instance. If you do not support this parameter, call the base class.
obsoleteThis method is deprecated and no longer called. For more information see CalculateRenderHash
This method is deprecated and no longer called. For more information see CalculateRenderHash(ulong)
Parameters:
| hash (uint) |
public static bool ShowContentInstanceBrowser(RhinoDoc doc, ref Guid instance_id, RenderContentKind kinds, ContentInstanceBrowserButtons buttons)
Allows the user to choose a content by displaying the Content Instance Browser dialog. The dialog will have OK, Cancel and Help buttons, and optional New and Edit buttons. Specifies the document to use. Sets the initially selected content and receives the instance id of the chosen content. Specifies the kind(s) of content that should be displayed in the browser. Specifies which optional buttons to display. Returns true if the user chooses a content or false if the dialog is cancelled.
Parameters:
| doc (RhinoDoc) | |
| instance_id (ref Guid) | |
| kinds (RenderContentKind) | |
| buttons (RenderContent.ContentInstanceBrowserButtons) |
Remove this content and all its children from any instance groups they may be a member of. If any content in the same document is left alone in the group, that content is also ungrouped. Records undo and sends events OnContentChanged and OnContentGroupIdChanged. \note This method is designed to be called from a content UI and is intended for RDK internal use but may be used as an expert user override.
Returns: true if a content was ungrouped, \e false if no content or child was part of a group.
Remove this content from any instance group it may be a member of. Does not record undo but does send the OnContentGroupIdChanged event.
Returns: true if content was ungrouped, \e false if it was not part of a group.
Remove this content and all its children from any instance groups they may be a member of. Does not record undo but does send the OnContentGroupIdChanged event.
Returns: true if a content was ungrouped, \e false if no content or child was part of a group.
public void Uninitialize()
obsoleteThis method should not be called.
Icon to display in the content browser, this bitmap needs to be valid for the life of this content object, the content object that returns the bitmap is responsible for disposing of the bitmap.
Events
Used to monitor render content addition to the document.
Used to monitor render content modifications.
Used to monitor render content deletion from the document.
Used to monitor render content deletion from the document.
This event is raised when a field value is modified.
Used to monitor render content renaming in the document.
Used to monitor render content replacing in the document.
Used to monitor render content replacing in the document.
Used to monitor render content preview updates.
Event fired when changes to current environments have been made. This will be one of Background, Reflection or Skylighting Since 6.11
PreviewRendered
#This event is raised when a preview has been rendered