Commit Graph

207 Commits

Author SHA1 Message Date
Nathan Vegdahl
fb728addd2 Eh... stupid me. Left a duplicate main function in the rig type.
(Tail between legs, walks away shamefully.)
2010-02-03 15:44:19 +00:00
Nathan Vegdahl
11ce6eb4d4 Added a new rig type "shape_key_transforms" that drives shape keys based on the local transforms of a single bone. Quite useful in a variety of situations.
Required options:
    mesh:  name of mesh object(s) to add/get shapekeys to/from
           (if multiple objects, make a comma-separated list)
Optional options:
    loc_<x/y/z>:       name of the shape key to tie to translation of the bone
    loc_<x/y/z>_fac:   default multiplier of the bone influence on the shape key
    rot_<x/y/z>:       name of the shape key to tie to rotation of the bone
    rot_<x/y/z>_fac:   default multiplier of the bone influence on the shape key
    scale_<x/y/z>:     name of the shape key to tie to scale of the bone
    scale_<x/y/z>_fac: default multiplier of the bone influence on the shape key
2010-02-03 15:40:56 +00:00
Nathan Vegdahl
21f1625fd5 Updates to mouth rig. Old method didn't work well in combination with shape keys. This new method (effectively just weighting directly to the lip control bones) is much simpler, but also requires more manual weight painting to get it to look right. 2010-02-02 17:57:12 +00:00
Campbell Barton
039d087171 subtype support for properties in bpy.props. 2010-02-01 22:04:33 +00:00
Martin Poirier
7379e75e12 Fix loading python modules (like netrender) 2010-02-01 01:33:40 +00:00
Campbell Barton
fd3842f3a2 Mathutils doc improvements + other small things
- bpy.app moved into PyStructSequence (used by sys.float_info)
- added buildinfo into bpy.app.build_*
- bpy.ui removed (wasnt used)
- include external example files in Mathutils docs (only Mathutils and Vector are currently written)
- added support to auto document PyStructSequence's
- CMake had "'s inside all its strings.
2010-01-31 21:52:26 +00:00
Campbell Barton
95069f2909 pep8 changes 2010-01-31 14:46:28 +00:00
Campbell Barton
fbadf21b00 pep8 changes to rigify (minor warnings still there)
also found quite a few cases where variables were used that hadnt been defined.
2010-01-31 14:33:27 +00:00
Campbell Barton
22d8742f0d white space commit, so the actual changes in the next commiy wont be so hard to find 2010-01-31 14:30:21 +00:00
Campbell Barton
026b5bacca bugfix [#20638] not loading script in user script directory when startup 2010-01-30 14:48:46 +00:00
Campbell Barton
ec48cbd267 utility functions is_negative_m3 & is_negative_m4, added python Mathutils access Matrix.is_negative
renamed Mathutils attribute wrapped -> is_wrapped
2010-01-30 13:15:39 +00:00
Martin Poirier
21b7556bf7 Add cfg folder for keyconfigs (and possibly others later) to be imported after everything else.
Also remove .pyc file when removing keyconfigs.
2010-01-28 21:52:07 +00:00
Campbell Barton
6f3dfe81c0 missed some files last commit. 2010-01-28 19:21:15 +00:00
Campbell Barton
18ea9b6443 move bpy.load_scripts --> bpy.utils.load_scripts
added sequencer strip length display in seconds
2010-01-28 11:48:06 +00:00
Campbell Barton
478dc000b3 * Mathutils attributes documented - http://www.blender.org/documentation/250PythonDoc/Mathutils.html
* Vector.difference() needed normalized vectors
* bpy.DEUBG -> bpy.app.debug
2010-01-27 21:33:39 +00:00
Campbell Barton
89cd4be1af slice assignment wasnt running the properties update function (setting object layers wasnt working from py)
also commented operator subclassing, loosing py property order.
2010-01-27 17:23:28 +00:00
Campbell Barton
bffad18da8 [#20046] 2.5 "bridge faces" tool doesn't delete original selection
remove this script, its not good enough, remove grease pencil retopo also.
2010-01-26 14:39:01 +00:00
Nathan Vegdahl
fb8d6b9f7a Rigify:
- Removed control-shape deformation bones from the spine rig (no longer necessary thanks to the new "custom shape at" feature).
- Various improvements to the mouth rig, including a corrective shape key for mouth-open.
- The new method of generating into the same armature object every time wasn't copying pose bone data in the process, such as rotation mode and transform locks.
2010-01-26 11:17:41 +00:00
Campbell Barton
3150e4ee12 update tagged objects in the scene after calling each operator, this makes running a set of recorded operators work as expected. 2010-01-26 08:41:16 +00:00
Campbell Barton
c91a0f8adf make exception a bit nicer (since wiki docs dont make much sense how it was before) 2010-01-25 18:09:46 +00:00
Nathan Vegdahl
ede3f0285d Rigify now generates the rig into the same armature every time, so you don't have to re-hook-up things like armature modifiers, parenting, etc.
By default the generated rig object is named "rig".  But you can add a custom "rig_object_name" property to the metarig to specify the name of the object to generate into.
2010-01-25 14:19:12 +00:00
Campbell Barton
0a0f4c9d81 Mathutils refactor & include in sphinx generated docs, (TODO, include getset'ers in docs)
- Mathutils.MidpointVecs --> vector.lerp(other, fac)
 - Mathutils.AngleBetweenVecs --> vector.angle(other)
 - Mathutils.ProjectVecs --> vector.project(other)
 - Mathutils.DifferenceQuats --> quat.difference(other)
 - Mathutils.Slerp --> quat.slerp(other, fac)
 - Mathutils.Rand: removed, use pythons random module
 - Mathutils.RotationMatrix(angle, size, axis_flag, axis) --> Mathutils.RotationMatrix(angle, size, axis); merge axis & axis_flag args
 - Matrix.scalePart --> Matrix.scale_part
 - Matrix.translationPart --> Matrix.translation_part
 - Matrix.rotationPart --> Matrix.rotation_part
 - toMatrix --> to_matrix
 - toEuler --> to_euler
 - toQuat --> to_quat
 - Vector.toTrackQuat --> Vector.to_track_quat
2010-01-25 09:44:04 +00:00
Elia Sarti
265b9344ca Forgot to rename use_return in this script as well. 2010-01-24 19:30:54 +00:00
Campbell Barton
9d96399eeb - panel python template
- nicer syntax to capitalize words
2010-01-23 18:51:56 +00:00
Campbell Barton
3b09e73e58 - bugfix (user supplied fix) [#20745] makesrna with rename error.
- error with last commit, length had an index arg.
2010-01-22 14:59:01 +00:00
Campbell Barton
c6979aa0f4 continue when there are errors on reloading scripts 2010-01-22 14:43:08 +00:00
Campbell Barton
7f1a8a947d initial sphinx doc generation support for python and C modules.
python modules bpy.app, bpy.utils are now included in docs.
C defined python module bpy.props has its docstrings extracted and written directly into sphinx docs since the C methods cant be inspected.

added docstrings to bpy.props and improved some in bpy.utils.

will update online docs tomorrow.
2010-01-22 02:04:25 +00:00
Campbell Barton
8f3f1da080 - temp marker rename in menu (using python or the outliner isnt fun)
- marker selected property
- rigify error formatting error
2010-01-21 19:43:27 +00:00
Campbell Barton
0568f608c4 Patch from Jochen Schmitt, (various distro's had patched this)
- modify the path in python rather then C
- filter returns an object in python 3, set using slice.

also import sys as _sys so it doesnt appier in aytocompleation.
2010-01-20 19:26:23 +00:00
Nathan Vegdahl
c54d54e8ae Rigify:
- Added two driven-shape-key rig types that create and drive shape keys on a mesh/meshes based on the distance or rotation difference between two bones.
- Fixed bug in finger curl rig type where secondary finger controls were not created.  Finger type can also now (optionally) have a hinge switch (useful when using it for wings).
- Changed the blending system in rigify_utils to use copy_transforms constraints instead of copy_loc+copy_rot.
- Finished the quadruped leg type.  Now has both ik and fk control and ik/fk switching.  Also uses a rotating bone to control the knee direction instead of a pole target (seems to work more consistently for quadruped setups).  There's still one annoying bug regarding foot roll, but it's not blocking.  I'll track it down later.
- Mouth rig now creates corrective shape keys on the face mesh for dealing with mouth corners when they spread open.
- Biped arm and leg types now cause mesh to scale when you scale the fk controls.
- Misc improvements to the rig types.
2010-01-19 19:07:09 +00:00
Nathan Vegdahl
40fb29862e Added eyeball and eyelid rig types to rigify.
(First commit!  Let's hope this works!)
2010-01-19 18:52:45 +00:00
Campbell Barton
eedc3c09d1 append/prepend class methods for the header and panels (previously only worked for menus)
Example of adding a button to the view header;

 def draw_custom(self, context): self.layout.operator("some.operator")
 bpy.types.VIEW3D_HT_header.append(draw_custom)
2010-01-18 16:47:26 +00:00
Campbell Barton
e723b060fc python script reloading (f8)
- reload modules from types that are not directly included. for example wm.py uses classes from modules/rna_prop_ui.py which wasnt reloaded.
- script paths were being added to sys.path multiple times.

note: now the second reload gives a crash right away but this is a bug elsewhere.
2010-01-18 10:02:55 +00:00
Campbell Barton
381e926600 fixed sphinx doc generator
- arguments, return values indentation means they get correctly interpreted by sphinx
- functions with no return values were displaying return as ()
- return values were getting the '(optional)' added in some cases.

Example:
http://www.blender.org/documentation/250PythonDoc/bpy.ops.object.html
2010-01-17 20:59:35 +00:00
Campbell Barton
58f13d469e UV mirror tool (copies UVs from one side of the mesh to the other)
WIP, suffers from editmode bug where editmode python tools cant have redo-options set. and needs options for precission.
2010-01-13 17:58:26 +00:00
Campbell Barton
59dfd24f75 - bugfix [#20654] the property edge_face_count of the Mesh-Object does not work
- remove unneeded particle function
2010-01-12 18:33:21 +00:00
Campbell Barton
f6c79c553b [#20646] 2.5 does not load python scripts with multiple dots in the filename
- not a bug so add a warning if people add scripts with invalid names like this.
2010-01-12 10:04:03 +00:00
Campbell Barton
20df075e38 new rig types from Cessen 2010-01-10 19:20:48 +00:00
Campbell Barton
c723251cc0 rename rig types not to have generic in the name (Cessens decission) 2010-01-10 18:59:32 +00:00
Campbell Barton
57e96e4472 patch from Cessen, update to metarigs and some changes to the rigging main loop.
- property names dont need the bone type prefix anymore
- always add a root bone that all non parented bones are parented to
- x/y/z axis properties for bones.
2010-01-10 18:53:15 +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
b8ca67ca33 custom properties panels for most ID types. use subclassing to keep panel UI definitions minimal 2010-01-08 08:54:41 +00:00
Campbell Barton
e49e9289f0 - leg_quadruped_generic missing imports
- move global pivot in the UI of userprefs since others are closer related
2010-01-06 22:38:51 +00:00
Joshua Leung
a9861e3381 Durian Request: Drivers Recode
Highlights:
* Support for Multi-Target Variables
This was the main reason for this recode. Previously, variables could only be used to give some RNA property used as an input source to the driver a name. However, this meant that effects such as Rotational Difference couldn't be used in conjunction with other effects and/or settings to achieve the powerful results. Now, a variable can take several input targets, perform some interesting operations on them, and spit out a representative value based on that.

* New Variable Types
With the introduction of multi-target variables, there are now 3 types of variable that can be used: single property (i.e. the only type previously), Rotational Difference (angle between two bones), and Distance (distance between two objects or bones).

* New Driver Types
In addition to the existing 'Average', 'Sum', and 'Expression' types, there is now the additional options of 'Minimum' and 'Maximum'. These take the smallest/largest value that one of the variables evaluates to.

* Fix for Driver F-Curve colouring bug 
Newly added drivers did not get automatically coloured in the Graph Editor properly. Was caused by inappropriate notifiers being used.


Notes:
* This commit breaks existing 2.5 files with drivers (in other words, they are lost forever). 
* Rigify has been corrected to work with the new system. The PyAPI for accessing targets used for the variables could still be made nicer (using subclassing to directly access?), but that is left for later.
* Version patching for 2.49 files still needs to be put back in place.
2010-01-04 21:15:45 +00:00
Campbell Barton
c79cf56b69 dict.get() defaults to None as the second arg. no need to supply it. 2010-01-04 21:10:51 +00:00
Campbell Barton
589b2b4ca8 object.group_users, object.scene_users
utility functions to find the groups and scenes this object is used in.

button to set the group location from the cursor (UI is horrible but not any nice place to add?)

smarp project would fail if there were linked meshes in the scene, made ID.tag ignore the library, so you can tag linked data since its only for tools to use.

normalize the vertex normal before setting and use inline vector functions.
2010-01-04 15:37:22 +00:00
Campbell Barton
24a2c6e9bc bound box check for retopo grease pencil convertsion before spline intersection checking 2010-01-03 13:17:12 +00:00
Campbell Barton
18d37648ba grease pencil retopo improvement: join lines when endpoints match are close and are co-linear within some error limits.
still very slow, needs some speedups.
2010-01-03 01:30:07 +00:00
Campbell Barton
d8d11c55d9 patch from Cessen
Adds a new set of bones to rig types which are to be used for weight paint vgroups, in some these have some more segments to account for twist. also use Aligoriths new copy transform constraint.
2010-01-02 23:43:46 +00:00
Campbell Barton
04d0261c37 new python submodule. eg.
from bpy.app import binary_path, version, version_string, home

can add constant variables from blender here as needed (maybe functions too... bpy.app.memory_usage() ?)
2010-01-02 23:14:01 +00:00