Commit Graph

109 Commits

Author SHA1 Message Date
fcbfd29796 Fix combined pose + weight paint mode, was using wrong object
in a few places, missing some checks.
2009-09-19 15:48:47 +00:00
cf20399993 Pointcache:
* reset on object transformations
2009-09-13 23:58:03 +00:00
83074d0b37 2.5 - More work on Axis-Angle Rotations
* Added a few new methods for axis-angle conversions, and used these instead of manually performing those steps elsewhere
* Axis-angles to other representations now get their axes normalised to make sure that odd scaling doesn't occur.
* Made a few more tools work with axis-angles properly
2009-09-12 05:06:28 +00:00
baf12d3d17 2.5 - Rotation work (axis angle bugfixes + cleanups)
* Made transform work better with axis-angle
* Corrected the rotation-type handling code in a few places
2009-09-11 12:44:09 +00:00
d5009eb142 2.5 Rotations: As a experiment, enabling Axis-Angle for Bones
The support for this is really quite hacky, and I might disable this later if we cannot get some parts to work nicely. 

Some notes:
* This is currently stored in the same variable that quaternions are stored in, since they both have 4 components. However, in RNA, I've added 2 properties specially for this. 
* There are some shearing issues using certain axes - i.e. (1,1,0) - that will need to be checked on.
* Transform code is really quite temporary for this. Just a quick demo of what can be done...
2009-09-11 12:05:09 +00:00
1d0a567023 Curve/Surface Editing
- rename "Nurb" to "Spline" in RNA, eg. bpy.data.curves[0].splines[2].type == 'NURBS'
  from a user perspective spline is a more generic term while Nurb is misleading when used for beziers and poly lines.

- added curve.active_spline property so the python UI can display the last selected curve.
  
- set the active spline when entering editmode (uses first selected spline)
  
- added back Hide Handles as a curve property (removed the global flag), access from the view panel in editmode.
  
- added hide normal option for curve, normal size access for curve and mesh display.

- changing orderU/V, endpoints, cyclic, bezierU/V now work in editmode and calls update functions.

- entering editmode was crashing with text objects

- curve.switch_direction() crashed (own fault from last commit)

- Tkey for tilt was overridden by Toolbar, made Tilt Ctrl+T.

- OBJECT_OT_mode_set check for compatible modes before running - so curves dont try go into paint mode with V key for eg.
2009-09-08 07:35:07 +00:00
8b6b31b41f Made Nurb->type only store the type rather then mixing the type with flags.
moved CU_2D to Nurb->flag in do_versions
This made simple type checks confusing to read.

many... if( (nu->type & 7)==CU_BEZIER)
replaced with ... if(nu->type == CU_BEZIER)

made setting rna curve_2d clamp the Z values. still more RNA/UI changes to do.
2009-09-08 00:23:33 +00:00
08b8fc34cf Disconnect/connect hair:
- Moves hair from face-space to global space and back.
- Allows for editing of emitter mesh after hair combing.
- Disconnect hair before doing topology changing changes in mesh edit mode, connect after changes.
- Notes:
	* The closest location on emitter surface to the hair root is used to connect the hair.
	* Emitter deflection, sticky roots and add brush don't apply for disconnect hair in particle mode.
- Todo for future:
	* Copy disconnected hair from object to another (when 2.5 has proper copy operators again).
	* Possible automatic disconnect/connect with topology changing operations in mesh edit mode.
	
Other changes/fixes:
- Proper subtypes for some particle mode notifiers.
- Particle mode selections didn't draw correctly because of using lighting for the paths.
2009-09-05 20:12:08 +00:00
7df35db1b1 2.5
Notifiers
---------

Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:

* Geometry changes are now done with NC_GEOM, rather than
  NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
  notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
  should only be used for notifying about changes in space data,
  we don't want to go back to allqueue(REDRAW..).

Depsgraph
---------

The dependency graph now has a different flush call:

DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)

It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.

Docs
----

I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 20:51:09 +00:00
a819ef1bf2 2.5 - Keyframing Bugfixes + Code Cleanups
* DopeSheet + Graph Editor - 'Sample Keyframes' option now tags newly created keyframes as being breakdowns. Also moved reduced the code duplication here by moving the core code for this to the animation module.

* Keyframing (Standard/Auto) - Added proper 'replace' option
Keyframes can now be rekeyed non-destructively when the INSERTKEY_REPLACE flag is provided to the keyframing API functions, since this option will make sure that only the values of the handles get altered.

For the Auto-Keyframing 'Replace/Edit Keys' option, this means that it truly works as it describes now, since it will now only replace the values of the keyframes on the current frame, and won't create new keyframes in the process or destroy the tangents already created for those keys.

For things like the sliders in animation editors, keyframes changing the value won't destroy existing tangents.
2009-09-04 04:27:06 +00:00
bd7d26993f 2.5 - Rotation Order Tweaks for Armature Bones
* All tools where rotation order matters for armature bones have now been adjusted to use the new code

* Transform now uses the new code for bones too. However, there are some jumping issues here that I'm not too sure how to solve yet. Help fixing this is welcome.
2009-09-02 00:42:12 +00:00
1a968f64dc Fix crash reported by DingTo with camera transform in camera view. 2009-08-30 21:57:10 +00:00
874d38eeb4 Point cache editing:
- Baked point caches for particles, cloth and softbody can now be edited in particle mode.
	* This overwrites the old cloth/sb cache editmode editing.
	* The type of editable system is chosen from a menu.
	* For particles the current particle system and it's current cache are used.
- Currently this only works for caches that are in memory, but some automatic conversion from disk to memory and back can be implemented later.
- All tools from hair editing can't be applied to point caches and are hidden in the tool panel and specials menu. Some functionality like subdividing paths can be later implemented in a slightly different way from how it works for hair.
- Code is not yet optimized for speed, so editing might be slow sometimes.

Known issues:
- Cloth doesn't update properly while in particle mode, due to the way cloth modifier currently works. Daniel can you check on this?
- As "particle mode" is not only for particles any more some other name would be in place?
- Better icons are needed for the path, point, and tip-modes as the current icons from mesh edit mode are quite misleading.
- Direct editing of point velocities is not yet implemented, but will be in the future.

Other changes:
- Hair editing doesn't require a "make editable" button press any more.
- Multiple caches in single particle system disables changing emission properties.
- Unified ui code for all point cache panels.
	* Defined in buttons_particle.py and imported for cloth, smoke & softbody.
- Proper disabling of properties in ui after baking point caches. (Daniel could you please make needed disable code for smoke panels as their functionality is not familiar to me.)
- Hair weight brush has been removed. Once hair dynamics is re-implemented I'll code a more useable alternative to the functionality.

Bug fixes:
- Unlinking particle settings crashed.
- Deleting the active object with particles in the scene crashed.
- Softbody didn't write point caches correctly on save.
2009-08-29 15:20:36 +00:00
c15db042cc Grease Pencil: WIP Code Reordering + Context Stuff
* Shuffled some code around, and renamed some functions used for getting context info
- Split UI-buttons into a separate file from stroke-drawing code
- Removed some obsolete code (i.e. old paint code that used to be in _edit, but which has been moved to _paint). 

* Made drawing in 3D-View default to using the active object as the owner of the Grease Pencil data. For now, the drawing code will therefore only show the GP data for the active object only. More work to come on this.

* Fixed freeing code for Objects/Scenes with GP data.
2009-08-28 12:41:45 +00:00
d893b0f9ff Clear transform flag on all bones that are not transformed. 2009-08-26 02:18:47 +00:00
177956a3a7 2.5/Posemode:
* Pose mode was already object-localized, but moved the flag from object->flag to object->mode, with all the other modes.
* Updated object mode RNA
* Commented out some dubious use of base->flag with the posemode flag. So far as I could see the value was only being set, not read, so a hopefully safe change.
2009-08-16 03:24:23 +00:00
88294d7fa2 2.5/Particle edit:
* Made particle edit object-localized.
2009-08-16 02:35:44 +00:00
b8aff06466 2.5/Paint:
* Weightpaint is now object-local like sculpt and vertexpaint.
* Fixed a bug spotted by DingTo, going from editmode to sculptmode didn't fully leave editmode
2009-08-15 21:46:25 +00:00
314b14301f 2.5: warning fixes
Directories intern/ and source/blender/ now compile warning
free again here with scons/gcc.
2009-08-15 16:36:25 +00:00
f75005c2a8 2.5 MetaBalls
- It is possible to work with MetaBalls in edit mode now
 - Added basic UI to the button window (feel free to change it :-))
 - Header menus should work
 - Undo & redo should work
 - Removed global variable editelems and lastelem (moved it to the MetaBall struct)
 - All tools from old editmball.c was converted to the operators
 - Added lastelem to the RNA
 - Experimental: mb->editelems is only pointer at mb->elems or NULL (depends on Mode). ListBase of MetaElems is not duplicated in edit mode.

Tested with scons at Linux and mac OS X

TODO:
 - Recalc data after Undo or Redo
 - Solve issue with basic MetaBall and Python UI script (only base MetaBall object influence Wiresize and Threshold)
 - Fix orientation of manipulator in "Normal mode"
2009-07-29 12:35:09 +00:00
74e4ad20c9 2.5: code cleanup, added CTX_wm_space_* for each space type,
instead of casting everywhere.
2009-07-28 16:33:02 +00:00
dbd5c5b8a1 2.5 - Animation Tweaks (KeyingSets/NLA)
* Insert Keyframes menu now only displays the 'active keyingset' entry when there are some KeyingSets.

* Moved the validation code for auto-blending/extend modes to NLA editor code, and included calls for this in many of the editing tools for NLA strips.

* Removed obsolete 'ID_IPO' entries from RNA-ID wrapping (these were commented out anyway).
2009-07-24 06:51:33 +00:00
0f4fd4f5b1 NLA - Auto-Blending + 'Smarter' Extend Behaviour
* Auto-blending (blend in/out values get determined based on 'overlaps' of strips) now occurs after transforming strips. Where islands (continuous chains of strips) occur, only the ones on the ends of the islands will get or contribute to auto-blending.

* Extend modes (other than 'nothing') now get automatically determined (after transforms) so that moving strips will no-longer cause problems.

* Added a new option to hide influence curves in NLA. Also, made the line widths for these curves narrower, since the old setting was too ugly.

* Pose copy/paste buffer now gets freed on exit
2009-07-24 06:08:03 +00:00
bb158ad572 2.5 - Editing Animation data (keyframes/nla-strips) using transform tools now refreshes the 3d-view in realtime.
For now, this directly sets the update flags, though this really should be calling the Depsgraph API instead.
2009-07-12 03:42:39 +00:00
3116062a82 2.5: Couple of small fun features
* Text window font size now supports full range 8-32, instead of
  just 12 and 15. I added BLF_fixed_width to get the character
  width of a fixed size font.

* Buttons do undo push on change again.

* Animated/Keyframe/Driver colors are now themable, with blend
  value to blend with original color. Set this to 0.5 now to
  give colors less constrast.
* Fix tooltip popping up with RMB menu open, and missing redraw.

* Autokeyframe now works for buttons.

* Driver expressions can be edited in place in a button now.
  (still some refresh issues).
* Also made python driver default for the Add Driver function
  in the RMB button. This way you don't have to open a Graph
  editor if you just want to type an expression. Also, the
  default expression then is the current value.

* Tooltips now show some extra info, not sure what is good to
  have, but currently I added:
  * Shortcut key for operator buttons.
  * Python struct & property name for RNA buttons.
  * Expression for driven values.
  * Value for text/search/pointer buttons.
2009-07-12 02:06:15 +00:00
8b9bb47a3f Cleaning up manipulator code a bit
Made transform confirm or cancel on mouse up. More inline with button clicking and better for tablets.

Add operator params to make sure Rip and Extrude turn off PET and Mirror correctly.

Note: sorry for all the whitespace changes, I need to reconfigure this editor not to do autocleanup.
2009-07-12 02:01:13 +00:00
0051f1be8e NLA SoC: Merge from 2.5
21330 to 21469
2009-07-10 01:57:55 +00:00
eacb31dbb2 2.5: code consistency
* Rename BIF_transform/retopo.h to ED_transform/retopo.h
  for consistency.
* Move MESH_OT_duplicate_add to editmesh_add.c.
* Remove some code from BIF_gl.h which is not needed there
  anymore.
2009-07-08 16:17:47 +00:00
f3fd7d8800 2.5
Brought back the basics for transform manipulators. Martin will
hook it all up to new transform system.

Some notes:
- Still uses G.moving
- BIF_do_manipulator() is called as a View3D Operator
  I've tested selecting handles, added a print to confirm
- BIF_GetTransInfo() returns a dummy struct now, just to get
  it running.
- Marked some other issues with XXX
2009-07-08 15:01:28 +00:00
e22fefc2c8 NLA SoC: Fixed bug with NLA-Transform
Strip-sorting code was buggy, as it was trying to access an invalid pointer, so the call to sort strips after transform was temporarily disabled in previous commits.
2009-07-07 10:25:55 +00:00
6a320f3277 NLA SoC: Auto-Snapping Fixes (Transform)
Snap to nearest-second works again for NLA and Graph Editors
2009-07-07 06:21:38 +00:00
5fc61f03c1 NLA SoC: Fixes for bugs in transform code from previous commit
* The code to move strips between tracks now works (though it can still be a bit too eager to change tracks half-way through some transforms). 
Strips are moved up/down one strip at a time, depending on whether there is any space in the next-track in the direction you direct it to move in. 

* Auto-snapping works again. Also enabled snap-to-marker option for Graph Editor here.
2009-07-07 06:16:06 +00:00
2edef129be NLA SoC: Transform Code for NLA-Strips recoded (still buggy)
Recoded the Transform code for NLA-Strips so that they can now be moved between strips and will not get truncated when they get moved into other non-moving strips. 

Todos:
* The current code for moving strips between tracks is buggy (only goes up, and has a tendency to move up without being told to)
* Auto-snapping doesn't work yet...
2009-07-07 05:41:59 +00:00
905b138005 NLA SoC: Start of integration of Meta-strips in Transform
* Chains of selected strips are now converted to meta-strips before transforms begin, and converted back afterwards. This simplifies the transform code needed in later stages...

* Transform-flushing code for Meta-Strips should now work. There seems to be a little bit of numeric inaccuracy problems somewhere, as two strips which met at the same frame can get separated when scaling.

* Meta-strips now draw with proper text identification

* Snapping strips now properly clears meta-strips if a moved strip needs to be moved into a new track to be accomodated.

* Fixed a filter used by a selection-operator.
2009-07-07 02:12:50 +00:00
aa4ed13e4a NLA SoC: NLA Mapping Cleanup
While trying to fix the mapping conversions for repeat, I came across some limitations with the current (soon to be previous) mapping methods. 

Now the mapping conversions should work nicely for all places that use them.
2009-06-28 07:32:00 +00:00
500507ddb1 NLA SoC: Merge from 2.5 - 21179 to 21209 2009-06-28 03:26:10 +00:00
912c2f440b Pointcache refresh part 2
* Based on what happens during simulation the cache is marked (also in cache panel, this could possibly be extended to 3d view as well) as:
	- exact (not marked)
	- outdated (simulation is not done completely with current settings)
	- non-exact (frames were skipped during simulation)

* The parameter "cache step" effects the number of frames between saved cache frames.
	- This can save a lot of memory (or disk space) if absolutely frame accurate simulation is not required.
	- Speeds up the "quick caching" very much.
	- Frames between cached frames are interpolated from the cached frames.
	- Current default value of 10 frames works nicely with up/down-arrows (skip 10 frames forwards/backwards on timeline), but can be changed if wanted.

* The caching can work in normal or "quick" mode:
	[Normal cache]
	- Basic: Calculate what even happens (settings change, big frame steps etc.) and cache results, if possible try to use "cache step" when saving cache frames.
	- Becomes non-exact: After larger than 1 frame steps.
	- Becomes outdated: After any change effecting the simulation other than frame steps.
	- Pros/cons: Freedom of doing anything and playing with particles, but exact results have to calculated from the beginning.

	[Quick cache]
	- Basic: Calculate simulation up to current frame automatically on changes with cache step sized jumps in simulation. With multiple "quick cached" simulations the smallest cache step is used.
	- Becomes non-exact: Always from frame 1 (unless cache step = 1).
	- Becomes outdated: Never.
	- Pros/cons: Not very accurate, but super fast!
	- Todo: Transform of any animated (non-autokeyed) object is locked! Probably needs some tinkering with anim sys overrides.

* The simulation can be run forwards or backwards even if it's cache is outdated or non-exact, the following rules apply in these situations:
	- step forwards (to unknown) -> simulate from last exact frame, store result
	- step backwards (to known) -> result is interpolated from existing frames, store result, clear cache forwards if current frame is after last exact frame

* "Calculate to current frame" runs the simulation from start to current frame with a frame steps of 1.
	- Baking does the same, but runs the simulation all the way to the end of simulation.
	- Rendering does this automatically if the simulation is outdated of non-exact, so all rendered simulations will always be updated and exact.
	
* Every cache panel also holds buttons to "Bake all dynamics", "Free all dynamics" and "Update all dynamics to current frame".

* Cloth simulation supports the new cache too.
2009-06-27 15:28:58 +00:00
6510da4ce2 NLA SoC: Fix transforms for transition strips. 2009-06-25 12:30:49 +00:00
a1c5c501a6 At last... this merge should finally do the trick!
21073 to 21145
2009-06-25 04:33:21 +00:00
717916c2b9 NLA SoC: Fixes for segfaults during NLA Transforms
The snapping code was incorrectly assuming that td->extra was always AnimData, but for NLA this is incorrect as it is used for special data used for checking back.
2009-06-24 01:41:12 +00:00
b4acd77526 NLA SoC: Big Commit - Restored NLA-Mapping Corrections
In TweakMode, the keyframes of the Active Action are now shown (and can be edited) in NLA-mapped time, with appropriate corrections applied when editing. This works in the DopeSheet and Graph Editors :)

To do this, got rid of the old wrappers/API-methods, replacing them with new-style ones. A few methods previously (in this branch) used only for evaluation are now used for this purpose too. As the same code is used for editing + evaluation, this should now be much better to work with.

I've only done a few brief tests now, but I think I might've muddled the invert-flags on one or two cases which I'll need to check out tomorrow. So, beware that there may be some weird and critical bugs for the next few days here...

Also, added proper license headers to new NLA files.


TODO:
- testing + bugfixing due to this commit
- show range of keyframes in NLA Editor active-action line
2009-06-23 13:25:31 +00:00
e2b6cea3b9 2.5: Tool Settings
* Moved proportional edit, snap, autokey mode, and a few others
  from Scene to ToolSettings.
* RNA wrapped properties in ToolSettings for the UV editor:
  proportional edit, snap settings, selection modes.
2009-06-23 00:41:55 +00:00
aa267976b8 NLA SoC: Merge from 2.5
21043 to 21072 

(NOTE TO SELF: Campbell made a commit in 2.5 before this merge finished)
2009-06-22 04:39:35 +00:00
6b15024f4a Pointcache refresh part 1:
* Particles support larger than 1 frame changes, bigger frame changes can result in inaccurate results, but it's super fast and you get a nice feeling of how the particles behave!
* "Cache to current frame" button calculates the exact result of particles at current frame.
* Current state of cache can be protected by making it a bake.
* Cache is now in memory by default, disk cache is an option.
* Only "viewport %" number of particles are calculated and cached in viewport, baking and rendering calculate all particles.
* Info on cached frames and memory usage given in ui.
* Support for exact "autocaching" of changes and large frame changes(disabled for now until exact place in event system is decided)
* "Continue physics" is probably deprecated after this and should be removed once sb & cloth use the new cache code.

Todo:
* Make softbody & cloth use the new cache things.

Other changes:
* Some cleanup of particle buttons.
2009-06-21 10:16:52 +00:00
ca5ff43b1f NLA SoC: Improved anim-channel filtering flags for NLA so that channels don't need to be checked to be NLA-Tracks before being used. 2009-06-09 12:28:10 +00:00
096e2f0b5a NLA SoC: Transform tools for NLA
This commit restores transform support for NLA. Grab, scale, 'extend', and tweak (i.e. grab by just click+dragging) are implemented. 

Notes:
- As soon as one end of a strip touches another adjacent strip (within the same track), that end stops moving. This has been done to avoid the situation where overlapping strips within the same track (which is not allowed) might be caused by transforms.
- Made some changes to the RNA setters for the strip extents so that the validation above could take place (and other necessary changes on a per-strip basis could also occur).

TODO's ?
- Strips cannot be transferred from track to track using transforms. I've yet to decide whether this needs to be done, or whether a separate operator will suffice.
- What happens to the range of Actions used when the strips change sizes unexpectedly (i.e. the no-overlap condition above)? Currently range stays the same, but this doesn't always seem desirable?
2009-06-09 11:26:45 +00:00
2dbf73f6a0 2.5 PoseLib - First steps to get PoseLib to work in 2.5
* Cleaned up Keyframing API to get eliminate some of the problems faced during the original implementation of PoseLib, thus reducing code redundancy. 
* Added new Animato evaluation functions specifically for use by PoseLib. 
* Replaced parts of PoseLib code which relied on old animation system to the equivalent code for Animato. Notice the much cleaner + saner + compact code!

Next step is to operatorfy the PoseLib tools (while maintaining possibility for an API to some things) :)
2009-04-15 01:10:36 +00:00
5b3d7bfdf6 2.5
More cleanup!

- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
  Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
  (was only in use for radiosity buttons)

And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:

- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
  to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
  a several calls using different args.

Further just added the missing includes, and removed unused vars.
2009-04-14 15:59:52 +00:00
e4ee708cef Added back old code for transform seq overlap in an '#if 0',
since the loop that works around t->data being freed can sometimes shuffle strips that are not being transformed (eg, when extending or with locked strips)
2009-03-30 01:16:28 +00:00
4a164ce520 Shuffle only selected sequence blocks. 2009-03-28 22:01:07 +00:00