Age | Commit message (Collapse) | Author |
|
|
|
- added bpy.sys as a python module - with bpy.sys.expandpath()
- moved bpy.ops into scripts/modules
- moved autocomplete into its own module from space_console.py
|
|
- moved release/io and release/ui into release/scripts/io, ui
- updated scons, cmake, make
When porting 2.4x scripts back, use a command like this so as not to loose the commit history...
svn cp https://svn.blender.org/svnroot/bf-blender/branches/blender2.4/release/scripts/raw_import.py release/scripts/io/import_raw.py
|
|
* copied I/O scripts
* copied, modified rna_*_api.c and rna_*.c
I/O scripts not working yet due to slight BPY differences and RNA changes. Will fix them later.
Not merged changes:
* C unit testing integration, because it is clumsy
* scons cross-compiling, can be merged easily later
|
|
way to test the overhead of the python api (printed to the consoel on exit).
- rename WM_OT_ten_timer to WM_OT_redraw_timer
- added iterations argument to run more then 10 times (10 is default still)
- use report api rather then always calling a popup directly.
- added a new test that draws every region without swapping.
- dont show the info popup when operators are called from python.
- operators called from python now print reports, useful with the interactive console.
eg.
>>> bpy.ops.wm.redraw_timer(type='DRAW_WIN', iterations=300)
Info: 300 x Draw Window: 4168.56 ms, average: 13.8952
|
|
for now set the sys.stdin to None, this gives an error on input() or help() but better then locking up blender.
Would be nice to support for the blender console to be used as a stdin but this isnt so simple.
also quiet some warnings.
|
|
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/Unix_FHS
for scons WITH_BF_FHS enabled an alternative layout eg.
scons WITH_BF_FHS=1 BF_INSTALLDIR="/usr/local"
for CMake just run "make install" after make (CMAKE_INSTALL_PREFIX is used for the base path)
Currently only scripts use both the system and user path correctly, other areas of blender have their own path code inline with lots of ifdefs, needs to be carefully updated.
|
|
solved by wrapping all polling in WM_operator_poll and
adding a special callback for python.
|
|
fix some missing checks in the python interface.
|
|
- was imperfect calculation for points marking shortest distance for non-crossing lines in 3d
|
|
* PROP_NEVER_NULL is now a flag instead of a subtype.
* It works for function parameters too now, so setting
this flag can help avoid NULL checks in the function.
* Renamed LocalLamp to PointLamp, making it consistent
with the UI name.
* Set icons for the different lamp struct types.
|
|
writes all operators (including PyOperators) and their default values into a textblock.
Useful for an overview and checking consistancy.
eg. http://www.pasteall.org/7918/python
added rna functions text.clear() and text.write(str)
|
|
something wrong (`svn status` output: http://www.pasteall.org/7887).
The command: svn merge -r 23130:23129 https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-kazanbas
|
|
- some warnings in last commit.
|
|
array useful to get the defaults for operator & function arrays.
- updated python api to check for array types rather then the length since a variable length array can be 1 or 0 length.
- python docgen added .0 to the end of floats which messed up values like 1e-05
|
|
|
|
a reference to Reports locally allocated in the api functions, which would crash and burn later when the operator would actually stop.
This commit introduces a flag at the Reports level that can be used to indicate that it needs to be freed (on top of the flag already existing in the operator, which I guess could be removed).
Reports for operators called through python are only persisted if they indicate that they are running modal.
|
|
import scripts.
Did a few fixes in scripts to reflect recent RNA changes.
|
|
PYTHONPATH
|
|
AxisAngleToMat3
|
|
Next: update scripts and merge in 2.5.
|
|
|
|
* Disable setting array length of dynamic array for now, this was not
implemented correct, and it's not really needed now.
* Allow all dimensions to be dynamic size, not just the first.
* Change storage of multidimensional to be simpler.
* Rename API functions to be more compact.
* Fix some bugs in the implementation.
* RenderLayer.rect and RenderPass.rect use a multidimensional
dynamic array now.
|
|
|
|
strangely vector.c was skipped in last merge from trunk.
-----------------------------------
Mathutils fix: Vector.reflect
* correct function for reflection and moving it to arithb.c
|
|
MathUtil matrix type follows Blender convention of column
major storage. This means that the elements on one column
are contiguous in memory. Vectors are one dimensional
arrays that can be considered in row or in column but
the Blender convention is column so vector should only
be considered as row. This means that the only logical
multiplication operation between matrix and vector is
matrix * vector.
This convention is respected in all parts of MathUtil
except in matrix/matrix and matrix/vector multiplication
where the row major convention is assumed, which in the
and is equivalent to reversing the order of multiplication.
This is clearly a bug and must be corrected but the side
effect is that it will break all scripts using these
operations. Script writers who care about the correctness
of the matrix operations have already implemented work around:
1) change order of matrix/vector multiplication.
vec2 = vec1 * mat1
This must be changed to the normal order:
vec2 = mat1 * vec1
2) change order of matrix/matrix multiplication
(with matl a local transform in matw reference)
mat3 = matl * matw
This must be changed to the normal order:
mat3 = matw * matl
3) transpose before an after the multiplication
matl.transpose()
matw.transpose()
mat3 = matw * matl
mat3.transpose()
This must be changed to:
mat3 = matw * matl;
|
|
* correct function for reflection and moving it to arithb.c
* note: 2.5 has an already more elegant solution for it (still wrong, but the code is cleaner).
Therefore the merge may need to be manual in that case.
Specifically in 2.5 we are doing:
if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL;
And there we don't need to create a VectorObject *mirrvec; only to get the values.
Code used to test it:
http://www.pasteall.org/7654/python
* YoFrankie script probably needs to be fixed too.
|
|
Multidim. arrays can now be modified at any level, for example:
struc.arrayprop = x
struc.arrayprop[i] = x
struc.arrayprop[i][j] = x
struc.arrayprop[i][j][k] = x
etc...
Approriate rvalue type/length checking is done.
To ensure all works correctly, I wrote automated tests in release/test/rna_array.py.
These tests cover: array/item access, assignment on different levels, tests that proper exceptions are thrown on invalid item access/assignment.
The tests use properties of the RNA Test struct defined in rna_test.c. This struct is only compiled when building with BF_UNIT_TEST=1 scons arg.
Currently unit tests are run manually by loading the script in the Text Editor.
Here's the output I have: http://www.pasteall.org/7644
Things to improve here:
- better exception messages when multidim. array assignment fails. Those we have currently are not very useful for multidim.
- add tests for slice assignment
|
|
too (undefined function, assuming int, etc.)
This compiled fine with scons/msvc and scons/mingw (gcc 4.4.0). Please test and report any problems.
|
|
Was annoying to use a different editor for cmake only.
theeth says this should be ok with gsoc and merges from branches.
|
|
replacements...
MTC_cross3Float -> Crossf
MTC_diff3Float -> VecSubf
MTC_dot3Float -> Inpf
MTC_Mat3CpyMat4 -> Mat3CpyMat4
MTC_Mat3MulVecd -> Mat3MulVecd
MTC_Mat3MulVecfl -> Mat3MulVecfl
MTC_Mat4CpyMat4 -> Mat4CpyMat4
MTC_Mat4Invert -> Mat4Invert
MTC_Mat4Mul3Vecfl -> Mat4Mul3Vecfl
MTC_Mat4MulMat4 -> Mat4MulMat4
MTC_Mat4MulSerie -> Mat4MulSerie
MTC_Mat4MulVec4fl -> Mat4MulVec4fl
MTC_Mat4MulVecfl -> Mat4MulVecfl
MTC_Mat4One -> Mat4One
MTC_Mat4Ortho -> Mat4Ortho
MTC_Mat4SwapMat4 -> Mat4SwapMat4
|
|
* bring back 'player' libtype, after investigation with ideasman.
scons/mingw works nicely, for some reason msvc fails to link still, will look further into it.
|
|
NOTE: this needs changes to stubs.c, but need to check with ideasman_42 how to fix with cmake. Probably linking order issues, but stubs.c currently generates warnings for msvc (redefinition of funcs) and errors for mingw (same redefinitions). Removing the offending lines from stubs.c fixes that.
|
|
* further cleaning of 'player' stuff. Now only 3 libs are remaining, of which ideally the stubs lib will be fixed at some point, fading away into the dark history of not-so-nice code. The current blenderplayer part is still a little bit hackish, I'll see if I can find a better alternative, for now it works good enough.
|
|
* first working changes to get blenderplayer linking
* blenderplayer/ moved into source/ (CMakeLists.txt changed for that too)
* added externs for bprogname to gp_ghost, so that it links properly
|
|
autogenerate packages for nested modules.
bpy.data, bpy.ops.object etc.
- added basic docs for bpy.props
- omit panel, menu and operator classes (took up too much space and not useful)
- exec cant be used as an operator suffix eg- CONSOLE_OT_exec --> CONSOLE_OT_execute (same for file)
- fixed some crashes when generating docs
Updated docs here
http://www.graphicall.org/ftp/ideasman42/html/
|
|
(requested by algorith)
example. bpy.ops.tfm.rotate('INVOKE_REGION_WIN', pivot=(0,1,2), ......)
bpy_array.c - was too strict with types, 0 should be allowed as well as 0.0 in a float array.
|
|
|
|
for PyRNA and KX_PySequence types.
mesh1 > mesh2 # will raise an error.
|
|
|
|
python modules on load.
BLI_exist vs BLI_exists (fun times were had by all)
|
|
python.
- Incorrect Mathutils vector docstrings.
- last rayshade commit had an incomplete comment.
|
|
getValue() rather than setValue()
- added GPL header to bpy_interface.c from 2.4x's BPY_interface.c
- warning fixes
|
|
Example code: http://www.pasteall.org/7332/c.
New API functions: http://www.pasteall.org/7330/c.
Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed.
What this means for ID property access:
* MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4
* MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4
* Object.matrix - 2-dimensional array
What this means for functions:
* more intuitive API possibility, for example:
Mesh.add_vertices([(x, y, z), (x, y, z), ...])
Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...])
Python part is not complete yet, e.g. it is possible to:
MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa
MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad
but the following won't work:
MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3]
|
|
from Alberto Santos (dnakhain)
This also adds the option to duplicate a particle system with an object.
--- description from the patch submission.
This patch includes my latest additions to the Python API developed for my Degree's Project.
It includes:
- Particle
- Vertex group dictionary in doc (to use with setvertexgroup/getvertexgroup)
- Particle.New return psys (not specified in doc)
- Draw As variable and dict
- Strand render toggle
- Object
- psys variable in duplicate
- Material
- Strand render variables
- Texture
- Use colorbands
- Lamp
- Spot buffer type selection
|
|
a __props__ list in the class, same as for operators.
|
|
__rna__ overrides the subtypes.
For now have pyrna_struct_as_srna look in the dict first for __rna__ before using PyDict_GetItemString.
Somehow __rna__ is not calling the pyrna_struct_getattro function, python find it first.
The only relyable way to get the rna from python currently is.
bpy.types.SomeType.__dict__['__rna__']
|
|
|
|
|
|
possible from python, but it's still work in progress.
Pointers and collections are restricted to types derived from
IDPropertyGroup (same as for operators), because RNA knows how to
allocate/deallocate those.
Collections have .add() and .remove(number) functions that can be
used. The remove function should be fixed to take an other argument
than a number.
With the IDPropertyGroup restriction, pointers are more like nested
structs. They don't have add(), remove() yet, not sure where to put
them. Currently the pointer / nested struct is automatically allocated
in the get() function, this needs to be fixed, rule is that RNA get()
will not change any data for thread safety.
Also, it is only possible to add properties to structs after they have
been registered, which needs to be improved as well.
Example code:
http://www.pasteall.org/7201/python
|