Commit Graph

25652 Commits

Author SHA1 Message Date
Sergey Sharybin
eccccd7b09 Camera tracking integration
===========================

Basic implementation of scene orientation tools.
Most probably they'll eb re-exposed in UI soon.

- Implemented "Set Floor" operator.
  It takes three
  selected tracks which has got bundles and makes them
  parallel to scene floor. One of selected bundles (active
  bundle if presents) becomes scene origin, the other
  becomes X-axis. Guessing of this bundles could fail.
  Camera tries to be on positive Z half-space.
- Implemented "Set X-axis" operator.
  This operator takes selected track with bundle and
  aligns it along X-axis. This means rotation to make
  Y-coord of this bundle 0 is applied.
- If camera has got a parent, then transformation would
  be applient ot this parent, not to camera.
  Useful for configuration when Empty is used to orient
  camera and some related stuff in 3D space.
2011-07-13 15:09:45 +00:00
Sergey Sharybin
dd0d761f48 Camera tracking integration
===========================

Previous solution to make bundles work for parented camera
wasn't very nice. It could totally confuse depsgraph and it's
quite slow.

Now i've implemented function where_is_object_mat which makes
almost the same as where_is_object_time, but it:
- Does not applies constraints.
- Assumes matrices for all dependencies are valie already
  (handles by depsgraph).
- Doesn't make any changes to object itself or it's
  dependencies.
2011-07-13 10:30:42 +00:00
Sergey Sharybin
fa34bcf6ee Camera tracking integration
===========================

Attempt to fix bundles position for case scene camera has got
other constraints than CameraSolver (mostly to support camera
parenting to other object for scene orientation).

Use a bit silly logic to calculate camera matrix to orient
bundles in 3d space: temporary disable all CameraSolver
constraints for camera, re-calculate object matrix, use it
to orient bundles and clear temporary flag.

This allows to parent both of camera and mesh created from
bundles to the same Empty object and both of bundles and
mesh vertices would have the same coords in camera space.

Also removed copying of location/rotation from camera to
bundles object in "Bundles to Mesh" operator.
2011-07-13 08:26:33 +00:00
Sergey Sharybin
b74ad9b677 Merging r38316 through r38338 from trunk into into soc-2011-tomato 2011-07-12 18:06:16 +00:00
Sergey Sharybin
cceb1540dc Camera tracking integration
===========================

- Fixed typo in RNA api for has_bundle.
- Added operator "Bundles To Mesh".
  It was a request from Sebastian and this operator creates mesh
  with vertices using bundles coords for vertices coordinates.
  A bit limited atm -- new object can't be parented to camera,
  so changing camera orientation would requite mesh re-creation.
2011-07-12 18:04:29 +00:00
Sergey Sharybin
d89d162e28 Camera tracking integration
===========================

- Fixed buf with under reference for Follow Track constraint.
- Get rid of BKE_movieclip_approx_size. Rather than accessing
  to cache with previously set frame number it'll be easier to
  store size of last accessed in "runtime" DNA.
2011-07-12 13:35:25 +00:00
Sergey Sharybin
b821244614 Camera tracking integration
===========================

- Reduced size of widget for camera focal length units.
  Also changed labels to mm/px. Now it's much easier to read
  values and titles here.
- Reordered settings in "Display" panel. Hopefully it's
  now easier to read options here even when N-panel
  isn't large enough.
- Fixed bug with "disappearing" labels from "Active marker" panel.
- If search areas are hidden and marker is disabled,
  make pattern area red rather than displaying nothing for
  this marker.
- Internal change: "show marker path" became "show track path".
- Lock shape of pattern to square by default. Control unlocks
  this shape.
- Hitting escape when sliding cancels changes and stops sliding.
- Search areas are hidden by default now. No big benefit of
  looking at them now after changing default settings to
  2D tracker and pattern/search size.
- Both of Toolshelf and Properties panels are now visible
  by default.
- Move keyframes from Properties panel to Toolshelf.
  It is a key thing which makes reconstruction correct and
  this options were too hidden and not so convenient to
  use.
2011-07-12 11:46:46 +00:00
Brecht Van Lommel
d0e4fb393b RNA: fix some text datablock property UI names. 2011-07-12 09:30:40 +00:00
Sergey Sharybin
222a198cd4 Camera tracking integration
===========================

This should been never gone outside of my local working tree.
2011-07-12 08:43:21 +00:00
Sergey Sharybin
94779fd9b5 Merging r38296 through r38315 from trunk into soc-2011-tomato 2011-07-11 18:18:42 +00:00
Sergey Sharybin
f76b7dc8c3 Camera tracking integration
===========================

Forgot to add colamd to cmake rules for blenderplayer.
Because of starnge reason it should be added to list after libmv.
2011-07-11 18:16:02 +00:00
Sergey Sharybin
2543e01052 Camera tracking integration
===========================

- Fixed incorrect usage of RNA structure for
  CameraSolverConstraint.
- Fixed some typos in object_constraint which were
  casting CameraSolver data to FollowTrack data.
- Tracking-related constraints now have got option
  "Use Defult Clip" which makes them use clip set as
  active for scene. Enabled by default.
- Set active blender camera focal length after reconstruction.
- Corrected offset of sequence images. Now first image from sequence
  should be at scene frame 1.
2011-07-11 17:13:27 +00:00
Sergey Sharybin
ef5b107b3b Camera tracking integration
===========================

- Minor spelling fixes.
- Do not draw bundles for hidden tracks in SpaceClip.
- Pressing SHift when sliding marker with mouse makes movenment more accurate.
- New default values for maerker pattern/search areas.
  This makes tracking more stable.
- Pyramid level increased to 4. This would make tracking
  of blured imaged more accurate.
2011-07-11 12:38:44 +00:00
Sergey Sharybin
179546dbc3 Camera tracking integration
===========================

Forgot to write Focal Length SET function :)
2011-07-11 11:17:39 +00:00
Brecht Van Lommel
e645068aa0 Fix #27928: avi raw writing failure, after earlier bugfix for big file sizes. 2011-07-11 09:47:13 +00:00
Brecht Van Lommel
9fb2e5dde7 Fix #27930: many modifiers crashed when used on a lattice with a vertex group. 2011-07-11 09:15:20 +00:00
Brecht Van Lommel
7dfe34864e Fix #27912: crash after mesh.materials.pop(). 2011-07-11 09:08:08 +00:00
Brecht Van Lommel
8ca556a32a Fix #27921: optimal display with 2 subsurf modifiers fails. 2011-07-11 09:05:10 +00:00
Sergey Sharybin
08bd300f0e Camera tracking integration
===========================

- Changed libmv api to use doubles instead of floats.
  No real benefit rather than keeping API uniform.
- Optimized reconstructed camera search. It's optimized for
  playback, not random access.
- Added option to show projection of bundles into footage.
  To see bundles "Show Bundles" from Display panel should
  be enabled. Used very rough limit of 3 px to consider projection
  is fine. Colors are still hard-coded. Not sure it could be useful
  to make them configurable.
- Added option to mute footage. It could be useful to check
  if markers/bundles are moving smoothly.
- Added selector for focal length units.
2011-07-11 09:04:00 +00:00
Sergey Sharybin
1135dbcc36 Merging r38265 through r38295 from trunk into soc-2011-tomato 2011-07-11 08:43:34 +00:00
Janne Karhu
897cbe4b42 Fix for [#27398] Particle systems with animated groups render incorrectly in viewport
* Hmph.. depsgraph and group duplication == illogical.
2011-07-10 23:49:59 +00:00
Janne Karhu
2ebc5cbe75 Fix for [#27293] Group Instance of particle system is rendered wrong
* Silly mul_m4_v3 had turned into a mul_m4_v4 at some point!
2011-07-10 23:24:15 +00:00
Campbell Barton
80eb1eae42 run WM_exit(C) when blender as a python module exits 2011-07-10 18:54:02 +00:00
Brecht Van Lommel
1f6a79ecb5 Fix #27926: autokey not working with auto IK, broke this with an earlier bugfix. 2011-07-10 18:21:40 +00:00
Sergey Sharybin
0277b36b76 Camera tracking integration
===========================

- Fixed sub-pixel precision error when sliding markers.
- Made sliding areas smaller.
- Remove "Debug" menu,
- pep8 cleanup.
2011-07-10 18:12:29 +00:00
Janne Karhu
2fb4a37baa Fix for [#27289] Hair: Render Option - Object does not point objects to end of "hair path"
* Objects are now always rotated in the directions of the hair paths
* Secondary fix: particle size wasn't updated for hair particles, so dupliobject size couldn't be change after the hair was edited
2011-07-10 17:30:31 +00:00
Janne Karhu
de7592b489 Fix for [#26873] Animated displacement modifier on an object doesn't work with hair particle objects
* Noise is now considered an animated texture as it changes with every frame
* Converted a few places in particles code to use the particle system's own random table instead of BLI_frand.
2011-07-10 17:04:56 +00:00
Sergey Sharybin
f4d2a3c8b0 Camera tracking integration
===========================

- Added option to keep area equal width and height
  when sliding it by mouse. Use "Control" button for this.
- Do now show sliding zones for disabled markers.
2011-07-09 20:38:41 +00:00
Campbell Barton
7370ba1839 fix for NULL pointer usages 2011-07-09 19:59:32 +00:00
Sergey Sharybin
b16a448e8d Camera tracking integration
===========================

Clean-up: animation data is not necessery in MovieClip. Removing.

It'll be easy to add it back just reverting this commit.
2011-07-09 19:57:29 +00:00
Sergey Sharybin
964c3cb0fa Camera tracking integration
===========================

- Implemented hide/show track functionality.
- Small re-exposing Marker menu into UI.
  Now it's called "Track". Added new operators there.
- Set reconstructed clip as active to scene.
2011-07-09 19:51:23 +00:00
Campbell Barton
65d1e27ff5 fix for using uninitialized value in gpu_shader_material 2011-07-09 19:16:32 +00:00
Sergey Sharybin
98242d4653 Camera tracking integration
===========================

Improved marker size/position adjustment:
- Rollback selection model so selected parts of marker
  would be disabled only when "extension" click happens.
- Implemented left mouse sliding to adjust marker position
  (using small square in left top corner of search area) and
  size of pattern/search (using small triangle it right bottom
  corner of marker)
2011-07-09 17:51:59 +00:00
Sergey Sharybin
0c802ad23e Merging r38237 through r38264 from trunk into soc-2011-tomato 2011-07-09 17:49:36 +00:00
Campbell Barton
d5984b2d50 fix [#27683] Blender hangs when baking a particle system when a driver is present 2011-07-09 17:41:39 +00:00
Ton Roosendaal
2bb08ee48e Wrong tooltip for OBJECT_OT_make_links_scene() operator. 2011-07-09 17:09:28 +00:00
Ton Roosendaal
de10ffab75 Bugfix #27761
Material nodes: when no output node was active, it sets one.
Not common to happen anymore, only for deleting output nodes
without clicking on nodes.
2011-07-09 17:03:35 +00:00
Sergey Sharybin
c314ac8ce3 Fix #27888: Render artifacts in 2.58.1
It was a regression introduced in rev36301. Average normal calcilation
used to fail due to triangular faces which are too slight.

Do not use triangles with too small area for average normal calculation.
2011-07-09 15:10:12 +00:00
Campbell Barton
905d04ef9d fix [#27915] Relax Pose crashes blender on bone with ChildOf constraint in linked rig 2011-07-09 14:33:28 +00:00
Sergey Sharybin
5506d18fa8 Fox #27866: Curve handle snaps/locks when it shouldnt
It was a precision error in calchandleNurb. Do not align handles
along handle which si too short.
2011-07-09 14:22:52 +00:00
Nicholas Bishop
abdf420a6d == GPU Buffers ==
This patch attempts to clean up and document the GPU buffers
code. There are a few bug fixes as well.

Patch reviewed here: http://codereview.appspot.com/4631052/

Summary:

* Bugfix: make GPU_buffer_copy_normal convert from shorts to floats
  correctly, also fixed the use of cached face normal CustomData.

* Bugfix: changed the `mat_nr' field of GPUBufferMaterial from char to
  short.

* Changed color buffer setup to not alloc a temporary copy of color
  data, just passes the MCol data in directly.

* Changed the GPU buffer pool code to make clearer what operates
  specifically on the global pool.

* Lots of refactoring for GPU_drawobject_new; should operate mostly
  the same (except got rid of one unecessary allocation), just split
  into more functions and without macros now.

* Converted some #defines into enumerations.

* Made some stuff private, pulled out of header file.

* Deleted unused function GPU_buffer_pool_free_unused().

* Removed GPU_interleaved_setup and related #defines. (I think this
  was used for editmode VBOs, but those were disabled.)

* Added lots of comments.

* Added a few comments in the code signed `--nicholas' to note places
  where I am unsure about design or usage, would be good to address
  these better.

* Code formatting changed to be more consistent with the rest of
  Blender.

* Renamed some fields and variables to be more consistent with
  Blender's naming conventions.

* Renamed some fields and variables to use more descriptive names,
  e.g. renamed `redir' to `mat_orig_to_new'.

* Removed print outs with DEBUG_VBO -- don't feel too strongly about
  this one, just not used elsewhere in Blender, could be easily added
  back if others disagree though.

* Moved the PBVH drawing code down to the bottom of the file, before
  was sitting in the middle of the other VBO code
2011-07-08 19:58:02 +00:00
Sergey Sharybin
c3d2e13a49 Camera tracking integration
===========================

- Made settings for tracking non-animatable.
- Fixed crash when enabling/disabling markers from
  "Specials" menu.
- Translate all coords to make first reconstructed camera
  be at position (0,0,0).
- Blender's camera now affects on reconstructed data.
  Bundles are "parented" to active scene camera. So now
  bundles' could could be scaled and rotated when camera
  is rotating/scaling.
2011-07-08 17:42:13 +00:00
Sergey Sharybin
3685eac8e1 Merging r38220 through r38236 from trunk into soc-2011-tomato 2011-07-08 17:40:29 +00:00
Brecht Van Lommel
a6bb0f93ad Fix #27897: mesh with negative scale disappears while sculpting, clipping
planes were wrong in that case.
2011-07-08 15:58:00 +00:00
Brecht Van Lommel
a5906de7c4 Fix #26962: softbody collision doesn't respect subsurf+displace modifiers.
Softbody was still using a flag to determine if it should use the final or
deform derivedmesh, but this wans't exposed in the UI. Others systems use the
collision modifier, now softbody uses it also to get vertices and faces, but
with own collision code.
2011-07-08 13:22:58 +00:00
Brecht Van Lommel
668323d701 Fix #27900: file browser filter, sort, .. parameters were not saved. This is
useful if you have a screen setup with a file browser editor.
2011-07-08 12:22:48 +00:00
Brecht Van Lommel
aa7b843b1c Fix #27902: autokey bones with individual origins transform not working. 2011-07-08 11:43:35 +00:00
Sergey Sharybin
f20de08afd Camera tracking integration
===========================

- 32 bit linux compilation should be fixed now.
- Camrea reconstruction data should be better now
  when there's no reconstructed cameras.
- Implemented "Set Origin" operator
- Added "Specials" W-key menu for SpaceClip.
  Supports such operators:
  * Enable track
  * Disable track
  * Set origin
2011-07-08 08:38:54 +00:00
Sergey Sharybin
5e80cb3662 Camera tracking integration
===========================

- Disallow negative size for bundles.
- Fixed bug with passing disabled markers to solver.
2011-07-07 19:27:14 +00:00
Sergey Sharybin
d279e8891f Camera tracking integration
===========================

- ColaMD moved from OpenNL to extern/.
  It'll be needed for libmv. Also, it's a bit updated from
  year 1999 to 2007.
  Need to be tested for regressions.
- Updated bundling script for libmv. Now it uses fuller
  subset of this library.
- Bundled new libmv.
- Request from Keir: add command line argument to toggle logging
  stuff on. Currently, if Blender is launched with -d argument
  libmv would start printing logging messages. There's no
  argument to increase verbosity, but there's API in libmv-capi,
  so it'll be easy to add.
- Finally fixed crash when ibuf is acquiring with user=NULL.
- Added ActiveClip property to the scene. This clip is used
  as default value for new match-moving constraints.
- Added some flags to Display panel of View3D. Related on
  displaying match-moving stuff.
- Internal change: bundles data moved inside to MovieTrackingTrack.
- Initial implementation of 3d reconstruction.
- Added constraint "Camera Solver". This constraint is supposed
  to be used to make camera follow the reconstructed camera path.
- Added "reference" property to "Follow Track" constraint.
  Now object could be "parented" to 2D track position or to
  3D bundle position.

The very quick guide:

To use reconstruction you should have footage with tracked markers,
choose two keyframes in "Tracking settings" panel. There should be
quite noticeable parallax effect between this two frames. This
is used to initialize reconstruction stuff.
Camera data (focal length and optical center) should be filled in
"Camera Data" panel. Optical center is often the center of image,
so it'll be filled in automatically.
You should also set values for undistortion (K1, K2 and K3). Currently,
there's no any visualization for this parameters and approach of
"change value -> reconstruct -> see what've changed" is the only way
for now.
Libmv team is working on auto-calibration tool, so it should be
easier to gather this coefficients in nearest (i hope) future.
There's also no scene orientation stuff.

Basic workflow:
- Open footage.
- Set markers and track them.
- Fill in camera data and keyframes.
- Hit "Solve Camera" button.
- Add "Camera Solver" constraint to camera in scene.
- Choose movieclip in that constraint.
- To see bundles in 3D viewport active clip should be set
  in scene buttons.
2011-07-07 17:58:33 +00:00