Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
developer:zoorhinoplugin [2020/08/14]
127.0.0.1 external edit
developer:zoorhinoplugin [2020/11/25]
sandy [Rhino Plug-in Sample]
Line 1: Line 1:
-====== Creating Rhino C++ Plug-ins that use the Zoo ======+====== Creating Rhino C++ Plugins that use the Zoo ======
 > **Developer:** //[[developer:zoo|Zoo 5.0]]// > **Developer:** //[[developer:zoo|Zoo 5.0]]//
-> **Summary:** //Discusses how to create Rhino 5.0 plug-ins that can obtain licenses from the Rhino license manager and the Zoo.//+> **Summary:** //Discusses how to create Rhino 5.0 plugins to obtain licenses from the Rhino license manager and the Zoo.//
  
 ===== Overview ===== ===== Overview =====
-Zoo 5.0 allows 3rd party plug-in developers to add licensing support for their products to the Zoo.+Zoo 5.0 allows 3rd party plugin developers to add licensing support for their products to the Zoo.
  
-The Rhino 5.0 C++ SDK allows developers to write plug-ins for Rhino that use the Rhino license manager and obtain licenses from Zoo servers.+The Rhino 5.0 C++ SDK allows developers to write plugins for Rhino that use the Rhino license manager and obtain licenses from Zoo servers.
  
  
 ===== Requirements ===== ===== Requirements =====
-Rhino C++ plug-ins are MFC dynamic link libraries. Thus, to create a plug-in for Rhino, you will need one of the following development tools:+Rhino C++ plugins are MFC dynamic link libraries. Thus, to create a plugin for Rhino, you will need one of the following development tools:
  
   - Microsoft Visual C++ 2005 (required for Rhino 5.0 32-bit)   - Microsoft Visual C++ 2005 (required for Rhino 5.0 32-bit)
   - Microsoft Visual C++ 2010 (required for Rhino 5.0 64-bit)   - Microsoft Visual C++ 2010 (required for Rhino 5.0 64-bit)
-  - [[http://wiki.mcneel.com/developer/sdksamples/rhino5wip|Rhino 5.0 C++ SDK]]+  - Rhino 5.0 C++ SDK
  
 Note, the Express Editions of Microsoft Visual Studio will **not** work, as they do not include MFC. Note, the Express Editions of Microsoft Visual Studio will **not** work, as they do not include MFC.
  
-Also, all Rhino plug-ins that use the Rhino license manager to access the Zoo must be signed with an Authenticode certificate issued by McNeel Plug-in Security. These certificates are freebut must be requested by each developer. Developers must agree to the //Terms of Use// before a certificate is issued. For more information on plug-in signing, see the following:+Also, all Rhino plugins that use the Rhino license manager to access the Zoo must be signed with an Authenticode certificate issued by McNeel Plugin Security. These certificates are free but must be requested by each developer. Developers must agree to the //Terms of Use// before a certificate is issued. 
  
-[[developer:digital-signatures/create-request|Digitally Signing Plug-ins]] +===== Creating a Rhino C++ Plugin ===== 
- +The following are the general steps required to create a Rhino plugin.  
-===== Creating a Rhino C++ Plug-in ===== +  - Make sure you have Rhino 5.0 installed. 
-The following are the general steps required to create a Rhino plug-in.  +  - Make sure you have the Rhino 5.0 C++ SDK installed.
-  - Make sure you have the [[http://www.rhino3d.com/nr.htm|Rhino 5.0]] installed. +
-  - Make sure you have the [[http://wiki.mcneel.com/developer/sdksamples/rhino5wip|Rhino 5.0 C++ SDK]] installed.+
   - Launch Microsoft Visual Studio 2010.   - Launch Microsoft Visual Studio 2010.
-  - Create a new project, in C++, based on the **Rhino 5.0 Plug-in** project template. +  - Create a new project, in C++, based on the **Rhino 5.0 Plugin** project template. 
-  - Build your plug-in+  - Build your plugin
-  - Launch Rhino and use **PlugInManager** to install your plug-in (to verify that it was built properly).+  - Launch Rhino and use **PlugInManager** to install your plugin (to verify that it was correctly built).
  
-===== Adding Licensing Support to your Plug-in Project ===== +===== Adding Licensing Support to your Plugin Project ===== 
-After you have built and tested your basic plug-in, you can add licensing support as follows:+After you have built and tested your basic plugin, you can add licensing support as follows:
   - Add a new .CPP file to your project.   - Add a new .CPP file to your project.
   - In this .CPP file, declare a new class that is derived from **CRhinoLicenseValidator**.   - In this .CPP file, declare a new class that is derived from **CRhinoLicenseValidator**.
   - Override the **CRhinoLicenseValidator::ProductBuildType** virtual function and return the build type of the license that your product requires.   - Override the **CRhinoLicenseValidator::ProductBuildType** virtual function and return the build type of the license that your product requires.
-  - Override and implement the **CRhinoLicenseValidator::ValidateProductKey** virtual function. Rhino will call into this function whenever it needs your plug-in to validate a license that is entered by a user, returned by the Rhino license manager (standalone node), or returned from a Zoo server (network node). For details, see the example Rhino C++ plug-in listed below.+  - Override and implement the **CRhinoLicenseValidator::ValidateProductKey** virtual function. Rhino will call into this function whenever it needs your plugin to validate a license that is entered by a user, returned by the Rhino license manager (standalone node), or returned from a Zoo server (network node). For details, see the example Rhino C++ plugin listed below.
   - Create one (and only one) static instance of your object.   - Create one (and only one) static instance of your object.
-  - In your plug-in' **CRhinoPlugIn::OnLoadPlugIn ** member, call  **CRhinoPlugIn::GetLicense** to get a license. +  - In your plugin' **CRhinoPlugIn::OnLoadPlugIn ** member, call  **CRhinoPlugIn::GetLicense** to get a license. 
-  - Build your plug-in+  - Build your plugin
-  - [[developer:digital-signatures/create-request|Digitally sign your plug-in.]] +  - [[developer:digital-signatures/create-request|Digitally sign your plugin.]] 
-  - Launch Rhino and test your plug-in. When your plug-in is loaded for the first time, you will be prompted to enter a license.+  - Launch Rhino and test your plugin. When you load your plugin for the first time, you will be prompted to enter a license.
 {{:developer:licensenotfound.png|}} {{:developer:licensenotfound.png|}}
  
 ===== Managing your License ===== ===== Managing your License =====
-Rhino plug-ins that use the Rhino license manager appear in the Licenses page of the Options dialog. Here, the user is allowed to view and manage the license.+Rhino plugins that use the Rhino license manager appear in the Licenses page of the Options dialog. Here, the user is allowed to view and manage the license.
  
 {{:developer:licensetools.png|}} {{:developer:licensetools.png|}}
  
-===== Rhino Plug-in Sample ===== +===== Rhino Plugin Sample ===== 
-[[https://github.com/mcneel/Zoo5|Sample Rhino 5 C++ plug-in project on GitHub]]+[[https://github.com/mcneel/Zoo5|Sample Rhino 5 C++ plugin project on GitHub]]
  
 \\ \\