Commit Graph

34 Commits

Author SHA1 Message Date
Campbell Barton
c3937c93d5 minor changes made before commit broke this script 2009-11-26 16:05:32 +00:00
Campbell Barton
64f552356a ctrl 1-5 for changing subsurf levels 2009-11-26 15:36:23 +00:00
Campbell Barton
8e09171d5b temp hack to make the popup show wider when running the edit description operator 2009-11-23 00:56:19 +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
247f9cfc04 - add cloth button wasnt working because it was set to execute the operator.
- for adding an operator, start with a blank name and dont write the default one. (still writes each name you type in, will need to fix this properly)
- move the AddPresetBase class into presets.py since all the presets are defined there.
2009-11-22 13:15:21 +00:00
Campbell Barton
8b84cc2ab6 use context member rather then modifier name in presets 2009-11-22 11:33:44 +00:00
Thomas Dinges
02e99b9a43 * Minor cleanups.
* Added Cloth Presets. Patch by nudelZ. Thanks!
2009-11-22 10:32:37 +00:00
Campbell Barton
adb14a2247 remove template uiTemplate_view3d_select_faceselmenu 2009-11-22 10:02:32 +00:00
Campbell Barton
9e2ed89105 SSS presets, Thomas and I added these at the same time, however I meant to make this a more general system.
this commit shows how to add a preset using the base preset class and menu with minimal effort.
2009-11-22 00:22:29 +00:00
Campbell Barton
6db600dddc moving this file back, sorry for the noise 2009-11-22 00:18:43 +00:00
Campbell Barton
d46e83e1c5 looks like we both added sss at once :) , removing since Im using the base class and a single presets file 2009-11-22 00:17:36 +00:00
Thomas Dinges
4f6b95480f * Added Subsurface Scattering Presets.
Note: Add doesn't work, it writes some text into the file, not the values. (Maybe because the values are arrays?!)
Campbell, please check :)
2009-11-22 00:03:42 +00:00
Campbell Barton
1dfbf3a9f6 - aspectx wasnt saved in the render preset
- define a preset base class
- cleanup some comments and whitespace
2009-11-21 23:55:14 +00:00
Thomas Dinges
2351d1c4d3 * Some cleanup for recent preset commit.
* Minor align fix for Frame Rate Buttons.
2009-11-21 22:54:02 +00:00
Campbell Barton
5e7debcecf render presets, select from a directory, button to add own presets 2009-11-21 21:39:20 +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
966b01665b use number keys to set the current brush in paint modes 2009-11-17 16:04:17 +00:00
Campbell Barton
51f2dcd08c - access console languages as modules rather then having the py operator call an operator
- workaround for __getattr__ existing for types that dont support it
2009-11-17 12:21:41 +00:00
Campbell Barton
7636d17af6 property editor for bone and object ID props, add/remove/edit
good example of how editing NON rna data results in very weired scripts :/
2009-11-16 22:53:28 +00:00
Campbell Barton
c2624e1a4f fix for skinning uneven loops, fixed to use even edge removal currently 2009-11-13 19:18:17 +00:00
Campbell Barton
5a322bd67c F8 reload works again, script errors are printed but dont stop loading every other script 2009-11-13 11:10:29 +00:00
Campbell Barton
0750a8dc5c simple fix, still worked on my PC somehow 2009-11-09 09:16:16 +00:00
Campbell Barton
af011f33a6 use the cwd for the shell prompt, use subprocess.getstatusoutput rather then popen() 2009-11-08 12:35:37 +00:00
Campbell Barton
fac2ca1c7c bpy/rna api class feature
- python defined classes will be used when available (otherwise automaically generated metaclasses are made as before)
- use properties rather then functions for python defined rna class's
- call the classes getattr AFTER doing an RNA lookup, avoids setting and clearing exceptions for most attribute lookups, tested UI scripts are ~25% faster.
- extending rna py classes this way is a nicer alternative to modifying the generated metaclasses in place.

Example class

--- snip
class Object(bpy.types.ID):

    def _get_children(self):
        return [child for child in bpy.data.objects if child.parent == self]

    children = property(_get_children)
--- snip

The C initialization function looks in bpy_types.py for classes matching RNA structure names, using them when available.
This means all objects in python will be instances of these classes.
Python properties/funcs defined in ID py class will also be available for subclasses for eg. (Group Mesh etc)
2009-11-08 01:13:19 +00:00
Campbell Barton
30c4c4599d pedantic enum string consistancy 2009-11-07 22:12:03 +00:00
Campbell Barton
ddeb9f8e24 - added console language type
- separated python console from the interactive console
- added shell console type (simple example)
- console types are autodetected and can be selected in the menu
2009-11-06 23:53:40 +00:00
Campbell Barton
44db0b0e27 view docs was broken for operators - was getting the nested class string. 2009-11-05 19:31:38 +00:00
Campbell Barton
be4ceb5fdf Select interior faces, access from the mesh select menu
new mesh functions, remove duplicates in uvproject and mesh_skin
- face.edge_keys()
- edge.key()
- mesh.edge_face_count()
- mesh.edge_face_count_dict()
2009-11-05 12:37:49 +00:00
Campbell Barton
48bc52ea1b fix for editing docs 2009-11-05 10:02:14 +00:00
Campbell Barton
e6ea68a31c - missing return values
- more detailed exceptions (always give file:line incase the python exception doesnt)
- fix some errors in the edit docs

editing docs still fails, need to figure out why.
2009-11-04 22:36:46 +00:00
Campbell Barton
08bbda5005 - Stopping jobs on undo wasnt fixing undo/redo while with render previews as it was supposed to: needed WM_jobs_stop_all rather then WM_jobs_stop because it ends the thread rather then just setting 'stop'.
- gpl header + warning fix
2009-11-04 20:50:09 +00:00
Campbell Barton
3fa8959bb5 - move WM operators out of bpy_ops.py into their own file
- fix operator template
2009-11-04 20:21:08 +00:00
Campbell Barton
4033aba579 new operator directory, move some scripts from io 2009-11-04 14:40:35 +00:00