mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 08:48:40 +02:00
[ui] display output 3D files when double clicking on a node
* iterate over output attributes to find an "obj" file * make default material brighter
This commit is contained in:
parent
76ec5a1913
commit
b8f61bf033
6 changed files with 42 additions and 10 deletions
|
@ -16,10 +16,10 @@ Entity {
|
|||
|
||||
property bool showTextures: true
|
||||
property string diffuseMap: ""
|
||||
property color ambient: "#999999"
|
||||
property color ambient: "#AAA"
|
||||
property real shininess
|
||||
property color specular
|
||||
property color diffuseColor: "#AA9999"
|
||||
property color diffuseColor: "#AAA"
|
||||
property alias object: instantiator.object
|
||||
|
||||
NodeInstantiator {
|
||||
|
|
|
@ -74,15 +74,24 @@ FocusScope {
|
|||
// unparent previous material
|
||||
// and exclude it from the entity components
|
||||
comp.parent = null
|
||||
continue; // skip original component and continue
|
||||
}
|
||||
else
|
||||
comps.push(comp)
|
||||
|
||||
// make default material brighter
|
||||
if(comp.toString().indexOf("QPhongMaterial") > -1) {
|
||||
comp.diffuse = "#AAA"
|
||||
comp.ambient = "#AAA"
|
||||
}
|
||||
comps.push(comp)
|
||||
}
|
||||
entity.components = comps
|
||||
mats.forEach(function(m){
|
||||
// create a material switcher for each material definition
|
||||
var matSwitcher = materialSwitcherComponent.createObject(entity, m)
|
||||
// bind textures checkbox to texture switch property
|
||||
// trigger showTextures update by inverting it
|
||||
// and re-bind textures checkbox to texture switch property
|
||||
// (this double update ensure the texture display is correct)
|
||||
matSwitcher.showTextures = !matSwitcher.showTextures
|
||||
matSwitcher.showTextures = Qt.binding(function(){ return texturesCheckBox.checked })
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue