Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-12-26fixes for errors/warnings found with cppcheckCampbell Barton
2009-12-08compile python driver expressions for faster re-evaluation.Campbell Barton
approx 15-25x speedup
2009-11-20option to have scripts run on startup for per blendfile UI'sCampbell Barton
2009-11-13changes python initializationCampbell Barton
- bpy is now a python package, this makes it easier to add utility modules and adjust python startup which was previously using verbose Py/C api. Access should not be any slower since both C and Python modules use dictionary access. - loop over scripts and load via python (currently F8 reload isnt working, will add back shortly) - the C module is kept but renamed to _bpy and not meant for direct access from anything but the bpy package. - bpy_types.py is an exception since it runs before the bpy package is initialized.
2009-11-10Function declaration for BPY_context_getMartin Poirier
2009-08-10adding back button evaluation so you can do 1/60, 90*0.1 etc as well as ↵Campbell Barton
dimension conversion 1km-10cm+4ft Note... - Python3.1 you don't need to add the .0 for divisions anymore (was esp annoying for button eval) - Simple dimension input, imperial mi/yd/ft/in, metric km/m/cm/mm, Later could display these values and have a pref for scene scale, atm it assumes 1BU == 1m.
2009-07-22remove scriptlinks,Campbell Barton
they were not working and we have plans for better script integration in 2.5
2009-07-092.5Ton Roosendaal
Monthly cleaning round to make it compile warning free. Mostly it was const stuff (strings, Context), but also a couple useful fixes, like wrong use of temp pointers. Only Mathutils callback struct I left alone... design issue.
2009-06-23SVN maintenance.Guillermo S. Romero
2009-06-222.5: warning fixesBrecht Van Lommel
Mostly harmless ones, except for one about "gzopen64" being undeclared. This needs some defines in BLI_storage.h to be set before <unistd.h> is included. Might fix a crash in compressed file reading, though I'm not sure since it's hard to repeat the crash consistently.
2009-06-14Blender/Python APICampbell Barton
Send the full python stack trace to the reporting api, added BPY_exception_buffer which temporarily overrides sys.stdout and sys.stderr to get the output (uses the io module in py3 StringIO in py2 to avoid writing into a real file), pity the Py/C api has no function to do this. fix for crash when showing menu's that have no items.
2009-04-23F8Key reloads all python scripts and redraws for quick testingCampbell Barton
F7 runs test.py also for testing
2009-04-20Drivers: "Scripted Expression" drivers (i.e. PyDrivers) work againJoshua Leung
Now it is possible to write a Python Expression using the variable names for driver targets (see mockup from initial commit) to substitute the appropriate values into the expression. In the __global__ namespace for PyDriver evaluation, the following modules are available: * __builtins__ - i.e. the builtin Python functions * bpy - new Python API * math or m - math module For example: Consider a driver with three targets, named: A, B, C Now, you could write an expression like: C if A < 5 else B or even: 2*C if A < 5 or A > 20 else m.PI*B Of course, you don't have to have three targets, the above was just an example. TODO: * Bring back way to load pydrivers.py * Blender.Noise equivalent would be nice to have P.S. I hope I haven't made any terrible Python API coding errors here (i.e. mem leaks, etc.)
2009-04-11Added back importing UI scripts rather then running,Campbell Barton
The bug was todo with bpy.data and bpy.types becoming invalid, temporary fix is to re-assign them to the bpy module before running python operators or panels. will look into a nicer way to get this working.
2009-04-11undo previous commit, changing running the script to importing it somehow ↵Campbell Barton
made it crash when running the class functions. will look into this further.
2009-04-11Changed the script UI registration to import rather then run each python script,Campbell Barton
this means it caches the compiled pyc files after importing fro the first time. My times for importing 501 buttons_objects.py files were. - running each as a script 1.9sec - importing for the first time 1.8sec - importing a second time (using pyc files) 0.57sec Also added "bpy" to sys.modules so it can be imported.
2009-04-11UI:Brecht Van Lommel
* Added very basic loading of .py files on startup to define panels. It now executes all .py files in .blender/ui on startup. Right now this contains the object buttons, the C code for it is commented out. These files should get embedded in the blender executable as well eventually, that's a bit more complicated so this works for now. * For scons and cmake it seems to copy & find the files OK, for make only "make release" works (same with scripts/ folder it seems). * Added BLI_gethome_folder function in BLI_util.h. This is adapted from bpy_gethome, and gives the path to a folder in .blender like scripts or ui. There's plenty of things to figure out here about paths, embedding, caching, user configs ...
2009-04-01Python Panels WIPCampbell Barton
- Register python panels - Added a generic class checking function BPY_class_validate() for panels/operators. - No button drawing yet Brecht, Added RNA_enum_value_from_id() and RNA_enum_id_from_value() to rna_access.c to do lookups between identifiers and values of EnumPropertyItem's, Not sure if these should go here.
2009-03-04run script in the text editor is back. UI scripts dont work yet.Campbell Barton
2009-02-28Python experimental UI APICampbell Barton
Can draw panels in the scripts space containing RNA and operator buttons. * Added bpyui.register() so scripts can draw buttons and panels into the scripts space type. * wrapped drawBlock, drawPanels and matchPanelsView2d * Operator buttons take a python dictionary used to set the button defaults. * BPY_getFileAndNum utility function to get the filename and line number python is currently running.
2009-02-162.5Joshua Leung
Added RNA wrapping for F-Curve colour settings
2008-12-212.5 - Compiling 'hacks' for pyJoshua Leung
* Unicode calls in bpy_idprop.c were causing linking errors here. Probably Py-libs for windows would need recompiling with unicode before we can enable this. For now, commented out the offending calls.
2008-12-21wip operator py-apiCampbell Barton
"operator.ED_VIEW3D_OT_viewhome(center=1)" calls the operator, converting keyword args to properties. Need a way to run scripts in the UI for useful testing. Still need to deal with operator exceptions and verifying args against operator options. Added temporary WM_operatortype_first() to allow python to return a list if available operators, can replace this with something better later (operator iterator?)
2008-11-13Merge of trunk into blender 2.5:Brecht Van Lommel
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416 Issues: * GHOST/X11 had conflicting changes. Some code was added in 2.5, which was later added in trunk also, but reverted partially, specifically revision 16683. I have left out this reversion in the 2.5 branch since I think it is needed there. http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683 * Scons had various conflicting changes, I decided to go with trunk version for everything except priorities and some library renaming. * In creator.c, there were various fixes and fixes for fixes related to the -w -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done differently. Since this is changed so much, and I don't think those fixes would be needed in 2.5, I've left them out. * Also in creator.c: there was code for a python bugfix where the screen was not initialized when running with -P. The code that initializes the screen there I had to disable, that can't work in 2.5 anymore but left it commented as a reminder. Further I had to disable some new function calls. using src/ and python/, as was done already in this branch, disabled function calls: * bpath.c: error reporting * BME_conversions.c: editmesh conversion functions. * SHD_dynamic: disabled almost completely, there is no python/. * KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled. * text.c: clipboard copy call. * object.c: OB_SUPPORT_MATERIAL. * DerivedMesh.c and subsurf_ccg, stipple_quarttone. Still to be done: * Go over files and functions that were moved to a different location but could still use changes that were done in trunk.
2008-09-19== Python Space Handlers ==Willian Padovani Germano
Patch #9673: "Short patch to make spacehandler event scripts work more like normal python gui script handlers" by Steven Truppe: http://projects.blender.org/tracker/?func=detail&atid=127&aid=9673&group_id=9 This patch adds the Blender.eventValue variable available for space handlers, holding the event value (aka 1 for button and key presses, X or Y coordinate for mousex / mousey movement). Thanks, Steven. PS: this doesn't break existing scripts.
2008-09-19== Python Script Links ==Willian Padovani Germano
Bug #17599: Summary: Python constraints, good in 2.46 not working anymore in 2.47 http://projects.blender.org/tracker/?func=detail&atid=125&aid=17599&group_id=9 Improved my old hack to avoid frame changed scriptlinks from running when rendering stills, should fix this bug. It also causes REDRAW scriptlinks to be executed during renders, but that conforms to how FRAMECHANGED ones work. BTW: this can still be improved. The current system meant to disable all Python functionality at once needs imo to be replaced by one that allows to enable / disable per feature (scriptlinks, pyconstraints, pynodes, etc.). A better way to inform scriptlinks about what is going on (render, anim, render anim, etc.) would also help. Will discuss with others.
2008-09-15added BLI_convertstringcwd, used so command line blendfiles and python ↵Campbell Barton
scripts can be relative to the current path. - was alredy doing this for blendfiles, but better to have in its own function. header_text.c - renamed PATH_MAX, was defined by system includes.
2008-08-12Rolled back on rev. 16039. Had problems with display, messages being blank ↵Ian Thompson
and scripts not being recompiled in some cases. Needs more thought before committing.
2008-08-09Python errors originating in the active text are now displayed at the top of ↵Ian Thompson
the text area. Errors in other files/scripts still pop up a message as before and all errors are still printed to the console. This removes the need to switch to the console for local errors.
2008-07-15Created a BPy module BPyTextPlugin to centralize functions used across the ↵Ian Thompson
text plugin scripts. Also created two more scripts to handle imports and member suggestions.
2008-07-15Any script can now register a unique key combination as part of its bpy ↵Ian Thompson
header. For a supported space type, the user may press this shortcut to invoke the script. Space types that are to support shortcuts like this should call BPY_menu_do_shortcut(...) from the event queue read method (See winqreadtextspace in drawtext.c for example)
2008-04-23added ipo script template from blenderartists forTe, made scripts refresh on ↵Campbell Barton
load factory settings and replaced elysiun with blenderartist.org in headers
2008-04-17Patch from GSR that a) fixes a whole bunch of GPL/BL licenseChris Want
blocks that were previously missed; and b) greatly increase my ohloh stats!
2008-03-15fix for [#8559] Python script that uses FIleSelector and has an error in it ↵Campbell Barton
segfaults Blender
2008-03-07Made python scripts save and load in the blend file so you can have the same ↵Campbell Barton
scripts running when you open a blend file. Also scripts will re-run on undo rather then closing. This is done by saving and loading the name of the script or textblock of the 'Script' datablock, connected to the ScriptSpace. This way when there is a name but the script dosnt run. Blender runs the script or text block if available.
2008-02-24Patch #8344:Joshua Leung
Submitted by: Thomas Knight (epat) Parts committed: 1) Fixed a few misspellings in some error strings. 2) Fixed a (theoretical) bug with pyconstraints where a text object could be deleted from python but would remain linked to the constraint it was assigned to - causing slight UI usage discontinuities! Not committed yet: 3) Particle system bugfix in this patch has not been committed. Could jahka or brecht check this.
2008-02-20Python Bugfix,Campbell Barton
Setting the user preference for python scripts didnt add the bpymodules subdirectory to sys.path (python module search path). Also problems with entering and exiting- the old path was used until next restart.
2008-02-13Added a global string to be used for the tempdir. since the user preference ↵Campbell Barton
is not loaded in background mode and the user preference is not validated and has no fallback. 'btempdir' is set with BLI_where_is_temp() - This tries to use U.tempdir but falls back to $TEMP or /tmp/
2008-01-07Patch to change license to GPL only, from GSR.Chris Want
2008-01-07Whole lot of changes.... here a shortlist:Ton Roosendaal
- removed editors/area and put this all in screen - added first python calls (note, a new c file for scriptlinks) - added view3d editor callbacks (no drawing yet) - added files in editors/interface (Cmake and Scons has to be fixed, help welcome!) - now areas/headers are being converted on file read - note: previously saved 2.50 files will crash!!! (.B.blend) - area regions are being drawn, first handler for cursor added (on edge) - window duplicate and scale works correct for screen subdiv Todos for me: - need to fix things in syntax (function names) a bit still - more operators for screen - define how Context will work... still unresolved when it gets set - docs! Reviews of code structure is welcome! There are also more todos now for others, but it can wait a couple of days
2007-12-24Part 4 of the event refactor branch: all changes in existing files,Ton Roosendaal
Makefiles especially, and of course the windowmanager DNA!
2007-12-24Step 3 for the initial commits for 2.5: removing src/ and python,Ton Roosendaal
adding new windowmanager module, and the first bits of new editors module.
2007-10-22== Constraints System - Recode 2 ==Joshua Leung
Once again, I've recoded the constraints system. This time, the goals were: * To make it more future-proof by 'modernising' the coding style. The long functions filled with switch statements, have given way to function-pointers with smaller functions for specific purposes. * To make it support constraints which use multiple targets more readily that it did. In the past, it was assumed that constraints could only have at most one target. As a result, a lot of code has been shuffled around, and modified. Also, the subversion number has been bumped up. Known issues: * PyConstraints, which were the main motivation for supporting multiple-targets, are currently broken. There are some bimport() error that keeps causing problems. I've also temporarily removed the doDriver support, although it may return in another form soon. * Constraints BPy-API is currently has a few features which currently don't work yet * Outliner currently only displays the names of the constraints instead of the fancy subtarget/target/constraint-name display it used to do. What gets displayed here needs further investigation, as the old way was certainly not that great (and is not compatible with the new system too)
2007-08-18== PyConstraints ==Joshua Leung
I've added the ability for PyConstraints to define a function (doDriver) that is able to directly modify values of the owner/target, so that certain setups can be created reliably. Users should take note that this is against the basic concept of what a constraint does, and that under no circumstances may they set the values of any variables controlling the transforms. For more details, check out the information in the PyConstraint template script. I've also updated PyConstraints to be aware of geometry targets. The script template has been updated with this information.
2007-07-27=Draw Module Fixed=Joseph Eagar
This commit fixes the Draw module. All buttons/widgets created via the Draw module in a SpaceScript area are now inserted into a global list attached to the SpaceScript data. This list is cleared before each draw, when freeing the space, and when the area is switched to another space.c This is necessary to prevent Blender's internal UI code from getting invalid pointers to python data. In addition, it allows storing widget tooltips inside the python Button objects, which solves that little bit of stupidity. Note that this reverts the previous weaklist solution. In fact, I had to go over each previous commit by Campbell after this code originally branched before the weaklist commit and re-add each commit. So if anything is missing, just tell me, or feel free to re-add it.
2007-07-15== Constraints System ==Joshua Leung
After just over a week of coding, I've finished doing a major refactor/cleanup of the constraints code. In the process, quite a few old kludges and ugly hacks have been removed. Also, some new features which will greatly benefit riggers have been implemented. === What's New === * The long-awaited ``ChildOf Constraint'': This allows you to animate parent influences, and choose which transformation channels the parent affects the child on (i.e. no translation/rotation/scaling). It should be noted that disabling some combinations may not totally work as expected. Also, the 'Set Inverse' and 'Clear Inverse' buttons at the bottom of this constraint's panel set/clear the inverse correction for the parent's effects. Use these to make the owner not stick/be glued to the parent. * Constraint/Target Evaluation Spaces: In some constraints, there are now 1-2 combo boxes at the bottom of their panel, which allows you to pick which `co-ordinate space' they are evaluated in. This is much more flexible than the old 'local' options for bones only were. * Action Constraint - Loc/Rot/Size Inputs The Action Constraint can finally use the target's location/rotation/scaling transforms as input, to control the owner of the constraint. This should work much more reliably than it used to. The target evaluation should now also be more accurate due to the new space conversion stuff. * Transform - No longer in Crazy Space (TM) Transforming objects/bones with constraints applied should no longer occur in Crazy Space. They are now correctly inverse-corrected. This also applies to old-style object tracking. === General Code Changes === * solve_constraints is now in constraints.c. I've removed the old `blend consecutive constraints of same type' junk, which made the code more complex than it needed to be. * evaluate_constraint is now only passed the constraint, and two matrices. A few unused variables have been removed from here. * A tempolary struct, bConstraintOb, is now passed to solve_constraints instead of relying on an ugly, static workobject in some cases. This works much better. * Made the formatting of constraint code consistent * There's a version patch for older files so that constraint settings are correctly converted to the new system. This is currently done for MajorVersion <= 244, and SubVersion < 3. I've bumped up the subversion to 3 for this purpose. However, with the imminent 2.45 release, this may need to be adjusted accordingly. * LocEulSizeToMat4 and LocQuatSizeToMat4 now work in the order Size, Rot, Location. I've also added a few other math functions. * Mat4BlendMat4 is now in arithb. I've modified it's method slightly, to use other arithb functions, instead of its crazy blending scheme. * Moved some of the RigidBodyJoint constraint's code out of blenkernel, and into src. It shouldn't be setting its target in its data initialisation function based + accessing scene stuff where it was doing so. === Future Work === * Geometry to act as targets for constraints. A space has been reserved for this already. * Tidy up UI buttons of constraints
2007-06-18== PyConstraints ==Joshua Leung
At last! The ability to code constraints in Python. This opens up many interesting rigging possibilities, as well as making prototyping constraints easier. * A PyConstraint script must begin with the line #BPYCONSTRAINT * It must also define a doConstraint function, which performs the core actions of the constraint. * PyConstraints use IDProperties to store custom properties for each PyConstraint instance. The scripter can choose which of these ID-Properties to expose to a user to control the behaviour of the constraint. This must be done using the Draw.PupBlock method. Credits to Joe Eager (joeedh) for coding the original patch on which this is based. I've made heavy revisions to large parts of the patch. For more detailed information, and some demo scripts, see the following page: http://aligorith.googlepages.com/pyconstraints2
2006-06-12== Python Button Evaluation ==Martin Poirier
Users can write any valid Python expression (that evals to an int or float) inside Blender's gui number buttons (preceded by #) and have them evaluated to their actual int or float value. Button Evaluation has access to the same modules as PyDrivers. For example: #1.0*9-2.3 #ob("Camera").LocZ #1.0/ob("Cube").LocX #math.sin(math.pi) -- or simply #m.sin(m.pi) etc
2006-05-01Small update for pydrivers: force reloading the pydrivers.py BlenderWillian Padovani Germano
text module when user edits the input text box of any pydriver (Transform Properties panel, Ipo window). It's enough to click in and out of a single pydriver's text input box for the module reloading and also re-evaluation of all pydrivers available. Maybe this "refreshing" should also be available from a menu, let's see. Note for Python fans: Definitions and redefinitions in a reloaded module are properly handled in Python, but previously defined data in the module doesn't disappear. So if you define a function "f" inside a module, import it, then change the function's name to "g" and reload the module, both "f" and "g" will be available. This is considered a feature, check reload's documentation: http://docs.python.org/lib/built-in-funcs.html#l2h-59
2006-04-30Pydrivers: Ipo Drivers controlled by Python expressionsWillian Padovani Germano
wiki with info: http://mediawiki.blender.org/index.php/BlenderDev/PyDrivers (there are two sample .blends in the patch tracker entry, last link in the wiki page) Notes: In usiblender.c I just made Python exit before the main library gets freed. I found a situation with pydrivers where py's gc tried to del objects on exit and their ID's were not valid anymore (so sigsegv). Ton needs to check the depsgraph part. For now pydrivers can reference their own object, something normal ipodrivers can't. This seems to work fine and is quite useful, but if tests prove the restriction is necessary, we just need to uncomment a piece of code in EXPP_interface.c, marked with "XXX". Thanks Ton for the ipodrivers code and adding the hooks for the py part and Martin for the "Button Python Evaluation" patch from which I started this one. Anyone interested, please check the wiki, the .blends (they have README's) and tell me about any issue.