MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / onNodeLoaded

Method onNodeLoaded

Source/Engine/Visject/VisjectGraph.h:139–182  ·  view source on GitHub ↗

[Graph]

Source from the content-addressed store, hash-verified

137public:
138 // [Graph]
139 bool onNodeLoaded(NodeType* n) override
140 {
141 switch (n->GroupID)
142 {
143 // Tools
144 case 7:
145 switch (n->TypeID)
146 {
147 // Curves
148#define SETUP_CURVE(id, curves, access) \
149 case id: \
150 { \
151 n->Data.Curve.CurveIndex = curves.Count(); \
152 auto& curve = curves.AddOne(); \
153 const int32 keyframesCount = n->Values[0].AsInt; \
154 auto& keyframes = curve.GetKeyframes(); \
155 keyframes.Resize(keyframesCount); \
156 for (int32 i = 0; i < keyframesCount; i++) \
157 { \
158 const int32 idx = i * 4; \
159 auto& keyframe = keyframes[i]; \
160 keyframe.Time = n->Values[idx + 1].AsFloat; \
161 keyframe.Value = n->Values[idx + 2].access; \
162 keyframe.TangentIn = n->Values[idx + 3].access; \
163 keyframe.TangentOut = n->Values[idx + 4].access; \
164 } \
165 break; \
166 }
167 SETUP_CURVE(12, FloatCurves, AsFloat)
168 SETUP_CURVE(13, Float2Curves, AsFloat2())
169 SETUP_CURVE(14, Float3Curves, AsFloat3())
170 SETUP_CURVE(15, Float4Curves, AsFloat4())
171#undef SETUP_CURVE
172 // Get Gameplay Global
173 case 16:
174 n->Assets.Resize(1);
175 n->Assets[0] = ::LoadAsset((Guid)n->Values[0], Asset::TypeInitializer);
176 break;
177 }
178 }
179
180 // Base
181 return Base::onNodeLoaded(n);
182 }
183};
184
185/// <summary>

Callers

nothing calls this directly

Calls 2

LoadAssetFunction · 0.85
ResizeMethod · 0.45

Tested by

no test coverage detected