Cleaned the GUI for effectors: Widen the panel and the buttons. Made the button text more conformed.
Added vortex field for particles. Particles swirl around z-axis of the object. Little hackish, could be made better.
Edges in Mesh
- adds automatic when you use creases. For other situations; call the
void make_edges(Mesh *me) in mesh.c. Of course, once in editmode the
edges are automatically recreated.
- in F9 buttons you can add/remove edges too
- both for Mesh and DisplistMesh, so it speeds up drawing quite some in
wireframe
- render for edges can't work... edges have no material nor tface nor col..
so here still the faces are rendered in wire
Creases in Subsurf
- based on the code by Chris McFarlen
- main changes is that now edges are used, saving quite some data in file
- use SHIFT+E in editmode to set edges-sharpness. values go from 0-1
- in F9 buttons you can set draw-crease mode. It draws now blended from
wire color to edge-select color (as provided in Theme)
Known issue: setting sharpness on 1 cube (subdiv 2) gives weird results
with some values... Chris, can you check?
Further; code cleanups, changing 0 in NULL when needed, no warnings, etc etc
* removed 32 channel limit (can now have 50, or of you know what number to change, 999 ;)
* added new IPOs: mirror fresnel and fac, transparency fresnel and fac, and glow factor transparent materials (add)
The changes from the original include the ability to add a blurred edge with a selectable width to the wipe and to rotate the effect.
Has these sweep types included already
-single
-double
-iris
These still need to be coded
-box
-cross
-clock
- click on palette didn't update button values
- the bottom 'palette' button now restores to old color
- H values scroll allways, also with black or white
Todo still:
- save in file (btw, i changed default colors to my pref :)
from" buttons.
Now a click in palette is default: update the active color.
If you want to store in palette: hold CTRL while click.
This isn't optimal either, but at least better.
the color plane
- removed warnings from glutil.c, made circleXOR call become float instead
of short
- fixed error in drawing text of buttons in pop-up menus, when zoomed small
With a click on the 'COL' buttons (the ones showing RGB) a menu pops up
with three colorpicking fields and a palette.
The fields are the three planar intersections of a HSV cube, each allowing
choosing in the field without the field changing.
The palette is 'modal' unfortunately (couldn't find a simple working other
method) where the button "paste to color" denotes the state that click in
palette copies to edited color, and "copy to palette" means the active
color is copied into the palette...
Todo:
- saving of palette in file
- decide whether ESC leaves without changes...
to use Shift-Click.
As before, clicking on the left side of a number field decreases, clicking on the right side increases, but clicking in the centre, on the text itself, starts editing the
value directly. Other behaviour like dragging left and right
is unchanged.
for Armature. Note: only works for subsurfed Mesh now!
Change in drawobject.c: Halo option on subsurf Mesh now draws points.
but using the original vertices...
- added submenu "Scripts" in both View3D->Object and Mesh menus.
Put them on top (it's better to follow some guideline, so users don't have to search for "Scripts" submenu in a different position in each menu), feel free to change.
- added button 'previous win' to SpaceScript, makes accessing buttons win, for example, much faster. Maybe all spaces could have this button.
BPython:
- added Window.EditMode(), to check, enter and leave edit mode. Scripts that change mesh data need this to leave edit mode before making changes to the active (G.obedit) mesh, of course.
- updated script bevel_center to use the above function and also popup an error msg if the active obj is not a mesh.
- doc updates, minor fixes.
Forgot to mention in my previous commit that I also updated the "-P" command-line option (for running script files) to be able to run already loaded Blender Texts, too. So, if you have a script called 'Text' in foo.blend, you can run it with blender foo.blend -P Text .
- textures: added support for new mixers (div, diff etc) to work on the
other map-to channels too, like ref or spec
Also it works on lamp and world textures
- brought back uncommented line of code that was removed by leon, to have
particle motion based on textures
- recoded the glPylonOffset hack to be nice function, this for future
testing.
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
Thanks to them for the new contributions!
(I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'. Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work. G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A). Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode. It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender. Loading after the program is up has no such problems. When I finish I'll post examples of demo mode scripts.
Kent Mein. So next to the mix, mult, add, sub we have now:
- Div: divides by texture color
- Screen: is like Mult, but works opposite (makes lighter)
- Diff: the difference between texture color and material
- Light: if texture is lighter it shows (per component)
- Dark: if texture is darker it shows (per component)
Next step: add this for specular and mirror, and the other channels...
I commit it now because it also fixes error in previous commit.
Please note the following:
- pictures need to be saved as 'premul' sky render if you want to use it
in Blender as texture
- but for alpha-over in sequencer it has to be 'key alpha'...
This inconsistancy needs to be solved.. for example as option for both
texture as sequencer.
"inserting keys in editmode didnt work on newly created Meshes"
Found out the error was in code committed by Hos in december, when
he added feature to copy newly added vertices (or remove) when editing
vertex keys. In his commit he already noted "please test" :)
Error was that newly created meshes didn't give a correct first key. For keys
to work in 2.32 and 2.33 you have to leave editmode at least once, or
insert keys outside of editmode.
The fix was fairly simple, just checking for an empty first key.
Division by zero in calculating render coords... only happens for
Wire material AND having face-less edges. Then the normal is zero, and
some calculations can't happen correctly.
(error in rendercore.c, other files committed was because of removed and
cleaned up enters)
http://www.blender3d.org/cms/Ramp_Shaders.348.0.html
Material color and specular now can be defined by a Colorband. The actual
color then is defined during shading based on:
- shade value (like dotproduct)
- energy value (dot product plus light)
- normal
- result of all shading (useful for adding stuff in the end)
Special request from [A]ndy! :)
First one was for drawview.c I gave some types to things that didn't have them
example
-static void view3d_panel_background(cntrl) // VIEW3D_HANDLER_BACKGROUND
+static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGR
For edit.c I added a newline to the end of the file.
Weee
Kent
polygonization of 512 MetaBalls:
- version 2.33a: 76 s
- current cvs version 8 s
- button "Never" is added in button window: Metaballs are polygonized only during render time (it is useful for particle animation) http://e-learning.vslib.cz/hnidek/misc/bowl_metaballs.blend
on my win32 box with my tests without crashing.
But be aware! There may be more of them watching
us, waiting for a moment of distraction, nobody
is safe.
New is that objects can have a force field, and Meshes can even deflect
(collide) particles. This is in a new sub-menu in Object buttons F7
The full instructions where on the web, Leon mailed it me and I will put
it in CMS tomorrow. For those who like to play with it now, here are demo
files:
http://download.blender.org/demo/test/
Quite some changes where in the integration though... so previous created
particle deflectors will not work. Changes to mention now are:
- gravity is renamed to 'force field'
- force field and deflector options are in Object now, not in Mesh
- the options also have its own struct, doesnt add to Object by default
- force fields are possible for all object types, but only work on center.
So empty objects are typical for it.
Work to do:
- add draw method in 3d win to denote forcefield objects
- check on the UI (panel with different size?)
- add 'recalc' button in deflector panel
to activate it. Added comment in code how to enable it for those who
like to play (search for translu)
What doesnt work - according to me not satisfying - is fact that radiosity
hemicubes alias badly on short distances, so interior light doesn't spread
well.
Better use of booleans for python
#include fixes for Windows
Python Doc fixes
Use the farthest vertex as the face position when z sorting faces. (Camera is on -z axis!)
- Added KlopUtils by Carlos Lopez and Batch Object Name Edit by Campbell Barton (thanks both!)
BPython:
- Fixed things I recently broke in Blender.sys, added Blender.sys.join(dir, file)
- doc and other minor updates
- Added function Blender.Save(filename) to save .blend files.
- Added scriptlink-related methods (get, clear, add) to Scene and Materials. Will still add method remove and add these methods to World, Object, Camera and Lamp.
- Updates and small fixes in docs.
- usage of relative paths "//" now can be controlled with a button in the
fileselect header
- relative path support added for linked Library files
Note: in oops window you can see the library file names, select the last
icon button in header to show the blocks.
The work i did end of may on render normals (displacemap especially)
caused refraction code to work wrong... took a while to find out, but
just removed a couple of lines too much.
Added clear comment there what it is, and what danger of removing is!
Campbell Barton updated his Wavefront OBJ scripts and Ben Omari updated his DirectX 7 and 8 ones (thanks both). The other listed scripts had minor updates to accomodate the menu changes.
- Scripts in menus:
renamed Tools to Object, Generators to Add, and Modifiers to Mesh (Metaball, Curve, Surface can be added later), to integrate better in the interface.
- Fixed a bug in Blender.sys.makename: last letter of file extension was being cut out.
When changing subsurf level, in shaded mode, and with Mesh that has more
users... the shaded displist of the other meshes are corrupt, potentially
causing crash.
And: small improvement in select-outline: when drawtype-extra Wire is set,
it skips it. Not needed, looked a bit ugly.
- lowered tooltip-update delay loop to 0.02 sec (was 0.05), which showed
up 'trails' while going over pulldowns with tooltips
- changed tooltip calculation for size, it was drawing the labels far too
large (height). Made sure text prints in middle too.
- by default tooltips print 12 pixels below button now
This for all current NKEY menus by default. Can be standard for each hotkey
controlled Panel from now on; use toggle_blockhandler() for it.
Another popular request: hotkey enabled Panels now optionally reopen on
the previous location, instead of under mouse. This option "Pinned" is a
user option now. Optional for later; have it as per-panel option... dunno!
The last request, close on mouse-exit, won't be implemented, this intrudes
with Panel consistancy, and is pretty OK solved with NKEY-NKEY now.
- Font object didn't support draw xtra wire yet
- removed drawing the circles from MBall object, except in editmode
- little cleanup in draw_object() call, it had a weird exception for
mball drawing
this consists of 22 different ways to sweep from 1 strip to another. For you windows lovers: it's like "Blinds" in Powerpoint :)
- in the NKEY menu you can choose which type you want perform, vertical, horizontal, in/out etc. it's too much to decribe.
Credits for this go to Kent 'Sirdude" Mein who coded the sequence plugin I stole the code from.
To allow certain sequence effects to have settings, I also added a "varstr" void pointer to the Sequence DNA, that can point to a special struct for each effect. This is similar to how plugins are handles.
more neat effects to come....
- Change the name of a strip in the NKEY menu of the strip.
- If a strip HAS a name, it will be displayed in the strip, instead of all that garbage that was previously there (image locations, lengths, whatever)
Still TODO: while adding new effects to the sequencer I will also add this for effect strips. at the moment it's not clear yet what should go in the NKEY menu.
Just making sure memory is always allocated and freed in the same
binary object, which seems to be mandatory on msvc if you don't have
the comercial version. If you are using this code you need to
syncronize with yafray cvs also, or it won't work. Binaries for os x
are updated in the link I gave in my last commit.
Needs latest yafray, you can get it from cvs, but I have also binaries
for os x here:
http://www.coala.uniovi.es/~jandro/noname/downloads/yafray-0.0.6-3.pkg.zip
To use it, go to yafray panels (global settings) and uncheck the "xml" button.
That would tell the export code to avoid xml export and use the yafray plugin
instead. You'll see the render being draw while running and you can even stop it
with ESC key.
Since I'm sure problems will appear, expect updates soon.
Remember: does not work on win32
types:
- Continue: is default, old style
- Dolly: is like previous, but not continuous
- Scale: is the new method. Name is based on fact it scales view
PupStrInput, a wrapper for the Blender String popup (thanks!)
- Fixed bug #1374 reported by Gabriel Beloin (gabio, thanks too):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=1374&group_id=9
There was a minor mistake in the import menu: vrml called dxf and vice-versa and shortcuts were wrong (removed them).
- Doc updates, minor updates elsewhere.
Wim Van Hoydonck contributed the famous Knife script (put under Modifiers group) developed by Stefano Selleri and himself (thank to both!)
- Added helper function Blender.sys.makename, updated docs and script ac3d_export to use it (shall update other exporters too):
this function is just a simple helper to format a filename as needed (change extension, strip dirname, it defaults to use G.sce as path).
- Added a test method: Blender.Scene.getScriptlinks(eventName):
just testing, if this path proves useful other functions will be added and made general, for objects, etc.
Displace mapping + Map-Input using Object wasn't working. This caused
by the inverse matrix of an Object potentially not being calculated when
displace was calculated.
Solved by moving imat calculus to the top of the main function.
Yafray note: the convention to hack out all transformations from
renderconverter could be implemented more elegant, by moving this to
the yafray section (and just matrix-transform back). Makes code less
unreadable, but also support displacement then (and might solve other
errors).
Envmap render error; when no (f10) envmap option was used, it could give
a 'stripe' effect based on a non-initialized global value. Only happens
for transparant layers...
Recalculate normals (mesh editmode) had some weak points, as demonstrated
in the bug report sample file. It appeared to be 2 aspects that could be
simply fixed:
- for calculation of the most outer face (to set normal outside) it used
a manhattan distance. making it real distance helped quite some
- but most important: the routine only took triangles into account, which
didn't work proper with very irregular quads, especially with non-flat
quads. It now calculates both trias in a quad individually.
-- new try so that scripts place their guis and file selectors in proper places:
should be ok now for any but the really weirdest screen layouts, will be updated when scripts are added to other menus in the interface.
* Added items for importing DXF, VRML, etc. in the File->Import menu, that just call the normal Open function. Most people don't even know that you can open these formats through the normal Open fileselect, so this will make it more obvious.
* Removed the 'Export Selected' menu, and put poor old lonely STL in the Import and Export menus too. Most of the exporters export only the selected object anyway, so it's not really a necessary distinction to make.
- added function Blender.sys.exists(path) to check if a given file exists;
- forgot to mention: in my previous commit the blender.html file was also updated slightly.
- tiny updates for better behavior, unix line endings, cvs Id tags;
- Updated DX7 exporter (thanks to author Ben Omari who's also working on a DX8 one);
- added sysinfo script;
Interface (scripts):
- changed behavior for which win is chosen for script guis:
Now there's a smarter order, guis will use either:
- Scripts win
- Buttons win (if not a script from groups Wizards or Utils)
- Text win
- Closest bigger area
- Added a button to the scripts header so that it's faster to return to the buttons win (this can be made general), if that was the previous win used.
Solaris and a bunch of the others were out of date....
I guess we should change them back for platforms that don't work out
with 2.3 but I'm guessing that things will get updated better this way
then asking everyone to update their own platforms.
Kent
-starting updates and new additions for Blender 2.34:
Some of the new scripts require Python modules not builtin with Blender, so you either need a full Python install or the needed extra modules. This is an ongoing work, there should be more scripts, better testing and also proper ways to tell users they don't have all expected modules. It's expected that Win users won't need full Python installs, since we can provide a minimal zip with the needed modules from 2.34 on.
Thanks to Anthony D'Agostino (scorpius), Jean-Michel Soler (jms) and Campbell Barton (Cam / ideasman) for donating the scripts now added / updated.
BPython:
-added two new script menu groups: Tools and Utils. We still need to find places elsewhere in the gui where the groups can be put.
prevented rvk editing to work in the action window.
Please not that "if (act) {" (Does the object have an action? Currently
only true for some armatures) and "if (key) {" (does the object have
rvk's keys? Currently only true for meshes) are never both true at the
same time so in the following snippet, the function foo_key() never gets
executed:
if (act) {
if (key) {
foo_key();
else
foo_bar();
}
}
Better is this:
if (key) {
foo_key();
else if (act) {
foo_bar();
}
messages and pupmenu()s. Edited spelling and grammar,
stylistic consistency, etc.
I added the guidelines and rationale that I used to the
CMS here:
http://www.blender3d.org/cms/Language_and_terminology.338.0.html
Next step is to get icons in there, to make it easier to see
at a glance what sort of message (and how much attention
should be paid to it, or if it can be dismissed with a flick
of the mouse, eg. boring remove doubles notifications)
mockup: http://mke3.net:9000/blender/ui/controls/error_ok_icons.png
Add Python Mapping method to CListValue
Fix Bernoulli bool distribution python method for random actuator
Fix Python IpoActuator methods setProperty and force acts local
Make data objects private
Better sort method for polygon materials - much easier to understand
big, since a float can go to 10^-37. And, this value is still squared, so
a square root will not frustrate it.
Limit now is 10^-35, fixing disappearing faces in extreme small object
thats extreme close to a camera. (thanks OOPz!)
Switched order of routines for displacement and autosmooth, where the
autosmooth will be last now. This prevents displaced (loose) faces, and
might give attractive sharp edges in other cases too.
Key alpha (render) set alph component at '1' for sky... this is an old
convention from NeoGeo days, and I have absolutely no clue whatfor...
maybe for some antique amiga iff format or so. Made it zero now.
is calculated in where_is_object.
Negative scale is found by a cross product of first 2 rows in matrix, and
comparing that (dot product) with third row.
OpenGL draw.
(BTW: the previous commit also solves raytrace errors with negative scaled
objects...)
Further a cleanup of displaylist flags and object/base flags. The #define
ACTIVE is moved to filesel.c (only used here).
The GONNA_MOVE #define got a OB_ added in front.
conversion. Old method tried to solve it per object, detecting a flipped
matrix. Since we have displacemapping and raytracing this is too inaccurate.
Also, flipping normals should alsways result i correct flipped vertex-
normals too.
Solution is to completely recalcuate the 'puno' (vertex normal) flags in
renderHelp.c now (set_normal_flags). The face normals themselves are not
flipped until that stage.
Second major improvement involves the calculation of correct splitted
triangles, when a quad is not flat. It now creates triangles based on the
vertex normals, which have actual information on surrounding geometry, thus
resulting in much smoother results.
Without this you get errors in ray-shadow, with light shining almost
parallel to a face. But again, displacement mapping improves with it too.
Third fix is that by removing normal flipping from displace code the result
is much better now.
Implicit declaration of swab in Linux, needs to define __USE_XOPEN at
source/blender/src:
I also added #includst <stdlib.h> to this file to fix it on solaris as well.
Kent
switches (glMaterial) inbetween a glBegin and glEnd. Combined with a
switch of glShadeModel however, on recent Nvidia it caused faces not
to be drawn... dunno if this is official compliancy, but not too
complex just to correct.
Reenabled the setScript/getScript methods for python controller bricks.
Set the ray source point to MouseFocusSensor.getRaySource works.
Added: Python -> MT_Quaternion
MT_Matrix4x4, MT_Matrix3x3, MT_Vector3, MT_Point3 -> Python
Correct transform of frustum bound sphere centre point to world coordinates
Profiling revealed that the SceneGraph updated every physics object, whether it moved or not, even though the physics object was at the right place. This would cause SOLID to go and update its bounding boxes, overlap tests etc.
This callback handles the special case (parented objects) where the physics scene needs to be informed of changes to the scenegraph.
Added Python attributes (mass, parent, visible, position, orientation, scaling) to the KX_GameObject module.
Make KX_GameObject use the KX_PyMath Python <-> Moto conversion.
Depth sorting for Transparent polygons. Use ZTransp in Material buttons to enable.
This will cause an object's polygons to be sorted (back to front for alpha polygons, front to back for solid polygons.)
Blender.Draw.Button() was not showing up. Seems to be an epydoc
issue with Button() being both a module method and the name of a class.
I changed Button to Button_ and added a usage note.
Yes, this is lame.
might be only an edge was missing in one of the loops.
Fix a crash that would sometimes happen when clicking the texture painting
button in the image window header. Made headerbuttons_packdummy a static
variable again. The uiDefBut call for the texture painting button stores a
reference to it, so it must be kept in memory.