ui/ --> startup/bl_ui
op/ --> startup/bl_operators
scripts/startup/ is now the only auto-loading script dir which gives some speedup for blender loading too.
~/.blender/2.56/scripts/startup works for auto-loading scripts too.
Modified to only do one lookup.
from Martin:
"Basically, what it does is allow you to add register and unregister class methods to rna types, this way you don't have to rely on module register/unregister methods to setup your types properly (and it makes them easier to move around when reorganizing code and easier to understand what a type does when reading code). This is especially nice for PropertyGroup classes that are added as properties to existing types, you can easily see in their register methods where they are added and removed in their unregister method. Obviously, those two methods are optional, so current code still works fine."
Not really a "bug", but it was on my todo anyways. Based on patch
[#26508] by Campbell, with a few modifications including extending
this to the Action/DopeSheet editor too.
People had trouble finding the 'Create New Directory' operator button in the file browser. Changed this to show the text as well and make button bigger.
Discussed with Campbell, it's not actually bug and it's more about limitation
of topology mirror. It will work properly when both sides of mesh have matching
unique topology.
Added note to tooltip, so now unpredictable behaviour shouldn't confuse users
so much.
Also gray out "Topology mirror" when "X Mirror" is disabled.
creating RNA within draw functions can free existing RNA, crashing blender when this is already used in the UI.
disallowing this so it raises a python exception.
This was being used to dynamically generate addon categories so for now they are hard coded and we need proper enum-functions for python to do this.
'create' was used as prefix and suffix, change dupli list functions to use as suffix, this matches obj.animation_data_create() & obj.animation_data_clear().
obj.create_dupli_list() --> obj.dupli_list_create()
obj.free_dupli_list() --> obj.dupli_list_clear()
Don't use 'create' for object to mesh function since other uses of this are for createing data which stays attached, instead use mathutils style naming convention.
obj.create_mesh() --> obj.to_mesh()
this is not well suited to RNA so this is a native python api.
This uses:
bpy.data.libraries.load(filepath, link=False, relative=False)
however the return value needs to use pythons context manager, this means the library loading is confined to a block of code and python cant leave a half loaded library state.
eg, load a single scene we know the name of:
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.scenes = ["Scene"]
eg, load all scenes:
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.scenes = data_from.scenes
eg, load all objects starting with 'A'
with bpy.data.libraries.load(filepath) as (data_from, data_to):
data_to.objects = [name for name in data_from.objects if name.startswith("A")]
As you can see gives 2 objects like 'bpy.data', but containing lists of strings which can be moved from one into another.
the same, but big changes have happened both on the outside and on the inside.
New UI:
* The old parameters were quite true to the underlying algorithm, but were quite obscure
from a users point of view. Now there are only a few intuitive basic parameters that
define the basic fluid behavior.
** By default particle size is now used to determine the interaction radius, rest
density and spring rest lengths so that it's easy to get stable simulations by simply
emitting particles for a few frames and adjusting the particle size (easy when the
particle size is drawn) so that the fluid appears continuous (particles are touching
eachother).
** Stiffness - in reality most fluids are very incompressible, but this is a very hard
problem to solve with particle based fluid simulation so some compromises have to be
made. So the bigger the stiffness parameter is the less the fluid will compress under
stress, but the more substeps are needed for stable simulation.
** Viscosity - how much internal friction there is in the fluid. Large viscosities also
smooth out instabilities, so less viscous fluids again need more substeps to remain
stable.
** Buoancy - with high buoancy low pressure areas inside the fluid start to rise against
gravity, and high pressure areas start to come down.
* In addition to these basic parameters there are separate advanced parameters that can
either be tweaked relative to the basic parameters (or particle size) or defined
independently.
** Repulsion - the stiffness parameter tries to keep the fluid density constant, but this
can lead to small clumps of particles, so the repulsion keeps the particles better
separated.
** Stiff viscosity - the normal viscosity only applies when particles are moving closer to
eachother to allow free flowing fluids. Stiff viscosity also applies smoothing to
particles that are moving away from eachother.
** Interaction radius - by default this is 4 * particle size.
** Rest density - by default this is a density that the particles have when they're packed
densely next to eachother.
** Spring rest length - by default this is 2 * particle size.
* There are also new options for 3d view particle coloring in the display panel to show
particle velocity and acceleration. These make it easier to see what's happening in the
fluid simulations, but can of course be used with other particles as well.
* Viscoelastic springs have some new options too. The plasticity can now be set to much
higher values for instant deletion of springs as the elastic limit is exeeded. In addition
to that there is an option to only create springs for a certain number of frames when a
particle is born. These options give new possibilities for breaking viscoelastic fluids.
New in the code:
* Most of the fluids code is now thread safe, so when particle dynamics go threaded there
will be a nice speed boost to fluids as well.
* Fluids now use a bvh-tree instead of a kd-tree for the neighbor lookups. The bvh-tree
implementation makes the code quite a bit cleaner and should also give a slight speed
boost to the simulation too.
* Previously only force fields were calculated with the different integration methods, but
now the fluid calculations are also done using the selected integration method, so there
are again more choices in effecting simulation accuracy and stability. This change also
included a nice cleanup of the whole particle integration code.
As the internals are pretty stirred up old particle fluid simulations will probably not
work correctly straight away, but with some tweaking the same level of control is still
available by not using the "relative versions" of the advanced parameters (by default these
are not used when loading old files).
Option for tagging creases (Ctrl+RMB) to also re-unwrap the mesh.
In 2.42 this could be done by setting rt==8 (very hidden), now its a little less hidden (in the toolbar).
Patch from Miika Hämäläinen.
The old Material "Only Shadow" used an ancient 'best guess'
formula using Lamp Distance and some averaging for converting
shadow values to alpha.
A couple of bug reporters already complained about the not
very predictable renders. Miika fixed this by adding two
new options, to only give the true shadow factor exclusively,
or to give a result including light intensity values.
More info:
http://projects.blender.org/tracker/index.php?func=detail&aid=26413&group_id=9&atid=127
the old FH setting was blended with the other physics settings (friction and elastic)
Also in the Physics panel it was saying "Use Material Physics" but the button is only for Force Field.
Since I was here I decided to change the Constraint FH ui name from Fh to Force. I don't think users really understand what FH is (I for once don't).
Thanks to Carsten Wartmann for pointing that out.
- Added option "Fixed Texture" to the UI. Because of strange reason,
this feature was implemented but hidden from users.
Would be cool, if somebody familiar with 2d texture paiting check.
- Fixed some issues in existing code of fixed texture paiting.
It now handles brush radius and curve correct.
- Also fixed issue with paiting with texture from node tree - it used
to be painted with regular brush color instead of texture.
- use own OrderedDictMini class, pythons collections.OrderedDict is overkill, 179 sloc. replaced with own, 11 lines.
- remove code which stored the class file & line per RNA subclass, this was useful but would raise its own exception every time to generate a stack trace to get the class info so we could use of the class failed to register. the class stores its module & name which can be enough to find where it was defined.
Finally, the Blender icon can be used for the splash screen menu entry, on own todo for almost 1 year!
Thanks to elubie for fixing this in the code. :)
* Moved ICON_BLENDER away from (0,0) spot in blenderbuttons, since ICON_BLENDER=0 define is conflicting ICON_NULL define as well as with logic checks for nonzero icon id.
* This solved bug where ICON_BLENDER can't be set from Python as well as when using new UI functions from within Blender.
From the tracker:::
Issues fixed:
- ConeTwist-constraint's params weren't making it to the CcdPhysicsEnvironment, also added Hinge's params.
- UI wasn't using angles where applicable.
- btHingeConstraint's constructor can create frame-matrices which don't align so the hinge doesn's start at 0 degree tilt.
This is an issue when setting limits.
Changes:
- UI: Hinge limits can be set (and disabled).
- UI: ConeTwist only has max-limits and only the twistX can be disabled
- PyApi via rna_constraint.c: added the functions limit_xyz_min, limit_xyz_max (for 6dof), limit_angle_xyz_min,
limit_angle_xyz_max (for 6dof), limit_angle_x_min, limit_angle_x_max (for hinge).
- PyApi: dropped python-function limit_cone_min.
.:. Extra:
UI Changes:
- renamed "RigidBody Joint" to "Rigid Boidy Joint"
- reorganized UI to conform with other parameters (e.g. Limit Rot)
- added dis/active all over the place :)
* More code cleanup.
When removing the narrow_ui feature, a lot of split functions were kept. Changed them to rows, which are more easily readable. Check out properties_data_lattice.py for a good example.
markers.
This is useful for when working with lipsync shots, where you've used
markers for noting down key syllables and want to separate these out
into chunks to manage things better.
Layer height used to be controlled with brush radius, quite confusing decision.
Added new property for brushes - height for adjusting affectable brush height
(it could be not only layer height in the future).
* This is basically a total rewrite of the edge split algorithm. The old one didn't handle tris at all and quads were cut wrong in some cases too with the addition of not handling uv coordinates at all.
* This new algorithm uses a flag system to categorize different splits and the identical but rotated cases in a similar way to how marching cubes indexes different cases.
* It cuts quads and tris and creates proper uv's for the new faces too.
* I also renamed the option to "edge cut" to differentiate if from the edge split modifier and added an option to override a uv-channel in the exploded mesh with particle age as x-coordinate so that the shrapnel can be faded out nicely etc.
Invert Image Colors (RGB)
--
Invert Red Channel
Invert Green Channel
Invert Blue Channel
Invert Alpha Channel
mostly because of the recent changes in normalmap channels,
so users can adopt old bakes quickly.
though they might aswell prove useful in other situations.
Now we have the old UI again, as suggested by several developers on the Mailing List.
At least for simple materials. For Node Materials we keep the new Pipeline panel.
This should make both sides happy. :)
adding meshes in C does:
Add Empty Mesh -> Enter Editmode -> Create Mesh
while python does:
Add Generated Mesh -> Enter Editmode
problem with this is there is no empty undo state for undo-redo to use so it always gave a duplicate mesh on redo-ing.
workaround by adding an empty mesh, do an undo push, and join the generated mesh into the empty one.
this would be fixed if undo stack spanned modes.
problem was on installing a file which was already installed, when the source and target paths match python deleted the file.
now check if the selected file is inside any of the addon search paths and abort with an error.
this also means we can have a version string like '2.56a-beta' without using buildinfo.
release/VERSION was only used by scons, NSIS installer.
Possibly helps to fix bug [#26062] too.
From the patch description:
"A new panel is proposed to bring togheter all the properties of a material that belong to the render pipeline level.
Such properties are currently not mixable with node materials, as nodes operate on a shader level."
Commiting this patch as approved in the sundy meeting.
* Particle system's are comparable to texture slots, which can
only exist within an id block. Particle settings on the other
hand are idblocks which should be pinnable just like textures.
* When particle settings are pinned only properties that make
sense without the actual particle system are shown in the
particle panel.
* Now texture pinning works consistently for all textures.
* The only problem is that there is no way to pin textures if there are
no textures in the context path, so it's for example impossible to pin
the texture of a displace modifier without adding a texture somewhere
else and selecting that texture first. I my opinion this is quite
counter productive so perhaps a dedicated "only textures" texture
context option is needed after all.
* All the various index-related issues should finally be sorted now.
It seems you cannot just partially implement some of these active
index getter/setters...
* Standardised the call used by PoseLib operators to get the Object
from which they get the active PoseLib data from
* PoseLib operators which require some existing data to work now use a
poll() which checks for this
* Added back the operator used to make standard actions into ones
usable by PoseLib
* Added a dummy operator for the apply active pose button which really
just calls the same backend functions as "Browse Interactive", but
which has a nicer frontend (naming + description) for the purpose of
being used in this way
* Also, removed some useless code from here
- Added operator button to show the current pose. This runs on top of
the interactive pose browse functionality, so the tooltip may be a bit
obtuse...
- Specifying a pose for the Pose browse functionality to set now works
correctly. Previously, some old depsgraph hacks were actually
interferring with correct updating (only the armature updated
correctly, but deforms didn't occur)
- Fixed a case of accessing freed memory, which I'm surprised no
static checkers have reportedly picked up on yet, or that nobody has
really had issues with (probably due to low memory "turnaround" so
far)
This presents a UI from which PoseLibs can be assigned/removed from
Objects. From here, it is also possible to see the list of poses and
add/remove poses from this list.
Known Issues:
- [Py/RNA/Operators BUG ALERT!] If after immediately starting Blender
you try to remove a pose from the PoseLib using the UI buttons, you'll
get a an error the first time you do so (but not for subsequent
attempts). This seems to be caused by the "pose" enum (dynamically
generated) of the POSELIB_OT_pose_remove operator, which does not seem
to be getting initialised when the operator's exec gets called without
the invoke having been called previously
- Changing the active Pose Library still seems to be broken (to be
fixed soon)
Todos:
- Operator button to make the selected pose get shown in the 3d view
- Restore the "validate action" operator and add that to this panel
- Rename pose access
unawaliable state.
- Also changed dynamic space bar menu, so it now also wouldn't allow to
set brush stroke flags to unavaliable state.
Also tried to remove use_anchor, use_space, use_restore_mesh and
use_airbrush, so user would be unable to set flags to unavaliable state,
but it was quite difficult for non-sculpt paint modes. They don't support
all of stroke methods, so brush.stroke_method can't be used for them.
Keep this area unchanged for now.
left/right to current frame in dope sheet
This commit separates out this selection functionality out of the
click-selection operator into a separate operator, so that hotkeys and
menu entries can be assigned to it.
This is based on an idea+patch (#23738) submitted by Torsten Rupp
(rupp), though I've ultimately decided not to go with the suggested
implementation as I don't think this fits that well under the "column"
select operator.
Todo: Graph Editor support will be coming shortly...
* New option to distribute particles in a hexagonal grid.
* This is much more stable for fluids than normal grid distribution and looks quite nice otherwise too :)
* Also some small scale code cleanup of grid distribution code.
* Renamed the old split uv's animate option "time" to "age" and added a new option to change the used split frame by frame. These are good changes were suggested/implied by Hannu Hoffren over 3 years ago in his tutorial video! (oh my how time flies)
* Also cleaned up the billboard ui quite a bit. For example now the uv channels can be properly chosen from the existing channels.
* Greetings from farsthary: particle rotation is now taken into account for particle effector direction.
** This gives all kinds of new possibilities as he shows in his blog http://farsthary.wordpress.com/2011/02/08/vortex-particle-simple-tut/.
**The only modification I made to his patch was to use the actual rotated particle direction as the effector direction as this defaults to the particle velocity vector, so no actual new options are needed.
* I also added an "effector amount" setting for particle effectors so that only a part of the particles can be considered as effectors. This makes it possible to create simple "farsthary vortexes" with only one particle system.
* Also some tiny reorganization of the falloff min/max values for a nicer ui.
* Effecting particle properties with textures was possible in 2.49,
but not in 2.5 anymore.
* Now particles have their own textures (available in texture panel
for objects with particle systems), which are totally separate from
the material textures.
* Currently a basic set of particle properties is available for
texture control. Some others could still be added, but the whole
system is not intended as an "change anything with a texture" as
this kind of functionality will be provided with node particles in
the future much better.
* Combined with the previously added "particle texture coordinates"
this new functionality also solves the problem of animating particle
properties through the particle lifetime nicely.
* Currently the textures only use the intensity of the texture in
"multiply" blending mode, so in order for the textures to effect
a particle parameter there has to be a non-zero value defined for
the parameter in the particle settings. Other blend modes can be
added later if they're considered useful enough.
would stop the entire menu from drawing if they raised an exception.
now print the exception and continue.
Also added a verbose argument for bpy.utils.(un)register_module() to help test whats being registered.
- KeyingSetInfo classes are now collected like Panels, Operators etc so bpy.utils.register_module() can be used.
- move bpy.types.register() to bpy.utils.register_class
This removes auto-registration, committed by Martin r30961.
Realize this is a contentious topic but Brecht and myself both would rather opt-in registration.
TODO:
- addons need updating.
- class list will be modified to use weakrefs (should have been done for existing system too).
- will move bpy.types.(un)register functions into bpy.utils.(un)register_class, currently including these functions in a type list is internally ugly, scripts which loop over types also need to check for these.
from Shinsuke Irie (irie) with some minor edits.
Shinsuke's description from the tracker:
---
I have implemented GVFS framework support of blender-thumbnailer.py which allows some file managers like Nautilus and Thunar to show thumbnails in trash or network directories. If Python's gio module is available, the thumbnailer uses it to access to filesystems mounted via GVFS. This change shouldn't affect desktop environments other than GNOME and XFCE.
A function gvfs_open() in this patch is defined to solve a stupid incompatibility between Python file object and GIO Seekable object.
On Ubuntu 10.10, I confirmed thumbnails can be generated for file://, trash://, sftp://, and smb://.
* Texture context was previously determined by going to the appropriate panel, for example "world panel -> texture panel" to access world textures. Additionally there was a separate button to access brush textures.
* Now the texture context can be selected directly through an expanded icon menu, which shows the available context options.
* This context selector is now at the top of the texture panel, but this could later be perhaps integrated to the context path somehow to be more intuitive.