Amerio.Stephane Posted July 6 Posted July 6 Hello, I have a custom mgraph where I want a parameter to only be visible when another one has a specific value. As described here https://developer.unigine.com/en/docs/latest/content/materials/graph/?highlighted=condition,activity,conditionlll,condit,activ,conditionll#activity_condition, I tried this syntax in the editor for the Activity Condition, but this leads to this error at runtime: ERROR: Material::loadUlon(): (Material:"XXX/viewcone_decal.mgraph" Texture:"texture") Condition "(use_texture==1)" has semantic error What am I missing? Additional question: at first, I wanted to use a bool for 'use_texture', but then it wouldn't be found by findParameter(), and there is no setParameterBool. Additional bug report: when the material graph window is displayed in Editor, you can no longer move/rotate/resize node in the main viewport with the gizmo. viewcone_decal.mgraph
silent Posted July 7 Posted July 7 Hi Stephane, It should be enough to specify the parameter name, like that: texture=1 instead of use_texture==1 Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Amerio.Stephane Posted July 7 Author Posted July 7 Sorry, not sure to understand. I want the "texture" parameter to be visible only when the other parameter "use_texture" equals 1. Shouldn't the condition then be "use_texture=1" ? But I also tried it and it doesn't work either. What about the other 2 questions/bug?
silent Posted July 7 Posted July 7 Hi Stephane, Please check the video with custom parameter usage: parameter_custom.mp4 Is that what you want to achieve? You can use findState() to search for bool type of parameters in code. Regarding the non-working manipulators inside the Editor viewport, so far we were unable to reproduce this. Are you using multi-monitor setup for Editor (maybe DPI scale as well)? Will it work again if you do the Windows -> Reset Windows Layout? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
Amerio.Stephane Posted July 7 Author Posted July 7 You are right, it works as expected when the condition is a Bool, and I have to use setState instead of setParameter*. Thanks for the clarification! Regarding the non-working gizmo when mgraph is edited, I couldn't reproduce here, so there must have been something else. I'll see if I can reproduce it, anyway. Thanks!
Recommended Posts