MCPcopy Create free account
hub / github.com/MrKepzie/Natron / initialize

Method initialize

Gui/ProjectGuiSerialization.cpp:60–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58#include "Gui/ViewerTab.h"
59
60NATRON_NAMESPACE_ENTER
61
62void
63ProjectGuiSerialization::initialize(const ProjectGui* projectGui)
64{
65 NodesList activeNodes;
66
67 projectGui->getInternalProject()->getActiveNodesExpandGroups(&activeNodes);
68
69 _serializedNodes.clear();
70 for (NodesList::iterator it = activeNodes.begin(); it != activeNodes.end(); ++it) {
71 boost::shared_ptr<NodeGuiI> nodegui_i = (*it)->getNodeGui();
72 if (!nodegui_i) {
73 continue;
74 }
75 NodeGuiPtr nodegui = boost::dynamic_pointer_cast<NodeGui>(nodegui_i);
76
77 if ( nodegui->isVisible() ) {
78 boost::shared_ptr<NodeCollection> isInCollection = (*it)->getGroup();
79 NodeGroup* isCollectionAGroup = dynamic_cast<NodeGroup*>( isInCollection.get() );
80 if (!isCollectionAGroup) {
81 ///Nodes within a group will be serialized recursively in the node group serialization
82 NodeGuiSerialization state;
83 nodegui->serialize(&state);
84 _serializedNodes.push_back(state);
85 }
86 ViewerInstance* viewer = (*it)->isEffectViewer();
87 if (viewer) {
88 ViewerTab* tab = projectGui->getGui()->getViewerTabForInstance(viewer);
89 assert(tab);
90 if (tab) {
91 ViewerGL* v = tab->getViewer();
92 if (v) {
93 ViewerData viewerData;
94 double zoompar;
95 v->getProjection(&viewerData.zoomLeft, &viewerData.zoomBottom, &viewerData.zoomFactor, &zoompar);
96 viewerData.userRoI = v->getUserRegionOfInterest();
97 viewerData.userRoIenabled = v->isUserRegionOfInterestEnabled();
98 viewerData.isClippedToProject = tab->isClippedToProject();
99 viewerData.autoContrastEnabled = tab->isAutoContrastEnabled();
100 viewerData.gain = tab->getGain();
101 viewerData.gamma = tab->getGamma();
102 viewerData.colorSpace = tab->getColorSpace();
103 viewerData.channels = tab->getChannelsString();
104 viewerData.renderScaleActivated = tab->getRenderScaleActivated();
105 viewerData.mipMapLevel = tab->getMipMapLevel();
106 viewerData.zoomOrPanSinceLastFit = tab->getZoomOrPannedSinceLastFit();
107 viewerData.wipeCompositingOp = (int)tab->getCompositingOperator();
108 viewerData.leftToolbarVisible = tab->isLeftToolbarVisible();
109 viewerData.rightToolbarVisible = tab->isRightToolbarVisible();
110 viewerData.topToolbarVisible = tab->isTopToolbarVisible();
111 viewerData.infobarVisible = tab->isInfobarVisible();
112 viewerData.playerVisible = tab->isPlayerVisible();
113 viewerData.timelineVisible = tab->isTimelineVisible();
114 viewerData.checkerboardEnabled = tab->isCheckerboardEnabled();
115 viewerData.isFullFrameProcessEnabled = tab->isFullFrameProcessingEnabled();
116 viewerData.fps = tab->getDesiredFps();
117 viewerData.fpsLocked = tab->isFPSLocked();

Callers

nothing calls this directly

Calls 15

isClippedToProjectMethod · 0.80
getColorSpaceMethod · 0.80
getChannelsStringMethod · 0.80
isLeftToolbarVisibleMethod · 0.80
isRightToolbarVisibleMethod · 0.80
isTopToolbarVisibleMethod · 0.80
isInfobarVisibleMethod · 0.80

Tested by

no test coverage detected