diff options
9 files changed, 89 insertions, 89 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/ClientDataModelBridge/ClientDataModelBridge.cpp b/src/Authoring/Client/Code/Core/Doc/ClientDataModelBridge/ClientDataModelBridge.cpp index e839b1db..f69a9733 100644 --- a/src/Authoring/Client/Code/Core/Doc/ClientDataModelBridge/ClientDataModelBridge.cpp +++ b/src/Authoring/Client/Code/Core/Doc/ClientDataModelBridge/ClientDataModelBridge.cpp @@ -94,7 +94,6 @@ CClientDataModelBridge::CClientDataModelBridge( , m_Alias(inDefinitions->m_Alias) , m_Path(inDefinitions->m_Path) , m_Lightmaps(inDefinitions->m_Lightmaps) - , m_CacheEnabled(false) { } @@ -321,6 +320,9 @@ qt3dsdm::Qt3DSDMPropertyHandle CClientDataModelBridge::getVariantsProperty(int i if (instanceType == OBJTYPE_MODEL) return m_Model.m_variants; + if (instanceType == OBJTYPE_GROUP) + return m_Group.m_variants; + return 0; } diff --git a/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp b/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp index d80ce37b..febacc42 100644 --- a/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp +++ b/src/Authoring/Client/Code/Core/Doc/IComposerSerializer.cpp @@ -1612,9 +1612,10 @@ struct SComposerSerializerImpl : public IComposerSerializer IDOMWriter::Scope __instanceScope(inWriter, theType->wide_str()); inWriter.Att(L"id", GetInstanceId(inInstance)); - // for objects with a 'variants' property (layers and models) save the variants property - // under the <Graph> node - if (theType.getValue() == L"Layer" || theType.getValue() == L"Model") { + // For objects with a 'variants' property (layers, models and groups) save the variants + // property under the <Graph> node. + if (theType.getValue() == L"Layer" || theType.getValue() == L"Model" + || theType.getValue() == L"Group") { auto prop = m_propertySystem.GetAggregateInstancePropertyByName(inInstance, L"variants"); SValue sVal; diff --git a/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.h b/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.h index aed93159..ca82ca7d 100644 --- a/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.h +++ b/src/Authoring/Client/Code/Core/Utility/StudioObjectTypes.h @@ -41,38 +41,42 @@ // enum EStudioObjectType { - OBJTYPE_UNKNOWN = 0x00000000, - OBJTYPE_SCENE = 0x00000001, - OBJTYPE_LAYER = 0x00000002, - OBJTYPE_BEHAVIOR = 0x00000004, - OBJTYPE_MATERIAL = 0x00000008, - OBJTYPE_CAMERA = 0x00000010, - OBJTYPE_LIGHT = 0x00000020, - OBJTYPE_MODEL = 0x00000040, - OBJTYPE_GROUP = 0x00000080, - OBJTYPE_IMAGE = 0x00000400, - OBJTYPE_TEXT = 0x00001000, - OBJTYPE_COMPONENT = 0x00002000, - OBJTYPE_SLIDE = 0x00004000, - OBJTYPE_EFFECT = 0x00008000, - OBJTYPE_RENDERPLUGIN = 0x00010000, - OBJTYPE_CUSTOMMATERIAL = 0x00020000, - OBJTYPE_REFERENCEDMATERIAL = 0x00040000, - OBJTYPE_GUIDE = 0x00080000, - OBJTYPE_ALIAS = 0x00100000, - OBJTYPE_PATH = 0x00200000, - OBJTYPE_PATHANCHORPOINT = 0x00400000, - OBJTYPE_SUBPATH = 0x00800000, - OBJTYPE_SOUND = 0x01000000, - OBJTYPE_LIGHTMAPS = 0x02000000, - OBJTYPE_DATAINPUT = 0x04000000, - OBJTYPE_PRESENTATION = 0x08000000, - OBJTYPE_PROJECT = 0x10000000, - OBJTYPE_QML_STREAM = 0x20000000, - OBJTYPE_MATERIALDATA = 0x40000000, + OBJTYPE_UNKNOWN = 0x00000000, + OBJTYPE_SCENE = 0x00000001, + OBJTYPE_LAYER = 0x00000002, + OBJTYPE_BEHAVIOR = 0x00000004, + OBJTYPE_MATERIAL = 0x00000008, + OBJTYPE_CAMERA = 0x00000010, + OBJTYPE_LIGHT = 0x00000020, + OBJTYPE_MODEL = 0x00000040, + OBJTYPE_GROUP = 0x00000080, + OBJTYPE_IMAGE = 0x00000100, + OBJTYPE_TEXT = 0x00000200, + OBJTYPE_COMPONENT = 0x00000400, + OBJTYPE_SLIDE = 0x00000800, + OBJTYPE_EFFECT = 0x00001000, + OBJTYPE_RENDERPLUGIN = 0x00002000, + OBJTYPE_CUSTOMMATERIAL = 0x00004000, + OBJTYPE_REFERENCEDMATERIAL = 0x00008000, + OBJTYPE_GUIDE = 0x00010000, + OBJTYPE_ALIAS = 0x00020000, + OBJTYPE_PATH = 0x00040000, + OBJTYPE_PATHANCHORPOINT = 0x00080000, + OBJTYPE_SUBPATH = 0x00100000, + OBJTYPE_SOUND = 0x00200000, + OBJTYPE_LIGHTMAPS = 0x00400000, + OBJTYPE_DATAINPUT = 0x00800000, + OBJTYPE_PRESENTATION = 0x01000000, + OBJTYPE_PROJECT = 0x02000000, + OBJTYPE_QML_STREAM = 0x04000000, + OBJTYPE_MATERIALDATA = 0x08000000, // filters - OBJTYPE_IS_VARIANT = OBJTYPE_LAYER | OBJTYPE_MODEL + OBJTYPE_IS_VARIANT = OBJTYPE_LAYER | OBJTYPE_MODEL | OBJTYPE_GROUP, + OBJTYPE_IS_MATERIAL = OBJTYPE_MATERIAL | OBJTYPE_CUSTOMMATERIAL | OBJTYPE_REFERENCEDMATERIAL, + OBJTYPE_IS_SINGULAR = OBJTYPE_SCENE | OBJTYPE_LAYER | OBJTYPE_BEHAVIOR | OBJTYPE_EFFECT + | OBJTYPE_IS_MATERIAL, // Singular: cannot be multiselected + OBJTYPE_IS_UNGROUPABLE = OBJTYPE_IS_SINGULAR | OBJTYPE_IMAGE }; typedef enum { diff --git a/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.cpp b/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.cpp index 842a2884..41aa3365 100644 --- a/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.cpp +++ b/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.cpp @@ -487,14 +487,8 @@ void ComposerTypeDefinitionsHelper::DeriveInstance(IDataCore &inDataCore, } // Container object for all of the object definitions -SComposerObjectDefinitions::SComposerObjectDefinitions( - IDataCore &inCore, - IMetaData &inMetaData /*, ISlideCore& inSlideCore, IPropertySystem& inPropertySystem*/) - : m_DataCore(inCore) - , m_MetaData(inMetaData) - //, m_SlideCore( inSlideCore ) - //, m_PropertySystem( inPropertySystem ) - , m_Typed(inCore, inMetaData, inCore.CreateInstance()) +SComposerObjectDefinitions::SComposerObjectDefinitions(IDataCore &inCore, IMetaData &inMetaData) + : m_Typed(inCore, inMetaData, inCore.CreateInstance()) , m_Guided(inCore, inMetaData, inCore.CreateInstance()) , m_Named(inCore, inMetaData, inCore.CreateInstance()) , m_SlideOwner(inCore, inMetaData, inCore.CreateInstance()) @@ -523,6 +517,7 @@ SComposerObjectDefinitions::SComposerObjectDefinitions( , m_Path(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Node) , m_PathAnchorPoint(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset) , m_SubPath(inCore, inMetaData, inCore.CreateInstance(), m_Typed, m_Asset) + , m_DataCore(inCore) { } diff --git a/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.h b/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.h index f5db0e38..d962c137 100644 --- a/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.h +++ b/src/Authoring/QT3DSDM/Systems/Qt3DSDMComposerTypeDefinitions.h @@ -66,7 +66,7 @@ class IPropertySystem; HANDLE_COMPOSER_OBJECT_TYPE(Effect, ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES) \ HANDLE_COMPOSER_OBJECT_TYPE(Node, ITERATE_COMPOSER_NODE_PROPERTIES) \ HANDLE_COMPOSER_OBJECT_TYPE(Layer, ITERATE_COMPOSER_LAYER_PROPERTIES) \ - HANDLE_COMPOSER_OBJECT_TYPE(Group, ITERATE_COMPOSER_NO_ADDITIONAL_PROPERTIES) \ + HANDLE_COMPOSER_OBJECT_TYPE(Group, ITERATE_COMPOSER_GROUP_PROPERTIES) \ HANDLE_COMPOSER_OBJECT_TYPE(Model, ITERATE_COMPOSER_MODEL_PROPERTIES) \ HANDLE_COMPOSER_OBJECT_TYPE(Light, ITERATE_COMPOSER_LIGHT_PROPERTIES) \ HANDLE_COMPOSER_OBJECT_TYPE(Camera, ITERATE_COMPOSER_CAMERA_PROPERTIES) \ @@ -239,6 +239,9 @@ class IPropertySystem; HANDLE_COMPOSER_PROPERTY(variants, m_variants, TDataStrPtr, L"") \ HANDLE_COMPOSER_PROPERTY_DUPLICATE(controlledproperty, m_ControlledProperty, TDataStrPtr, L"") +#define ITERATE_COMPOSER_GROUP_PROPERTIES \ + HANDLE_COMPOSER_PROPERTY_DUPLICATE(variants, m_variants, TDataStrPtr, L"") \ + #define ITERATE_COMPOSER_LIGHT_PROPERTIES \ HANDLE_COMPOSER_PROPERTY(lighttype, m_LightType, TDataStrPtr, L"Directional") \ HANDLE_COMPOSER_PROPERTY(scope, m_Scope, SObjectRefType, L"") \ @@ -927,19 +930,15 @@ struct SComposerObjectDefinition<ComposerObjectTypes::SubPath> class SComposerObjectDefinitions { public: - IDataCore &m_DataCore; - IMetaData &m_MetaData; - #define HANDLE_COMPOSER_OBJECT_TYPE(name, propmacro) \ SComposerObjectDefinition<ComposerObjectTypes::name> m_##name; ITERATE_COMPOSER_OBJECT_TYPES #undef HANDLE_COMPOSER_OBJECT_TYPE - SComposerObjectDefinitions( - IDataCore &inDataCore, - IMetaData &inMetaData /*, ISlideCore& inSlideCore, IPropertySystem& inPropertySystem */); + SComposerObjectDefinitions(IDataCore &inDataCore, IMetaData &inMetaData); + SComposerObjectDefinitions() = default; + ~SComposerObjectDefinitions() = default; - //////////////////////////////////////////////////////////////////////////////////////////////// // RTTI API bool IsA(Qt3DSDMInstanceHandle inInstance, ComposerObjectTypes::Enum inType); // Could easily return None, meaning we can't identify the object type. @@ -948,9 +947,8 @@ public: ComposerObjectTypes::Enum GetType(Qt3DSDMInstanceHandle inInstance); Qt3DSDMInstanceHandle GetInstanceForType(ComposerObjectTypes::Enum inType); - SComposerObjectDefinitions() = default; - ~SComposerObjectDefinitions() = default; private: + IDataCore &m_DataCore; SComposerObjectDefinitions(const SComposerObjectDefinitions&) = delete; SComposerObjectDefinitions& operator=(const SComposerObjectDefinitions&) = delete; }; diff --git a/src/Authoring/Studio/Application/StudioApp.cpp b/src/Authoring/Studio/Application/StudioApp.cpp index 789dd4ba..29129931 100644 --- a/src/Authoring/Studio/Application/StudioApp.cpp +++ b/src/Authoring/Studio/Application/StudioApp.cpp @@ -1056,18 +1056,12 @@ bool CStudioApp::canGroupSelectedObjects() const auto bridge = m_core->GetDoc()->GetStudioSystem()->GetClientDataModelBridge(); EStudioObjectType type = bridge->GetObjectType(first); - const int ungroupableTypes = OBJTYPE_SCENE | OBJTYPE_LAYER | OBJTYPE_MATERIAL - | OBJTYPE_CUSTOMMATERIAL | OBJTYPE_REFERENCEDMATERIAL | OBJTYPE_BEHAVIOR - | OBJTYPE_EFFECT | OBJTYPE_IMAGE; - - if (type & ungroupableTypes) + if (type & OBJTYPE_IS_UNGROUPABLE) return false; - if (type == OBJTYPE_COMPONENT) { - // Components can't be grouped if they are the root of currently active time context - if (bridge->IsActiveComponent(first)) - return false; - } + // Components can't be grouped if they are the root of currently active time context + if (type == OBJTYPE_COMPONENT && bridge->IsActiveComponent(first)) + return false; // All items must either be on master slide or not be on master slide bool isMaster = bridge->IsMaster(first); diff --git a/src/Authoring/Studio/DragAndDrop/FileDropSource.cpp b/src/Authoring/Studio/DragAndDrop/FileDropSource.cpp index 95c1b862..85bc1962 100644 --- a/src/Authoring/Studio/DragAndDrop/FileDropSource.cpp +++ b/src/Authoring/Studio/DragAndDrop/FileDropSource.cpp @@ -55,15 +55,12 @@ bool CFileDropSource::ValidateTarget(CDropTarget *inTarget) EStudioObjectType targetType = (EStudioObjectType)inTarget->GetObjectType(); if (m_ObjectType & (OBJTYPE_PRESENTATION | OBJTYPE_QML_STREAM)) { SetHasValidTarget(!bridge->isDefaultMaterial(inTarget->GetInstance()) - && (targetType & (OBJTYPE_LAYER | OBJTYPE_MATERIAL - | OBJTYPE_CUSTOMMATERIAL | OBJTYPE_REFERENCEDMATERIAL - | OBJTYPE_IMAGE))); + && (targetType & (OBJTYPE_LAYER | OBJTYPE_IS_MATERIAL | OBJTYPE_IMAGE))); return m_HasValidTarget; } if (m_ObjectType == OBJTYPE_MATERIALDATA) { - SetHasValidTarget(targetType & (OBJTYPE_MATERIAL | OBJTYPE_CUSTOMMATERIAL - | OBJTYPE_REFERENCEDMATERIAL)); + SetHasValidTarget(targetType & OBJTYPE_IS_MATERIAL); return m_HasValidTarget; } @@ -73,8 +70,7 @@ bool CFileDropSource::ValidateTarget(CDropTarget *inTarget) // allow material, image, and scene as valid targets for image drops if (!targetIsValid && m_FileType == DocumentEditorFileType::Image) { - if (targetType & (OBJTYPE_MATERIAL | OBJTYPE_CUSTOMMATERIAL | OBJTYPE_REFERENCEDMATERIAL - | OBJTYPE_IMAGE)) { + if (targetType & (OBJTYPE_IS_MATERIAL | OBJTYPE_IMAGE)) { // Default material shouldn't be targeatable targetIsValid = !bridge->isDefaultMaterial(inTarget->GetInstance()); } else { @@ -233,8 +229,7 @@ CCmd *CFileDropSource::GenerateAssetCommand(qt3dsdm::Qt3DSDMInstanceHandle inTar ->SetInstancePropertyValueAsRenderable(inTarget, propHandle, src); } } - } else if (rowType & (OBJTYPE_MATERIAL | OBJTYPE_CUSTOMMATERIAL - | OBJTYPE_REFERENCEDMATERIAL)) { // Drop on a Material + } else if (rowType & OBJTYPE_IS_MATERIAL) { // Drop on a Material // if this is a ref material, update the material it references qt3dsdm::Qt3DSDMInstanceHandle refInstance = 0; if (rowType == OBJTYPE_REFERENCEDMATERIAL) { @@ -277,13 +272,12 @@ CCmd *CFileDropSource::GenerateAssetCommand(qt3dsdm::Qt3DSDMInstanceHandle inTar ->addRectFromSource(src, inSlide, isPres, thePoint, theStartTime); } } else if (isMatData) { - if (rowType == OBJTYPE_REFERENCEDMATERIAL || rowType == OBJTYPE_MATERIAL - || rowType == OBJTYPE_CUSTOMMATERIAL) { + if (rowType & OBJTYPE_IS_MATERIAL) { if (!QFileInfo(m_FilePath).completeBaseName().contains(QLatin1Char('#'))) { const auto doc = g_StudioApp.GetCore()->GetDoc(); { // Scope for the ScopedDocumentEditor Q3DStudio::ScopedDocumentEditor sceneEditor( - Q3DStudio::SCOPED_DOCUMENT_EDITOR(*doc, QString())); + Q3DStudio::SCOPED_DOCUMENT_EDITOR(*doc, {})); QString name; QMap<QString, QString> values; QMap<QString, QMap<QString, QString>> textureValues; diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowManager.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowManager.cpp index d7b34a86..041b651d 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowManager.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowManager.cpp @@ -219,16 +219,13 @@ void RowManager::selectRow(RowTree *row, bool multiSelect) row = row->parentRow(); if (multiSelect && m_selectedRows.size() > 0) { - // Do not allow certain object types into multiselection - const EStudioObjectType rowType = row->rowType(); - const int singularType = OBJTYPE_SCENE | OBJTYPE_MATERIAL | OBJTYPE_LAYER - | OBJTYPE_BEHAVIOR | OBJTYPE_EFFECT; - if (singularType & rowType || singularType & m_selectedRows[0]->rowType()) + // Do not allow singular object types into multiselection + if ((row->rowType() | m_selectedRows[0]->rowType()) & OBJTYPE_IS_SINGULAR) return; } - Qt3DSDMTimelineItemBinding *binding = - static_cast<Qt3DSDMTimelineItemBinding *>(row->getBinding()); + Qt3DSDMTimelineItemBinding *binding + = static_cast<Qt3DSDMTimelineItemBinding *>(row->getBinding()); if (binding) binding->SetSelected(multiSelect); } diff --git a/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml b/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml index 0e003008..2df33774 100644 --- a/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml +++ b/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml @@ -62,7 +62,20 @@ <Property name="eyeball" formalName="Visible" description="Item visibility" type="Boolean" default="True" hidden="False" controllable="True" /> </Effect> <Group> - <Property name="sourcepath" formalName="Import" description="Path to the source of this group" type="Import" /> + <!-- Basic Properties --> + <Property name="name" formalName="Name" type="String" default="Model" category="Basic Properties" description="Object name" /> + <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" description="Item visibility" /> + <Property name="position" formalName="Position" type="Vector" category="Basic Properties" description="Location in local space" /> + <Property name="rotation" formalName="Rotation" type="Rotation" category="Basic Properties" description="Rotation around local axes" /> + <Property name="scale" formalName="Scale" type="Vector" default="1 1 1" category="Basic Properties" description="Size adjustments along local axes" /> + <Property name="pivot" formalName="Pivot" type="Vector" category="Basic Properties" description="Offset of the contents away from the local center" /> + <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Basic Properties" /> + + <!-- Variant Tags --> + <Property name="variants" type="String" animatable="False" category="Variant Tags" /> + + <!-- Import --> + <Property name="sourcepath" formalName="Import" type="Import" category="Import" description="Path to the source of this group" /> </Group> <Image> <!--Images and materials don't have lifetimes, so we use a value that we know just won't cause any issues--> @@ -205,13 +218,12 @@ </Layer> <Light> <!-- Basic Properties --> - <Property name="name" formalName="Name" description="Object name" type="String" default="Light" hidden="False" category="Basic Properties" /> - <Property name="eyeball" formalName="Visible" description="Item visibility" type="Boolean" default="True" hidden="False" controllable="True" category="Basic Properties" /> - <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" hidden="True" category="Basic Properties" /> - <Property name="position" formalName="Position" description="Location in local space" type="Vector" category="Basic Properties" /> - <Property name="rotation" formalName="Rotation" description="Rotation around local axes" type="Rotation" category="Basic Properties" /> - <Property name="scale" formalName="Scale" description="Size adjustments along local axes" type="Vector" default="1 1 1" category="Basic Properties" /> - <Property name="pivot" formalName="Pivot" description="Offset of the contents away from the local center" type="Vector" category="Basic Properties" /> + <Property name="name" formalName="Name" type="String" default="Light" category="Basic Properties" description="Object name" /> + <Property name="eyeball" formalName="Visible" type="Boolean" default="True" category="Basic Properties" description="Item visibility" controllable="True" /> + <Property name="position" formalName="Position" type="Vector" category="Basic Properties" description="Location in local space" /> + <Property name="rotation" formalName="Rotation" type="Rotation" category="Basic Properties" description="Rotation around local axes" /> + <Property name="scale" formalName="Scale" type="Vector" default="1 1 1" category="Basic Properties" description="Size adjustments along local axes" /> + <Property name="pivot" formalName="Pivot" type="Vector" category="Basic Properties" description="Offset of the contents away from the local center" /> <!-- Light Properties --> <Property name='scope' formalName="Scope" description="Portion of the scene graph lit by this\nlight; no value results in entire layer\nbeing affected." type='ObjectRef' category="Light Properties" /> @@ -241,6 +253,9 @@ <Property name="shdwbias" formalName="Shadow Depth Bias" description="Slight offset to avoid self-shadowing\nartifacts" default="0" min="-1.0" max="1.0" category="Shadow" /> <Property name="shdwmapfar" formalName="Shadow Far Clip" description="Affects the maximum distance for the shadow\ndepth map" default="5000" category="Shadow" /> <Property name="shdwmapfov" formalName="Shadow Field of View" description="Affects the field of view of the shadow\ncamera" default="90" min="1" max="179" hidden="True" category="Shadow" /> + + <!-- Hidden props --> + <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" category="Basic Properties" hidden="True" /> </Light> <MaterialBase> <Property name="name" formalName="Name" description="Object name" type="String" default="Material" hidden="False" category="Basic Properties" /> |