Commit Graph

485 Commits

Author SHA1 Message Date
cc008dbc30 it wrapping font stuff like font file info
.
2005-05-04 21:26:29 +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
9aadcfc2c4 New methods for Image module:
.getPixel( x, y ) returns float list of [r, g, b, a] for pixel
.getMaxXY()  returns image size as float list [x, y]

Contributed by Austin Benesh (mchs3d).  Thanks!

also ran code thru indent.
2005-04-30 19:30:35 +00:00
0094bc92dd - EXPP_addScriptLink called wrong error function (I bet the compiler
warned about this...)
2005-04-24 19:32:04 +00:00
Stephen Swaney
a15fbce1de fix overlooked compiler warning. sheesh.
update contributor names.
2005-04-24 19:27:14 +00:00
Stephen Swaney
626e930c47 New IPO methods.
Ipo.delCurve( curve_name ) deletes named curve from IPO.
Ipocurve.delBezier( int ) deletes point at index from Ipocurve.

Contributed by Ken Hughes (khughes).  Thanks!
2005-04-24 19:03:39 +00:00
43835d4d04 Matched the default value for rkerror limit in bpy 2005-04-22 18:05:56 +00:00
Stephen Swaney
63388ad246 Fix previous fix by moving some code around to try to please everyone.
or at least their compilers.  let me know what breaks.
2005-04-22 16:10:46 +00:00
Stephen Swaney
9fb241c930 fix compiler error with gcc 4.0. mismatched declarations. 2005-04-22 02:27:16 +00:00
Stephen Swaney
b89bddbf6f doc updates. NMesn.transform( matrix, recalc_normals )
had description for recalc_normals backward.
2005-04-22 02:17:20 +00:00
589ce4a005 BPython:
- based on a request by Campbell (he also provided a patch for scene.Layer) access to layers was improved a little, keeping the old method (ob.Layers is a bitmask) and adding the nicer one (ob.layers is a list of ints).  Done for objects and scenes.  House-cleaning: .Layer was renamed to .Layers (actually just using strncmp instead of strcmp, so both work, same done for Window.ViewLayers).
- finally committing patch by Ken Hughes to let .clearScriptLinks() accept a parameter (list of strings) to clear only specified texts.
- doc updates and fixes (JMS reported a problem in nmesh.transform() example code).

Thanks all who contributed.
2005-04-21 19:44:52 +00:00
Stephen Swaney
f919cf75f1 More Curve Module features: access to the attributes flagU and flagV
in a  CurNurb object.
Contributed by Gergely Erdelyi (dyce).
2005-04-17 14:37:40 +00:00
Stephen Swaney
127abda43d New methods for Curve module: getBevOb() and setBevOb()
Adds ability to set, clear and get bevel object for a Curve.
Contributed by Gergely Erdelyi (dyce).
Thanks!
2005-04-17 13:48:16 +00:00
fa5d910f93 Updating build systems: folder release/bpydata/ moved to release/scripts/bpydata/
It seemed trivial enough, so I updated all systems (makefiles, xcode, scons, scons win installer), please complain if something went wrong.  Mostly it was just removing release/bpydata references, since the release/scripts dir is already worked on recursevely, handling dirs inside it.

For the scons nsi file writer script I had to write code for each new dir, but it can be recoded recursively, too (in fact joining all release stuff in a single dir tree with nothing else would be a good idea, making installation code simpler).  Since it's just python and I have a little more time now, I can help scons managers if they still need.

Thanks Campbell Barton for reporting.
2005-04-16 18:25:42 +00:00
56591ade33 The setup functions for SB and PI now initialize the vars to the defaults that are set in the UI when one of the panels are accessed. Current this happens whenever an SB or PI api function is called for the first time. 2005-04-16 15:33:38 +00:00
d65fc84a68 Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!).  It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version.  For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System).  Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago.  For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9

BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode.  Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves.  This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True).  Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
2005-04-16 05:25:42 +00:00
ca9e54b6aa Fixes timecode to run frames 0 to (fps-1) rather than 1 to fps 2005-04-15 13:38:27 +00:00
baa0b8ce25 Similar to last commit, This initializes the pd pointer if it is null for Particle interaction. for all the PI functions 2005-04-14 20:41:02 +00:00
95994e937f This commit initializes the softbody pointer if it is accessed through python and has not yet been set up. 2005-04-14 20:11:10 +00:00
4108a47720 Adds getTimeCode() to Rendering Context so that you can get current frame in HH:MM:SS:FF string format 2005-04-14 18:27:11 +00:00
442f0d1411 Adds API for Particle Interaction Settings and Softbody Settings
Also adds docs for above API.

My testing cases seem to work fine. Please test to make sure I have not
missed anything!

Stivs, I got ascotan's signoff on thses. But please make any adjustments that
you deem needed.

Johnny
2005-04-14 17:56:37 +00:00
78939c0cc0 - It is possible to scale radius of MetaElem again.
- It is possible to change dx, dy and dz params in 3Dview with manipulators
    or with some shortcuts (S-X, S-Y, S-Z).
 - User can scale stiffness when green circle is selected.
 - MetaElem is selected with RMB click at green or red circle, then user can
    grab or rotate with MetaElem as usual.

 - Screenshot:
    http://e-learning.vslib.cz/~hnidek/pics/scale_stiffness.jpg

 - Captured video:
    http://e-learning.vslib.cz/~hnidek/captured-videos/scale_stiffness.avi
2005-04-11 19:31:05 +00:00
0b02d592b8 - work-in-progress: subsurf level 0 now just acts like a regular mesh,
before it would follow subsurf code path by creating fake displistmesh,
   etc... kinda fun for testing but just annoying now.
 - change to creasing behavior, to make sure that with full creasing effect
   is just simple subdivision.
2005-04-04 03:38:21 +00:00
Stephen Swaney
2e9f9e90a6 A little housekeeping:
Object.c - expand evil 1 character name.  nicer error msg.
doc/Object.py - clarify Object.getData() doc
2005-04-02 17:01:56 +00:00
8b3c8698a8 - add include for allqueue prototype 2005-04-02 15:56:16 +00:00
24c9f65056 - got tired of str[n]casecmp not declared warnings
- added BLI_str[n]casecmp, use instead of regular versions
 - rewrote BLI_str[n]casecmp to not be stupid
2005-04-02 15:36:57 +00:00
cbc04194e5 Changing hard codec max frame release for a define (in blendef.h with the other maximums).
Tried to change it everywhere, hopefully I didn't miss any.

Also raised max frame to 30000 (maintainer of that code can safely modify it back since it is in one spot now ;) )
Needed that limit for a marketing video contract, might as well commit it.
2005-03-31 18:49:52 +00:00
e229722d5b - added Mesh->derived and Mesh->decimated DerivedMesh pointers
- removed DL_MESH displist type!!!! Now store a DerivedMesh directly.
 - May still be some issues left having to do with releasing this
   at the right time (old code just splashed free_displist all
   over the place).
2005-03-29 16:43:39 +00:00
0d19ac1d94 - update NMesh.c to use DerivedMesh API 2005-03-27 22:51:48 +00:00
c9c47bd44e Adding some docs for camera insertIpoKey additions 2005-03-27 13:34:59 +00:00
Stephen Swaney
9fc5849812 New Bpy method: Camera.insertIpoKey()
Contributed by Johnny Matthews (guitarGeek)
2005-03-27 13:28:49 +00:00
Stephen Swaney
9465bf6881 Updated Bpy method Object.getData() now supports new Text3d type.
Contributed by Johnny Matthews.
2005-03-26 18:14:29 +00:00
24e52b703e Adding some docs for world and lamp insertIpoKey additions 2005-03-26 18:01:30 +00:00
Stephen Swaney
c9c0e8d50c More Bpy goodness!
New insertIpoKey() methods for Lamp and World types.
Contributed by Johnny Matthews (guitarGeek)
2005-03-26 17:30:21 +00:00
a4b5ddb371 BPython:
-- Stephane Soppera (thanks) reported libc stat function fails for paths ending with "\" under win with free VC++ compiler toolkit 2003:
    removed final '/' (BLI_make_file_string changes the '/' to '\\\\' for win) slashes from relevant paths, that should take care of it .  Note: here (linux, glibc, gcc 3.3.3) stat doesn't have this problem.  Also checking if U.pythondir ends with a slash and, if so (as long as its length > 2 to), removing the slash, for the same reason.
-- small cosmetic changes in BPY_menus.c for debug msgs and in header_scripts (added a separator in the Scripts win -> Scripts menu).
2005-03-22 04:28:36 +00:00
62147bba30 Scripts (making some changes to the scripts dir):
- moved bpydata/ to scripts/bpydata/ and added a config/ subdir to it;
- created scripts/bpymodules for py modules (also got rid of those "mod_"'s appended to the files);
- updated scripts accordingly.

This will require you to "reinstall" (just copy the scripts/ dir over your older one) if you have a .blender/scripts/ dir somewhere.  Otherwise some scripts won't work.  You can use the updated "Help->System->System Information" script here to check all is fine.  An installer script yet to be written will help users with these issues, specially to make the user defined dir have the same structure expected from the default scripts dir, so the basic facilities (module search; saved config data; scripts: installer, help browser, config editor) are also available for a user's own collection of written and downloaded scripts.

BPython:
- slikdigit's crash was because he had no <home or blender exe location>/.blender/:
  proper check added and also now if all else fails the <cvsblender>/release/scripts/ dir is also searched for scripts.  All this registration dirs stuff is a little messy (installation!), so please report any troubles (I only tested on linux).
- slight change in error report in BPY_interface.c's BPY_menu_do_python; remembering to set globaldict pointer to NULL there, too.
- moved bpy_gethome() to EXPP_interface.[ch]
- "//" as user defined python dir is ignored while looking for scripts, considering it's only a default some users use, not really meant for a scripts dir.
2005-03-21 05:26:52 +00:00
03cafb856d Adding some docs for material insertIpoKey additions 2005-03-20 19:52:15 +00:00
Stephen Swaney
7df1facbfa New Material method: insertIpoKey( key_type )
inserts material ipo key at current frame.
contributed by Johnny Matthews.
2005-03-20 18:28:36 +00:00
Stephen Swaney
99bffa9cc0 correct bad reference to getDrawMode. 2005-03-20 12:34:36 +00:00
836d576730 Adding some docs for Object insertIpoKey additions 2005-03-20 03:50:56 +00:00
66b8984cd8 Adding some docs for Text3d additions 2005-03-20 03:42:04 +00:00
Stephen Swaney
0d2179774d New Bpy Object method: insertIpoKey()
inserts Object IPO key for LOC, ROT, SIZE, LOCROT, or LOCROTSIZE
Contributed by Johnny Matthews (guitarGeek)
2005-03-19 23:47:39 +00:00
Stephen Swaney
c0ebb826fa fix warning: initialization makes integer from pointer without a cast 2005-03-19 21:28:40 +00:00
8e92ee8684 - remove all obsolete inclusions of BLI_winstuff.h (due to recent changes)
NOTE: BLI_winstuff.h was meant to be a wrapper around windows.h to handle
undefining various crap that windows.h defines. Platform specific headers
should only have to be included in a few places. This reduces the number
of inclusions of BLI_winstuff.h to 16 which is a much more reasonable
number (than the 144 or whatever it used to be)
2005-03-19 21:08:13 +00:00
b3bb3f06ba Some cleaning up of BLI_winstuff.h usage
- removed reference in render.h (really bad, shouldn't include a platform
   specific header so widely unless really necessary)
 - added M_PI, M_PI_2, M_SQRT, M_SQRT_2 defines to BLI_arithb.h... this is
   a better place as it is more the "standard" blender math header. left
   in winstuff.h as well for the moment for simplicity
 - other changes are patches to code so everything works ok with this
   shuffling.
2005-03-19 20:04:25 +00:00
dd17f7e725 BPython:
- Added Blender.Run(script) + doc update (forgot to mention in my previous commit).

Trying to fix two mistakes from my previous commit:

- nmesh.transform(): forgot yesterday that affine vectors have 4th component = 0, now updated normals transformation accordingly.

- As Ton pointed, recursive parsing of scripts dirs in search of scripts was a mess.  I simply forgot about the "//" trick and much worse, to protect against worst cases ("/", for example). Now the code uses BLI_convertstringcode to take care of "//", doesn't process if dir = "/" and there are limits:

max depth for traversing subdirs = 4
max dirs in the tree = 30.

I'll work more on this, check more, but these changes were tested and should make the code safer, of course, so I'm committing.  Sorry about the mess, I should take lessons on defensive programming ...
2005-03-19 18:23:05 +00:00
0d1738e285 Fix for building on win32 2005-03-19 17:15:25 +00:00
a96ed881dc BPython:
- Scripts:
    fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
    cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
    small updates to help_browser.py script.

 The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place).  Updated Scripts win->Scripts menu so it won't show all available entries, only  the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees.  The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).

- Modules:
    Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
    NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).

- Bugs fixed:
    #2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
    Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text).  Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.

    #1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
    Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
    Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file.  After more testing we can make further updates.  Updated many places to not call redraws if in bg mode, now it is officially available.  Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.

- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
cbbe236f92 - patch submitted by guitargeek
-includes:
*Text3d accessors - ablity to manipulate FONT objects through python
*update to Object.link - calls text_to_curve upon ob_font link for drawing
*update to constant.h - constant type checking define
*update to curve.c - clamp values on getters/setters
*clean up of Text3d module
2005-03-19 03:24:00 +00:00
ab21276aaf fixed example of use the GetScreenInfo
.
2005-03-17 14:41:36 +00:00