* First step towards a new vector transform node, to convert Points/Vectors between World/Object/Camera space.
This only contains the Blender UI, RNA... code, no Cycles integration yet.
Update from a script I had in 2.4x, useful if you have mesh data which is _almost_ symmetrical,
there was no good way to automatically make the minor adjustments to make the mesh fully symmetrical.
Options for...
- symmetry-axis.
- blending between the +/- side.
- center mid verts.
Access from Mesh menu.
It removes buttons_header.c file, adds a (small) space_properties.py one, with a PROPERTIES_HT_header class, which simply uses the RNA enum to draw the context buttons.
It also fixes that enum, btw, it always featured all contexts, which means you could (try to!) set through RNA invalid contexts...
Thanks to brecht and dingto for the reviews.
Adding only the .svg file, the PNG can make once the multiview branch is merged.
I wanted to commit this to avoid having conflicts in the .svg file if
someone works on new icons too.
The new icon is at X-23
Was using edge-slide & remove-doubles but this was error prone since remove doubles could fail in some cases or find doubles where it shouldn't (with very small scale objects).
This gives more predictable behavior when the edges of a loop wouldnt slide (in that case they would just drag over to one of the sides with no user control)
and multiple edge loops work better too. eg:
- http://www.graphicall.org/ftp/ideasman42/edge_loop_del_update.png
the Parameter Editor mode. The Material Boundary toggle button takes
effect only in the Python Scripting mode. Instead the Parameter Editor
mode automatically determines which edge types need to be computed on the
basis of user-specified line selection criteria in terms of edge types.
Problem report from Light BWK through personal communications, thanks!
* Added a node to convert wavelength (in nanometers, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.
* Code cleanup:
** Moved color functions (xyz and hsv) into dedicated utility files.
** Remove svm_lerp(), use interp() instead.
Documentation:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Wavelength
Example render:
http://www.pasteall.org/pic/show.php?id=53202
This is part of my GSoC 2013. (revisions 57322, 57326, 57335 and 57367 from soc-2013-dingto).
linked via material
Textures linked to modifiers are now shown in the AnimEditor channel hierarchy
under object level now (i.e. on same level as ob-data, shapekeys, and object's
action). This makes it possible to edit such animation data without having to
ensure that these textures are also linked to the object's material so that they
will appear.
As a side-effect of how this is implemented, if playback is slower on scenes
following this commit, disable the "modifier" filter under the filtering
settings in the relevant animation editor header. In particular, it may be
beneficial to disable this when you've got scenes with meshes that have many
modifiers (but none of these have any linked data with settings which can be
animated), as Blender will still try to go through all those modifiers checking
for anything to show.
- script execution is off by default
- if a blend file attempts to execute a script
this shows a message in the header with the action
that was suppressed (script/driver/game-autostart) and 2 buttons to either reload the file trusted, or to ignore the message.
- the file selector will always default to use the trust setting in the user preferences,
but reloading an open file will keep using the current setting (whatever was set before or set on the command-line).
- added SCons setting WITH_BF_PYTHON_SECURITY, this sets the default state for the user prefereces not to trust blend files on load.
... this option was in CMake before, but always off, now its enabled by default for SCons and CMake, and forced on in CMake for now.
* Added a node to convert wavelength (in nanometer, from 380nm to 780nm) to RGB values. This can be useful to match real world colors easier.
Example render:
http://www.pasteall.org/pic/show.php?id=53202
ToDo:
* Move some functions into an util file, maybe a common util_color.h or so.
* Test GPU, unfortunately sm_21 doesn't work for me yet.
that is that RNA does not support multiple inheritance so the actual node group subtypes (ShaderNodeGroup, CompositorNodeGroup, TextureNodeGroup) can not be derived from both the
ShaderNode/CompositorNode/TextureNode base types as well as a common NodeGroup type ... It is possible however to define node group types entirely in python which avoids the limitations of the RNA system
and is much more flexible, example for this will follow later.
* VERTEX_WEIGHT modifiers had quite a messy UI, improved the grouping of options a bit, so it is easier to scan through.
* Do not use abbreviations like "Rem" or "Dist" in the UI...
* Also small change for BEVEL modifier UI for more efficient space usage.
- made precision configurable.
- report a warning when doubles are found since they cause problems.
added Polygon.center attribute to avoid calculating in python.
- Ctrl+RMB only worked for edges & faces
- Menu item 'Select Shortest Path' only worked for vertices.
Now Ctrl+RMB works for vertices and the menu item works for verts/edges/faces (depending on the current selection).
An optional 'internal' argument was added to the bpy.data.texts.load() operator.
The changes in revision 57153 were reverted, so that the is_in_memory and is_dirty
properties of text datablocks are not editable again.
In the C API layer, BKE_text_load_ex() was introduced to allow for optionally
making text datablocks internal after loading.
- expose unwrap as a menu (rather then a regular button that pops up a menu)
- move 2 extrude buttons into one menu button, also do the same for the mesh menu.
Now button in the toolshelf behaves this way:
- User clicks on "Add Marker"
- Then he clicks where the marker should get placed
Patch by Marcos Couto (ocf) with own modifications.
Implements an automatic keyframe selection algorithm which uses
couple of approaches to find out best keyframes candidates:
- First, slightly modifier Pollefeys's criteria is used, which
limits correspondence ration from 80% to 100%. This allows to
reject keyframe candidate early without doing heavy math in
cases there're not much common features with first keyframe.
- Second step is based on Geometric Robust Information Criteria
(aka GRIC), which checks whether features motion between
candidate keyframes is better defined by homography or
fundamental matrices.
To be a good keyframe candidate, fundamental matrix need to
define motion better than homography (in this case F-GRIC will
be smaller than H-GRIC).
This two criteria are well described in this paper:
http://www.cs.ait.ac.th/~mdailey/papers/Tahir-KeyFrame.pdf
- Final step is based on estimating reconstruction error of
a full-scene solution using candidate keyframes. This part
is based on the following paper:
ftp://ftp.tnt.uni-hannover.de/pub/papers/2004/ECCV2004-TTHBAW.pdf
This step requires reconstruction using candidate keyframes
and obtaining covariance matrix of 3D points positions.
Reconstruction was done pretty much straightforward using
other simple pipeline routines, and for covariance estimation
pseudo-inverse of Hessian is used, which is in this case
(J^T * J)+, where + denotes pseudo-inverse.
Jacobian matrix is estimating using Ceres evaluate API.
This is also crucial to get rid of possible gauge ambiguity,
which is in our case made by zero-ing 7 (by gauge freedoms
number) eigen values in pseudo-inverse.
There're still room for improving and optimizing the code,
but we need some point to start with anyway :)
Thanks to Keir Mierle and Sameer Agarwal who assisted a lot
to make this feature working.
Was missing keymap for REGION_TIMER, which ended up
in missing updates happening.
Added this kind of timer to RNA, so keymaps could
bind to it.
Also made 3ds max keymap working again. Too bad it
was broken in 2.67 and 2.67a :S
non-group trees (node trees not in the bpy.data.node_groups collection) to avoid confusion. For that purpose a new optional poll function argument has been added to NodeItem, which allows selectively
polling individual items in an otherwise static list.
The Emission panel now has a Use Modifier Stack option to emit particles from
the mesh with modifiers applied. Previously particles would only be emitted from
faces that exist in the original mesh. There are some caveats however:
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.68/Tools#Particles
Use center of currently visible frame part instead of
center of the whole frame for position of marker which
is adding from toolbox.
Used separate operator for this to keep operators more
atomic and not confuse with lots of conflicting properties.
* Use unified node sizes, as already was done with compositor nodes. Only Mapping node uses a custom size. This way we don't have too small nodes on creation anymore.
* Don't show Script Category for Blender Internal nodes.
* Added Westin Sheen and Westin Backscatter closures for testing, useful for Cloth like effects.
Only available via OSL, added an example OSL shader to the Templates (Text Editor).
Previously it was nearly impossible to have fast moving objects emitting smoke or they would just leave behind a row of smoke poofs instead of continious stream of smoke. Now it's possible to set number of subframes for each smoke flow.
Another new thing is ability to set size of smoke flow particles instead of using closest smoke cell. This also works with my earlier "full sample" commit, so no more blocky particles either. :)
For more info check my blog post: http://www.miikahweb.com/en/blog/2013/05/17/blender-smoke-subframes
This commit also includes couple of fixes I spotted while testing:
* Fix: dissolve was applied at different time for low res and high res simulations.
* Fix: full sample setting didn't get copied with domain.
So now, in the new "other" tex context, you can (depending on active data) have direct access to modifiers', force's or brushes' textures...
I also refactored a bit how texture contexts are handled (once again, we had some quite similar code in both space_buttons and RNA sources). This should also solve some harmless glitches like "no texture context selected in UI" sometimes when you remove data related to current texture (see e.g. after removing the material from default cube, in startup scene).
This usage of two different systems for textures, and the handling of switches between them, has been a bit tricky to get working right, but it is OK now I think. I also had to add a bool flag to buttons space, SB_TEX_USER_LIMITED (use_limited_texture_context in RNA), which indicates "new shading" texture code whether it has to ignore materials, lamps etc. (BI) or not (Cycles).
Btw, pinned textures from modifiers/force/etc. were also broken (showing nothing), now it should work too.
Thanks to Brecht for reviewing.
bug reported by Eloy Felix over email
Apparently there are some files that will perform better with "use_occlusion_culling" off.
For now the UI option can return.
Technically this could make into 2.67a, but the string is not localized (it'll be in English).
Not sure what is more important here:
- consistent UI OR to expose in the UI an option some people need
* Editing number of segments for particle hair did not update the viewport.
* Hidden particles were confusing, the paths were drawn but without the points.
Now it draws the path faded to indicate that they are hidden/locked.
* Select tips/roots operators now have options to select/deselect/toggle/invert.
Eventually a context menu for nodes could be a nicer solution: right-click on node link opening a popup with operators for the node, socket or link under cursor, including option "Insert Reroute".
This operator will run a tracker from previous
keyframe to current frame for all selected markers.
Current markers positions are considering initial
position guess which could be updated by a tracker
for better match.
Useful in cases when feature disappears from the
frame and then appears again. Usage in this case
is the following:
- When feature point re-appeared on frame, manully
place marker on it.
- Use Refine Markers operation (which is in Track
panel) to allow tracker to find a better match.
Depending on direction of tracking use either
Forwards or Backwards refining. It's easy: if
trackign happens forwards, use Refine Frowards,
otherwise use Refine Backwards :)
This is hopefully the ultimate solution against smoke blockiness near emitter.
Previously high resolution flow/emitter voxels were generated based on the low resolution ones. So if you had 32 resolution and 4 division high resolution, it still used smoke flow generated from those 32 resolution voxels. Now I introduced a new sampling method called "Full Sample" that generates full resolution flow for for high resolution domain as well.
Read more about it in my blog post: https://www.miikahweb.com/en/blog/2013/05/10/getting-rid-of-smoke-blockiness
Also changed "quick smoke" operator default voxel data interpolation mode to "Cubic B-Spline" to smoothen out it even more.
This is an alternative to using camera to scale the
scene and it's expected to be better solution because
scaling camera leads to issues with z-buffer.
Found the whole scaling thing a bit confusing,
especially for object tracking, but cleaning this up
is a bit different topic.
Only the suggested changes that cause backward incompatibility were considered for now.
* Removed pyFXSThicknessShader that is identical with pyConstantThicknessShader.
* Swapped the order of two arguments of the pyDecreasingThicknessShader constructor
in line with other shaders taking the same arguments.
* Made module functions smoothC and get_fedge into methods of relevant shader classes.
* Removed pyExtremitiesOrientationShader that relied on undefined Stroke methods.
* Add a few more OSL templates to the Text Editor, so people can use some of the OSL only shaders and closures.
* Temperature (Kelvin) to RGB converter
* Wavelength to RGB converter
* Ramp closure (Phong and Diffuse)
* Toon closure (Diffuse and Specular)
Quad View: ALT + W
Switch Wireframe / Solid: F3
Render: F10
Properties: F12
Ortho / perspective View: P
Zoom to selected center: Z
Select/ Deselect all: CTRL + A
in changing A hotkeys ctrl-a hotkeys are now ctrl-shift-a and GameEngine is now ctrl-alt-shift-p
Moved the code after the masking check so we can skip the texture lookup
if the pixel is done, is a bit faster. Also hide the color wheel for these
tools, only did it for 2D paint in previous commit.
* 2D image painting with textures that contained alpha did not work correctly,
had been broken for a while.
* 2D image panels texture (mask) panels showed wrong buttons for texture overlay.
* Texture map mode 3D now also uses masking, like Tiled and Stencil the texture
does not move along with the brush so it works fine.
* 2D image paint View mapping did not work correct, especially noticeable with
Rake rotation.
* Masking is now disabled for the smear tool, this can't really work because
the original image is constantly changing and gave artifacts.
scaling it along one axis, now there's a Reset Transform button.
The Image Aspect button is now also hidden unless the texture is an image texture.
And also hide the color wheel for painting tools that don't use colors.
Made keyap use the same select_or_deselect_all operator
as used for maya keymap instead of tricks with deselect_all.
Solves issue with selection in editor mode (reported as #3
in the original bug report).
* 2D image painting support for masking to limit the max contribution of a stroke
to a pixel, to get it working compatible with projection painting. Not strictly
a bugfix, but the inconsistency here was annoying.
* Fix python errors in Texture Mask panel in image editor, was missing overlay
options.
* Clamp paint mask to 0..1 in case some texture exceeds it, this could give black
pixels due to integer overflow.
Since the bug was fixed that made blur brush _not_ blur all verts, there is no way to blur vertex colors after baking.
While this was hidden it was useful especially for baking vertex colors.
- Sequencer preview was clamping float buffers
- ACES color space wasn't correct, was noticeable when
applying display processor from linear space to display.
- Extended sRGB LUT to sRGBf from nuke-default config.
Makes sequencer behave much better in sRGB space.
Some enums' items actually are generated from data (like the render layers of compo nodes), so they should not be translated. Added a PROP_ENUM_NO_TRANSLATE new RNA flag to tag those enums (only found those for nodes, but may be more of them around).
Also fix similar issue in main list of render layers (Py UI code! :P ).
- update copying code for linestyles to copy gaps
- update copying code for freestyle line modifiers to copy mapping flags and seeds
- fix drawing code for Material modifiers after a recent refactoring
Some RNA Properties were not updated in UI scripts after a recent refactoring
there removing "use_" prefix from some of the boolean properties (strangely
though, while every other property attached to SPHFluidSettings.flag has gone
from "use_factor_blah" to "factor_blah", use_factor_density still keeps the old
prefix).
The previous fix limited overlap, but is sometimes
too conservative, and artists want way to turn off
the limiting, so added 'Allow Overlap' option to
modifier.
the operator the previous time. However for these menus it makes more sense to
always use edge/face bevel and to leave vertex bevel for Mesh > Vertex > Bevel.
Allow separate control for tex/mask/cursor overlay. This commit implements
separate overlays for mask textures and cursor curves. The user can turn on
and off separate parts of the overlay by using the appropriate widgets.
The cursor overlay widgets are located at the tool selection panel
Also fixed alpha masks not getting correctly masked and mask texture mapping
not having the correct update callback
Two main things:
- Made a python operator for selection in a viewport
which will de-select everything if nothing is under
the mouse.
To do so needed to modify VIEW3D_OT_select, so invoke
sets mouse location which is later used by exec
function.
This way it's possible to select stuff from python
defined operator.
Not best-ever solution since ideally exec() shall not
do OpenGL stuff, but we've got this issue in some
other operators. We'll solve this later.
- Used a keymap from Gianmichele Mariani as a reference,
updated his keymap to latest changes in operators.
We shall match Maya keymap much better now, thanks
for the keymap dude!
Displays such information as current frame dimension,
frame number within image sequence/movie and in case
of image sequence input displays current file name of
a frame.
Not entirely happy with such approach, but was requested
a lot by artists.
Workaround for an issue with python: strings generated by py scripts should also exist in python as long as they are used in C. Else C code may access freed memory.
Simply store the generated list of items in the class, for now. :/
* Remove difflib's quick_ratio() call, from quick tests looks it is four times slower than ratio(), and yet it gives the same results...
* Moved code to find all po's in a dir into its own func (will be used by i18n addon tools too).
Made it so loop/ring selection are assigned to RELEASE button,
so they're not conflicting with regular selection.
There's still seems to be a conflict between loop and ring
selection, but it was here for ages and that's another story.
* Have all "Info" nodes next to each other.
* Moved "Material Output" to the top.
* Have all light shaders (Emission, Background, AO) next to each other.
Option to draw mesh vertex-weights in editmode, available from the 'Mesh Display' panel.
TODO: get this to work when modifiers are applied in solid mode (texface-solidmode is working).
As some people have already noticed, the "Add" menu for nodes is a bit messy since pynodes merge. The reason for this is that the order of nodes in submenus (categories) was previously defined by the order in which all nodes are registered (at the bottom of blenkernel/intern/node.c). For the dynamic registration of node types now possible this system of defining node order along with registration is no longer viable: while it would still sort of work for C nodes, it is completely meaningless for dynamic (python) nodes, which are basically registered automatically in whatever order modules and addons are loaded, with the added complexity of unloading and reloading.
To fix this problem and add a bunch of desirable features this commit replaces the C menu with a python implementation. The new menu does not rely on any particular order of types in the node registry, but instead uses a simple explicit list of all the available nodes, grouped by categories (in scripts/nodeitems_builtins.py).
There are a number of additional features that become possible with this implementation:
1) Node Toolbar can be populated!
The list of nodes is used to create 2 UI items for each node: 1 entry in a submenu of "Add" menu and 1 item in a node toolbar panel with basically the same functionality. Clicking a button in the toolbar will add a new node of this type, just like selecting an item in the menu. The toolbar has the advantage of having collapsible panels for each category, so users can decide if they don't need certain nodes categories and have the rest more easily accessible.
2) Each node item is a true operator call.
The old Add menu is a pretty old piece of C code which doesn't even use proper operator buttons. Now there is a generic node_add operator which can be used very flexibly for adding any of the available nodes.
3) Node Items support additional settings.
Each "NodeItem" consists of the basic node type plus an optional list of initial settings that shall be applied to a new instance. This gives additional flexibility for creating variants of the same node or for defining preferred initial settings. E.g. it has been requested to disable previews for all nodes except inputs, this would be simple change in the py code and much less intrusive than in C.
4) Node items can be generated with a function.
A callback can be used in any category instead of the fixed list, which generates a set of items based on the context (much like dynamic enum items in bpy.props). Originally this was implemented for group nodes, because these nodes only make sense when linked to a node tree from the library data. This principle could come in handy for a number of other nodes, e.g. Image nodes could provide a similar list of node variants based on images in the library - no need to first add node, then select an image.
WARNING: pynodes scripters will have to rework their "draw_add_menu" callback in node tree types, this has been removed now! It was already pretty redundant, since one can add draw functions to the Add menu just like for any other menu. In the future i'd like to improve the categories system further so scripters can use it for custom node systems too, for now just make a draw callback and attach it to the Add menu.
* Fix precision overflow issue with overlay previews,
* Expose alpha mask mapping to UI (still not functional but coming soon).
* More overlay refactoring:
Overlay now does minimal checking for texture refresh.
Instead, we now have invalidation flags to set an aspect of the brush
overlay as invalid. This is necessary because this way we will be able to
separate and preview different brush attributes on the overlays, using
different textures:
These attributes/aspects are:
Primary texture (main texture for sculpt, vertex, imapaint)
Secondary texture (mask/alpha texture for imapaint)
Cursor texture (cursor texture. It involves brush strength and curves)
Modified the relevant RNA property update functions and C update callback
functions to call the relevant cursor invalidation functions instead
of checking every frame for multiple properties.
Properties that affect this are:
Image changes, if image is used by current brush,
Texture slot changes, similarly
Curve changes,
Object mode change invalidates the cursor
Paint tool change invalidates the cursor.
These changes give slightly more invalidation cases than simply
comparing the relevant properties each frame, but these do not occur in
performance critical moments and it's a much more elegant system than
adding more variables to check per frame each time we add something on
the system.
This option replaces previously added GPU limit
option, which became tricky to follow after GLSL
display space conversion.
There're 4 modes available:
- AUTO which will try to guess which mode is
best to use.
Currently It'll try using GLSL and if it fails,
will fallback to 2D textures.
Probably it'll make sense checking on whether
2D textures works well but currently such behavior
shall be sufficient.
Later we could make this method smarter (for example
don't try to use GLSL on certain GPU or so).
- GLSL will currently behave the same way as AUTO,
but it is intended to always try using GLSL
(unless it can not be used because of existing
limitation of dither and RGB curves).
- 2D Textures will use CPU-based color space conversion
and use OGL 2D Texture to display the image.
Image will be displayed in tiles, so there shall be
no big GPU memory consumption.
- DrawPixels will straightly fallback to glDrawPixels
without trying to use any fancy GPU stuff.
Hopefully this will also fix
#34943: Blender crashes when resizing the Compositing Screen Window
Added a label to guide users to line style settings in the Render Layers context
(in line with the similar labels found in the Cloth and Soft Body modifier panels),
so that Freestyle options per render layer can be more easily found.
Also workaround a nasty bug, where unregistered py classes remain listed in relevant __subclasses__() calls, which would lead to crash with python addons i18n tools (main translation was not affected, as messages extracting tools are executed in a brand new "factory startup" Blender ;) ).
* Pressing x or y to scale overlay immediately presents visual feedback
instead of requiring mouse motion
* Hide the ovelay icon when stencil is active since you can't deactivate
then.
* Mark Preset operator as 'Internal' only, so it does not show up inside the search menu. We cannot be sure if we meet the context requirements otherwise (unless we add a poll to each subclass).
* Do not share poll with other files, create own poll classes.
* Avoid some splits() and use rows instead (less code).
* Remove some commented C code.
* layout = self.layout declarations come before variable declarations.
* Cycles Render layers UI was broken after freestyle merge (changes were not merged). Did manual edits now with some tweaks.
* Some layout fixes for Mask Layer.
This commit is the first part of a two-part merger of the soc-2008-mxcurioni
(Freestyle) branch. New 'freestyle' folders were added to the source/blender/
and release/script/ directories through a couple of svn copy operations
(instead of svn merge, due to broken svn:mergeinfo properties of the branch).
by Francisco De La Cruz (xercesblue), with some of my own changes/improvements.
Converts faces to triangle-fans (useful to run on ngons).
To access select a group of faces and press "Alt+P" or alternatively select the operator from the Faces menu (Ctrl+F)
* Shift-Rclick and holding right click, x or y will trigger constrained
scaling of overlay. Pressing again will revert to uniform scaling.
* Added operator, visible under the mapping drop menu, to fit stencil
aspect ratio to brush image aspect ratio.
* Made it possible to access stencil attributes from python as vec.x,
vec.y. Thanks to kgeogeo for pointing out!
- add rna property 'as_bytes' method so you can get a string property as python bytes (bypass encoding).
- make bpy.path.abspath/relpath compatible with bytes.
- add 'relpath' option to bpy_extras.image_utils.load_image(), so you can load an image relative to a path.
- "Add node" was showing on wrong location when used via pulldown menus.
Now this option will put the nodes in center of the view.
- The Curves widget was making itself smaller/bigger based on width of region.
That messes up the layout engine now - especially the code that checks if
there's a scroller needed or not (it went into an eternal feedback loop).
Now this widget has fixed height (like the other larger widgets).
Better would be to allow such large widgets to be scaled vertically individually.
That's for the todo!
Made it an operator instead of automatic prefetching.
Filling the whole memory with frames is not always
desired behavior.
Now prefetching is available via P-key, or from Clip
panel in toolbox or from Clip menu.
Also enabled prefetching for non-proxied movies.
Suggested by Brecht Van Lommel and Campbell Barton through code review comments.
Previously style modules were external Python script files whose absolute paths
were kept in .blend files. Now style modules are stored in .blend files as text
datablocks.
Style modules are configured in three steps:
1. Open an external style module file (or create a new text datablock) in the
Text Editor in Blender.
2. Add a style module to the list of style modules (by pressing the "Add" button)
in the Render Layer properties window.
3. Click the name entry and select the style module from the drop-down menu.
New operator "Find Node".
Opens search menu, and allows to find a node based on name or label.
On selecting name, menu selects/activates the node and moves the view to it.
Shortcut: ALT+F
Menu: Node editor, "Select"