Here is my EXTREMELY PRELIMINARY, step-by-step procedure for creating a Nuke Operator .dll from scratch, using VS 2010:
Creating a Nuke Operator from scratch using Visual Studio 2010. 1) Start VS2010. 2) Click on 'New Project...' 3) Open the 'Installed Templates' section in the 'New Project' dialog, if it isn't (Here we assume that you have the C++ development template installed. If not, you will need to go back to your VS2010 install CD and install it), and expand the 'Visual C++' section 4) Click on the 'General' option under 'Visual C++', and select 'Empty Project' from the list in the center tab. 5) Below, in the 'Name' section, enter the name of your Operator. E.g. 'TestNode' 6) Make sure the 'Create directory for solution' option is checked, and browse to the location for the folder containing your Operator Solution 7) We are now going to set all the configuration properties required for the C++ project you just created. Note that all these steps must be performed (or copied) for each of the four possible configurations (Debug/Release) & (32/64 bit): a. Right click on the Project Name (TestNode in this case), and select 'Properties'. Alternatively, you can select 'Properties' from the 'Project' menu at the top, or just press Alt-F7. b. Select the Configuration (Debug/Release) and the Platform (32/64 bit) at the top of this dialog. Recommended practice is to use Release, and most of us will be on a 64-bit platform. c. Expand the 'Configuration Properties' section if it is not already, and click on 'General' d. Change the 'Configuration Type' to 'Dynamic Library (.dll)' e. Change the 'Character Set' to 'Use Unicode Character Set' f. Change the 'Whole Program Optimization' to 'Use Link Time Code Generation' g. Next, select 'Debugging' from the left panel. h. Set 'Command' to 'C:\Program Files\Nuke6.2v2\Nuke6.2.exe' (note that this will probably not be necessary, since direct debugging using the IDE is 'iffy' at best using Nuke, but this permits us to launch Nuke in Debug mode in order to trace execution and look at variable values in the VS Debugger. i. Click on 'VC++ Directories' in the left panel j. Change 'Include Directories' to 'C:\Program Files\Nuke6.2v2\include;$(IncludePath)' (or wherever your nuke is installed). This gives the VC compiler access to the '.h' files. k. Expand the 'Linker' section in the left panel, and click on 'General' l. Change the 'Enable Incremental Linking' option to 'No (/INCREMENTAL:NO)' m. Set 'Additional Library Directories' to 'C:\Program Files\Nuke6.2v2;%(AdditionalLibraryDirectories)' (or wherever your version of Nuke is installed) This tells the VC2010 linker where the required .dll libraries are to be found. n. Select 'Input' from the left panel, under 'Linker', and set 'Additional Dependencies' to 'DDImage.lib;glew32.lib;%(AdditionalDependencies)' (having just told VS2010 where the libraries are to be found, now we tell it what is to be referenced by the Operator) 8) Your Project parameters are now properly configured. Next, move or create the necessary .cpp files into the project folder (e.g., the Mirror.cpp, stdafx.cpp, and stdafx.h files from the vc8 directory in your installation) 9) Important note: When your project is compiled, VS2010 will create a .dll file with the same name as the your project by default (this is actually specified as the 'Target Name' in the 'General' section under 'Configuration Properties' in your Project Properties), and Nuke will assume that the name of the Operator Node is the same as the name of the .dll. If this is not the case, you will get an error. So, be sure that the class you define for your Operator, and the Node name defined in the CLASS definition in the node, is the same as the name of your project. That's it! You now have a properly configured VS2010 Nuke project from scratch. Cheers! Steve Booth (CONFIDENTIALITY NOTICE: The information contained in this email may be confidential and/or privileged. This email is intended to be reviewed by only the individual or organization named above. If you are not the intended recipient, or an authorized representative of the intended recipient, you are hereby notified that any review, dissemination or copying of this email, or the information contained herein is strictly prohibited. If you have received this communication in error, please notify the sender by return email and delete this email from your system. Thank You.)
_______________________________________________ Nuke-dev mailing list [email protected] http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
