diff options
4 files changed, 118 insertions, 53 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp index dec38cea..d4fdc306 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.cpp @@ -623,6 +623,31 @@ QString InspectorControlModel::getDefaultMaterialString() const return QObject::tr("Default"); } +bool InspectorControlModel::isGroupCollapsed(int groupIdx) const +{ + const auto inspectable = dynamic_cast<Qt3DSDMInspectable *>(m_inspectableBase); + if (inspectable && groupIdx > -1 && groupIdx < m_groupElements.size()) { + auto instance = inspectable->GetGroupInstance(0); + + if (m_collapseMap.contains(instance)) + return m_collapseMap[instance].contains(groupIdx); + } + + return false; +} + +void InspectorControlModel::updateGroupCollapseState(int groupIdx, bool isCollapsed) +{ + const auto inspectable = dynamic_cast<Qt3DSDMInspectable *>(m_inspectableBase); + if (inspectable && groupIdx > -1 && groupIdx < m_groupElements.size()) { + auto instance = inspectable->GetGroupInstance(0); + if (isCollapsed) + m_collapseMap[instance][groupIdx] = true; + else + m_collapseMap[instance].remove(groupIdx); + } +} + void InspectorControlModel::updateFontValues(InspectorControlBase *element) const { // Find if there are any font items and update the values of those diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h index 561d8af1..e329dba1 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlModel.h @@ -153,6 +153,8 @@ public: Q_INVOKABLE bool isDefaultMaterial() const; Q_INVOKABLE void addMaterial(); Q_INVOKABLE void duplicateMaterial(); + Q_INVOKABLE bool isGroupCollapsed(int groupIdx) const; + Q_INVOKABLE void updateGroupCollapseState(int groupIdx, bool state); private: void onSlideRearranged(const qt3dsdm::Qt3DSDMSlideHandle &inMaster, int inOldIndex, @@ -197,6 +199,8 @@ private: qt3dsdm::SValue m_previouslyCommittedValue; + QHash<int, QHash<int, bool> > m_collapseMap; + QString getBasicMaterialString() const; QString getAnimatableMaterialString() const; QString getReferencedMaterialString() const; diff --git a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml index 9a9c0c01..b2e8b286 100644 --- a/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml +++ b/src/Authoring/Studio/Palettes/Inspector/InspectorControlView.qml @@ -205,12 +205,45 @@ Rectangle { width: parent.width - x spacing: 4 - StyledLabel { - text: model.title + Rectangle { // group header + x: -10 + width: delegateItem.width + height: 25 + color: "#111111" + + StyledLabel { + x: 30 + text: model.title + anchors.verticalCenter: parent.verticalCenter + } + + Image { + id: collapseButton + x: 10 + anchors.verticalCenter: parent.verticalCenter + source: { + _resDir + (groupItems.visible ? "arrow_down.png" : "arrow.png") + } + } + + MouseArea { + id: collapseButtonMouseArea + anchors.fill: parent + onClicked: { + if (mouse.button === Qt.LeftButton) { + groupItems.visible = !groupItems.visible; + _inspectorModel.updateGroupCollapseState(indexOfThisDelegate, + !groupItems.visible) + } + } + } } Column { spacing: 4 + id: groupItems + + visible: !_inspectorModel.isGroupCollapsed(indexOfThisDelegate) Repeater { model: delegateItem.values diff --git a/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml b/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml index 992b9164..b376d272 100644 --- a/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml +++ b/src/Runtime/res/DataModelMetadata/en-us/MetaData.xml @@ -84,118 +84,121 @@ <Property name="subpresentation" formalName="Sub-Presentation" description="Presentation or QML stream\nto use instead of the image" type="Renderable" /> </Image> <Layer> - <Property name="name" formalName="Name" description="Object name" type="String" default="Layer" hidden="False" /> - <Property name="eyeball" formalName="Visible" description="Item visibility" type="Boolean" default="True" hidden="False" controllable="True" /> - <Property name="disabledepthtest" formalName="Disable Depth Test" description="Optimize render speed for layers with\nmostly transparent objects?" type="Boolean" animatable="False"/> - <Property name="disabledepthprepass" formalName="Disable Depth Prepass" description="Optimize render speed for layers\nwith low depth complexity" type="Boolean" animatable="False"/> - <Property name="progressiveaa" formalName="Progressive AA" description="Improves the visual quality when no\nitems are moving" list="None:2x:4x:8x" default="None" /> - <Property name="multisampleaa" formalName="Multisample AA" description="Improves geometry quality, e.g.\nsilhouettes." list="None:2x:4x:SSAA" default="None" /> - <Property name="temporalaa" formalName="Temporal AA" description="Improve overall quality using camera\njittering and frame blending?" type="Boolean" default="False"/> - <Property name="background" formalName="Layer Background" description="The color to use for the layer\neach frame" list="Transparent:SolidColor:Unspecified" default="Transparent" /> - <Property name="backgroundcolor" formalName="Background Color" description="The background color for the layer" type="Color" animatable="False"> + <!-- Basic Properties --> + <Property name="name" formalName="Name" description="Object name" type="String" default="Layer" 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="background" formalName="Layer Background" description="The color to use for the layer\neach frame" list="Transparent:SolidColor:Unspecified" default="Transparent" category="Basic Properties" /> + <Property name="backgroundcolor" formalName="Background Color" description="The background color for the layer" type="Color" animatable="False" category="Basic Properties"> <ShowIfEqual property="background" value="SolidColor"/> </Property> - <Property name="blendtype" formalName="Blend Mode" list="Normal:Screen:Multiply:Add:Subtract:*Overlay:*ColorBurn:*ColorDodge" default="Normal" description="Mode of blending between this layer\nand layers below. Modes marked with\n* are available only with HW supporting\nadvanced blending modes." /> - <Property name="horzfields" formalName="Horizontal Fields" description="Properties to use to control the\nhorizontal size and placement" list="Left/Width:Left/Right:Width/Right" default="Left/Width" /> - <Property name="left" formalName="Left" description="Distance between presentation and\nlayer left edges"> + <Property name="blendtype" formalName="Blend Mode" list="Normal:Screen:Multiply:Add:Subtract:*Overlay:*ColorBurn:*ColorDodge" default="Normal" description="Mode of blending between this layer\nand layers below. Modes marked with\n* are available only with HW supporting\nadvanced blending modes." category="Basic Properties" /> + <Property name="sourcepath" formalName="Sub-Presentation" description="Presentation or QML stream to\nrender for this layer" type="Renderable" controllable="True" category="Basic Properties" /> + + <!-- Antialiasing --> + <Property name="progressiveaa" formalName="Progressive AA" description="Improves the visual quality when no\nitems are moving" list="None:2x:4x:8x" default="None" category="Antialiasing" /> + <Property name="multisampleaa" formalName="Multisample AA" description="Improves geometry quality, e.g.\nsilhouettes." list="None:2x:4x:SSAA" default="None" category="Antialiasing" /> + <Property name="temporalaa" formalName="Temporal AA" description="Improve overall quality using camera\njittering and frame blending?" type="Boolean" default="False" category="Antialiasing" /> + + <!-- Size --> + <Property name="horzfields" formalName="Horizontal Fields" description="Properties to use to control the\nhorizontal size and placement" list="Left/Width:Left/Right:Width/Right" default="Left/Width" category="Size" /> + <Property name="left" formalName="Left" description="Distance between presentation and\nlayer left edges" category="Size"> <ShowIfEqual property="horzfields" value="Left/Width"/> <ShowIfEqual property="horzfields" value="Left/Right"/> </Property> - <Property name="leftunits" formalName="Left Units" description="Left distance is percent of overall\nwidth or absolute pixels" list="percent:pixels" default="percent"> + <Property name="leftunits" formalName="Left Units" description="Left distance is percent of overall\nwidth or absolute pixels" list="percent:pixels" default="percent" category="Size"> <ShowIfEqual property="horzfields" value="Left/Width"/> <ShowIfEqual property="horzfields" value="Left/Right"/> </Property> - <Property name="width" formalName="Width" description="Overall layer width" default="100"> + <Property name="width" formalName="Width" description="Overall layer width" default="100" category="Size"> <ShowIfEqual property="horzfields" value="Left/Width"/> <ShowIfEqual property="horzfields" value="Width/Right"/> </Property> - <Property name="widthunits" formalName="Width Units" description="Width is percent of overall width\nor absolute pixels" list="percent:pixels" default="percent"> + <Property name="widthunits" formalName="Width Units" description="Width is percent of overall width\nor absolute pixels" list="percent:pixels" default="percent" category="Size"> <ShowIfEqual property="horzfields" value="Left/Width"/> <ShowIfEqual property="horzfields" value="Width/Right"/> </Property> - <Property name="right" formalName="Right" description="Distance between presentation and layer\nright edges"> + <Property name="right" formalName="Right" description="Distance between presentation and layer\nright edges" category="Size"> <ShowIfEqual property="horzfields" value="Left/Right"/> <ShowIfEqual property="horzfields" value="Width/Right"/> </Property> - <Property name="rightunits" formalName="Right Units" description="Right distance is percent of overall\nwidth or absolute pixels" list="percent:pixels" default="percent"> + <Property name="rightunits" formalName="Right Units" description="Right distance is percent of overall\nwidth or absolute pixels" list="percent:pixels" default="percent" category="Size"> <ShowIfEqual property="horzfields" value="Left/Right"/> <ShowIfEqual property="horzfields" value="Width/Right"/> </Property> - <Property name="vertfields" formalName="Vertical Fields" description="Properties to use to control the\nvertical size and placement" list="Top/Height:Top/Bottom:Height/Bottom" default="Top/Height" /> - <Property name="top" formalName="Top" description="Distance between presentation and layer\ntop edges."> + <Property name="vertfields" formalName="Vertical Fields" description="Properties to use to control the\nvertical size and placement" list="Top/Height:Top/Bottom:Height/Bottom" default="Top/Height" category="Size" /> + <Property name="top" formalName="Top" description="Distance between presentation and layer\ntop edges." category="Size"> <ShowIfEqual property="vertfields" value="Top/Height"/> <ShowIfEqual property="vertfields" value="Top/Bottom"/> </Property> - <Property name="topunits" formalName="Top Units" description="Top distance is percent of overall\nheight or absolute pixels" list="percent:pixels" default="percent"> + <Property name="topunits" formalName="Top Units" description="Top distance is percent of overall\nheight or absolute pixels" list="percent:pixels" default="percent" category="Size"> <ShowIfEqual property="vertfields" value="Top/Height"/> <ShowIfEqual property="vertfields" value="Top/Bottom"/> </Property> - <Property name="height" formalName="Height" description="Overall layer height." default="100"> + <Property name="height" formalName="Height" description="Overall layer height." default="100" category="Size"> <ShowIfEqual property="vertfields" value="Top/Height"/> <ShowIfEqual property="vertfields" value="Height/Bottom"/> </Property> - <Property name="heightunits" formalName="Height Units" description="Height is percent of overall height\nor absolute pixels" list="percent:pixels" default="percent"> + <Property name="heightunits" formalName="Height Units" description="Height is percent of overall height\nor absolute pixels" list="percent:pixels" default="percent" category="Size"> <ShowIfEqual property="vertfields" value="Top/Height"/> <ShowIfEqual property="vertfields" value="Height/Bottom"/> </Property> - <Property name="bottom" formalName="Bottom" description="Distance between presentation and layer\nbottom edges"> + <Property name="bottom" formalName="Bottom" description="Distance between presentation and layer\nbottom edges" category="Size"> <ShowIfEqual property="vertfields" value="Top/Bottom"/> <ShowIfEqual property="vertfields" value="Height/Bottom"/> </Property> - <Property name="bottomunits" formalName="Bottom Units" description="Bottom distance is percent of overall\nheight or absolute pixels" list="percent:pixels" default="percent"> + <Property name="bottomunits" formalName="Bottom Units" description="Bottom distance is percent of overall\nheight or absolute pixels" list="percent:pixels" default="percent" category="Size"> <ShowIfEqual property="vertfields" value="Top/Bottom"/> <ShowIfEqual property="vertfields" value="Height/Bottom"/> </Property> - <Property name="sourcepath" formalName="Sub-Presentation" description="Presentation or QML stream to\nrender for this layer" type="Renderable" controllable="True" /> - <!-- Restating the node properties so they appear at the bottom of the list because they won't be used quite as much --> - <!--CN - removing properties that may force the layer to render offscreen. We aren't ready to support this feature--> - <Property name="position" formalName="Position" description="Position" type="Vector" hidden="True"/> - <Property name="rotation" formalName="Rotation" description="Rotation" type="Rotation" hidden="True" /> - <Property name="scale" formalName="Scale" description="Scale" type="Vector" default="1 1 1" hidden="True" /> - <Property name="pivot" formalName="Pivot" description="Pivot" type="Vector" hidden="True" /> - <Property name="opacity" formalName="Opacity" min="0" max="100" default="100" hidden="True" /> - <Property name="aostrength" formalName="Ambient Occlusion" description="Amount of ambient occlusion shading\nto apply" min="0" max="100" default="0"> + <!-- Ambient Occlusion --> + <Property name="aostrength" formalName="Ambient Occlusion" description="Amount of ambient occlusion shading\nto apply" min="0" max="100" default="0" category="Ambient Occlusion" > <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="aodistance" formalName="AO Distance" description="Size of the ambient occlusion shading" default="5"> + <Property name="aodistance" formalName="AO Distance" description="Size of the ambient occlusion shading" default="5" category="Ambient Occlusion"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="aosoftness" formalName="AO Softness" description="Magnitude of the blurring used to\nsoften shading" min="0" max="50" default="50"> + <Property name="aosoftness" formalName="AO Softness" description="Magnitude of the blurring used to\nsoften shading" min="0" max="50" default="50" category="Ambient Occlusion"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="aobias" formalName="AO Threshold" description="Remove AO from flat surfaces to\nprevent artifacts" default="0"> + <Property name="aobias" formalName="AO Threshold" description="Remove AO from flat surfaces to\nprevent artifacts" default="0" category="Ambient Occlusion"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="aosamplerate" formalName="AO Sampling Rate" description="Quality of AO sampling" type="Long" default="2" min="2" max="4"> + <Property name="aosamplerate" formalName="AO Sampling Rate" description="Quality of AO sampling" type="Long" default="2" min="2" max="4" category="Ambient Occlusion"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="aodither" formalName="AO Detail" description="Use close-range detail AO" type="Boolean" default="True"> + <Property name="aodither" formalName="AO Detail" description="Use close-range detail AO" type="Boolean" default="True" category="Ambient Occlusion"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="shadowstrength" formalName="Shadow Strength" description="Amount of shadowing to apply" min="0" max="100" default="0" hidden="True"> + <!-- Shadow --> + <Property name="shadowstrength" formalName="Shadow Strength" description="Amount of shadowing to apply" min="0" max="100" default="0" hidden="True" category="Shadow"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="shadowdist" formalName="Shadow Distance" description="Maximum distance to ray march for\nshadows test" default="10" hidden="True"> + <Property name="shadowdist" formalName="Shadow Distance" description="Maximum distance to ray march for\nshadows test" default="10" hidden="True" category="Shadow"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="shadowsoftness" formalName="Shadow Softness" description="Amount of softening of the shadow\nedges" min="0" max="100" default="100" hidden="True"> + <Property name="shadowsoftness" formalName="Shadow Softness" description="Amount of softening of the shadow\nedges" min="0" max="100" default="100" hidden="True" category="Shadow"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="shadowbias" formalName="Shadow Threshold" description="Remove self-shadowing from flat\nsurfaces" default="0" hidden="True"> + <Property name="shadowbias" formalName="Shadow Threshold" description="Remove self-shadowing from flat\nsurfaces" default="0" hidden="True" category="Shadow"> <ShowIfEqual property="sourcepath" value=""/> </Property> - <Property name="lightprobe" formalName="Light Probe" description="Image used for image-based lighting\nand reflections" type="Image" /> - <Property name="probebright" formalName="IBL Brightness" description="Amount of light emitted by the light\nprobe." default="100" /> - <Property name="fastibl" formalName="Fast IBL" description="Use a faster approximation to\nimage-based lighting" type="Boolean" default="True" hidden="True" /> - <Property name="probehorizon" formalName="IBL Horizon Cutoff" description="Upper limit for horizon darkening\nof the light probe" min="-1" max="-0.001" default="-1" /> - <Property name="probefov" formalName="IBL FOV Angle" description="Image source FOV for the case of using\na camera-source as the IBL probe" min="1.0" max="180" default="180" /> - <Property name="lightprobe2" formalName="Secondary Light Probe" description="Image to blend over the primary light\nprobe" type="Image" /> - <Property name="probe2fade" formalName="Probe Crossfade" description="Blend amount between the primary and\nseconary probes" min="0.0" max="1.0" default="1.0" /> - <Property name="probe2window" formalName="Secondary Probe Window" description="Texture-U window size used for the\nmoving window (for scrolling textures)" min="0.01" max="1.0" default="1.0" hidden="True" /> - <Property name="probe2pos" formalName="Secondary Probe Offset" description="Texture-U window offset used for the\nmoving window" default="0.5" hidden="True" /> + <!-- Light Probe --> + <Property name="lightprobe" formalName="Light Probe" description="Image used for image-based lighting\nand reflections" type="Image" category="Light Probe" /> + <Property name="probebright" formalName="IBL Brightness" description="Amount of light emitted by the light\nprobe." default="100" category="Light Probe" /> + <Property name="fastibl" formalName="Fast IBL" description="Use a faster approximation to\nimage-based lighting" type="Boolean" default="True" hidden="True" category="Light Probe" /> + <Property name="probehorizon" formalName="IBL Horizon Cutoff" description="Upper limit for horizon darkening\nof the light probe" min="-1" max="-0.001" default="-1" category="Light Probe" /> + <Property name="probefov" formalName="IBL FOV Angle" description="Image source FOV for the case of using\na camera-source as the IBL probe" min="1.0" max="180" default="180" category="Light Probe" /> + <Property name="lightprobe2" formalName="Secondary Light Probe" description="Image to blend over the primary light\nprobe" type="Image" category="Light Probe" /> + <Property name="probe2fade" formalName="Probe Crossfade" description="Blend amount between the primary and\nseconary probes" min="0.0" max="1.0" default="1.0" category="Light Probe" /> + <Property name="probe2window" formalName="Secondary Probe Window" description="Texture-U window size used for the\nmoving window (for scrolling textures)" min="0.01" max="1.0" default="1.0" hidden="True" category="Light Probe" /> + <Property name="probe2pos" formalName="Secondary Probe Offset" description="Texture-U window offset used for the\nmoving window" default="0.5" hidden="True" category="Light Probe" /> + + <!-- Advanced --> + <Property name="disabledepthtest" formalName="Disable Depth Test" description="Optimize render speed for layers with\nmostly transparent objects?" type="Boolean" animatable="False" category="Advanced" /> + <Property name="disabledepthprepass" formalName="Disable Depth Prepass" description="Optimize render speed for layers\nwith low depth complexity" type="Boolean" animatable="False" category="Advanced" /> </Layer> <Light> <Property name="name" formalName="Name" description="Object name" type="String" default="Light" hidden="False" /> |