Commit Graph

20514 Commits

Author SHA1 Message Date
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
4e61f8a836 pep8 whitespace commit
bpy/rna api (no functionality change, just move getting the srna py base into a function)
2009-11-07 22:07:46 +00:00
Martin Poirier
5bb88685ca fluid cache need a +1 offset, their frame 0 is blender frame 1 (fun stuff) 2009-11-07 17:47:54 +00:00
Arystanbek Dyussenov
7b96bc00d5 Merge -c 24393 (patch by Jan) from COLLADA branch. 2009-11-07 14:34:04 +00:00
Campbell Barton
f25bc95688 missed committing this file (from Stani's patch) 2009-11-07 14:17:49 +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
6e47d9bb9c - modal keymap for border select
- revert circle select keys adjustments & view navigation while selecting (durian guys liked but allowed activating multiple circle select's at once)
2009-11-06 22:51:08 +00:00
Campbell Barton
e2f01e4c7c api changes suggested by Stani 2009-11-06 22:42:15 +00:00
Brecht Van Lommel
5a5646934c Fix for transform orientation fix, probably forgot to commit this? 2009-11-06 22:10:08 +00:00
Brecht Van Lommel
f21d0bacf7 Bugfix: crash in posemode transform buttons with no active pose bone. 2009-11-06 21:41:07 +00:00
Martin Poirier
0b027b4097 Make orientation matrix access function public.
Fix bug in previous code: passing 3x3 matrix to a function expecting a 4x4 (warnings are for something)
2009-11-06 21:31:14 +00:00
Thomas Dinges
5c3a365ac4 * Added "Align View to Selected" to the View > Align View menu.
Patch by Jeff Doyle (nfz). Thanks!
2009-11-06 21:10:45 +00:00
Brecht Van Lommel
0ffdcfecb3 B.blend.c update. Only change is that brushes and panels are not saved, so
that they will be recreated with defaults settings/order.
2009-11-06 14:46:07 +00:00
Campbell Barton
4e9699debf experemental durian request, allow view manipulation while using circle select 2009-11-06 12:43:20 +00:00
Campbell Barton
aa7374e471 - removing the last particle system now exits particle edit mode.
- py UI script used an undeclared variable
2009-11-06 12:27:28 +00:00
Joshua Leung
5a12b7d159 Driver Scripting:
Added RNA functions for adding and removing Driver Targets. Unfortunately, I couldn't do this by simply adding callbacks for the add/remove of the collection, as I've had to add to extra RNA functions to do that.

Example usage - driving Lamp Distance with Cube LocZ:
myOb= bpy.data.objects["Lamp"]
myOb.driver_add("data.distance")

# drivers is list of F-Curves that have driver data
drivers= myOb.animation_data.drivers
distDriver= drivers[0].driver 

dtar= distDriver.add_target("ctrl1")
dtar.id_type= 'OBJECT'
dtar.id= bpy.data.objects["Cube"]
dtar.rna_path= "location"
dtar.array_index= 2
2009-11-06 11:09:04 +00:00
Campbell Barton
d4fe2595f7 bring back align to view to object
- In 2.4x this was numpad *, however that would only align on the Z axis.
- New behavior for VIEW3D_OT_viewnumpad, holding Shift with Numpad 1/3/7 sets the left/top/front etc on the normal axis.
- Uses active bone, face, edge, vert, curve handel & object (just like the view manipulator with 'Normal' selected).
2009-11-06 10:38:00 +00:00
Campbell Barton
cc2476fde5 patch from Stani, support for function arguments in autocomplete 2009-11-06 08:53:07 +00:00
Joshua Leung
e1e6391a0b Fix for scons + mingw compiling
Removed the special exception for booleans lib priority, which was needed in the past to get it compiling ok with the src directory.
2009-11-06 08:32:50 +00:00
Benoit Bolsee
d315af74f0 Update MSVC project files for openCollada. 2009-11-05 21:34:47 +00:00
Brecht Van Lommel
6771a0cb6d Fix #19763: crash with tooltip open & maximizing area to fullscreen. 2009-11-05 20:51:36 +00:00
Kent Mein
bb0f4310aa Simple one liner....
Added options to add Flip normals to toolbar.  (iCer on irc is responsible)

Kent
2009-11-05 20:35:36 +00:00
Brecht Van Lommel
43d916c08a Fix bug #19754: alt + scrollwheel to change button values was not
working in popup menus, silly workaround now until this uses modal
keymaps.
2009-11-05 20:32:46 +00:00
Brecht Van Lommel
c0bfa4e462 Fix for bug #19692: setting text on curve, bevel or taper object did
not update dependency graph causing missing updates.
2009-11-05 19:32:10 +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
Brecht Van Lommel
17c323b5a4 Fix for bug #19817: cloth simulation with collision slow on Mac.
The cause of this is in the bullet library, seems like some kind
of poor handling of many repeated allocations by Mac OS X, but the
allocation is unnecessary, so removed it.

Patch submitted to bullet:
http://code.google.com/p/bullet/issues/detail?id=303
2009-11-05 19:06:29 +00:00
Campbell Barton
aec92ddc51 operator to select pos/neg verts on any axis relative to the active vertex
- useful to select the center verts of a model without having to attempt to border select
- useful for selecting one half or a model
2009-11-05 18:29:48 +00:00
Brecht Van Lommel
1196947a98 Fix makefiles for modifiers commit. 2009-11-05 18:17:18 +00:00
Brecht Van Lommel
1e40adddc7 2.5 Modifiers: mesh deform, boolean and decimation work again. 2009-11-05 18:05:55 +00:00
Campbell Barton
bdfa652605 adding group instances didnt do an undo push 2009-11-05 17:43:23 +00:00
Campbell Barton
8109b13e83 - converted circle select use a modal map
- now works exactly like 2.4x, except that its accessed from the CKey
- hack to remember circle size, need some better way to do this
2009-11-05 17:32:06 +00:00
Brecht Van Lommel
aec5fb9804 Fix warnings in RNA, one being an actual bug in setting an object's layer. 2009-11-05 17:28:10 +00:00
William Reynish
93b2ed3822 Moved the object and bone name fields out of the Transform panel in 3Dview properties. They're in a new panel now called 'Item'. Needs an update in the B.blend to put it on the top. 2009-11-05 17:22:11 +00:00
Brecht Van Lommel
82baca3f36 Fix for bug #19807: renaming texture layers in editmode crashes. 2009-11-05 16:40:12 +00:00
Campbell Barton
18e069f486 only run the banner function for console (not reports) 2009-11-05 16:30:18 +00:00
Campbell Barton
0f1e28a13f - circle select mouse wheel resize now works (somehow mouse wheel generates a mouse up event)
- context.active_bone wasnt set to an editbone type
2009-11-05 15:59:14 +00:00
Campbell Barton
5481549725 was setting the active material on exit editmode rather then enter 2009-11-05 14:54:02 +00:00
Campbell Barton
59eaa1ff50 last commit broke entering editmode 2009-11-05 14:42:39 +00:00
William Reynish
2907c6fdf0 Moved the buttons around slightly in shape keys, to make it clearer what is action buttons, and what is toggles. 2009-11-05 14:31:17 +00:00
Campbell Barton
b1ac71b3a0 enter editmode when adding objects even if the object is not in an active layer,
useful for python but in rare cases this also happens for users.

Active layer getting out of sync is an old bug but hard find when it happens.
This at least fixes segfaulting on adding objects.
2009-11-05 14:25:08 +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
247f72fcc0 - added bpy.context to the python module
- made the console banner printing function into a python operator (includes sys.version)
- added 'C' into the consoles default namespace for convenience
2009-11-05 11:17:09 +00:00
Campbell Barton
cacd68c335 python console autocomplete would crash (missing NULL check for pose channels)
add rna functions id.animation_data_create() and id.animation_data_clear() - works for all ID types that support animdata.
2009-11-05 10:50:58 +00:00
Joshua Leung
06d5d53a24 Bugfixes + Spline IK Tweaks:
* #19819: 'Select' operator for Hooks was crashing when Hooks didn't have any vertices assigned yet

* Default twist resolution mode for curves is now 'Minimise'. This seems to work better for Curve Deforms and other purposes. Can be changed if other ways are better after some more testing.

* Spline IK now has more options for controlling how the x and z axis scaling is determined. There is now a choice between using the radius of the curve, the x+z scaling from the bones, or no scaling (default). This does break old files a bit, but this is to have a more stable base for later.
2009-11-05 10:09:45 +00:00
Matt Ebb
751f07d6d4 Fix for error in previous fix - oops ( [#19818] ) 2009-11-05 10:02:29 +00:00
Campbell Barton
48bc52ea1b fix for editing docs 2009-11-05 10:02:14 +00:00
Matt Ebb
0b2bc7785d * Fix for [#19700] undo doesn't display visual feedback on lattices
Depgraph update was commented out in undo system because of globals, restored this with new context/id-based depgraph

* Fix in UV editor UV menu
* Slightly nicer default names for adding forcefields with Add menu
2009-11-05 09:57:43 +00:00
Joshua Leung
63d6d6cb74 Armature Editing Bugfixes:
* #19790: Circle Select doesn't work for Armature edit mode or pose mode
* Duplicate bones (Shift-D) was calling the wrong operator. This now uses the macro version, instead of the copy only.
2009-11-05 08:54:33 +00:00
Matt Ebb
ce973efd4f Fix for [#19780] pivot for rotation/scaling doesn't use "active vert/edge/face"
Martin please doublecheck, but it should be all good.
2009-11-05 04:37:42 +00:00