Vred2019 Pro - what happen to python execfile ?!

Vred2019 Pro - what happen to python execfile ?!

Bob.Bon2000
Collaborator Collaborator
1,300 Views
7 Replies
Message 1 of 8

Vred2019 Pro - what happen to python execfile ?!

Bob.Bon2000
Collaborator
Collaborator

What is the new replacement for :

s.send("/python?value=execfile('C://test//x.py)'".encode())

All I get is 

Couldn't execute command 'execfile('C://test//...'!

 

Thanks.

 

0 Likes
Accepted solutions (1)
1,301 Views
7 Replies
Replies (7)
Message 2 of 8

marcus_fritzen
Autodesk
Autodesk
Accepted solution

Hi,

 

in 2019 we made some changes regarding the security of some Python calls. However, you can revert it by starting VRED with the command line option "-insecure_python". Hope that helps.

 

Cheers,

Marcus



Marcus Fritzen
Principal Engineer
0 Likes
Message 3 of 8

Bob.Bon2000
Collaborator
Collaborator

Hmm I had a feeling this is going to happen.

 

Will this functionality remain or it will be removed within next 10 releases? 

0 Likes
Message 4 of 8

seiferp
Community Manager
Community Manager
There will never be a solution that fits for all. But if an IT department of a company with hundreds of licenses sees this as a security issue and showstopper to roll out ... we do these adjustments. Sorry if it broke something else.
0 Likes
Message 5 of 8

Bob.Bon2000
Collaborator
Collaborator

Hey

 

yeah I agree, it was quite a security issue, but at the same time in closed networks, it did not matter and allowed us  to build up quite a few systems on it.

 

In this case, how can we tell vred to execute a script after he finish his startup procedure?

 

TIA

0 Likes
Message 6 of 8

marcus_fritzen
Autodesk
Autodesk

Hi,

 

as I wrote, your code will work like in previous versions if you start VREDPro with the command line option

"-insecure_python". You can add it e.g. to the desktop shortcut by right-click on the shortcut -> Properties, there you need to add it to the "Target" which should end up in something like this: "C:\Program Files\Autodesk\VREDPro-11.0\bin\WIN64\VREDPro.exe" -insecure_python.

 

Another solution would be to use another command line option called "-postpython", which will execute after VRED has launched or loaded a scene (see command line option description: VREDPro.exe --help).

 

Cheers,

Marcus



Marcus Fritzen
Principal Engineer
0 Likes
Message 7 of 8

Bob.Bon2000
Collaborator
Collaborator

Humh... bit tricky. Is there no folder in vred like plugins/autostart or something like that where we could place .py files and let vred auto execute them on start? 

0 Likes
Message 8 of 8

marcus_fritzen
Autodesk
Autodesk

No, there is no autostart folder.

 

Cheers,

Marcus



Marcus Fritzen
Principal Engineer
0 Likes