Community
VRED Forum
Welcome to Autodesk’s VRED Forums. Share your knowledge, ask questions, and explore popular VRED topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HTML Sceneplate issue

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
st.jirka
823 Views, 11 Replies

HTML Sceneplate issue

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

11 REPLIES 11
Message 2 of 12
marcus_fritzen
in reply to: st.jirka

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



Marcus Fritzen
Principal Engineer
Message 3 of 12
st.jirka
in reply to: marcus_fritzen

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.

Message 4 of 12
marcus_fritzen
in reply to: st.jirka

Thanks for the scene. We'll have a look at it asap.



Marcus Fritzen
Principal Engineer
Message 5 of 12
seiferp
in reply to: marcus_fritzen

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?

 

Task Manager.png

 

 

 

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>

 

Message 6 of 12
st.jirka
in reply to: seiferp

Thank you for your suggestion. The code you suggested works perfectly!

Message 7 of 12
seiferp
in reply to: st.jirka

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.

Message 8 of 12
Anonymous
in reply to: seiferp

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.

Message 9 of 12
seiferp
in reply to: Anonymous

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."

Message 10 of 12
Anonymous
in reply to: seiferp

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.

Message 11 of 12
Anonymous
in reply to: Anonymous

Also it seems the executePython just takes the plain python string to be evaluated.

The prefix "value=" is wrong and results in an error.

Message 12 of 12
Anonymous
in reply to: Anonymous

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.

Post to forums  

Autodesk Design & Make Report