BaseFile lost methods
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/09/2010 at 15:55, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R12
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;---------
Is there really a reason for removing these methods in R12's BaseFile?ReadVector
ReadLVector
ReadMatrix
ReadLMatrix
ReadTime
WriteVector
WriteLVector
WriteMatrix
WriteLMatrix
WriteTimeI happen to use some of them extensively in my big, massive plugin and this means figuring out how to recreate the functionality (hopefully uncoverable in the SDK files!) so that my data and configuration files continue to work as they should. No mention of them in the PDF either. Egads...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/09/2010 at 03:12, xxxxxxxx wrote:
Seems an odd thing to do, doesn't it? Why remove useful functionality in this way?
I suppose it's easy enough to recreate - WriteReal() x3 can be used to write the vector components, and since the matrix is a set of vectors, that shouldn't be a problem either. Don't know about the time, though.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/09/2010 at 06:17, xxxxxxxx wrote:
Easy to recreate - but why am I recreating them? Dangle a carrot in front of me, hook me on it, and then take it away. The difference is now the call is a reference out. Instead of the direct methods:
Bool AESFile::WriteVector(const Vector &v)
{
return WriteReal(v.x) && WriteReal(v.y) && WriteReal(v.z);
}I now need to make indirect references, and send an extra argument, which is slower (!!!???) :
Bool WriteVector(BaseFile* bf, const Vector &v)
{
return bf->WriteSReal((SReal)v.x) && bf->WriteSReal((SReal)v.y) && bf->WriteSReal((SReal)v.z);
}Where is the efficiency and convenience in that?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/09/2010 at 08:59, xxxxxxxx wrote:
ReadTime/ReadVector/ReadMatrix + their respective counterparts have been removed as C4D can run in either single or double precision, thus the behaviour would not be defined and lead to crashes/unexpected behaviour.
If you don't want to deal with different precision I recommend to use HyperFiles to store data -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/09/2010 at 10:35, xxxxxxxx wrote:
Instead of blanketing Real, why not make SReal and LReal variants then? It was simple enough for me to do the above (corrected). Haven't check their veracity but at some point this has to work or you will need to remove those Writes and Reads as well so that I can output binary for everything...
The other bothersome thing about these changes is that now that I had finally added 'f' to ALL of my floating point values (because Real was defined as float), I must now go through and remove them all. Please don't add them back in for R13 or I will send you my code so that one of you can make the thousands and thousands of changes!
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/09/2010 at 11:32, xxxxxxxx wrote:
I'll add SReal/LReal versions for Matrix and Vector, however I cannot do this for BaseTime.
The other bothersome thing about these changes is that now that I had finally added 'f' to ALL of my floating point values (because Real was defined as float), I must now go through and remove them all. Please don't add them back in for R13 or I will send you my code so that one of you can make the thousands and thousands of changes!
That's why we added the defines SCO, LCO and RCO.
Instead of writing "5.0f" or "5.0" the better way is to write "RCO 5.0"
By doing so you ensure that it always will be the right format, without needing runtime for a conversion.However using "5.0" is fine, too. C4D will only use single-precision for special editions, hardware etc. Regular C4Ds will always be double-precision from R12 on. And "5.0" also works in single precision - it just is marginally slower.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/09/2010 at 12:26, xxxxxxxx wrote:
Originally posted by xxxxxxxx
And "5.0" also works in single precision - it just is marginally slower.
Exactly why I added all of those 'f's to my Real constants. Marginal for the processor to do the double to single precision conversion - but all of them add up when it is being done thousands or millions of times.
SCO, LCO, RCO are only good if you are only targeting R11 and R12. I'm also targeting R10 and was, until recently, targeting R9.