|
Prisms Development Toolkit DocumentationSide Effects Software Inc. 1997 |
Typically, you will create custom versions of action in a separate
directory. The most common way to do this is to copy the files
and then modify sample.c to do what you want. Usersop.c also needs to be changed to add your new sop to the sop table. Many people use a Make file to compile everything.
The first, wowee.c, would contain the source for your sop. What that looks like is explained in the next section.
The second, usersop.c, is important because it tells action to add your SOP to a table of user SOP references. It would look like this:
#include <custom.h>
extern SOP_FUNC WoweeSopRef;
/* Now define the table for Action to know about the SOPs */
SOP_FUNC *UserSopTable[] = {
&WoweeSopRef,
0, /* must be last entry in the table */
};
/* This is a dummy function which may be needed for linking */
void
sbprompt(void)
{
}
Notice that the string "Wowee" appears in two places. You can have more
than one custom SOP in action. In our example, to have another
SOP, called "Kazowee", available to the animator, the file usersop.c
would look like:
#include <custom.h>
extern SOP_FUNC WoweeSopRef;
extern SOP_FUNC KazoweeSopRef;
SOP_FUNC *UserSopTable[] = {
&WoweeSopRef,
&KazoweeSopRef,
0,
};
void
sbprompt(void)
{
}
The third file in this directory would be a Makefile. This is a file,
called "Makefile", which is used by the UNIX make command to
perform commands based on certain conditions.
This is optional,
but it saves typing and simplifies things if you want both a graphical
and non-graphical version of your custom action. The simplest
possible Makefile could contain just the following lines:
newaction: wowee.c usersop.c custom usersop.c wowee.c -o newaction newacting: wowee.c usersop.c custom -n usersop.c wowee.c -o newactionThis would be used by simply typing "make" or "make newaction" to get the graphical custom action, or "make newacting" to get the non-graphical one.