FULLOSA Conversion Script

FULLOSA CONVERSION SCRIPT

This is another one of those “small but personally handy scripts” I wrote while revisiting some older projects in newer versions of Blender (tested in 2.40). Possibly someone out there might also find this script useful, and so here it is :slight_smile:


# FULLOSA CONVERSION SCRIPT
#
# BY: ROBERTT
# RELEASED: JANUARY 2006
# SCRIPT VERSION: 1.0
# TESTED ON BLENDER VERSIONS: 2.40
#
# WHAT THIS BLENDER PYTHON SCRIPT CAN DO:
#
# This script turns FULLOSA on
# for all materials in your currently
# loaded .blend file.
#
# This can be particularly useful if
# you are working with older .blend
# files (from previous versions of
# Blender) in Blender 2.40.
#
# USAGE TERMS:  USE THIS SCRIPT FREELY,
# AT YOUR OWN RISK, AND ADAPT AS YOU WISH.


import Blender

from Blender import Material

materials = Blender.Material.Get()

# Change materials to FULL OSA

print "
Setting FULLOSA for all materials..."

for m in materials:
	m.mode |= Material.Modes.FULLOSA

print "Done!"

Copy and paste the above code into a test file called fullosa.py
or click here to download the script.

RobertT

How do you do it the other way around? To turn the fullosa off.

I think “^=” can be used as XOR to make the function toggle, so you run it once the bits associated with FULLOSA are on (or off) and then run it again so it’s off (or on):


import Blender

from Blender import Material

materials = Blender.Material.Get()

# Change materials to FULL OSA

print "
Setting FULLOSA for all materials..."

for m in materials:
   m.mode ^= Material.Modes.FULLOSA

print "Done!" 

Not 100% sure about that (since I haven’t done XOR bitwise operations in Python/Blender yet) but it seems to work here :slight_smile:

RobertT