Commit Graph

114 Commits

Author SHA1 Message Date
Campbell Barton
3535be3f6f patch from Cessen, tweaks and fixes to metarig elements 2009-12-09 22:44:26 +00:00
Campbell Barton
daf043b3fe if bone type root is defined, all new parentless bones become children of it 2009-12-09 15:13:03 +00:00
Campbell Barton
5dd68e8cb6 some more rig options, fix typo 2009-12-09 14:29:55 +00:00
Campbell Barton
a41131db24 - added editbone.matrix, readonly, utility property that calculates the matrix from the bone roll
- spine fixes
- arm now uses the average Z axis to place the poll target
2009-12-09 14:25:56 +00:00
Campbell Barton
d6c583cc54 - use the bone that the type was set for automatic assigned blending property (when blending 2 chains)
- delete the type property from the generated rig so running again wont confuse things
2009-12-09 12:36:13 +00:00
Campbell Barton
0e713ba1d0 - rewrote arm rig so it creates 2 chains and blend them automatically (like the leg)
- use reverse order for palm fingers (pointer first)
- allow copying bone class instances to exclude some bones
- doc generation had a python error (incedently updated online docs linked from the splash)
2009-12-09 12:00:28 +00:00
Campbell Barton
ee74e720a8 - modify for Cessens updated spine
- Neck example didnt account for some possible problems when linking to the body
- foot IK were referencing the wrong bones
- updated some example rigs
- graph constraint arrow direction was incorrect
2009-12-08 17:00:53 +00:00
Campbell Barton
fb7fed6706 minor fixes 2009-12-08 14:02:06 +00:00
Campbell Barton
fccceaa87f - pyrna support for (value in array), currently only 1 dimensional arrays.
- use python malloc's in bpy_array.c
- automatically blending bone locations is disabled if the target bone has locked location
- neck had incorrect roll
2009-12-08 09:40:30 +00:00
Campbell Barton
f4fa39a551 white space commit (spaces -> tabs and clearing whitespace) 2009-12-08 07:11:43 +00:00
Campbell Barton
ce49719a0c use the SUM driver type to avoid adding all values on each bone.
also avoids hitting the 255 string limit if you want to add 100's of values. eg.
>>> b05/max(0.001, [globals().update({"LOCALS":locals(), "ADD":float.__add__, "reduce":__import__("functools").reduce}), 0.0][1], max((, [LOCALS["b%.2d" % (i+1)] for i in range(5)])))

Since this more simple expression reaches the limit fairly quick...
>>> b05/max(0.001,b01+b02+b03+b04+b05)
2009-12-07 20:49:12 +00:00
Campbell Barton
f8f7f57557 - bone.basename now only gets the name before the first '.', since names like finger.01.L are common
- updated delta not to remove a bone
- spine and neck rigs interpolation bones are now axis aligned to the control bone
- palm tag is expected on the pointer finger rather then the wrist
- operate on bone children first working up the chain (not essential but more pradictable)
2009-12-07 17:21:30 +00:00
Campbell Barton
926201acf8 - string copy without .py wasnt terminating the string
- console import autocomplete wasnt including modules defined in C like BGL, Mathutils
2009-12-07 14:09:53 +00:00
Campbell Barton
750764f411 rna flag PROP_ENUM_FLAG which makes rna props a tuple of enums when converted into a PyObject
only used by wm.invoke_props_popup() currently
2009-12-07 00:16:57 +00:00
Campbell Barton
062cf438ce remove nasty hack which made StructRNA class instaces have no __dict__,
use __slots__, it seems all the parent classes need to have slots as well for this to work.
all python defined srna classes are checked for this too
2009-12-05 23:41:45 +00:00
Campbell Barton
5ebe54f470 pep8 edits and fix some warnings 2009-12-05 22:03:07 +00:00
Campbell Barton
651336d5df fixes for automatic tests and some errors in last commit 2009-12-05 20:45:51 +00:00
Martin Poirier
bcd1ab54cd Support for the C Macro system in Python.
Basic definition works like a python operator but you derive from "bpy.types.Macro" instead.
Operators are added to the macro after it has been added with "bpy.ops.add_macro" through the class method "define" which takes an operator id and returns an OperatorMacroType (new RNA type) for which properties can then be defined to be passed to the operator when run.

Example: http://blenderartists.org/~theeth/bf/macro.py

Using this system, it should be easy to add an operator to the console that converts selected lines into a macro or even a more generic record macro system.
2009-12-05 19:27:26 +00:00
Campbell Barton
65edb7341f split up metarig hierarchy evaluation and modifying the metarig into 2 steps,
original bone names cant be changed anymore but this means the bones can be re-parented without confusing scripts that run after the rig is modified.
support for defining a bone to have multiple types and  automatically blending between 2 generated rigs
2009-12-05 19:26:28 +00:00
Guillermo S. Romero
648122b1a2 String fix and a bunch of PEP8 issues I had collected in the meanwhile. 2009-12-04 17:54:48 +00:00
Campbell Barton
19c0a169b8 touches for demo'ing 2009-12-04 16:35:31 +00:00
Campbell Barton
a9b9993414 rna function
editbone.align(vector), to align the bones z axis to a localspace direction.

finished leg rig pose mode data
2009-12-04 02:32:34 +00:00
Campbell Barton
ab1290d62e leg rig type & metarig example, still need to add IK's
fixed some small bugs too.
2009-12-03 22:44:11 +00:00
Campbell Barton
3b0e182f71 - property decorators for setting attributes didnt work, hack to prevent every instance of an BPyStructRNA to have its own dictionary, set the tp_dictoffset to 0. attempted to use __slots__ but this doesnt work for some reason.
- made bone.length writable
2009-12-03 21:53:01 +00:00
Campbell Barton
685d418f3a - curve geometry curve panel wasnt displaying with no active spline
- graph export didnt work for constraints with no subtarget
- utility functions for duplicating a set of bones and blending between 2 sets
2009-12-03 14:20:35 +00:00
Campbell Barton
7706261e79 change bone storage class so __slots__ can be used for looping over attributes without getting functions 2009-12-02 19:13:54 +00:00
Campbell Barton
e2450e4dd9 multiple script paths broke text template menu 2009-12-02 16:11:10 +00:00
Campbell Barton
ce36cdac04 - bpy.data.add_armature()
- rigify testnig function, creates all example metarigs, processes and generates graphs for before and after.
2009-12-02 15:37:07 +00:00
Campbell Barton
2bf618368a - include example input rigs for each autorig type, running metarig_template() in each submodule generates the armature and pose bone ID properties.
- rigify.write_meta_rig() exports rigs as python scripts
2009-12-02 11:55:47 +00:00
Campbell Barton
8c5d021d19 rename armature RNA props
armature_matrix --> matrix_local
armature_head --> head_local
armature_tail --> tail_local
2009-12-02 10:32:39 +00:00
Campbell Barton
50c8c28c60 - finished spine rig generator, (drivers, constraints)
- bug with args passed for class slots being modified in place.
- sort graphviz bones & drivers (useful for diffing 2 armatures)
2009-12-02 02:56:22 +00:00
Campbell Barton
c27f3adadc - rig spine type WIP, editmode done, still needs pose constraints and drivers.
- bone.translate(vec) utility function
2009-12-01 22:45:56 +00:00
Campbell Barton
48398c978e more small fixes 2009-12-01 12:43:06 +00:00
Campbell Barton
2afc967a2f small fixes, also option for fake parent so hierarchy is always from the parent down 2009-12-01 12:25:59 +00:00
Campbell Barton
0391000c4e export an armature to graphviz showing hierarchy, constraint and driver relationships, useful for understanding other peoples complicated rigs.
can be extended for 2.4x oops like graph too/

Example of Cessens spine rig
http://www.pasteall.org/pic/show.php?id=378
2009-12-01 12:02:23 +00:00
Campbell Barton
99e765ee00 added autorig neck type
new bone properties
- bone.basename (name without the extension), "Some.Bone.001" --> "Some.Bone"
- bone.children_recursive_basename, gives a chain of children that have the same basename
2009-12-01 00:44:53 +00:00
Campbell Barton
33c444f965 User Script support added back.
- the scripts path set in the user preferences or ~/.blender/scripts/ui (io, op, io etc..) will be used to load scripts.
- the default home dir part probably only works in *nix os's

- Added a missing sync callback to vector.toTuple()
2009-11-30 22:32:04 +00:00
Campbell Barton
a2140192fe convert rigify into a package. advantage is new types can be added into the package without modifying any existing files, the bone 'type' property will find the matching submodule 2009-11-30 12:31:11 +00:00
Campbell Barton
e1ba5517e6 better remove doubles for retopo, use 15th the of the average of both splines lengths (less scale dependant) 2009-11-30 11:18:46 +00:00
Campbell Barton
e526047061 retopo: use a smaller scale for faces that are modeled where 1.0==1m, will eventually try to use a method that doesnt depend on scale like this
grease pencil point.co wasnt a vector when it should be
2009-11-30 10:21:42 +00:00
Campbell Barton
9b0a3ee9ce previous commit for retopo converted the strokes into a curve first, better to use the grease pencil data directly. renamed coordinates --> co, matching mesh verts 2009-11-30 02:34:49 +00:00
Campbell Barton
dc1af66d8a - grease pencil drawing on the surface of objects (only when enable face snap & projection, a bit hidden I know)
- retopo operator to convert grease pencil drawn topology into geometry, not in the convert menu yet since its not quite finished, use the operator search menu for retopo. will test this week and see what needs fixing.
2009-11-30 01:13:46 +00:00
Campbell Barton
2bef608fb3 - new objects added from the rna api defaulted to quat rotation, not even using an identity quat.
- making meshes in python isnt nice at the moment, added a helper function.
    mesh.from_pydata(verts, edges, faces)
2009-11-29 23:14:41 +00:00
Campbell Barton
2e61294cbc simple fixes
[#20123] "Import" menu entry becomes empty
[#20141] In Object menu Make Links appears twice - SVN 24970

also moved OBJs name cleaning func to bpy.utils.clean_name(name, replace="_")
2009-11-28 20:50:31 +00:00
Campbell Barton
c3884d9547 shoulder improvements, fixes for linking arm/palm/finger together 2009-11-27 17:07:50 +00:00
Campbell Barton
552134db45 new palm rig type + some refactoring to make names less confusing for the arm rig
linked text would not run
2009-11-27 13:24:04 +00:00
Campbell Barton
68b100232b basic support for Sintels arm rig with property driven ik/fk switching and stretch bones to display connections, still need to do shoulder hinge and hand delta offset bones 2009-11-26 13:36:15 +00:00
Campbell Barton
b40307df16 add access to bone add/remove from rna. eg.
bone = arm.edit_bones.new("SomeBone")
 arm.edit_bones.remove(bone)

regify (WIP)
2009-11-25 11:05:11 +00:00
Campbell Barton
ff5276b0ce - use a generic bone class so all 3 bone types (Edit/Pose/Armature) - can have the same utility functions, length, parent_recursive, parent_index(), etc
- change the wiki url to avoid redirects (from Luka)
- removed pose prefix from pose_head/pose_tail/pose_matrix
2009-11-24 11:58:49 +00:00
Campbell Barton
d55ac4da2b - added rna api function scene.update(), needed for rig generation to update driver deps
- removed some warnings
2009-11-24 09:24:32 +00:00