VOXEDIT: added editMode() to scene mgr to distinguish between animation and volume mode
parent
199effc3b9
commit
12a7603dc1
|
@ -516,6 +516,7 @@ void SceneManager::resetSceneState() {
|
|||
_animationLayerDirtyState = -1;
|
||||
_animationIdx = 0;
|
||||
_animationUpdate = false;
|
||||
_editMode = EditMode::Volume;
|
||||
_mementoHandler.clearStates();
|
||||
const int layerId = _layerMgr.activeLayer();
|
||||
// push the initial state of the current layer to the memento handler to
|
||||
|
@ -1505,6 +1506,7 @@ bool SceneManager::loadAnimationEntity(const std::string& luaFile) {
|
|||
|
||||
resetSceneState();
|
||||
_animationUpdate = true;
|
||||
_editMode = EditMode::Animation;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,10 @@ static constexpr struct Direction {
|
|||
{"backward", 0, 0, -1}
|
||||
};
|
||||
|
||||
enum class EditMode {
|
||||
Volume, Animation
|
||||
};
|
||||
|
||||
/**
|
||||
* @note The data is shared across all viewports
|
||||
*/
|
||||
|
@ -63,6 +67,7 @@ private:
|
|||
Modifier _modifier;
|
||||
voxel::RawVolume* _copy = nullptr;
|
||||
render::Gizmo _gizmo;
|
||||
EditMode _editMode = EditMode::Volume;
|
||||
|
||||
animation::Character _character;
|
||||
animation::AnimationRenderer _animationRenderer;
|
||||
|
@ -303,6 +308,7 @@ public:
|
|||
* @return @c true if the scene is completely empty
|
||||
*/
|
||||
bool empty() const;
|
||||
EditMode editMode() const;
|
||||
|
||||
static const uint8_t RenderScene = 1u << 0u;
|
||||
static const uint8_t RenderUI = 1u << 1u;
|
||||
|
@ -402,6 +408,10 @@ inline bool SceneManager::empty() const {
|
|||
return _layerMgr.layers().empty();
|
||||
}
|
||||
|
||||
inline EditMode SceneManager::editMode() const {
|
||||
return _editMode;
|
||||
}
|
||||
|
||||
inline const voxel::Voxel& SceneManager::hitCursorVoxel() const {
|
||||
return _hitCursorVoxel;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue