Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-27 03:49:13 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-01-27 03:49:13 +0400
commit556912792ad3c37c294256a558c96b39f264e7b5 (patch)
tree9b6ee8cf1ad92ee89c04f27a89be11599c5b40c0 /doc
parent9251d628db0abe599d927d79170025d8545c8ace (diff)
parentc84383301c5a2582e95259a7e4468a23a3566401 (diff)
Merged changes in the trunk up to revision 54110.
Conflicts resolved: source/blender/blenfont/SConscript source/blender/blenkernel/intern/subsurf_ccg.c source/blender/makesdna/intern/makesdna.c source/blender/makesrna/intern/rna_scene.c
Diffstat (limited to 'doc')
-rw-r--r--doc/python_api/examples/bpy.props.5.py12
-rw-r--r--doc/python_api/examples/bpy.types.AddonPreferences.1.py2
-rw-r--r--doc/python_api/examples/bpy.types.UIList.py2
-rw-r--r--doc/python_api/rst/info_tutorial_addon.rst18
-rw-r--r--doc/python_api/rst_from_bmesh_opdefines.py50
-rw-r--r--doc/python_api/sphinx_doc_gen.py6
6 files changed, 46 insertions, 44 deletions
diff --git a/doc/python_api/examples/bpy.props.5.py b/doc/python_api/examples/bpy.props.5.py
index e49d0f2a0a0..1f61e33c30f 100644
--- a/doc/python_api/examples/bpy.props.5.py
+++ b/doc/python_api/examples/bpy.props.5.py
@@ -16,6 +16,7 @@ import bpy
def get_float(self):
return self["testprop"]
+
def set_float(self, value):
self["testprop"] = value
@@ -36,6 +37,7 @@ bpy.types.Scene.test_date = bpy.props.StringProperty(get=get_date)
def get_array(self):
return (True, self["somebool"])
+
def set_array(self, values):
self["somebool"] = values[0] and values[1]
@@ -51,10 +53,12 @@ test_items = [
("YELLOW", "Red", "", 4),
]
+
def get_enum(self):
import random
return random.randint(1, 4)
+
def set_enum(self, value):
print("setting value", value)
@@ -66,16 +70,16 @@ bpy.types.Scene.test_enum = bpy.props.EnumProperty(items=test_items, get=get_enu
scene = bpy.context.scene
scene.test_float = 12.34
-print (scene.test_float)
+print(scene.test_float)
scene.test_array = (True, False)
-print ([x for x in scene.test_array])
+print([x for x in scene.test_array])
#scene.test_date = "blah" # this would fail, property is read-only
-print (scene.test_date)
+print(scene.test_date)
scene.test_enum = 'BLUE'
-print (scene.test_enum)
+print(scene.test_enum)
# >>> 12.34000015258789
diff --git a/doc/python_api/examples/bpy.types.AddonPreferences.1.py b/doc/python_api/examples/bpy.types.AddonPreferences.1.py
index 08de6f4f5a9..73f90acb3fa 100644
--- a/doc/python_api/examples/bpy.types.AddonPreferences.1.py
+++ b/doc/python_api/examples/bpy.types.AddonPreferences.1.py
@@ -17,6 +17,8 @@ from bpy.props import StringProperty, IntProperty, BoolProperty
class ExampleAddonPreferences(AddonPreferences):
+ # this must match the addon name, use '__package__'
+ # when defining this in a submodule of a python package.
bl_idname = __name__
filepath = StringProperty(
diff --git a/doc/python_api/examples/bpy.types.UIList.py b/doc/python_api/examples/bpy.types.UIList.py
index f2017e3883d..a37bbff726a 100644
--- a/doc/python_api/examples/bpy.types.UIList.py
+++ b/doc/python_api/examples/bpy.types.UIList.py
@@ -86,4 +86,4 @@ def unregister():
if __name__ == "__main__":
- register() \ No newline at end of file
+ register()
diff --git a/doc/python_api/rst/info_tutorial_addon.rst b/doc/python_api/rst/info_tutorial_addon.rst
index 2a101041227..5637cf2f638 100644
--- a/doc/python_api/rst/info_tutorial_addon.rst
+++ b/doc/python_api/rst/info_tutorial_addon.rst
@@ -486,16 +486,14 @@ using :kbd:`Ctrl-Shift-Space` as the key shortcut to activate it.
kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
kmi.properties.total = 4
- addon_keymaps.append(km)
+ addon_keymaps.append((km, kmi))
def unregister():
# handle the keymap
- wm = bpy.context.window_manager
- for km in addon_keymaps:
- wm.keyconfigs.addon.keymaps.remove(km)
- # clear the list
+ for km, kmi in addon_keymaps:
+ km.keymap_items.remove(kmi)
addon_keymaps.clear()
@@ -568,18 +566,16 @@ Bringing it all together
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
kmi.properties.total = 4
- addon_keymaps.append(km)
+ addon_keymaps.append((km, kmi))
def unregister():
bpy.utils.unregister_class(ObjectCursorArray)
bpy.types.VIEW3D_MT_object.remove(menu_func)
# handle the keymap
- wm = bpy.context.window_manager
- for km in addon_keymaps:
- wm.keyconfigs.addon.keymaps.remove(km)
- # clear the list
- del addon_keymaps[:]
+ for km, kmi in addon_keymaps:
+ km.keymap_items.remove(kmi)
+ addon_keymaps.clear()
if __name__ == "__main__":
diff --git a/doc/python_api/rst_from_bmesh_opdefines.py b/doc/python_api/rst_from_bmesh_opdefines.py
index c1b6643389d..3776ef7ce56 100644
--- a/doc/python_api/rst_from_bmesh_opdefines.py
+++ b/doc/python_api/rst_from_bmesh_opdefines.py
@@ -65,10 +65,10 @@ def main():
fsrc = open(FILE_OP_DEFINES_C, 'r', encoding="utf-8")
blocks = []
-
+
is_block = False
is_comment = False # /* global comments only */
-
+
comment_ctx = None
block_ctx = None
@@ -82,7 +82,7 @@ def main():
elif l.strip().startswith("/*"):
is_comment = True
comment_ctx = []
-
+
if is_block:
if l.strip().startswith("//"):
pass
@@ -93,11 +93,11 @@ def main():
l = l[:cpp_comment]
block_ctx.append(l)
-
+
if l.strip() == "};":
is_block = False
comment_ctx = None
-
+
if is_comment:
c_comment_start = l.find("/*")
if c_comment_start != -1:
@@ -113,7 +113,6 @@ def main():
fsrc.close()
del fsrc
-
# namespace hack
vars = (
"BMO_OP_SLOT_ELEMENT_BUF",
@@ -124,7 +123,7 @@ def main():
"BMO_OP_SLOT_VEC",
"BMO_OP_SLOT_PTR",
"BMO_OP_SLOT_MAPPING",
-
+
"BMO_OP_SLOT_SUBTYPE_MAP_ELEM",
"BMO_OP_SLOT_SUBTYPE_MAP_BOOL",
"BMO_OP_SLOT_SUBTYPE_MAP_INT",
@@ -157,23 +156,23 @@ def main():
for comment, b in blocks:
# magic, translate into python
b[0] = b[0].replace("static BMOpDefine ", "")
-
+
for i, l in enumerate(b):
l = l.strip()
l = l.replace("{", "(")
l = l.replace("}", ")")
-
+
if l.startswith("/*"):
l = l.replace("/*", "'''own <")
else:
l = l.replace("/*", "'''inline <")
l = l.replace("*/", ">''',")
-
+
# exec func. eg: bmo_rotate_edges_exec,
if l.startswith("bmo_") and l.endswith("_exec,"):
l = "None,"
b[i] = l
-
+
#for l in b:
# print(l)
@@ -182,7 +181,7 @@ def main():
"__file__": "generated",
"__name__": "__main__",
}
-
+
global_namespace.update(vars_dict)
text_a, text_b = text.split("=", 1)
@@ -191,7 +190,6 @@ def main():
# print(global_namespace["result"])
blocks_py.append((comment, global_namespace["result"]))
-
# ---------------------
# Now convert into rst.
fout = open(OUT_RST, 'w', encoding="utf-8")
@@ -217,7 +215,7 @@ def main():
args_out_index[:] = [i for (i, a) in enumerate(args_out) if type(a) == tuple]
fw(".. function:: %s(bm, %s)\n\n" % (b[0], ", ".join([args_in[i][0] for i in args_in_index])))
-
+
# -- wash the comment
comment_washed = []
for i, l in enumerate(comment):
@@ -236,7 +234,6 @@ def main():
fw("\n")
# -- done
-
# get the args
def get_args_wash(args, args_index, is_ret):
args_wash = []
@@ -268,7 +265,7 @@ def main():
comment_next = comment_next[8:-1] # strip inline <...>
else:
comment_next = ""
-
+
comment = ""
if comment_prev:
comment += comment_prev.strip()
@@ -304,18 +301,21 @@ def main():
elif tp == BMO_OP_SLOT_ELEMENT_BUF:
assert(tp_sub is not None)
-
+
ls = []
- if tp_sub & BM_VERT: ls.append(":class:`bmesh.types.BMVert`")
- if tp_sub & BM_EDGE: ls.append(":class:`bmesh.types.BMEdge`")
- if tp_sub & BM_FACE: ls.append(":class:`bmesh.types.BMFace`")
+ if tp_sub & BM_VERT:
+ ls.append(":class:`bmesh.types.BMVert`")
+ if tp_sub & BM_EDGE:
+ ls.append(":class:`bmesh.types.BMEdge`")
+ if tp_sub & BM_FACE:
+ ls.append(":class:`bmesh.types.BMFace`")
assert(ls) # must be at least one
if tp_sub & BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE:
tp_str = "/".join(ls)
else:
tp_str = ("list of (%s)" % ", ".join(ls))
-
+
del ls
elif tp == BMO_OP_SLOT_MAPPING:
if tp_sub & BMO_OP_SLOT_SUBTYPE_MAP_EMPTY:
@@ -356,21 +356,21 @@ def main():
fw(" :arg %s: %s\n" % (name, comment))
fw(" :type %s: %s\n" % (name, tp))
-
+
if args_out_wash:
fw(" :return:\n\n")
-
+
for (name, tp, comment) in args_out_wash:
assert(name.endswith(".out"))
name = name[:-4]
fw(" - ``%s``: %s\n\n" % (name, comment))
fw(" **type** %s\n" % tp)
-
+
fw("\n")
fw(" :rtype: dict with string keys\n")
fw("\n\n")
-
+
fout.close()
del fout
print(OUT_RST)
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 89659c10add..4311ae56f8e 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -614,10 +614,10 @@ def pyfunc2sphinx(ident, fw, identifier, py_func, is_class=True):
'''
function or class method to sphinx
'''
-
+
if type(py_func) == type(bpy.types.Space.draw_handler_add):
return
-
+
arg_str = inspect.formatargspec(*inspect.getargspec(py_func))
if not is_class:
@@ -992,6 +992,7 @@ context_type_map = {
"world": ("World", False),
}
+
def pycontext2sphinx(basepath):
# Only use once. very irregular
@@ -1019,7 +1020,6 @@ def pycontext2sphinx(basepath):
"sequencer_context_dir",
)
-
unique = set()
blend_cdll = ctypes.CDLL("")
for ctx_str in context_strings: