bpy.ops.import.obj("somepath") is invalid syntax because import is a keyword.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 4 Nov 2009 17:16:58 +0000 (17:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 4 Nov 2009 17:16:58 +0000 (17:16 +0000)
rename import to import_scene, import_anim, future import_sequence_edl, import_model etc..

release/scripts/io/import_anim_bvh.py [moved from release/scripts/io/import_bvh.py with 99% similarity]
release/scripts/io/import_scene_3ds.py [moved from release/scripts/io/import_3ds.py with 99% similarity]
release/scripts/io/import_scene_obj.py [moved from release/scripts/io/import_obj.py with 99% similarity]
release/scripts/ui/space_console.py
source/blender/python/epy_doc_gen.py

similarity index 99%
rename from release/scripts/io/import_bvh.py
rename to release/scripts/io/import_anim_bvh.py
index 52650078e7f7572db78581d2dd937df7894ce313..dff9a3ac0c8eabdf53f0be280073e2ad2b486881 100644 (file)
@@ -855,7 +855,7 @@ from bpy.props import *
 
 class BvhImporter(bpy.types.Operator):
        '''Load a Wavefront OBJ File.'''
-       bl_idname = "import.bvh"
+       bl_idname = "import_anim.bvh"
        bl_label = "Import BVH"
        
        path = StringProperty(name="File Path", description="File path used for importing the OBJ file", maxlen= 1024, default= "")
@@ -877,5 +877,5 @@ bpy.ops.add(BvhImporter)
 
 
 import dynamic_menu
-menu_func = lambda self, context: self.layout.itemO("import.bvh", text="Motion Capture (.bvh)...")
+menu_func = lambda self, context: self.layout.itemO(BvhImporter.bl_idname, text="Motion Capture (.bvh)...")
 menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_import, menu_func)
similarity index 99%
rename from release/scripts/io/import_3ds.py
rename to release/scripts/io/import_scene_3ds.py
index 62612cc79d4ea03e174b63a4b084beaa7138be13..cd351ccb99e20bf863e5e933a4fbd7965ddd3656 100644 (file)
@@ -139,7 +139,7 @@ import os
 import time
 import struct
 
-from import_obj import unpack_face_list, load_image
+from import_scene_obj import unpack_face_list, load_image
 
 import bpy
 import Mathutils
@@ -1143,7 +1143,7 @@ from bpy.props import *
 
 class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
        '''Import from 3DS file format (.3ds)'''
-       bl_idname = "import.autodesk_3ds"
+       bl_idname = "import_scene.autodesk_3ds"
        bl_label = 'Import 3DS'
        
        # List of operator properties, the attributes will be assigned
@@ -1167,7 +1167,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
 bpy.ops.add(IMPORT_OT_autodesk_3ds)
 
 import dynamic_menu
-menu_func = lambda self, context: self.layout.itemO("import.autodesk_3ds", text="3D Studio (.3ds)...")
+menu_func = lambda self, context: self.layout.itemO(IMPORT_OT_autodesk_3ds.bl_idname, text="3D Studio (.3ds)...")
 menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_import, menu_func)
 
 # NOTES:
similarity index 99%
rename from release/scripts/io/import_obj.py
rename to release/scripts/io/import_scene_obj.py
index e5e0dc35995db7e529de402fbaf2b4ff520de830..d1b29a3024da96f7e61d48cfeae118f05f1e109f 100644 (file)
@@ -1574,7 +1574,7 @@ from bpy.props import *
 
 class IMPORT_OT_obj(bpy.types.Operator):
        '''Load a Wavefront OBJ File.'''
-       bl_idname = "import.obj"
+       bl_idname = "import_scene.obj"
        bl_label = "Import OBJ"
        
        # List of operator properties, the attributes will be assigned
@@ -1626,7 +1626,7 @@ bpy.ops.add(IMPORT_OT_obj)
 
 
 import dynamic_menu
-menu_func = lambda self, context: self.layout.itemO("import.obj", text="Wavefront (.obj)...")
+menu_func = lambda self, context: self.layout.itemO(IMPORT_OT_obj.bl_idname, text="Wavefront (.obj)...")
 menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_import, menu_func)
 
 
index 7cd5a0a903bdb5975014c7c66cec3c7ef377a69d..c3b97fbaf0a30ee2efbeb814fdd5138e38d01e6c 100644 (file)
@@ -157,6 +157,10 @@ class CONSOLE_OT_exec(bpy.types.Operator):
 
         console, stdout, stderr = get_console(hash(context.region))
 
+        # Hack, useful but must add some other way to access
+        #if "C" not in console.locals:
+        console.locals["C"] = context
+
         # redirect output
         sys.stdout = stdout
         sys.stderr = stderr
@@ -222,7 +226,7 @@ class CONSOLE_OT_autocomplete(bpy.types.Operator):
         sc = context.space_data
 
         console = get_console(hash(context.region))[0]
-
+        
         current_line = sc.history[-1]
         line = current_line.line
 
index 202a1df350267c09f53be03890dc239086270946..fff9d4f9c20742136b595868e37b7af8c216673f 100644 (file)
@@ -23,10 +23,10 @@ Usage,
 run this script from blenders root path once you have compiled blender
     ./blender.bin -P source/blender/python/epy_doc_gen.py
 
-This will generate rna.py and bpyoperator.py in "./source/blender/python/doc/"
+This will generate python files in "./source/blender/python/doc/bpy"
 Generate html docs  by running...
 
-    epydoc source/blender/python/doc/*.py -v \\
+    epydoc source/blender/python/doc/bpy/ -v \\
             -o source/blender/python/doc/html \\
             --inheritance=included \\
             --no-sourcecode \\
@@ -170,11 +170,11 @@ def write_func(rna, ident, out, func_type):
     # Operators and functions work differently
     if func_type=='OPERATOR':
         rna_func_name = rna_struct.identifier.split("_OT_")[-1]
-        rna_func_desc = rna_struct.description.strip()
+        rna_func_desc = rna_struct.description.strip().replace('\n', ' ')
         items = rna_struct.properties.items()
     else:
         rna_func_name = rna.identifier
-        rna_func_desc = rna.description.strip()
+        rna_func_desc = rna.description.strip().replace('\n', ' ')
         items = rna.parameters.items()