|
|
|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
|
Hi,
I am using the FBX SDK 2011_3 and would like to create a simple Property that is able to store a variable array of integers, which should be written to and read from files.
From what I have seen so far, there does not appear to be a simple way to do that. The AnimCurve implementation for instance has exactly what I need, but the Property it is using for this doesn’t appear to be accessible, and may even be very custom.
What I consider doing as a workaround is one of the following:
* Use the DTBlob, and finally store a simple vector’s data in binary
* Connect an AnimCurve to an integer property and use its interface to simulate an integer array. This would certainly work, but would be wasteful as well.
* Implement custom writing for a custom property with a custom interface - this would be too much effort, but would certainly be possible as well.
* Use the array methods of the Property (SetArraySize, etc.) to simulate dynamic growth, but I assume this would be very slow and overkill.
Do you think I have overlooked anything obvious ? Or which way would be the best ? I prefer just saving it as a blob actually, its simple and would probably yield best performance.
Thank you,
Sebastian
|
|
|
|
Hello Sebastian, I think to make a DTBlob is a good choice.
Besides, I am looking at all the data type and thinking maybe you can use DTStringList too.
I did a simple test with the public sample UserProperties, I changed the p6 as follow:
// add elements to the list
p6.AddEnumValue("3");
p6.AddEnumValue("5");
p6.AddEnumValue("4");
p6.AddEnumValue("98");
p6.InsertEnumValue(0, "34");
And in the FBX file, it will be written as:
P: “MyList”, “stringlist”, “”, “A+U”,2, “34~3~5~4~98”
I attached the generated fbx file.
Jiayang Xu
Maya Data Platform
Autodesk
|
|
|
|
Hi Jiayang,
I indeed ended up using the DTBlob. By deriving from KFbxProperty, it was possible to easily and conveniently implement a new Property type which would allow to define a vector template, the vector in question can then be written to and loaded from the actual blob property. This also has the advantage that the normal vector interface can be used for creating and accessing the data.
One question still open is the alignment of the data of the blob: Does DTBlob automatically write bytes in network alignment, or do I have to do it myself ? Unfortunately I didn’t find any hint on this important fact in the respective docs, which appear to be only stating the obvious in many cases, but usually don’t go beyond that.
I am very tempted though to believe DTBlob does that already, as everything could be considered a bug in a data-exchange format.
Regards,
Sebastian
|
|
|
|
|
Hello, Sebastian, fbxBlob simply take the raw data in by memcpy, and do not handle the data itself at all.
So it totally depend on the user to define that raw data.
Author: Jiayang Xu
|
| Replied: 21 December 2010 05:30 PM
|
|
|
|
|
|
|