Commit Graph

452 Commits

Author SHA1 Message Date
e441c57d22 fix for bug #2588
objects with circular dependancies where not handled correctly
when sorting bases.

the fix is actually a workaround only and may evolve later

also add changes to xcode project for recent commits
2005-05-21 21:52:58 +00:00
244a1a71b3 Bug fix #2591
Dependency issue... could solve it by calling an extra where_is_object
when a displaylist is made for vertex-parenting on deformed objects.
2005-05-20 20:44:33 +00:00
Nathan Letwory
1071d4a16e This commit fixes two related issues:
1:
* when a blendfile gets loaded, paths are corrected with OS specific slashes (see blender.c)
* made available BLI_char_switch(char *string, char from, char to)
* made available BLI_clean(char *string);. This function should be called whenever you're doing path stuff, so paths are correctly saved, and thus avoiding other path functions stopping to work

2:
* relative paths work now in sequencer too (due to slash mess that didn't work all too well).
2005-05-20 12:18:11 +00:00
83792faa3f Two softbody thingies;
- fixed error in option "Enable Goal" which didn't work with Vertex groups
  assigned

- renamed some buttons & fixed tooltips. A doc online will be there soon
2005-05-20 12:15:50 +00:00
Stephen Swaney
615c2f40a1 text editor patch by antihc3.
fixes 'Memoryblock free: attempt to free NULL pointer' errors.
2005-05-19 03:15:49 +00:00
c1936cff60 fixed it sending null to MEM_freeN
.
2005-05-18 23:54:56 +00:00
2d6481c41c TextEditor: syntax color support.
Patch provided by Ricki Myers. Works quite obvious, see Theme editor too!

Notes about the provided code;
- The default syntax colors were screaming! Toned it down to match the
  default dark on lightgrey background better.
- Added: initializing colors in saved themes (usiblender.c)
- The implementation of the button for this option was quite clumsy...
  Blender UI options services this a lot easier.
  (Same fixed for 'line numbers' option)
- Bracket matching now uses as color a mix of backdrop and the
  selected-text color. Noticed my texteditor did it too...

-> I really miss comments in code describing a little bit the thought
   process behind the code. Like a short introduction on this feature
   in the top of the drawtext.c, little remarks on new functions.
   ALso in patch tracker or the mailinglist no docs was mentioned?

-> drawtext.c now gets messy quickly... lack of overview, structure,
   and confusing mix of personal coding styles.
   For not-active supported code dangerous...
2005-05-13 16:11:28 +00:00
c7942efdba Deform with Curves didn't take the 'tilt' value into account.
Note, the tilting only works for '3D' curves, and is accessible in
EditMode curve with TKEY.
2005-05-13 13:06:20 +00:00
aca394e341 On "Add duplicate object" the softbody baking info wasn't freed.
Note: currently the 'baking' stores the entire animation system, which
makes further animation refining (or duplicating) useless for a Baked
SoftBody. You can even delete the entire anim system.
This can be presented as a feature too (saves slow armature stuff).
However, I might check on a 'relative' bake too.
2005-05-12 14:00:12 +00:00
09fb5d6b8d BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).

- Updated Window and Window.Theme with new theme vars and the Time space.

- Script links:

-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.

-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.

-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.

-- Implemented Ton's space handler script links:

Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.

Here's how it works:

- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT

and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.

EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:

import Blender
from Blender import Draw

evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender

Blender.event = None # tell Blender not to process itself the event

DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.

To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.

Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.

- doc updates about the additions.

=======

Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
2005-05-08 21:20:34 +00:00
ef2855bcab Timline goodies;
- Mkey while ALT+A inserts markers.
  Note for Matt; You forgot to check for 'val'. The delay in tuho I brought
  back to max 1 frame. Delays are common in realtime gfx apps, the picture
  you see is old, and its possible you press a key while next frame is
  already drawing, and then it has to increase the frame value still... :)

- RMB escapes from anim playback

- on activate object, Timeline redraws too

- Added keyline drawing for Material Ipos. The CTRL+Page keys work with it.

Softbody:

- Renamed buttons to call "Spring constant" now "Stiff(ness)" and the
  "Friction" became "Damping".
2005-05-08 20:10:59 +00:00
9a41ac4f70 Patch from Tom Musgrove to bypass extrude popup on singular selections...
Implementation had some issues though, since:

a) Blender has no stats available that tells amount of selected edges
b) Bypassing the popup should be 100% accurate
b) Once you do that, the popup should actually only show possible
   choices as well.

So! I've added a G.totedge and G.totedgesel, also being printed in the
info header. Using this variable the extrude popups could be limited too.

Also: made 'normal alignment' for edge-only selections work when the
normal wasn't pointing OK. Now it aligns the Z axis with the edge itself
Exact algorithm for choosing a 'normal' and 'plane' still is weak.
2005-05-07 15:50:09 +00:00
2887e68705 Bug fix #2515
Bumped up ipo limit for material "normal" mapping to 25.0 max.
2005-05-05 20:39:50 +00:00
f0a4ce98f9 Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.

Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html

Notes for using timewindow;

- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers

- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key

- Press S or E to set start/end frame for playback

Notes about the implementation in Tuhopuu:

- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
  should deselect all, except the indicated Marker. Not when holding SHIFT
  of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
  (Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
  was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
422b69fe1e UI cleanup work;
Proportional edit:

- Proportional mode added to header as button/menu. Including new option
  to have only connected geometry influenced.
- Added icons for proportional & proportional modes
- Make proportional edit data part of Scene, so all gets saved.
  The Global flag G_PROPORTIONAL was removed
- Made sure #defines get used properly, also tweaked order for proportional
  so it starts with regular 'smooth' by default.
- Use ALT+O in editmode to switch to new proportional 'connected' mode

Other UI stuff:

- in EditMode, the layer buttons get hidden... the amount of icons in
  3d header grows to fast. :)
- made less ugly icons for the Manipulators. Still can be better.
- Added alpha-filter for pre-processing Icon-image, giving nicer display
  of icon-antialising on dark or bright backdrops
- disabled Manipulators when in editmode, and current layers don't show
  the edited data.
- Added the value used to define Normal size (editmode draw) in Scene too,
  so it gets saved.
2005-05-03 10:54:42 +00:00
42126cb5fc Added baking for softbodies.
Works as follows;
- press the 'show bake settings' button (no space left... :)
- define start/end frame for bake, and an interval step.
  The baked result interpolates nicely (Bspline, 4 keys) so in general a
  step size of 2 or 3 still gives OK results.
- Press "BAKE". This will do a full animation + playback. Press ESC if it
  you don't want it.

Once Baked, the BAKE button becomes a FREE BAKE. As reminder the softbody
buttons get blocked with error() menu.

This saves OK in a file. Renders any frame, including fields and moblur.
You can also set a "Timeoffs" for the softbody. And yes, this should be
in the NLA once... :)

NOTE! With this commit, files saved with the old (first commit) version by
Jens Ole won't read the settings back... he stored all sofbody variables in
Object, which was moved to a new struct when I did my first commit on SB
(over a month ago)

Also note that I moved particle deflecting & softbody to a new include.
2005-05-02 13:28:13 +00:00
Stephen Swaney
a6bb0b7f79 fix 'no newline at end of file' warnings 2005-04-30 23:29:10 +00:00
Stephen Swaney
a21fd1571b changed empty #elif to #else 2005-04-30 23:24:48 +00:00
2577c4e915 Updated MSVC6 projects to handle depgraph (added some files)
fixed some *includes*
with
#ifdef WIN32
#elif
#include <sys/time.h>
#endif
looks like MSVC6 does not need that include .. donno if cygwin builds will
so thats why i kept that *ifdef overhead*
2005-04-30 22:52:00 +00:00
79e333343b Dependency graph patch, provided by Jean-Luc Peuriere.
Works like a charm... well it now replaces the old base-sorting hack. :)
Next stage will be to define how to further integrate it. Plus some
minor code cleanups... static/internal functions versus external, etc.
2005-04-30 21:27:05 +00:00
b705434c72 A couple more simple gcc4.X warnings fixed.
softbody.c I removed an unused var.
text.c added return values to 2 return statements that didn't have anything.
Makefile added $(FIX_STUBS_WARNINGS) to CFLAGS for the stub.
source/blender/src/editface.c  fixed up int vs unsigned int stuff
source/blender/src/resources.c had two vars declared as unsigned char *
and then inputs to them were cast as char * so updated the casts.

Kent
2005-04-28 14:37:15 +00:00
d7d58accda Fix for reported (thanks Jens Ole!) error in rendering UV map textures.
Caused by making threadsafe envmap render...

Commit in convertblenderscene.c is just replacing constant with define.
2005-04-28 09:57:21 +00:00
7811d7209a Bunch of gcc 4.0 warning fixes.
source/creator/creator.c
	changed ifdef's around fpe_handler to match when its actually used.

intern/SoundSystem/intern/SND_AudioDevice.cpp
	Changed: SND_SoundObject* oldobject = oldobject = pIdObject->GetSoundObject();
	to: SND_SoundObject* oldobject = pIdObject->GetSoundObject();

intern/SoundSystem/openal/SND_OpenALDevice.cpp
	removed unused var.

source/blender/blenkernel/intern/mball.c
	initalized a couple of vars that might have been used uninitalized.

The rest were changing types to match, most of them were something like
was short * should have been unsigned short *.

Kent
2005-04-27 11:52:50 +00:00
e79db85cc1 Bug fix #2483
Wrong referencing of Materials created when importing DXF caused crashes.
Note for the person who coded it: the use of Blender internals (database)
is quite confusing... most of exotic.c isn't really OK code to reuse
from.

There's also a lot of redundant code there... with many chunks adding
objects or mesh data being copied completely. This can be structured much
better! :)
2005-04-27 10:08:37 +00:00
8fbecd24e8 Built in an escape from sbObjectStep() if transform() is used. Has to be
done for lattices... these keep calling this during transform, causing
the lattice itself and its children (if soft) to remain static on same
position.

Real solution has to be 2-fold:
- store deformed lattice points in Lattice, as a "DispList"
- usage of proper depgraph :)

There's also the idea to keep simulating softbody during a transform, to
give feedback on what softbody does... later.
2005-04-25 08:30:49 +00:00
7f75cfdd29 Bug fix #2469
Apparently DXF allows layers to be read too... this went wrong in 2 ways;

- object->lay was not equal to base->lay
- if DXF has layer info, but not readable, it set object->lay to 1 instead
  of using 'current layer'.
2005-04-24 21:38:19 +00:00
9083ab1a14 cleaned up parameter list for SoftBodyDetectCollision(...)
SoftBodyDetectCollision() is handeling the case
'user wants to prevent self intersection by declaring SB object a deflection target'
ahh .. yeah .. i can see the bug reports on that
(me shrugs .. never promised that to work)
2005-04-24 20:51:47 +00:00
7fa7826da7 The zblur plugin (aka as DoF) integrated in render. Compared to patch
submitted by Alexander, changes/improvements are:

- Moved to new Panel in Scene buttons "Post Effects". Together with other
  postprocessing options, such as Edge render. It is also not called DoF,
  this because that's a bit pretending too much then. It's a zblur still!
- Made it render Alpha as well
- Made it use and deliver float buffers
- Huge cleanup of zblur.c code, was very messy. It was alling things in render
  code without need even (win matrices, transform faces, etc)
- Fixed errors in using Z values (zbuffer is signed int)
- Removed very weird gamma corrections for front/back half
- Tweaked gaussian table, allow variable 'Sigma' to be set for gauss curve
- Didn't copy 'auto focus' yet. Use of this is very limited, and gives
  false expectations, nor works for rendering anims with deamons well.

Main issue remains: it's not a very advanced feature... I still doubt
very much if this deserves to be released. Spent 2 days on trying to get
the key issues solved, with not much results.

- gauss filter code has weird side effects on large blur size
- having unsharp (blurred) in front also blurs what's around in back.
  only blurred in back with sharp in front works a little bit
- severe aliasing errors... also due the code splitting in 2 halves
- doesnt work with unified yet
- won't work for halos, spot halos or transparant faces

Anyhoo... It was promised to be committed, so now artists can play with it.
Who knows it's useful after all, or some fixes can be implemented. :)
2005-04-23 20:49:23 +00:00
55f4ead5a2 gave softbody runge kutta error limit a nice default value 2005-04-22 17:58:39 +00:00
c5214c1571 rescaled stregth of wind and forcefield effects by some magnitudes
wind 250
field 1000
yeah WARNING to all testers:
tighten belts
scale down wind and forcefield settings (IPOs)
2005-04-21 18:58:15 +00:00
8a75569f9a Testing, 1, 2, 3... (just added enter) 2005-04-21 11:24:44 +00:00
be3eec3014 Softbody: added "time" button, to control speed for wriggling. Low values
make it slower, higher values faster.

Monkey: accidentally got inverted normals for they eye again. :)
2005-04-20 16:55:04 +00:00
4126e4e345 providing a minimalistic UI for SB vertex to face collision detection
in the particle interaction panel
"D"= "Amount of damping during softbody collision/intrusion"
"I"= "Inner face thickness" good value for unit cube == 0.2
"O"= "Outer face thickness" good value for unit cube == 0.02
still we can easily hide that before releasing
2005-04-19 22:06:12 +00:00
1d47d662f9 removed my SB hack from particle collision code
(which still can't really handle moving targets)
leaving 2 bug fixes
1. multiple objects need a reset on cache variable
2. quads always need to be handled as 2 triangles
(since they don't need to share a plane)

added a collision detecting function in effect.c for SB
( no need to be there, but i did not find a better place )
but should handle 'moving targets' up to 0.2 blender units/frame

well .. important info in this case:
collision
uses 'face normal' to decide if *intrusion* happend
uses 'damping' of collision target to slow down movement
when *intrusion* happend

+some more removing unneeded code in softbody.c
2005-04-18 21:51:45 +00:00
d34acbfe44 Replaced a bunch of malloc() calls with proper MEM_mallocN()
(and free() and calloc() of course)

Remainder malloc() calls need to be there for realloc().
2005-04-17 18:00:33 +00:00
425f295604 Patch submitted by Jorge Bernal (lordloki) and Jonathan Merritt.
This will add Minneart diffuse and WardIso specular to our shader menu.
Minneart gives nice control over darkness/brightness areas, the wardIso
over 'plastic' style sharp or fuzzy specular.

Webpage is being made with nice samples. Will be in release log.

Jorge: one change is in the do_versions, you inserted it on wrong location.
2005-04-17 17:43:07 +00:00
Alexander Ewering
dfe3ad0d7b copy_softbody() didn't check if object actually was softbody! 2005-04-16 16:56:06 +00:00
5ff281eaec Li'll feat request;
When curve objects have no front/back faces, the bevels were only drawn
for the outer part. Now it also makes interior bevels, so yo can
have a curve become a 'solid' ring easily.
Note: only works when you disable filling option "Front" and "Back".
2005-04-16 15:51:44 +00:00
07ef51cdb1 More SoftBody stuff:
- after grab/duplicate the softbody didn't get a reset signal
- added 'copy properties' for softbody settings
- duplicate object didn't copy softbody yet
2005-04-16 15:06:02 +00:00
7943f7990e Softbody:
- Added browsing for vertex group for "Goal" in SoftBody buttons.
- Means the default name "SOFTGOAL" isn't needed anymore
- temporally, on file read, the "SOFTGOAL" vertex group is set, if exists
- removing vertex group possible too
- changed softbody.c code to use this
2005-04-16 14:01:49 +00:00
11ef47407d - bug fix, tface flags weren't checked correctly for INVISIBLE
- bug fix, tfaces weren't accessed correctly in presence of hidden/invis.
2005-04-14 13:46:05 +00:00
f2678b8dac hum ..
turned off quad optimization, which is a bug IMHO, since breaking a quad it 2
faces always needs a test on both faces
2005-04-13 20:32:28 +00:00
f5cb2db604 Ack! Found out the bugfix commit #2411 was accidentally still calling to do
all actions (in all objects) instead of only the ones parented to
particle system.
2005-04-13 19:26:38 +00:00
84359bf996 im going to dig a hole to hide in
beginners standard typo did break particles
2005-04-13 12:18:58 +00:00
22ccdea4d3 Rather give a pointer to a local copy of vital data to pdDoDeflection()
in sb_deflect_particle() than a pointer to data.

Changed de-swamping in sb collision to move along face normal.
2005-04-13 07:51:06 +00:00
c7b82c40c2 Did put softbody time scaling stuff to functions,
so we can decide later what proper timing is meant to be.
i've prepared something in static float sb_time_scale(Object *ob) [softbody.c] (ton :) )

'hacked in' particle collision system to match softbodies needs
naa .. i don't realy like the hack to int pdDoDeflection(..) in kernel .. effect.c  (but it works :) )
so .. until we'll have a 'nice' collision detector this is what 'softbodies simulator can live with'
did not remove intentionally test function static int sb_deflect_test(..) for further discussions

http://mitglied.lycos.de/mosebjorn/hidden/  sbcol6.blend should work for a while
2005-04-12 21:36:21 +00:00
52b7b978e3 Bug fix #2411
(Looks like big commit, but is mostly just change of API call!)

Particle emittors now can be parented to an armature Bone, and give the
correct path for each particle. Note that this doesn't work for deform!
And, for each particle the entire armature is evaluated, all actions and
NLA strips.

It used to work a little while BTW, but the code just called ALL armatures
and made ALL deforms again. Was quite slow... thats why the API call
change: do_all_actions() now accepts Object * to only do that one. With
a NULL it now does all still. Will disapppear in recode of course...
2005-04-11 17:55:20 +00:00
6fa9f9b7f5 - don't apply creasing to edges with no adjacent faces... things
go wacky.
2005-04-10 15:04:52 +00:00
Stephen Swaney
e8a6bf6fb9 Bugfix for disappearing hilight bug and code re-org for text editor
from Ricki Myers (themyers).

Comes with nice juicy commit msg, too!

- source/blender/blenkernel/BKE_text.h

	- Removed indent_paste, uncommen, unindent_lines, comment_paste,
	uncomment_paste, uncomment, set_tabs.

	All these functions cut and re-added text (I felt this was
	unsafe). whicch is was caused the highlight loss.


	- Now the only functions are Indent, Unindent, comment, uncomment,
	  setcurr_tab. 	All these functions only take one @parm (struct Text)

	-indent(struct Text *text)
		copy's the selected text in a MEM_mallocN line by line added a
		tab at the begginning

	- Unindent(struct Text *text)
		Tests if current line starts with a tab.
		if TAB remove it
	- comment(struct Text *text)
		copy's the selected text in a MEM_mallocN and adding a # at the begginning

	- Uncomment(struct Text *text)
		Tests if current line starts with a #.
		if # remove it

	- setcurr_tab (Text *text)
		Checks for Tabs pri. to any text
		if : is found and not in a comment then Tabs is increased by one
		if "return", "break", "pass" is found then Tabs is decreased

- blender/source/blender/src/header_text.c

	Changed:	txt_cut_sel(text);
			indent_paste(text);
	TO:
			txt_order_cursors(text);
			indent(text);
	* no more cutting of the text

- source/blender/src/drawtext.c

	set_tabs(Text *text) just calls setcurr_tab(text);
2005-04-10 14:01:41 +00:00
b1675a345a - made shadedisplist not free all object displist data...
this messed with data caches which messed with assumptions made
   by drawing code (and was just silly not to mention). here
   be dragons...
2005-04-10 00:00:34 +00:00