Parameter Type File(string) seems not to work

   2108   5   1
User Avatar
Member
323 posts
Joined: 1月 2015
Offline
Hi there,
for a shader i would like to use a list of floats from a .txt file.
It works all well with a Parameter set to String.
But not when i want to use a .txt file with the same text(values) in it.

Is there a special .txt format?

Any tips are welcome!

thx

Attachments:
file_string.JPG (61.3 KB)
string.JPG (63.3 KB)

User Avatar
スタッフ
477 posts
Joined: 4月 2014
Offline
A “File String” parameter won't return the content of the file when you evaluate it. It will return you the string path to the file.
User Avatar
スタッフ
477 posts
Joined: 4月 2014
Offline
There doesn't seem to be an easy way to read file content from vex. You'll have to add another string parameter and put a python expression on it. In the expression, evaluate the string path, open and read the file in python with it.
User Avatar
スタッフ
6298 posts
Joined: 7月 2005
Offline
This is where systemRAW can be used.

On Linux,
`systemRAW(“cat myfile.txt”)`
User Avatar
Member
323 posts
Joined: 1月 2015
Offline
thx for the answers.
I will try my luck with python.
User Avatar
スタッフ
477 posts
Joined: 4月 2014
Offline
Please tell us how you managed to get it working as you won't be the last one to ask how to read file content in vex.
  • Quick Links