Bug in blenderman script

I am not sure exactly when this bug occurs, but I have managed to get it to occur consistently in a scene of mine.

The error is in line 1701 of blenderman.01 beta 7.3

if len(namelist) > 1:
surfaceshadername.val = namelist[objectshadermenu.val - 1]

it seems that the index to the namelist array goes to -1 on occasion. In otherwords the len(namelist) is not always a good indicator that objectshadermenu.val is going to be 1 or more. It is sometimes zero.

Then obviously an index out of range error occurs.

In fact, if I put add more shaders to the blenderman selection area, the len(namelist) gets higher as would be expected, but there is no change to objectshadermenu.val

how can I fix this myself.

Cheers

If you want a bug to be fixed in that script I thiink you must do it yourself since it’s not developed anymore.

The developer is now working his @ss of enabling renderman export directly from within blender . :slight_smile:

if len(namelist) > 1:
surfaceshadername.val = namelist[objectshadermenu.val - 1] 

I can answer to this, as I took some of Blenderman procedure to do Yable:

namelist is a sequence type, so indexes begin from 0.

surfaceshadername is a Menu value, it begins from 1.

So this displacement is needed…

This is how namelist is obtained:

namelist = string.split(sshader, "|")

sshader is something like:

sshader = "name1 | name2 | name3| and so on "

if I want that the Menu to show “name1” as selected, I have to
assign: surfaceshadername.val -> 1.

So the piece of code is right, maybe the error is somewhere else.
Andrea

Thanks for the responses :o

Good news to hear there will be renderman integration into blender. !! A moments silence for blenderman. Ah well. It was a great piece of code, still is.

The problem with the bug, is its definitely at this point of code. But I have noticed that it only seems to happen the minute I join 2 meshes together. I have redone the model and used separate meshes and bingo! I guess it’s too much to ask for the script to figure out what material belongs to which mesh of the same object.

The bug still lurks, well actually not a bug then, more like an ambitous user, but that’s the way out…