mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:19:02 +02:00
Working debugging script with tabs
This commit is contained in:
parent
8cabd1c953
commit
f63b4a64b0
2 changed files with 106 additions and 111 deletions
|
@ -14,8 +14,8 @@ var qml = Script.resolvePath('outline.qml');
|
||||||
var window = new OverlayWindow({
|
var window = new OverlayWindow({
|
||||||
title: 'Outline',
|
title: 'Outline',
|
||||||
source: qml,
|
source: qml,
|
||||||
width: 285,
|
width: 400,
|
||||||
height: 370,
|
height: 400,
|
||||||
});
|
});
|
||||||
window.closed.connect(function() { Script.stop(); });
|
window.closed.connect(function() { Script.stop(); });
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ function update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Selection.addToSelectedItemsList(selectionName, typeName, result.objectID)
|
Selection.addToSelectedItemsList(selectionName, typeName, result.objectID)
|
||||||
print("OUTLINE " + outlineGroupIndex + " picked type: " + result.type + ", id: " + result.objectID);
|
//print("OUTLINE " + outlineGroupIndex + " picked type: " + result.type + ", id: " + result.objectID);
|
||||||
|
|
||||||
prevID = result.objectID;
|
prevID = result.objectID;
|
||||||
prevType = typeName;
|
prevType = typeName;
|
||||||
|
|
|
@ -15,34 +15,14 @@ import "configSlider"
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
property var debugConfig: Render.getConfig("RenderMainView.OutlineDebug")
|
property var debugConfig: Render.getConfig("RenderMainView.OutlineDebug")
|
||||||
property var drawConfig: Render.getConfig("RenderMainView.OutlineEffect0")
|
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
anchors.fill: parent
|
||||||
ComboBox {
|
|
||||||
id: groupBox
|
|
||||||
model: ["Group 0", "Group 1", "Group 2", "Group 3", "Group 4"]
|
|
||||||
Timer {
|
|
||||||
id: postpone
|
|
||||||
interval: 100; running: false; repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
paramWidgetLoader.sourceComponent = paramWidgets;
|
|
||||||
sendToScript(currentIndex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
// This is a hack to be sure the widgets below properly reflect the change of index: delete the Component
|
|
||||||
// by setting the loader source to Null and then recreate it 100ms later
|
|
||||||
root.drawConfig = Render.getConfig("RenderMainView.OutlineEffect"+currentIndex)
|
|
||||||
paramWidgetLoader.sourceComponent = undefined;
|
|
||||||
postpone.interval = 100
|
|
||||||
postpone.start()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
|
id: debug
|
||||||
text: "View Mask"
|
text: "View Mask"
|
||||||
checked: root.debugConfig["viewMask"]
|
checked: root.debugConfig["viewMask"]
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
|
@ -50,104 +30,119 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
TabView {
|
||||||
id: paramWidgets
|
id: tabs
|
||||||
Column {
|
width: 384
|
||||||
spacing: 8
|
height: 400
|
||||||
CheckBox {
|
|
||||||
text: "Glow"
|
|
||||||
checked: root.drawConfig["glow"]
|
|
||||||
onCheckedChanged: {
|
|
||||||
drawConfig["glow"] = checked;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ConfigSlider {
|
|
||||||
label: "Width"
|
|
||||||
integral: false
|
|
||||||
config: root.drawConfig
|
|
||||||
property: "width"
|
|
||||||
max: 15.0
|
|
||||||
min: 0.0
|
|
||||||
width: 280
|
|
||||||
}
|
|
||||||
ConfigSlider {
|
|
||||||
label: "Intensity"
|
|
||||||
integral: false
|
|
||||||
config: root.drawConfig
|
|
||||||
property: "intensity"
|
|
||||||
max: 1.0
|
|
||||||
min: 0.0
|
|
||||||
width: 280
|
|
||||||
}
|
|
||||||
|
|
||||||
GroupBox {
|
onCurrentIndexChanged: {
|
||||||
title: "Color"
|
sendToScript(currentIndex)
|
||||||
width: 280
|
}
|
||||||
Column {
|
|
||||||
spacing: 8
|
|
||||||
|
|
||||||
ConfigSlider {
|
Component {
|
||||||
label: "Red"
|
id: paramWidgets
|
||||||
integral: false
|
|
||||||
config: root.drawConfig
|
Column {
|
||||||
property: "colorR"
|
spacing: 8
|
||||||
max: 1.0
|
|
||||||
min: 0.0
|
CheckBox {
|
||||||
width: 270
|
id: glow
|
||||||
}
|
text: "Glow"
|
||||||
ConfigSlider {
|
checked: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)["glow"]
|
||||||
label: "Green"
|
onCheckedChanged: {
|
||||||
integral: false
|
Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)["glow"] = checked;
|
||||||
config: root.drawConfig
|
|
||||||
property: "colorG"
|
|
||||||
max: 1.0
|
|
||||||
min: 0.0
|
|
||||||
width: 270
|
|
||||||
}
|
|
||||||
ConfigSlider {
|
|
||||||
label: "Blue"
|
|
||||||
integral: false
|
|
||||||
config: root.drawConfig
|
|
||||||
property: "colorB"
|
|
||||||
max: 1.0
|
|
||||||
min: 0.0
|
|
||||||
width: 270
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
ConfigSlider {
|
||||||
|
label: "Width"
|
||||||
|
integral: false
|
||||||
|
config: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)
|
||||||
|
property: "width"
|
||||||
|
max: 15.0
|
||||||
|
min: 0.0
|
||||||
|
width: 280
|
||||||
|
}
|
||||||
|
ConfigSlider {
|
||||||
|
label: "Intensity"
|
||||||
|
integral: false
|
||||||
|
config: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)
|
||||||
|
property: "intensity"
|
||||||
|
max: 1.0
|
||||||
|
min: 0.0
|
||||||
|
width: 280
|
||||||
|
}
|
||||||
|
|
||||||
GroupBox {
|
GroupBox {
|
||||||
title: "Fill Opacity"
|
title: "Color"
|
||||||
width: 280
|
width: 280
|
||||||
Column {
|
Column {
|
||||||
spacing: 8
|
spacing: 8
|
||||||
|
|
||||||
ConfigSlider {
|
ConfigSlider {
|
||||||
label: "Unoccluded"
|
label: "Red"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.drawConfig
|
config: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)
|
||||||
property: "unoccludedFillOpacity"
|
property: "colorR"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 270
|
width: 270
|
||||||
}
|
}
|
||||||
ConfigSlider {
|
ConfigSlider {
|
||||||
label: "Occluded"
|
label: "Green"
|
||||||
integral: false
|
integral: false
|
||||||
config: root.drawConfig
|
config: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)
|
||||||
property: "occludedFillOpacity"
|
property: "colorG"
|
||||||
max: 1.0
|
max: 1.0
|
||||||
min: 0.0
|
min: 0.0
|
||||||
width: 270
|
width: 270
|
||||||
|
}
|
||||||
|
ConfigSlider {
|
||||||
|
label: "Blue"
|
||||||
|
integral: false
|
||||||
|
config: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)
|
||||||
|
property: "colorB"
|
||||||
|
max: 1.0
|
||||||
|
min: 0.0
|
||||||
|
width: 270
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GroupBox {
|
||||||
|
title: "Fill Opacity"
|
||||||
|
width: 280
|
||||||
|
Column {
|
||||||
|
spacing: 8
|
||||||
|
|
||||||
|
ConfigSlider {
|
||||||
|
label: "Unoccluded"
|
||||||
|
integral: false
|
||||||
|
config: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)
|
||||||
|
property: "unoccludedFillOpacity"
|
||||||
|
max: 1.0
|
||||||
|
min: 0.0
|
||||||
|
width: 270
|
||||||
|
}
|
||||||
|
ConfigSlider {
|
||||||
|
label: "Occluded"
|
||||||
|
integral: false
|
||||||
|
config: Render.getConfig("RenderMainView.OutlineEffect"+tabs.currentIndex)
|
||||||
|
property: "occludedFillOpacity"
|
||||||
|
max: 1.0
|
||||||
|
min: 0.0
|
||||||
|
width: 270
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Component.onCompleted: {
|
||||||
id: paramWidgetLoader
|
for (var i=0 ; i<4 ; i++) {
|
||||||
sourceComponent: paramWidgets
|
var outlinePage = tabs.addTab("Outl. "+i, paramWidgets)
|
||||||
|
outlinePage.active = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue