Commit Graph

5786 Commits

Author SHA1 Message Date
Ton Roosendaal
014aa7261e Orange branch: OpenEXR finally in Blender!
Credits go to Gernot Ziegler, who originally coded EXR support, and to
Austin  Benesh for bringing it further. Kent Mein provided a lot of code
for integrating float buffers in Blender imbuf and ImBuf API cleanup,
and provided Make and Scons and static linking.

At this moment; the EXR libraries are a *dependency*, so you cannot get
the Orange branch compiled without having OpenEXR installed. Get the
(precompiled or sources) stuff from www.openexr.com. Current default is
that the headers and lib resides in /user/local/

Several changes/additions/fixes were added:

- EXR code only supported 'half' format (16 bits per channel). I've added
  float writing, but for reading it I need tomorrow. :)
- Quite some clumsy copying of data happened in EXR code.
- cleaned up the api calls already a bit, preparing for more advanced
  support
- Zbuffers were saved 16 bits, now 32 bits
- automatic adding of .exr extensions went wrong

Imbuf:

- added proper imbuf->flags and imbuf->mall support for float buffers, it
  was created for *each* imbuf. :)
- found bugs for float buffers in scaling and flipping. Code there will
  need more checks still
- imbuf also needs to be verified to behave properly when no 32 bits
  rect exists (for saving for example)

TODO:

- support internal float images for textures, backbuf, AO probes, and
  display in Image window

Hope this commit won't screwup syncing with bf-blender... :/
2006-01-09 00:40:35 +00:00
Ton Roosendaal
104ab9b103 Orange:
- New UI element: the "Curve Button".

For mapping ranges (like 0 - 1) to another range, the curve button can be
used for proportional falloff, bone influences, painting density, etc.
Most evident use is of course to map RGB color with curves.

To be able to use it, you have to allocate a CurveMapping struct and pass
this on to the button. The CurveMapping API is in the new C file
blenkernel/intern/colortools.c
It's as simple as calling:

   curvemap= curvemapping_add(3, 0, 0, 1, 1)

Which will create 3 curves, and sets a default 0-1 range. The current code
only supports up to 4 curves maximum per mapping struct.
The CurveMap button in Blender than handles allmost all  editing.
Evaluating a single channel:

   float newvalue= curvemapping_evaluateF(curvemap, 0, oldval);

Where the second argument is the channel index, here 0-1-2 are possible.
Or mapping a vector:

   curvemapping_evaluate3F(curvemap, newvec, oldvec);

Optimized versions for byte or short mapping is possible too, not done yet.

In butspace.c I've added a template wrapper for buttons around the curve, to
reveil settings or show tools; check this screenie:

http://www.blender.org/bf/curves.jpg

- Buttons R, G, B: select channel
- icons + and -: zoom in, out
- icon 'wrench': menu with tools, like clear curve, set handle type
- icon 'clipping': menu with clip values, and to dis/enable clipping
- icon 'x': delete selection

In the curve button itself, only LMB clicks are handled (like all UI elements
in Blender).

- click on point: select
- shift+click on point: swap select
- click on point + drag: select point (if not selected) and move it
- click outside point + drag: translate view
- CTRL+click: add new point
- hold SHIFT while dragging to snap to grid
  (Yes I know... either one of these can be Blender compliant, not both!)
- if you drag a point exactly on top of another, it merges them

Other fixes:

- Icons now draw using "Safe RasterPos", so they align with pixel boundary.
  the old code made ints from the raster pos coordinate, which doesn't work
  well for zoom in/out situations

- bug in Node editing: buttons could not get freed, causing in memory error
  prints at end of a Blender session. That one was a very simple, but nasty
  error causing me all evening last night to find!
  (Hint; check diff of editnode.c, where uiDoButtons is called)

Last note: this adds 3 new files in our tree, I did scons, but not MSVC!
2006-01-08 11:41:06 +00:00
Ton Roosendaal
32e21f4524 Orange: while testing other code, I found out the scrollwheel code redraws
a 2d window 3 (three!) times on every event! This explains why scrollwheel
seems to lag quite some when used in buttons or outliner.

The view2dzoom() and view2dmove() code is horrid. Nice project for someone
is to move all 2d (View2D struct related) code into its own C file. A lot
of that is spread around in the code.
2006-01-07 10:35:47 +00:00
Andrea Weikert
e6d5d8cb74 FIX: scaling of pupmenu for materials caused text to be cut off.
Scaling up of the text and icon in pupmenu is prevented now in ui_do_but_MENU.
2006-01-06 19:18:31 +00:00
Ton Roosendaal
b702ce4819 Orange bugfix; duplicating object with group didn't increase group user
counter... tsk tsk tsk!
2006-01-05 19:16:28 +00:00
Ton Roosendaal
febd2a8f28 orange bugfix: "Make local Action" did not set the Ipos in channels to
local (or make copy if used by other actions), causing in loss of ipo's.
2006-01-05 16:12:02 +00:00
Ton Roosendaal
fbe9a17138 Orange bugfix: regular materials did not show textures... 2006-01-05 14:53:26 +00:00
Ton Roosendaal
465ff56d96 Orange: Ack! Yesterday's commit to cleanup relative paths forgot to
change the undo code as well... so on any Undo/redo all the libraries got
lost!
2006-01-05 14:12:07 +00:00
Ton Roosendaal
283b0ff736 Orange; maintenance commit!
- Moved all 'render pipeline control' options out of the Material panels
  into the (now renamed) "Links and Pipeline" Panel. These are the options
  that are not per material-node, but global for the entire Material tree.
  It includes ZTransp, Zinvert, Strands, Halo, Wire, etc.

- To further make Node editing clear, when you enable Nodes for the first
  time, the link button to the first Material node is drawn red, to note
  that here needs something linked or added.

- Protected Node editing for Library data

- Fixed header buttons to work OK for Node Window
2006-01-05 13:46:27 +00:00
Matt Ebb
0551b93808 * Fix to update timeline after transform in action window 2006-01-05 13:25:26 +00:00
Ton Roosendaal
406b3ae63b Orange; last commit didnt draw passepartout correctly. Also added a limit,
so you cannot screw up the entire view :)
2006-01-04 21:29:32 +00:00
Ton Roosendaal
987a3216c3 Orange: Hold SHIFT+MMB in camera view shifts the viewports around. 2006-01-04 21:16:09 +00:00
Ton Roosendaal
1521012c18 Orange; moved version patch for bone layers to 2.40, so orange branch can
read 2.40 files!
2006-01-04 19:11:27 +00:00
Ton Roosendaal
3f4aed3658 Orange; relative path fix for libraries.
- On linking stuff from libraries, each relative path now is relative with
  respect to the file that uses the library.

This way you can make libraries that use other libraries, and link them
in your project with an entire different relative path.

The commit also fixes issues when mixing up relative or non-relative paths.

Now after this I need to commit something cool, so the orangers will update
and check! :)
2006-01-04 19:05:24 +00:00
Ton Roosendaal
ed2b55585d Wednesday sync orange with bf-blender
Note: has the crazyspace fix!
2006-01-04 15:47:16 +00:00
Ton Roosendaal
4cb838d54f Fix for CrazySpace correction. (Special request of our Argentinan bird
movie friends :)

There were two issues with it, which both have been tackled as follows:

- the correction transformations (quaternions) were calculated per face,
  and then averaged over the vertices. This gave annoying inaccuracies,
  especially when the geometry is irregular.
  The new code first calculates two tangent vectors in a vertex, based on
  the associated edges it has in a face. These tangents then are used to
  define the transform. Tangents are 20% of the length of an edge now.

- When a SubSurf modifier was in the chain, the deformation caused by the
  subsurf was also included in CrazySpace correction, giving even larger
  errors.
  New code temporally disables Subsurf, recalculates vertices, and then
  does the crazy tricks. :)

All in all, quite well working!
2006-01-04 15:37:48 +00:00
Campbell Barton
4af91dae79 Added some notes regarding Object.GetSelected() - it uses the last localview. 2006-01-04 15:11:35 +00:00
Joseph Gilbert
de37b11e56 [ #3712 ] Calling makeEditable() and update() on an armature twice duplicates bones
* fixes bug where editbones are not freed on calling update()
2006-01-04 15:07:15 +00:00
Ton Roosendaal
ec01a66a6b Orange: Node previews now draw standard backdrop to show alpha better. 2006-01-04 12:41:13 +00:00
Ton Roosendaal
3153a238b3 Orange: more Node goodies;
- New Node: "Mapping". Allows input vector to be translated, rotated and
  scaled. And optional be clipped to a range. Works for colors too!

- The button "Normal" now allows incremental input, so a click in the
  button won't change the normal anymore

- Connecting wires now show selection state for Nodes, with nice blended
  colors. Both colors were added in Themes, but default to black and white
2006-01-04 12:13:13 +00:00
Campbell Barton
ff7ca4b1a2 Gave an example of changing lamp modes in epydocs. - answers a q on elysuin. 2006-01-04 01:55:39 +00:00
Ton Roosendaal
bd26fe8f94 Orange: Another issue with Armature layers; in NLA, the strips with a
locked length should not skip hidden channels.
2006-01-03 22:09:25 +00:00
Ton Roosendaal
f47899fc0f Orange; merger with bf-blender.
(Merging is *not* fun work, especially not with bugfixes in main branch
for code that got cleaned up in the other! Poor Hos... :)
2006-01-03 21:43:31 +00:00
Ton Roosendaal
9557c3a66d Orange: minor tweak for group user counting. 2006-01-03 21:10:43 +00:00
Ton Roosendaal
14d5cd1c31 Bugfix #3646
Outliner, using scrollwheel with mouse in scrollbar didn't scroll in the
correct direction.
2006-01-03 20:59:51 +00:00
Ton Roosendaal
5414bca7f7 Bugfix #3643
Editmode mesh: after an unhide ("reveal") the countall() needed to be
called. This caused for example extrude not to work when all was hidden.
2006-01-03 20:26:24 +00:00
Ton Roosendaal
750b9df26a Bugfix #3673
Threadsafe patch for environment maps type "Load" missed to include a
call, so still crashed. Only for non-debug builds though, so not reported
earlier.

From my cvs log 7 months ago:

"Added threadsafe patch from Martin.
Now envmaps of type "Load" should not give errors. I assume Martin tested!"

 :)
2006-01-03 20:06:08 +00:00
Ton Roosendaal
a085a41bc5 Bug #3681 The never ending bump mapping saga!
With the fix over a month ago, which added correct texture space vectors for
the bump, gave results so crispy that normals could invert after normalize.
This only when the normal "fac" slider was > 1.0.

The normals from imagetextures now get clipped to prevent it to result in
flipping normals. Will do more tests though...

Also note that the real good way would be have the tangent vectors for the
actual render normal available to perturb for bump, thats another story.
2006-01-03 19:49:38 +00:00
Joseph Gilbert
9f8348a22a *bpy fix
- include file capitialized wrong
2006-01-03 17:24:24 +00:00
Chris Want
b41a476401 As positively recieved on the mailing list and irc (and blessed by
guitargeek), this commit enhances the support for temporary storage
for the structs EditVert, EditEdge, and EditFace. The field
"EditVert *vn" has been removed and replaced by a union called
"tmp" that can hold:

 v,  an EditVert pointer;
 e,  an EditEdge pointer;
 f,  an EditFace pointer;
 fp, a float pointer;
 p,  a void pointer;
 l,  a long;

Please see the mailing list post here for more information about
this:

http://projects.blender.org/pipermail/bf-committers/2005-December/012877.html
2006-01-03 17:22:42 +00:00
Joseph Gilbert
5233f73589 *warnings fixes
- fixes a number of warnings in bpy project
2006-01-03 16:27:34 +00:00
Joseph Gilbert
700ff0193b *msvc7 update
- added bullet files to project
- fixed compiler path on bBullet project
2006-01-03 16:19:36 +00:00
Johnny Matthews
af7e7ab587 Changing the names of the shape copying tools to something that doesn't offend the orange team ;) 2006-01-03 15:22:11 +00:00
Ton Roosendaal
832f2d33d3 Orange; stuff for the animation department!
- Found the potential crasher for sound playback & undo. Test!
- PoseMode: NKey panel didn't work when actions where assigned
- NLA: "Add action strip" now displays in menu to which active object the
  actions are added.
2006-01-03 12:04:05 +00:00
Ton Roosendaal
4bc4eac1e5 Orange; tweaks for further integrating node editing in UI
- Previews inside groups now get updated too
- Activating nodes inside of groups updates UI and preview render correctly
- Entering/leaving groups updates UI and previewrender
- Material Node: now draws socket name next to colorpicker for inputs
2006-01-03 11:34:28 +00:00
Campbell Barton
d14f6c9cbc replaced more M_Object_Get for the faster Object_CreatePyObject.
Object.GetSelected now dosnt return None if there is no 3d view. - wasnt documented and likely would mess up scripts that always expected a list. - Just return an empty list instead.
2006-01-03 06:14:53 +00:00
Campbell Barton
fc079f8482 made scene.getChildren() a heap faster. 983.3 times faster in my test.
getting 7200 objects did take: 1.18 sec,  now 0.0012 sec

It was doing a full object list lookup for every object in the scenes base using the name to compare.
now it just gets the object directly from the base and converts it to a python object, adding it to the list.
- Cam
2006-01-03 05:38:39 +00:00
Campbell Barton
fc6ec33c89 Adds a boarder around the oops, usefull to know where the oops bounds end with larger scenes.
I needed to do a make clean, then make to see this change.
2006-01-03 04:20:43 +00:00
Campbell Barton
5f48930a75 Moved Object.Join() into a function of an object.
eg.
ret_val = ob.join(objects)
Now it dosent depend on the current selection, or change the selection context.

Made respective join_* functions return 0 if the join was not mode, 1 when it workes.
2006-01-03 02:35:45 +00:00
Campbell Barton
80f903ed73 Small commit, hopefully the last Duplicate change.
Made pythons duplicate not redraw, documented adduplicate()
2006-01-02 23:26:54 +00:00
Ton Roosendaal
85f089f3b9 Node render: a fix in threading, groups had a stack counter issue... :) 2006-01-02 21:04:33 +00:00
Ton Roosendaal
0cba8b906a Orange fix: Mixup in indices caused input-normal for Material Node go wrong
(caused by commit of 3 hours ago)
2006-01-02 20:24:18 +00:00
Ton Roosendaal
0943a0249c Orange: enabled thread render for node trees.
Works with groups too! But, discovered a bug with texture nodes inside
of groups... will do that next.
2006-01-02 19:09:37 +00:00
Ton Roosendaal
c1a4e42a75 Orange; another node update for reviewing.
Material Nodes now have input sockets, to override the actual Material
settings. If socket has no input, you can also edit Material settings here.
(Color picker, number slider).

Of course a load of options will become available here, first bugfixing!
(Oh, and enable fix thread render)
2006-01-02 17:40:03 +00:00
Ton Roosendaal
763695c0e8 Orange; made Node types Texture and Geometry integrated in render. Means
the coordinate outputs now have correct dx/dy vectors for Image AA, and
texture delivers correct intensity, rgb, alpha and normal.

Note; we need a "Vector Mapping" node, to do 2d/3d mapping, like in the
Material "Map In" panel.
2006-01-02 15:32:17 +00:00
Ton Roosendaal
4650f7f8a9 Fake commit; just forgot to add this to the log;
A group node; named "Backlight"

http://www.blender.org/bf/g1.jpg
http://www.blender.org/bf/g2.jpg

And how it looks rendered:

http://www.blender.org/bf/g3.jpg (no Nodes)
http://www.blender.org/bf/g4.jpg (with Nodes)
2006-01-02 13:08:23 +00:00
Ton Roosendaal
ea7538dca6 Orange: more noodle updates!
**** NEW: Group Nodes

Node trees usually become messy and confusing quickly, so we need
not only a way to collapse Nodes into single 'groups', but also a
way to re-use that data to create libraries of effects.

This has been done by making a new Library data type, the NodeTree.
Everything that has been grouped is stored here, and available for
re-use, appending or linking. These NodeTrees are fully generic,
i.e. can store shader trees, composit trees, and so on. The 'type'
value as stored in the NodeTree will keep track of internal type
definitions and execute/drawing callbacks. Needless to say, re-using
shader trees in a composit tree is a bit useless, and will be
prevented in the browsing code. :)

So; any NodeTree can become a "Goup Node" inside in a NodeTree. This
Group Node then works just like any Node.
To prevent the current code to become too complex, I've disabled
the possibility to insert Groups inside of Groups. That might be
enabled later, but is a real nasty piece of code to get OK.

Since Group Nodes are a dynamic Node type, a lot of work has been
done to ensure Node definitions can be dynamic too, but still allow
to be stored in files, and allow to be verified for type-definition
changes on reloading. This system needs a little bit maturing still,
so the Python gurus should better wait a little bit! (Also for me to
write the definite API docs for it).

What works now:

- Press CTRL+G to create a new Group. The grouping code checks for
impossible selections (like an unselected node between selected nodes).
Everthing that's selected then gets removed from the current tree, and
inserted in a new NodeTree library data block. A Group Node then is
added which links to this new NodeTree.

- Press ALT+G to ungroup. This will not delete the NodeTree library
data, but just duplicate the Group into the current tree.

- Press TAB, or click on the NodeTree icon to edit Groups. Note that
NodeTrees are instances, so editing one Group will also change the
other users.
This also means that when removing nodes in a Group (or hiding sockets
or changing internal links) this is immediately corrected for all users
of this Group, also in other Materials.

- While editing Groups, only the internal Nodes can be edited. A single
click outside of the Group boundary will close this 'edit mode'.

What needs to be done:

- SHIFT+A menu in toolbox style, also including a list of Groups
- Enable the single-user button in the Group Node
- Displaying all (visible) internal group UI elements in the Node Panel
- Enable Library linking and prevent editing of Groups then.


**** NEW: Socket Visibility control

Node types will be generated with a lot of possible inputs or outputs,
and drawing all sockets all the time isn't very useful then.

A new option in the Node header ('plus' icon) allows to either hide all
unused sockets (first keypress) or to reveil them (when there are hidden
sockets, the icon displays black, otherwise it's blended).

Hidden sockets in Nodes also are not exported to a Group, so this way
you can control what options (in/outputs) exactly are available.

To be done:
- a way to hide individual sockets, like with a RMB click on it.

**** NEW: Nodes now render!

This is still quite primitive, more on a level to replace the (now
obsolete and disabled) Material Layers.

What needs to be done:

- make the "Geometry" node work properly, also for AA textures
- make the Texture Node work (does very little at the moment)
- give Material Nodes all inputs as needed (like Map-to Panel)
- find a way to export more data from a Material Node, like the
  shadow value, or light intensity only, etc

Very important also to separate from the Material Buttons the
"global" options, like "Ztransp" or "Wire" or "Halo". These can not
be set for each Material-Node individually.

Also note that the Preview Render (Buttons window) now renders a bit
differently. This was a horrid piece of antique code, using a totally
incompatible way of rendering. Target is to fully re-use internal
render code for previews.

OK... that's it mostly. Now test!
2006-01-02 13:06:05 +00:00
Campbell Barton
8b0c3de7d9 Changed adduplicate() to take the dupflags as an argument. so faking the Alt Key isnt needed anymore in Blender or python.
Changed Pythons Object.Duplicate() to take keyword parms to enable duplication of spesific data.
Eg- Object.Duplicate(mesh=1) # to duplicate mesh data also.
2006-01-02 10:40:13 +00:00
Ton Roosendaal
9710d4c84c Orange <-> bf-blender conflict, with 2.40 saved files the version-patch to
initialize the (soon obsolete) material layers was skipped, causing it all
to be rendered black.
2006-01-01 16:37:21 +00:00
Ken Hughes
362c8baac4 Bugfix #3652: material.setSpecCol() only accepted a tuple, not separate
parameters as it used to (prior to my tp_getset update).  Fixed this and
other similar situations.
2006-01-01 16:28:57 +00:00