modifying UV via python ruins material

if i run my script that remaps UV data on an object with a material, then the material user value goes to -1W and the bar goes red. is there any way to fix this without removing the material, running the script, then adding the material? i have to run the script on hundreds of objects and dont want to do this on every one.

Hi lizard809,

Please post a small script example here that exibits the problem or send an email to the bf-python mailing list:
http://www.blender.org/mailman/listinfo/bf-python

We’ll then try to fix the problem.

Thanks in advance

heres some simple code that ruins material:
im using 2.25 so if this is a glitch with it then im stuck because the script i made is for automapping for a game and using a different blender would probably screw up the gamelogic data.

import Blender
ob=Blender.Object.getSelected()[0]
mesh=ob.getData
mesh.update()

Ah, as I thought. I fixed that problem, but of course this is only working in the newer versions, probably since the first 2.28, from what I remember.

There were a couple of bugs in NMesh that gave trouble with the update method. But there used to be some work-arounds that may (or may not) help you, like using the Mesh module that was part of 2.25. The best you could do is search this forum for older messages or ask directly one of the guru script writers who might remember what to do. Or wait…

Let’s hope Blender 2.30 can have the game engine back, so 2.25 can finally rest in peace.