Commit Graph

3028 Commits

Author SHA1 Message Date
5811076d0d Fix crash rendering linked scenes in compo
Simply linking scene (lib.blend) without compo into another one (compo.blend),
using it in a compositor and rendering it would crash.
2014-05-23 17:42:15 +02:00
561be3ac53 Bake API: compare with NULL rather then casting to bool 2014-05-23 14:54:12 +10:00
c56bbccb0d Fix T39901: Crashes if the resolution % is changed while rendering an animation
Copy render percentage. dimensions and border settings and use them for all the
frames in the animation render.
2014-05-22 14:39:31 +02:00
049b6cfa6d Fix for image garbage collection failing to run for render-only views
Check for freeing old images was running per-object, move this to viewport drawing.
2014-05-22 11:58:07 +10:00
Dalai Felinto
8d297394ba Bake API: partial fix T40156 (applyRotation issues)
This fixes most of the cases, the only situation not addressed is when
the highpoly object(s) has non-uniform scale.

mul_transposed_mat3_m4_v3() should take care of non-uniform scales so
I'm a bit confused on why it doesn't work. The lowpoly object can have
any transformation, the only issue is if the highpoly object has
non-uniform scale.

Test file of the remaining issue:
https://developer.blender.org/file/info/PHID-FILE-tpw2xgddyzxtpg3e7xzs/

Reference reading:
http://www.unknownroad.com/rtfm/graphics/rt_normals.html
2014-05-21 15:10:57 -03:00
27cebb2651 Fix T39711: cycles particle motion blur affected by viewport draw method. 2014-05-21 15:51:37 +02:00
f8554ed61a Fix T39669: Freestyle: Curve with extrude>0 causes warnings in console.
The reported Freestyle warnings were due to wrong normals of filled faces at both ends
of a 2D extruded curve. The problem is detailed in the comment #19 of T39669.

The cause of the bug was an inconsistency in the use of vertex indices between
BKE_mesh_nurbs_displist_to_mdata() and init_render_curve() in the case of
DispList::type equal to DL_INDEX3.

This commit also fixes a related bug that the normals of filled faces were not inverted
when a scale of the curve object is set to a negative value (e.g., the Z scale was -1).

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D532
2014-05-17 08:51:00 +09:00
295c37caa4 Fix T39763: Blender renders disabled Render Layers using Blender Internal
For now only disables scene render if all the layers are disabled, but scene
will still be rendered if it's used in compo, has enabled layers which are
not used by compo.

Current pipeline doesn't allow to handle such cases nicely, so leaving it
for later.
2014-05-15 18:21:02 +02:00
48881ad1e0 Code cleanup: doxy comments 2014-05-14 15:00:47 +10:00
7fb96ff00d Fix T40142: Objects restricted in render/view don't produce duplis in
with correct transform for Blender Internal.

According to previous code the obmat must be modified even if the
duplicated object itself is filtered later. TBH i have no idea how/why
this works, but nobody else does either ... All obmats are restored
after BI messes with them during render, so should be fine ...
2014-05-12 08:55:47 +02:00
Dalai Felinto
8943dc60ec Bake API: selected to active needs differentials or it renders black when bump/displacement (fix T40101) 2014-05-10 10:06:53 -03:00
Dalai Felinto
4c5fe540bf ammend to [31cb7e39] Bake API: calculating differentials 2014-05-08 15:05:12 -03:00
Dalai Felinto
31cb7e395e Bake API: calculating differentials
Code with contribution from Brecht Van Lommel (he wrote the
bake_differentials actually ;)

Reviewers: brecht

Differential Revision: https://developer.blender.org/D510
2014-05-08 14:38:30 -03:00
5cee409d42 Followup fix to T39966.
The previous fix was not quite correct:
* It would use the same wireframe/bbox check in viewport- and regular render
* The duplicator loop in Blender Internal is more permissive now to avoid disabling wireframe duplicators, but this means we need to check is_object_hidden right before making render objects to ensure this still works.
2014-05-06 17:47:48 +02:00
fbfaa4770d Fix T39322, hair not rendered in rendered mode viewport after returning
from particle edit mode.

Check for object particle edit mode, not psys->edit. This won't get
freed on exit (which might be worth considering doing, maybe?)
2014-05-05 19:51:58 +03:00
48c1a7f8a4 Doxy cleanup: formatting 2014-05-03 23:45:17 +10:00
6ec2d72eca Alternative fix for T39941, this also fixes odd behavior of rendered preview.
The rendered preview didn't show active layer or wasn't updated if the
layer was disabled. Now the viewport always shows an active layer regardless
of whether it's enabled or disabled.
2014-05-03 18:29:58 +09:00
Dalai Felinto
97641a0ec9 Bake API - bpy.ops.object.bake()
New operator that can calls a bake function to the current render engine when available. This commit provides no feature for the users, but allows external engines to be accessed by the operator and be integrated with the baking api.

The API itself is simple. Blender sends a populated array of BakePixels to the renderer, and gets back an array of floats with the result.

The Blender Internal (and multires) system is still running independent, but we eventually will pipe it through the API as well. Cycles baking will come next as a separated commit

Python Operator:
----------------
The operator can be called with some arguments, or a user interface can be created for it. In that case the arguments can be ommited and the interface can expose the settings from bpy.context.scene.render.bake

bpy.ops.object.bake(type='COMBINED', filepath="", width=512, height=512, margin=16, use_selected_to_active=False, cage_extrusion=0, cage="", normal_space='TANGENT', normal_r='POS_X', normal_g='POS_Y', normal_b='POS_Z', save_mode='INTERNAL', use_clear=False, use_split_materials=False, use_automatic_name=False)
Note: external save mode is currently disabled.

Supported Features:
------------------
 * Margin - Baked result is extended this many pixels beyond the border of each UV "island," to soften seams in the texture.

 * Selected to Active - bake shading on the surface of selected object to the active object. The rays are cast from the lowpoly object inwards towards the highpoly object. If the highpoly object is not entirely involved by the lowpoly object, you can tweak the rays start point with Cage Extrusion. For even more control of the cage you can use a Cage object.

 * Cage Extrusion - distance to use for the inward ray cast when using selected to active

 * Custom Cage - object to use as cage (instead of the lowpoly object).

 * Normal swizzle - change the axis that gets mapped to RGB

 * Normal space - save as tangent or object normal spaces

Supported Passes:
-----------------
Any pass that is supported by Blender renderlayer system. Though it's up to the external engine to provide a valid enum with its supported passes. Normal passes get a special treatment since we post-process them to converted and "swizzled"

Development Notes for External Engines:
---------------------------------------
(read them in bake_api.c)

* For a complete implementation example look at the Cycles Bake commit (next).

Review: D421
Reviewed by: Campbell Barton, Brecht van Lommel, Sergey Sharybin, Thomas Dinge

Normal map pipeline "consulting" by Andy Davies (metalliandy)
Original design by Brecht van Lommel.

The entire commit history can be found on the branch: bake-cycles
2014-05-02 21:19:08 -03:00
b62c2a913b Fix T39985: crash while rendering a scene with compositing nodes using another scene
The issue was caused by the wrong scene used to acquire render result for.

Now made it so render pipeline reports currently rendering scene to the job
via special callback.

This also solves missing tile highlight issue when rendering multiple scenes
in the compositor.
2014-05-02 14:54:13 +02:00
1552b56d9c Fix for missing render layer display buffer allocation 2014-05-02 14:54:12 +02:00
b2c2edf6ae Fix T39966: Whole Group option of dupligroup visualization of particles
does not work as expected for Viewport and Blender Internal.

As @sergey noticed, this was caused by rBfbf8595, which disabled
rendering for wireframe objects in the viewport. However, the same
function `is_object_hidden` is also used for skipping dupli objects then
which may themselves be renderable.

Now use two variants:
* is_object_restricted is the previous test for general viewport/render visibility (lets wireframe duplicators pass)
* is_object_hidden includes the wireframe check for actual render instances
2014-05-02 13:08:15 +02:00
4ca67869cc Code cleanup: remove unused includes
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-05-01 04:47:51 +10:00
1f4cfb3974 Fix T39952: Printing tiles gives negative numbers 2014-04-30 09:34:37 +10:00
1dcf956849 Fix for wrong behavior of 'darken' blend mode with factor.
The formula was not consistent across Blender and behaved strangely, now it is
a simple linear blend between color1 and min(color1, color2).

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D489
2014-04-29 14:03:09 +02:00
4ff3ebf45c Fix T39940: animation of render layer on/off toggle not working during render. 2014-04-29 14:03:09 +02:00
7544961ea5 Fix T39942: Displacement of group instance objects when switching to textured viewport shading
Usual dupli object issue, sometimes it's needed that all the object in
dupli group have modified obmat.

Made it an utility function now, which is used by convertblender and
dupli draw code now.
2014-04-29 17:52:04 +06:00
182e97a2cd Fix T39941: Freestyle: Rendered preview crashes when non-primary render layer is selected and disabled.
Freestyle relies on render layer name (RenderLayer::name) to find the render layer that
corresponds to a scene render layer being rendered.

When the active render layer is disabled during preview rendering, the function
render_result_new() populates the list of render layers (RenderResult::layers) with an
unnamed render layer while setting the active scene render layer index to zero.

This commit fixes the missing initialization of the render layer name by referring to that of
the first in the list of scene render layers.
2014-04-29 20:41:48 +09:00
409fb4da0c Code cleanup: remove redundant matrix initialization 2014-04-29 18:13:20 +10:00
f2d25975b5 Code cleanup: use 'const' for arrays (render) 2014-04-27 00:25:15 +10:00
1e6fa59e4f Fix T39852: Crash (Blender internal) large objects
Add check when bounds reached inf
2014-04-24 03:07:45 +10:00
7cdf5992dd Add asserts to raytrace get/set_cut functions 2014-04-24 02:30:39 +10:00
fc28732ba6 Blender Internal: Add material property "Cast" which can disable both ray and buffer shadows.
Also refactor:
- Material property UI related to shadows
- Preparation of OR-ed mode flags (ma->mode_l) of render materials

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D313
2014-04-23 15:03:34 +09:00
9b0ab89067 Follow up to previous commit: tweak RE_RAYTRACE_EPSILON (correction value used
when checking neighbor faces against shadowing).
2014-04-21 20:27:19 +02:00
3de8f255d7 Fix T39735: New auto smooth creates artifacts with flat shaded faces(BI)
This actually had nothing specific to new split normals, it was an internal limitation
of BI raytracer, which would check against neighbor face shadowing only when they shared
a common vertex, now it also performs checks when both faces have a vertex with a common
"ancestor" (org index).

Note this allows to also fix same issue when using SplitEdges modifier (and potentially
others?), but only when AutoSmooth is enabled (due to some compute/mem overhead, we
do not want to enable this code systematically).

Thanks to Brecht for advices and review!
2014-04-21 20:27:19 +02:00
55d75f5020 Code cleanup: correct abs use
also minor cleanup to rotation code
2014-04-21 02:02:21 +10:00
f7de9efb74 BI: cleanup in autosmooth area. 2014-04-17 18:23:14 +02:00
f270b34e99 Fix T37675: blender internal viewport render wrong for volumes after rotation.
We really should not have Object.imat_ren, that's the wrong place to put render
data. But just update it now on rotation rather than doing a bigger refactor to
remove it.
2014-04-15 15:56:56 +02:00
776f8d5a6f Split Normals I (4/5): Add support of split normals to BI renderer.
Note that this commit completely replaces old behavior of the auto_smooth feature in BI.

Also note that split normals are only handled when no "advanced geometry post-processing" is used
(something like Displace will obviously break it, since it has to re-compute normals after displacement...).

Reviewers: brecht

Reviewed By: brecht

CC: campbellbarton

Differential Revision: https://developer.blender.org/D368
2014-04-13 12:37:47 +02:00
15169c71a6 Blender Internal: remove BLI BVH for raytracing.
It has no benefits over other BVH types, as far as I know it was only added
because it was possible. This also fixes T39344.
2014-04-11 13:20:41 +02:00
a15b3c4d11 Code cleanup: use bool 2014-04-11 11:33:29 +10:00
6cd717e0a3 Fix T39521: Render with two Blender processes on same computer: compression issues?
We need to salt temp exr filenames with pid, else several instances of Blender rendering
the same scene on same machine and using "Save Buffers" option would use the same files!
2014-04-02 11:59:43 +02:00
35747ee3d5 Rename "BLI_cpu.h" to "BLI_system.h" and add to it BLI_getpid() helper.
There is not much sense to have a whole BLI file just to check SSE2 on CPUs...
So idea is to rename it to more generic "BLI_system", and add to it more system-related
utils, like e.g. an include helper for getpid(), which allows to hide unix/windows
internals from rest of the code...

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D439
2014-04-02 11:59:43 +02:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
482201d1a0 Style cleanup 2014-03-31 05:46:19 +11:00
faf529d036 BLI_rand: Add BLI_rng_get_float_unit_v3, was static rayshade func 2014-03-30 15:04:20 +11:00
7199e2288f Code cleanup: use sqrtf when input and output are float 2014-03-28 14:53:37 +11:00
a7242c3162 Code cleanup: add _v2 suffix to resolve_tri/quad functions 2014-03-26 11:15:21 +11:00
27e86ed832 Code cleanup: use bools 2014-03-20 22:56:28 +11:00
9767ff8916 Code cleanup: use true/false in sequencer functions 2014-03-20 15:46:38 +06:00
efb48fcbbb Fix for crash happening on blender exit after the bake
The issue is caused by 1a79abdad, and annoyingly it's a regression
since 2.69, so if we do 'a', this commit should be ported there.
2014-03-20 13:16:33 +06:00