New Scene now has the popup from 2.4x which gives the option to copy.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 15 Jun 2010 17:14:21 +0000 (17:14 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 15 Jun 2010 17:14:21 +0000 (17:14 +0000)
Added some test code for rna_info to create a big list of property+type+descriptions, useful for api name review.

release/scripts/modules/rna_info.py
source/blender/editors/interface/interface_templates.c

index fa1d15a7845165aada579f27ac05338219af25c3..0f6d60066a369f9807d1840f76563ebf7c06fbef 100644 (file)
@@ -620,3 +620,19 @@ def BuildRNAInfo():
     #    print(rna_info)
 
     return InfoStructRNA.global_lookup, InfoFunctionRNA.global_lookup, InfoOperatorRNA.global_lookup, InfoPropertyRNA.global_lookup
+
+
+if __name__ == "__main__":
+    import rna_info
+    struct = rna_info.BuildRNAInfo()[0]
+    data = ""
+    for struct_id, v in sorted(struct.items()):
+        struct_id_str = "".join(sid for sid in struct_id if struct_id)
+        props = [(prop.identifier, prop) for prop in v.properties]
+        
+        for prop_id, prop in sorted(props):
+            data += "%s.%s:    %s    %s\n" % (struct_id_str, prop.identifier, prop.type, prop.description)
+
+
+    text = bpy.data.texts.new(name="api.py")
+    text.from_string(data)
index 05c162ef639708a9791eea1278a36847aac4b427..fb515d55854c285aa72405119f6a7bf8429ee3fa 100644 (file)
@@ -428,7 +428,7 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
                int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6;
                
                if(newop) {
-                       but= uiDefIconTextButO(block, BUT, newop, WM_OP_EXEC_DEFAULT, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL);
+                       but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_DEFAULT, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL);
                        uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW));
                }
                else {