MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / exportSequences

Method exportSequences

Engine/source/ts/tsShapeOldRead.cpp:191–291  ·  view source on GitHub ↗

------------------------------------------------- export all sequences -------------------------------------------------

Source from the content-addressed store, hash-verified

189// export all sequences
190//-------------------------------------------------
191void TSShape::exportSequences(Stream * s)
192{
193 // write version
194 s->write(smVersion);
195
196 S32 i,sz;
197
198 // write node names
199 // -- this is how we will map imported sequence nodes to shape nodes
200 sz = nodes.size();
201 s->write(sz);
202 for (i=0;i<nodes.size();i++)
203 writeName(s,nodes[i].nameIndex);
204
205 // legacy write -- write zero objects, don't pretend to support object export anymore
206 s->write(0);
207
208 // on import, we will need to adjust keyframe data based on number of
209 // nodes/objects in this shape...number of nodes can be inferred from
210 // above, but number of objects cannot be. Write that quantity here:
211 s->write(objects.size());
212
213 // write node states -- skip default node states
214 s->write(nodeRotations.size());
215 for (i=0;i<nodeRotations.size();i++)
216 {
217 s->write(nodeRotations[i].x);
218 s->write(nodeRotations[i].y);
219 s->write(nodeRotations[i].z);
220 s->write(nodeRotations[i].w);
221 }
222 s->write(nodeTranslations.size());
223 for (i=0;i<nodeTranslations.size(); i++)
224 {
225 s->write(nodeTranslations[i].x);
226 s->write(nodeTranslations[i].y);
227 s->write(nodeTranslations[i].z);
228 }
229 s->write(nodeUniformScales.size());
230 for (i=0;i<nodeUniformScales.size();i++)
231 s->write(nodeUniformScales[i]);
232 s->write(nodeAlignedScales.size());
233 for (i=0;i<nodeAlignedScales.size();i++)
234 {
235 s->write(nodeAlignedScales[i].x);
236 s->write(nodeAlignedScales[i].y);
237 s->write(nodeAlignedScales[i].z);
238 }
239 s->write(nodeArbitraryScaleRots.size());
240 for (i=0;i<nodeArbitraryScaleRots.size();i++)
241 {
242 s->write(nodeArbitraryScaleRots[i].x);
243 s->write(nodeArbitraryScaleRots[i].y);
244 s->write(nodeArbitraryScaleRots[i].z);
245 s->write(nodeArbitraryScaleRots[i].w);
246 }
247 for (i=0;i<nodeArbitraryScaleFactors.size();i++)
248 {

Callers

nothing calls this directly

Calls 2

writeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected