untelon
05-03-2007, 10:18 PM
Howdy again.
This time I am in need of some help performance wise. See, I wrote a exporter script that, given a character, would export an ascii file with the shader that is applied to every poly face. It is rather straight forward. Select the mesh(es) and run the script. Out comes text file(s) for each mesh(es) with a detail list of the shader applied to every face... It works but it is slow, specially when restoring the shaders. This is because I store each face.
object.f[01]
object.f[02]
object.f[03]
object.f[04]
....
object.f[4001]
is much less efficient than
object.f[01:4001]
I was wondering if there's a better way of selecting the faces per shader, instead of a flatten list, a more consiced and optimized version, I like the "myobject.f[0:100]".
Ideally I would like to replicate the functioonality that you get when you right click on a shader and are able to select the geometry using the shader (converting the selection to faces won't work because it select the whole object, regardless of how many shaders might be using it).
As I said, right now I am able to do this, but it creates a long list, and even though I am sorting my text file for faster selection (I.e., all the "lambertSG5" together), I would like to have the [xx:yy] format, as I think it is faster.
Any ideas?
This time I am in need of some help performance wise. See, I wrote a exporter script that, given a character, would export an ascii file with the shader that is applied to every poly face. It is rather straight forward. Select the mesh(es) and run the script. Out comes text file(s) for each mesh(es) with a detail list of the shader applied to every face... It works but it is slow, specially when restoring the shaders. This is because I store each face.
object.f[01]
object.f[02]
object.f[03]
object.f[04]
....
object.f[4001]
is much less efficient than
object.f[01:4001]
I was wondering if there's a better way of selecting the faces per shader, instead of a flatten list, a more consiced and optimized version, I like the "myobject.f[0:100]".
Ideally I would like to replicate the functioonality that you get when you right click on a shader and are able to select the geometry using the shader (converting the selection to faces won't work because it select the whole object, regardless of how many shaders might be using it).
As I said, right now I am able to do this, but it creates a long list, and even though I am sorting my text file for faster selection (I.e., all the "lambertSG5" together), I would like to have the [xx:yy] format, as I think it is faster.
Any ideas?
