Working on improving the material inspector

This commit is contained in:
Sam Gateau 2019-10-03 17:04:40 -07:00
parent ae259ef9fd
commit a5c10abcac
2 changed files with 75 additions and 30 deletions

View file

@ -177,6 +177,10 @@ glm::mat4 getGlobalTransform(const QMultiMap<QString, QString>& _connectionParen
break; break;
} }
} }
if (fbxModel.hasGeometricOffset && visitedNodes.size() > 1) {
qCWarning(modelformat) << "Here is a parent node with Geometric offset ?????" << url;
}
} }
return globalTransform; return globalTransform;
} }

View file

@ -13,12 +13,19 @@ import QtQuick.Layouts 1.3
import stylesUit 1.0 import stylesUit 1.0
import controlsUit 1.0 as HifiControls import controlsUit 1.0 as HifiControls
import "../lib/prop" as Prop
Rectangle { Rectangle {
HifiConstants { id: hifi;} HifiConstants { id: hifi;}
color: Qt.rgba(hifi.colors.baseGray.r, hifi.colors.baseGray.g, hifi.colors.baseGray.b, 0.8); color: Qt.rgba(hifi.colors.baseGray.r, hifi.colors.baseGray.g, hifi.colors.baseGray.b, 0.8);
id: root; id: root;
property var theMaterial: {}
property var theMaterialAttributes: {}
property var hasMaterial: false
property var isReadOnly: true
function fromScript(message) { function fromScript(message) {
switch (message.method) { switch (message.method) {
case "setObjectInfo": case "setObjectInfo":
@ -26,40 +33,74 @@ Rectangle {
break; break;
case "setMaterialJSON": case "setMaterialJSON":
materialJSONText.text = message.params.materialJSONText; materialJSONText.text = message.params.materialJSONText;
theObject = JSON.parse(message.params.materialJSONText)
theMaterialAttributes = theObject.materials
console.log(JSON.stringify(theOtheMaterialAttributesbject))
hasMaterial = (theMaterial !== undefined)
break; break;
} }
} }
Rectangle { Column {
id: entityIDContainer
height: 52 anchors.left: parent.left
width: root.width anchors.right: parent.right
color: Qt.rgba(root.color.r * 0.7, root.color.g * 0.7, root.color.b * 0.7, 0.8);
TextEdit { Rectangle {
id: entityIDInfo id: entityIDContainer
text: "Type: Unknown\nID: None\nMesh Part: Unknown" height: 52
font.pointSize: 9
color: "#FFFFFF"
readOnly: true
selectByMouse: true
}
}
Original.ScrollView {
anchors.top: entityIDContainer.bottom
height: root.height - entityIDContainer.height
width: root.width
clip: true
Original.ScrollBar.horizontal.policy: Original.ScrollBar.AlwaysOff
TextEdit {
id: materialJSONText
text: "Click an object to get material JSON"
width: root.width width: root.width
font.pointSize: 10 color: Qt.rgba(root.color.r * 0.7, root.color.g * 0.7, root.color.b * 0.7, 0.8);
color: "#FFFFFF" TextEdit {
readOnly: true id: entityIDInfo
selectByMouse: true text: "Type: Unknown\nID: None\nMesh Part: Unknown"
wrapMode: Text.WordWrap font.pointSize: 9
color: "#FFFFFF"
readOnly: true
selectByMouse: true
}
}
Prop.PropScalar {
visible: hasMaterial && ("roughness" in theMaterialAttributes)
label: "roughness"
object: theMaterialAttributes
property: "roughness"
readOnly: isReadOnly
}
Prop.PropScalar {
visible: hasMaterial && ("opacity" in theMaterialAttributes)
label: "opacity"
object: theMaterialAttributes
property: "opacity"
readOnly: isReadOnly
}
Prop.PropString {
visible: hasMaterial && ("albedoMap" in theMaterialAttributes)
label: "roughness"
object: theMaterialAttributes
property: "roughness"
readOnly: isReadOnly
}
Original.ScrollView {
// anchors.top: entityIDContainer.bottom
height: root.height - entityIDContainer.height
width: root.width
clip: true
Original.ScrollBar.horizontal.policy: Original.ScrollBar.AlwaysOff
TextEdit {
id: materialJSONText
text: "Click an object to get material JSON"
width: root.width
font.pointSize: 10
color: "#FFFFFF"
readOnly: true
selectByMouse: true
wrapMode: Text.WordWrap
}
} }
} }
} }