Back to the Shapespark home page

viewer.setMaterialEditable with regex

Hello Folks,
I have materials in my model which either starts with “2bhk” or “3bhk” strings. I am trying to use the following call with regex

This regex should return materials which matches… But this calls fails and when I try to set the material opacity, there is an exception generated but the material opacity is properly changed.

However if i make a call viewer.setAllMaterialsEditable();, then no exeption is generated as expected since the call to setMaterialEdutable did not suceeded and an exception “call setmaterial before the scene is loaded” is thrown…
Is there something wrong in my regex, which shapespark does not recognise or the format is incorrect

Regexp needs to be passed without the quotes ‘’. Try passing for example: /^[0-9]bhk/

1 Like

It works!. Thanks Jan