1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
#ifndef writeRib_h
#define writeRib_h
// Shave and a Haircut
// (c) 2019 Epic Games
// US Patent 6720962
#ifdef __cplusplus
extern "C"
{
#endif
// For all of the flags in this struct, 1 means the flag is set and 0 means
// that it is not set.
typedef struct
{
// Generate a binary RIB file rather than ASCII.
unsigned char binary;
// Use cubic curves for hairs, rather than linear.
unsigned char cubicCurves;
// Have the main RIB file use full path names for per-voxel RIB files,
// rather than relative names.
unsigned char fullPaths;
// If generating a binary RIB, use gzip compression.
unsigned char gzip;
// Include motion blocks for motionBlur.
unsigned char motionBlur;
// For instanced hair, output vertex normals.
unsigned char normals;
// Output Shave's root and tip colors for each hair. These will use
// parameter names "rootcolor" and "tipcolor".
unsigned char rootTipColors;
// Output growth surface normals for each hair root. These will use
// the parameter name "N_Srf".
unsigned char surfaceNormals;
// Output uvs for each hair or instance vertex.
unsigned char uvs;
// Display on stderr all warning messages.
unsigned char verbose;
// Output per-vertex colors. (Not currently implemented.)
unsigned char vertexColors;
// Generate a separate RIB file for each node and voxel combination,
// plus a master RIB file which includes them all. (This is currently
// the only supported option, so 'voxels' is always forced to be set.)
unsigned char voxels;
// Output 'w' coordinates for each hair vertex, giving the normalized
// distance along the hair, from 0 at the root to 1 at the tip. These
// will use the parameter name "w".
unsigned char wCoords;
} WriteRibFlags;
//
// Write out a RIB file for the specified nodes from a DRA file.
//
// 'flags' describes which parameters to include in the RIB file, as well
// as some formatting information. See the WriteRibFlags struct above.
//
// 'ribFile' gives the name of the main RIB file to be generated (e.g.
// 'myFile.rib'). Per-voxel RIB files will use that name as a base,
// followed by the node name and voxel number (e.g. 'myFile_node1_5.rib').
// If 'ribFile' is NULL then the main RIB file will be written to the
// console and the per-voxel RIB files will use an empty base name
// (e.g. '_node1_5.rib').
//
// 'draFile' is the Shave DRA data file from which the RIB file is to be
// generated.
//
// 'numNodesToWrite' gives the number of hair nodes from 'draFile' which
// are to be included in the RIB file.
//
// 'nodesToWrite' is an array of 'numNodesToWrite' elements containing the
// names of the hair nodes inside 'draFile' for which RIB files are to be
// generated. The array is mandatory and must contain 'numNodesToWrite'
// elements.
//
// 'facesPerInst' is an array of 'numNodesToWrite' elements giving the number
// of faces in one instance, for each hair node. Zero indicates that the
// corresponding node is not instanced. If none of the nodes are instanced
// the array may be omitted and NULL passed in its stead.
//
// 'nodeRibText' is an array of 'numNodesToWrite' elements giving the
// node-specific RIB text for each node. If a given node has no RIB text
// it's entry may be NULL or the empty string (""). If none of the nodes
// have node-specific RIB text then the array may be omitted and NULL
// passed in its stead.
//
// 'globalRibText' is generic RIB text which will appear at the start of
// the RIB file.
//
// Returns 1 on success, 0 on failure.
//
extern int writeRib( const WriteRibFlags * flags, const char *ribFile, const char *draFile, float shutterOpen, float shutterClose, int numNodesToWrite, char **nodesToWrite, const int *facesPerInst, char **nodeRibText, const char *globalRibText );
#ifdef __cplusplus
}
#endif
#endif
|