also made all other exporters do this.
Made some internal changes.
- moved path functions from bpy.utils to bpy.path (similar to os.path)
- added functions...
bpy.path.ensure_ext(path, ".ext", case_sensitive=False) # simple function to ensure the extension is set.
bpy.path.resolve_ncase(path) # useful for importing scenes made on windows where the path case doesnt match the files.
path -> filepath (for rna and operators, as agreed on with elubie)
path -> data_path (for windowmanager context functions, this was alredy used in many places)
- added new mathutils.Color() type, use with rna so we can do for eg:
material.diffuse_color.r = 1.0
# also has hsv access
material.diffuse_color.s = 0.6
- made Mathutils and Geometry module names lowercase.
create_mesh, create_dupli_list, make_display_list and is_visible.
This is done in order to make these context independent as the RNA API should
be as much as possible, and to fix#21297 and #21719, where there was an
assumption from these functions that there is a scene in the context, which
does not work for external render engines exporting in a separate thread.
Also avoided using context in a number of other functions, ideally only UI/WM
type functions should use context.
I've updated the scripts in trunk, but the addons and external ones in
development will need updates too.
Didn't crash for me, but did export incorrectly since editmode changes weren't flushed.
Fixed this by setting all exporters to go back to object mode before exporting.
Also cleaned up some naming in exporter creator strings, it's "Blender" not "Blender3D".
rename BKE_get_image_export_path() to BKE_rebase_path() and take a filename arg rather then an image.
obj export file copy was also not working because of a missing import.
Running scripts directly didnt call the register function, even though this is not essential its good to be able to run a script directly and see changes in the UI.
Also meant to mention, on the todo: show the confirmation before closing the file selector,
rather than afterwards where it's inconvenient and easy to miss...
change how data is added. eg.
bpy.data.add_mesh(name) --> bpy.data.meshes.new(name)
bpy.data.remove_lamp(lamp) --> bpy.data.lamps.remove(lamp)
image and texture stil use add_* funcs
from bpy.app import binary_path, version, version_string, home
can add constant variables from blender here as needed (maybe functions too... bpy.app.memory_usage() ?)
[#20123] "Import" menu entry becomes empty
[#20141] In Object menu Make Links appears twice - SVN 24970
also moved OBJs name cleaning func to bpy.utils.clean_name(name, replace="_")
- remove functions such as operator_int(), operator_enum(), operator_string
this mixed with keyword arguments in a way that made them hard to read.
Instead, have operator() always return properties rather then needing an argument.
- rename prop_pointer() --> prop_object(), pointer is more a C thing.
- missed item_enumR(), rename to prop_enum()
however this meant the invoke function could not modify properties for exec to use (unless it called exec directly after)
since the popup for eg would re-instance the python class each time.
now use the operator properties directly through rna without an automatic copy.
now an operator attribute is accessed like this...
self.path --> self.properties.path
- made all exporters default to the blend filename with the extension replaced
- MDD's poll function now checks for an active mesh
- multiline docstrings are written as multiline docs when generating epydocs