Hi,
define a Material Switch in the Material Editor with the highlighted and the non-highlighted material. Drag & drop it to the Variant Set to the tab "Material" and to the node in the Scenegraph. In the State column you can define which material is shown when selecting the Variant set. So Python is not necessarily required. You can also explore the example here:
If you want to controll the Material Variant by script, you must also aplly a material Switch to the Variant Set as described above. Then you can select the Material Variant with the Python command
selectMaterialVariant(name, state)
Name = Name of the Material Switch
State = the Name of the state
Regards
Jochen
I still think I have described what you want. We have created a Menue. I attached a screenshot. The green button is active, the blue one is inactive.
Hi
just to maybe Add a version which works with Python Buttons:
from PythonQt import QtCore, QtGui
def handleButton():
button.setStyleSheet("background-color: red")
demo = QtGui.QWidget()
demo.setWindowTitle("Demo")
button = QtGui.QPushButton("TEST")
button.clicked.connect(handleButton)
layout = QtGui.QVBoxLayout(demo)
layout.addWidget(button)
demo.show()
Hope that helps, (You would have to write a logic which changes the Background of the Button based on which State it is in)
cheers
Klaus
Can't find what you're looking for? Ask the community or share your knowledge.