Commit Graph

30 Commits

Author SHA1 Message Date
Campbell Barton
50bce31dbb rna api changes
- mesh.add_geometry(v, e, f)  --> mesh.vertices.add(tot), mesh.edges.add(tot), mesh.faces.add(tot)
- mesh.add_material(mat) --> mesh.materials.link(mat)

changed material.link so it always adds a material even if it exists in the list, this behavior is good for users but not scripts since it can mess up indicies (some formats may have the same material set twice).
2010-08-26 22:44:05 +00:00
Campbell Barton
9784a1169d rna naming: verts -> vertices 2010-08-18 03:42:26 +00:00
Martin Poirier
5b345524ea RNA Types metaclass registration
See mailing list posts for details [1][2][3]

Addons still need to be fixed; Campbell said he'd do it today.

See any of the py files (outside netrender) in this commit for how to do it (it's rather simple).

[1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html
[2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html
[3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html
2010-08-02 02:55:12 +00:00
Campbell Barton
a9867c226b add torus now works like other C add-object operators, location and rotation are initialized and kept even when settings are changed after. 2010-05-30 17:18:16 +00:00
Campbell Barton
f1b9d395e3 - base_object.layers_from_view(view3d), needed for setting local layers
- module 'add_object_utils', so each script doesnt need its own add object code, dealing with layers, scene, cursor location, editmode etc.
2010-05-23 12:14:07 +00:00
Campbell Barton
5e2a9770f5 bugfix [#22163] Add->mesh->torus is broken
recent commit broke this, missed changing double to float.
2010-04-26 21:25:14 +00:00
Campbell Barton
873d4a3f05 py api
- mathutils.Color.hsv attribute. eg. material.diffuse_color.hsv = 0.2, 0.8, 0.4
- Vector/Euler/Quaternion/Color now only take a single seq arg.
- internal function for parsing arrays. (cleanup messy internal list/vector/tuple/seq parsing)
- didnt update rigify yet.
2010-04-25 19:27:59 +00:00
Campbell Barton
67cfc427ee PyAPI
- 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.
2010-04-11 14:22:27 +00:00
Campbell Barton
c19725b266 svn merge https://svn.blender.org/svnroot/bf-blender/branches/render25 -r27895:27901; svn merge https://svn.blender.org/svnroot/bf-blender/branches/render25 -r27902:27907, skipping 27902 2010-03-31 20:39:08 +00:00
Brecht Van Lommel
47a0967a30 no need to set flat shading for faces manually
(commit 27534 by Campbell from render25 branch)
2010-03-16 17:59:39 +00:00
Campbell Barton
fbb8672da4 replace operator options bl_undo and bl_register with bl_options
eg.
 bl_options = {'REGISTER', 'UNDO', 'BLOCKING', 'GRAB_POINTER'}

This didnt exist when operators were originally wrapped.
2010-03-01 00:03:51 +00:00
Campbell Barton
97bdfe6f1b pep8 cleanup + correction for external player operator return value. 2010-02-22 23:32:58 +00:00
Campbell Barton
bc3d96678d bugfix [#21233] Crash in pyapi, with new object.
pass the obdata as an argument rather then assigning later so as not to allow an invalid state.
2010-02-22 00:07:46 +00:00
Campbell Barton
23efeff6a9 [#21177] Text editor
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.
2010-02-16 09:55:07 +00:00
Campbell Barton
39c04315e2 change python scripts so modules which register with blender have a register() function rather then making import automatically run the register functions (generally considered bad practice by python people) 2010-02-14 11:21:21 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Daniel Salazar
bc5f81ee3c Clean up of tooltips in py operators and better operator name for
randomize transform
2010-02-11 23:13:47 +00:00
Daniel Salazar
6d833bced2 Better default resolutions for UV Sphere and Torus primitives (nice square
faces)
Torus is generated flat shaded like the rest of primitives for easier
tweaking of resolution and consistency with the rest of the primitives
2010-02-09 21:05:59 +00:00
Campbell Barton
95069f2909 pep8 changes 2010-01-31 14:46:28 +00:00
Campbell Barton
e85a023480 bugfix [#19681] adjusting the settings of the 'add torus' tool in edit mode 2010-01-29 15:19:19 +00:00
Campbell Barton
aed721e01c [#20685] Fixed: cleaned up descriptions, removed unrelated comments in code
from Jaevixa McNomera (jaevixa)
2010-01-15 10:02:02 +00:00
Campbell Barton
6f8ee9b0f9 patch [#20673] Fixed descriptions in Torus mesh controls, and added some requested controls
from Jaevixa McNomera (jaevixa)
2010-01-14 22:45:56 +00:00
Campbell Barton
08c9ecb3b0 RNA/Py API
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
2010-01-09 23:44:01 +00:00
Campbell Barton
5afd084513 replace dynamic_menu.py with Menu classmethods much less complicated.
access append/prepend eg.

bpy.types.INFO_MT_file_import.append(lambda self, context: self.layout.operator("import_some.format"))
2009-12-25 22:16:19 +00:00
Campbell Barton
bbe13e7823 * register operators like other classes
* operators now return sets (converted into flags)
* can't remove bpy_operator_wrap.c since macro's still use the custom register funcs
2009-12-24 19:50:43 +00:00
Campbell Barton
b5740b0e77 remove ICON prefix from the enum, for python this is redundant eg.
layout.prop("setting", icon='ICON_BLAH_BLAH')

Also reverted previous commit, the cursor subtype just needed to be added to the switch statement.
2009-12-10 10:23:53 +00:00
Campbell Barton
caab05ec8c rna UI api rename...
note: this aims to follow pep8 however I chose to use 'prop/props' rather then 'property/properties' because it would make function names too long.

itemR() --> prop()
items_enumR() --> props_enum()
item_menu_enumR() --> prop_menu_enum()
item_pointerR() --> prop_pointer()
itemO() --> operator()
item_enumO() --> operator_enum()
items_enumO() --> operator_enums()
item_menu_enumO() --> operator_menu_enum()
item_booleanO() --> operator_boolean()
item_intO() --> operator_int()
item_floatO() --> operator_float()
item_stringO() --> operator_string()
itemL() --> label()
itemM() --> menu()
itemS() --> separator()

batch script used http://www.pasteall.org/9345
2009-11-23 00:27:30 +00:00
Campbell Barton
3119eaf284 - dir() now works for collection functions
- group.objects.link/unlink use exceptions rather then return values
- scene.add_object/remove_object --> scene.objects.link/unlink
2009-11-20 10:00:54 +00:00
Campbell Barton
e61c90e416 operators were copying the properties from the rna operator into the class instance.
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
2009-11-19 17:12:08 +00:00
Campbell Barton
4033aba579 new operator directory, move some scripts from io 2009-11-04 14:40:35 +00:00