The PDC file is used by Maya's particle disk caching and startup cache. It is a binary file that holds one frame's worth of data for a single particle object.
Note: The unit for PDC files is always cm
Row no |
Content |
Byte Count |
Description |
Default |
Extra Info |
Example |
Example Explanation |
Row no |
| 1 | PDC file header |
4 |
Characters indicating that this is a PDC file. This will be the 4 characters "P", "D", "C", " ". |
"P", "D", "C"," " |
last one is space character (no commas or quotes) |
"P", "D", "C", " " |
Compulsory. No changes should be made here. | 1 |
| 2 | 4 |
One Integer indicating the file format version number. |
1 |
Avoid changing this untill you know for certain. No documentation about it. |
1 |
Lets stick to default | 2 | |
| 3 | 4 |
One Integer holding bit information about whether the values stored in the file are BIG_ENDIAN or LITTLE_ENDIAN. |
1 |
Maya only likes Big_Endian. So always use 1. |
1 |
Always use 1 for this | 3 | |
| 4 | 8 |
2 Integers holding extra bit information that various file format version might decide to use. |
0, 0 |
Avoid changing these. No documentation about them | 0 0 |
Lets stick to default | 4 | |
| 5 | 4 |
1 Integer indicating the number of particles represented in this file | "N" |
N is the no of particle you need |
5 |
Lets say our particle system contains 5 particles | 5 | |
| 6 | 4 |
1 Integer indicating the number of attributes that have values stored in this file. | " M " |
M is the no of attributes you'll write in the file (eg position, particleID, rgbpp,etc) |
1 |
We'll just write 1 attribute for position on per particle basis. | 6 | |
Header size |
28 Bytes |
28 Bytes |
||||||
There will be "M" records, one record for each attribute. Each record will consists of the following:
Row no |
Content |
Byte Count |
Description |
Default |
Extra Info |
Example |
Example Explanation |
Row no |
| 7 | Single Record (There will be M records like this) |
4 |
Integer indicating the length of the attribute's name =L where L is the length of the name. |
8 |
8 (no of characters in string "postion") | 7 | ||
| 8 | L |
L Characters indicating the name of the attribute | position |
position | 8 | |||
| 9 | 4 |
1 Integer indicating the type of data for the current attribute. Choose the number from the following data type map below (Row no10) |
Per Object Attributes are set for all particles so they are single numbers. (ie of type 0,2,4 ) See row 10 Per Particle attributes are set for each particle so naturally they are an array of the data. (ie of type 1,3,5 ) See row 10 |
5 |
As position is specified as 3 doubles ie a vector and we have to specify this on per particle basis our datatype becomes 5 (vector array). See the info below on choosing data type.(Row No10) |
9 | ||
| 10 | P |
Data Type 0 ---> Integer 1 ---> Integer Array 2 ---> Double 3 ---> Double Array 4 ---> Vector 5 ---> Vector Array |
0 ---> Integer (just one int=4 bytes - usually per object attribute) 1 ---> Integer Array ( N ints=N*4bytes - where N is the number of particles, usually per particle attribute) 2 ---> Double (just one double=8bytes - usually per object attribute) 3 ---> Double Array ( N doubles=N*8bytes - where N is the number of particles, usually per particle attribute) 4 ---> Vector (3 doubles=3*8bytes - usually per object attribute) 5 ---> Vector Array ( N vectors=N*3 doubles=N*3*8bytes - where N is the number of particles, usually per particle attribute) |
1.0 1.0 1.0 2.0 2.0 2.0 3.0 3.0 3.0 4.0 4.0 4.0 5.0 5.0 5.0 |
x, y, z corrdinates for each particle. Maya stores floating points in double precision using 8 bytes. | 10 | ||
Single Record Size (The record size for each attribute will vary according to data type) |
8+L+(N*B) Bytes |
N * B Bytes representing the data for this attribute, where L is the no of characters in attribute name N is the number of particles or 1 for non-array data B is the number of bytes needed to represent the data type. |
N*B= 5*(3*8)=120 8+L+N*B=8+8+120 =136 Bytes |
x y z are 3 doubles occuring 5 times | ||||
Total File Size (Summation of header and M record size) |
28+size of M record Bytes |
28 bytes of header M records of size (8 + L + B) (8 + L + B) is going to be different for each attribute | 28 + 1*(136)=148 Bytes |
|||||
Reference: Maya Documentation
Caution: Since format contains data that is not word aligned there could be potential problems with different compilers. In a loose words what it means is when you read data from memory by providing a memory address or pointer you might get incorrect results. As compilers will hand you the data from a valid address rather than from where you asked from. Our implementation takes care of this.