Funny, I just went through this process the other night.
I'm writing some plug-ins for particle-flow and XSI to import\export PDC cache files. I too find that even on my pc the PDC cache output function is using Big Endian byte order and you must do a swap on all non-char data types which was a bit frustrating at first. I am getting a version of 1 and an Endianness of 1 btw.
Agreed, dynExport always includes particleId. And I do not think you will be able to only export a single position axis by default. You could however, add a custom attribute that you assign the current Y position of the particle to and export that attribute instead of position, I would think. But, at that point, you might as well just write your own export function out of maya instead of using PDC. Unless you want to manipulate the data externally and feed it back in through the cache mechanism...
I am not seeing an additional 4 bytes before the next attribute record and my PDC parsing function seems to be working fine (I'm writing it in C++ but that shouldn't matter).
There is definitely very minimal information on the PDC file format out there besides the single page in the help, it took a bit of patience but I did get it going.
Post some code( your swapper and/or your vector array handling seems the likely culprit ) and I'll take a look if you'd like.
Good luck,
Todd Kuennl
Rapid-TD
QUOTE(amitc @ 10/06/05, 03:38 PM)
PDC is driving me nuts.
1) I am trying to find out how PDC file should be wriiten
2) Then use the PDC to drive particles
The PDC format documentation is confusing.
It does not tell what is specification for BIG_endian or little endian (is 0 big endian and 1 little endian or vice versa or something else)
It does not tell what size the arrays will be for each type. A table specifying attributes and size would help.
Anyways Here what I have done so far.
Create a particle object with 4 particles
CODE
particle -n p -ll 0 0 0 -ur 3 0 0 -grs 1 -c 1;
Export them as PDC
CODE
dynExport -f pdc -mnf 0 -mxf 10 -atr position p;
Why does this write 2 attributes "position" and "particleid" when I am just aking it to write one?
Is there a way to just just write PositionY only instead of all x y and z?
So I get a file of size 190 bytes of which 28 is standard header so far good.
After the header 4+8+8=12 bytes which tells the length of "position" string and position written as chars and integer defining type as 5 ie vector array.
I presume vector array is 3 doubles. (beats me how it differs from double array)
There are 4 particles so there should be 4 particles*3 doubles*8 bytes =24 bytes.
Before the next attribute(particle id) there is an extra of 4 bytes? dont know what they mean. It looks like its an an integer but should be at the start of the vecotor array or end?
I have written a barebone PDC reader in C.
I am finding some inconsitency with the documentation.
There are extra 4 bytes in every attribute record. Not sure where they come from and where they should be (beginging or end).
It seems the PDC is written in BIG-endian. I am working on windows/intel and linux/intel
I have to swap integers to read correctly. The double go bonkers as I am not swapping them correctly.
Is there a way to write pdc from Maya in little endian for testing?
Well ultimately I want to drive theses particles from external data. Lets say only in position Y (to create a height field)
Any help from you folks would be great
Thanks
[snapback]216643[/snapback]