vcanim.gif (8357 bytes)Plugin Plumbing
Home ] Sales ] Products ] Services ] Support ] Downloads ]

 

 


The Mechanics of Creating Your Own Plugin

You should usually be able to construct the effect you want using SoftWish's general purpose plugins, the SoftWish console for immediate effects and   SoftWish behaviors for persistent effect. If you must create your own SoftWish plugin at a lower level, you do so by:

  • Creating a subdirectory of $SI_LOCATION/3D/custom/SoftWish. The subdirectory can have any name, let's say: WonderEffect.
  • You MUST create a file named pkgIndex.tcl in the directory you just made, and this package index file must tell SoftWish how to load WonderEffect's code. A package index can do it with a line like this:

    package ifneeded SoftWish101 1.0 "source [file join $dir myplugin.tcl]"

  • This is all you need to do if all the code for your plugin is in the file myplugin.tcl. This line causes the file $SI_LOCATION/3D/custom/SoftWish/WonderEffect/myplugin.tcl to be loaded whenever version 1.0 of your plugin is needed.
  • Your plugin must also be assigned a unique name of the form: SoftWishN, where N is a number between 0 and 128. Video Collage reserves 0-20, so you can use SoftWish21, SoftWish22, .... , SoftWish127.  Let's use SoftWish101 for WonderEffect. You will use the SoftWishNNN name in the Softimage .cus file.  The name SoftWishNNN is totally independent of the directory name you choose (in this case WonderEffect).
  • Now we are ready to construct our .cus file. The name of the .cus file is the name which Softimage will display on the specified button. Let's suppose you want your plugin to be WonderEffect in the MODEL module.
  • Create WonderEffect.cus in SI_LOCATION/3D/custom/model.
  • Your DYNAMIC_LINK must be to SoftWish,  so you will have a line:

    LINKNAME SoftWish

  • All the entry points of your plugin that Softimage is going to call must be to the SoftWishNNN name in the .cus file, and to SoftWishEntryPoint in your tcl code. So if WonderEffect has an INIT entry point you must have a line like:

    INIT_FUNCTION SoftWish101

    in your .cus file and a procedure SoftWishInit in your tcl code. If WonderEffect wants Softimage to call it at SETUP, then it needs a line like:

    SETUP_FUNCTION SoftWish101

    in the .cus file. and a SoftWishSetup procedure in the Tcl code. In either case the Tcl code containing these procedures must be made available by your pkgIndex.tcl file. Similarly if you have an update function you would have a SoftWishUpdate procedure and the line:

    UPDATE_FUNCTION SoftWish101

    in your .cus file. We recommend ALWAYS having a cleanup entry point:

    CLEANUP_FUNCTION SoftWish101

    and the associated SoftWishCleanup procedure since this lets us clean up interpreters sooner.


Whitepaper ] Terms and Conventions ] Release Notes 2.2 ] Problems You May Encounter ] Installation overview ] Installing on Irix ] Installing on Nt ] Licensing ] Scripting ] Utilities and Libraries ] Tools ] Tutorials ]

copyright Video-Collage Inc.