|
Prisms Development Toolkit DocumentationSide Effects Software Inc. 1997 |
SOP_FUNC CircleSopRef = { /* 1st: SOP name as in usersop.c */
"circle", /* 2nd: name as it appears in menu */
"c:::O:p:r:", /* 3rd: SOP params and how to parse */
sopScan,
sopPrint,
sopCook,
sopDefaults,
sopClean,
sopGPMake,
sopGetParms,
SOPUSAGE,
};
1. In usersop.c you will define the access
point for this sop. The name you use here (in this case, CircleSopRef)
and the name you use there must be the same. In general, SOP function
entries are named YourNameSopRef, where YourName is the name you are
using for the SOP.
2. The string that will appear in the SOP menu and at the top of the SOP in the SOP list goes here. This does not need to be the same as anything else you have used, but it is a good idea not to confuse people.
3. SOP parameters are defined here, in sopScan()
and sopPrint(), and also in the
SOPUSAGE macro.
The syntax is simple: choose a letter for each argument or set of
arguments your sop will accept. Letters which may NOT be used
because they are reserved by action are
For example, the -c flag takes 3 arguments (center x, y and z), so it is
entered as "c:::". A toggle, which took no values, would have no : after
it. For example, the command line for the Elipsoid SOP is
#define SOPUSAGE \ "sellipsoid [-c x y z] [-r x y z] [-O axis]\n\ \t\t[-t type] [-p lat long] [-P]\n\ \t-c The center of the ellipsoid\n\ \t-r The radii of the dominant axes (x, y, z)\n\ \t-O The polar axis (x, y or z)\n\ \t-t How to connect the ellipsoid(tri, quad, row, col, rc)\n\ \t-p The number of divisions for lat and long\n\ \t-P Fuse the points at the poles"so the corresponding SOP_FUNC is
SOP_FUNC EllipsoidSopRef = {
"ellipsoid",
"c:::r:::O:p::Pt:",
sopScan, sopPrint, sopCook,
sopDefaults, sopClean, sopGPMake,
sopGetParms,
SOPUSAGE,
};
Since -P (fuse the points at the poles) is a toggle, it is followed
immediately by 't', which takes a single argument.