RhinoCommon plug-in CreatePreview usage

Thanks Nathan

Regarding the Preview issue - this is definitely not working right. I can update an Octane Material (which saves to the RenderMaterial Fields) and then click Update All Previews, and CreatePreview(CreatePreviewEventArgs args) is not called. And them occassionally it is! So Rhino does not seem to be setting the “is dirty” flag on the material when my plugin sets the Field data.

Also, my Rhino5 code is

protected override void CreatePreview(CreatePreviewEventArgs args)
{
        if (!(args.PreviewContent is OctaneRenderMaterial))
                    return;

in order to filter out non-Octane material previews. I was told to change this to the following for RhinoWIP:

protected override void CreatePreview(CreatePreviewEventArgs args)
{
        if (args.ContentTypeId != this.Id)
                return;

…which was working for previous RhinoWIP builds - however with the current build the “this.id” is different from the “args.ContentTypeId” being passed to CreatePreview (so therefore the Preview is not being done).

It looks like CreatePreview is being passed with the assembly GUID rather than the PhysicalcSoftware.OctaneRender.RhinoPlugin GUID.

Paul

Post split off into new thread.

I have created RH-41553 to track this issue.

Paul

I have absolutely no idea why you were asked to change the comparison - it’s definately wrong. Those are two very different types of things. You should be comparing to ContentTypeId with the ContentTypeId that you are returning from your Octane material - which is probably the Guid attribute you have just above your material class definition.

As for the calls to CreatePreview - they all appear to be working perfectly here.

  • Andy