Finally in 2.5 branch :)
Still things to do, but will continue working in here. I won't bother
repeating the commit messages from the last year or so, however I've
written up some technical docs to help Ton/Brecht/etc review and find
their way around the code:
http://wiki.blender.org/index.php/User:Broken/VolumeRenderingDev
That above page has some known issues and todos listed, but I'm still
interested in bug reports.
Credits for this code:
* Matt Ebb
(with thanks to Red Cartel/ProMotion Studios)
* Raul Fernandez Hernandez (Farsthary) for patches:
o Light cache based multiple scattering approximation
o Initial voxeldata texture code
o Depth Cutoff threshold
* Andre Susano Pinto for BVH range lookup addition
* Trilinear interpolation adapted from pbrt
* Tricubic interpolation from libtricubic
Made toggle buttons less wide, with less extra space around them
Made number widgets wider to allow larger numbers, such as the current frame field in the timeline.
Patch by Lorenzo Pierfederici (lento). Many thanks!
* Ported some more menus to python (Pose, Particle...)
* Some cleanup and reorganization in the python file to reduce code. :)
* Cleanup of old C buttons code.
This solves one of the last remaining hurdles for
volume rendering. Previously it always used ray
tracing to shade other objects inside or behind the
volume. This meant that said objects would look
aliased, unless you used Full OSA on the volume
(which is slow!). As well as this, it meant that you didn't
get a good alpha channel out of the volume to use for
compositing, similar to ray refracting materials.
This commit enables z transparency for volume
materials. Although it can be potentially less
physically correct, in most situations there's no
difference, and you get the benefit of nice sampling for
other objects and an alpha channel for compositing too.
-Made Mirror and Transparency panels more consistent.
-Improved greying out, and better communicated the fact that alpha settings do work even if Ztransp/Ray Transp are not enabled. The results of low alpha and no Ztransp/Ray Transp look weird though - is this supposed to be supported?
-Added Flare panel for halo.
-Improved SSS panel.
when passing properties=True as argument.
Other changes:
* uiItemR, uiItemFullR, uiItemFullO now accept a flag argument rather
than multiple different "boolean" arguments, but still exposed as
booleans to python.
* Fix RNA to support setting PROP_RNAPTR for return values.
* Alt-S in Object Mode would crash. Was caused by modal-keymaps for Pose Mode not being cleared when not in Pose Mode.
Also fixed what appears to have been a copy+paste error for Armature Sketching keymaps.
* Active KeyingSet menu in TimeLine header is now properly editable. Was using the wrong type of layout call to do this.
Made Hook Modifier be able to use bone targets. However, I haven't been able to verify that everything will work perfectly, since just creating a new Hook Modifier and assigning targets doesn't set hmd->indexar correctly.
* Popup menus now remember the last clicked item again.
* Modifier and File Format menus are now organized in multiple
columns with categories.
* Hook, explode, uv project modifiers have all their buttons
again with the relevant operators implemented.
* Modifiers that can't be added by the user, or don't work on
curves for example, are not in the menu anymore.
* Fix search menu overlapping buttons when near the bottom of
the screen.
* Fix uv layers search menu not working in some modifiers.
* Cleanup popup menu code a bit, layout engine is used in more
cases now instead of ugly position calculation code.
* Refactored weight paint to use the new stroke code, now does smooth stroke and stroke spacing.
Note: weight paint is failing to free it's MocNodes in 2.5, someone might want to look into that
* Converted vertex paint to use the new stroke system. Now supports the same smooth stroke and stroke spacing as sculpt mode.
* Refactored the paint cursor a bit, just sculpt for now but other modes soon.
* A couple warning fixes
* cache for low res (deactivating high res for now)
* new way of view3d rendering of smoke (no longer 3 axes) -using 3dtexture now (introduced into gpu/intern)
* introducing LZO and LZMA libs into extern (makefiles missing for now)
* reducing memory usage after simulating for the frame ended (freeing temporary buffers)
* splitting smoke into 2 modifier for the cache-sake (it cannot handle more than 1 cache on the same modifier-index)
* no color on gui anymore
* fixing non-power-of-2 resolutions (hopefully)
* fixing select-deselect of domain drawing bug
* fixing drawobject.c coding style (making Ton happy) ;-)
HINT #1: If scons doesn't work -> cmakefiles are up-to-date, couldn't test scons (but i tried to mantain them, too)
CODERS HINT #1: we really need a way to disable adding all modifiers through "Add Modifiers" dropdown!
WARNING #1: before applying this commit, deactivate your SMOKE DOMAIN in your old files and save them then. You can open them then savely after that.
WARNING #2: File and cache format of smoke can be changed, this is not final!
Implementation:
* NC_SCENE or NC_OBJECT cause scene->stats to be cleared.
* NC_INFO is sent to tag info headers for redraw.
* In UI scene.statistics() creates scene->stats if it is
NULLd, and then returns the string.
* Fix header menu spacing bug, and make it consistent for all headers.
* For consistency, always put menus first in the header, then any enums
to switch the type of data displayed.
* Node editor header ported to python layout. Still quite a few
operators missing to make the menus complete.
* RNA wrapped node editor, and added use_nodes property to material
and scene.
* Added Shading and Performance panels in the scene buttons,
containing the options previously in the 2.4x game menu.
* Added show framerate/debug/physics/warnings back in game menu.
* Moved these settings from G.fileflags to scene GameData.
* Enabled Display Lists by default.
* Some other small game scene button tweaks.
* Added UI for brush stroke. Contains for now spacing and smooth stroke
* Removed Sculpt UI for airbrush -- doesn't do anything in sculpt mode
* Improved smooth stroke by using float instead of int precision, so smooth stroke is even smoother now
* Exposed Tex.use_nodes, Tex.nodetree, MTex.which_output in RNA
* Added node controls to texture buttons (Use Nodes and Use Output)
* Made new texture outputs have unique names by default, though unique names still aren't required.
Note: The preview window in the texture buttons only takes which_output into account when in "material" mode, and in the material half of "both" mode; the plain texture display ignores the user's output choice.
This is because ED_preview_draw draws a Tex* and not an MTex* -- still some work to do here.
* Properly wrapped Keying Sets in RNA. Now the timeline header shows a popup for choosing KeyingSets instead of the nasty index button.
* Fixed bugs in Outliner code for adding/removing array elements to Keying Sets. This makes it possible to add only the x and z location settings for an object for example.
* Some UI fixes suggested by broken, removed specialized Add Brush menu in favor of standard ID add button, also put a separator between brush selection and brush properties.
* Add RenderResult.load_from_file to load whole multilayer exr's at once.
* Removed x/y offset from RenderLayer.load_from_file, better to encourage
using offset in begin_result() to minimize memory usage.
* Added WITH_OPENEXR in some screen/file/image module for scons/make, exr
was not working in some places there.
* Finally the header and menus are done via python.
* Added RNA for sync audio.
Note: This is just a basic working version in python. It needs more work and some layout changes.
Joshua: Feel free to adjust this further :)
* Added a new Paint type in scene DNA. This is now the base struct for Sculpt.
* The Paint type contains a list of Brushes, you can add or remove these much like material and texture slots.
* Modified the UI for the new Paint type, now shows the list of brushes active for this mode
* Added a New Brush operator, shows in the UI as a list of brush tool types to add
* Made the sculpt tool property UI smaller and not expanded, expectation is that we will have a number of preset brushes that will cover the basic sculpt brush types
TODO:
* Vertex paint, weight paint, texture paint need to be converted to this system next
* Add brush presets to the default blend
* Sculpt Menu is now written in python.
* Select Menus are only for Object, Edit and Particle Mode, added code to check on that, fixed Console warnings.
* Fixed a typo in armature buttons, reported in IRC by "ebrain".
* data reorganisation - uses own values now instead of reusing surface material properties (i.e. an individual density value, rather than reusing alpha) Files saved with the old system won't load up the same after this.
* improved defaults and ui
- view3d use select menus use the context.mode enum value.
- if selectmenu in dir(bpy.types) # creates a list of 1400+ strings, does a lookup and throws them away, better avoid this for redrawing.
Patch [#19031] (2.5) python menus for the view3d header
by Lorenzo Pierfederici (lento). Thanks!
* Added CTX_data_mode_string() to find out in which mode we're in.
* Added some "select" menus as a test.
This patch makes it basically possible to wrap the 3D View menus to python.
* Transparency is now it's own panel, with a boolean toggle
+ enum for z/ray transparency (following mockup made by
William). Also had to change DNA flags for this.
* Disabled radiosity a bit more in render engine, it still had
some effects like auto autosmooth.
* Make some sliders in material buttons percentages in RNA.
* Some other small tweaks in layout and naming.
Implementation Note:
* Moved the scene copy/unlink code back into blenkernel, with
the exception of the copy single user stuff which is still in
object_edit.c.
* Uses SCREENDELETE notifier like SCREENBROWSE, seems only clean
way to do this now.
* Moved the brush texture settings to MTex/TextureSlot. The mapping settings now show up in the texture panel, pretty much like they do for textures used with materials.
TODO:
* Tiled mode should not show Z size setting
* Add a locked mode so that texture size can be changed uniformly like in 2.4x
- use the scene context for the unit settings since there isn't a better place for it currently.
- added 'chain' to imperial units
- set more rna props to be distances and angles.
Integration is still very rough around the edges and WIP, but it works, and can render smoke (using new Smoke format in Voxel Data texture) --> http://vimeo.com/6030983
More to come, but this makes things much easier to work on for me :)
There was a mix in the layout of these panels; some were single column, some dual column. All these n-key sidebars seem to work best with single column layouts to minimize wasted space, so made all the panels fit that paradigm.
Also included a bunch of labels and a bit of layout cleanup.
- HEADER (beginning of each file)
* general header:
+ 8 char: "BPHYSICS"
+ 1 int: simulation type (same as PTCacheID->type)
* custom header (same for sb, particles and cloth, but can be different for new dynamics)
+ 1 int: totpoint (number of points)
+ 1 int: data_types (bit flags for what the stored data is)
- DATA (directly after header)
*totpoint times the data as specified in data_types flags
- simulation type
soft body = 0, particles = 1, cloth = 2
- data types (more can be added easily when needed)
data flag contains
----------------------------------------
index (1<<0) 1 int (index of current point)
location (1<<1) 3 float
velocity (1<<2) 3 float
rotation (1<<3) 4 float (quaternion)
avelocity (1<<4) 3 float (used for particles)
xconst (1<<4) 3 float (used for cloth)
size (1<<5) 1 float
times (1<<6) 3 float (birth, die & lifetime of particle)
boids (1<<7) 1 BoidData
Notes:
- Every frame is not nescessary since data is interpolated for the inbetween frames.
- For now every point is needed for every cached frame, the "index" data type is reserved for future usage.
- For loading external particle caches only "location" data is necessary, other needed values are determined from the given data.
- Non-dynamic data should be written into an info file if external usage is desired.
* Info file is named as normal cache files, but with frame number 0;
* "Non-dynamic" means data such as particle times.
* Written automatically when baking to disk so basically a library of particle simulations should be possible.
- Old disk cache format is supported for reading, so pre 2.5 files shouldn't break. However old style memory cache (added during 2.5 development) is not supported. To keep memory cached simulations convert the cache to disk cache before svn update and save the blend.
- External sb and cloth caches should be perfectly possible, but due to lack of testing these are not yet enabled in ui.
Other changes:
- Multiple point caches per dynamics system.
* In the future these will hopefully be nla editable etc, but for now things are simple and the current (selected) point cache is used.
* Changing the amount of cached points (for example particle count) is allowed, but might not give correct results if multiple caches are present.
- Generalization of point cache baking etc operator & rna code.
- Comb brushing particle hair didn't work smoothly.
long/short units...
day,d, hour,hr,h, minute,min,m, second,sec,s, millisecond,ms, microsecond,us
Also may fix some bugs that were reported.
Note, to convert fps to time evil_C needs to be used to get the scene.
- currently only distances work.
- user preferences, edit section to set the units and scale.
- option to display pairs (nicer for imperial display?)
- support for evaluating multiple comma separated values eg: 2',11" ..or.. 5ft, 4mil
- comma separated expressions/values accumulate 1+1,2**3,4cm/3
- attempted fast conversion from a value to a string so button drawing isn't too slow.
* imperial long/short *
- mile, mi
- yard, yd
- foot, '
- inch, "
- thou, mil
* metric long/short *
kilometer, km
meter, m
centimeter, cm
millimeter, mm
micrometer, um
nanometer, nm
picometer, pm
* Code cleanup. Note: This file doesn't follow the UI code guidelines due to some more complex layout structure.
Will think about this special case.
* Added new Sound Options into the System settings.
* Disable shaded mode for now, it cause too many crashes combined
with preview render, will be fixed properly later.
* Make 3d view toolbar region a bit wider. Ideally this would not
be needed, but the sculpt/paint buttons just don't fit otherwise.
* Revert change to icon/text spacing in buttons, it breaks text
editing and clipping. Will properly fix this later so changing
the spacing can be done centrally.
* Fix for grease pencil simplify stroke python error. Now button
is hidden (as in 2.4), but still available through outliner.
* Fix for memory leak in UI code, when using ctrl+Q menu.
* Fix submenu > icon being drawn on some buttons where it was not
needed.
Note...
- Python3.1 you don't need to add the .0 for divisions anymore (was esp annoying for button eval)
- Simple dimension input, imperial mi/yd/ft/in, metric km/m/cm/mm, Later could display these values and have a pref for scene scale, atm it assumes 1BU == 1m.
* Added toolbar UI for setting "anchored" mode
* Added a "persistent" mode for the layer brush; basically you can keep sculpting on the same layer between strokes when this is on. There's a button to reset the base so you can add another layer on top of that, and so on.
This feature was suggested by Blenderer on BA, thanks!
Note, I think these options could use better names in the UI, but I couldn't really think of anything very descriptive, suggestions welcome
* Added some greying out and hiding for disabled/non available settings.
* Some layout tweaks.
* Added "Flip Direction" for Sculpt, this is the "Add, Sub" Option from 2.49, this time as a boolean. Off = Add, On, Sub.
UI changes: splitting dome options for different dome modes (eg angle doesn't work for envmap mode)
if anyone wants to tweak that, feel free to do it.
* I put a remaining to bring setEyeSeparation + Focal Length to the Stereo GUI. I'm still not sure what would be the default parameters for that, and that will require other changes (eg remove the flag m_setfocallength and m_seteyesep). For so far only a label remind :)
* Sun lamp type export (known as parallel lights in povray)
* Native support for blenders metaballs, currently exports
- ball and ellipsoid types
- radius, stiffness
- ellipsoid xyz scale
- negative elements
- single material (like blender)
Renamed rna props.
elem.sizex -> size_x
mball.last_selected_element -> mball.active_element
minor changes to UI scripts.
-Deleted old Buttons C code for RIGIDBODYJOINT constraint.
-"Realtime" Icon for Modifer was different in Template and RNA, i changed the Icon in RNA to match the template version, which is an eye instead of a cube.
-Removed shadows from most UI items. The shadow settings are unfortunately not really useful, because you can't set them for individual items. There was a lot of black text with black shadows, which really only makes the text look fuzzy. For shadows to improve clarity, they should be the opposite color of the text label, not the same color.
-Tweaked material layout, with clearer grouping in Ray Mirror and Ray Transparency panels.
-Added icons in the texture type menu to signify which textures are procedural and which ones are images, and plugins.
a) fixing domain boundaries
b) fixing flow gui (no more velocity there - taken from particles)
c) Outflow available (deletes smoke from scene)
d) deactivating other noise options for now
e) base for render/preview settings
f) fixing collisions to be working again
Note: Rna access to softbody point cache is through softbody modifier although the point cache is in softbody settings. This is to make it similar to cloth.
Bugfix: Softbody rna was trying to get "ob->soft->softflag" instead of the correct "ob->softflag".
* Removed redundant color picker panels from the Properties Panel.
* Deleted some old C Buttons Code. (Background Image, Weight Paint, View and the Color pickers.)
* Added missing Particle Mode Buttons into the Toolbar. They need a check if the system is editable or not.
* Pose Mode Panels in Toolbar were not working due to wrong context. Fixed.
* Separated value and range sliders for the value into two separate rows. Value comes before the range settings since it's used more often, and is drawn as a slider instead.
* Tweaked ranges for the sliders so that they will work sanely.
http://666kb.com/i/bb49zl2t6ojvk7tax.png
We tried now to connect top-down with left-right, having top-down for the big picture (like already used in textures panel).
Other fields still missing. Approved by William, another small fix ("type" in one row) suggested by DingTo (not visible in the screenshot).
Not working:
a) rendering (since volumterics branch is not merged yet)
b) moving collision objects of any kind
c) saving of collision objects (because that's what I am working on)
d) pointcache
e) A bunch of other things I already know of
So please do not report any bugs on this one yet :-)
- All of this is in python and easy to change.
- each panel class has a set() of compatible engines.
- this set is checked for the poll function
- external engines can add themselves to this panels compatible engines
eg.
buttons_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')
I tried doing this by subclassing each panel and replacing only the poll function to reference 'POVRAY_RENDER' but it became fairly complicated and meant registering many of the same panels under different names.
Added mist support to povray.
'Align' should not be overused, it gets quite ugly (and
loses communication impact) when used between
buttons of different types. Dependencies should be
shown via layout and greying out.
These lamp panels still needs some cleaning up too...
- It is possible to work with MetaBalls in edit mode now
- Added basic UI to the button window (feel free to change it :-))
- Header menus should work
- Undo & redo should work
- Removed global variable editelems and lastelem (moved it to the MetaBall struct)
- All tools from old editmball.c was converted to the operators
- Added lastelem to the RNA
- Experimental: mb->editelems is only pointer at mb->elems or NULL (depends on Mode). ListBase of MetaElems is not duplicated in edit mode.
Tested with scons at Linux and mac OS X
TODO:
- Recalc data after Undo or Redo
- Solve issue with basic MetaBall and Python UI script (only base MetaBall object influence Wiresize and Threshold)
- Fix orientation of manipulator in "Normal mode"
* Image window only show game properties in game mode.
* Fix image window render info drawing wrong with alpha enabled.
* Win32 editmode cursor now uses a different one than the system
cursor, that one is barely visible, especially in the new theme
colors.
* Center text in operator header print.
* Fix sequencer unlock shortcut key.
* Fix uv layer / vertex color active render button now graying out.
* Workaround to get default zoom level 1:1 again for new buttons
(will try to fix properly later, is due to scrollbars).
Supports...
- camera/lamp/mesh object types
- meshes with modifiers applied, normals/uv/vertex colors
- materials, reflection, transparency
- spot/area/point lamps, samples, raytrace options
- scene render size, AA setting
Details...
- Doesn't need any 3rd party modules.
- Runs povray from the subprocess module, updating the image from a TARGA.
- Currently no UI panels or support for custom settings.
This could be used as an example for other scripts.
- returned ID types from RNA funcs didnt get their ID's assigned which crashed in some cases (still not working for members of ID types).
- ob.create_remder_mesh() wasnt assigning any materials.
* Again, some layout code cleaning.
* Made assignments more consistent.
I started to write code guidelines in the wiki:
http://wiki.blender.org/index.php/LayoutFiles-Code_Guidelines
Matt/William: You are welcome to change them or add new infos, I will continue on improving them as well in the next few days.
lay = result.layers[0]
lay.rect_from_file("somefile.png", part.x, part.y)
If the source image is bigger then the render layer x/y offsets can be used to choose the part of the image use.
* operator for create new directory activated (IKEY)
* operator for rename (works on files and directories so far) (CTRL+LMB)
Note: fail to rename is rather quiet, no message popup, just doesn't rename if it can't.
So far checked that (On Windows Vista) rename fails on system directories, which I think acceptable.
Note: I removed the code that (silently) deletes file if I rename file to an existing one. Considered harmful :)
- running a script from a file now uses the PyRun_File(FILE *, ...) rather then PyRun_String("exec(open(r'/somepath.py').read())"...), aparently FILE struct on windows could not ensured to be the same between blender and python, since we use our own python on windows now it should be ok.
- generating docs works again (operator update for py style syntax broke them)
- python operator doc strings was being overwritten
- added rna property attribute "default" to get the default value of a property, not working on arrays currently because variable length arrays are not supported.
Various fixes for painting, sculpting and particle edit, still
much to be done...
* Move RNA paint and sculpt structs into rna_sculpt_paint.c,
* Added Particle Edit RNA.
* Some tweaks to existing Paint RNA.
* Put texture paint and particle edit object in context.
* Fix some errors in the brush layout, properly doing None
checks, fixing some wrong property identifiers.
* Added tool enum for texture paint and particle edit in panels.
* Allow editing brush textures in the texture buttons, still with
a stupid toggle, ideas for how to make the connection better are
welcome.
* Diffuse/specular ramps works again.
* Wire is now a material type next to Surface and Halo.
* Removed Volume material type option until it is actually there.
* Some button layout tweaks.
missing commits from peter 20942, 21165, 21170, 21174, 21597
these files still need manual merging
source/blender/makesdna/DNA_sequence_types.h
source/blender/src/sequence.c
source/blender/src/seqeffects.c
source/blender/src/editseq.c
source/blender/include/BSE_sequence.h
* Added operators in Toolbar for Object Mode too. (Mesh only).
I think it should be there too, going into edit mode and select all just to change the shading of the whole mesh is not good. ;-)
* Armature:
- added: fill, merge, separate
- renamed: duplicate, align
* Pose:
- added: apply pose
* Armature Edit menu has been converted to use operators/layout now
- shift+b in the console would do border zoom (rather then upper case B), fixed by making v2d's border zoom check if the v2d's zoom is locked.
- blender in debug mode registers all operators, useful for testing.
* Some Code cleanup.
* Added 3-Split Operator into the panel and some options (which don't work yet)
* Added RNA for RegionView3D lock and box options.