Commit Graph

47594 Commits

Author SHA1 Message Date
Campbell Barton
d73e312f88 Added Image.GetCurrent()
Previously the only way to get the current image was flaky and relyd on the image being assigned to a mesh.

try:
  me = Scene.GetCurrent().getAttiveObject().getData(mesh=1)
  image = me.faces[me.activeFace].image
except:
  image = None

...Can new be replaced by the following, and works even when there is no mesh.
image = Image.GetCurrent()

epydocs:
  Get the currently displayed Image from Blenders UV/Image window.
  When multiple images are displayed, the last active UV/Image windows image is used.
2005-12-13 00:00:11 +00:00
Ken Hughes
b72dc4585f -- Bugfix #3566: Entering very large numbers for scaling/rotation/translation
cause a write past end of string buffers in outputNumInput().  Patched to
   make large numbers (+-1.0e+10) display in scientific notation format.
2005-12-12 23:03:32 +00:00
Ton Roosendaal
556451345b Bugfix #3583
Auto-IK confused a routine that checked for IK on bones... causing
drawing errors in buttons and 3d window.
2005-12-12 22:27:30 +00:00
Ton Roosendaal
ba237f5170 Bugfix #3565
Enabling FluidSim on non-mesh object crashed... it uses DerivedMesh. :)
2005-12-12 22:04:34 +00:00
Ton Roosendaal
f27350174a Bug #3562
Strips with a repeat fraction (like 3.51) should also "hold" on the
fraction of .51 when indicated so.
Patch provided by Roland Hess, but cleaned up (exisiting) mess a bit too.
2005-12-12 21:56:32 +00:00
Ton Roosendaal
bf412134d4 Bugfix #3556
Unified render didn't treat the alpha for raytraced transparent correct...
unified is based on layering with alpha, so it cannot support alpha in
raytraced transparent correctly.

I'm going to kill unified one day... its giving me headaches. :)
2005-12-12 21:16:24 +00:00
Joseph Gilbert
540e5bb77d *Armature api documentation 2005-12-12 20:12:50 +00:00
Ton Roosendaal
ebfe09a223 Bugfix #3544
First two vertices of a hair strand were not transformed OK, causing weird
results with especially thicker hair, or very short ones.
2005-12-12 19:06:34 +00:00
Joseph Gilbert
9ae9527c51 - Armature/Bone API for python
* this resolves a number of outstanding issues with the armature api and gets this ready for release
- add/remove bones possible
- rolls work correctly now!
- ik'ing to parent should work
- flags for tip/root/bone selection
- etc.
2005-12-12 18:46:26 +00:00
Stephen Swaney
d32b100464 bugfix: #3420 Indent/Unindent in text editor not undoable
contributed by Mr. TextEditor - themyers.  Thanks!
2005-12-12 18:35:15 +00:00
Ton Roosendaal
46c18b3e95 NLA editor, adding actions wasn't possible when amount of actions was over
30, the databrowse option didnt work.

Made popup menu to go to 60 now, in 3 collums max. Databrowse works too
now.

Next commit; check all other databrowsers for it.
2005-12-12 16:29:47 +00:00
Joilnen Leite
c452e8672c Rewrote TimeLine_getFramesMarked func with better coding
.
2005-12-12 11:57:58 +00:00
Ton Roosendaal
d2a3d5e79c Debug commit;
If a group duplicator uses a group with no users, it draws in red. Needed
because this seems to happen in unknown cases...
2005-12-12 09:18:56 +00:00
Alexander Ewering
6c3e8ac2e1 Fix confusing (too early) waitcursor when selecting rand fac for fractal
subdivide.
2005-12-12 03:02:29 +00:00
Ton Roosendaal
7daa8d0bca Sunday merger of orange branch with bf-blender 2005-12-11 23:04:27 +00:00
Ton Roosendaal
51d1b52286 Fix #1 to resolve corrupted NLA files with lib-linked groups.
- If a library became unreadable, with a print like:
  ERROR: can't find lib //../../../../../../..//jorma_light.blend
  Then set the F10 "rt" button to 111. :)
  That will read files with a stripping routine to fix it.

- For lost actions in strips: press Lkey in NLA editor, this is the new
  "re-link action" option. To get it work, dont forget to fill in the
  proper Armature in NKey panel.

The real fix, for the code that corrupted relative paths, will be
part of the bf-blender branch merging, which follows.
2005-12-11 22:54:46 +00:00
Ton Roosendaal
e58eecbea5 Fix: reading library files with option "Relative Paths" set, whilst library
was read already AND relative, caused the path for libraries to corrupt...

Error caused big headaches in studio Orange... :)
2005-12-11 22:03:04 +00:00
Ton Roosendaal
83f8cb0806 Added depsgraph update call on 'add group'. 2005-12-11 18:01:09 +00:00
Ton Roosendaal
d3113b5184 Orange: made duplicators work for dynamic particle systems. Meaning; a
particle generator can be duplicated.

Note that the particles are only generated once, on the original, and just
get duplicated.
For static particles it worked already OK.

Added note for previous grouping commit; group-duplicators should support
fully all animation systems, including modifiers and particles.
2005-12-11 14:28:22 +00:00
Ton Roosendaal
feb14b9b66 Orange: Removed old duplicator stuff from renderconverter.c... 2005-12-11 13:37:05 +00:00
Ton Roosendaal
d7bee8c117 Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
   enables to control the entire animation system of the Group.

Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
   to override NLA/action of any Grouped Object.

For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.

Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.

Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.

-> Recoded entire duplicator system

The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.

By centralizing the code for duplicating, more options can be easier added.
Features to note:

- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too

Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.

-> Library System

- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.

-> Fixes

- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
  causing unnecessary slowdown on reading.

Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
Campbell Barton
e0d20e00ce Added some details in the Mathutils documentation. 2005-12-11 04:20:37 +00:00
Ken Hughes
76e7905736 -- Bugfix #3573: Deleting a scriptlink when some other scriptlinks were no
longer linked to a script would cause a crash.  We now delete all
   scriptlinks which are not linked.
2005-12-10 19:36:05 +00:00
Ken Hughes
080eb9b3fa -- Bugfix #3564: Texture.getImage() always returned None for Env maps, even if
an image was assigned.
2005-12-09 23:19:00 +00:00
Ton Roosendaal
ccb285006c Bugfix #3526
Division with zero caused wrong pixels to be rendered with Ortho camera.
2005-12-09 17:22:50 +00:00
Ton Roosendaal
485dd1d376 Orange; WIP commit for inclusion of "Tangent" vector in rendering.
This first implementation only supports it for Meshes with UV maps, and
only tangents in V direction.

Tangent diffuse:
http://www.blender.org/bf/0001_0080.avi
Tangent spec, diffuse, and bump:
http://www.blender.org/bf/20001_0080.avi

NOTE: since UV coordinates are still very badly subsurfed, this won't work
well for subsurf meshes... on the todo.

On the todo;
- generate tangents for meshes without UV (with some options)
- use tangents from Curve/Surface
- add the Ashkimin shader from tracker

-----

Important bugfix; curves didn't render anymore since yesterday. :)
2005-12-09 15:14:32 +00:00
Joilnen Leite
7b2f1d4776 change return of getMarked method for dict {framnum:['nameframe']}
.
2005-12-09 15:00:54 +00:00
Johnny Matthews
e4c375ef0b bugfix #3550
Fixing Loopcut smooth to actually cut smooth

I think this will go to HEAD now...
2005-12-09 14:49:41 +00:00
Ken Hughes
1e589f59d0 -- Bugfix #3520: Text with extrusion and/or bevelling would would disappear
when edit mode was entered.
2005-12-09 14:30:51 +00:00
Ken Hughes
cf42e62ebb -- Bugfix #3545: Toggling the "apply modifier to editing cage during
Editmode" flag in one modifier cleared the flag for all other modifiers.
   It now only allows toggling of the last modifier in the stack.
2005-12-09 13:57:27 +00:00
Ton Roosendaal
c492729b3a New feature: "Stress" texture input channel
(As usual movies disappears after while)

Face example showing stress values on a blend. White is stretch, black
is squeeze
http://www.blender.org/bf/0001_0014.avi

Quick test with softbody stretch
http://www.blender.org/bf/0001_0100.avi

Based on the difference of the "Orco" (original undeformed coordinate)
and the actual render coordinate, a stress value is computed to make
textures react to stretching or wrinking skin.

The texture coordinate is neutral (0) on relaxed state. -1 is squeezed
to zero, +1 is stretched to infinity.
Note that scaling (object itself or parent) also will result in
stress values.

The reason for the huge commit is a cleanup in allocating memory for
the vertices. These were growing too large with new options, so now it
allocates the optional coordinates dynamically.
Saves about 20 MB memory per 1M vertices already. But best of all is that
I now can add much more fun... so tangents, here we come!
2005-12-08 22:05:42 +00:00
Johnny Matthews
13d638c8b8 bugfix #3550
Fixing Loopcut smooth to actually cut smooth
2005-12-08 21:35:08 +00:00
Ton Roosendaal
ae8c2963e5 Orange: fix for duplicator-group using X-Ray or Transparent draw options.
Note that X-ray is skipped, since it can only work for clearing the zbuffer,
but Transparent works now.
2005-12-08 20:07:41 +00:00
Ton Roosendaal
459d9607e8 Orange: Made Action Editor to respect Bone layers too.
Note: only works when an Object has Action linked, and not for pinned
actions.
2005-12-08 18:32:06 +00:00
Ton Roosendaal
7422fd4fff Orange: Action editor didn't reset selection flag on selecting Pose bones. 2005-12-08 15:18:42 +00:00
Ton Roosendaal
4b7bc941e5 Orange: More fixes in bone-layers (#$@%!).
- constraint buttons were drawing the hidden bone settings
- ctrl+I or 'Add constraint' didn't respect layers yet
2005-12-08 15:05:14 +00:00
Ton Roosendaal
42ec7a2afa Orange: Made Nkey and info text in 3d window respect Bone Layers. 2005-12-07 23:25:43 +00:00
Ken Hughes
e67360cb97 Made Mesh verts/edges/faces hashable (as they were in NMesh); this will
make it easier for some scripts to be converted.
2005-12-07 21:12:33 +00:00
Ton Roosendaal
89974f1546 Orange fixes;
- protected editing library data names in outliner
- layer-bone recode caused selection from posemode not to flush correctly
  to editmode
2005-12-07 20:28:48 +00:00
Ton Roosendaal
2f0ae40979 Bugfix from own collection: Rename option in Outliner didn't handle an ESC
correctly. Button wasn't closed then.
2005-12-07 19:59:26 +00:00
Brecht Van Lommel
44c9b42f60 Orange: Bugfix for uninitialized variables in lscm/stretch, forgot to
update initialization when switching from MEM_callocN to BLI_memarena.
This should fix the windows crashes.

Patch by Jens, thanks!
2005-12-07 19:54:52 +00:00
Ton Roosendaal
0c60e72cbf Orange: Group with curve objects in it, and used with group-duplication,
didn't update display when original was on hidden layer.
2005-12-07 19:47:22 +00:00
Toni Alatalo
5b71510ecf A patch from Ken Hughes per request of Bassam here at Orange: Python access to armature visibility layers. 2005-12-07 19:36:01 +00:00
Ton Roosendaal
ddc98d1307 Orange: option "Add to new group" (CTRL+G) didn't work when a group
already existed.
2005-12-07 15:13:37 +00:00
Ton Roosendaal
fba94ef97a Orange: Custom drawing types for bones in Poses!
In Armature Pose-bone panel, the 'hide' button got replaced with a button
where you can type (TAB complete works) a name for a Mesh Object. It then
draws that Object instead of the indicated bone drawing type.

Fixes for bone layers:
- Akey in Editmode didnt work proper (now deselects all non visible bones
  too. selection for editmode works on the vertices, not bones...
- Snap in Editmode now respects layers
2005-12-07 15:07:31 +00:00
Ton Roosendaal
5a514ae20e Orange Bugfix: depsgraph code crashed on building particle system without
forcefields.... tsk!
2005-12-07 12:46:34 +00:00
Ton Roosendaal
1123be1bcc Orange request; Bones in Armature now have own layer settings.
Works like for Object layers, but local within Armature itself. Each Bone
can be in (16 now) any layer, and the Armature layer defines what is
visible or not. Also note that hiding will still work too.

Since the Blender code is *stuffed* with Bone options now, this commit
requires a good test if all tools we got now comply to layers...
(I counted 130 cases for checking for selected Bones in code!)

In PoseMode; hotkey M will show 'movetolayer' menu. Not in editmode...
then its the mirror menu.

Todo: make action/nla drawing comply to Armature layer settings.
2005-12-07 12:36:26 +00:00
Ken Hughes
b02ff5f2a2 -- Bugfix #3551: fix memory corruption problem if Text3d.setText() called
while selected text is in edit mode.

(Future note: now that there is Unicode support in Blender, we need to add
support for it in the BPy Text3d API.)
2005-12-07 05:44:29 +00:00
Ken Hughes
b558edd629 Fix memory leak; if Blender quits while in text edit mode, free textbuf
inside of free_editText().
2005-12-07 05:41:58 +00:00
Kent Mein
4cf83c2c14 Fix for bug #3529
Provided by Jorge Bernal (lordloki)

Function was returning a wrong value in a switch statement.

Kent
2005-12-06 18:52:55 +00:00