* Reorganised all animation-related file-writing code to be in the same area in the code, and clearly marked which parts of code are only used to ensure we can load old files to version-patch.
* Added file reading code for new datatypes, so it is possible to load the quit.blend file saved from the previous session. Version patching to work with the new system has yet to be done...
* Assorted whitespace fixes in places I skimmed through...
* slightly improved drawing code
* temporarily added creation of thumbnails within thread in the background until thread job manager is available in WM.
* fixed missing icons in thumbnail view
Python operator api was using WM_operator_name_call() which was confusing things too much.
Added WM_operator_call_py() which ended up being a very small function and split out operator creation into wm_operator_create()
Python operator now runs the poll() function and raises an error if it fails.
Eventually there should be error messages for poll that python can use to give the exact reason for failing (eg - library linked data, no active object...)
* Removed nAction struct. We'll be using good ol' bAction structs again, but putting new data in a different list. Apart from that, the data is similar enough to do so.
* Rearranged code in DNA_action_types.h while renaming the structs to avoid confusion over what is currently in use...
* Added freeing and AnimData execution loops for many other ID-types too. (NOTE: I've added AnimData in NodeTree struct too, but it's not clear to me where the relevant data-management calls should go in Nodes code).
* File writing code should now only write the new data to files
(when in debug "-d" mode only)
copy & paste duplicate and transform operations can now be copied from user input and pasted into ./test.py and run with the Pkey (fixed some minor bugs preventing this)
Would be nice if the "mode" setting used a proper RNA Enum rather then an int.
# example, duplicate and transform
bpyoperator.OBJECT_OT_add_duplicate(mode=1)
bpyoperator.TFM_OT_transform(mode=1, options=0, values=(-1.23989, 0.570745, 0, 0), constraint_orientation=0, constraint_mode=0, constraint_matrix=(0, 0, 0, 0, 0, 0, 0, 0, 0))
******
-ported some of the Object mode select menu to use uiDefMenuButO
- select random/layer still uses the hard coded value as no sutible popup exists
- select by type suffers from random crashes, somthing to do with Context
- need some way of doing sub menu's using the operator's invoke
- the old menu is just #if'ed out
- and did a little hous cleaning aswel
- added some undo pushes to the select operators
- mouse select, loop select, select linked, unlink selection operators.
- added edge selection mode.
- fix 2.45 bug with unitialized theme colors, which caused the active face
and face centers to be not drawn.
- Added shift+d duplicate for object and editmode mesh.
Note it uses WM_operator_name_call(), which is fine now,
but in future might put again 2 undo's and operators on
the stack.
Will have to spend some time on how Macros will work!
- added itterator CTX_selected_editable_objects()
(named it first "edible" but that was too funny!)
Also cleaned object_edit.c to use this correctly.
- added CTX_wm_view3d(), especially for hybrid tools
that *can* use view3d, but don't have to.
- moved debug -d print for operators to the real invoke call
Cleanup warnings from Joshua's commit (mostly unused variables,
but also used functions that were not prototyped).
Two bugfixes; passing on &ob->adt instead of ob->adt
But; the DNA system is now messed up, with two structs using
the same ID (nAction and bAction), that goes horrible wrong!
* Made AnimData blocks be stored as pointer instead of directly in the ID-datablock, so that fewer files will need to be recompiled everytime some animation settings change.
* Tried to fix some of the compiler errors that pop up in Yafray code. If this commit doesn't fix it, just disable Yafray code for now (WITH_BF_YAFRAY=0 for scons)...
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future.
Highlights of the new system:
* Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action.
- F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves.
- The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc.
* F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated.
* Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place)
* F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place)
* NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still)
There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details:
http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html
So, what currently works:
* I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code.
* Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock.
* Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc.
Notes:
* Drivers haven't been hooked up yet
* Only objects and data directly linked to objects can be animated.
* Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change).
* Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor)
* I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review.
In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
* Added more compact property definitions, with a single function.
Only used by operators at the moment, would need to tweak regular
expressions a bit more to use it also for other RNA definitions.
* The operator properties defined now were completed a bit more but
still have many issues that need to be adressed, specifically;
* Some properties that should be booleans or enums are defined as
ints, note that ints are only for numeric values, not bitflags
or multiple choice.
* Soft/hard limits and default values of many properties are not
well defined still,
* Inconsistent naming, especially for example mouse locations or
bounds are named differently in different places. Also mouse
locations and other vector like properties should become a single
vector property instead of multiple X/Y properties.
* Almost no properties have descriptions, these would be good to
have for docs and tooltips.
So, please verify that the properties of the operators you wrote are
well defined.
- Finished adding primitives in Mesh editmode.
For test pleasure: hotkeys CTRL 0-9 add them.
More fun for testers:
- F3: gives menu of all registered ops. You can use
it too, it then execs it again, and makes it the
last executed operator.
- F4: executes last registered operator without menu.
- Depricated another bunch of globals; all the totobj,
totmesh, totvert, and so on.
- All code that needs such totals now count it themselves,
these stats were not supposed to be reliable
- Editmesh now stores and manages own totals.
- Todo: make a scene->stats that tracks notifiers.
Bugfix: selecting failed in editmesh, backbuffer stuff was
too late, already using index ranges before it was set.
Organized as follows:
uvedit/
uv editing related code
uvedit_draw.c: drawing code
uvedit_ops.c: operators, just a few done
uvedit_unwrap_ops.c: will be operators for unwrapping
uvedit_paramatrizer.c: lscm/abf/stretch/pack
space_image/
space_image.c: registration and common getter/setters
image_draw.c: drawing code, mostly functional
image_panels.c: panels, all commented out
image_render.c: render callbacks, non functional
image_ops.c: operators, only view navigation done
image_header.c: header, menus mostly done but missing buttons
Notes:
* Header menus consist only of Operator and RNA buttons, if they
are not implemented they're displayed grayed out. Ideally the full
header could work like this, but std_libbuttons looks problematic.
* Started using view2d code more than the old code, but for now it
still does own view2d management due to some very specific
requirements that the image window has. The drawing code however
is more clear hopefully, it only uses view2d, and there is no
switching between 'p' and 'f' view2d's anymore, it is always 'f'.
* In order to make uvedit operators more independent I move some
image space settings to scene toolsettings, and the current image
and its buffer is in the context. Especially sync selection and
select mode belonged there anyway as this cannot work correct with
different spaces having different settings anyway.
* Image paint is not back yet, did not want to put that together with
uvedit because there's really no code sharing.. perhaps vertex paint,
image paint and sculpt would be good to have in one module to share
brush code, partial redraw, etc better.
* Work around bScreen/Screen DNA name patching, so bScreen does not
require manual callbacks to be written for properties.
* Added SpaceLink and SpaceImage RNA.
* Fix issue initializing ID property arrays with default values.
DNA
* Some DNA changes for space image.
* And a fix for corrupt clone image pointer in reading brushes.
* View2D to region now returns ints instead of shorts.
* Use "Numpad" instead of "Pad" in automatic keymap menu info.
* Menus can now use buttons other than BUTM and SEPR, in
particular TOG and ROW are now supported instead of flipping
bits manually.
* Added a simpler uiDefMenu* api for making menus now, and it
only supports Operator and RNA buttons at the moment, will be
used in next commit. Not sure how this will evolve .. makes
menu code look cleaner anyways.
* Ensure that interface code doesn't crash when getting unknown
Operators and RNA properties, and display their buttons grayed
out in that case.