Commit Graph

18094 Commits

Author SHA1 Message Date
Campbell Barton
ffb8ac01a2 remove scriptlinks,
they were not working and we have plans for better script integration in 2.5
2009-07-22 09:41:41 +00:00
Matt Ebb
53c1b562af Fixed weird alignment for new mesh objects. This still doesn't work correctly in edit mode, but it's a bit more usable than before. 2009-07-22 06:31:36 +00:00
Guillermo S. Romero
d44d7e220d SVN maintenance. 2009-07-21 21:31:13 +00:00
Brecht Van Lommel
c354ea0ef1 2.5: Render
This adds a RenderEngine type to RNA, which can be subclassed
in python (c++ will follow once we support subclassing there).
It's very basic, but plugs into the pipeline nicely. Two example
scripts:

http://www.pasteall.org/6635/python
http://www.pasteall.org/6636/python

Issues:
* Render runs in a separate thread, and there is unrestricted
  access, so it's possible to crash blender with unsafe access.
* Save buffers and full sample are not supported yet.
2009-07-21 20:28:32 +00:00
Brecht Van Lommel
6b8dae0874 RNA
* ID blocks can now get RNA properties defined from python, e.g.:
  bpy.types.Scene.BoolProperty(..)
* RNA structs/functions/properties can now get pointers duplicated
  (mostly strings), since we can't point to some static string then.
* Added ExtensionRNA struct to add into *Type structs for subclassing,
  is a bit more compact than defining the 4 variables each time.
  Only disadvantage is it requires including RNA in more places.
2009-07-21 20:05:16 +00:00
Brecht Van Lommel
b8445173c4 2.5:
* Fix armature drawing crash with materials.
* Mixed texture/material preview was doing wrong gamma correction.
* Use *f math functions for AAO.
2009-07-21 18:29:37 +00:00
Brecht Van Lommel
a1407ff342 2.5:
* Windows fixes for texture filter & bump patches, thanks
  Jean-Michel Soler for noting.

* Added sqrtf/sinf/fabsf/... fallback #ifdefs in BLI_arithb.h,
  those should be safe to use now. Replacing the double for the
  float version throughout the code can be done once, but would
  need proper testing.
2009-07-21 18:23:45 +00:00
Campbell Barton
e4b7997277 py console wasnt working since r21743 2009-07-21 15:52:15 +00:00
Brecht Van Lommel
0391b5ecef 2.5: fix crash on load when saving with a filebrowser open. 2009-07-21 14:28:41 +00:00
Brecht Van Lommel
b5457e8e70 RNA
* Wrapped RenderResult, RenderLayer, RenderPass.
* Update RNA_access.h with new structs.
2009-07-21 14:11:51 +00:00
Brecht Van Lommel
0b49dc77de 2.5: Bump Mapping
Patch by Alfredo de Greef. Considerably improves the quality of bump
mapping, and texture filtering for displacement and warp too. Mainly
this is achieved by getting the texture derivatives just right in
various cases, many thanks to Alfredo for figuring this one out, works
great.


This is enabled by default now, but disabled still for existing
textures to preserve backwards compatibility. Can be enabled with
the "New Bump" option in the material texture slot in the outliner.

Also, I made the range for the normal factor a bit smaller since this
gives stronger effects, but note that you can still type in larger
values than the slider allows.
2009-07-21 13:46:49 +00:00
Joshua Leung
d19bb6ffcf Silencing warnings (mingw + scons) about undefined stuff... 2009-07-21 13:20:39 +00:00
Brecht Van Lommel
e3c6ae9b89 2.5: Texture Filtering
Patch by Alfredo de Greef with high quality image texture filters.
This adds 3 new filters:

* SAT: Summed Area Tables. This is like mipmaps, but using somewhat
  more memory avoids some artifacts.
* EWA: Ellipitical Weighted Average, anisotropic filter.
* FELINE: Fast elliptical lines for anisotropic texture mapping.

The one change I made to this was to try to fix an alpha/premul
problem, hopefully I didn't break anything, it looks compatible
with the existing filter now for me.
2009-07-21 13:20:35 +00:00
Joshua Leung
ea0b015b0a 2.5 - Copy/Paste Operators for Armatures
* Buttons in header now use operators too. The paste-flipped button needs attention though, since the flipped argument isn't set yet

* Assigned Ctrl-C, Ctrl-V, and Ctrl-Shift-V to Copy/Paste/Paste-Flipped respectively for now.

* Auto-Keying for this doesn't work again yet. On todo for later...

---

* Also, new armatures now get the flag to show custom bone colours enabled by default.
2009-07-21 13:12:40 +00:00
Brecht Van Lommel
e56287bfc9 2.5: Texture Buttons
* World and Lamp previews now working here too.
* Experiment with list template, showing only icons. Unfortunately
  texture icon render crashes combined with preview render so it
  shows all icons the same.
* Influence panels updated, with slider for each option. The values
  are still linked though, will fix that later.
* Image texture controls a bit more complete, still WIP.
* Color ramp back.
2009-07-21 12:57:55 +00:00
Joshua Leung
7284eb6d91 2.5 - More work on Bone Groups
* Added a new UI Template for the 3-colour picker used to visualise + select the custom colours for a bone group.

* Finished wrapping the colour properties for Bone Groups in RNA. Although changing the colour-set used will change the displayed/cached colours, changing the colours via the colour wells will not change the colour set to 'custom' (as per 2.4x) yet. This needs a nice solution...

* Fixed context-related bugs with the Assign/Remove operators for bone groups. These were using context-iterators for selected posechannels, but that was only defined/valid for the 3d view (but not for the buttons window), hence a failure in that case.
2009-07-21 12:38:01 +00:00
Ton Roosendaal
e18164dbab 2.5
Overlooked WM event.val usage without checking proper #defines.
My previous commit made all input not work on any modifier key press.
2009-07-21 12:19:46 +00:00
Ton Roosendaal
ed92105857 2.5
Modal keymaps.

I've tried to make it as simple as possible, yet still using sufficient facilities to enable self-documenting UIs, saving/reading in files, and proper Python support.

The simplicity is: the 'modal keymap' just checks an event, uses event matching similarly to other keymap matching, and if there's a match it changes the event type, and sets the event value to what the modal keymap has defined. The event values are being defined using EnumPropertyItem structs, so the UI will be able to show all options in self-documenting way.
This system also allows to still handle hardcoded own events.

Tech doc:

1) define keymap
- Create map with unique name, WM_modalkeymap_add()
- Give map property definitions (EnumPropertyItem *)
  This only for UI, so user can get information on available options

2) items
- WM_modalkeymap_add_item(): give it an enum value for events

3) activate
- In keymap definition code, assign the modal keymap to operatortype
  WM_modalkeymap_assign()

4) event manager
- The event handler will check for modal keymap, if so:
  - If the modal map has a match:
    - Sets event->type to EVT_MODAL_MAP
    - Sets event->val to the enum value

5) modal handler
- If event type is EVT_MODAL_MAP:
  - Check event->val, handle it
- Other events can just be handled still

Two examples added in the code:

editors/transform/transform.c: transform_modal_keymap()
editors/screen/screen_ops.c: keymap_modal_set()

Also: to support 'key release' the define KM_RELEASE now is officially
used in event manager, this is not '0', so don't check key events with
the old convention if(event->val) but use if(event->val==KM_PRESS)
2009-07-21 11:03:07 +00:00
Brecht Van Lommel
0865bf2959 2.5: python module name for import had trailing "." 2009-07-21 10:40:13 +00:00
Joshua Leung
6d074526f2 2.5 - Restoring Bone Groups
* Added Bone Groups UI to 'Armature' context buttons for now. Later, it may be more convenient to have these with bones instead?

* Added operators for the operations that can be performed on these groups. Moved the core adding/removing functions to blenkernel so that they can be used elsewhere in future if need be.

* Properly wrapped bone groups in RNA. Copied the way that Vertex Groups are wrapped, since they share some similarities. Setting colours for bone groups still needs more work though.
2009-07-21 10:18:08 +00:00
Campbell Barton
8c9ade81e8 Make linux/scons default to python 3.1 rather then the version scons runs with.
for a while py2.x will work but eventually be dropped when most OS's support it, so Id recommend upgrading.

The following instructions are only needed if you don't use python3.1 installed in the default location.
For releases users wont have to worry about this.


# in python3.1 source dir, build and install into your own dir, /opt/py31 is just an example.
./configure --prefix="/opt/py31"; make; make install

# In the scons user-config.py...
BF_PYTHON = "/opt/py31"

# ... now build ... 
# 
# Blender now needs 2 things to run. ./lib/libpython3.1.so and the python modules.

# Symlink (or copy) python modules, blender sets this path for modules on startup if it is found.
ln -s /opt/py31/lib/python3.1 ~/.blender/python

# Currently static linking is not working without hacks because of limitations in scons.
# for releases we can workaround, but for now its easier to set an environment variable.
# To start blender so it can find libpython3.1.so make this into a shell script to save yourself typing it in all the time.
export LD_LIBRARY_PATH="/opt/py31/lib/"
./blender
2009-07-21 10:13:20 +00:00
William Reynish
5cd5e85143 Cleaned up logic buttons in logic space slightly.
Moved Shade Smooth/Flat from Mesh obdata panel to tools area. These kinds of operator tools aren't really allowed in the buttons window anymore - whole point of new tools area :)
The only operators that are allowed in buttons window are things that act on the RNA fields, like add/remove buttons for adding vertex groups etc.
2009-07-21 09:35:39 +00:00
Campbell Barton
0ebf23c0b8 BLI_setenv, use instead of copying ifdefs about for setting env vars.
set PYTHONHOME as well as PYTHONPATH, quiets some warnings.
2009-07-21 09:26:28 +00:00
Joshua Leung
ca466dc8d8 2.5 - Porting 'Pose' Menu (and its submenus) to Layout Engine
It's alarming how many tools are still missing here!
2009-07-21 05:08:59 +00:00
Joshua Leung
93f2743b0f 2.5 - IK Constraint Tools + Constraint Editing Tweaks
* Add/Remove IK now works again using Shift-I and Ctrl-Alt-I as before. The code for this is now located in editconstraint.c for now...

* Adding constraints with automatically added targets works again. It's a relief that the old code still works (with a minor tweak)
2009-07-21 04:21:07 +00:00
Joshua Leung
74fce51841 2.5 - Constraint (Re)Naming
* Names for newly added constraints are now derived from the type of constraint, making it easier to identify the type of constraint

* Fixed crash when renaming constraints (due to invalid pointer being passed for the 'old' string name)
2009-07-21 02:54:02 +00:00
Brecht Van Lommel
22f421a9ee 2.5: Texture buttons preview now has an option to display the
texture, the material, or both side by side.
2009-07-21 01:57:46 +00:00
Brecht Van Lommel
6dfec894f9 2.5: Lamp button layout improvements by nudelZ. 2009-07-21 01:52:05 +00:00
Brecht Van Lommel
a78ef19054 2.5: UI
* List template visual changes. Items now look different,
  and it expands to size 5 as more items are added.

* Added LISTROW and LISTBOX elements. The former is like
  a typical ROW button, but looks diffrent. The latter
  looks like a BOUNDBOX, and has no extra features yet.
* Fix some glColor3ubv warnings with casting, did not find
  a nicer way.
2009-07-21 01:26:17 +00:00
Brecht Van Lommel
f682de6fd2 RNA
* Added suppport for generating code without verifying with DNA,
  this doesn't give good errors and is more error prone, but makes
  it easier to wrap things like EditBone which are not in DNA.
* RNA_define_verify_sdna(0), and set to 1 again afterwards.
2009-07-21 01:14:55 +00:00
Brecht Van Lommel
1f4fa869e4 2.5: RNA & UI
* Revert lamp sampling/buffers change. The right enum items should
  be defined in RNA, not the layout, so that it works in outliner,
  python api too.
* Also changed type popup to radio buttons again, and removed the
  icons. This is more consistent, and I don't think it's a good idea
  to start using icons for these things, too much clutter.

* Replace Mesh with Normals panel in the mesh buttons.
* Remove Material panel from mesh buttons.
* Added name fields for shape/vgroup/vcol/uv.
* Spacing tweak to Object and Bone names.

* Fix some naming conflicts in RNA, with "name" and "type" properties
  being defined twice in the same struct.

* context.scene.tool_settings -> context.tool_settings.
2009-07-21 00:55:20 +00:00
Brecht Van Lommel
0aebd5f144 2.5: Make shade smooth/flat operators consistent,
and add object mode operators.
2009-07-21 00:36:07 +00:00
Janne Karhu
5fd16476d9 Forgotten file from boids commit. 2009-07-21 00:31:33 +00:00
Brecht Van Lommel
ae10731eb9 2.5: DNA fixes for game engine changes, making it work on 64bit. 2009-07-21 00:30:19 +00:00
Guillermo S. Romero
024cd8c3d8 SVN maintenance. 2009-07-21 00:19:07 +00:00
Janne Karhu
b4353a8443 Initial code for boids v2
Too many new features to list! But here are the biggies:
- Boids can move on air and/or land, or climb a goal object.
- Proper interaction with collision objects.
	* Closest collision object in negative z direction is considered as ground.
	* Other collision objects are obstacles and boids collide with them.
- Boid behavior rules are now added to a dynamic list.
	* Many new rules and many still not implemented.
	* Different rule evaluation modes (fuzzy, random, average).
- Only particle systems defined by per system "boid relations" are considered for simulation of that system.
	* This is in addition to the boids own system of course.
	* Relations define other systems as "neutral", "friend" or "enemy".
- All effectors now effect boid physics, not boid brains.
	* This allows forcing boids somewhere.
	* Exception to this is new "boid" effector, which defines boid predators (positive strength) and goals (negative strength).
	
Known issue:
- Boid health isn't yet stored in pointcache so simulations with "fight" rule are not be read from cache properly.
- Object/Group visualization object's animation is not played in "particle time". This is definately the wanted behavior, but isn't possible with the current state of dupliobject code.

Other new features:
- Particle systems can now be named separately from particle settings.
	* Default name for particle settings is now "ParticleSettings" instead of "PSys"
- Per particle system list of particle effector weights.
	* Enables different effection strengths for particles from different particle systems with without messing around with effector group setting.

Other code changes:
- KDTree now supports range search as it's needed for new boids.
- "Keyed particle targets" renamed as general "particle targets", as they're needed for boids too. (this might break some files saved with new keyed particles)

Bug fixes:
- Object & group visualizations didn't work.
- Interpolating pointcache didn't do rotation.
2009-07-20 23:52:53 +00:00
Dalai Felinto
01b787636b fix for recent stereo changes+tweaks
(it's the 3rd commit in a row. But as they say, the 3rd is always a charm ;)

I still think we have a little mess with the DEFINE parameters in BGE (as in RAS_IRasterizer::StereoMode).
We used to have them duplicated and hardcoded in 2.4xx, but I think we can do it in another way now.

(I didn't change gameplayer, but I can do it once we have it linking and building properly)
2009-07-20 22:36:56 +00:00
William Reynish
a3366cb8f0 UI layouts
Changed order of panels in scene buttons to better follow order of importance, putting the post-processing options further down.

Cleaned up game physics properties
2009-07-20 21:31:32 +00:00
Dalai Felinto
bb0eab7f93 fix from last commit.
I thought """ """ could be used everywhere to make comments in python
2009-07-20 20:42:13 +00:00
Thomas Dinges
c72064272f 2.5 Lamps:
* Replaced RNA ENUM hacks for "shadow method" and "shadow_ray_sampling_method" with modifications in the layout file.
2009-07-20 20:34:14 +00:00
Dalai Felinto
9a9d118bbf BGE panels: wip
Logic Panel:
- world settings (moved from world)
 ... that includes physic engine selection + gravity
- game player (from gamesettings, it wasn't wrapped)
- stereo/dome (from gamesettings, it wasn't wrapped)
 ... separated stereom into stereoflag and stereomode
- properties
 ... (didn't touch it)

Buttons Game Panel:
(wip panel)
- Physics (moved from Logic Panel)
 ... it will be a datablock in the future (right Campbell ?)
- Material Physics (not currently implemented)
 ... a datablock link to the materials of an object + the dynamic physic variables

* NOTE:
in readfile.c::do_version I couldn't do if(scene->world). There is something wrong with scenes with an unlinked world. So so far we are ignoring the old values....
2009-07-20 20:28:29 +00:00
Campbell Barton
1b7f1bc72d mistake in own recent change, errors with startup scripts didnt raise errors 2009-07-20 20:00:59 +00:00
William Reynish
e43c425e8c Ok, first commit! Hope this goes ok.
Added the Turbidity parameter to the Sky panel in lamp buttons, since it affects sky as well as atmosphere.
2009-07-20 17:59:45 +00:00
Thomas Dinges
0b4a6ddf4a 2.5 Notifier:
* Added some missing notifier for 3DView Display settings.
2009-07-20 17:42:40 +00:00
Daniel Genrich
d301d8174c Some little UI adjustments to cloth + fluid panel and their presets 2009-07-20 17:15:41 +00:00
Campbell Barton
587d408f61 patch from William
Cleaned up force fields panel, as well as the other fixes (sculpt, lamps)
2009-07-20 16:39:16 +00:00
Campbell Barton
33bfd7397b BGE Button types panel, can edit existing buttons but not add new ones yet.
World Physics panel too though Im not sure if we'll eventually move this into another struct.
2009-07-20 16:21:55 +00:00
Joshua Leung
cc69f13013 2.5 - Constraints Editing + Keyframe Drawing Tweaks
Constraints:
* Adding constraints with targets should now work. 
-- (When no target is provided, the code to create a new target is not yet in place again yet)
* Constraints can be added in Object and PoseModes again using the Ctrl-Shift-C hotkey. 
* All constraints can now be cleared from the active Object or selected Bones using the Ctrl-Alt-C hotkey.
* Added warnings when adding constraints invalid for the current context, and removed the old add_constraint() function.
* Buttons window updates correctly after adding keyframes now

Keyframes Drawing:
* Removed un-necessary extra function-call for RB-Tree implementation, by inlining a special one-off case.
* Keyframe diamonds which are not within the viewable area are now not drawn (but filtering will still need to find them).
2009-07-20 12:42:31 +00:00
Campbell Barton
8bf9a8cb1e Added error prints if the text's main is not set. 2009-07-20 11:30:27 +00:00
Joshua Leung
ae7e321c8b 2.5 - Fixes to try and let C++ compilers not choke on DNA_anim_types.h 2009-07-20 10:43:41 +00:00