Commit Graph

9472 Commits

Author SHA1 Message Date
Brecht Van Lommel
3bb5fc9c7d * RNA: utility function to retrieve strings. It will use a fixed
size buffer if it's big enough, and otherwise allocate memory.
* Added BLI_dynstr_appendf() to construct strings easily in printf
  style, this should make it easier to construct menu strings for
  example.
2008-11-11 15:03:26 +00:00
Nathan Letwory
6eaaf2ce72 === SCons ===
* merge the recent scons changes from trunk, so this means that the same rules now apply:
  - scons-local available
  - platform default configs updated
  - check your user-config.py if you have made a full copy of default config

Note: BGE and blenderplayer still not working, but that is normal ;) (so turn them off!)
2008-11-07 19:21:52 +00:00
Brecht Van Lommel
7e8ba5c84d RNA
* Added more error prints for wrong definitions, for cases that
  would laters cause problems compiling or crash at runtime, and
  also made messages more clear.
* Added some skeleton code for main/ID/mesh/vertex types for testing.
* Added support for automatic arrays as collections using SDNA.

* Changed how pointers to data work. Now they are always wrapped
  in a PointerRNA struct, which contains the data pointer and type,
  and also the data pointer and type of the ID datablock that this
  belongs to, since for example a vertex on it's own may not have
  enough information for some operations, it also needs the mesh.

* Added some code for defining dependencies with RNA, and looking up
  data with paths like: scenes[0].objects["Cube"].data.verts[7].co.
  Note sure either will end up being used, this is experimental.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA
2008-11-07 02:58:25 +00:00
Brecht Van Lommel
21a0e55c50 RNA compile error and warning fixes for MSVC. 2008-11-01 00:23:08 +00:00
Brecht Van Lommel
7f24dbe5fc RNA / Data API
This is the first code for the Data API, also known as RNA system in the
2.5 Branch. It does not include a user interface, and only wraps some
Scene properties for testing. It is integrated with Scons and Makefiles,
and compiles a 'makesrna' program that generates an RNA.c file.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataAPI
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA

The changes are quite local, basically adding a makesrna module which
works similar to the makesdna module. The one external change is in
moving genfile.c from blenloader to the makesdna module, so that it can
be reused by the RNA code. This also meant changing the DNA makefiles.
It seems to be doing dependencies correct still in my tests, but if
there is an issue with the DNA not being rebuilt this commit might be
the one causing it. Also it seems for scons the makesdna and makesrna
modules are compiling without warnings. Not a new issue but this should
be fixed.

The RNA code supports all types as defined in the Data API design, so
in that sense it is fairly complete and I hope that aspect will not
have to change much. Some obviously missing parts are context related
code, notify() functions for updates and user defined / ID properties.
2008-10-31 23:50:02 +00:00
Brecht Van Lommel
b589489ef8 2.5 Branch: use themes for drawing the time space, and make
view2d grid code a bit nicer.
2008-10-08 18:07:56 +00:00
Nathan Letwory
9d77cc9222 * use env.Clone() instead of deprecated env.Copy() 2008-10-05 21:36:36 +00:00
Brecht Van Lommel
40fb11efaf 2.5 Branch: added WM_report and WM_reportf functions for reporting
information, warnings and errors.
2008-10-03 18:03:30 +00:00
Campbell Barton
fdb0b003f0 patch from skejoe for gcc 4.3 compatibility 2008-06-24 14:51:02 +00:00
Andrea Weikert
a06f4f3817 == Rip Area into new Window Operator ==
- operator that rips current area into new window
- implemented on the window level.
- sets C->area in current context if necessary
== fix ==
- small bugfix: missing return in WM_event_add_keymap_handler
2008-06-19 19:09:21 +00:00
Brecht Van Lommel
7097c8a51e 2.5 Branch: makefile update for last commit, patch provided by Diego, thanks! 2008-06-11 17:24:27 +00:00
Brecht Van Lommel
a019f1d3d6 2.5 Branch
==========

* Changed wmOperatorType, removing init/exit callbacks and adding cancel
  callback, removed default storage in favor of properties. Defined return
  values for exec/invoke/modal/cancel.
* Don't allocate operator on the stack, and removed operator copy for
  handlers. Now it frees based on return values from callbacks, and just
  keeps a wmOperator on the heap. Also it now registers after the operator
  is fully finished, to get the correct final properties.
* Changed OP_get_* functions to return 1 if the property is found and 0
  otherwise, gives more readable code in my opinion. Added OP_verify_*
  functions to quickly check if the property is available and set if it's
  not, that's common for exec/invoke.
* Removed WM_operatortypelist_append in favor of WM_operatortype_append
  which takes a function pointer instead of a list, avoids macro's and
  duplicating code.
* Fix a crash where the handler would still be used while it was freed by
  the operator.

* Spacetypes now have operatortypes() and keymap() callbacks to abstract
  them a bit more.
* Renamed C->curarea to C->area for consistency. Removed View3D/View2D/
  SpaceIpo from bContext, seems bad to keep these.
* Set context variables like window/screen/area/region to NULL again when
  leaving that context, instead of leaving the pointers there.

* Added if(G.f & G_DEBUG) for many of the prints, makes output a bit
  cleaner and easier to debug.
* Fixed priority of the editors/interface module in scons, would otherwise
  give link errors.

* Added start of generic view2d api.
* Added space_time with some basic drawing and a single operator to change
  the frame.
2008-06-11 10:10:31 +00:00
Andrea Weikert
161d60debf == join areas operator ==
- draw arrow in area that will removed and draw area that will be kept lighter (change from trunk: without arrow)
- not using notifications yet, but uses flag in ScrArea to determine draw type for area. (might be worth discussing)
- experimental: swapping of areas extended a bit, which allows user to choose area a bit more freely
2008-01-21 21:36:02 +00:00
Nathan Letwory
43f680bad8 *remove superfluous glEnd(); - made func internal too. 2008-01-20 21:37:39 +00:00
Nathan Letwory
107b0997e7 * grow AZone size
* remove ^M's
2008-01-20 21:10:55 +00:00
Diego Borghetti
a2074a1522 Changes to the "join area" operator.
This is a patch by Michael Fox (mfoxdogg) that make more
easy join two are, just RMB+Alt in the "origin" area,
drag the mouse to the "target" area and release the mouse.

Note that this is not a "final mouse-bind" for the join
operator, just an easy and simple option for test in 
this early stage of 2.5.

Other note: maybe it's a good idea add azones here ?
2008-01-20 04:39:50 +00:00
Diego Borghetti
0db1aed7e1 More change to the gesture manager.
After check this a little more I make some changes to the
API and now work on the following form:
	WM_gesture_init(C, type);

	while() {
		/* handler event, etc */
		/* if something change. */
		if(need_update) {
			/* update the gesture data and notify about it. */
			WM_gesture_update(C, data);
			WM_event_add_notifier (.. WM_NOTE_GESTURE_CHANGE ..);
		}
	}
	WM_gesture_end(C, type);

Another of the change is that now the gesture data is a link list
in the window struct, so we can have multiples "gestures" (but
of different type) at the same time.

Also take care that the "gesture data" is reusable, that mean that
only alloc it 1 time and use in all the place, that is
why don't support multiple gesture of the same type, but of course
that can be change.
2008-01-19 21:54:33 +00:00
Diego Borghetti
b80049a139 New "Gesture Manager" system.
This is a first implementation of the "gesture manager" system,
the idea is put the WM in a automatic draw mode so we can
implement different "Gesture types" to draw different class
of data (lasso, bound box, etc).

The gesture data is passed through the data field of the notifiers,
i think that we can change this to something like:
	WM_gesture_init(C, data); /* put the data in the context. */

	while() {
		/* send WM_NOTE_GESTURE_CHANGED to update screen */
	}

	/* send event and free the data in the context. */
	WM_gesture_end(C);

Also i add a new operator and event to test the gesture manager.
The new operator is the "border select" function, just press BKEY
in the window and LMB or ESCKEY to exit.
In the case of LMB you can see a print in the console about the
BORDERSELECT event.

All this still need a lot of work, comment are welcome.
2008-01-19 17:54:05 +00:00
Nathan Letwory
d7223cb3aa * clean up ^M
* make default size of action zones smaller (still draw them, but that could be also made optional).
2008-01-17 23:03:37 +00:00
Campbell Barton
4966e63f4f game engine wasnt compiling 2008-01-17 17:15:44 +00:00
Diego Borghetti
2dc143552f Fix uninitited list pointer when duplicate an area. 2008-01-17 16:22:37 +00:00
Nathan Letwory
d72af0a5a9 * First working version of a new split tool for areas.
- LMB+drag from lower left action zone. LMB release confirms
  - RMB or ESC cancel.

TODO:
  - subdiv (drag to center)
2008-01-17 13:50:54 +00:00
Nathan Letwory
e7539ef134 * don't copy azones- these are initiated runtime always. 2008-01-17 08:26:58 +00:00
Nathan Letwory
bd60122a2a * make sure we don't crash on window duplicate, or .B.blend read. There is still a bug with duplicate, but I'm working on it. 2008-01-17 08:21:21 +00:00
Nathan Letwory
0e476af66e * Start ActionZone support for areas. This is bScreen level stuff to be able to do funky stuff.
Right now 2 AZones are defined for each new ScrArea, and mouse over is now detected. Enter ugly triangle.
2008-01-17 05:33:54 +00:00
Nathan Letwory
7e14c5d119 * rearrange screen level drawing code a bit in preparation for tests. 2008-01-16 19:49:34 +00:00
Nathan Letwory
3eca7d1d06 * I gotta remember my mantra for real
"first compile, then commit".

Of course, if compile fails, don't commit.
2008-01-15 23:15:56 +00:00
Nathan Letwory
abc325092f * undutchification of printf's
* remove unnecessary printf's
* clean a bit, some doc strings
2008-01-15 23:08:10 +00:00
Andrea Weikert
da11a3f38e Operators: Join Areas
add split area to screen manager
- RMB+ALT down on area edge activates
- mouse move interactively to area that is to be removed
- LMB to confirm, ESC to cancel
TODO: 
- notifications for interactive drawing to mark area to remove

Some fixes
- uninitialized var warning.
- exit function of operators need to run before modal handler is removed if operator is used there.
- replaced MEM_mallocN with MEM_callocN to get rid of uninitialized mem for wmOperator.
- respect return value of wm_handler_operator_call() and break out of operator handling.
2008-01-15 20:42:00 +00:00
Nathan Letwory
9e9ebfc12c * check for NULL. Could crash if passed parameters were NULL. 2008-01-15 19:28:57 +00:00
Nathan Letwory
6ce20f2968 * add exit app with CTRLKEY+QKEY. 2008-01-15 18:54:38 +00:00
Nathan Letwory
3469906125 * area split:
- prevent a few more cases of Potential Crash.
- tweak moving stuff.
2008-01-15 14:40:43 +00:00
Diego Borghetti
5ed9571ea5 More "data types" for the Operator property system.
Now you can set/get: float, arrays (int and float) and string.

The only special function is OP_get_string, it is special
because return a pointer to the IDProperty data, so you can't
change/resize/free the string.

It's possible "fix" this with:
 1) Return a "const char"
 2) Return a duplicate string

All this new function are not in use yet, but i make a simple test
with the "move areas" operator (add a property of every type and then
print the result in the other size) and work fine, more test are welcome.

Other thing to check is the new OP_free_property function, because this
properties are only local to the operator, i choice free all this in the
"exit callback" of every operator (only move areas have property now), 
so comment about this are welcome too :)

Also add some notes to the WM_api.h file.
2008-01-15 04:49:09 +00:00
Nathan Letwory
8a7558a4fb * fix for crash when mouse cursor changed areas. Not enough was tested, so sometimes we got invalid edges. 2008-01-14 20:57:43 +00:00
Nathan Letwory
c89b96645e Operators: Split Area
This commit adds split area to the window/screen manager.
 - RMB down on area edge activates
 - mouse move interactively moves areas through new edge.
 - RMB up to confirm action
 - ESCKEY or LMB to cancel.

This still crashes in some situations, but I'm on it!
Also will start using new operator property system by bdiego
2008-01-14 20:46:42 +00:00
Diego Borghetti
2a0055401e New API to access Operator properties.
This is a simple API around IDProperty to store properties
in the Operator, it is really simple and this first commit
just add support for IDP_INT data type.

Take care that this "properties" are not save yet and you get
some "Error totblock" more with this.

I add some notes to the WM_api.h file, please check this,
comment and ideas are welcome.
2008-01-14 19:44:20 +00:00
Nicholas Bishop
49eb7a3eed Applied a couple sculpt/multires fixes from trunk to blender2.5. 2008-01-12 22:06:42 +00:00
Kent Mein
69f004f90d Reverting changes made yesterday to Makefile... (Its really messed up,
Going to do it over again from scratch)

Kent
2008-01-11 16:56:00 +00:00
Chris Want
6258c0979e The python lib name should be 'bf_python' instead of 'blender_python'
when linking.
2008-01-11 16:48:07 +00:00
Kent Mein
c562fdf095 Fixed typo from merge yesterday.
Kent
2008-01-11 14:15:59 +00:00
Kent Mein
6167882776 Cleaned up some things, more work to do here but its a little simpler now.
Kent
2008-01-10 19:53:57 +00:00
Kent Mein
ec4c6154fe Change vector structs from 3 to 4 so things are aligned for 64bit machines.
Kent
2008-01-10 19:22:58 +00:00
Ton Roosendaal
11ab3d7598 Add more memory clearing on file read for WindowManager. 2008-01-10 18:56:24 +00:00
Ton Roosendaal
42e2b4edde Two fixes in 2.5 branch:
- crash on start because of unitialized pointer
- Makefile had the python lib on weird location... I prefer all 
  blender/source/blender/ libs together on 1 place? The Make needs
  cleaning... it assumes publisher stuff. :)
2008-01-10 18:13:34 +00:00
Ton Roosendaal
43cf3af8c0 Blender 2.5 project: added first more complex handler + operator
- on mouse-over edge, you can drag area borders around.
- note it's a handerized system now, so it updates UI while you
  move mouse.

Feedback needed:

- read bottom part of the screen_edit.c file. It's the proposed
  method for adding tools and handlers. I think it's close, but
  might need some tweaks.
2008-01-10 17:38:17 +00:00
Nathan Letwory
b81b6be184 * fix linking order for bf_python 2008-01-09 23:07:34 +00:00
Andrea Weikert
ce975c1027 update to cmake files
- added python library
- small fix for ignored runtime library, needed for linking debug here
Note: still some problems linking with openexr in debug
2008-01-09 18:48:04 +00:00
Nathan Letwory
8269b89c15 * fix linking order for l00nix 2008-01-08 17:32:38 +00:00
Kent Mein
d0a23e2eb4 Commented out a couple of verse functions that are in src
Kent
2008-01-08 16:17:26 +00:00
Nathan Letwory
15da2232f7 * tweak linking priorities - should help for GCC users
* some lib renaming
2008-01-08 09:47:44 +00:00