Hi,
I have a problem with the HTML sceneplate. I made a GUI that changes variants by clicking on pictures. It's integrated in VRED as a Front plate through Sceneplate editor.
When I run it through browser it works absolutely fine. The problem comes when I use it in VRED because after clicking one of the images it does what I want but only once. After that the whole GUI becomes unresponsive. VRED still works, just the WEB overlay freezes.
Any suggestions?
Any suggestions
Solved! Go to Solution.
Solved by seiferp. Go to Solution.
Hi,
could you provide a minimal example scene with which the issue can be reproduced?
I haven't observed such a behavior until now.
Thx,
Marcus
Here's just a scene with a Switch, variants that switch it and the HTML (you will have to relink it in the scenplate editor) controls it, again in browser it works for me. But in VRED only works once.
Thanks for the scene. We'll have a look at it asap.
Your scene does work on my site without any problems. Are you running your scene in a company network? Due the fact you are sending commands over the network using the 8888 port I assume someone or something is blocking or killing the webengine process when communication is happening. Do you see the VREDMediaServer process in the Task Manager? Or shutting down when pressing a button in your html page?
Try this in your JavaScript to avoid communication over the network
<script type="text/javascript"> function setVariant(vset) {vred.executePython("value=selectVariantSet(\""+vset+"\", false)"); } </script>
Jep, than there is something in your network scanning the port communication and sees the MediaServer in the task manager as a security risk but not you web browser. So you could either talk to your IT or stick with the executePython function I’ve send you.
That is very helpful.
Could someone also point us to an official documentation, because also a sister function/method named `executePythonCommand` was announced but never explained.
Was mentioned under General in the 2019.2 Whats New´s
"Due to some companies’s network- and port scanning restrictions, the VRED MediaServer was not able to send python code embedded in Java, using the network port, to VRED. We have added an additional Java Class vred.executePython() that can send code directly to VRED, when it´s used in the Media Editor."
Does such a JavaScript call also return the result of the python call as string ? We often need Json to flow back and forth between HTML5 and VRED.
Also it seems the executePython just takes the plain python string to be evaluated.
The prefix "value=" is wrong and results in an error.
I reverse engineered executePythonCommand and found it to work like a typical JS callback mechanism.
function receive(result) { // do something with the result of type String } vred.executePythonCommand("<python that can be fed to str()>", receive);
Dear Pascal, did I miss something ?
Can't find what you're looking for? Ask the community or share your knowledge.