FileImportPlugIn file types not working in Rhino 8

Our plugin derives from FileImportPlugIn and overrides the AddFileTypes method to add a “FastShip” file type. As shown below this works as expected in Rhino 7.

However, in Rhino 8 the added file type does not show up. I have confirmed in the debugger that the file type list is being returned. Is there anything in particular I should do to get this to show up in Rhino 8 as well?

Thanks, Larry

1 Like

Hi Larry, this should of course “just work”. Check the following:

  1. .Are you on the latest service release of Rhino?

  2. Is your code like this:

protected override Rhino.PlugIns.FileTypeList AddFileTypes(Rhino.FileIO.FileReadOptions options)
{
  var result = new Rhino.PlugIns.FileTypeList();
  result.AddFileType("FastShip Files (*.srf,*.pex)", new string[] { "srf", "pex" });
  return result;
}
  1. Registry: The plug-in is registered in the registry in this location, where is your plug-in GUID that you set in AssemblyInfo.cs at [assembly: Guid("...")]
HKEY_CURRENT_USER\Software\McNeel\Rhinoceros\8.0\Plug-Ins\<GUID>\FileTypes

You can check if the plug-in is registered and which file types are listed in the registry. If you want to try to re-register the plug-in, delete the registry key , start Rhino and drag your RHP file onto Rhino again. After closing Rhino, the plug-in should be registered in the registry.

Hi @menno , thanks for the help with this.

  1. I was running SR14 but just updated to SR15 and behavior is the same.
  2. Yes my code looks just like that (I used the AddFileType overload that takes 3 arguments but effectively the same). Also tried just using one extension to make sure that wasn’t somehow causing the behavior
  3. Registry seems to look ok as attached, but still not showing up in the drop down.

Thanks for checking. Have you tried re-registring:

  1. close all running rhinos
  2. removing the registry entry of your plug-in, the “folder” that starts with 8b6c
  3. start Rhino again
  4. drag your plug-in onto Rhino to register it
  5. start the open dialog and find your plug-in

Also, can you test the return value of FileTypeList.AddFileType, that should return an integer >= 0. If the return value is negative, an error occurred while adding the file type.

Lastly, can you share the exact code for the AddFileTypes override in your plug-in?

Hi @menno, thanks for this input as it helped to find what I think is the real issue. After clearing out the registry and re-registering by dragging the plug-in onto Rhino, the FastShip file types show up in the list of supported files. However, once I close Rhino and then re-open it the FastShip file types no longer appear.

I generally use plug-in load protection to control loading of our plug-in (since I often switch between different builds and this lets me do that easily as well as identify which one I am loading). It appears that having plug-in load protection enabled and answering Yes to load the plug-in when Rhino opens does not load the file types. As soon as I re-enable my plug-in, removing it from load protection, the desired file types appear again.

I’m not sure if this is an intended behavior or not. It is a situation that our users could run into. Is this something you are able to look into?

Thanks again for your help with this.

Kind regards,

Larry

Thanks for finding and reporting these details, that will help in getting to the root of this. For now, I have reported the issue here.