bpy.ops.import.obj("somepath") is invalid syntax because import is a keyword.
rename import to import_scene, import_anim, future import_sequence_edl, import_model etc..
This commit is contained in:
parent
edeae7477b
commit
8af525f860
@ -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)
|
@ -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:
|
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user