PDA

View Full Version : Excuting a very long string Bug/hack?


Gibbz
12-18-2006, 10:04 AM
I have an issue where im executing a very long string.
i have stored the string in the user defined properties and to change it back to an array i need to use "execute"...

However because the string is very long it gives the following error....
">> MAXScript Rollout Handler Exception: -- Unknown system exception <<"

1. How can I find a hack/fix for this?
2. Is there a better way to store these?

erilaz
12-18-2006, 10:42 AM
Would it be easier to split the string into an array with filterString? I try to avoid using execute at all costs.

Gibbz
12-19-2006, 01:25 AM
hrmm, as i am storing an array within an array, how would i use filterstring to filter this?

t = "#(#(1, 2), #(2, 2), #(3, 2))"

erilaz
12-19-2006, 01:50 AM
A bit convoluted I guess, but you can do it like this:



t = "#(#(1,2),#(2,2),#(3,2))"
newArray = #()
arrayIdx = 0

baseString = filterString t "# ( )"
aC = baseString.count


for i = 1 to aC do
(
if baseString[i] != "," then
(
arrayIdx += 1
newArray[arrayIdx] = filterString baseString[i] ","
for i = 1 to newArray[arrayIdx].count do
(
numeral = (i as integer)
newArray[arrayIdx][i] = numeral
)
)

)

print newArray

Gibbz
12-19-2006, 04:20 AM
hrmm maybe it just max running out of memory

i get the same error with some code similar to the one you have there....

">> MAXScript Rollout Handler Exception: -- Unknown system exception <<"


:( *sad*

erilaz
12-19-2006, 08:40 AM
Could you post your code and the string? I'll see if I get the same results.

MerlinEl
12-21-2006, 07:38 AM
--Store data
(
local MyArray

struct myData
(
name,age,race
)

append MyArray (myData name:"John" age:24 race:"X")
)

--Geting data
MyArray[1].name
MyArray[1].age

ect....

---------------
Rene

Gibbz
12-21-2006, 01:03 PM
ok i got it working putting a GC in the main loop. It was running out of memory, the string was over 500,000 chars long! Is there a better place to store arrays in an object?

erilaz
12-21-2006, 01:13 PM
Can I ask why you're storing such a huge amount of data in an object in the first place? :D

Gibbz
12-22-2006, 06:39 AM
im storing data needed for untriangulation. Some of the scripts need to triangulate the mesh, however working with trimeshes is painfull, so its usefull to keep an this data....

MerlinEl
12-22-2006, 08:45 AM
mabe I not realy understand you question but:

why you not use?

snapshotasmesh polyObj --grab the TriMesh of the Editable_Poly

Gibbz
12-22-2006, 12:58 PM
and keep the original hidden in the scene?

CGTalk Moderation
12-22-2006, 12:58 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.