mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-26 17:30:32 -04:00
libobs: Create unique groups when duplicating scene
This commit is contained in:
@@ -284,6 +284,7 @@ OBS::ItemPasteType OBSBasic::getItemPasteType()
|
||||
return OBS::ItemPasteType::Invalid;
|
||||
}
|
||||
|
||||
bool allowPastingReference = true;
|
||||
bool allowPastingDuplicate = true;
|
||||
for (size_t i = clipboard.size(); i > 0; i--) {
|
||||
const size_t idx = i - 1;
|
||||
@@ -296,6 +297,19 @@ OBS::ItemPasteType OBSBasic::getItemPasteType()
|
||||
if (allowPastingDuplicate && obs_source_get_output_flags(strong) & OBS_SOURCE_DO_NOT_DUPLICATE) {
|
||||
allowPastingDuplicate = false;
|
||||
}
|
||||
|
||||
if (allowPastingReference && obs_source_is_group(strong)) {
|
||||
allowPastingReference = false;
|
||||
}
|
||||
}
|
||||
return allowPastingDuplicate ? OBS::ItemPasteType::Both : OBS::ItemPasteType::Reference;
|
||||
|
||||
if (allowPastingReference && allowPastingDuplicate) {
|
||||
return OBS::ItemPasteType::Both;
|
||||
} else if (allowPastingReference) {
|
||||
return OBS::ItemPasteType::Reference;
|
||||
} else if (allowPastingDuplicate) {
|
||||
return OBS::ItemPasteType::Duplicate;
|
||||
}
|
||||
|
||||
return OBS::ItemPasteType::Invalid;
|
||||
}
|
||||
|
||||
+2
-1
@@ -1961,7 +1961,8 @@ obs_scene_t *obs_scene_duplicate(obs_scene_t *scene, const char *name, enum obs_
|
||||
|
||||
for (size_t i = 0; i < items.num; i++) {
|
||||
item = items.array[i];
|
||||
source = make_unique ? dup_child(&items, i, new_scene, make_private) : new_ref(item->source);
|
||||
source = (make_unique || item->is_group) ? dup_child(&items, i, new_scene, make_private)
|
||||
: new_ref(item->source);
|
||||
|
||||
if (source) {
|
||||
struct obs_scene_item *new_item = obs_scene_add(new_scene, source);
|
||||
|
||||
Reference in New Issue
Block a user