Commit Graph

136 Commits

Author SHA1 Message Date
3266e10456 Proper cast to silence warning and comment to explain WTH is happening here. 2009-10-27 18:50:26 +00:00
e76ce369bb Compiler warning fixes for mingw:
* There's an unresolved error in transform_conversions.c which I've flagged in this commit. I'm not quite sure what the exact intentions of that code were (i.e. was the "void_pointer = 1" really intended)
2009-10-27 09:38:15 +00:00
1c1659eb28 - Right click menu can open links directly to API reference docs (rna and operators)
- Generated and uploaded api docs - http://www.blender.org/documentation/250PythonDoc
- Added Edit docs menu item & operators as discussed with Mindrones, Brecht, Stani & Letterip @ bconf, needs some web backend. python operator can aparently use xml/rpc to upload docstrings.
- Added operator invoke function - context.manager.invoke_props_popup(self.__operator__, event)
  this calls a popup for invoke by default (which intern calls execute())

- Own recent commit to game framing applied to non-camera views too.
- v3d->persp is deprecated but still used in some places.

- Transforming strips could overlap 1 frame if moving them below frame 0
- Transforming overlapping strips could go into an eternal loop (though overlapping strips should not exist)
2009-10-27 02:54:25 +00:00
3ffb695b10 Shape Keys
Blended shape keys can now be displayed & edited in edit mode. This
is much like showing an armature modifier in edit mode, and shape keys
now are a applied as a virtual modifier (for mesh & lattice only, curve
doesn't fit in the stack well due to tilt).

The main thing missing still is being able to switch between the active
shape key in edit mode, that's more complicated.. but the weights of
other shapes can be edited while in edit mode.

One thing to be careful about is that this does automatic crazyspace
correction, which means that if you edit a shape key with a low value,
the actual vertices will be moved to correct for that and actually move
a (potentially much) longer distance.

Also includes some UI tweaks, mainly placing some buttons horizontally
since the vertical list was getting too long.
2009-10-22 16:35:51 +00:00
d037061b68 after transform if strips overlap, move the frame rather then the channel to fix.
useful while snap isnt working. metastrips still need to be supported.
2009-10-22 14:40:32 +00:00
c825a9aeaa Bugfix #19703: Axis Angle wont work
* Transform code was not properly fixed to work with the new way that axis-angle data was stored
* The order of the args for the conversion function when switching rotation representations was wrong, causing problems when switching from quaternion to axis angle (i.e. these occurred for newly created bones).
2009-10-22 02:14:11 +00:00
7685def9af Graph Editor: Pivot Modes for Transform
It is now possible to choose from 'Bounding Box' (default), '2D-Cursor', and 'Individual Centers' as the pivot point(s) that rotation/scaling is performed around.
2009-10-21 10:36:46 +00:00
031da438e4 - enable snap to work for particle editmode so you can snap onto the emitter.
theeth: maybe there needs to be a new SnapMode for this? - SNAP_SELF?, like editmode but without setting t->editob

- dont run special_aftertrans_update on scene objects when after sequencer transform
2009-10-19 17:20:09 +00:00
55249e255a fix for bug where moving strips that are next to eachother would detect invalid overlaps
first update strips, then check overlap in a second loop
2009-10-19 10:37:50 +00:00
2c985dee97 - listener for sequencer space panels added for frame changes, now redraws during transform
- invalid pointer was used for getting the sequencer length crashing blender or setting the length to negative values.
- printf_strip(seq) for debugging sequence strip locations
- Spelling: Cheet Sheet -> Cheat Sheet
2009-10-19 10:07:19 +00:00
0445ff1ae9 Give sequencer its own transform freeing function.
Updating the sequencer after transform could not use special_aftertrans_update because it relies on data that is freed

theeth: moved the customFree function to run before freeing t->data, t->data2d in postTrans(), checked that customData is not needed.
2009-10-19 08:01:30 +00:00
680888419d A few Graph Editor tweaks:
* Tiny tweak of GL commands used when drawing F-Curves (single GL_LINES instead of multiple GL_LINE_STRIPS) to hopefully improve the performance with heaps of handles drawn a bit

* Spelling fix for initTransDataCurveHandes -> initTransDataCurveHandles
2009-10-16 10:01:15 +00:00
004199efd4 Graph Editor - Transform Crash Fix
The code for transforming a mixture of keyframes with bezier and non-bezier interpolation was crashing. 

The old code only took all the handles when a keyframe was bezier, and one when it was not; but sometimes this underestimated the situation (the first handle is only really used if the previous keyframe was bezier, as per the standard evaluation rules for these, but it didn't really check for this). Now, it just adds them whenever, since there is the possibility that keyframes may be moved before other unselected ones, in which case the handles may become invalid.

Thanks to Lee (from Durian, who found the crash), and Jess Balint (who had submitted a patch with some steps towards fixing this)
2009-10-16 06:24:39 +00:00
6ffb79107c X Mirror editmesh with PET
Lock vertice near the middle (|x| < 0.0001) on the mirror's plane.
Don't propagate transformation across mirror plane (this could probably be smarter)
2009-10-15 21:54:22 +00:00
a28b9512fe made texflag a short everywhere (only stores one flag)
fix for crash with separate (missing NULL check)
2009-10-15 09:00:40 +00:00
828e3f3059 Left in debug prints 2009-10-14 03:00:35 +00:00
e87839b673 Bugfix: Automerge keyframes was broken - the function call to perform the merging was commented out 2009-10-14 02:18:59 +00:00
3a1216a2f2 Project option for snap to faces.
This is similar to the old retopo all option but uses the snapping code and not the openGL depth buffer (it's thus more precise).

Not sure if making it available as a snap option is sensible, this is up for discussion.

NOTE: it will get slow fast on large meshes, we need to plug in an acceleration structure into snapping.

This will need an icon too.
2009-10-12 22:33:32 +00:00
ff07676b40 bring back automerge - [#19538] automerge editing doesn't work 2009-10-08 15:50:42 +00:00
da698657ce Keying Sets - Bugfixes + Auto-Keyframing
* Added a new option for Auto-Keyframing which makes it only insert keyframes for the items included in the active Keying Set. 
This only works for Transform Auto-Keyframing so far (other tools will get it added later). The option is disabled by default.

* Fixed bug where adding an 'entire' array to some KeyingSet would only start from the index of the button that the mouse was over at the time

* Made some UI tweaks for Keying Sets buttons (still heaps of missing options there).
2009-10-08 06:39:45 +00:00
6e43a69a8d Bugfix #19576: Auto keyframing does not record rotations on object level animation
The hardcoded paths for rotation keyframes on objects got broken by my commits to rename the rotation properties. I've taken this opportunity to recode the auto-keyframing code here to use the builtin keyingsets instead of going through and manually calling insert_keyframe(), thus preventing this problem in future.
2009-10-08 05:53:26 +00:00
475ab5ceb4 Rotation Modes Bugfix:
Animating rotations using different rotation modes should now work more often than before. 

Previously, quaternion and axis-angle values were stored in the same variable in DNA, but that was causing problems with other animation curves overwriting the values and causing the rotations to not work as expected. 

There are still some issues, but I'll track those down later tonight
2009-10-08 00:57:00 +00:00
bff893a420 Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons) 
  instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group 
  setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
	- "Point" is most like the old effectors and uses the 
	  effector location as the effector point.
	- "Plane" uses the closest point on effectors local xy-plane 
	  as the effector point.
	- "Surface" uses the closest point on an effector object's 
	  surface as the effector point.
	- "Every Point" uses every point in a mesh effector object 
	  as an effector point.
	- The falloff is calculated from this point, so for example 
	  with "surface" shape and "use only negative z axis" it's 
	  possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer 
  just spherical.
* New effector parameter "flow", which makes the effector act as 
  surrounding air velocity, so the resulting force is 
  proportional to the velocity difference of the point and "air 
  velocity". For example a wind field with flow=1.0 results in 
  proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random 
  flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force 
  (note. the z-axis is the surface normal in the case of 
  effector shape "surface")
* New "force field" submenu in add menu, which adds an empty 
  with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector 
  system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for 
  particles, softbody & cloth, since their final effect depends on many external 
  factors, like for example the surface area of the effected faces.

Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through 
  DAG_id_flush_update(..).
  
Known issues
* Curve guides don't yet have all ui buttons in place, but they 
  should work none the less.
* Hair dynamics don't yet respect force fields.

Other changes
* Particle emission defaults now to frames 1-200 with life of 50 
  frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to 
  free pidlists after use :).
2009-09-30 22:10:14 +00:00
d143627b62 Fix #19468: particle mode crash in transform, when there are
no editable particles.
2009-09-28 14:51:42 +00:00
7d2fd5449e Durian Feature Request: Rotation Modes for Objects
This (biggish) commit generalises the rotation modes functionality added for Bones, allowing Objects to use the various Euler Rotation orders, Axis-Angle, and Quaternion rotation representations.

I've also cleaned up the nomenclature of the rotation-related settings so that the naming styles are more consistent with each other. Unfortunately, this will break all files involving object or bone rotation animation made in 2.5 versions (2.4x will still get correctly converted).

General Notes:
* By default, Objects still default to using Eulers, while Bones will use Quaternions by default still.
* I've fixed all areas that I'm currently aware of to work with these changes. However, there are probably a few places where I've missed a few changes (i.e. auto-keyframing will need attention later).
* Removed the old "IPO-Keys" stuff from Transform code. I'm unlikely to restore this in the near future, and trying to fix that to include support for this commit would have been too much work.
2009-09-28 10:19:20 +00:00
930542540a Make edge slide a proper operator
Clean up a couple of things in transform (PET settings, custom data, ...)
2009-09-22 20:16:56 +00:00
2379af27d1 tested running the cheat-sheet, found a number of segfaults
pressing escape in the outliner was also crashing (somehow it tried to exit the file selector)
2009-09-21 09:17:14 +00:00
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