Commit Graph

47594 Commits

Author SHA1 Message Date
Antony Riakiotakis
ba345bcbb6 Fix T41414, T41386.
There were a few issues to fix here:

* We did not really unpremultiply float image dabs prior to sending them
to the GPU. That made float and byte image result different in texture
painting and undoing could change the result.
* To make textures nicely composited over the mesh, I used decal mode in
OpenGL texture environment for the texture unit. This uses the texture's
alpha channel with a nice over operator.
* Texture creation used to override the alpha setting due to the display
restrictions. Not so anymore, people can now create transparent byte
images.

Also, made alpha zero default for new textures now, since it has such a
nice effect here.
2014-08-12 13:49:45 +02:00
Lukas Tönne
1743c81ce1 Fix T41349: Muting texture nodes can cause crashes.
Problem is that setup of stack indices which refer to the same stack
entry can lead to cyclic TexDelegate node pointers, causing an infinite
loop.

Fixing this would take too much time and require recoding large parts of
the texnodes system, which is earmarked for scrapping anyway ... So for
now just disabled muting in texnodes to avoid crashes.
2014-08-12 12:44:47 +02:00
Antony Riakiotakis
6e8e94d806 Fix undo in texture painting not refreshing float images in viewport if
16 bit float textures was off
2014-08-12 12:03:27 +02:00
Sergey Sharybin
d425cb06f6 Fix T41408: Diffuse and specular passes were incorrect with combined/color passes disabled 2014-08-12 13:45:55 +06:00
Campbell Barton
eadfddd02a Cleanup: magic numbers 2014-08-12 15:58:53 +10:00
Campbell Barton
ab06ec7a24 Rewritten Array Modifier D443
Patch by PatB with own edits

- replace BMesh with CDDM functions.
- faster remove-vertex merging.
- extend CDDM_merge_verts to be more flexible.
2014-08-12 13:52:17 +10:00
Campbell Barton
06020eb02e Cleanup: unused var 2014-08-12 13:33:39 +10:00
Campbell Barton
6be4b39526 GHash: add flag get/set for gset 2014-08-12 13:29:40 +10:00
Tamito Kajiyama
b65a022892 Freestyle: Removed the stored bContext from the Controller class.
The stored context object was used for creation of shade nodes.  A closer look at the
node system showed that the context is not actually used when shader nodes are
added to a shader node tree.  Relying on this fact, now a NULL pointer is passed to
nodeAddStaticNode() instead of the stored bContext pointer.
2014-08-12 10:10:55 +09:00
Tamito Kajiyama
4bb81f625e Fix for wrong idname of the "Create Freestyle Stroke Material" operator. 2014-08-12 10:10:53 +09:00
Tamito Kajiyama
71b85a8390 Freestyle: code cleanup.
Marked a function argument with UNUSED() and removed an unused local variable.

Patch provided by Sergey Sharybin.
2014-08-12 10:10:52 +09:00
Tamito Kajiyama
75e03e93be Freestyle: removed dead code in BlenderStrokeRenderer. 2014-08-12 10:10:51 +09:00
Tamito Kajiyama
dd13952080 Freestyle: Fix for git merge glitches.
Also made minor code cleanup.
2014-08-12 10:10:50 +09:00
Tamito Kajiyama
b606520791 Freestyle: Removed debugging code (use G.main instead of Freestyle-local struct Main). 2014-08-12 10:10:49 +09:00
Tamito Kajiyama
f7d3f2b228 Fix for vertex colors not working properly.
Looks like the issue was caused by a UV map name starting with a lower case
letter (e.g., "color").  Capitalizing the name fixed the problem.  Also adjusted
the creation of custom data layers to optimize things a bit.
2014-08-12 10:10:48 +09:00
Tamito Kajiyama
829e25c922 Fix for wrong link in the line style shader nodes due to a typo. 2014-08-12 10:10:47 +09:00
Tamito Kajiyama
7dd605e361 Fix for SCENE_OT_freestyle_stroke_material_create not respecting "use_nodes" line style prop. 2014-08-12 10:10:46 +09:00
Tamito Kajiyama
7852fc8bcd Freestyle: Proper support for alpha transparency in line style shader nodes for Cycles. 2014-08-12 10:10:45 +09:00
Tamito Kajiyama
2843aa1501 Freestyle: Fix for error handling in SCENE_OT_freestyle_stroke_material_create. 2014-08-12 10:10:44 +09:00
Tamito Kajiyama
cc33d73185 Freestyle: Fix for an increasing reference count of images in copied Image Texture shader nodes. 2014-08-12 10:10:43 +09:00
Tamito Kajiyama
45af769020 Freestyle: Properly reconnect links from a UV Along Stroke node to a UV Map node. 2014-08-12 10:10:42 +09:00
Tamito Kajiyama
e457dfec32 Freestyle: Updated BKE_linestyle_default_shader() to include the UV Along Stroke shader node. 2014-08-12 10:10:41 +09:00
Tamito Kajiyama
52d357a0b5 Freestyle: Added new UV Along Stroke shader node. 2014-08-12 10:10:40 +09:00
Tamito Kajiyama
6a5b8e91b1 Freestyle: removed unnecessary call of node_type_storage() in the definition of the Output Line Style node. 2014-08-12 10:10:39 +09:00
Tamito Kajiyama
6f60ca3cd4 Freestyle: Caching of auto-generated materials from line style shader nodes. 2014-08-12 10:10:38 +09:00
Tamito Kajiyama
7b1234be1c Removed/disabled debugging code. 2014-08-12 10:10:37 +09:00
Tamito Kajiyama
34c133a488 Freestyle: an improved workflow of line style shading nodes.
Removed the previous changes for passing a line style through the Controller, and
revised the BlenderTextureShader to assign the shader node tree of a line style
(if specified) to strokes.  This way the assignment of shading nodes can be done
through both the Freestyle GUI and Python scripting.
2014-08-12 10:10:36 +09:00
Tamito Kajiyama
c38e80d632 WIP commit just for a record of a working snapshot of code revisions for node-based textured strokes. 2014-08-12 10:10:35 +09:00
Tamito Kajiyama
a2a2d4679a Made temporary changes to use G.main rather than Freestyle-local Main for debugging. 2014-08-12 10:10:34 +09:00
Tamito Kajiyama
622ef089f9 Freestyle: Fix for a crash during access to Scene properties from within Python. 2014-08-12 10:10:33 +09:00
Tamito Kajiyama
4fc2b8dcc6 Added BKE_linestyle_use_textures() to check if stroke textures are enabled. 2014-08-12 10:10:32 +09:00
Tamito Kajiyama
1ddb8e238e Freestyle: Keep a reference of the line style in Stroke rather than in StrokeRep. 2014-08-12 10:10:31 +09:00
Tamito Kajiyama
83360eccae Fix for renamed API functions in rB415af0b. 2014-08-12 10:10:29 +09:00
Tamito Kajiyama
701f0356df Freestyle: Removed a debug print in BlenderStrokeRenderer::GetStrokeShader(). 2014-08-12 10:10:28 +09:00
Tamito Kajiyama
722951eceb Freestyle: Added "blend_type" and "use_clamp" options to the Output Line Style shader node. 2014-08-12 10:10:27 +09:00
Tamito Kajiyama
833353b25e Freestyle: Fix for a crash in BKE_linestyle_default_shader() due to a typo. 2014-08-12 10:10:26 +09:00
Tamito Kajiyama
7e9ac19b2c Freestyle: Fix for stroke_shader node default values copied from the Output Line Style node. 2014-08-12 10:10:24 +09:00
Tamito Kajiyama
1b65faf90b Freestyle: Changed the default Color value of the Output Line Style node. 2014-08-12 10:10:23 +09:00
Tamito Kajiyama
cb75f79b8a Freestyle: Add BKE_linestyle_default_shader() for creating the default line style shader node tree.
Changes to ED_node_shader_default() were reverted since the code there was actually
not suitable for setting up the default line style node tree properly.
2014-08-12 10:10:22 +09:00
Tamito Kajiyama
4e11fcead0 Follow-up to rB647969f9b617: Renamed CTX_data_linestyle_from_scene() to BKE_get_linestyle_from_scene(). 2014-08-12 10:10:21 +09:00
Tamito Kajiyama
fc85446c50 Freestyle: Added preliminary support for textured strokes in Cycles.
Now the shader node tree of a line style ID datablock is used to define textures
as well as their mapping and influence.

TODO: Textures alpha channel mapping and influence.
TODO: Blend mode in the Output Line Style shader node.
2014-08-12 10:10:20 +09:00
Tamito Kajiyama
4677684cfd Changed ntreeCopyTree_ex() to accept a pointer to struct Main. 2014-08-12 10:10:19 +09:00
Tamito Kajiyama
d8f60d01e9 Fix for a wrong ID datablock referenced due to a typo in BKE_copy_linestyle(). 2014-08-12 10:10:18 +09:00
Tamito Kajiyama
846ec6e00c Added new Output Line Style shader node for defining a node-based line material. 2014-08-12 10:10:17 +09:00
Tamito Kajiyama
60cdf97c3d Minor fix for texture category name. 2014-08-12 10:10:16 +09:00
Tamito Kajiyama
91c31efe01 Enabled USE_CYCLES_FOR_STROKE_RENDERING compile-time flag by default. 2014-08-12 10:10:15 +09:00
Tamito Kajiyama
87f75299e1 Implemented a basic framework for node-based shaders.
Shader nodes will be used to define materials for stroke rendering, so as to
allow users to interactively configure textures.
2014-08-12 10:10:14 +09:00
Tamito Kajiyama
1e513658de Always use the Blender Internal renderer for stroke rendering. 2014-08-12 10:10:12 +09:00
Tamito Kajiyama
d459d102b5 Added new operator "Create Freestyle Stroke Material" for testing. 2014-08-12 10:10:11 +09:00
Tamito Kajiyama
1741df1e36 Removed debug prints. 2014-08-12 10:10:11 +09:00