Reg Media Editor -> WebEngine

Reg Media Editor -> WebEngine

Anonymous
Not applicable
971 Views
3 Replies
Message 1 of 4

Reg Media Editor -> WebEngine

Anonymous
Not applicable

Hello ALL,

 

In Media Editor, while creating a Web Engine, there is an option to give the URL or local HTML file path. Here we normally hard-code the path of the HTML file. 

 
 

Is there a possibility to give a relative path of the HTML file ( for example, “%TMP%/user/myHTML.html”) so that when I copy the *.vpb file to any machine and still the media editor works the same way without having to change the path everytime.

 

Thanks,

Raghavan

0 Likes
972 Views
3 Replies
Replies (3)
Message 2 of 4

seiferp
Community Manager
Community Manager

This should work for setting the file path next to the .vpb file

$VRED_CURRENT_PROJECT_DIR\mypath1\mypath2\myindex.html

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi,

 

I am getting the following error when I tried it using VRED 2020.1

 

expandFilename: couldn't expand env.var VRED_CURRENT_PROJECT_DIR! Path: $VRED_CURRENT_PROJECT_DIR\this\is\relative\test.html

 

I could not get information about this variable VRED_CURRENT_PROJECT_DIR in the help.

How can I set this variable using python code?

 

Also, I would like to use my own environment variable. Can I do this?

For ex: I create a variable myTestVariable and assign it to a temp folder. 

Then can I use this variable as you mentioned inside the WebEngine control. "$myTestVariable\myHTML.html"

 

Thanks,

Raghavan

0 Likes
Message 4 of 4

Anonymous
Not applicable

@Anonymous You can set a window specific environment variable e.g. with a batch script:

 

set myTestVariable=%~dp0\this\is\relative

 

or in C# within process start:

 

_currentProcess = new Process();
_currentProcess.StartInfo.EnvironmentVariables["myTestVariable"] = "C:\\temp\\"

 

 Afterwards you can use this in your scene e.g. with python

 

import os
os.environ["myTestVariable"]

 

or in the media editor with

$myTestVariable

 

Attached, you can find a small example, where you should see a diffenrence if you double click on the test.vpb or if you double click the batch script.

 

Hint: You may have to change the VRED path in the batch.

0 Likes