read file in ice

Discussions about SOFTIMAGEs© Interactive Creative Environment©
clankill3r
Posts: 131
Joined: 21 Oct 2012, 13:36

read file in ice

Post by clankill3r » 31 Oct 2012, 12:48

Is there anyway to read a file in ice?
I worked with processing before (awsome java dialect) and often had to read tsv or csv files.
I wanted to figure out how to work with files or data in softmage as well.
Atm i try it with JScript and ICE in order to see the upside and the downside of each way.

I know i can use a String node but i just wonder if a filea can be read.

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: read file in ice

Post by xsisupport » 31 Oct 2012, 15:24

clankill3r wrote:Is there anyway to read a file in ice?
I worked with processing before (awsome java dialect) and often had to read tsv or csv files.
I wanted to figure out how to work with files or data in softmage as well.
Atm i try it with JScript and ICE in order to see the upside and the downside of each way.

I know i can use a String node but i just wonder if a filea can be read.
Write a script that reads in the file and sets the DataArray (assuming you have 2013, I believe write access was new in that release)
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage

clankill3r
Posts: 131
Joined: 21 Oct 2012, 13:36

Re: read file in ice

Post by clankill3r » 31 Oct 2012, 16:31

correct:
ICEAttribute.DataArray - Sets a 1D Array object containing the data defined by an attribute.

The refrence only shows a python and c# example so i will look into it a bit later.

thanks so far.

clankill3r
Posts: 131
Joined: 21 Oct 2012, 13:36

Re: read file in ice

Post by clankill3r » 04 Nov 2012, 16:17

one more before i dive into scripting.

I tried with a really long string in ice (around 6mb of data).
they are like

179,179,179,179,179,179................etc. (around 900) and then a ; and then numbers again sperated by a comma.

If i do a count in notepad++ for ; i get 1040, if i paste it in the string object in ice and paste back in notepad++ and do a count again it says 5.
Also if i split the string in ice and show the array size in ice it says 5 so i lost like 99% of the data.

What is the string character limit?

User avatar
xsisupport
Posts: 713
Joined: 09 Jun 2009, 09:02
Location: Montreal Canada

Re: read file in ice

Post by xsisupport » 04 Nov 2012, 18:19

clankill3r wrote:one more before i dive into scripting.

I tried with a really long string in ice (around 6mb of data).
they are like

179,179,179,179,179,179................etc. (around 900) and then a ; and then numbers again sperated by a comma.

If i do a count in notepad++ for ; i get 1040, if i paste it in the string object in ice and paste back in notepad++ and do a count again it says 5.
Also if i split the string in ice and show the array size in ice it says 5 so i lost like 99% of the data.

What is the string character limit?
A 6MB string? I would give up on String to Array and write a simple script to build an array.
// Steve Blair
// "You're not a runner, you're just a guy who runs" -- my wife
//
// My Blogs: Arnold | Softimage