mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 11:49:59 +01:00
Clone with copy attributes
Two modes of cloning: from the source panel with 'Clone & filter' clones with copy of attributes (geometry, alpha, etc.), from the Insert source panel with 'Internal' source creates a fresh new copy.
This commit is contained in:
16
Mixer.cpp
16
Mixer.cpp
@@ -396,7 +396,7 @@ Source * Mixer::createSourceGroup()
|
||||
return s;
|
||||
}
|
||||
|
||||
Source * Mixer::createSourceClone(const std::string &namesource)
|
||||
Source * Mixer::createSourceClone(const std::string &namesource, bool copy_attributes)
|
||||
{
|
||||
// ready to create a source
|
||||
Source *s = nullptr;
|
||||
@@ -412,9 +412,17 @@ Source * Mixer::createSourceClone(const std::string &namesource)
|
||||
if (origin != session_->end()) {
|
||||
// create a source
|
||||
s = (*origin)->clone();
|
||||
// place clone next to origin
|
||||
s->group(View::MIXING)->translation_ = (*origin)->group(View::MIXING)->translation_;
|
||||
s->group(View::LAYER)->translation_ = (*origin)->group(View::LAYER)->translation_ + LAYER_STEP;
|
||||
|
||||
// if clone operation asks to copy attributes
|
||||
if (copy_attributes) {
|
||||
// place clone next to origin
|
||||
s->group(View::MIXING)->translation_ = (*origin)->group(View::MIXING)->translation_;
|
||||
s->group(View::LAYER)->translation_ = (*origin)->group(View::LAYER)->translation_ + LAYER_STEP;
|
||||
// copy geometry (overlap)
|
||||
s->group(View::GEOMETRY)->translation_ = (*origin)->group(View::GEOMETRY)->translation_;
|
||||
s->group(View::GEOMETRY)->scale_ = (*origin)->group(View::GEOMETRY)->scale_;
|
||||
s->group(View::GEOMETRY)->rotation_ = (*origin)->group(View::GEOMETRY)->rotation_;
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
|
||||
Reference in New Issue
Block a user