Copying materials array in AngelScript

33 views
Skip to first unread message

Chris Friesen

unread,
Nov 1, 2013, 12:44:42 AM11/1/13
to urh...@googlegroups.com
I can't seem to do this:

Array<Material@> materials = model.materials

I get this error 'materials' is not a member of 'StaticModel'

I can access the individual materials like this:

Material@ mat = model.materials[0];

is this array not the same as the other arrays?

Thanks,
Chris :D

Lasse Öörni

unread,
Nov 1, 2013, 5:45:39 AM11/1/13
to urh...@googlegroups.com
For performance and modularity reasons (there's no actual AngelScript material array inside the StaticModel, as it can't depend on scripting) the array-like access to the materials has been faked using indexed accessors.

You need to use a manual loop for copying the materials. The StaticModel's numGeometries property tells how many material indices there are.
Reply all
Reply to author
Forward
0 new messages