anybody has a little script to change from old bump map to new one in 2.5?
or vice versa
that would be very nice thanks
cause to do it in the Outliner is difficult to find the righ RNV value
thanks
anybody has a little script to change from old bump map to new one in 2.5?
or vice versa
that would be very nice thanks
cause to do it in the Outliner is difficult to find the righ RNV value
thanks
i found this old script where i began to do something to change from old to new
bump map butnot certain if this is working !
can someone help to complete this
at least we would ahve an example for this!
class matobjectbut1(bpy.types.Panel):
bl_label = "Hello from Material context"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
bl_show_header=True
def draw(self, context):
obj = context.object
layout = self.layout
class Objbutton1(matobjectbut1):
bl_label = "Bump Algo"
Display = 0
def draw_header(self, context):
layout = self.layout
# layout.label(text="oldnew", icon='ICON_PHYSICS')
# layout.label(text="oldnew", icon='GHOST_ENABLE')
# layout.label(text="oldnew", icon='TRIA_LEFT')
layout.label(text="oldnew", icon='BLENDER')
# No icon word anymore
def draw(self, context):
layout = self.layout
row = layout.row()
split = row.split(percentage=0.5)
colL = split.column()
colR = split.column()
if bpy.types.Objbutton1.Display == 0:
colL.operator("oldnew", text="New")
else:
colR.operator("oldnew", text="OLd")
class Obj_op1(bpy.types.Operator):
bl_label = "oldnew"
bl_idname = "oldnew"
bl_description = "Change Algo"
def invoke(self, context, event):
bpy.types.Objbutton1.Display = 1 - bpy.types.Objbutton1.Display
Bumpchange(bpy.types.Objbutton1.Display)
return('FINISHED',)
def Bumpchange(state):
print('Change Algo')
sc = bpy.context.scene
ob = sc.objects['Mesh']
materials = bpy.data.materials
print("state = ",state)
print ('in bumpchange function')
if state == 1:
for m in materials:
textures = m.textures
try:
for t in textures:
t.new_bump = True
ob.location.x=5.0
print ('change to true')
except:
continue
else:
for m in materials:
textures = m.textures
try:
for t in textures:
t.new_bump = false
ob.location.x=0.0
print ('change to false')
except:
continue
print('Algo has been toggle')
bpy.types.register(Obj_op1)
bpy.types.register(Objbutton1)
Thanks happy 2.5