MCPcopy Create free account
hub / github.com/Tencent/libpag / CheckLayerNum

Function CheckLayerNum

exporter/src/export/ExportVerify.cpp:263–284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261}
262
263static void CheckLayerNum(std::shared_ptr<PAGExportSession> session,
264 std::vector<pag::Composition*>& compositions) {
265 constexpr size_t maxLayerNum = 60;
266
267 size_t layerNum = 0;
268 for (auto composition : compositions) {
269 if (composition->type() != pag::CompositionType::Vector) {
270 layerNum++;
271 continue;
272 }
273 for (auto layer : static_cast<pag::VectorComposition*>(composition)->layers) {
274 if (layer->type() == pag::LayerType::PreCompose) {
275 continue;
276 }
277 layerNum++;
278 }
279 }
280
281 if (layerNum > maxLayerNum) {
282 session->pushWarning(AlertInfoType::LayerNum);
283 }
284}
285
286static void ZeroingTimeRemapOffset(pag::AnimatableProperty<pag::Frame>* timeRemap) {
287 auto keyFrames = timeRemap->keyframes;

Callers 1

CheckBeforeExportFunction · 0.85

Calls 2

typeMethod · 0.45
pushWarningMethod · 0.45

Tested by

no test coverage detected