Commit Graph

79 Commits

Author SHA1 Message Date
8f97f3ed29 Fix #25649: Image editor paint icon missing until enter weight paint
Issue was caused by starting Icon Preview render job from two places:
- Texture buttons for small icon preview
- Properties panel in image editor for large icon of texture

This preview job is starting in suspended mode and if new instance of the same job is
starting, suspended job will be totally stopped. This is normally for cases when you're
changing different settings -- in this case you'd wouldn't want re-render be triggered
on every slide change.
But what we've have with brush preview is that two instances of this job were creating for
large and small icon separately, but because of described policy only one icon was rendered.

If suspended job is getting to be stopped, check if it was started for the same icon
resolution and if not, that resolution will be also rendered in new job.
So it'll be still minimal re-rendering happens, but in cases when job was started from
two places for different icon sizes it'll work just fine.
2012-02-17 16:06:32 +00:00
9f2443293e replace fixed sizes with sizeof when passing string length since size wasn't always correct. 2012-01-12 13:16:30 +00:00
d7d856a23d Color management: add "Color Unpremultiply" option for images and render settings.
For premultiplied alpha images, this makes any color space conversion for the image
or render output work on color without alpha multiplied in.

This is typically useful to avoid fringing when the image was or will be composited
over a light background. If the image will be composited over a black background on
the other hand, leaving this option off will give correct results.

In an ideal world, there should never be any color space conversion on images with
alpha, since it's undefined what to do then, but in practice it's useful to have
this option.

Patch by Troy Sobotka, with changes by me.
2011-12-30 14:17:11 +00:00
647447db58 Code refactoring: split lamp functions from object.c into new lamp.c. 2011-11-05 13:11:49 +00:00
30f1f28a8a Nodes: add support for shader nodes on world and lamps, in addition to materials.
The internal render engine does not support them, and they are not accesible in
the UI yet, but cycles will use them.
2011-11-02 18:55:32 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
0664868aec BLI_make_file_string wasn't guaranteed to initialize the resulting path, some parts of the code accounted for this but most not, always initialize the string to "". 2011-10-23 05:56:55 +00:00
5cf593a778 strcpy() --> BLI_strncpy(), where source strings are not fixed and target size is known. 2011-10-19 23:10:54 +00:00
3b996ac1b3 add macro OB_TYPE_SUPPORT_MATERIAL, type checks were being done inline, some comparing range, some using ELEM#(), once was missing metaball check. 2011-10-03 17:29:43 +00:00
fa2ba5fbf5 - use static vars and functions where possible.
- use NULL rather than 0 when used as pointers.
2011-08-28 05:06:30 +00:00
609933208d dont include the preview.blend in headless mode 2011-07-13 19:27:42 +00:00
525f4e226e Fix for preview render, lamp and world now also get localized like material and texture. 2011-05-19 11:37:08 +00:00
54b97c1d9d Code refactor: split code for render updates and opening render view into
separate files, no functional changes.
2011-05-19 11:34:11 +00:00
22c2aef77c replace inline string searches with BLI_findstring(), strcmp(..., ""), with char comparisons. 2011-05-01 06:34:40 +00:00
1860c0c565 Fix for bug #26590, `Texture preview fails when path to custom brush
icon is set'

* Main problem was calling BKE_icon_changed too much, blocked previews
  from updating
* Also fixed clearing the icon when it's not a valid image path

Review link: http://codereview.appspot.com/4356045/
2011-04-27 01:16:24 +00:00
f2fd9d11bc Bugfix #26761
Texture preview render now doesn't increment/decrement material->texture
user counts anymore. Blenders library.c code could use some overhaul
once to support data relinkage and copying around better. :)
2011-04-04 13:47:34 +00:00
44692c70ae Bugfix, irc report:
Pressing ESC on material icon preview changes made it stop updating
the icons. Was caused by default 'break' callback testing ESC and
not resetting it. Now it uses same break callback as other previews.
2011-03-11 17:59:40 +00:00
c7fccc84bf use NULL rather then 0 for pointer assignments & comparison, modifier, imbuf & editors. 2011-03-05 10:29:10 +00:00
24fa1d1f04 Two additional fixes for node-tree + texture paint:
- "need exec" flag was cleared in wrong tree for preview renders
  (it should clear it in the copy, i did in original).
  This fixes projection paint on images with previews open
- Previews for nodes were copied always, now only for previews 
  invoked by node editor itself.
2011-03-04 12:59:09 +00:00
18afcbcb7d bugfix #26267
ImageWindow + 3D view texture paint + texture preview render + texture nodes.
Threading hell! But it works now :)
2011-03-03 18:53:07 +00:00
Nathan Letwory
95100afc12 doxygen: blender/editors tagged. 2011-02-27 20:29:51 +00:00
38bd8dcf05 Bugfix #26221
Two bugs in one:

- Lukas commit monday for new group/socket handling accidentally removed
  to set socketype in stacks, which as used by (texture) nodes to detect
  whether value, color or vector had to be read.
  Result was that all texture nodes were rendering as B&W

- Old 2.5 bug: preview renders for texture nodes didn't call a 
  NodeEndExec function, which gave crashes on deleting nodes.

The change in interface_hanlers.c is only a comment to explain
how keymaps are being found.
2011-02-26 13:53:15 +00:00
d7bee4ce2c bugfix [#26156] Opening .blend files through OS ignores "Load UI" flag 2011-02-21 02:40:48 +00:00
2ef296dc4c bugfix [#26118] Getting 'Error Totblock' when using sub-properties from a PointerProperty
blender wasnt freeing ID-Properties when freeing the material copy.
Checked that this isnt a problem for other preview types - texture/world/lamp.
2011-02-21 02:07:26 +00:00
8f21a43535 split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
2011-01-07 18:36:47 +00:00
b067a85aa3 Todo item:
Object color option now is incorporated in preview render, and
in display in 3D window.

Note that Object-color is "modulating" the render result, it just
multiplies... which is very limited for practical use. This was
added for Apricot game project. The original meaning however was
to replace diffuse only... so specular and light work still correct.

ALso made header for properties editor start on top, to reflect
default (report in tracker).
2011-01-05 15:10:35 +00:00
5db20b512e Todo item:
New option to start threaded wmJobs, with flag WM_JOB_SUSPEND.
This makes the job wait 1 timer step before running. 

Used now for Material Icon render renders, which makes the
big preview to be always rendered first while using UI.
2011-01-04 14:59:55 +00:00
2ad8175597 Todo: Material nodes
- On each re-render, the node image was cleared. Skipping this gives
  nicer pictures
- Node render was using AA, but unfortunately only 1 sample for Nodes
  is being stored. Disable AA render for now, nice speedup too.
2011-01-03 15:50:08 +00:00
22b97743ef avoid int/float comparisons within a number of for loops in deep shadow map compression.
gives minor overall speedup.
2011-01-03 06:13:50 +00:00
05cfe50436 Bugfix #25446 (and todo item)
The icons for materials were always lagging or not updating
at all. I also found it suspicious slow... 
It appeared that the icons now store a "mip level", where for
every change in Materials 2 render jobs for icons were started,
one for 32x32 pix, one for 96x96. The latter was cancelling out
the first job almost always.

Also made preview renders detect size, to set amount of tiles
to be rendered. Small icons use 1 part, larger previews 16 now.

All in all, behaves much smoother now! But, will also update
the thread Jobs manager to allow "delayed jobs" like for icons,
these are aggressively put as first in the jobs list.
2011-01-02 19:46:32 +00:00
6b1258f5b8 Bugfix #25301
Material Node trees:
SSS wasn't displaying in Nodes.

Implementation notes:
- Currently copying local data for preview render, only copies
  the base material. Node materials are re-used.
- This causes data to be in 2 "main" databases... complex.
- To make it work for preview, I had to add another loop in the
  SSS code that checks the original Main dbase. That's marked
  as warning in code to be fixed up.

Another bug:
- Material properties "SSS presets" copied settings to the
  active material, not to the displayed one. Added RNA call 
  to retrieve this from Objects.

(Next commit will fix preset scripts)
2010-12-20 13:02:33 +00:00
88b2955564 Bugfix #25307
Node shaders + textures, showing in Texture properties, with option
"show both previews" had bad ID checking.
2010-12-20 11:33:52 +00:00
b8e47fd160 Bugfix #25301
Preview render for node shaders broke, caused by localizing 
materials last week, to prevent thread crashes. Fixed now.
Also added a temp fix to draw color-management corrected
node previews default. Will follow scene setting tomorrow.

Also: SSS in nodes doesn't render yet. Was issue in 2.4 too...
2010-12-19 20:12:12 +00:00
7507a5f959 Bugfix #25288
SSS preview render didn't happy.
Was caused by using a Material copy for preview renders (to prevent
crashing in other cases). There were actually 2 errors:
- material copy should be added to preview-main database
- the render was invoked using wrong main database even!
2010-12-19 11:39:55 +00:00
52edaae9c5 Bugfix #20565
Material Node shaders: displaying GLSL + rendering previews crashed.
Reason was non-safe threaded access to material nodes. Now, on a preview
render, a full copy of Material is being made.
2010-12-03 14:26:03 +00:00
cd97253502 - added GCC warning -Wstrict-prototypes
- fixed bug in paste material, exposed by stricter warnings.
- removed/renamed various shadowed vars.
- removed BGE lamp.colour, only allow lamp.color attribute.
2010-12-03 12:30:59 +00:00
b45c3363fd fix for some pedantic warnings. 2010-12-03 01:52:28 +00:00
ce2295999e use zero initializers instead of memset(), also change PointerRNA_NULL from an extern into a define. 2010-11-23 08:44:21 +00:00
4d37cf90b9 remove G.sce, use G.main->name instead.
Both stored the filename of the blend file, but G.sce stored the last opened file.
This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore).

Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend.
2010-10-18 06:41:16 +00:00
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
77fb06f630 Fix #23350: flip "both" texture preview order from material-texture to
texture-material so it corresponds better to the text below.
2010-08-20 10:17:39 +00:00
d1759639dc - remove unused includes IMB_*, BIF_* & MEM_*
- remove MEM_guardedalloc.h from header files (include directly)
2010-08-16 05:46:10 +00:00
e81df3a6fa Fix #23238: crash rendering multiple scenes from compositor. 2010-08-12 13:58:10 +00:00
8c455e1da8 remove unused includes 2010-08-08 08:33:47 +00:00
708ef64663 include cleanup, no functional changes
- removed DNA_brush_types.h from DNA_scene_types.h (and some other similar cases)
- removed DNA_wave_types.h (never used)
- removed Main.wave
2010-08-04 04:01:27 +00:00
9b006d6d00 Fix preview render crash after recent G.main changes. 2010-08-01 20:36:24 +00:00
5fa7d1c1b4 2.5: code changes to reduce the usage of G.main and pass it along
or get it from the context instead.
2010-08-01 12:47:49 +00:00
ec19c7dffc == Sculpt ==
Fixed brush icons loading slowly

* Changed brush icon property from an enum to a flag that toggles whether a custom file is used for the brush icon
* Changed get_brush_icon to only handle loading external icons, built-ins are handled through the regular icon system
* Modified preview icon drawing to allow built-in icons
* When not using a custom icon, a default icon is selected based on the current tool

TODO:
* Allowing preview to show built-in icons makes the brush texture selector look ugly when nothing is selected. As discussed on IRC though, the nothing-selected state needs to be clarified anyway; I'll address this in another commit
* Use image browser when selecting a custom icon
* Selecting the default icon is ugly (uses the active object's mode), this can be fixed by making brushes know which paint mode they are part of
2010-07-26 04:00:09 +00:00
ba30ac1230 == Sculpt ==
Minor sculpt cleanups

* Moved the (previously extern) declarations of the brush icon data to ED_datafiles.h
* Set sculpt tool RNA to alphabetical order, quite a long list now
2010-07-25 22:05:52 +00:00
015ecdee29 * Polish preset did not enable tablet pressure for strength
* Turned off 'Front-Face Only' for all brushes, it needs more testing
* Added brush icons for other paint modes
* Moved 'tool' panel to bottom of all paint modes
* Moved 'appearance' panel to be next to bottom
* Moved brush selector panel to top of all modes
* Closed all panels except the brush selector panel
* Turned off X symmetry
2010-07-21 00:57:25 +00:00