8 years agoMerged changes in the trunk up to revision 55357.
Tamito Kajiyama [Mon, 18 Mar 2013 00:48:59 +0000 (00:48 +0000)]
Merged changes in the trunk up to revision 55357.

Resolved conflicts:

Also updated source/blender/blenkernel/intern/linestyle.c as a follow-up of
recent changes for the use of bool.

8 years agoFix for "draw images as texture"
Ton Roosendaal [Sun, 17 Mar 2013 17:32:45 +0000 (17:32 +0000)]
Fix for "draw images as texture"

Zooming in on images in Image window now shows pixels again (was filtered).

Now the glaDrawPixelsTex() and glaDrawPixelsAuto() have an argument to
define if images should zoom in with linear filter, or draw pixels.

8 years agoFeature:
Ton Roosendaal [Sun, 17 Mar 2013 16:54:06 +0000 (16:54 +0000)]

Image Editor and 3D view background image now use new automatic switching for
drawing GPU texture or OpenGL DrawPixels too. For large zoomed images
it gives massive speedup.

8 years agoFix evil own bug: paint_redraw accessed freed memory. Still doesn't
Antony Riakiotakis [Sun, 17 Mar 2013 16:53:35 +0000 (16:53 +0000)]
Fix evil own bug: paint_redraw accessed freed memory. Still doesn't
solve problem not being able to paint with black in image editor.

8 years agoNew feature:
Ton Roosendaal [Sun, 17 Mar 2013 14:38:58 +0000 (14:38 +0000)]
New feature:

Automatic switching for drawing pixel buffers via glDrawPixels or using GPU textures

It works with a User Preference limit, in megapixels, to define whether to use
GPU or direct pixel drawing. Default is now initialized to 10 MP (4k buffers).

Especially for zooming out (draw smaller) texture drawing is much smaller. Also
Nvidia cards typically draw much faster with textures in general.

Added to node backdrop first now, the other editors follow in a next commit.

For coders: added new DNA function to initialize new struct variables, so you
don't have to sub-version files anymore.

   DNA_struct_elem_find(fd->filesdna, "structname", "typename", "varname")

"filesdna" is the sdna description of the current file being versioned.

8 years agoCycles / CUDA:
Thomas Dinges [Sun, 17 Mar 2013 14:32:50 +0000 (14:32 +0000)]
Cycles / CUDA:
* Simplify Computing Capability Check, only check for major.

8 years agocode cleanup: incorrect sized array args, remove some redundant code.
Campbell Barton [Sun, 17 Mar 2013 10:26:23 +0000 (10:26 +0000)]
code cleanup: incorrect sized array args, remove some redundant code.

8 years agofix for missing NULL pointer checks and incorrect array free
Campbell Barton [Sun, 17 Mar 2013 10:15:06 +0000 (10:15 +0000)]
fix for missing NULL pointer checks and incorrect array free

8 years agoAdded descriptions for each constraint type, including common usage
Joshua Leung [Sun, 17 Mar 2013 03:45:15 +0000 (03:45 +0000)]
Added descriptions for each constraint type, including common usage
restrictions/limits to reduce confusion

8 years agoSetting clone cursor is now an option for paint operator. This is not
Antony Riakiotakis [Sun, 17 Mar 2013 03:08:46 +0000 (03:08 +0000)]
Setting clone cursor is now an option for paint operator. This is not
too nice but it frees the Ctrl-LClick shortcut and allows us to set
invert mode for other paint tools, such as sharpen vs blur or invert
colour for draw brush. This conflict has existed on GSOC branch, better
resolve now before merging invert functionality.

8 years agoFix for a crash due to a bug in the handling of singularity in stroke creation,
Tamito Kajiyama [Sat, 16 Mar 2013 22:39:39 +0000 (22:39 +0000)]
Fix for a crash due to a bug in the handling of singularity in stroke creation,
where additions of a small offset (to prevent vertices from being at the same point)
were not properly done when vertices were shifted in the reverse order.

A problem report by Vicente Carro through personal communications, thanks a lot!

8 years ago- ghost-sdl builds again.
Campbell Barton [Sat, 16 Mar 2013 20:49:46 +0000 (20:49 +0000)]
- ghost-sdl builds again.
- without python builds without warnings.
- replace MAXFLOAT -> FLT_MAX in some areas, MAXFLOAT overflows (lager then float range).
- add cmake option WITH_GCC_MUDFLAP to enable libmudflap use.

8 years agorevert own change: don't use memchr for strnlen, causes problems when the len is...
Campbell Barton [Sat, 16 Mar 2013 18:52:09 +0000 (18:52 +0000)]
revert own change: don't use memchr for strnlen, causes problems when the len is longer then the string data, instead use strnlen from freebsd.
also simplify empty string checks in logic_ops.c

8 years agoStop dyntopo updates from happening in masked areas
Nicholas Bishop [Sat, 16 Mar 2013 18:22:45 +0000 (18:22 +0000)]
Stop dyntopo updates from happening in masked areas

Fixes [#34348] Collapse short edges affects masked geometry

Fixed by disallowing topology updates on edges with a vertex masked at
50% or greater. This is a necessarily arbitrary choice; can't do
halfway updates for topology like we can with displacement.

8 years agoFix sculpt view normal for transformed objects
Nicholas Bishop [Sat, 16 Mar 2013 17:45:58 +0000 (17:45 +0000)]
Fix sculpt view normal for transformed objects

Patch from Antony Riakiotakis, thanks!

Fixes [#34641] "Front Faces Only" option in SculptMode behaves weird

8 years agofix for buffer overrun in reading bookmarks when a line was over 256 bytes.
Campbell Barton [Sat, 16 Mar 2013 17:33:16 +0000 (17:33 +0000)]
fix for buffer overrun in reading bookmarks when a line was over 256 bytes.

8 years agoBug fix, irc reported:
Ton Roosendaal [Sat, 16 Mar 2013 17:12:39 +0000 (17:12 +0000)]
Bug fix, irc reported:

Using new off-screen backbuffer selection failed for Lasso in editmode.

8 years agoFix for a crash due to mesh faces with wire frame materials not properly handled.
Tamito Kajiyama [Sat, 16 Mar 2013 16:41:12 +0000 (16:41 +0000)]
Fix for a crash due to mesh faces with wire frame materials not properly handled.
A problem report by Vicente Carro through personal communications, many thanks!

8 years agodon't create empty mesh object when separating if nothing is selected.
Campbell Barton [Sat, 16 Mar 2013 16:38:18 +0000 (16:38 +0000)]
don't create empty mesh object when separating if nothing is selected.

8 years agopatch [#34634] Select vertices without a group
Campbell Barton [Sat, 16 Mar 2013 16:11:50 +0000 (16:11 +0000)]
patch [#34634] Select vertices without a group
from Kevin Mackay (yakca)

8 years agoown error in recent knife-project changes.
Campbell Barton [Sat, 16 Mar 2013 16:10:27 +0000 (16:10 +0000)]
own error in recent knife-project changes.

8 years agostyle cleanup
Campbell Barton [Sat, 16 Mar 2013 14:42:05 +0000 (14:42 +0000)]
style cleanup

8 years agocode cleanup: shadowing
Campbell Barton [Sat, 16 Mar 2013 14:33:32 +0000 (14:33 +0000)]
code cleanup: shadowing

8 years agofix for crash when using BM_face_calc_tessellation(), its not ensured that all tris...
Campbell Barton [Sat, 16 Mar 2013 14:18:32 +0000 (14:18 +0000)]
fix for crash when using BM_face_calc_tessellation(), its not ensured that all tris will be filled in.
(effected knife project and laplacian smooth).

8 years agoFix for [#34654] Cycles hair particle system modifier obeys viewport visibility as...
Thomas Dinges [Sat, 16 Mar 2013 08:49:39 +0000 (08:49 +0000)]
Fix for [#34654] Cycles hair particle system modifier obeys viewport visibility as well
* Now Show Render and Show Viewport flags work independently and correct.

8 years agoSome more assorted fixes
Joshua Leung [Sat, 16 Mar 2013 05:58:59 +0000 (05:58 +0000)]
Some more assorted fixes
* More duplicate/wrong comments (copy+paste errors)
* Brough Calculate/Clear Motion Path UI for bones more in line with the Object

8 years agoAssorted anim editor fixes
Joshua Leung [Sat, 16 Mar 2013 05:48:46 +0000 (05:48 +0000)]
Assorted anim editor fixes
* Click-select operators don't have "register" flag anymore
* Graph Editor click select can be undone, just like everything else
* "Current frame" -> "Current Frame" for consistency with rest of menu

8 years agoNLA "Add Track" can now be used to add tracks to previously empty AnimData
Joshua Leung [Sat, 16 Mar 2013 05:09:32 +0000 (05:09 +0000)]
NLA "Add Track" can now be used to add tracks to previously empty AnimData
blocks, provided the blocks in question are in fact selected.

8 years agoAny ID Selector Template: ID Type dropdown now shows icon only as originally
Joshua Leung [Sat, 16 Mar 2013 03:59:03 +0000 (03:59 +0000)]
Any ID Selector Template: ID Type dropdown now shows icon only as originally

Finally, I've figured out a way to get the ID Selector Template to only show the
icon for the type of ID block (i.e. the intended design), instead of icon+text.
This improves the layout a bit, as previously the type selector and ID-block
pointer and label would all be the same sizes (roughly 1/3rd of the overall
width each), which meant that there wasn't much room left to actually see which
datablock had been selected.

Additionally, I've fixed a few more layout types which still didn't correctly
propagate the red-alert flags.

8 years agoAssorted small fixes
Joshua Leung [Sat, 16 Mar 2013 02:53:45 +0000 (02:53 +0000)]
Assorted small fixes
* Incorrect comment (copy+paste error) in nla_edit
* Whitespace in rna_gpencil
* The icon for AnimData is now attached to its RNA definition

8 years agoNLA Editor: Show the ID+AnimData block that the AnimData panel is showing the
Joshua Leung [Sat, 16 Mar 2013 02:42:19 +0000 (02:42 +0000)]
NLA Editor: Show the ID+AnimData block that the AnimData panel is showing the
active action for

8 years agoobject converting curve/mball to a mesh would give invalid selection state (edges...
Campbell Barton [Sat, 16 Mar 2013 01:19:03 +0000 (01:19 +0000)]
object converting curve/mball to a mesh would give invalid selection state (edges selected but nothing else).
add arg to BKE_mesh_calc_edges() so selecting newly created edges is optional.

8 years agofix for own mistake in using alloca in a loop, replace with BLI_buffer
Campbell Barton [Sat, 16 Mar 2013 00:41:32 +0000 (00:41 +0000)]
fix for own mistake in using alloca in a loop, replace with BLI_buffer

8 years agochanges to BLI_buffer
Campbell Barton [Sat, 16 Mar 2013 00:12:14 +0000 (00:12 +0000)]
changes to BLI_buffer
- assert if BLI_buffer_at() is called with an out of bounds value.
- add BLI_buffer_resize_data() macro which resizes and returns a pointer to the new array.
- warn if missing call to BLI_buffer_free().

8 years agocorrect lasso, weightpaint select, was calling BLI_lasso_boundbox() twice.
Campbell Barton [Fri, 15 Mar 2013 22:56:24 +0000 (22:56 +0000)]
correct lasso, weightpaint select, was calling BLI_lasso_boundbox() twice.

8 years agocode cleanup: quiet some -Wshadow warnings, mix of obvious mistakes and harmless...
Campbell Barton [Fri, 15 Mar 2013 22:55:10 +0000 (22:55 +0000)]
code cleanup: quiet some -Wshadow warnings, mix of obvious mistakes and harmless global/local naming conflict.

8 years agominor cleanup and calculate rake angle before jittering or result
Antony Riakiotakis [Fri, 15 Mar 2013 22:32:44 +0000 (22:32 +0000)]
minor cleanup and calculate rake angle before jittering or result
becomes essentially, random

8 years agoknife project improvements
Campbell Barton [Fri, 15 Mar 2013 20:39:56 +0000 (20:39 +0000)]
knife project improvements
When running in non-interactive mode, dont add a area draw callback or adjust the cursor, use a fixed snap value and don't use opengl lookups on faces.
Minor optimization - compare squared distances where possible.

8 years agofix for error pasting into a color button (tried to read its rna index of -1)
Campbell Barton [Fri, 15 Mar 2013 20:16:20 +0000 (20:16 +0000)]
fix for error pasting into a color button (tried to read its rna index of -1)

8 years agoFix: multisample viewport drawing didn't work well with selection or particle
Brecht Van Lommel [Fri, 15 Mar 2013 19:56:33 +0000 (19:56 +0000)]
Fix: multisample viewport drawing didn't work well with selection or particle
brushes, due to issues with color coded drawing or slow/buggy reading from such
a buffer on some systems.

In case multisample is enabled now, it uses an offscreen buffer for such drawing,
which is not multisampled and so should not cause issues. This does mean there is
some extra GPU memory usage when multisample is enabled, and we could optimize
triple buffer to work together here somehow to share buffers, but it's better than
having selection not working.

8 years agoScreen: add exit callback for area and region types, this gets called when
Brecht Van Lommel [Fri, 15 Mar 2013 19:56:29 +0000 (19:56 +0000)]
Screen: add exit callback for area and region types, this gets called when
hiding or removing an area or region.

8 years agoknife project: improve selection inside/outside checks.
Campbell Barton [Fri, 15 Mar 2013 19:38:42 +0000 (19:38 +0000)]
knife project: improve selection inside/outside checks.
- use more accurate method to find if a face is inside projected lines.
- check faces intersect while expanding selection - in some cases this could result in the entire model being selected.

8 years agouse bool for knife, also scons tab/space mix.
Campbell Barton [Fri, 15 Mar 2013 19:00:21 +0000 (19:00 +0000)]
use bool for knife, also scons tab/space mix.

8 years agoCompile fix:
Thomas Dinges [Fri, 15 Mar 2013 17:18:52 +0000 (17:18 +0000)]
Compile fix:
* Scons needed PThread include after recent movie clip changes.

8 years agoFurther improvement for multi-threaded proxies
Sergey Sharybin [Fri, 15 Mar 2013 16:57:19 +0000 (16:57 +0000)]
Further improvement for multi-threaded proxies

Handle sequences in a special case for dealing with
sequence sources.

Namely handle separate frames in separate threads,
but do disk read from a critical section since HDD
is not so friendly with lots threads requesting for
data from it.

Makes proxy building much faster than it was before.

8 years agoFix #34649: texture size limit user preference not working.
Brecht Van Lommel [Fri, 15 Mar 2013 16:16:11 +0000 (16:16 +0000)]
Fix #34649: texture size limit user preference not working.

8 years agoadd in ifdef for WITH_LIBMV, correct own error passing float[2] as float[3]
Campbell Barton [Fri, 15 Mar 2013 15:47:32 +0000 (15:47 +0000)]
add in ifdef for WITH_LIBMV, correct own error passing float[2] as float[3]

8 years agoFix/disambiguation for some "Clip" i18n messages.
Bastien Montagne [Fri, 15 Mar 2013 15:13:34 +0000 (15:13 +0000)]
Fix/disambiguation for some "Clip" i18n messages.

8 years agoSmall fix to previous commit: temp buffer for translation context needs to be initial...
Bastien Montagne [Fri, 15 Mar 2013 15:12:46 +0000 (15:12 +0000)]
Small fix to previous commit: temp buffer for translation context needs to be initialized to relevant default value for operators... Also fixed not initializing those buffers in macro register function.

8 years agoknife project:
Campbell Barton [Fri, 15 Mar 2013 14:43:09 +0000 (14:43 +0000)]
knife project:
- selecting faces inside the cut now works properly
- improve epsilon for detecing if faces are inside a cut (still not perfect)

8 years agoAdd the possibility to define the translation context for py rna classes (operators...
Bastien Montagne [Fri, 15 Mar 2013 14:32:29 +0000 (14:32 +0000)]
Add the possibility to define the translation context for py rna classes (operators, panels and menus).

Thanks to Campell and Brecht for the reviews!

8 years agofix for own bad mistake using alloca in a loop, also knife project wasnt selecting...
Campbell Barton [Fri, 15 Mar 2013 13:18:35 +0000 (13:18 +0000)]
fix for own bad mistake using alloca in a loop, also knife project wasnt selecting correctly.

8 years agoknife projection feature,
Campbell Barton [Fri, 15 Mar 2013 13:06:31 +0000 (13:06 +0000)]
knife projection feature,
apart of 3d printing tools - use to cookie-cut text into a mesh.

8 years agoMulti-threaded frame calculation for movie clip proxies
Sergey Sharybin [Fri, 15 Mar 2013 11:59:46 +0000 (11:59 +0000)]
Multi-threaded frame calculation for movie clip proxies

This commit implements multi-threaded calculation of frames
when building proxies. Both scaling and undistortion steps
are now threaded.

Frames and proxy resolution are still handled one-by-one,
saving files after every single step. So if HDD is not so
fast, this commit could have not so much benefit.

Internal changes:

- Added IMB_scaleImBuf_threaded which scales given image
  buffer in multiple threads and uses bilinear filtering.

- libmv's camera intrinsics now have SetThreads() method
  which is used to specify how many OpenMP threads to use
  for buffer distortion/undistortion.

  And yeah, this code is using OpenMP for threading.

- Reshuffled a bit libmv-capi calls and added function
  BKE_tracking_distortion_set_threads to specify number
  of threads used by intrinscis.

8 years agocode cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,
Campbell Barton [Fri, 15 Mar 2013 10:48:48 +0000 (10:48 +0000)]
code cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,
also correct odd indentation.

8 years agoAdd missing operators from paint modes:
Antony Riakiotakis [Fri, 15 Mar 2013 10:45:43 +0000 (10:45 +0000)]
Add missing operators from paint modes:

All modes:
Shift-S sets smooth stroke mode

Texture Paint/Vertex Paint:
R springs brush rotation control menu
Ctrl-F sets brush user rotation

Vertex paint mode was getting transform events with R, made sure no
transform events are handled for paint modes.

8 years agoFix #34617, Track Position Node outputs had a limit value of 1 instead of the usual...
Lukas Toenne [Fri, 15 Mar 2013 10:34:32 +0000 (10:34 +0000)]
Fix #34617, Track Position Node outputs had a limit value of 1 instead of the usual 0 (multiple connections allowed). Common problem with the explicit limit value in socket C templates, should be removed ...

8 years agoSupport for rake in 2D image painting.
Antony Riakiotakis [Fri, 15 Mar 2013 09:48:51 +0000 (09:48 +0000)]
Support for rake in 2D image painting.

8 years agoPatch #34632: DPX/Cineon speed up
Sergey Sharybin [Fri, 15 Mar 2013 09:46:37 +0000 (09:46 +0000)]
Patch #34632: DPX/Cineon speed up

Done by Julien Enche (aka trap), thanks!

From the patch comment:
This patch speeds up Cineon/DPX file loading.
Some more checks are done in dpxOpen and cineonOpen functions so IB_test
flag can now be taken into account safely, and an unnecessary call to
IMB_rect_from_float has been removed.

DPX/Cineon file now loads around 3 times faster on my computer.

Own comment:
Ideally, IB_rect shall indeed indicate which buffers to load, however
currently all places which reads image uses this flag.

This fact already mentioned in OpenEXR reader and it shall be fine
to skip doing rect_from_float in readers themselves.

8 years agoSkip allocating any display buffer and starting any threads
Sergey Sharybin [Fri, 15 Mar 2013 09:35:12 +0000 (09:35 +0000)]
Skip allocating any display buffer and starting any threads
in case image buffer contains byte buffer only and it's
color space matches display space.

It was already check for this case, but it happened later
in color management routines, which is needed for saving
files, but not fast enough for realtime playback of 4K.

8 years agoSkip doing frame undistortion if it's not needed for proxies.
Sergey Sharybin [Fri, 15 Mar 2013 09:32:59 +0000 (09:32 +0000)]
Skip doing frame undistortion if it's not needed for proxies.

8 years agoFixes for 2d painting:
Antony Riakiotakis [Fri, 15 Mar 2013 09:19:41 +0000 (09:19 +0000)]
Fixes for 2d painting:

* Jittering accounts for zoom
* Smooth stroke accounts for zoom
* Expose smooth stroke in image paint editor.

8 years agoFix #34633: Merge First/Last crashes Blender
Sergey Sharybin [Fri, 15 Mar 2013 07:08:00 +0000 (07:08 +0000)]
Fix #34633: Merge First/Last crashes Blender

It was check happening when generating menu with available modes
for merge operator, but no checks happened when executing operator.

Since operator could be called from python or shortcut, it was
possible to bypass all the checks.

8 years agoFix for the Selection by Image Border not taking account of resolution percentage.
Tamito Kajiyama [Fri, 15 Mar 2013 00:30:20 +0000 (00:30 +0000)]
Fix for the Selection by Image Border not taking account of resolution percentage.
Problem report by octane98 in the BlenderArtists Freestyle thread in June 2012, thanks a lot!

8 years agoFix own mistake. Erroneously prefixed sculpt capabilities with sculpt_
Antony Riakiotakis [Fri, 15 Mar 2013 00:22:04 +0000 (00:22 +0000)]
Fix own mistake. Erroneously prefixed sculpt capabilities with sculpt_
before separating them in another struct. Thanks to Sebastian Koenig for reporting

8 years agomove polygon intersection out of BLI_lasso into BLI_math_geom since its a generally...
Campbell Barton [Thu, 14 Mar 2013 21:44:16 +0000 (21:44 +0000)]
move polygon intersection out of BLI_lasso into BLI_math_geom since its a generally useful function.

- isect_point_poly_v2()
- isect_point_poly_v2_int()

8 years agoBLI_linklist_free() was incorrectly taking MEM_freeN() as an argument, evidentially...
Campbell Barton [Thu, 14 Mar 2013 19:40:42 +0000 (19:40 +0000)]
BLI_linklist_free() was incorrectly taking MEM_freeN() as an argument, evidentially this works on x86 - but could cause issues later on.
add BLI_linklist_freeN() which MEM_freeN's each item.

8 years agosplit up BKE_mesh_to_curve() into 2 functions, adding BKE_mesh_to_curve_ex() which...
Campbell Barton [Thu, 14 Mar 2013 18:44:32 +0000 (18:44 +0000)]
split up BKE_mesh_to_curve() into 2 functions, adding BKE_mesh_to_curve_ex() which doesn't do object type conversion.

8 years agoconverting a mesh to a curve was unnecessarily using tessface's.
Campbell Barton [Thu, 14 Mar 2013 18:35:21 +0000 (18:35 +0000)]
converting a mesh to a curve was unnecessarily using tessface's.
use mpolys instead and simplify checks for wire edges.

Also rename BKE_mesh_from_curve() --> BKE_mesh_to_curve() since this function converts a mesh into a curve.

8 years agoUserprefs:Addon panel - Renamed label of the link to the documentation
Gaia Clary [Thu, 14 Mar 2013 16:53:38 +0000 (16:53 +0000)]
Userprefs:Addon panel - Renamed label of the link to the documentation

8 years agoThere was a regression in recent bugfix which touched Mix node.
Sergey Sharybin [Thu, 14 Mar 2013 16:25:32 +0000 (16:25 +0000)]
There was a regression in recent bugfix which touched Mix node.

This commit hopefully fixes that regression.

8 years agoFix misguiding menu label and make tooltip more descriptive
Gaia Clary [Thu, 14 Mar 2013 15:01:23 +0000 (15:01 +0000)]
Fix misguiding menu label and make tooltip more descriptive

8 years agouse floats for knife tool internal mouse coord.
Campbell Barton [Thu, 14 Mar 2013 14:46:59 +0000 (14:46 +0000)]
use floats for knife tool internal mouse coord.

8 years agoUsual blenderplayer fix! :p
Bastien Montagne [Thu, 14 Mar 2013 14:05:41 +0000 (14:05 +0000)]
Usual blenderplayer fix! :p

8 years agominor knife refactor to prepare for running non interactively.
Campbell Barton [Thu, 14 Mar 2013 13:58:56 +0000 (13:58 +0000)]
minor knife refactor to prepare for running non interactively.

8 years agodisable -Wredundant-decls for gcc versions older then 4.6
Campbell Barton [Thu, 14 Mar 2013 13:00:00 +0000 (13:00 +0000)]
disable -Wredundant-decls for gcc versions older then 4.6

8 years agoui_def_but() allocating an extra byte in 'but->str' for no reason.
Campbell Barton [Thu, 14 Mar 2013 11:29:15 +0000 (11:29 +0000)]
ui_def_but() allocating an extra byte in 'but->str' for no reason.

8 years agouse BLI_strncpy_rlen() rather then BLI_snprintf() when no formatting is needed.
Campbell Barton [Thu, 14 Mar 2013 10:39:18 +0000 (10:39 +0000)]
use BLI_strncpy_rlen() rather then BLI_snprintf() when no formatting is needed.
also replace sprintf with strcpy when no formatting is done.

8 years agoCode cleanup: replace magic constant used for alpha ignore flag with a define.
Sergey Sharybin [Thu, 14 Mar 2013 10:15:10 +0000 (10:15 +0000)]
Code cleanup: replace magic constant used for alpha ignore flag with a define.

8 years agoadd BLI_strncpy_rlen(), a clone of BLI_strncpy() that returns the number of bytes...
Campbell Barton [Thu, 14 Mar 2013 10:07:05 +0000 (10:07 +0000)]
add BLI_strncpy_rlen(), a clone of BLI_strncpy() that returns the number of bytes copied.

also move doxy comments for BLI_string.h into the C file.

8 years agoFix #34616: Wrong face culling for curves with constructive modifiers
Sergey Sharybin [Thu, 14 Mar 2013 09:50:29 +0000 (09:50 +0000)]
Fix #34616: Wrong face culling for curves with constructive modifiers

If curve object does have derived mesh, culling shall happen for
back faces, not front.

8 years agominor change to BLI_strncpy(). replace strlen() with BLI_strnlen().
Campbell Barton [Thu, 14 Mar 2013 09:49:20 +0000 (09:49 +0000)]
minor change to BLI_strncpy(). replace strlen() with BLI_strnlen().

8 years agocode cleanup: de-duplicate view clipping function for paint and knife tool, minor...
Campbell Barton [Thu, 14 Mar 2013 07:56:40 +0000 (07:56 +0000)]
code cleanup: de-duplicate view clipping function for paint and knife tool, minor changes to knife initialization.

8 years agoBorder rendering now works for all scenes used in compositor,
Sergey Sharybin [Thu, 14 Mar 2013 07:38:37 +0000 (07:38 +0000)]
Border rendering now works for all scenes used in compositor,
before this only active scene would be rendered with border.

When do_render_fields_blur_3d() is finished, it'll modify
render's display rect so it'll correspond bordered render
result placed on black backgrund. Actual border is stored
nowhere, which makes it only way to re-calculate disprect
for all other renders used in compo based on source. Not
so big deal actually.

Also needed to modify Cycles a bit, because before this
patch it used border settings from scene being rendered.
Now made it so render data is passing to external engines.

Using a property inside RenderEngine structure for this.
Not best ever design for passing render data, but this
would prevent API breakage. So now external engines could
access engine.render to access active rendering settings.

Reviewed by Brecht, thanks!

8 years agotweaks to clang so blender can build with -Werror
Campbell Barton [Thu, 14 Mar 2013 07:25:54 +0000 (07:25 +0000)]
tweaks to clang so blender can build with -Werror

8 years agoQuick fixes for previous commit
Joshua Leung [Thu, 14 Mar 2013 07:11:36 +0000 (07:11 +0000)]
Quick fixes for previous commit
* Missing word in tooltip for operator
* Ensure that filters are set appropriately so that effect is visible

8 years agoNLA Editor: Operator to add AnimData to selected objects so that they can appear
Joshua Leung [Thu, 14 Mar 2013 06:34:02 +0000 (06:34 +0000)]
NLA Editor: Operator to add AnimData to selected objects so that they can appear

This commit introduces an operator in the Add menu - this operator ensures that
all selected objects have AnimData attached to them (even if they don't have any
actions/drivers yet). By doing this, these objects can at least appear in the
NLA Editor, which will allow them to have strips added to them in future without
having to create throwaway actions first (NOTE: there's still some stuff coming
to allow that).

Also, renamed NLA_OT_delete_tracks -> NLA_OT_tracks_delete

8 years agoBugfix: Filtering option in NLA Editor to include AnimData blocks with no
Joshua Leung [Thu, 14 Mar 2013 06:30:18 +0000 (06:30 +0000)]
Bugfix: Filtering option in NLA Editor to include AnimData blocks with no
actions or NLA data attached was broken

Looks like a typo whcih somehow slipped in at some stage, as I remember that
this used to work at some point 2 years ago!

8 years agofix reading out of buffer bounds for recent vertex paint commit.
Campbell Barton [Thu, 14 Mar 2013 05:59:34 +0000 (05:59 +0000)]
fix reading out of buffer bounds for recent vertex paint commit.

8 years agoRemove OPTYPE_REGISTER flag from click handler operator for anim editors
Joshua Leung [Thu, 14 Mar 2013 05:58:13 +0000 (05:58 +0000)]
Remove OPTYPE_REGISTER flag from click handler operator for anim editors

1) It made no sense to show this as the last operator which was used, since
these can only be used from the anim editors (and not the 3D View where this
panel appears most of the time)
2) Mouse select operators in other places didn't do this
3) There aren't really any editable parameters for this operator anyway
4) It's highly dependent on valid mouse coordinates as input.

Apart from that, undo still works fine, so no need to really keep this here.

8 years agostyle cleanup: odd indentation
Campbell Barton [Thu, 14 Mar 2013 05:52:30 +0000 (05:52 +0000)]
style cleanup: odd indentation

8 years agoMore AnimData selection fixes
Joshua Leung [Thu, 14 Mar 2013 05:44:56 +0000 (05:44 +0000)]
More AnimData selection fixes

* Not all supported datatypes would show up in the NLA Properties Region when
* Clicking on the name part of the "Active Action" tracks now selects the
AnimData block that action is attached to

8 years agoBugfix: Selecting AnimData "expanders" in AnimEditors works again
Joshua Leung [Thu, 14 Mar 2013 05:01:51 +0000 (05:01 +0000)]
Bugfix: Selecting AnimData "expanders" in AnimEditors works again

Somewhere along the line, this functionality broke, even though the code to
handle these settings was still in place for many of these. The main implication
of this fix is that it should now be possible to select a particular AnimData
block, which makes it possible to do things such as changing the action
associated with that AnimData block (i.e. via the "Animation Data" panel in the
NLA Editor), as well as other operations which I've had on the todolist for a
while. Stay tuned!

8 years agoFix silly mistake that could lead to crash. Also, slight cleanup/rename
Antony Riakiotakis [Thu, 14 Mar 2013 03:47:20 +0000 (03:47 +0000)]
Fix silly mistake that could lead to crash. Also, slight cleanup/rename
and comments

8 years agoSupport for textures in vertex painting.
Antony Riakiotakis [Thu, 14 Mar 2013 03:42:17 +0000 (03:42 +0000)]
Support for textures in vertex painting.

Developer notes: this commit does painting in sRGB space. Since colours
are stored im byte per component formats, expect this to have the usual
dark fringing issues. Speed wise vertex paint could use some
optimization, for instance we could store the screen space vertex
positions on initialization like we do for texture painting, but this is
for another time. Also noticed that vertex painting suffers from the
subsurf + mirror issue too :/

Apart from that it's quite exciting how easy it is to add support for
texturing now that proper abstractions for texture sampling have been
done :)

8 years agoExpose input stroke samples for image painting.
Antony Riakiotakis [Thu, 14 Mar 2013 02:45:23 +0000 (02:45 +0000)]
Expose input stroke samples for image painting.

8 years agoTwo new Features:
Antony Riakiotakis [Thu, 14 Mar 2013 02:27:36 +0000 (02:27 +0000)]
Two new Features:

* Support for Rake in projective paint (2D painting will be a separate
* Support for smooth stroke across all paint systems

8 years agoFix #34526: crash using mask modifier + subsurf + UV map.
Brecht Van Lommel [Wed, 13 Mar 2013 22:15:59 +0000 (22:15 +0000)]
Fix #34526: crash using mask modifier + subsurf + UV map.

8 years agoWM: remove "No (valid) startup.blend found" message printed on startup, can be useful...
Brecht Van Lommel [Wed, 13 Mar 2013 20:00:39 +0000 (20:00 +0000)]
WM: remove "No (valid) startup.blend found" message printed on startup, can be useful for debugging but hide it for normal usage.

8 years agoFix #34551: blender crash rendering with save buffers.
Brecht Van Lommel [Wed, 13 Mar 2013 19:48:07 +0000 (19:48 +0000)]
Fix #34551: blender crash rendering with save buffers.

Problem was the new usage of access() on Windows, this doesn't accept X_OK. Also wrapped _waccess so that UTF-8 paths work.