MCPcopy Create free account
hub / github.com/assimp/assimp / WriteHeaderExtension

Method WriteHeaderExtension

code/AssetLib/FBX/FBXExporter.cpp:317–396  ·  view source on GitHub ↗

FBXHeaderExtension top-level node

Source from the content-addressed store, hash-verified

315
316//FBXHeaderExtension top-level node
317void FBXExporter::WriteHeaderExtension ()
318{
319 if (!binary) {
320 // no title, follows directly from the top comment
321 }
322 FBX::Node n("FBXHeaderExtension");
323 StreamWriterLE outstream(outfile);
324 int indent = 0;
325
326 // begin node
327 n.Begin(outstream, binary, indent);
328
329 // write properties
330 // (none)
331
332 // finish properties
333 n.EndProperties(outstream, binary, indent, 0);
334
335 // begin children
336 n.BeginChildren(outstream, binary, indent);
337
338 indent = 1;
339
340 // write child nodes
341 FBX::Node::WritePropertyNode(
342 "FBXHeaderVersion", int32_t(1003), outstream, binary, indent
343 );
344 FBX::Node::WritePropertyNode(
345 "FBXVersion", int32_t(EXPORT_VERSION_INT), outstream, binary, indent
346 );
347 if (binary) {
348 FBX::Node::WritePropertyNode(
349 "EncryptionType", int32_t(0), outstream, binary, indent
350 );
351 }
352
353 FBX::Node CreationTimeStamp("CreationTimeStamp");
354 time_t rawtime;
355 time(&rawtime);
356 struct tm * now = localtime(&rawtime);
357 CreationTimeStamp.AddChild("Version", int32_t(1000));
358 CreationTimeStamp.AddChild("Year", int32_t(now->tm_year + 1900));
359 CreationTimeStamp.AddChild("Month", int32_t(now->tm_mon + 1));
360 CreationTimeStamp.AddChild("Day", int32_t(now->tm_mday));
361 CreationTimeStamp.AddChild("Hour", int32_t(now->tm_hour));
362 CreationTimeStamp.AddChild("Minute", int32_t(now->tm_min));
363 CreationTimeStamp.AddChild("Second", int32_t(now->tm_sec));
364 CreationTimeStamp.AddChild("Millisecond", int32_t(0));
365 CreationTimeStamp.Dump(outstream, binary, indent);
366
367 std::stringstream creator;
368 creator << "Open Asset Import Library (Assimp) " << aiGetVersionMajor()
369 << "." << aiGetVersionMinor() << "." << aiGetVersionRevision();
370 FBX::Node::WritePropertyNode(
371 "Creator", creator.str(), outstream, binary, indent
372 );
373
374 indent = 0;

Callers

nothing calls this directly

Calls 11

aiGetVersionMajorFunction · 0.85
aiGetVersionMinorFunction · 0.85
aiGetVersionRevisionFunction · 0.85
EndPropertiesMethod · 0.80
BeginChildrenMethod · 0.80
DumpMethod · 0.80
strMethod · 0.80
BeginMethod · 0.45
AddChildMethod · 0.45
EndMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected