blender.git
6 years agorigidbody: Add generic spring constraint
Sergej Reich [Wed, 23 Jan 2013 05:57:01 +0000 (05:57 +0000)]
rigidbody: Add generic spring constraint

Behaves like the generic constraint but has optional spring on each axis.

TODO: Add option to set rest length.

Patch by Markus Kasten (markus111), thanks!

6 years agorigidbody: Add rigid body constraints
Sergej Reich [Wed, 23 Jan 2013 05:56:56 +0000 (05:56 +0000)]
rigidbody: Add rigid body constraints

Constraints connect two rigid bodies.
Depending on which constraint is used different degrees of freedom
are limited, e.g. a hinge constraint only allows the objects to rotate
around a common axis.

Constraints are implemented as individual objects and bahave similar to
rigid bodies in terms of adding/removing/validating.

The position and orientation of the constraint object is the pivot point
of the constraint.

Constraints have their own group in the rigid body world.

To make connecting rigid bodies easier, there is a "Connect" operator that
creates an empty objects with a rigid body constraint connecting the selected
objects to active.

Currently the following constraints are implemented:
* Fixed
* Point
* Hinge
* Slider
* Piston
* Generic

Note: constraint limits aren't animatable yet).

6 years agorigidbody: Add "Copy Rigid Body Settings" and "Bake To Keyframes" operators
Sergej Reich [Wed, 23 Jan 2013 05:56:49 +0000 (05:56 +0000)]
rigidbody: Add "Copy Rigid Body Settings" and "Bake To Keyframes" operators

Based on a script by liero, thanks!

6 years agorigidbody: Add rigid body simulation
Sergej Reich [Wed, 23 Jan 2013 05:56:44 +0000 (05:56 +0000)]
rigidbody: Add rigid body simulation

Add operators to add/remove rigid body world and objects.
Add UI scripts.

The rigid body simulation works on scene level and overrides the
position/orientation of rigid bodies when active.
It does not deform meshes or generate data so there is no modifier.

Usage:
* Add rigid body world in the scene tab
* Create a group
* Add objects to the group
* Assign group to the rigid body world
* Play animation
For convenience the rigid body tools operators in the tools panel of the 3d view
will add a world, group and add objects to the group automatically so you only have
to press one button to add/remove rigid bodies to the simulation.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

6 years agorigidbody: Add point cache support
Sergej Reich [Wed, 23 Jan 2013 05:56:34 +0000 (05:56 +0000)]
rigidbody: Add point cache support

Add read/write/interpolate functions.

In order to get rigid body point cache id from object it's now required to pass the
scene to BKE_ptcache_ids_from_object().

Rigid body cache is drawn in the orange color of the bullet logo.

6 years agorigidbody: Add force field support
Sergej Reich [Wed, 23 Jan 2013 05:56:27 +0000 (05:56 +0000)]
rigidbody: Add force field support

Force fields work with rigid bodies just like they do with other simulations.

Increase min and max strength of force fields so they can influence heavy rigid
bodies.

TODO: Adjust force field strength based on the time step taken.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

6 years agorigidbody: Add DNA/RNA/BKE infrastructure for the rigid body sim
Sergej Reich [Wed, 23 Jan 2013 05:56:22 +0000 (05:56 +0000)]
rigidbody: Add DNA/RNA/BKE infrastructure for the rigid body sim

This is just the basic structure, the simulation isn't hooked up yet.

Scenes get a pointer to a rigid body world that holds rigid body objects.
Objects get a pointer to a rigdid body object.

Both rigid body world and objects aren't used directly in the simulation
and only hold information to create the actual physics objects.

Physics objects are created when rigid body objects are validated.
In order to keep blender and bullet objects in sync care has to be taken
to either call appropriate set functions or flag objects for validation.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

6 years agorigidbody: Add rigidbody module
Sergej Reich [Wed, 23 Jan 2013 05:56:13 +0000 (05:56 +0000)]
rigidbody: Add rigidbody module

It's mostly a C API for bullet that interfaces nicely with blender.
It could act as a generic interface for rigid body simulations but right
now it's very specific to bullet.

TODO: Fix building without bullet.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

6 years agomath: Add functions to decompose transformation matrices
Sergej Reich [Wed, 23 Jan 2013 05:56:05 +0000 (05:56 +0000)]
math: Add functions to decompose transformation matrices

mat4_decompose() is similar to mat4_to_loc_rot_size() but returns
rotation as quaternion.
mat4_to_loc_quat() just returns location and rotation without size.

6 years agoworkaround [#32866] Crash by cyclic use of Boolean Modifier
Campbell Barton [Wed, 23 Jan 2013 05:42:45 +0000 (05:42 +0000)]
workaround [#32866] Crash by cyclic use of Boolean Modifier

officially - modifiers shouldn't calc other objects derived mesh, but in some cases its needed at the moment for certain scenes, so just disallow booleans depending on booleans.

6 years agofix for own regression since 2.4x, non-linear number button range was too insensitive...
Campbell Barton [Wed, 23 Jan 2013 04:55:34 +0000 (04:55 +0000)]
fix for own regression since 2.4x, non-linear number button range was too insensitive for int buttons.

6 years agofix for glitch with vertex bake:
Campbell Barton [Wed, 23 Jan 2013 04:22:02 +0000 (04:22 +0000)]
fix for glitch with vertex bake:
- the mesh would be tagged to update, then updated before bake finished.
- also increase self-shadow offset, in some cases the offset wasn't enough.

6 years agofix [#33729] Shadows produce artefacts in vertex colour baking
Campbell Barton [Wed, 23 Jan 2013 03:01:43 +0000 (03:01 +0000)]
fix [#33729] Shadows produce artefacts in vertex colour baking

6 years agotweak to recent commit to clamp vertex range so new empty vgroups are in fact empty.
Campbell Barton [Tue, 22 Jan 2013 21:54:44 +0000 (21:54 +0000)]
tweak to recent commit to clamp vertex range so new empty vgroups are in fact empty.
- don't clamp if no empty groups are created
- no need to call ED_vgroup_data_create, this was very old code for weight paint r1596 - weight paint works without adding 'dvert'array.

6 years agoDisplaying labelname with reroute nodes.
Monique Dewanchand [Tue, 22 Jan 2013 21:35:33 +0000 (21:35 +0000)]
Displaying labelname with reroute nodes.
It uses the default text color.

6 years agosim: Remove "continue physics" code
Sergej Reich [Tue, 22 Jan 2013 20:47:03 +0000 (20:47 +0000)]
sim: Remove "continue physics" code

This was left over from 2.4x days and is not used anymore.
Now simulations are always interactive.

6 years agoOSX 10.6 error - hiding code behind a respondsToSelector.
Ton Roosendaal [Tue, 22 Jan 2013 19:06:51 +0000 (19:06 +0000)]
OSX 10.6 error - hiding code behind a respondsToSelector.

6 years agoGame Engine UI: Image Sampling Texture Panel cleanup
Dalai Felinto [Tue, 22 Jan 2013 18:42:16 +0000 (18:42 +0000)]
Game Engine UI: Image Sampling Texture Panel cleanup
removing non-GE supported features.

The idea of splitting the draw() function comes from Campbell Barton.
Review from him as well.

The main reason for not implement this in properties_games.py is to make sure the
panel is in the same order for both BI and BGE engines.

6 years agoMatcap fix: on enabling it, and when no matcap was selected before,
Ton Roosendaal [Tue, 22 Jan 2013 18:36:11 +0000 (18:36 +0000)]
Matcap fix: on enabling it, and when no matcap was selected before,
it sets first matcap icon.

6 years agomake sure config directory is initialized or python complains
Antony Riakiotakis [Tue, 22 Jan 2013 18:13:22 +0000 (18:13 +0000)]
make sure config directory is initialized or python complains

6 years agoBug fix #33911
Ton Roosendaal [Tue, 22 Jan 2013 18:07:17 +0000 (18:07 +0000)]
Bug fix #33911

When you open a Blender window larger than a screen, Macs clip it to match the height,
but they allow the width to be more.

Problem is that this clipping happens after all window opening code. That causes
check for HiDPI mode to fail.

Now it checks it again on event GHOST_kEventWindowUpdate, which is only on startup.

6 years agoScons, linux: If we are to keep WITH_INTERNATIONAL on by default, also turn on boost...
Antony Riakiotakis [Tue, 22 Jan 2013 17:09:10 +0000 (17:09 +0000)]
Scons, linux: If we are to keep WITH_INTERNATIONAL on by default, also turn on boost by default because it locale libraries are needed

6 years agoa better fix for scons finding pyconfig.h in ubuntu 12.10
Antony Riakiotakis [Tue, 22 Jan 2013 16:40:40 +0000 (16:40 +0000)]
a better fix for scons finding pyconfig.h in ubuntu 12.10

6 years agoFix/workaround for GLSL textured and matcap modes for dyntopo
Sergey Sharybin [Tue, 22 Jan 2013 16:06:09 +0000 (16:06 +0000)]
Fix/workaround for GLSL textured and matcap modes for dyntopo

Currently used special checks in DM draw code, perhaps better would be
simply to flush changes from PBVH to DM.

Anyway, now things seems to be working OK, will check on better solution
from code point of view later.

6 years agoBugfix #33945
Ton Roosendaal [Tue, 22 Jan 2013 15:30:29 +0000 (15:30 +0000)]
Bugfix #33945

OSX: in HiDPI mode, the brush circle doubled on every use.
Was caused by new code storing and setting brush sizes.

6 years agoFix [#33962] Grease Pencil crashing blender
Bastien Montagne [Tue, 22 Jan 2013 15:22:46 +0000 (15:22 +0000)]
Fix [#33962] Grease Pencil crashing blender

Own fault from grease pencil to curve enhacement. Fixed the bug itself, and made poll of convert operator more strict (no only active when there is something to convert, i.e. at least one stroke!).

6 years agoFix for build with scons whithout i18n support.
Bastien Montagne [Tue, 22 Jan 2013 14:55:34 +0000 (14:55 +0000)]
Fix for build with scons whithout i18n support.

This should not be needed, I really see no reason for this linking error, but I'd rather use this hack than wasting more time over this issue. When will we get rid of this "two build systems to maintain" time-wasting situation?

6 years agoCycles:
Thomas Dinges [Tue, 22 Jan 2013 14:49:52 +0000 (14:49 +0000)]
Cycles:
* Disable Lamp MIS on sm_20. Still enabled for CPU and sm_21 and above.

6 years agorevert scons fix, it is necessary after all
Antony Riakiotakis [Tue, 22 Jan 2013 14:25:20 +0000 (14:25 +0000)]
revert scons fix, it is necessary after all

6 years agoubuntu 12.10 does not have pyconfig.h in include directory causing scons to fail...
Antony Riakiotakis [Tue, 22 Jan 2013 14:14:30 +0000 (14:14 +0000)]
ubuntu 12.10 does not have pyconfig.h in include directory causing scons to fail. Omitting since it looks like cmake only uses Python.h too

6 years agoadd path for particle brush
Campbell Barton [Tue, 22 Jan 2013 13:47:44 +0000 (13:47 +0000)]
add path for particle brush

6 years agostyle cleanup
Campbell Barton [Tue, 22 Jan 2013 13:35:02 +0000 (13:35 +0000)]
style cleanup

6 years agoMatcap fix:
Ton Roosendaal [Tue, 22 Jan 2013 12:36:06 +0000 (12:36 +0000)]
Matcap fix:

Setting Cycles as render engine skipped matcap drawing.
Logic for checking drawing types needed a shuffle.

6 years agoGood rule of thumb. If blenderplayer gets broken after stubs.c leaves my "recently...
Antony Riakiotakis [Tue, 22 Jan 2013 12:32:07 +0000 (12:32 +0000)]
Good rule of thumb. If blenderplayer gets broken after stubs.c leaves my "recently opened" menu on my editor, something is really wrong :)

6 years agoscons compile fix for Ton's matcaps work
Joshua Leung [Tue, 22 Jan 2013 11:37:12 +0000 (11:37 +0000)]
scons compile fix for Ton's matcaps work

6 years agoConfirming GPL license and thanks to the people who provided the matcaps:
Ton Roosendaal [Tue, 22 Jan 2013 11:29:29 +0000 (11:29 +0000)]
Confirming GPL license and thanks to the people who provided the matcaps:

Knt Trammell and Aidy Burrows and John Herreno.

6 years agoadd missing includes
Campbell Barton [Tue, 22 Jan 2013 11:27:22 +0000 (11:27 +0000)]
add missing includes

6 years agocomments for RNA_def_property_ui_range() and clamp some out-of-range values.
Campbell Barton [Tue, 22 Jan 2013 11:23:05 +0000 (11:23 +0000)]
comments for RNA_def_property_ui_range() and clamp some out-of-range values.

6 years agoMatcap support in 3D Viewport.
Ton Roosendaal [Tue, 22 Jan 2013 11:18:41 +0000 (11:18 +0000)]
Matcap support in 3D Viewport.

Full log is here:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability#Matcap_in_3D_viewport

Implementation notes:

- Matcaps are an extension of Solid draw mode, and don't show in other drawmodes.
  (It's mostly intended to aid modeling/sculpt)

- By design, Matcaps are a UI feature, and only stored locally for the UI itself, and
  won't affect rendering or materials.

- Currently a set of 16 (GPL licensed) Matcaps have been compiled into Blender.
  It doesn't take memory or cpu time, until you use it.

- Brush Icons and Matcaps use same code now, and only get generated/allocated on
  actually using it (instead of on startup).

- The current set might get new or different images still, based on user feedback.

- Matcap images are 512x512 pixels, so each image takes 1 Mb memory. Unused matcaps get
  freed immediately. The Matcap icon previews (128x128 pixels) stay in memory.

- Loading own matcap image files will be added later. That needs design and code work
  to get it stable and memory-friendly.

- The GLSL code uses the ID PreviewImage for matcaps. I tested it using the existing
  Material previews, which has its limits... especially for textured previews the
  normal-mapped matcap won't look good.

6 years agofix [#33889] Unexpected weights after parenting with Empty Groups
Campbell Barton [Tue, 22 Jan 2013 10:51:57 +0000 (10:51 +0000)]
fix [#33889] Unexpected weights after parenting with Empty Groups

out of range dvert's are now cleared before adding new-empty groups.

6 years agoFix #33951: Only margin is correctly baked for non-displacement baking
Sergey Sharybin [Tue, 22 Jan 2013 09:37:46 +0000 (09:37 +0000)]
Fix #33951: Only margin is correctly baked for non-displacement baking

Was own mistake in recent changes.

6 years agoFix projection texture painting crash
Sergey Sharybin [Tue, 22 Jan 2013 08:05:00 +0000 (08:05 +0000)]
Fix projection texture painting crash

It was caused by own mistake by not noticing externtex is used not
only by render engine. Now this function uses pool passed as argument
rather than using R.pool.

6 years agoreverting r53798 to fix [#33831], it casued bug [#33921]
Campbell Barton [Tue, 22 Jan 2013 07:10:42 +0000 (07:10 +0000)]
reverting r53798 to fix [#33831], it casued bug [#33921]

6 years agoupdate stub
Campbell Barton [Tue, 22 Jan 2013 06:55:15 +0000 (06:55 +0000)]
update stub

6 years agocorrect addon tutorial section on keymap register/unregister and add label next to...
Campbell Barton [Tue, 22 Jan 2013 06:41:12 +0000 (06:41 +0000)]
correct addon tutorial section on keymap register/unregister and add label next to image color-depth option.
having buttons labelled [8, 16] on their own is not very meaningful.

6 years agofix [#33841] Disabling and re-enabling live addon crashes blender (modal/draw handler)
Campbell Barton [Tue, 22 Jan 2013 06:16:49 +0000 (06:16 +0000)]
fix [#33841] Disabling and re-enabling live addon crashes blender (modal/draw handler)

6 years agofix for error where linking objects to the scene would show the popup if activated...
Campbell Barton [Tue, 22 Jan 2013 04:54:31 +0000 (04:54 +0000)]
fix for error where linking objects to the scene would show the popup if activated from the object menu.

6 years agoproperty change reporting now uses the context again, rather then checking a dir...
Campbell Barton [Tue, 22 Jan 2013 04:24:01 +0000 (04:24 +0000)]
property change reporting now uses the context again, rather then checking a dir() on context, hard-code common paths.
eg:
  bpy.context.scene.render.resolution_x = 1921
  bpy.context.object.data.use_auto_smooth = True
  bpy.context.object.active_material.diffuse_intensity = 1
  bpy.context.scene.world.exposure = 0.1

also remove duplicate GS() defines

6 years agoadd rna paths to toolsettings and its substructs, useful for python scripting.
Campbell Barton [Tue, 22 Jan 2013 03:11:11 +0000 (03:11 +0000)]
add rna paths to toolsettings and its substructs, useful for python scripting.

6 years agofix [#33836] issuing bpy.ops.render.render() in console crashes the program
Campbell Barton [Tue, 22 Jan 2013 02:21:21 +0000 (02:21 +0000)]
fix [#33836] issuing bpy.ops.render.render() in console crashes the program

don't check the event queue from threads, assert if this happens in future.

6 years agoImproved performance for multiple iterations, keeping the same laplacian matrix.
Alexander Pinzon [Mon, 21 Jan 2013 19:33:58 +0000 (19:33 +0000)]
Improved performance for multiple iterations, keeping the same laplacian matrix.

6 years agocode cleanup: minor changes, replace len_v3 with len_squared_v3 for comparison.
Campbell Barton [Mon, 21 Jan 2013 18:45:31 +0000 (18:45 +0000)]
code cleanup: minor changes, replace len_v3 with len_squared_v3 for comparison.

6 years agoMultires baker: fix wrong normalization if baking happens to multiple images
Sergey Sharybin [Mon, 21 Jan 2013 18:34:27 +0000 (18:34 +0000)]
Multires baker: fix wrong normalization if baking happens to multiple images

Previously normalization will happen per image buffer individually, which
was wrong in cases different faces of the sane mesh uses different images.

Also solved possible threading issues when calculating min.max displacement.

6 years agoMultires baker: fix bad face->grid index conversion for displacement baker
Sergey Sharybin [Mon, 21 Jan 2013 18:34:20 +0000 (18:34 +0000)]
Multires baker: fix bad face->grid index conversion for displacement baker

6 years agoMultires baker: fix memory leak caused by threading issues
Sergey Sharybin [Mon, 21 Jan 2013 18:34:14 +0000 (18:34 +0000)]
Multires baker: fix memory leak caused by threading issues

Didn't notice this before because of non-working guarded allocation
at the time threading was added to multires baker.

6 years agoVertex bevel: adjust vertex positions to make a more rounded pattern.
Howard Trickey [Mon, 21 Jan 2013 18:19:34 +0000 (18:19 +0000)]
Vertex bevel: adjust vertex positions to make a more rounded pattern.
Also fixed debug quad drawing code to not join successive quads.

6 years agoFix compile with collada enabled
Jens Verwiebe [Mon, 21 Jan 2013 17:38:11 +0000 (17:38 +0000)]
Fix compile with collada enabled

6 years agofix [#33937] Planar decimate + triangulate operator leaves non-triangle faces
Campbell Barton [Mon, 21 Jan 2013 17:25:08 +0000 (17:25 +0000)]
fix [#33937] Planar decimate + triangulate operator leaves non-triangle faces

triangulate operation will now always triangulate, even on degenerate faces.

6 years agoadd an influence slider to mesh cache.
Campbell Barton [Mon, 21 Jan 2013 16:43:04 +0000 (16:43 +0000)]
add an influence slider to mesh cache.

6 years agoUsual minor UI messages fixes...
Bastien Montagne [Mon, 21 Jan 2013 16:25:25 +0000 (16:25 +0000)]
Usual minor UI messages fixes...

6 years agomesh-cache deform modifier,
Campbell Barton [Mon, 21 Jan 2013 15:41:00 +0000 (15:41 +0000)]
mesh-cache deform modifier,
supports MDD and PC2 formats.

see wiki docs:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Modifiers/Deform/Mesh_Cache

6 years agoOn second thought, exposes bpy.app.translations also when built without i18n support...
Bastien Montagne [Mon, 21 Jan 2013 15:10:22 +0000 (15:10 +0000)]
On second thought, exposes bpy.app.translations also when built without i18n support, this will avoid the need for py scripts to test for its presence everywhere!

6 years agoAdd (vertex-only) Bevel to Mesh > Vertex menu.
Howard Trickey [Mon, 21 Jan 2013 14:15:57 +0000 (14:15 +0000)]
Add (vertex-only) Bevel to Mesh > Vertex menu.

6 years agoFix building for new collada...
Bastien Montagne [Mon, 21 Jan 2013 14:00:01 +0000 (14:00 +0000)]
Fix building for new collada...

6 years agoAdded gsoc-2012 collada improvements from bratwurst branch
Gaia Clary [Mon, 21 Jan 2013 13:45:49 +0000 (13:45 +0000)]
Added gsoc-2012 collada improvements from bratwurst branch

6 years agoBevel vertex: fix rebuild of faces so they are connected when seg > 1.
Howard Trickey [Mon, 21 Jan 2013 13:31:16 +0000 (13:31 +0000)]
Bevel vertex: fix rebuild of faces so they are connected when seg > 1.

6 years agoAvoid using python keyword as operator property name
Sergey Sharybin [Mon, 21 Jan 2013 12:44:40 +0000 (12:44 +0000)]
Avoid using python keyword as operator property name

6 years agoFix #33899: Maya keymap/custom keymap selection issues
Sergey Sharybin [Mon, 21 Jan 2013 12:27:31 +0000 (12:27 +0000)]
Fix #33899: Maya keymap/custom keymap selection issues

Switch selection from Release to Click, so releasing mouse button
after transform confirmation wouldn't trigger selection operator.

However, needed to disable old Click behavior which used to deselect
everything if click happened outside of any object. It wad bad way
to do such a behavior and shall be re-think and solved in a better
way.

6 years agoPrint warnings when invalid py dict/key/value is found in translations data (do not...
Bastien Montagne [Mon, 21 Jan 2013 12:01:47 +0000 (12:01 +0000)]
Print warnings when invalid py dict/key/value is found in translations data (do not error here, this is not critical and can be ignored/skiped, and it would break translations for other addons as well).

6 years agoFix image pool crash when acquiring buffer for NULL image
Sergey Sharybin [Mon, 21 Jan 2013 11:38:15 +0000 (11:38 +0000)]
Fix image pool crash when acquiring buffer for NULL image

6 years agoUpdating icons to 2.5.08 (see [#33448])
Joshua Leung [Mon, 21 Jan 2013 11:25:04 +0000 (11:25 +0000)]
Updating icons to 2.5.08  (see [#33448])

Thanks Wolter van der Velde for adding the (most of) the missing Force Field
icons

6 years agoExpose locale_explode in bpy.app.translations, will be handy in i18n manipulation...
Bastien Montagne [Mon, 21 Jan 2013 10:57:24 +0000 (10:57 +0000)]
Expose locale_explode in bpy.app.translations, will be handy in i18n manipulation scripts/addons.

6 years agoI18n fix: "" context is not the same as NULL context!
Bastien Montagne [Mon, 21 Jan 2013 10:52:34 +0000 (10:52 +0000)]
I18n fix: "" context is not the same as NULL context!

This bug did not appear earlier because the "" default context was actually never used, always NULL context was passed instead. But bpy.app.translations uses "" as default context in its keys (simplifies the hash/comp functions of internal py messages cache)...

So now, Blender prefers NULL (None in python) as default context value, but understands also "" as such.

6 years agoPatch [#33926] Menu separators to group the items on Specials Menu
Joshua Leung [Mon, 21 Jan 2013 10:48:18 +0000 (10:48 +0000)]
Patch [#33926] Menu separators to group the items on Specials Menu
Submitted by: Harley Acheson (harley)

This patch adds separators to group items in the Special Menu in EditMode. Order
of items is untouched.

6 years agoFixes to BLF_locale_explode, was not handling all cases correctly (own fault) :/
Bastien Montagne [Mon, 21 Jan 2013 10:46:01 +0000 (10:46 +0000)]
Fixes to BLF_locale_explode, was not handling all cases correctly (own fault) :/

6 years agofix regression in own recent commit, vertex flags were left uninitialized.
Campbell Barton [Mon, 21 Jan 2013 09:54:33 +0000 (09:54 +0000)]
fix regression in own recent commit, vertex flags were left uninitialized.

6 years agoSupport normalized displacement maps in cases maximal distance is not set
Sergey Sharybin [Mon, 21 Jan 2013 09:05:05 +0000 (09:05 +0000)]
Support normalized displacement maps in cases maximal distance is not set

This will calculate maximal distance automatically and normalize displacement
to it. Before this change normalization will not happen at all in cases max
distance is not set manually.

This affects on "regular" baker only, there are still some fixes to come for
multiresolution baker, but that could be solved separately.

6 years agoFixed render time regression in Blender Internal
Sergey Sharybin [Mon, 21 Jan 2013 08:49:42 +0000 (08:49 +0000)]
Fixed render time regression in Blender Internal

It was caused by image threading safe commit and it was noticeable
only on really multi-core CPU (like dual-socket Xeon stations), was
not visible on core i7 machine.

The reason of slowdown was spinlock around image buffer referencing,
which lead to lots of cores waiting for single core and using image
buffer after it was referenced was not so much longer than doing
reference itself.

The most clear solution here seemed to be introducing Image Pool
which will contain list of loaded and referenced image buffers, so
all threads could skip lock if the pool is used for reading only.
Lock only needed in cases when buffer for requested image user is
missing in the pool. This lock will happen only once per image so
overall amount of locks is much less that it was before.

To operate with pool:
- BKE_image_pool_new() creates new pool
- BKE_image_pool_free() destroys pool and dereferences all image
  buffers which were loaded to it
- BKE_image_pool_acquire_ibuf() returns image buffer for given
  image and user. Pool could be NULL and in this case fallback to
  BKE_image_acquire_ibuf will happen.

  This helps to avoid lots to if(poll) checks in image sampling
  code.

- BKE_image_pool_release_ibuf releases image buffer. In fact, it
  will only do something if pool is NULL, in all other case it'll
  equal to DoNothing operation.

6 years agoVarious cleanup in i18n code (having funcs implemented in two different places is...
Bastien Montagne [Mon, 21 Jan 2013 08:08:20 +0000 (08:08 +0000)]
Various cleanup in i18n code (having funcs implemented in two different places is tricky, you quickly forget to add/edit one, we already have this problem with ugly bplayer stub... e.g. since r53938, BLF_locale_explode was not implemented in non-WITH_INTERNATIONAL builds). Also tried to simplify #ifdef's here...

6 years agoStyle cleanup
Joshua Leung [Mon, 21 Jan 2013 06:32:09 +0000 (06:32 +0000)]
Style cleanup

6 years agoBugfix [#33852] Scale of a strip in NLA is changed after moving it long distance
Joshua Leung [Mon, 21 Jan 2013 06:31:17 +0000 (06:31 +0000)]
Bugfix [#33852] Scale of a strip in NLA is changed after moving it long distance
using numeric input

When using numeric input to move strips, the strip extent clamping code could
end up prematurely truncating one endpoint. This was because the clamping code
uses the values of the other end (e.g. end for start, and start for end) as one
of the limits on its allowable range to prevent inverted strips.

Now we just set these values twice - the first time, one of the endpoints may
still get truncated (while the other one will be able to go to its correct
value), then the second time both will get set correctly (and validated too).

6 years agoFix compiling problems with translation stuff disabled
Joshua Leung [Mon, 21 Jan 2013 05:42:19 +0000 (05:42 +0000)]
Fix compiling problems with translation stuff disabled

6 years agofix for own error in vertex slide, isolated verts mixed with regular selection would...
Campbell Barton [Mon, 21 Jan 2013 03:00:10 +0000 (03:00 +0000)]
fix for own error in vertex slide, isolated verts mixed with regular selection would crash.

6 years agoBugfix [#33946] Bake Action fails in SVN for Objects
Joshua Leung [Mon, 21 Jan 2013 02:40:51 +0000 (02:40 +0000)]
Bugfix [#33946] Bake Action fails in SVN for Objects

The problems here were caused by a cleanup commit (r. 53369).
BTW, the code here is pretty convoluted mess.

6 years agominor changes to _build_translations_cache(), remove unneeded NULL checks and use...
Campbell Barton [Mon, 21 Jan 2013 02:40:36 +0000 (02:40 +0000)]
minor changes to _build_translations_cache(), remove unneeded NULL checks and use slightly different funcs for getting strings.

6 years agocode cleanup: style & warnings.
Campbell Barton [Mon, 21 Jan 2013 02:30:40 +0000 (02:30 +0000)]
code cleanup: style & warnings.

6 years agoBevel vertex only (shortcut: control-shift-B) initial commit.
Howard Trickey [Mon, 21 Jan 2013 01:52:23 +0000 (01:52 +0000)]
Bevel vertex only (shortcut: control-shift-B) initial commit.

6 years agoOmmit extraneous check for paint tool in 3d mapping case (Only draw tool
Antony Riakiotakis [Mon, 21 Jan 2013 01:01:15 +0000 (01:01 +0000)]
Ommit extraneous check for paint tool in 3d mapping case (Only draw tool
uses this anyway) and avoid copying of coordinate for 3D case.

6 years agoCycles Hair: Fix of cardinal curve intersection routine
Stuart Broadfoot [Mon, 21 Jan 2013 00:58:14 +0000 (00:58 +0000)]
Cycles Hair: Fix of cardinal curve intersection routine

Fixed some of my own mistakes in the cardinal curve intersection routine.

6 years agoFix #33939, if initialization of vert slide failed, code did not handle
Antony Riakiotakis [Mon, 21 Jan 2013 00:39:54 +0000 (00:39 +0000)]
Fix #33939, if initialization of vert slide failed, code did not handle
the case well.

6 years ago3D mapping for projective texture painting (only for draw brush). Useful
Antony Riakiotakis [Sun, 20 Jan 2013 21:32:14 +0000 (21:32 +0000)]
3D mapping for projective texture painting (only for draw brush). Useful
to draw with procedural textures on surface of object. 2D painting will
still paint as if tiled.

When we unify the paint systems, the texture sampling functions will
need to be changed. Sculpt uses a slightly different system that passes
both screen and 3d coordinates to the sampling function. This commit
however is not too disrupting for that however so it can go in now.

6 years agoFix for usual bplayer issue (own fault)...
Bastien Montagne [Sun, 20 Jan 2013 18:17:01 +0000 (18:17 +0000)]
Fix for usual bplayer issue (own fault)...

6 years agoPython i18n API. Many thanks to Campbell and Brecht for the reviews and suggestions!
Bastien Montagne [Sun, 20 Jan 2013 17:29:07 +0000 (17:29 +0000)]
Python i18n API. Many thanks to Campbell and Brecht for the reviews and suggestions!

This commit adds:
* A new bpy.app.translations module giving some info about locales/translation stuff (current active locale, all locales currently known by blender, all translation contexts currently defined, etc.).

* The ability for addons to feature translations, using the (un)register functions of above module.

* Also cleans up "translate py string when storing into RNA prop" by removing "PROP_TRANSLATE" string's subtype, and adding a PROP_STRING_PY_TRANSLATE flag instead (this way it is no more exposed to python...).

Addon translations work with py dictionaries: each addon features a dict {lang: {(context, message): translation, ...}, ...}, which is registered when the addon is enabled (and unregistered when disabled).

Then, when a key (context, message) is not found in regular mo catalog, a cache dict for current locale is built from all registered addon translations, and key is searched in it.

Note: currently addons writers have to do all the work by hand, will add something (probably extend "edit translation" addon) to automate messages extraction from addons soon(ish)! To get a look to expected behavior from addons, have a look at render_copy_settings/__init__.py and render_copy_settings/translations.py (rather stupid example currently, but...). Once we have a complete process, I'll also update relevant wiki pages.

6 years agoFix #33941. We need to free the image editor ibuf too if no image is
Antony Riakiotakis [Sun, 20 Jan 2013 17:25:46 +0000 (17:25 +0000)]
Fix #33941. We need to free the image editor ibuf too if no image is
found for cloning.

6 years agofix for own error in recent BLI_array commit
Campbell Barton [Sun, 20 Jan 2013 16:58:14 +0000 (16:58 +0000)]
fix for own error in recent BLI_array commit

6 years agoAdd missing virtual destructor for VirtualMemoryAllocator
Nicholas Bishop [Sun, 20 Jan 2013 15:36:32 +0000 (15:36 +0000)]
Add missing virtual destructor for VirtualMemoryAllocator

Fixes a warning from GCC 4.7.2.

6 years agocode cleanup: remove some paranoid checks which would have crashed anyway earlier on.
Campbell Barton [Sun, 20 Jan 2013 14:50:50 +0000 (14:50 +0000)]
code cleanup: remove some paranoid checks which would have crashed anyway earlier on.
Also some minor formatting.

6 years agoMore win32 multimon (r53923). Changed getNumDisplays so that it will actually succeed.
Jason Wilkins [Sun, 20 Jan 2013 14:40:31 +0000 (14:40 +0000)]
More win32 multimon (r53923).  Changed getNumDisplays so that it will actually succeed.

6 years agofix for possible null pointer dereference in PE_create_particle_edit
Campbell Barton [Sun, 20 Jan 2013 14:10:10 +0000 (14:10 +0000)]
fix for possible null pointer dereference in PE_create_particle_edit

6 years agoAdd multimon support to GHOST_DisplayManagerWin32.cpp (It seemed to work before,...
Jason Wilkins [Sun, 20 Jan 2013 13:46:53 +0000 (13:46 +0000)]
Add multimon support to GHOST_DisplayManagerWin32.cpp (It seemed to work before, but recent changes to GHOST_ASSERT caused it to abort if WITH_ASSERT_ABORT was configured).