Compare commits

..

128 Commits

Author SHA1 Message Date
69f990ad7e Disabled data access in particle RNA.
Only the general attribute descriptions and state instance can be
accessed from plain bpy now. For detailed data read/write the bparticles
module has to be used.

This was forced by a change to collection iterators, which essentially
makes them unsuitable for anything other than ListBase and arrays
(state attributes and particle data in this case). It may be possible
to reeanble this later, but generally bparticles is the better approach.
2014-07-14 15:00:55 +02:00
911fe9dfa2 Fixed a few small merge errors. Sorted libs are now defined in
macros.cmake.
2014-07-14 14:59:17 +02:00
55cf7703fd Merge branch 'master' into particles_refactor
Conflicts:
	source/blender/blenkernel/intern/object.c
	source/blender/blenkernel/intern/rigidbody.c
	source/blender/blenloader/intern/writefile.c
	source/blender/python/intern/bpy_interface.c
	source/creator/CMakeLists.txt
2014-07-14 14:23:50 +02:00
f5abbee52a Fix for variable declaration after code (invalid C). 2014-04-24 12:41:23 +02:00
01a2253dfd Fix for dupli type bit flags exceeding short range.
The nparticle dupli flag was using 1<<15, which gives issues with signed
short variables. Fortunately there are unused bits in the
Object.transflag, now reuse the deprecated OB_POWERTRACK flag for this.

Also replaced dupli context int type with short to avoid errors with
strict compiler flags.
2014-04-22 15:52:13 +02:00
4684f2c70d Added missing support for quaternion attributes in the bparticles API. 2014-04-22 11:28:32 +02:00
5a6eccfe43 Replaced the RBO_GET_MASS and RBO_GET_MARGIN macros with proper
functions.

There is really no reason to use macros for this sort of thing.
2014-04-22 11:28:31 +02:00
79fc66872a Moved build/apply functions for constraints into rigidbody_objects too.
This is only about object-based constraints. Bullet constraints can be
added for other future use cases too outside the objects code.
2014-04-22 11:28:31 +02:00
b7d3160133 Moved functions for object component data management (RigidBodyObject
and RigidBodyCon) into rigidbody_objects.c as well.
2014-04-22 11:28:31 +02:00
da8b4f9112 Moved transform utility functions for objects into the rigidbody_objects
source file.

Renamed them a bit to make clear these are for objects only.
2014-04-22 11:28:31 +02:00
e2d7123674 Separation of concerns: Moved functions for building object rigid bodies
and applying Bullet results to them into a dedicated file.

The same should happen for particles, shapes, constraints etc. later.

The purpose of this is to keep the main Bullet world API limited to
dealing with Bullet primarily and avoid fixating it on Object DNA data.
2014-04-22 11:27:48 +02:00
843efe48ab A couple of small fixes for merge issues. 2014-04-22 11:23:50 +02:00
bb3cf1ded0 Use instanced object collision shapes for particles instead of plain
spheres. The "collision_shape" attribute is no longer needed, the shapes
can be retrieved from the instanced objects instead (which must be RBs
themselves).
2014-04-22 11:23:50 +02:00
137fa8a40b Sensible default value support for particle attributes. Some data types
(normal, color, quaternion, matrix) get common default values, others
are just 0 and have to be defined by the user if necessary.
2014-04-22 11:23:50 +02:00
547f42156e Added default rotation attribute. 2014-04-22 11:23:50 +02:00
54fe3f0285 Basic dupli display for particles.
Conflicts:
	source/blender/blenkernel/intern/anim.c
2014-04-22 11:23:50 +02:00
6821bec4eb Fixed read/write code for particle display dupli lists and added a
modifier object walk callback (also used in readfile for generic
modifier lib_link).
2014-04-22 11:23:50 +02:00
fd5b195ea7 Free dupli object lists correctly when freeing display structs. 2014-04-22 11:23:50 +02:00
3113007682 Boilerplate RNA for the particle display settings. 2014-04-22 11:23:50 +02:00
6529e53f40 Add a dupli display method by default. 2014-04-22 11:23:50 +02:00
d82c6ce507 Single display 'add' function, is easier to provide as API method. 2014-04-22 11:23:49 +02:00
0211fc88f9 Automatically set the object transflag for nparticle duplis, like
current particles (but actual code is in nparticle to stay out of object
code as much as possible).
2014-04-22 11:23:49 +02:00
5235a9ea75 Moved the particle display list from the modifier into the psys itself.
This makes the modifier more easily replaceable later on and allows
more detailed management of the particle object settings (in particular
dupli flags).
2014-04-22 11:23:49 +02:00
e93e2abae6 Particle display type for duplis. 2014-04-22 11:23:49 +02:00
13876fafbc Removed old unused nparticle modifier code. 2014-04-22 11:23:49 +02:00
7253c6752b Only call the 'validate' function for particles once, to prevent them
from being removed and added back to the world continuously, which
resets the motion state each time. Also set the USED flag outside of
validate since this is not executed every step and would otherwise
delete all existing particles.
2014-04-22 11:23:48 +02:00
772b08b8aa Added new bparticles function for copying the current particle state
instead of just creating a new empty state. Also clear the py_handle
when copying the state, otherwise the PyObject is invalid.
2014-04-22 11:23:48 +02:00
d4af9c8e6a Set some usable default values for a number of particle rigid body
settings.
2014-04-22 11:23:48 +02:00
3ae43a2ce2 Some missing stddef.h includes for NULL. 2014-04-22 11:23:47 +02:00
1edcfc363e Very basic sync method for particles, which copies the state and
updates the particle positions from rigid bodies.
2014-04-22 11:23:47 +02:00
f077d9f57c Fix for rigid body removal methods: Flag new rigid bodies for particles
as used to prevent freeing. Also remove bodies if they already exist,
to prevent double adding and subsequent assert failure.

Conflicts:
	source/blender/blenkernel/intern/rigidbody.c
2014-04-22 11:23:47 +02:00
839149ea90 Fix for RigidBodyWorld reading: initialize empty body mempool when
reading blend files, this is not actually stored.
2014-04-22 11:23:47 +02:00
6a3705690f Removed rigidbody build/apply functions from NParticle API. It's better
to keep this functionality inside RigidBody blenkernel for now.
2014-04-22 11:23:47 +02:00
7c666d168f Cleanup: Separate function for details of the object 'apply' method. 2014-04-22 11:23:47 +02:00
667728788d Added inline comment about possible memory management optimization. 2014-04-22 11:23:47 +02:00
2e9c9415eb Cleanup: Separated object and constraint build loops into own functions.
Renamed some more API methods to follow the new naming scheme.

Conflicts:
	source/blender/blenkernel/intern/rigidbody.c
2014-04-22 11:23:47 +02:00
2fbb7a7937 Cleanup: Renamed a number of internal rigidbody functions to clarify
the procedure:

  world_build:  create rbRigidBody instances for stuff in Scene
  validate_*:   ensure a rbRigidBody exists for an Object/particle/etc.
  sync_*:       define Bullet settings for an Object/particle/etc. based
                on Blender Scene data
  world_apply:  copy back data from Bullet after a step to the Blender
                Scene data

Conflicts:
	source/blender/blenkernel/intern/rigidbody.c
2014-04-22 11:23:47 +02:00
6cf17ddc48 Fix potential issue from early exit when no constraints exist. 2014-04-22 11:23:47 +02:00
93da0edf0c Particle validate function for adding particle rigid bodies. 2014-04-22 11:23:46 +02:00
dc60ec7505 Removed unused variables. 2014-04-22 11:23:46 +02:00
4472309bdd Added collision shape pointer attribute for particles. This will change
soon, for now is the easiest way to keep track of things.
2014-04-22 11:23:46 +02:00
f948f57a98 Pointer attribute get/set functions for particles. 2014-04-22 11:23:46 +02:00
0480a26d37 Use the rigidbody_world_free_bodies function for freeing bodies when
destroying the world, instead of looping over the object group. This is
in line with the memory ownership being at the RigidBodyWorld now
instead of the individual Objects and will ensure all RBs get destroyed
properly when using particles etc. later.
2014-04-22 11:23:46 +02:00
a5f193fe51 Basic mempool usage for creating and removing rbRigidBody instances.
This uses flags to indicate used rbRigidBodies and then loops over the
mempool to remove orphaned bodies. The same should eventually be done
for shapes and constraints.
2014-04-22 11:23:46 +02:00
1d6638d077 Shortcut variable for rbRigidBody, avoids repetitive rbo->physics_object
access.
2014-04-22 11:23:46 +02:00
dc4dd96db2 Generic flags for rbRigidBody. These can be used by the blenkernel API
to tag used rigid bodies and automatically remove unused bodies.
2014-04-22 11:23:46 +02:00
ddf86fb42c Use the mempool in RigidBodyWorld instead of allocating memory inside
the Bullet CAPI.

NOTE: this is broken atm because to free an Object's rigid body data
the RBW needs to be passed along, which would require a Scene argument
in the blenkernel function. This will get fixed by moving ownership of
the rigid body away from object and into the RBW memory management sync
procedure.

Conflicts:
	intern/rigidbody/RBI_api.h
2014-04-22 11:23:46 +02:00
c56fb3d108 Make the btRigidBody a direct component of the rbRigidBody wrapper
struct. This avoids one pointer indirection and makes future memory
management possible. Requires a constructur/destructor pair to
initialize the 'body' member correctly.
2014-04-22 11:23:46 +02:00
e93309556b Added a mempool to RigidBodyWorld as a memory manager for bodies.
Conflicts:
	intern/rigidbody/rb_bullet_api.cpp
2014-04-22 11:23:46 +02:00
39ce10c2f5 Added a new attribute type 'POINTER', for storing rigid body pointers.
This may not be the best way to map rigid bodies to particles,
eventually a nicer way could be to make use of the userpointer in Bullet
btRigidBody and store a weak reference to Blender types there instead.
Storing rigid body pointers in the particles just mimicks the way the
Object RBs work atm.

The pointer attribute gets a flag 'TEMPORARY' to prevent it from being
stored in the cache and .blend files, since it's only valid during the
Bullet stepping anyway.
2014-04-22 11:23:45 +02:00
b6ff000ec2 Stub functions for creating and updating rigid bodies from particle
systems in the RigidBodyWorld steps.
2014-04-22 11:23:45 +02:00
7f8997783f Cleanup: Removed old unused code from multi-layer paged buffers. 2014-04-22 11:23:45 +02:00
335ff9331a Include the standard type attributes in the dir function for particles. 2014-04-22 11:23:45 +02:00
3887c0f2f1 Fix for particle getattro: Throw an exception if iterator is not valid,
otherwise expect to find a correct void *data (assert is used to as a
sanity check, should never fail).
2014-04-22 11:23:45 +02:00
30d3fae8b7 Added a __dir__ method for particles to return the list of available
attributes.
2014-04-22 11:23:45 +02:00
10d17ae2b1 bpy particle objects are still valid if the particle id does not yet
exist. This allows a create-on-write feature, where a particle is
automatically added to the state if the pid does not yet exist.
2014-04-22 11:23:45 +02:00
97011304e4 New API function for replacing the current particle system's state. ATM
this creates a full copy of the given state, so the reference can be
used further. This may need some more thought.
2014-04-22 11:23:45 +02:00
1c84174ae9 Add particle sequence as a state attribute in the API. 2014-04-22 11:23:45 +02:00
2a4b80101b Fix for particle iterator validity check: also check for negative index,
this is used for indicating an invalid particle iterator.
2014-04-22 11:23:44 +02:00
89c74dfcf1 Custom get/set methods for the "Particle" type. This supports particle
attributes directly as python properties in the particle wrapper type.
If a particle identifier has no corresponding data in the state yet it
will be automatically created when writing.
2014-04-22 11:23:44 +02:00
1275e68c0e Store the particle ID alongside the particle iterator in the python
particle wrapper type, so it can be used to automatically create missing
particles later on.
2014-04-22 11:23:44 +02:00
3033fdd502 Added particles sequence in state bpy api. 2014-04-22 11:23:44 +02:00
6b4719e1e0 Added 'attributes' sequence property in the state type. 2014-04-22 11:23:44 +02:00
b8f54307fc Added "name" property (read-only) for attribute states. 2014-04-22 11:23:44 +02:00
2ec54df635 A bit shorter internal names for bparticles structs and functions. 2014-04-22 11:23:44 +02:00
f4344cdfa5 Added python type for particle attribute state in the bparticles module. 2014-04-22 11:23:43 +02:00
f3d1522272 Basic submodule 'types' in bparticles, defining a PyObject type for
the particle state.
2014-04-22 11:23:43 +02:00
eee0f75b1f Added new python module 'bparticles' for implementing a full python API
to define particle states. This is necessary because otherwise the RNA
can only refer to data that already exists in the DNA library (bpy.data)
but not create temporary structs. The state should be defined separately
before replacing a particle system's state with it. This is similar to
how bmesh works.
2014-04-22 11:23:43 +02:00
fe0bd22bcf Added missing read/write code for particle display. 2014-04-22 11:23:42 +02:00
dc93c57b41 Basic display feature for particles. This is organized as a list of
NParticleDisplay in the modifier for now. Each NParticleDisplay adds
a visualization element of some type in the viewport, which will allow
combining elements for custom attributes with standard display modes
for particles.
2014-04-22 11:23:42 +02:00
c991cd78e7 Add position attribute to particles by default. 2014-04-22 11:23:42 +02:00
6f9afa9775 Use a readonly flag for attributes and a second variant of the Data
RNA access types to prevent writing over immutable attributes ("id" in
particular).
2014-04-22 11:23:42 +02:00
5dd5c883fa Initialize the "id" attribute when adding particles to the state. 2014-04-22 11:23:42 +02:00
e93d2e0625 Use the new attribute flags to determine editability in RNA. 2014-04-22 11:23:42 +02:00
02e687d02c Flags for particle attributes:
- REQUIRED: These attributes are always existent in every particle
    system. Currently this is only the "id" layer, position might also
    be added
- PROTECTED: Attribute name, datatype, etc. can not be changed. Only
    user-defined attributes can be modified this way.
2014-04-22 11:23:42 +02:00
6ad40aa1ae RNA fix: using RNA_def_struct_sdna_from works only with actual pointers,
but not with directly nested structs (NParticleAttributeDescription in
this case). Resort to including "desc." prefix in the property paths.
2014-04-22 11:23:42 +02:00
4eda0a6f42 Clear the attribute buffers when adding new particles to a state. This
should probably use a specific default value for each attribute at some
point.
2014-04-22 11:23:42 +02:00
e1dc85f974 Copy the attribute descriptor to attribute states as well. The storage
overhead is negligible and this allows sanity type check assert as well
as correct RNA refining without access to the original attribute
descriptor.
2014-04-22 11:23:41 +02:00
7209bd4ebd Ensure the attribute states are synced to the attributes of the particle
system when adding/removing attribute descriptors. This is not a hard
requirement really, if an attribute has no state data that would still
work, but in most cases it should stay in sync.
2014-04-22 11:23:41 +02:00
ad9e4983dc Replaced the attribute state array with a ListBase. Eventually this
should use a hash table for O(1) lookup, but for now a linked list is
the easiest implementation.
2014-04-22 11:23:41 +02:00
5d4ae82cc0 Added accessor functions in particle state which allow extending the
particle state. These can be used later in python wrappers to support
more immediate collection-style access.
2014-04-22 11:23:41 +02:00
4b90b80c70 Fixed the particle attribute state data access functions. These have to
use an index as key rather than a particle ID, since the latter is not
available in a single attribute state without access to the parent
particle state.
2014-04-22 11:23:41 +02:00
f2bdf4bd4c New function for adding a particle based on particle id. 2014-04-22 11:23:41 +02:00
2496ab7f5d Alternative particle iterator init method using a specific particle ID. 2014-04-22 11:23:41 +02:00
5f3ae1c0d6 Unused RNA code for exposing particles directly in the state as a
collection. This doesn't work atm because for lookup it would need to
allocate a particle iterator, which can not be freed afterward. This
can probably be done nicer as a pure python wrapper instead of RNA.
2014-04-22 11:23:41 +02:00
971d22e5d0 Collection property for accessing the attribute states in a particle
state.
2014-04-22 11:23:41 +02:00
326a3b20f1 Store the particle state in iterators instead of the particle system. 2014-04-22 11:23:41 +02:00
408be6417d Yet another restructuring effort: Separate the state from the particle
system settings. Attributes can be accessed by name in the state data,
for now this uses plain linear search in a NULL-terminated array, but
can eventually use a hash table for O(1) lookup.
2014-04-22 11:23:41 +02:00
a5a6bd1c00 Added a comment in DNA about the concept of state/descriptor separation
and possible future optimization.
2014-04-22 11:23:40 +02:00
c7f285ca10 Iterator access functions for particles. 2014-04-22 11:23:40 +02:00
f92590e396 Implemented a simple iterator API for particle systems using a plain
index and the ID attribute for determining the state size. Have to see
how this plays out in terms of performance ...
2014-04-22 11:23:40 +02:00
5e90d3e803 Added 2 functions for looking up particles by their ID in the psys. 2014-04-22 11:23:40 +02:00
e750e0fc93 New function for getting a particle iterator at a given index. This will
be used for binary search in the particle id attribute layer.
2014-04-22 11:23:40 +02:00
649c8d6909 Copy the particle state when copying an attribute. 2014-04-22 11:23:40 +02:00
b6ced99abb Use a fixed "id" attribute, this will be required for all sorts of
particle functions and identify particles unambiguously.
2014-04-22 11:23:40 +02:00
5dccaa1ad6 Removed leftover #undefs. 2014-04-22 11:23:40 +02:00
206a0bd42f Removed unused data type mapping function in RNA, this is now directly
refined through the type of the attribute/state.
2014-04-22 11:23:39 +02:00
e7561274d7 More restructuring ... Putting state into attributes, otherwise mapping
between declared attributes in psys and attribute states becomes very
complicated.
2014-04-22 11:23:39 +02:00
fc51e04aec Fix for paged buffer iterator, can be constructed for a buffer without
any pages.
2014-04-22 11:23:39 +02:00
a0c7ee76a3 Disabled strict alignment in paged buffer for now, this fails for vector
attributes, needs a nicer way to handle this.
2014-04-22 11:23:39 +02:00
d99ff7fbee Renamed RNA property of the particle system in the psys modifier. 2014-04-22 11:23:39 +02:00
75aff0a75e Some renaming and DNA reorganization. Particle attributes now have a
descriptor as well as state data.
2014-04-22 11:23:39 +02:00
689d660adf Removed deprecated DNA data inside #if 0 block, C preprocessor doesn't
work with makesdna.
2014-04-22 11:23:39 +02:00
d5d5002c49 Disabled some unused DNA code for nparticles. 2014-04-22 11:23:39 +02:00
05791252b2 Collection properties for actual data in particle buffers. 2014-04-22 11:23:39 +02:00
8873e54701 Setter callback for particle attribute data type. Currently just throws an assert failure, later on this should make sure the particle data is converted to the correct type (or simply make datatype read-only). 2014-04-22 11:23:38 +02:00
e775f53b16 Basic properties for particle attribute descriptors. Uses a generic function to inject these properties using the nested 'desc' field. 2014-04-22 11:23:38 +02:00
af9e6b7fc5 Basic particle buffer implementation with RNA for adding and removing attributes. 2014-04-22 11:23:38 +02:00
34487cd754 Basic RNA for paged buffer and nparticle buffer. 2014-04-22 11:23:38 +02:00
857a403cd2 Updated read/write code for paged buffer for the new layer/page structure. 2014-04-22 11:23:38 +02:00
e65fb0661d Added missing DNA files to makesdna. 2014-04-22 11:23:38 +02:00
e1a9f63867 Added read/write code for NParticleSystemModifierData and NParticleBuffer. 2014-04-22 11:23:38 +02:00
da63e23ef7 Added missing draw function in the modifier panel. 2014-04-22 11:23:38 +02:00
4f7867247b Added applyModifier callback and AcceptsMesh flag so particle system can added on mesh objects. applyMesh is just a stub returning the unmodified mesh. 2014-04-22 11:23:38 +02:00
1da72ac496 Renamed the modifier to NParticleSystem since it will also define some simulation modes in addition to the actual buffer. 2014-04-22 11:23:38 +02:00
dce6d75726 Added a new modifier NParticleBuffer. This is just a thin wrapper around the NParticleBuffer struct to act as a particle container. Eventually could utilize a better object data system, for now this is ok. 2014-04-22 11:23:37 +02:00
2ab499cd1d Cleanup: disabled old modifier solution for now. 2014-04-22 11:23:37 +02:00
2cba992e9f Basic functions for creating/destroying buffers, adding/removing layers and adding elements. 2014-04-22 11:23:37 +02:00
e5777ec044 Started implementing individual paged layers. 2014-04-22 11:23:37 +02:00
bc3e02f8fe Copied over some old code, to be adapted. 2014-04-22 11:23:37 +02:00
46ffd66368 Removed unused code. 2014-04-22 11:23:37 +02:00
3fe2dc327e A few more macros to create typed access functions to paged buffer. 2014-04-22 11:23:37 +02:00
Lukas Tönne
075f6d4cf4 Skeleton files for particle buffer types. 2014-04-22 11:23:37 +02:00
Lukas Tönne
44633c67d1 Cleanup: use blenlib prefixes for iterator functions too. 2014-04-22 11:23:37 +02:00
Lukas Tönne
982c74edf0 Added basic read/write functions for pagedbuffer. 2014-04-22 11:23:37 +02:00
Lukas Tönne
dbf603c488 Better macros for low-level ultra fast access to paged buffers. 2014-04-22 11:23:14 +02:00
Lukas Tönne
2c0065295a Cleanup: follow the proposed naming scheme for blenlib (BLI_<prefix>_<function-name>). 2014-04-22 11:23:14 +02:00
Lukas Tönne
69692fdb0f Original paged buffer implementation. 2014-04-22 11:23:14 +02:00
3411 changed files with 106345 additions and 366136 deletions

6
.gitignore vendored
View File

@@ -26,9 +26,3 @@ Desktop.ini
# local patches # local patches
/*.patch /*.patch
/*.diff /*.diff
# in-source doc-gen
/doc/doxygen/html/
/doc/python_api/sphinx-in-tmp/
/doc/python_api/sphinx-in/
/doc/python_api/sphinx-out/

File diff suppressed because it is too large Load Diff

View File

@@ -52,10 +52,6 @@ ifneq "$(findstring debug, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_debug BUILD_DIR:=$(BUILD_DIR)_debug
BUILD_TYPE:=Debug BUILD_TYPE:=Debug
endif endif
ifneq "$(findstring full, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_full
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_full.cmake"
endif
ifneq "$(findstring lite, $(MAKECMDGOALS))" "" ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_lite BUILD_DIR:=$(BUILD_DIR)_lite
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake"
@@ -65,7 +61,7 @@ ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake" BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake"
endif endif
ifneq "$(findstring headless, $(MAKECMDGOALS))" "" ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_headless BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake" BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
endif endif
ifneq "$(findstring bpy, $(MAKECMDGOALS))" "" ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
@@ -113,7 +109,7 @@ endif
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Build Blender # Build Blender
all: FORCE all:
@echo @echo
@echo Configuring Blender ... @echo Configuring Blender ...
@@ -133,7 +129,6 @@ all: FORCE
@echo @echo
debug: all debug: all
full: all
lite: all lite: all
cycles: all cycles: all
headless: all headless: all
@@ -142,17 +137,16 @@ bpy: all
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Configuration (save some cd'ing around) # Configuration (save some cd'ing around)
config: FORCE config:
$(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)" $(CMAKE_CONFIG_TOOL) "$(BUILD_DIR)"
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Help for build targets # Help for build targets
help: FORCE help:
@echo "" @echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)" @echo "Convenience targets provided for building blender, (multiple at once can be used)"
@echo " * debug - build a debug binary" @echo " * debug - build a debug binary"
@echo " * full - enable all supported dependencies & options"
@echo " * lite - disable non essential features for a smaller binary and faster build" @echo " * lite - disable non essential features for a smaller binary and faster build"
@echo " * headless - build without an interface (renderfarm or server automation)" @echo " * headless - build without an interface (renderfarm or server automation)"
@echo " * cycles - build Cycles standalone only, without Blender" @echo " * cycles - build Cycles standalone only, without Blender"
@@ -171,7 +165,7 @@ help: FORCE
@echo "" @echo ""
@echo "Package Targets" @echo "Package Targets"
@echo " * package_debian - build a debian package" @echo " * package_debian - build a debian package"
@echo " * package_pacman - build an arch linux pacman package" @echo " * package_pacman - build an arch linux pacmanpackage"
@echo " * package_archive - build an archive package" @echo " * package_archive - build an archive package"
@echo "" @echo ""
@echo "Testing Targets (not associated with building blender)" @echo "Testing Targets (not associated with building blender)"
@@ -198,8 +192,7 @@ help: FORCE
@echo "" @echo ""
@echo "Utilities (not associated with building blender)" @echo "Utilities (not associated with building blender)"
@echo " * icons - updates PNG icons from SVG files." @echo " * icons - updates PNG icons from SVG files."
@echo " * tgz - create a compressed archive of the source code." @echo " * tbz - create a compressed svn export 'blender_archive.tar.bz2'"
@echo " * update - updates git and all submodules"
@echo "" @echo ""
@echo "Documentation Targets (not associated with building blender)" @echo "Documentation Targets (not associated with building blender)"
@echo " * doc_py - generate sphinx python api docs" @echo " * doc_py - generate sphinx python api docs"
@@ -207,20 +200,17 @@ help: FORCE
@echo " * doc_dna - generate blender file format reference" @echo " * doc_dna - generate blender file format reference"
@echo " * doc_man - generate manpage" @echo " * doc_man - generate manpage"
@echo "" @echo ""
@echo "Information"
@echo " * help - this help message"
@echo " * help_features - show a list of optional features when building"
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Packages # Packages
# #
package_debian: FORCE package_debian:
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman: FORCE package_pacman:
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
package_archive: FORCE package_archive:
make -C "$(BUILD_DIR)" -s package_archive make -C "$(BUILD_DIR)" -s package_archive
@echo archive in "$(BUILD_DIR)/release" @echo archive in "$(BUILD_DIR)/release"
@@ -228,74 +218,58 @@ package_archive: FORCE
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Tests # Tests
# #
test: FORCE test:
cd $(BUILD_DIR) ; ctest . --output-on-failure cd $(BUILD_DIR) ; ctest . --output-on-failure
# run pep8 check check on scripts we distribute. # run pep8 check check on scripts we distribute.
test_pep8: FORCE test_pep8:
python3 tests/python/pep8.py > test_pep8.log 2>&1 python3 tests/python/pep8.py > test_pep8.log 2>&1
@echo "written: test_pep8.log" @echo "written: test_pep8.log"
# run some checks on our cmakefiles. # run some checks on our cmakefiles.
test_cmake: FORCE test_cmake:
python3 build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1 python3 build_files/cmake/cmake_consistency_check.py > test_cmake_consistency.log 2>&1
@echo "written: test_cmake_consistency.log" @echo "written: test_cmake_consistency.log"
# run deprecation tests, see if we have anything to remove. # run deprecation tests, see if we have anything to remove.
test_deprecated: FORCE test_deprecated:
python3 tests/check_deprecated.py python3 tests/check_deprecated.py
test_style_c: FORCE test_style_c:
# run our own checks on C/C++ style # run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 \ PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/source/blender" "$(BLENDER_DIR)/source/creator" --no-length-check
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
--no-length-check
test_style_c_qtc: FORCE test_style_c_qtc:
# run our own checks on C/C++ style # run our own checks on C/C++ style
USE_QTC_TASK=1 \ USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \ PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/source/blender" "$(BLENDER_DIR)/source/creator" --no-length-check > \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \ test_style.tasks
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
--no-length-check \
> \
"$(BLENDER_DIR)/test_style.tasks"
@echo "written: test_style.tasks" @echo "written: test_style.tasks"
test_style_osl: FORCE test_style_osl:
# run our own checks on C/C++ style # run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 python3 \ PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/intern/cycles/kernel/shaders" "$(BLENDER_DIR)/release/scripts/templates_osl"
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl"
test_style_osl_qtc: FORCE test_style_osl_qtc:
# run our own checks on C/C++ style # run our own checks on C/C++ style
USE_QTC_TASK=1 \ USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \ PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" "$(BLENDER_DIR)/intern/cycles/kernel/shaders" "$(BLENDER_DIR)/release/scripts/templates_osl" > \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \ test_style.tasks
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl" \
> \
"$(BLENDER_DIR)/test_style.tasks"
@echo "written: test_style.tasks" @echo "written: test_style.tasks"
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Project Files # Project Files
# #
project_qtcreator: FORCE project_qtcreator:
python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)" python3 build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_netbeans: FORCE project_netbeans:
python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)" python3 build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
project_eclipse: FORCE project_eclipse:
cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)" cmake -G"Eclipse CDT4 - Unix Makefiles" -H"$(BLENDER_DIR)" -B"$(BUILD_DIR)"
@@ -303,123 +277,90 @@ project_eclipse: FORCE
# Static Checking # Static Checking
# #
check_cppcheck: FORCE check_cppcheck:
$(CMAKE_CONFIG) $(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \ python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py" 2> \
"$(BLENDER_DIR)/check_cppcheck.txt" "$(BLENDER_DIR)/check_cppcheck.txt"
@echo "written: check_cppcheck.txt" @echo "written: check_cppcheck.txt"
check_clang_array: FORCE check_clang_array:
$(CMAKE_CONFIG) $(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py" python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_clang_array.py"
check_splint: FORCE check_splint:
$(CMAKE_CONFIG) $(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py" python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py"
check_sparse: FORCE check_sparse:
$(CMAKE_CONFIG) $(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py" python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py"
check_smatch: FORCE check_smatch:
$(CMAKE_CONFIG) $(CMAKE_CONFIG)
cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py" python3 "$(BLENDER_DIR)/build_files/cmake/cmake_static_check_smatch.py"
check_spelling_py: FORCE check_spelling_py:
cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 \ PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/release/scripts"
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/release/scripts"
check_spelling_c: FORCE check_spelling_c:
cd "$(BUILD_DIR)" ; \ cd "$(BUILD_DIR)" ; \
PYTHONIOENCODING=utf_8 python3 \ PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/source"
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
check_spelling_c_qtc: FORCE check_spelling_c_qtc:
cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \ cd "$(BUILD_DIR)" ; USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 python3 \ PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/source" > \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \ "$(BLENDER_DIR)/check_spelling_c.tasks"
"$(BLENDER_DIR)/source" \
"$(BLENDER_DIR)/intern/cycles" \
"$(BLENDER_DIR)/intern/guardedalloc" \
"$(BLENDER_DIR)/intern/ghost" \
> \
"$(BLENDER_DIR)/check_spelling_c.tasks"
check_spelling_osl: FORCE check_spelling_osl:
cd "$(BUILD_DIR)" ;\ cd "$(BUILD_DIR)" ; PYTHONIOENCODING=utf_8 python3 "$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" "$(BLENDER_DIR)/intern/cycles/kernel/shaders"
PYTHONIOENCODING=utf_8 python3 \
"$(BLENDER_DIR)/source/tools/check_source/check_spelling.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders"
check_descriptions: FORCE check_descriptions:
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python \ "$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python "$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
"$(BLENDER_DIR)/source/tools/check_source/check_descriptions.py"
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Utilities # Utilities
# #
tgz: FORCE tbz:
./build_files/utils/build_tgz.sh svn export . blender_archive
tar cjf blender_archive.tar.bz2 blender_archive/
rm -rf blender_archive/
@echo "blender_archive.tar.bz2 written"
icons: FORCE icons:
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py" "$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py" "$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
update: FORCE
if [ -d "../lib" ]; then \
svn update ../lib/* ; \
fi
git pull --rebase
git submodule foreach git pull --rebase origin master
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Documentation # Documentation
# #
# Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation. # Simple version of ./doc/python_api/sphinx_doc_gen.sh with no PDF generation.
doc_py: FORCE doc_py:
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py "$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/python_api/sphinx_doc_gen.py
cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out cd doc/python_api ; sphinx-build -b html sphinx-in sphinx-out
@echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'" @echo "docs written into: '$(BLENDER_DIR)/doc/python_api/sphinx-out/contents.html'"
doc_doxy: FORCE doc_doxy:
cd doc/doxygen; doxygen Doxyfile cd doc/doxygen; doxygen Doxyfile
@echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'" @echo "docs written into: '$(BLENDER_DIR)/doc/doxygen/html/index.html'"
doc_dna: FORCE doc_dna:
"$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py "$(BUILD_DIR)/bin/blender" --background -noaudio --factory-startup --python doc/blender_file_format/BlendFileDnaExporter_25.py
@echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'" @echo "docs written into: '$(BLENDER_DIR)/doc/blender_file_format/dna.html'"
doc_man: FORCE doc_man:
python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender" python3 doc/manpage/blender.1.py "$(BUILD_DIR)/bin/blender"
help_features: FORCE
@python3 -c \
"import re; \
print('\n'.join([ \
w for l in open('"$(BLENDER_DIR)"/CMakeLists.txt', 'r').readlines() \
if not l.lstrip().startswith('#') \
for w in (re.sub(\
r'.*\boption\s*\(\s*(WITH_[a-zA-Z0-9_]+)\s+(\".*\")\s*.*', r'\g<1> - \g<2>', l).strip('() \n'),) \
if w.startswith('WITH_')]))" | uniq
clean:
clean: FORCE
$(MAKE) -C "$(BUILD_DIR)" clean $(MAKE) -C "$(BUILD_DIR)" clean
.PHONY: all .PHONY: all
FORCE:

View File

@@ -70,7 +70,7 @@ quickdebug = None
##### BEGIN SETUP ##### ##### BEGIN SETUP #####
B.possible_types = ['core', 'player', 'player2', 'intern', 'extern', 'system'] B.possible_types = ['core', 'player', 'player2', 'intern', 'extern']
B.binarykind = ['blender' , 'blenderplayer'] B.binarykind = ['blender' , 'blenderplayer']
################################## ##################################
@@ -125,7 +125,7 @@ else:
B.quickie=[] B.quickie=[]
toolset = B.arguments.get('BF_TOOLSET', None) toolset = B.arguments.get('BF_TOOLSET', None)
vcver = B.arguments.get('MSVS_VERSION', '12.0') vcver = B.arguments.get('MSVS_VERSION', '9.0')
if toolset: if toolset:
print "Using " + toolset print "Using " + toolset
@@ -210,16 +210,9 @@ if sys.platform=='win32':
if B.bitness==64: if B.bitness==64:
env.Append(CPPFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally env.Append(CPPFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
if env['BF_DEBUG']:
env.Append(CPPDEFINES=['_DEBUG', 'DEBUG'])
else:
env.Append(CPPDEFINES=['NDEBUG'])
if not env['BF_FANCY']: if not env['BF_FANCY']:
B.bc.disable() B.bc.disable()
if env['WITH_BF_SDL_DYNLOAD']:
env['BF_SDL_INC'] = '#extern/sdlew/include/SDL2'
# remove install dir so old and new files are not mixed. # remove install dir so old and new files are not mixed.
# NOTE: only do the scripts directory for now, otherwise is too disruptive for developers # NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
@@ -266,7 +259,6 @@ if 'blenderlite' in B.targets:
target_env_defs['WITH_BF_BOOLEAN'] = False target_env_defs['WITH_BF_BOOLEAN'] = False
target_env_defs['WITH_BF_REMESH'] = False target_env_defs['WITH_BF_REMESH'] = False
target_env_defs['WITH_BF_PYTHON'] = False target_env_defs['WITH_BF_PYTHON'] = False
target_env_defs['WITH_BF_IME'] = False
target_env_defs['WITH_BF_3DMOUSE'] = False target_env_defs['WITH_BF_3DMOUSE'] = False
target_env_defs['WITH_BF_LIBMV'] = False target_env_defs['WITH_BF_LIBMV'] = False
target_env_defs['WITH_BF_FREESTYLE'] = False target_env_defs['WITH_BF_FREESTYLE'] = False
@@ -331,10 +323,7 @@ if env['OURPLATFORM']=='darwin':
print B.bc.OKGREEN + "Available SDK's: \n" + B.bc.ENDC + MACOSX_SDK_CHECK.replace('\t', '') print B.bc.OKGREEN + "Available SDK's: \n" + B.bc.ENDC + MACOSX_SDK_CHECK.replace('\t', '')
if env['MACOSX_SDK'] == '': # no set sdk, choosing best one found if env['MACOSX_SDK'] == '': # no set sdk, choosing best one found
if 'OS X 10.10' in MACOSX_SDK_CHECK: if 'OS X 10.9' in MACOSX_SDK_CHECK:
env['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
env['MACOSX_SDK']='/Developer/SDKs/MacOSX10.10.sdk'
elif 'OS X 10.9' in MACOSX_SDK_CHECK:
env['MACOSX_DEPLOYMENT_TARGET'] = '10.6' env['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
env['MACOSX_SDK']='/Developer/SDKs/MacOSX10.9.sdk' env['MACOSX_SDK']='/Developer/SDKs/MacOSX10.9.sdk'
elif 'OS X 10.8' in MACOSX_SDK_CHECK: elif 'OS X 10.8' in MACOSX_SDK_CHECK:
@@ -423,9 +412,6 @@ if env['OURPLATFORM']=='darwin':
env.Append(LINKFLAGS=['-F/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','Jackmp']) env.Append(LINKFLAGS=['-F/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','Jackmp'])
print B.bc.OKGREEN + "Using Jack" print B.bc.OKGREEN + "Using Jack"
if env['WITH_BF_SDL']:
env.Append(LINKFLAGS=['-lazy_framework','ForceFeedback'])
if env['WITH_BF_QUICKTIME'] == 1: if env['WITH_BF_QUICKTIME'] == 1:
env['PLATFORM_LINKFLAGS'] = env['PLATFORM_LINKFLAGS']+['-framework','QTKit'] env['PLATFORM_LINKFLAGS'] = env['PLATFORM_LINKFLAGS']+['-framework','QTKit']
@@ -444,7 +430,6 @@ if env['OURPLATFORM']=='darwin':
print B.bc.OKGREEN + "Disabled OpenMP, not supported by compiler" print B.bc.OKGREEN + "Disabled OpenMP, not supported by compiler"
if env['WITH_BF_CYCLES_OSL'] == 1: if env['WITH_BF_CYCLES_OSL'] == 1:
env['WITH_BF_LLVM'] = 1
OSX_OSL_LIBPATH = Dir(env.subst(env['BF_OSL_LIBPATH'])).abspath OSX_OSL_LIBPATH = Dir(env.subst(env['BF_OSL_LIBPATH'])).abspath
# we need 2 variants of passing the oslexec with the force_load option, string and list type atm # we need 2 variants of passing the oslexec with the force_load option, string and list type atm
if env['C_COMPILER_ID'] == 'gcc' and env['CCVERSION'] >= '4.8' or env['C_COMPILER_ID'] == 'clang' and env['CCVERSION'] >= '3.4': if env['C_COMPILER_ID'] == 'gcc' and env['CCVERSION'] >= '4.8' or env['C_COMPILER_ID'] == 'clang' and env['CCVERSION'] >= '3.4':
@@ -452,12 +437,6 @@ if env['OURPLATFORM']=='darwin':
else: else:
env.Append(LINKFLAGS=['-L'+OSX_OSL_LIBPATH,'-loslcomp','-force_load '+ OSX_OSL_LIBPATH +'/liboslexec.a','-loslquery']) env.Append(LINKFLAGS=['-L'+OSX_OSL_LIBPATH,'-loslcomp','-force_load '+ OSX_OSL_LIBPATH +'/liboslexec.a','-loslquery'])
env.Append(BF_PROGRAM_LINKFLAGS=['-Xlinker','-force_load','-Xlinker',OSX_OSL_LIBPATH +'/liboslexec.a']) env.Append(BF_PROGRAM_LINKFLAGS=['-Xlinker','-force_load','-Xlinker',OSX_OSL_LIBPATH +'/liboslexec.a'])
else:
env['WITH_BF_LLVM'] = 0
if env['WITH_BF_LLVM'] == 0:
# Due duplicated generic UTF functions, we pull them either from LLVMSupport or COLLADA
env.Append(BF_OPENCOLLADA_LIB=' UTF')
# Trying to get rid of eventually clashes, we export some symbols explicite as local # Trying to get rid of eventually clashes, we export some symbols explicite as local
env.Append(LINKFLAGS=['-Xlinker','-unexported_symbols_list','-Xlinker','./source/creator/osx_locals.map']) env.Append(LINKFLAGS=['-Xlinker','-unexported_symbols_list','-Xlinker','./source/creator/osx_locals.map'])
@@ -470,14 +449,6 @@ if env['OURPLATFORM']=='darwin':
################### End Automatic configuration for OSX ################## ################### End Automatic configuration for OSX ##################
############################################################################# #############################################################################
if env['OURPLATFORM'] == 'linux' and not env['C_COMPILER_ID']:
command = ["%s"%env['CC'], "--version"]
line = btools.get_command_output(command)
if line.startswith('gcc'):
env['C_COMPILER_ID'] = 'gcc'
elif 'clang' in line[0]:
env['C_COMPILER_ID'] = 'clang'
if env['WITH_BF_OPENMP'] == 1: if env['WITH_BF_OPENMP'] == 1:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
env['CCFLAGS'].append('/openmp') env['CCFLAGS'].append('/openmp')
@@ -488,13 +459,6 @@ if env['WITH_BF_OPENMP'] == 1:
else: else:
env.Append(CCFLAGS=['-fopenmp']) env.Append(CCFLAGS=['-fopenmp'])
if env['WITH_BF_CPP11']:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
# Nothing special is needed, C++11 features are available by default.
pass
else:
env['CXXFLAGS'].append('-std=c++11')
#check for additional debug libnames #check for additional debug libnames
if env.has_key('BF_DEBUG_LIBS'): if env.has_key('BF_DEBUG_LIBS'):
@@ -547,49 +511,6 @@ env['CPPFLAGS'].append('-DWITH_OPENNL')
if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'): if env['OURPLATFORM'] not in ('win32-vc', 'win64-vc'):
env['CPPFLAGS'].append('-DHAVE_STDBOOL_H') env['CPPFLAGS'].append('-DHAVE_STDBOOL_H')
# OpenGL
if env['WITH_BF_GL_PROFILE_COMPAT']:
env['BF_GL_DEFINITIONS'].append('WITH_GL_PROFILE_COMPAT')
if env['WITH_BF_GL_PROFILE_CORE']:
env['BF_GL_DEFINITIONS'].append('WITH_GL_PROFILE_CORE')
if env['WITH_BF_GL_PROFILE_ES20']:
env['BF_GL_DEFINITIONS'].append('WITH_GL_PROFILE_ES20')
if env['WITH_BF_GL_EGL']:
env['BF_GL_DEFINITIONS'].append('WITH_EGL')
# GLEW
if env['WITH_BF_GLEW_MX']:
env['BF_GL_DEFINITIONS'].append('WITH_GLEW_MX')
if env['WITH_BF_GLEW_ES']:
env['BF_GLEW_INC'] = '#extern/glew-es/include'
env['BF_GL_DEFINITIONS'] += ['GLEW_STATIC', 'WITH_GLEW_ES']
if not env['WITH_BF_GL_PROFILE_ES20']:
# No ES functions are needed
env['BF_GL_DEFINITIONS'].append('GLEW_NO_ES')
elif not (env['WITH_BF_GL_PROFILE_CORE'] or env['WITH_BF_GL_PROFILE_COMPAT']):
# ES is enabled, but the other functions are all disabled
env['BF_GL_DEFINITIONS'].append('GLEW_ES_ONLY')
if env['WITH_BF_GL_PROFILE_ES20']:
if env['WITH_BF_GL_EGL']:
env['BF_GL_DEFINITIONS'].append('GLEW_USE_LIB_ES20')
if env['WITH_BF_GL_EGL']:
env['BF_GL_DEFINITIONS'].append('GLEW_INC_EGL')
else:
env['BF_GLEW_INC'] = '#extern/glew/include'
env['BF_GL_DEFINITIONS'].append('GLEW_STATIC')
# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
B.root_build_dir = env['BF_BUILDDIR'] B.root_build_dir = env['BF_BUILDDIR']
B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc') B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
@@ -691,36 +612,31 @@ def data_to_c(FILE_FROM, FILE_TO, VAR_NAME):
FILE_FROM = FILE_FROM.replace("/", "\\") FILE_FROM = FILE_FROM.replace("/", "\\")
FILE_TO = FILE_TO.replace("/", "\\") FILE_TO = FILE_TO.replace("/", "\\")
try: # first check if we need to bother.
# first check if we need to bother. if os.path.exists(FILE_TO):
if os.path.exists(FILE_TO): if os.path.getmtime(FILE_FROM) < os.path.getmtime(FILE_TO):
if os.path.getmtime(FILE_FROM) < os.path.getmtime(FILE_TO): return
return
print(B.bc.HEADER + "Generating: " + B.bc.ENDC + "%r" % os.path.basename(FILE_TO)) print(B.bc.HEADER + "Generating: " + B.bc.ENDC + "%r" % os.path.basename(FILE_TO))
fpin = open(FILE_FROM, "rb") fpin = open(FILE_FROM, "rb")
fpin.seek(0, os.SEEK_END) fpin.seek(0, os.SEEK_END)
size = fpin.tell() size = fpin.tell()
fpin.seek(0) fpin.seek(0)
fpout = open(FILE_TO, "w") fpout = open(FILE_TO, "w")
fpout.write("int %s_size = %d;\n" % (VAR_NAME, size)) fpout.write("int %s_size = %d;\n" % (VAR_NAME, size))
fpout.write("char %s[] = {\n" % VAR_NAME) fpout.write("char %s[] = {\n" % VAR_NAME)
while size > 0: while size > 0:
size -= 1 size -= 1
if size % 32 == 31: if size % 32 == 31:
fpout.write("\n") fpout.write("\n")
fpout.write("%3d," % ord(fpin.read(1))) fpout.write("%3d," % ord(fpin.read(1)))
fpout.write("\n 0};\n\n") fpout.write("\n 0};\n\n")
fpin.close() fpin.close()
fpout.close() fpout.close()
except KeyboardInterrupt:
if os.path.exists(FILE_TO):
os.remove(FILE_TO)
raise KeyboardInterrupt
def data_to_c_simple(FILE_FROM): def data_to_c_simple(FILE_FROM):
filename_only = os.path.basename(FILE_FROM) filename_only = os.path.basename(FILE_FROM)
@@ -745,12 +661,7 @@ def data_to_c_simple_icon(PATH_FROM):
FILE_TO_PNG = os.path.join(env['DATA_SOURCES'], filename_only + ".png") FILE_TO_PNG = os.path.join(env['DATA_SOURCES'], filename_only + ".png")
FILE_TO = FILE_TO_PNG + ".c" FILE_TO = FILE_TO_PNG + ".c"
argv = [PATH_FROM, FILE_TO_PNG] argv = [PATH_FROM, FILE_TO_PNG]
try: datatoc_icon.main_ex(argv)
datatoc_icon.main_ex(argv)
except KeyboardInterrupt:
if os.path.exists(FILE_TO_PNG):
os.remove(FILE_TO_PNG)
raise KeyboardInterrupt
# then the png to a c file # then the png to a c file
data_to_c_simple(FILE_TO_PNG) data_to_c_simple(FILE_TO_PNG)
@@ -766,9 +677,6 @@ if B.targets != ['cudakernels']:
data_to_c_simple("release/datafiles/preview_cycles.blend") data_to_c_simple("release/datafiles/preview_cycles.blend")
# --- glsl --- # --- glsl ---
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_color_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_frag.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_vert.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
@@ -776,18 +684,8 @@ if B.targets != ['cudakernels']:
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_sep_gaussian_blur_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex_world.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl") data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_lib.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_vert.glsl")
data_to_c_simple("intern/opencolorio/gpu_shader_display_transform.glsl") data_to_c_simple("intern/opencolorio/gpu_shader_display_transform.glsl")
# --- blender --- # --- blender ---
@@ -817,13 +715,6 @@ if B.targets != ['cudakernels']:
data_to_c_simple("release/datafiles/brushicons/fill.png") data_to_c_simple("release/datafiles/brushicons/fill.png")
data_to_c_simple("release/datafiles/brushicons/flatten.png") data_to_c_simple("release/datafiles/brushicons/flatten.png")
data_to_c_simple("release/datafiles/brushicons/grab.png") data_to_c_simple("release/datafiles/brushicons/grab.png")
data_to_c_simple("release/datafiles/brushicons/hairadd.png")
data_to_c_simple("release/datafiles/brushicons/haircomb.png")
data_to_c_simple("release/datafiles/brushicons/haircut.png")
data_to_c_simple("release/datafiles/brushicons/hairlength.png")
data_to_c_simple("release/datafiles/brushicons/hairpuff.png")
data_to_c_simple("release/datafiles/brushicons/hairsmooth.png")
data_to_c_simple("release/datafiles/brushicons/hairweight.png")
data_to_c_simple("release/datafiles/brushicons/inflate.png") data_to_c_simple("release/datafiles/brushicons/inflate.png")
data_to_c_simple("release/datafiles/brushicons/layer.png") data_to_c_simple("release/datafiles/brushicons/layer.png")
data_to_c_simple("release/datafiles/brushicons/lighten.png") data_to_c_simple("release/datafiles/brushicons/lighten.png")
@@ -839,8 +730,6 @@ if B.targets != ['cudakernels']:
data_to_c_simple("release/datafiles/brushicons/soften.png") data_to_c_simple("release/datafiles/brushicons/soften.png")
data_to_c_simple("release/datafiles/brushicons/subtract.png") data_to_c_simple("release/datafiles/brushicons/subtract.png")
data_to_c_simple("release/datafiles/brushicons/texdraw.png") data_to_c_simple("release/datafiles/brushicons/texdraw.png")
data_to_c_simple("release/datafiles/brushicons/texfill.png")
data_to_c_simple("release/datafiles/brushicons/texmask.png")
data_to_c_simple("release/datafiles/brushicons/thumb.png") data_to_c_simple("release/datafiles/brushicons/thumb.png")
data_to_c_simple("release/datafiles/brushicons/twist.png") data_to_c_simple("release/datafiles/brushicons/twist.png")
data_to_c_simple("release/datafiles/brushicons/vertexdraw.png") data_to_c_simple("release/datafiles/brushicons/vertexdraw.png")
@@ -889,21 +778,17 @@ B.init_lib_dict()
##### END SETUP ########## ##### END SETUP ##########
## Auto-configuration run-time tests if B.targets != ['cudakernels']:
# Put all auto configuration run-time tests here
from FindSharedPtr import FindSharedPtr from FindSharedPtr import FindSharedPtr
from FindUnorderedMap import FindUnorderedMap from FindUnorderedMap import FindUnorderedMap
conf = Configure(env) conf = Configure(env)
old_linkflags = conf.env['LINKFLAGS'] conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS']) FindSharedPtr(conf)
FindUnorderedMap(conf)
# Put all tests here env = conf.Finish()
FindSharedPtr(conf)
FindUnorderedMap(conf)
conf.env['LINKFLAGS'] = old_linkflags
env = conf.Finish()
# End of auto configuration # End of auto configuration
@@ -921,7 +806,7 @@ SConscript(B.root_build_dir+'/extern/SConscript')
# libraries to give as objects to linking phase # libraries to give as objects to linking phase
mainlist = [] mainlist = []
for tp in B.possible_types: for tp in B.possible_types:
if (not tp == 'player') and (not tp == 'player2') and (not tp == 'system'): if (not tp == 'player') and (not tp == 'player2'):
mainlist += B.create_blender_liblist(env, tp) mainlist += B.create_blender_liblist(env, tp)
if B.arguments.get('BF_PRIORITYLIST', '0')=='1': if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
@@ -933,17 +818,7 @@ thestatlibs, thelibincs = B.setup_staticlibs(env)
thesyslibs = B.setup_syslibs(env) thesyslibs = B.setup_syslibs(env)
if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
blender_progname = "blender" env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
blender_progname = "blender-app"
lenv = env.Clone()
lenv.Append(LINKFLAGS = env['PLATFORM_LINKFLAGS'])
targetpath = B.root_build_dir + '/blender'
launcher_obj = [env.Object(B.root_build_dir + 'source/creator/creator/creator_launch_win', ['#source/creator/creator_launch_win.c'])]
env.BlenderProg(B.root_build_dir, 'blender', [launcher_obj] + B.resources, ['bf_utfconv'] + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
env.BlenderProg(B.root_build_dir, blender_progname, creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
if env['WITH_BF_PLAYER']: if env['WITH_BF_PLAYER']:
playerlist = B.create_blender_liblist(env, 'player') playerlist = B.create_blender_liblist(env, 'player')
playerlist += B.create_blender_liblist(env, 'player2') playerlist += B.create_blender_liblist(env, 'player2')
@@ -993,10 +868,6 @@ if env['OURPLATFORM']!='darwin':
td, tf = os.path.split(targetdir) td, tf = os.path.split(targetdir)
dotblenderinstall.append(env.Install(dir=td, source=srcfile)) dotblenderinstall.append(env.Install(dir=td, source=srcfile))
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
scriptinstall.append(env.InstallAs(env['BF_INSTALLDIR'] + '/blender-app.exe.manifest',
'source/icons/blender.exe.manifest'))
if env['WITH_BF_PYTHON']: if env['WITH_BF_PYTHON']:
#-- local/VERSION/scripts #-- local/VERSION/scripts
scriptpaths=['release/scripts'] scriptpaths=['release/scripts']
@@ -1035,20 +906,17 @@ if env['OURPLATFORM']!='darwin':
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel') dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel')
source=os.listdir('intern/cycles/kernel') source=os.listdir('intern/cycles/kernel')
if '__pycache__' in source: source.remove('__pycache__') if '__pycache__' in source: source.remove('__pycache__')
source.remove('kernel.cpp')
source.remove('CMakeLists.txt') source.remove('CMakeLists.txt')
source.remove('SConscript')
source.remove('svm') source.remove('svm')
source.remove('closure') source.remove('closure')
source.remove('geom') source.remove('geom')
source.remove('shaders') source.remove('shaders')
source.remove('osl') source.remove('osl')
source.remove('split')
source=['intern/cycles/kernel/'+s for s in source] source=['intern/cycles/kernel/'+s for s in source]
source.append('intern/cycles/util/util_atomic.h')
source.append('intern/cycles/util/util_color.h') source.append('intern/cycles/util/util_color.h')
source.append('intern/cycles/util/util_half.h') source.append('intern/cycles/util/util_half.h')
source.append('intern/cycles/util/util_math.h') source.append('intern/cycles/util/util_math.h')
source.append('intern/cycles/util/util_math_fast.h')
source.append('intern/cycles/util/util_transform.h') source.append('intern/cycles/util/util_transform.h')
source.append('intern/cycles/util/util_types.h') source.append('intern/cycles/util/util_types.h')
scriptinstall.append(env.Install(dir=dir,source=source)) scriptinstall.append(env.Install(dir=dir,source=source))
@@ -1070,12 +938,6 @@ if env['OURPLATFORM']!='darwin':
if '__pycache__' in source: source.remove('__pycache__') if '__pycache__' in source: source.remove('__pycache__')
source=['intern/cycles/kernel/geom/'+s for s in source] source=['intern/cycles/kernel/geom/'+s for s in source]
scriptinstall.append(env.Install(dir=dir,source=source)) scriptinstall.append(env.Install(dir=dir,source=source))
# split
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'kernel', 'split')
source=os.listdir('intern/cycles/kernel/split')
if '__pycache__' in source: source.remove('__pycache__')
source=['intern/cycles/kernel/split/'+s for s in source]
scriptinstall.append(env.Install(dir=dir,source=source))
# licenses # licenses
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'license') dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'license')
@@ -1091,9 +953,8 @@ if env['OURPLATFORM']!='darwin':
dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'lib') dir=os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts', 'addons','cycles', 'lib')
for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']: for arch in env['BF_CYCLES_CUDA_BINARIES_ARCH']:
kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel') kernel_build_dir = os.path.join(B.root_build_dir, 'intern/cycles/kernel')
for suffix in ('', '_experimental'): cubin_file = os.path.join(kernel_build_dir, "kernel_%s.cubin" % arch)
cubin_file = os.path.join(kernel_build_dir, "kernel%s_%s.cubin" % (suffix, arch)) cubininstall.append(env.Install(dir=dir,source=cubin_file))
cubininstall.append(env.Install(dir=dir,source=cubin_file))
# osl shaders # osl shaders
if env['WITH_BF_CYCLES_OSL']: if env['WITH_BF_CYCLES_OSL']:
@@ -1205,37 +1066,9 @@ if env['OURPLATFORM']=='linuxcross':
textlist = [] textlist = []
texttargetlist = [] texttargetlist = []
for tp, tn, tf in os.walk('release/text'): for tp, tn, tf in os.walk('release/text'):
tf.remove("readme.html")
for f in tf: for f in tf:
textlist.append(tp+os.sep+f) textlist.append(tp+os.sep+f)
def readme_version_patch():
readme_src = "release/text/readme.html"
readme_dst = os.path.abspath(os.path.normpath(os.path.join(env['BF_BUILDDIR'], "readme.html")))
if not os.path.exists(readme_dst) or (os.path.getmtime(readme_dst) < os.path.getmtime(readme_src)):
f = open(readme_src, "r")
data = f.read()
f.close()
data = data.replace("BLENDER_VERSION", VERSION)
f = open(readme_dst, "w")
f.write(data)
f.close()
textlist.append(readme_dst)
readme_version_patch()
del readme_version_patch
'''Command(
"release/text/readme.html"
)
Command("file.out", "file.in", Copy(env['BF_INSTALLDIR'], "release/text/readme.html"))
'''
# Font licenses # Font licenses
textlist.append('release/datafiles/LICENSE-bfont.ttf.txt') textlist.append('release/datafiles/LICENSE-bfont.ttf.txt')
if env['WITH_BF_INTERNATIONAL']: if env['WITH_BF_INTERNATIONAL']:
@@ -1262,15 +1095,16 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll'] dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
if env['WITH_BF_SDL']: if env['WITH_BF_SDL']:
dllsources.append('${BF_SDL_LIBPATH}/SDL2.dll') if env['OURPLATFORM'] == 'win64-vc':
pass # we link statically already to SDL on win64
else:
dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
if env['WITH_BF_PYTHON']: if env['WITH_BF_PYTHON']:
if env['BF_DEBUG']: if env['BF_DEBUG']:
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll') dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
dllsources.append('${BF_PYTHON_LIBPATH}/sqlite3_d.dll')
else: else:
dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll') dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
dllsources.append('${BF_PYTHON_LIBPATH}/sqlite3.dll')
if env['WITH_BF_ICONV']: if env['WITH_BF_ICONV']:
if env['OURPLATFORM'] == 'win64-vc': if env['OURPLATFORM'] == 'win64-vc':
@@ -1281,6 +1115,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
if env['WITH_BF_OPENAL']: if env['WITH_BF_OPENAL']:
dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll') dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
if env['WITH_BF_SNDFILE']: if env['WITH_BF_SNDFILE']:
dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll') dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')

View File

@@ -25,12 +25,10 @@
ARGS=$( \ ARGS=$( \
getopt \ getopt \
-o s:i:t:h \ -o s:i:t:h \
--long source:,install:,tmp:,info:,threads:,help,no-sudo,with-all,with-opencollada,\ --long source:,install:,tmp:,threads:,help,no-sudo,with-all,with-opencollada,ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,\
force-all,force-python,force-numpy,force-boost,force-ocio,force-oiio,force-llvm,force-osl,force-opencollada,\ force-all,force-python,force-numpy,force-boost,force-ocio,force-oiio,force-llvm,force-osl,force-opencollada,\
force-ffmpeg,force-alembic,\ force-ffmpeg,skip-python,skip-numpy,skip-boost,skip-ocio,skip-oiio,skip-llvm,skip-osl,skip-ffmpeg,\
skip-python,skip-numpy,skip-boost,skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-ffmpeg,skip-opencollada,skip-alembic,\ skip-opencollada,required-numpy,libyaml-cpp-ver: \
required-numpy: \
-- "$@" \ -- "$@" \
) )
@@ -40,7 +38,6 @@ SRC="$HOME/src/blender-deps"
INST="/opt/lib" INST="/opt/lib"
TMP="/tmp" TMP="/tmp"
CWD=$PWD CWD=$PWD
INFO_PATH=$CWD
# Do not install some optional, potentially conflicting libs by default... # Do not install some optional, potentially conflicting libs by default...
WITH_ALL=false WITH_ALL=false
@@ -77,13 +74,10 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--tmp=<path> --tmp=<path>
Use a specific temp path (defaults to '\$TMP'). Use a specific temp path (defaults to '\$TMP').
--info=<path>
Use a specific info path (to store BUILD_NOTES.txt, defaults to '\$INFO_PATH').
-t n, --threads=n -t n, --threads=n
Use a specific number of threads when building the libraries (auto-detected as '\$THREADS'). Use a specific number of threads when building the libraries (auto-detected as '\$THREADS').
--no-sudo --no_sudo
Disable use of sudo (this script won't be able to do much though, will just print needed packages...). Disable use of sudo (this script won't be able to do much though, will just print needed packages...).
--with-all --with-all
@@ -95,9 +89,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--with-opencollada --with-opencollada
Build and install the OpenCOLLADA libraries. Build and install the OpenCOLLADA libraries.
--with-alembic
Build and install the Alembic library.
--ver-ocio=<ver> --ver-ocio=<ver>
Force version of OCIO library. Force version of OCIO library.
@@ -147,9 +138,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--force-ffmpeg --force-ffmpeg
Force the rebuild of FFMpeg. Force the rebuild of FFMpeg.
--force-alembic
Force the rebuild of Alembic.
Note about the --force-foo options: Note about the --force-foo options:
* They obviously only have an effect if those libraries are built by this script * They obviously only have an effect if those libraries are built by this script
(i.e. if there is no available and satisfactory package)! (i.e. if there is no available and satisfactory package)!
@@ -186,12 +174,13 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--skip-ffmpeg --skip-ffmpeg
Unconditionally skip FFMpeg installation/building. Unconditionally skip FFMpeg installation/building.
--skip-alembic
Unconditionally skip Alembic installation/building.
--required-numpy --required-numpy
Use this in case your distro features a valid python package, but no matching Numpy one. Use this in case your distro features a valid python package, but no matching Numpy one.
It will force compilation of both python and numpy\"" It will force compilation of both python and numpy
--libyaml-cpp-ver=<ver>
Ubuntu hack: you may have to force installation of a non-defaut version of libyaml-cpp
(e.g. ocio in trusty uses 0.3, while default version is 0.5... *sigh*)\""
##### Main Vars ##### ##### Main Vars #####
@@ -213,31 +202,33 @@ BOOST_VERSION_MIN="1.49"
BOOST_FORCE_REBUILD=false BOOST_FORCE_REBUILD=false
BOOST_SKIP=false BOOST_SKIP=false
OCIO_VERSION="1.0.9" OCIO_VERSION="1.0.7"
OCIO_VERSION_MIN="1.0" OCIO_VERSION_MIN="1.0"
OCIO_FORCE_REBUILD=false OCIO_FORCE_REBUILD=false
OCIO_SKIP=false OCIO_SKIP=false
LIBYAML_CPP_VER_DEFINED=false
LIBYAML_CPP_VER="0.0"
OPENEXR_VERSION="2.2.0" OPENEXR_VERSION="2.1.0"
OPENEXR_VERSION_MIN="2.0.1" OPENEXR_VERSION_MIN="2.0.1"
ILMBASE_VERSION="2.2.0" ILMBASE_VERSION="2.1.0"
OPENEXR_FORCE_REBUILD=false OPENEXR_FORCE_REBUILD=false
OPENEXR_SKIP=false OPENEXR_SKIP=false
_with_built_openexr=false _with_built_openexr=false
OIIO_VERSION="1.4.16" OIIO_VERSION="1.4.0"
OIIO_VERSION_MIN="1.4.0" OIIO_VERSION_MIN="1.4.0"
OIIO_FORCE_REBUILD=false OIIO_FORCE_REBUILD=false
OIIO_SKIP=false OIIO_SKIP=false
LLVM_VERSION="3.4" LLVM_VERSION="3.3"
LLVM_VERSION_MIN="3.4" LLVM_VERSION_MIN="3.3"
LLVM_VERSION_FOUND="" LLVM_VERSION_FOUND=""
LLVM_FORCE_REBUILD=false LLVM_FORCE_REBUILD=false
LLVM_SKIP=false LLVM_SKIP=false
# OSL needs to be compiled for now! # OSL needs to be compiled for now!
OSL_VERSION="1.5.11" OSL_VERSION="1.4.0"
OSL_VERSION_MIN=$OSL_VERSION OSL_VERSION_MIN=$OSL_VERSION
OSL_FORCE_REBUILD=false OSL_FORCE_REBUILD=false
OSL_SKIP=false OSL_SKIP=false
@@ -247,8 +238,8 @@ OPENCOLLADA_VERSION="1.3"
OPENCOLLADA_FORCE_REBUILD=false OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false OPENCOLLADA_SKIP=false
FFMPEG_VERSION="2.1.5" FFMPEG_VERSION="2.1.4"
FFMPEG_VERSION_MIN="2.1.5" FFMPEG_VERSION_MIN="0.7.6"
FFMPEG_FORCE_REBUILD=false FFMPEG_FORCE_REBUILD=false
FFMPEG_SKIP=false FFMPEG_SKIP=false
_ffmpeg_list_sep=";" _ffmpeg_list_sep=";"
@@ -273,11 +264,6 @@ MP3LAME_DEV=""
OPENJPEG_USE=false OPENJPEG_USE=false
OPENJPEG_DEV="" OPENJPEG_DEV=""
ALEMBIC_VERSION="1.5.5"
ALEMBIC_VERSION_MIN="1.5.5"
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
# Switch to english language, else some things (like check_package_DEB()) won't work! # Switch to english language, else some things (like check_package_DEB()) won't work!
LANG_BACK=$LANG LANG_BACK=$LANG
LANG="" LANG=""
@@ -340,9 +326,6 @@ while true; do
--tmp) --tmp)
TMP="$2"; shift; shift; continue TMP="$2"; shift; shift; continue
;; ;;
--info)
INFO_PATH="$2"; shift; shift; continue
;;
-t|--threads) -t|--threads)
THREADS="$2"; shift; shift; continue THREADS="$2"; shift; shift; continue
;; ;;
@@ -437,9 +420,6 @@ while true; do
--force-ffmpeg) --force-ffmpeg)
FFMPEG_FORCE_REBUILD=true; shift; continue FFMPEG_FORCE_REBUILD=true; shift; continue
;; ;;
--force-alembic)
ALEMBIC_FORCE_REBUILD=true; shift; continue
;;
--skip-python) --skip-python)
PYTHON_SKIP=true; shift; continue PYTHON_SKIP=true; shift; continue
;; ;;
@@ -470,12 +450,12 @@ while true; do
--skip-ffmpeg) --skip-ffmpeg)
FFMPEG_SKIP=true; shift; continue FFMPEG_SKIP=true; shift; continue
;; ;;
--skip-alembic)
ALEMBIC_SKIP=true; shift; continue
;;
--required-numpy) --required-numpy)
NUMPY_REQUIRED=true; shift; continue NUMPY_REQUIRED=true; shift; continue
;; ;;
--libyaml-cpp-ver)
LIBYAML_CPP_VER_DEFINED=true; LIBYAML_CPP_VER="$2"; shift; shift; continue
;;
--) --)
# no more arguments to parse # no more arguments to parse
break break
@@ -491,12 +471,11 @@ while true; do
esac esac
done done
if [ $WITH_ALL == true -a $OPENCOLLADA_SKIP == false ]; then if $WITH_ALL; then
WITH_OPENCOLLADA=true WITH_OPENCOLLADA=true
fi fi
# This has to be done here, because user might force some versions... # This has to be done here, because user might force some versions...
PYTHON_SOURCE=( "http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" ) PYTHON_SOURCE=( "http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" )
NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" ) NUMPY_SOURCE=( "http://sourceforge.net/projects/numpy/files/NumPy/$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
@@ -504,38 +483,26 @@ _boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" ) BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" )
OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" ) OCIO_SOURCE=( "https://github.com/imageworks/OpenColorIO/tarball/v$OCIO_VERSION" )
#OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" )
OPENEXR_USE_REPO=false OPENEXR_SOURCE=( "https://github.com/mont29/openexr.git" )
OPENEXR_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/openexr-$OPENEXR_VERSION.tar.gz" ) OPENEXR_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
OPENEXR_SOURCE_REPO=( "https://github.com/mont29/openexr.git" )
OPENEXR_SOURCE_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
ILMBASE_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz" ) ILMBASE_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz" )
OIIO_USE_REPO=false #OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" ) OIIO_SOURCE=( "https://github.com/mont29/oiio.git" )
OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" ) OIIO_REPO_UID="99113d12619c90cf44721195a759674ea61f02b1"
OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" ) LLVM_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/llvm-$LLVM_VERSION.src.tar.gz" )
LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" ) LLVM_CLANG_SOURCE=( "http://llvm.org/releases/$LLVM_VERSION/clang-$LLVM_VERSION.src.tar.gz" "http://llvm.org/releases/$LLVM_VERSION/cfe-$LLVM_VERSION.src.tar.gz" )
OSL_USE_REPO=true #OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" )
#~ OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage/archive/Release-$OSL_VERSION.tar.gz" ) #OSL_SOURCE=( "https://github.com/mont29/OpenShadingLanguage.git" )
OSL_SOURCE=( "https://github.com/Nazg-Gul/OpenShadingLanguage/archive/Release-1.5.11.tar.gz" ) OSL_SOURCE=( "https://github.com/imageworks/OpenShadingLanguage.git" )
#~ OSL_SOURCE_REPO=( "https://github.com/imageworks/OpenShadingLanguage.git" ) OSL_REPO_UID="4abd672ed3979e5e965323201a5ba5ab802a76a9"
#~ OSL_SOURCE_REPO=( "https://github.com/mont29/OpenShadingLanguage.git" )
#~ OSL_SOURCE_REPO_UID="85179714e1bc69cd25ecb6bb711c1a156685d395"
#~ OSL_SOURCE_REPO_BRANCH="master"
OSL_SOURCE_REPO=( "https://github.com/Nazg-Gul/OpenShadingLanguage.git" )
OSL_SOURCE_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
OSL_SOURCE_REPO_BRANCH="blender-fixes"
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" ) OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d" OPENCOLLADA_REPO_UID="18da7f4109a8eafaa290a33f5550501cc4c8bae8"
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" ) FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
ALEMBIC_SOURCE=( "https://code.google.com/p/alembic/" )
ALEMBIC_REPO_UID=( "1_05_05" )
##### Generic Helpers ##### ##### Generic Helpers #####
@@ -862,7 +829,6 @@ compile_Boost() {
# Rebuild dependecies as well! # Rebuild dependecies as well!
OIIO_FORCE_REBUILD=true OIIO_FORCE_REBUILD=true
OSL_FORCE_REBUILD=true OSL_FORCE_REBUILD=true
ALEMBIC_FORCE_REBUILD=true
prepare_opt prepare_opt
@@ -1007,11 +973,12 @@ clean_ILMBASE() {
compile_ILMBASE() { compile_ILMBASE() {
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
ilmbase_magic=10 ilmbase_magic=8
_init_ilmbase _init_ilmbase
# Clean install if needed! # Clean install if needed!
magic_compile_check ilmbase-$ILMBASE_VERSION $ilmbase_magic magic_compile_check ilmbase-$ILMBASE_VERSION $ilmbase_magic
if [ $? -eq 1 -o $OPENEXR_FORCE_REBUILD == true ]; then if [ $? -eq 1 -o $OPENEXR_FORCE_REBUILD == true ]; then
clean_ILMBASE clean_ILMBASE
rm -rf $_openexr_inst rm -rf $_openexr_inst
@@ -1031,7 +998,8 @@ compile_ILMBASE() {
download ILMBASE_SOURCE[@] $_src.tar.gz download ILMBASE_SOURCE[@] $_src.tar.gz
INFO "Unpacking ILMBase-$ILMBASE_VERSION" INFO "Unpacking ILMBase-$ILMBASE_VERSION"
tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" -xf $_src.tar.gz tar -C $SRC --transform "s,(.*/?)ilmbase-[^/]*(.*),\1ILMBase-$ILMBASE_VERSION\2,x" \
-xf $_src.tar.gz
fi fi
@@ -1047,7 +1015,6 @@ compile_ILMBASE() {
cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst" cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON" cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
if file /bin/cp | grep -q '32-bit'; then if file /bin/cp | grep -q '32-bit'; then
cflags="-fPIC -m32 -march=i686" cflags="-fPIC -m32 -march=i686"
@@ -1093,7 +1060,7 @@ clean_OPENEXR() {
compile_OPENEXR() { compile_OPENEXR() {
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
openexr_magic=13 openexr_magic=12
# Clean install if needed! # Clean install if needed!
magic_compile_check openexr-$OPENEXR_VERSION $openexr_magic magic_compile_check openexr-$OPENEXR_VERSION $openexr_magic
@@ -1120,28 +1087,24 @@ compile_OPENEXR() {
INFO "Downloading OpenEXR-$OPENEXR_VERSION" INFO "Downloading OpenEXR-$OPENEXR_VERSION"
mkdir -p $SRC mkdir -p $SRC
if [ $OPENEXR_USE_REPO == true ]; then # download OPENEXR_SOURCE[@] $_src.tar.gz
git clone ${OPENEXR_SOURCE_REPO[0]} $_src
else # INFO "Unpacking OpenEXR-$OPENEXR_VERSION"
download OPENEXR_SOURCE[@] $_src.tar.gz # tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" \
INFO "Unpacking OpenEXR-$OPENEXR_VERSION" # -xf $_src.tar.gz
tar -C $SRC --transform "s,(.*/?)openexr[^/]*(.*),\1OpenEXR-$OPENEXR_VERSION\2,x" -xf $_src.tar.gz
fi git clone ${OPENEXR_SOURCE[0]} $_src
fi fi
cd $_src cd $_src
if [ $OPENEXR_USE_REPO == true ]; then # XXX For now, always update from latest repo...
# XXX For now, always update from latest repo... git pull origin master
git pull origin master
# Stick to same rev as windows' libs... # Stick to same rev as windows' libs...
git checkout $OPENEXR_SOURCE_REPO_UID git checkout $OPENEXR_REPO_UID
git reset --hard git reset --hard
oiio_src_path="../OpenEXR"
else
oiio_src_path=".."
fi
# Always refresh the whole build! # Always refresh the whole build!
if [ -d build ]; then if [ -d build ]; then
@@ -1155,7 +1118,6 @@ compile_OPENEXR() {
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D ILMBASE_PACKAGE_PREFIX=$_ilmbase_inst" cmake_d="$cmake_d -D ILMBASE_PACKAGE_PREFIX=$_ilmbase_inst"
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON" cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -D NAMESPACE_VERSIONING=OFF" # VERY IMPORTANT!!!
if file /bin/cp | grep -q '32-bit'; then if file /bin/cp | grep -q '32-bit'; then
cflags="-fPIC -m32 -march=i686" cflags="-fPIC -m32 -march=i686"
@@ -1163,7 +1125,7 @@ compile_OPENEXR() {
cflags="-fPIC" cflags="-fPIC"
fi fi
cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" $oiio_src_path cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ../OpenEXR
make -j$THREADS && make install make -j$THREADS && make install
@@ -1227,25 +1189,24 @@ compile_OIIO() {
if [ ! -d $_src ]; then if [ ! -d $_src ]; then
mkdir -p $SRC mkdir -p $SRC
# download OIIO_SOURCE[@] "$_src.tar.gz"
# INFO "Unpacking OpenImageIO-$OIIO_VERSION"
# tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" \
# -xf $_src.tar.gz
git clone ${OIIO_SOURCE[0]} $_src
if [ $OIIO_USE_REPO == true ]; then
git clone ${OIIO_SOURCE_REPO[0]} $_src
else
download OIIO_SOURCE[@] "$_src.tar.gz"
INFO "Unpacking OpenImageIO-$OIIO_VERSION"
tar -C $SRC --transform "s,(.*/?)oiio-Release-[^/]*(.*),\1OpenImageIO-$OIIO_VERSION\2,x" -xf $_src.tar.gz
fi
fi fi
cd $_src cd $_src
if [ $OIIO_USE_REPO == true ]; then # XXX For now, always update from latest repo...
# XXX For now, always update from latest repo... git pull origin master
git pull origin master
# Stick to same rev as windows' libs... # Stick to same rev as windows' libs...
git checkout $OIIO_SOURCE_REPO_UID git checkout $OIIO_REPO_UID
git reset --hard git reset --hard
fi
# Always refresh the whole build! # Always refresh the whole build!
if [ -d build ]; then if [ -d build ]; then
@@ -1267,7 +1228,6 @@ compile_OIIO() {
if [ $_with_built_openexr == true ]; then if [ $_with_built_openexr == true ]; then
cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr" cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
cmake_d="$cmake_d -D OPENEXR_HOME=$INST/openexr" cmake_d="$cmake_d -D OPENEXR_HOME=$INST/openexr"
INFO "ILMBASE_HOME=$INST/openexr"
fi fi
# Optional tests and cmd tools # Optional tests and cmd tools
@@ -1398,7 +1358,7 @@ EOF
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst" cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON" cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON"
cmake_d="$cmake_d -D LLVM_TARGETS_TO_BUILD=X86" cmake_d="$cmake_d -D LLVM_TARGETS_TO_BUILD=X86"
cmake_d="$cmake_d -D LLVM_ENABLE_TERMINFO=OFF" cmake_d="$cmake_d -D -DLLVM_ENABLE_TERMINFO=OFF"
if [ -d $_FFI_INCLUDE_DIR ]; then if [ -d $_FFI_INCLUDE_DIR ]; then
cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR" cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR"
@@ -1444,15 +1404,14 @@ clean_OSL() {
compile_OSL() { compile_OSL() {
# To be changed each time we make edits that would modify the compiled result! # To be changed each time we make edits that would modify the compiled result!
osl_magic=17 osl_magic=15
_init_osl _init_osl
# Clean install if needed! # Clean install if needed!
magic_compile_check osl-$OSL_VERSION $osl_magic magic_compile_check osl-$OSL_VERSION $osl_magic
#~ if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then if [ $? -eq 1 -o $OSL_FORCE_REBUILD == true ]; then
#~ rm -Rf $_src # XXX Radical, but not easy to change remote repo fully automatically clean_OSL
#~ clean_OSL fi
#~ fi
if [ ! -d $_inst ]; then if [ ! -d $_inst ]; then
INFO "Building OpenShadingLanguage-$OSL_VERSION" INFO "Building OpenShadingLanguage-$OSL_VERSION"
@@ -1462,26 +1421,26 @@ compile_OSL() {
if [ ! -d $_src ]; then if [ ! -d $_src ]; then
mkdir -p $SRC mkdir -p $SRC
if [ $OSL_USE_REPO == true ]; then # download OSL_SOURCE[@] "$_src.tar.gz"
git clone ${OSL_SOURCE_REPO[0]} $_src
else # INFO "Unpacking OpenShadingLanguage-$OSL_VERSION"
download OSL_SOURCE[@] "$_src.tar.gz" # tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
INFO "Unpacking OpenShadingLanguage-$OSL_VERSION" # -xf $_src.tar.gz
tar -C $SRC --transform "s,(.*/?)OpenShadingLanguage-[^/]*(.*),\1OpenShadingLanguage-$OSL_VERSION\2,x" \
-xf $_src.tar.gz git clone ${OSL_SOURCE[0]} $_src
fi
fi fi
cd $_src cd $_src
if [ $OSL_USE_REPO == true ]; then git remote set-url origin $OSL_SOURCE
git remote set-url origin ${OSL_SOURCE_REPO[0]}
# XXX For now, always update from latest repo... # XXX For now, always update from latest repo...
git pull --no-edit -X theirs origin $OSL_SOURCE_REPO_BRANCH git pull -X theirs origin master
# Stick to same rev as windows' libs...
git checkout $OSL_SOURCE_REPO_UID # Stick to same rev as windows' libs...
git reset --hard git checkout $OSL_REPO_UID
fi git reset --hard
# Always refresh the whole build! # Always refresh the whole build!
if [ -d build ]; then if [ -d build ]; then
@@ -1496,14 +1455,10 @@ compile_OSL() {
cmake_d="$cmake_d -D STOP_ON_WARNING=OFF" cmake_d="$cmake_d -D STOP_ON_WARNING=OFF"
cmake_d="$cmake_d -D BUILDSTATIC=OFF" cmake_d="$cmake_d -D BUILDSTATIC=OFF"
#~ cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION" cmake_d="$cmake_d -D ILMBASE_VERSION=$ILMBASE_VERSION"
if [ $_with_built_openexr == true ]; then if [ $_with_built_openexr == true ]; then
INFO "ILMBASE_HOME=$INST/openexr"
cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr" cmake_d="$cmake_d -D ILMBASE_HOME=$INST/openexr"
# XXX Temp workaround... sigh, ILMBase really messed the things up by defining their custom names ON by default :(
cmake_d="$cmake_d -D ILMBASE_CUSTOM=ON"
cmake_d="$cmake_d -D ILMBASE_CUSTOM_LIBRARIES='Half;Iex;Imath;IlmThread'"
fi fi
if [ -d $INST/boost ]; then if [ -d $INST/boost ]; then
@@ -1517,7 +1472,7 @@ compile_OSL() {
if [ ! -z $LLVM_VERSION_FOUND ]; then if [ ! -z $LLVM_VERSION_FOUND ]; then
cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND" cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
if [ -d $INST/llvm ]; then if [ -d $INST/llvm ]; then
cmake_d="$cmake_d -D LLVM_ROOT_DIR=$INST/llvm" cmake_d="$cmake_d -D LLVM_DIRECTORY=$INST/llvm"
cmake_d="$cmake_d -D LLVM_STATIC=ON" cmake_d="$cmake_d -D LLVM_STATIC=ON"
fi fi
fi fi
@@ -1561,7 +1516,7 @@ clean_OpenCOLLADA() {
compile_OpenCOLLADA() { compile_OpenCOLLADA() {
# To be changed each time we make edits that would modify the compiled results! # To be changed each time we make edits that would modify the compiled results!
opencollada_magic=9 opencollada_magic=8
_init_opencollada _init_opencollada
# Clean install if needed! # Clean install if needed!
@@ -1730,165 +1685,6 @@ compile_FFmpeg() {
fi fi
} }
#### Build ALEMBIC ####
_init_alembic() {
_src=$SRC/Alembic-$ALEMBIC_VERSION
_hg=false
_inst=$INST/alembic-$ALEMBIC_VERSION
_inst_shortcut=$INST/alembic
}
clean_alembic() {
_init_alembic
_clean
}
compile_alembic() {
# To be changed each time we make edits that would modify the compiled result!
alembic_magic=1
_init_alembic
# Clean install if needed!
magic_compile_check alembic-$ALEMBIC_VERSION $alembic_magic
if [ $? -eq 1 -o $ALEMBIC_FORCE_REBUILD == true ]; then
clean_alembic
fi
if [ ! -d $_inst ]; then
INFO "Building Alembic-$ALEMBIC_VERSION"
prepare_opt
if [ ! -d $_src ]; then
mkdir -p $SRC
hg clone -u $ALEMBIC_REPO_UID $ALEMBIC_SOURCE $_src
fi
cd $_src
# XXX Ugly patching hack!
# Alembice cmake files are erratic, to say the least
# have to manually disable a bunch of crap here
cat << EOF | patch -p1
--- a/CMakeLists.txt Mon Jul 28 10:09:21 2014 -0700
+++ b/CMakeLists.txt Thu Oct 16 15:03:27 2014 +0200
@@ -57,9 +57,9 @@
${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} )
SET( VERSION ${PROJECT_VERSION} )
-SET( ALEMBIC_NO_TESTS FALSE )
-SET( ALEMBIC_NO_BOOTSTRAP FALSE )
-SET( ALEMBIC_NO_OPENGL FALSE )
+SET( ALEMBIC_NO_TESTS TRUE )
+SET( ALEMBIC_NO_BOOTSTRAP TRUE )
+SET( ALEMBIC_NO_OPENGL TRUE )
MESSAGE(STATUS "CMAKE SYSTEM NAME = ${CMAKE_SYSTEM_NAME}" )
@@ -306,15 +306,15 @@
ENDIF()
# Include PyAlembic stuff
-IF(DEFINED USE_PYALEMBIC AND NOT USE_PYALEMBIC)
- MESSAGE(STATUS "Skipping Alembic Python bindings")
-ELSE()
- MESSAGE(STATUS "About to include Python cmake files")
- ADD_SUBDIRECTORY( python )
-ENDIF()
+#IF(DEFINED USE_PYALEMBIC AND NOT USE_PYALEMBIC)
+# MESSAGE(STATUS "Skipping Alembic Python bindings")
+#ELSE()
+# MESSAGE(STATUS "About to include Python cmake files")
+# ADD_SUBDIRECTORY( python )
+#ENDIF()
# Example code not supported
-ADD_SUBDIRECTORY( examples )
+#ADD_SUBDIRECTORY( examples )
# Uncomment to build python docs Makefile (requires Sphinx)
# Run `make docs` from build root
EOF
cat << EOF | patch -p1
--- a/lib/Alembic/Util/CMakeLists.txt Mon Jul 28 10:09:21 2014 -0700
+++ b/lib/Alembic/Util/CMakeLists.txt Thu Oct 16 15:03:27 2014 +0200
@@ -65,7 +65,7 @@
DESTINATION include/Alembic/Util
PERMISSIONS OWNER_READ GROUP_READ WORLD_READ )
-IF( NOT ALEMBIC_NO_TESTS )
- ADD_SUBDIRECTORY( Tests )
-ENDIF()
+#IF( NOT ALEMBIC_NO_TESTS )
+# ADD_SUBDIRECTORY( Tests )
+#ENDIF()
EOF
cat << EOF | patch -p1
--- a/python/CMakeLists.txt Mon Jul 28 10:09:21 2014 -0700
+++ b/python/CMakeLists.txt Thu Oct 16 14:20:25 2014 +0200
@@ -35,4 +35,4 @@
ADD_SUBDIRECTORY( PyAlembic )
ADD_SUBDIRECTORY( PyAbcOpenGL )
-ADD_SUBDIRECTORY( examples )
+#ADD_SUBDIRECTORY( examples )
EOF
# Always refresh the whole build!
# XXX 'build' directory is included in Alembic sources, don't touch that
if [ -d blender_build ]; then
rm -rf blender_build
fi
mkdir blender_build
cd blender_build
# XXX Alembic cmake doesn't take these as options
# XXX Alembic creates a subfolder itself ... rather than fix their
# stupid build files, just expect this here by using $INST as prefix
export ALEMBIC_INSTALL_PREFIX=$INST
cmake_d="-D CMAKE_BUILD_TYPE=Release"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$INST"
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -D BUILD_STATIC_LIBS=ON"
cmake_d="$cmake_d -D USE_PYTHON=OFF"
cmake_d="$cmake_d -D USE_PYALEMBIC=OFF"
cmake_d="$cmakd_d -D ALEMBIC_PYTHON_INCLUDE_DIR=/use/include/python2.7" # XXX BAD
cmake_d="$cmakd_d -D ALEMBIC_PYTHON_LIBRARY=/use/lib/python2.7" # XXX BAD
cmake_d="$cmake_d -D USE_PYILMBASE=OFF"
cmake_d="$cmake_d -D ILMBASE_ROOT=$INST/openexr"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_HALF_LIB=$INST/openexr/lib/libHalf.la"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_IEX_LIB=$INST/openexr/lib/libIex-2_1.la"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_ILMTHREAD_LIB=$INST/openexr/lib/libIlmThread-2_1.la"
cmake_d="$cmake_d -D ALEMBIC_ILMBASE_IMATH_LIB=$INST/openexr/lib/libImath-2_1.la"
cmake $cmake_d ../
make -j$THREADS && make install
make clean
if [ -d $_inst ]; then
_create_inst_shortcut
else
ERROR "Alembic-$ALEMBIC_VERSION failed to compile, exiting"
exit 1
fi
magic_compile_set alembic-$ALEMBIC_VERSION $alembic_magic
cd $CWD
INFO "Done compiling Alembic-$ALEMBIC_VERSION!"
else
INFO "Own Alembic-$ALEMBIC_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-alembic option."
fi
}
#### Install on DEB-like #### #### Install on DEB-like ####
get_package_version_DEB() { get_package_version_DEB() {
@@ -1906,7 +1702,7 @@ check_package_DEB() {
} }
check_package_installed_DEB() { check_package_installed_DEB() {
r=`dpkg-query -W -f='${Status}' $1 | grep -c "install ok"` r=`dpkg -s $1 | grep -c '$1'`
if [ $r -ge 1 ]; then if [ $r -ge 1 ]; then
return 0 return 0
@@ -1953,6 +1749,11 @@ install_DEB() {
PRINT "" PRINT ""
INFO "Installing dependencies for DEB-based distribution" INFO "Installing dependencies for DEB-based distribution"
PRINT "" PRINT ""
WARNING "Beware of recent Ubuntu/Debian!!!"
PRINT "Ubuntu 14.4 and Debian Jessie come with a default libyaml-cpp in 0.5 version, while their ocio package still"
PRINT "uses the 0.3 version. You have to use '--libyaml-cpp-ver=0.3' option (else Blender will builds with 0.5,"
PRINT "and break when using packaged ocio)..."
PRINT ""
PRINT "`eval _echo "$COMMON_INFO"`" PRINT "`eval _echo "$COMMON_INFO"`"
PRINT "" PRINT ""
@@ -1995,10 +1796,10 @@ install_DEB() {
OGG_DEV="libogg-dev" OGG_DEV="libogg-dev"
THEORA_DEV="libtheora-dev" THEORA_DEV="libtheora-dev"
_packages="gawk cmake cmake-curses-gui scons mercurial build-essential libjpeg-dev libpng-dev \ _packages="gawk cmake cmake-curses-gui scons build-essential libjpeg-dev libpng-dev \
libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \ libfreetype6-dev libx11-dev libxi-dev wget libsqlite3-dev libbz2-dev \
libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \ libncurses5-dev libssl-dev liblzma-dev libreadline-dev $OPENJPEG_DEV \
libopenal-dev libglew-dev libglewmx-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \ libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev" libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev"
OPENJPEG_USE=true OPENJPEG_USE=true
@@ -2066,7 +1867,7 @@ install_DEB() {
# Only install jack if jack2 is not already installed! # Only install jack if jack2 is not already installed!
JACK="libjack-dev" JACK="libjack-dev"
JACK2="libjack-jackd2-dev" JACK2="libjack-jackd2-dev"
check_package_installed_DEB $JACK2 check_package_installed_DEB JACK2
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
_packages="$_packages $JACK2" _packages="$_packages $JACK2"
else else
@@ -2175,8 +1976,7 @@ install_DEB() {
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
install_packages_DEB libboost-locale$boost_version-dev libboost-filesystem$boost_version-dev \ install_packages_DEB libboost-locale$boost_version-dev libboost-filesystem$boost_version-dev \
libboost-regex$boost_version-dev libboost-system$boost_version-dev \ libboost-regex$boost_version-dev libboost-system$boost_version-dev \
libboost-thread$boost_version-dev libboost-python$boost_version-dev \ libboost-thread$boost_version-dev
libboost-program-options$boost_version-dev libboost-wave$boost_version-dev
clean_Boost clean_Boost
else else
compile_Boost compile_Boost
@@ -2190,14 +1990,13 @@ install_DEB() {
if $OCIO_SKIP; then if $OCIO_SKIP; then
WARNING "Skipping OpenColorIO installation, as requested..." WARNING "Skipping OpenColorIO installation, as requested..."
else else
# XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)! check_package_version_ge_DEB libopencolorio-dev $OCIO_VERSION_MIN
#check_package_version_ge_DEB libopencolorio-dev $OCIO_VERSION_MIN if [ $? -eq 0 ]; then
#if [ $? -eq 0 ]; then install_packages_DEB libopencolorio-dev
#install_packages_DEB libopencolorio-dev clean_OCIO
#clean_OCIO else
#else
compile_OCIO compile_OCIO
#fi fi
fi fi
PRINT "" PRINT ""
@@ -2309,14 +2108,6 @@ install_DEB() {
# fi # fi
compile_FFmpeg compile_FFmpeg
fi fi
if $ALEMBIC_SKIP; then
WARNING "Skipping Alembic installation, as requested..."
else
install_packages_DEB libhdf5-dev
install_packages_DEB libpython2.7-dev # XXX nasty hack, should be done better ...
compile_alembic
fi
} }
@@ -2479,7 +2270,7 @@ install_RPM() {
OGG_DEV="libogg-devel" OGG_DEV="libogg-devel"
THEORA_DEV="libtheora-devel" THEORA_DEV="libtheora-devel"
_packages="gcc gcc-c++ make scons libtiff-devel libjpeg-devel\ _packages="gcc gcc-c++ make scons libtiff-devel freetype-devel libjpeg-devel\
libpng-devel libX11-devel libXi-devel wget ncurses-devel \ libpng-devel libX11-devel libXi-devel wget ncurses-devel \
readline-devel $OPENJPEG_DEV openal-soft-devel \ readline-devel $OPENJPEG_DEV openal-soft-devel \
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \ glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
@@ -2493,7 +2284,7 @@ install_RPM() {
if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then if [ $RPM = "FEDORA" -o $RPM = "RHEL" ]; then
OPENEXR_DEV="openexr-devel" OPENEXR_DEV="openexr-devel"
_packages="$_packages freetype-devel libsqlite3x-devel fftw-devel SDL-devel" _packages="$_packages libsqlite3x-devel fftw-devel SDL-devel"
if $WITH_ALL; then if $WITH_ALL; then
_packages="$_packages jack-audio-connection-kit-devel" _packages="$_packages jack-audio-connection-kit-devel"
@@ -2531,7 +2322,7 @@ install_RPM() {
elif [ $RPM = "SUSE" ]; then elif [ $RPM = "SUSE" ]; then
OPENEXR_DEV="libopenexr-devel" OPENEXR_DEV="libopenexr-devel"
_packages="$_packages cmake freetype2-devel sqlite3-devel fftw3-devel libSDL-devel" _packages="$_packages cmake sqlite3-devel fftw3-devel libSDL-devel"
PRINT "" PRINT ""
install_packages_RPM $_packages install_packages_RPM $_packages
@@ -2633,14 +2424,13 @@ install_RPM() {
if $OCIO_SKIP; then if $OCIO_SKIP; then
WARNING "Skipping OpenColorIO installation, as requested..." WARNING "Skipping OpenColorIO installation, as requested..."
else else
# XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)! check_package_version_ge_RPM OpenColorIO-devel $OCIO_VERSION_MIN
#check_package_version_ge_RPM OpenColorIO-devel $OCIO_VERSION_MIN if [ $? -eq 0 ]; then
#if [ $? -eq 0 ]; then install_packages_RPM OpenColorIO-devel
#install_packages_RPM OpenColorIO-devel clean_OCIO
#clean_OCIO else
#else
compile_OCIO compile_OCIO
#fi fi
fi fi
PRINT "" PRINT ""
@@ -2943,15 +2733,14 @@ install_ARCH() {
if $OCIO_SKIP; then if $OCIO_SKIP; then
WARNING "Skipping OpenColorIO installation, as requested..." WARNING "Skipping OpenColorIO installation, as requested..."
else else
# XXX Always force build of own OCIO, until linux distro guys update their package to default libyaml-cpp ver (0.5)! check_package_version_ge_ARCH opencolorio $OCIO_VERSION_MIN
#check_package_version_ge_ARCH opencolorio $OCIO_VERSION_MIN if [ $? -eq 0 ]; then
#if [ $? -eq 0 ]; then install_packages_ARCH opencolorio yaml-cpp tinyxml
#install_packages_ARCH opencolorio yaml-cpp tinyxml clean_OCIO
#clean_OCIO else
#else
install_packages_ARCH yaml-cpp tinyxml install_packages_ARCH yaml-cpp tinyxml
compile_OCIO compile_OCIO
#fi fi
fi fi
PRINT "" PRINT ""
@@ -3189,7 +2978,7 @@ print_info() {
_buildargs="$_buildargs $_1" _buildargs="$_buildargs $_1"
fi fi
if [ -d $INST/llvm ]; then if [ -d $INST/llvm ]; then
_1="-D LLVM_ROOT_DIR=$INST/llvm" _1="-D LLVM_DIRECTORY=$INST/llvm"
_2="-D LLVM_STATIC=ON" _2="-D LLVM_STATIC=ON"
PRINT " $_1" PRINT " $_1"
PRINT " $_2" PRINT " $_2"
@@ -3222,12 +3011,6 @@ print_info() {
fi fi
fi fi
if [ -d $INST/alembic ]; then
_1="-D ALEMBIC_ROOT_DIR=$INST/alembic"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
PRINT "" PRINT ""
PRINT "Or even simpler, just run (in your blender-source dir):" PRINT "Or even simpler, just run (in your blender-source dir):"
PRINT " make -j$THREADS BUILD_CMAKE_ARGS=\"$_buildargs\"" PRINT " make -j$THREADS BUILD_CMAKE_ARGS=\"$_buildargs\""
@@ -3251,10 +3034,10 @@ print_info() {
PRINT "BF_OPENEXR = '$INST/openexr'" PRINT "BF_OPENEXR = '$INST/openexr'"
_ilm_libs_ext="" _ilm_libs_ext=""
#~ version_ge $OPENEXR_VERSION "2.1.0" version_ge $OPENEXR_VERSION "2.1.0"
#~ if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
#~ _ilm_libs_ext=`echo $OPENEXR_VERSION | sed -r 's/([0-9]+)\.([0-9]+).*/-\1_\2/'` _ilm_libs_ext=`echo $OPENEXR_VERSION | sed -r 's/([0-9]+)\.([0-9]+).*/-\1_\2/'`
#~ fi fi
PRINT "BF_OPENEXR_LIB = 'Half IlmImf$_ilm_libs_ext Iex$_ilm_libs_ext Imath$_ilm_libs_ext '" PRINT "BF_OPENEXR_LIB = 'Half IlmImf$_ilm_libs_ext Iex$_ilm_libs_ext Imath$_ilm_libs_ext '"
# BF_OPENEXR_LIB does not work, things like '-lIlmImf-2_1' do not suit ld. # BF_OPENEXR_LIB does not work, things like '-lIlmImf-2_1' do not suit ld.
# For now, hack around!!! # For now, hack around!!!
@@ -3297,13 +3080,6 @@ print_info() {
PRINT "BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice `print_info_ffmpeglink`'" PRINT "BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice `print_info_ffmpeglink`'"
fi fi
if [ "$ALEMBIC_SKIP" = false ]; then
PRINT "WITH_BF_ALEMBIC = True"
if [ -d $INST/alembic ]; then
PRINT "BF_ALEMBIC = '$INST/alembic'"
fi
fi
if [ "$WITH_ALL" = false ]; then if [ "$WITH_ALL" = false ]; then
PRINT "WITH_BF_3DMOUSE = False" PRINT "WITH_BF_3DMOUSE = False"
# No libspacenav in official arch repos... # No libspacenav in official arch repos...
@@ -3332,9 +3108,9 @@ else
exit 1 exit 1
fi fi
print_info | tee $INFO_PATH/BUILD_NOTES.txt print_info | tee BUILD_NOTES.txt
PRINT "" PRINT ""
PRINT "This information has been written to $INFO_PATH/BUILD_NOTES.txt" PRINT "This information has been written to BUILD_NOTES.txt"
PRINT "" PRINT ""
# Switch back to user language. # Switch back to user language.

View File

@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-i686'
BF_INSTALLDIR = '../blender-install/linux-glibc211-i686' BF_INSTALLDIR = '../blender-install/linux-glibc211-i686'
BF_NUMJOBS = 1 BF_NUMJOBS = 1
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']

View File

@@ -2,4 +2,4 @@ BF_BUILDDIR = '../blender-build/linux-glibc211-x86_64'
BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64' BF_INSTALLDIR = '../blender-install/linux-glibc211-x86_64'
BF_NUMJOBS = 1 BF_NUMJOBS = 1
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']

View File

@@ -22,7 +22,7 @@ BF_OPENCOLLADA_LIB_STATIC = '${BF_OPENCOLLADA}/lib/libOpenCOLLADAStreamWriter.a
'${BF_OPENCOLLADA}/lib/libOpenCOLLADAFramework.a ' + \ '${BF_OPENCOLLADA}/lib/libOpenCOLLADAFramework.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADABaseUtils.a ' + \ '${BF_OPENCOLLADA}/lib/libOpenCOLLADABaseUtils.a ' + \
'${BF_OPENCOLLADA}/lib/libGeneratedSaxParser.a ' + \ '${BF_OPENCOLLADA}/lib/libGeneratedSaxParser.a ' + \
'${BF_OPENCOLLADA}/lib/libMathMLSolver.a ' + \ '${BF_OPENCOLLADA}/lib/libUTF.a ${BF_OPENCOLLADA}/lib/libMathMLSolver.a ' + \
'${BF_OPENCOLLADA}/lib/libbuffer.a ${BF_OPENCOLLADA}/lib/libftoa.a ' + \ '${BF_OPENCOLLADA}/lib/libbuffer.a ${BF_OPENCOLLADA}/lib/libftoa.a ' + \
'/usr/lib/libxml2.a /usr/lib/libexpat.a /usr/lib/libpcre.a' '/usr/lib/libxml2.a /usr/lib/libexpat.a /usr/lib/libpcre.a'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib /home/sources/staticlibs/lib64' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib /home/sources/staticlibs/lib64'
@@ -49,7 +49,7 @@ BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal' BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a' BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a'
WITH_BF_GETTEXT_STATIC = True WITH_BF_GETTEXT_STATIC = True
@@ -79,8 +79,6 @@ WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = True WITH_BF_OGG = True
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
@@ -124,22 +122,20 @@ BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a' BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib' BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
BF_IS_NEW_OSL = False
WITH_BF_CYCLES_OSL = True WITH_BF_CYCLES_OSL = True
WITH_BF_STATICOSL = BF_IS_NEW_OSL WITH_BF_STATICOSL = False
BF_OSL = '/opt/lib/osl' BF_OSL = '/opt/lib/osl'
BF_OSL_INC = '${BF_OSL}/include' BF_OSL_INC = '${BF_OSL}/include'
# note oslexec would passed via program linkflags, which is needed to # note oslexec would passed via program linkflags, which is needed to
# make llvm happy with osl_allocate_closure_component # make llvm happy with osl_allocate_closure_component
BF_OSL_LIB = 'oslcomp oslexec oslquery' BF_OSL_LIB = 'oslcomp oslexec oslquery'
BF_OSL_LIB_STATIC = '${BF_OSL}/lib/liboslcomp.a ${BF_OSL}/lib/liboslexec.a ${BF_OSL}/lib/liboslquery.a'
BF_OSL_LIBPATH = '${BF_OSL}/lib' BF_OSL_LIBPATH = '${BF_OSL}/lib'
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc' BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
WITH_BF_LLVM = True WITH_BF_LLVM = True
WITH_BF_STATICLLVM = False WITH_BF_STATICLLVM = False
BF_LLVM = '/opt/lib/llvm-3.4.2' BF_LLVM = '/opt/lib/llvm-3.1'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMObject LLVMX86Info LLVMX86AsmPrinter ' + \ BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \ 'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMSupport' 'LLVMTarget LLVMMC LLVMCore LLVMSupport'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib' BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
@@ -159,31 +155,13 @@ BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \ BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \ '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
${BF_BOOST_LIBPATH}/libboost_thread.a' ${BF_BOOST_LIBPATH}/libboost_thread.a'
if BF_IS_NEW_OSL:
BF_BOOST_LIB_STATIC += ' ${BF_BOOST_LIBPATH}/libboost_wave.a'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib' BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
# Ocean Simulation # Ocean Simulation
WITH_BF_OCEANSIM = True WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization # Compilation and optimization
BF_DEBUG = False BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++ REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
PLATFORM_LINKFLAGS = ['-lrt'] PLATFORM_LINKFLAGS = ['-lrt']
if BF_IS_NEW_OSL: BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
BF_PROGRAM_LINKFLAGS = ['-Wl,--version-script=source/creator/blender.map']
else:
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']

View File

@@ -22,7 +22,7 @@ BF_OPENCOLLADA_LIB_STATIC = '${BF_OPENCOLLADA}/lib/libOpenCOLLADAStreamWriter.a
'${BF_OPENCOLLADA}/lib/libOpenCOLLADAFramework.a ' + \ '${BF_OPENCOLLADA}/lib/libOpenCOLLADAFramework.a ' + \
'${BF_OPENCOLLADA}/lib/libOpenCOLLADABaseUtils.a ' + \ '${BF_OPENCOLLADA}/lib/libOpenCOLLADABaseUtils.a ' + \
'${BF_OPENCOLLADA}/lib/libGeneratedSaxParser.a ' + \ '${BF_OPENCOLLADA}/lib/libGeneratedSaxParser.a ' + \
'${BF_OPENCOLLADA}/lib/libMathMLSolver.a ' + \ '${BF_OPENCOLLADA}/lib/libUTF.a ${BF_OPENCOLLADA}/lib/libMathMLSolver.a ' + \
'${BF_OPENCOLLADA}/lib/libbuffer.a ${BF_OPENCOLLADA}/lib/libftoa.a ' + \ '${BF_OPENCOLLADA}/lib/libbuffer.a ${BF_OPENCOLLADA}/lib/libftoa.a ' + \
'/usr/lib/libxml2.a /usr/lib/libexpat.a /usr/lib/libpcre.a' '/usr/lib/libxml2.a /usr/lib/libexpat.a /usr/lib/libpcre.a'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib /home/sources/staticlibs/lib64' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib /home/sources/staticlibs/lib64'
@@ -49,7 +49,7 @@ BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal' BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a' BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a'
WITH_BF_GETTEXT_STATIC = True WITH_BF_GETTEXT_STATIC = True
@@ -79,8 +79,6 @@ WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = True WITH_BF_OGG = True
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
@@ -124,22 +122,20 @@ BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a' BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib' BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
BF_IS_NEW_OSL = False
WITH_BF_CYCLES_OSL = True WITH_BF_CYCLES_OSL = True
WITH_BF_STATICOSL = BF_IS_NEW_OSL WITH_BF_STATICOSL = False
BF_OSL = '/opt/lib/osl' BF_OSL = '/opt/lib/osl'
BF_OSL_INC = '${BF_OSL}/include' BF_OSL_INC = '${BF_OSL}/include'
# note oslexec would passed via program linkflags, which is needed to # note oslexec would passed via program linkflags, which is needed to
# make llvm happy with osl_allocate_closure_component # make llvm happy with osl_allocate_closure_component
BF_OSL_LIB = 'oslcomp oslexec oslquery' BF_OSL_LIB = 'oslcomp oslexec oslquery'
BF_OSL_LIB_STATIC = '${BF_OSL}/lib/liboslcomp.a ${BF_OSL}/lib/liboslexec.a ${BF_OSL}/lib/liboslquery.a'
BF_OSL_LIBPATH = '${BF_OSL}/lib' BF_OSL_LIBPATH = '${BF_OSL}/lib'
BF_OSL_COMPILER = '${BF_OSL}/bin/oslc' BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
WITH_BF_LLVM = True WITH_BF_LLVM = True
WITH_BF_STATICLLVM = False WITH_BF_STATICLLVM = False
BF_LLVM = '/opt/lib/llvm-3.4.2' BF_LLVM = '/opt/lib/llvm-3.1'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMObject LLVMX86Info LLVMX86AsmPrinter ' + \ BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \ 'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMSupport' 'LLVMTarget LLVMMC LLVMCore LLVMSupport'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib' BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
@@ -159,31 +155,13 @@ BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \ BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \ '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a \
${BF_BOOST_LIBPATH}/libboost_thread.a' ${BF_BOOST_LIBPATH}/libboost_thread.a'
if BF_IS_NEW_OSL:
BF_BOOST_LIB_STATIC += ' ${BF_BOOST_LIBPATH}/libboost_wave.a'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib' BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
# Ocean Simulation # Ocean Simulation
WITH_BF_OCEANSIM = True WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization # Compilation and optimization
BF_DEBUG = False BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++ REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++
PLATFORM_LINKFLAGS = ['-lrt'] PLATFORM_LINKFLAGS = ['-lrt']
if BF_IS_NEW_OSL: BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']
BF_PROGRAM_LINKFLAGS = ['-Wl,--version-script=source/creator/blender.map']
else:
BF_PROGRAM_LINKFLAGS = ['-Wl,--whole-archive', '-loslexec', '-Wl,--no-whole-archive', '-Wl,--version-script=source/creator/blender.map']

View File

@@ -3,7 +3,3 @@ MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
WITH_BF_CYCLES_CUDA_BINARIES = True WITH_BF_CYCLES_CUDA_BINARIES = True
WITH_BF_CYCLES_OSL = False # OSL never worked on OSX 32bit !
WITH_BF_COLLADA = False # we drop 32bit, newest collada is only x86_64 !

View File

@@ -1,6 +1,5 @@
CC = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang"
CXX = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang++"
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64 MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
WITH_BF_CYCLES_CUDA_BINARIES = True WITH_BF_CYCLES_CUDA_BINARIES = True

View File

@@ -34,7 +34,7 @@ BF_CXX_LIB_STATIC = '/usr/lib/gcc/i486-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal' BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a' BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a'
WITH_BF_GETTEXT_STATIC = True WITH_BF_GETTEXT_STATIC = True
@@ -64,8 +64,6 @@ WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = False WITH_BF_OGG = False
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
@@ -120,19 +118,6 @@ WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True WITH_BF_STATICFFTW3 = True
WITH_BF_OCEANSIM = True WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization # Compilation and optimization
BF_DEBUG = False BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++ REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++

View File

@@ -34,7 +34,7 @@ BF_CXX_LIB_STATIC = '/usr/lib/gcc/x86_64-linux-gnu/4.7.1/libstdc++.a'
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
WITH_BF_STATICOPENAL = True WITH_BF_STATICOPENAL = True
BF_OPENAL = '/opt/lib/openal' BF_OPENAL = '/opt/lib/openal'
BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a /opt/lib/openal/lib/libcommon.a' BF_OPENAL_LIB_STATIC = '/opt/lib/openal/lib/libopenal.a'
WITH_BF_GETTEXT_STATIC = True WITH_BF_GETTEXT_STATIC = True
@@ -64,8 +64,6 @@ WITH_BF_STATICZLIB = True
BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a' BF_ZLIB_LIB_STATIC = '${BF_ZLIB}/lib/libz.a'
WITH_BF_SDL = True WITH_BF_SDL = True
WITH_BF_SDL_DYNLOAD = True
WITH_BF_OGG = False WITH_BF_OGG = False
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
@@ -120,19 +118,6 @@ WITH_BF_FFTW3 = True
WITH_BF_STATICFFTW3 = True WITH_BF_STATICFFTW3 = True
WITH_BF_OCEANSIM = True WITH_BF_OCEANSIM = True
# Alembic
WITH_BF_HDF5 = False
WITH_BF_ALEMBIC = True
WITH_BF_STATICALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH = '${BF_ALEMBIC}/lib/static'
BF_ALEMBIC_LIB_STATIC = '${BF_ALEMBIC_LIBPATH}/libAlembicAbcGeom.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbc.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCollection.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreFactory.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcMaterial.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicOgawa.a ${BF_ALEMBIC_LIBPATH}/libAlembicAbcCoreAbstract.a ' + \
'${BF_ALEMBIC_LIBPATH}/libAlembicUtil.a'
# Compilation and optimization # Compilation and optimization
BF_DEBUG = False BF_DEBUG = False
REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++ REL_CCFLAGS = ['-DNDEBUG', '-O2', '-msse', '-msse2'] # C & C++

View File

@@ -3,58 +3,6 @@
# <pep8 compliant> # <pep8 compliant>
# List of the branches being built automatically overnight
NIGHT_SCHEDULE_BRANCHES = [None, "gooseberry"]
# List of the branches available for force build
FORCE_SCHEDULE_BRANCHES = ["master", "gooseberry", "experimental-build"]
"""
Stock Twisted directory lister doesn't provide any information about last file
modification time, we hack the class a bit in order to have such functionaliity
:)
"""
from buildbot.status.web.base import DirectoryLister
def get_files_and_directories(self, directory):
from twisted.web.static import (getTypeAndEncoding,
formatFileSize)
import urllib
import cgi
import time
import os
files = []
dirs = []
for path in directory:
url = urllib.quote(path, "/")
escapedPath = cgi.escape(path)
lastmodified = time.ctime(os.path.getmtime(
os.path.join(self.path, path)))
if os.path.isdir(os.path.join(self.path, path)):
url = url + '/'
dirs.append({'text': escapedPath + "/", 'href': url,
'size': '', 'type': '[Directory]',
'encoding': '',
'lastmodified': lastmodified})
else:
mimetype, encoding = getTypeAndEncoding(path, self.contentTypes,
self.contentEncodings,
self.defaultType)
try:
size = os.stat(os.path.join(self.path, path)).st_size
except OSError:
continue
files.append({
'text': escapedPath, "href": url,
'type': '[%s]' % mimetype,
'encoding': (encoding and '[%s]' % encoding or ''),
'size': formatFileSize(size),
'lastmodified': lastmodified})
return dirs, files
DirectoryLister._getFilesAndDirectories = get_files_and_directories
# Dictionary that the buildmaster pays attention to. # Dictionary that the buildmaster pays attention to.
c = BuildmasterConfig = {} c = BuildmasterConfig = {}
@@ -84,89 +32,51 @@ c['change_source'] = GitPoller(
'git://git.blender.org/blender.git', 'git://git.blender.org/blender.git',
pollinterval=1200) pollinterval=1200)
# CODEBASES
#
# Allow to controll separately things like branches for each repo and submodules.
all_repositories = {
r'git://git.blender.org/blender.git': 'blender',
r'git://git.blender.org/blender-translations.git': 'blender-translations',
r'git://git.blender.org/blender-addons.git': 'blender-addons',
r'git://git.blender.org/blender-addons-contrib.git': 'blender-addons-contrib',
r'git://git.blender.org/scons.git': 'scons',
r'https://svn.blender.org/svnroot/bf-blender/': 'lib svn',
}
def codebaseGenerator(chdict):
return all_repositories[chdict['repository']]
c['codebaseGenerator'] = codebaseGenerator
# SCHEDULERS # SCHEDULERS
# #
# Decide how to react to incoming changes. # Decide how to react to incoming changes.
# from buildbot.scheduler import Scheduler # from buildbot.scheduler import Scheduler
from buildbot.schedulers import timed, forcesched from buildbot.schedulers import timed
c['schedulers'] = [] c['schedulers'] = []
def schedule_force_build(name):
c['schedulers'].append(forcesched.ForceScheduler(name='force ' + name,
builderNames=[name],
codebases=[forcesched.CodebaseParameter(
codebase="blender",
branch=forcesched.ChoiceStringParameter(
name="branch", choices=FORCE_SCHEDULE_BRANCHES, default="master"),
# Do not hide revision, can be handy!
repository=forcesched.FixedParameter(name="repository", default="", hide=True),
project=forcesched.FixedParameter(name="project", default="", hide=True)),
# For now, hide other codebases.
forcesched.CodebaseParameter(hide=True, codebase="blender-translations"),
forcesched.CodebaseParameter(hide=True, codebase="blender-addons"),
forcesched.CodebaseParameter(hide=True, codebase="blender-addons-contrib"),
forcesched.CodebaseParameter(hide=True, codebase="scons"),
forcesched.CodebaseParameter(hide=True, codebase="lib svn")],
properties=[]))
def schedule_build(name, hour, minute=0): def schedule_build(name, hour, minute=0):
for current_branch in NIGHT_SCHEDULE_BRANCHES: c['schedulers'].append(timed.Nightly(name='nightly ' + name,
scheduler_name = "nightly " + name builderNames=[name],
if current_branch: hour=hour,
scheduler_name += ' ' + current_branch minute=minute))
c['schedulers'].append(timed.Nightly(name=scheduler_name,
codebases={
"blender": {"repository": ""},
"blender-translations": {"repository": "", "branch": "master"},
"blender-addons": {"repository": "", "branch": "master"},
"blender-addons-contrib": {"repository": "", "branch": "master"},
"scons": {"repository": "", "branch": "master"},
"lib svn": {"repository": "", "branch": "trunk"}},
branch=current_branch,
builderNames=[name],
hour=hour,
minute=minute))
"""
schedule_cycle = 4
for i in range(0, schedule_cycle):
names = []
for j in range(0, len(buildernames)):
if j % schedule_cycle == i:
names += [buildernames[j]]
print(names)
c['schedulers'].append(timed.Nightly(name='nightly' + str(i),
builderNames=names,
hour=3+i,
minute=0))
"""
# BUILDERS # BUILDERS
# #
# The 'builders' list defines the Builders, which tell Buildbot how to # The 'builders' list defines the Builders, which tell Buildbot how to perform a build:
# perform a build: what steps, and which slaves can execute them. # what steps, and which slaves can execute them. Note that any particular build will
# Note that any particular build will only take place on one slave. # only take place on one slave.
from buildbot.process.factory import BuildFactory from buildbot.process.factory import BuildFactory
from buildbot.process.properties import Interpolate
from buildbot.steps.source import SVN from buildbot.steps.source import SVN
from buildbot.steps.source import Git from buildbot.steps.source import Git
from buildbot.steps.shell import ShellCommand from buildbot.steps.shell import ShellCommand
from buildbot.steps.shell import Compile from buildbot.steps.shell import Compile
from buildbot.steps.shell import Test from buildbot.steps.shell import Test
from buildbot.steps.transfer import FileUpload from buildbot.steps.transfer import FileUpload
# from buildbot.steps.transfer import FileDownload
from buildbot.steps.master import MasterShellCommand from buildbot.steps.master import MasterShellCommand
from buildbot.config import BuilderConfig from buildbot.config import BuilderConfig
@@ -176,8 +86,7 @@ c['builders'] = []
buildernames = [] buildernames = []
def add_builder(c, name, libdir, factory, branch='', def add_builder(c, name, libdir, factory, branch='', rsync=False, hour=3, minute=0):
rsync=False, hour=3, minute=0):
slavenames = [] slavenames = []
for slave in master_private.slaves: for slave in master_private.slaves:
@@ -186,69 +95,31 @@ def add_builder(c, name, libdir, factory, branch='',
if len(slavenames) > 0: if len(slavenames) > 0:
f = factory(name, libdir, branch, rsync) f = factory(name, libdir, branch, rsync)
c['builders'].append(BuilderConfig(name=name, c['builders'].append(BuilderConfig(name=name, slavenames=slavenames, factory=f, category='blender'))
slavenames=slavenames,
factory=f,
category='blender'))
buildernames.append(name) buildernames.append(name)
schedule_build(name, hour, minute) schedule_build(name, hour, minute)
schedule_force_build(name)
# common steps # common steps
def git_submodule_step(submodule): def git_submodule_step(submodule):
return Git(name=submodule + '.git', return Git(name=submodule+'.git', repourl='git://git.blender.org/' + submodule + '.git', mode='update', workdir=submodule + '.git')
repourl='git://git.blender.org/' + submodule + '.git',
mode='update',
codebase=submodule,
workdir=submodule + '.git')
def git_step(branch=''): def git_step(branch=''):
if branch: if branch:
return Git(name='blender.git', return Git(name='blender.git', repourl='git://git.blender.org/blender.git', mode='update', branch=branch, workdir='blender.git', submodules=True)
repourl='git://git.blender.org/blender.git',
mode='update',
branch=branch,
codebase='blender',
workdir='blender.git',
submodules=True)
else: else:
return Git(name='blender.git', return Git(name='blender.git', repourl='git://git.blender.org/blender.git', mode='update', workdir='blender.git', submodules=True)
repourl='git://git.blender.org/blender.git',
mode='update',
codebase='blender',
workdir='blender.git',
submodules=True)
def git_submodules_update(): def git_submodules_update():
command = ['git', 'submodule', 'foreach', '--recursive', command = ['git', 'submodule', 'foreach', '--recursive', 'git', 'pull', 'origin', 'master']
'git', 'pull', 'origin', 'master'] return ShellCommand(name='Submodules Update', command=command, description='updating', descriptionDone='up to date', workdir='blender.git')
return ShellCommand(name='Submodules Update',
command=command,
description='updating',
descriptionDone='up to date',
workdir='blender.git')
def lib_svn_step(dir): def lib_svn_step(dir):
return SVN(name='lib svn', return SVN(name='lib svn', baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir, mode='update', defaultBranch='trunk', workdir='lib/' + dir)
baseURL='https://svn.blender.org/svnroot/bf-blender/%%BRANCH%%/lib/' + dir,
codebase='lib svn',
mode='update',
defaultBranch='trunk',
workdir='lib/' + dir)
def rsync_step(id, branch, rsync_script): def rsync_step(id, branch, rsync_script):
return ShellCommand(name='rsync', return ShellCommand(name='rsync', command=['python', rsync_script, id, branch], description='uploading', descriptionDone='uploaded', workdir='install')
command=['python', rsync_script, id, branch],
description='uploading',
descriptionDone='uploaded',
workdir='install')
# generic builder # generic builder
@@ -265,38 +136,21 @@ def generic_builder(id, libdir='', branch='', rsync=False):
if libdir != '': if libdir != '':
f.addStep(lib_svn_step(libdir)) f.addStep(lib_svn_step(libdir))
for submodule in ('blender-translations', for submodule in ('blender-translations', 'blender-addons', 'blender-addons-contrib', 'scons'):
'blender-addons',
'blender-addons-contrib',
'scons'):
f.addStep(git_submodule_step(submodule)) f.addStep(git_submodule_step(submodule))
f.addStep(git_step(branch)) f.addStep(git_step(branch))
f.addStep(git_submodules_update()) f.addStep(git_submodules_update())
f.addStep(Compile(command=['python', compile_script, id], timeout=3600)) f.addStep(Compile(command=['python', compile_script, id], timeout=3600))
f.addStep(Test(command=['python', test_script, id])) f.addStep(Test(command=['python', test_script, id]))
f.addStep(ShellCommand(name='package', f.addStep(ShellCommand(name='package', command=['python', pack_script, id, branch], description='packaging', descriptionDone='packaged'))
command=['python', pack_script, id, branch or Interpolate('%(src:blender:branch)s')],
description='packaging',
descriptionDone='packaged'))
if rsync: if rsync:
f.addStep(rsync_step(id, branch, rsync_script)) f.addStep(rsync_step(id, branch, rsync_script))
elif id.find('cmake') != -1: elif id.find('cmake') != -1:
f.addStep(FileUpload(name='upload', f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=150 * 1024 * 1024))
slavesrc='buildbot_upload.zip',
masterdest=filename,
maxsize=150 * 1024 * 1024))
else: else:
f.addStep(FileUpload(name='upload', f.addStep(FileUpload(name='upload', slavesrc='buildbot_upload.zip', masterdest=filename, maxsize=150 * 1024 * 1024, workdir='install'))
slavesrc='buildbot_upload.zip', f.addStep(MasterShellCommand(name='unpack', command=['python', unpack_script, filename], description='unpacking', descriptionDone='unpacked'))
masterdest=filename,
maxsize=150 * 1024 * 1024,
workdir='install'))
f.addStep(MasterShellCommand(name='unpack',
command=['python', unpack_script, filename],
description='unpacking',
descriptionDone='unpacked'))
return f return f
# builders # builders
@@ -305,10 +159,12 @@ add_builder(c, 'mac_x86_64_10_6_scons', 'darwin-9.x.universal', generic_builder,
add_builder(c, 'mac_i386_10_6_scons', 'darwin-9.x.universal', generic_builder, hour=11) add_builder(c, 'mac_i386_10_6_scons', 'darwin-9.x.universal', generic_builder, hour=11)
add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder, hour=1) add_builder(c, 'linux_glibc211_i386_scons', '', generic_builder, hour=1)
add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder, hour=2) add_builder(c, 'linux_glibc211_x86_64_scons', '', generic_builder, hour=2)
add_builder(c, 'win32_scons', 'windows', generic_builder, hour=1)
add_builder(c, 'win64_scons', 'win64', generic_builder, hour=2)
#add_builder(c, 'win32_scons_vc2012', 'windows_vc11', generic_builder, hour=1)
#add_builder(c, 'win64_scons_vc2012', 'win64_vc11', generic_builder, hour=2)
add_builder(c, 'win32_scons_vc2013', 'windows_vc12', generic_builder, hour=1) add_builder(c, 'win32_scons_vc2013', 'windows_vc12', generic_builder, hour=1)
add_builder(c, 'win64_scons_vc2013', 'win64_vc12', generic_builder, hour=2) add_builder(c, 'win64_scons_vc2013', 'win64_vc12', generic_builder, hour=2)
add_builder(c, 'win32_cmake_vc2013', 'windows_vc12', generic_builder, hour=3)
add_builder(c, 'win64_cmake_vc2013', 'win64_vc12', generic_builder, hour=4)
#add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder, hour=4) #add_builder(c, 'mingw_win32_scons', 'mingw32', generic_builder, hour=4)
add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder, hour=3) add_builder(c, 'mingw_win64_scons', 'mingw64', generic_builder, hour=3)
#add_builder(c, 'freebsd_i386_cmake', '', generic_builder, hour=1) #add_builder(c, 'freebsd_i386_cmake', '', generic_builder, hour=1)
@@ -339,16 +195,15 @@ authz_cfg = authz.Authz(
# change any of these to True to enable; see the manual for more # change any of these to True to enable; see the manual for more
# options # options
gracefulShutdown=False, gracefulShutdown=False,
forceBuild=True, # use this to test your slave once it is set up forceBuild='auth', # use this to test your slave once it is set up
forceAllBuilds=False, forceAllBuilds=False,
pingBuilder=False, pingBuilder=False,
stopBuild=True, stopBuild='auth',
stopAllBuilds=False, stopAllBuilds=False,
cancelPendingBuild=True, cancelPendingBuild='auth',
) )
c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg)) c['status'].append(html.WebStatus(http_port=8010, authz=authz_cfg))
#c['status'].append(html.WebStatus(http_port=8010))
# PROJECT IDENTITY # PROJECT IDENTITY

View File

@@ -30,12 +30,11 @@ import zipfile
# extension stripping # extension stripping
def strip_extension(filename): def strip_extension(filename):
extensions = '.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe' extensions = '.zip', '.tar', '.bz2', '.gz', '.tgz', '.tbz', '.exe'
filename_noext, ext = os.path.splitext(filename)
for ext in extensions: if ext in extensions:
if filename.endswith(ext): return strip_extension(filename_noext) # may have .tar.bz2
filename = filename[:-len(ext)] else:
return filename
return filename
# extract platform from package name # extract platform from package name
@@ -49,11 +48,12 @@ def get_platform(filename):
tokens = filename.split("-") tokens = filename.split("-")
platforms = ('osx', 'mac', 'bsd', platforms = ('osx', 'mac', 'bsd',
'win', 'linux', 'source', 'win', 'linux', 'source',
'irix', 'solaris', 'mingw') 'solaris',
'mingw')
platform_tokens = [] platform_tokens = []
found = False found = False
for i, token in enumerate(tokens): for token in tokens:
if not found: if not found:
for platform in platforms: for platform in platforms:
if platform in token.lower(): if platform in token.lower():
@@ -71,14 +71,14 @@ def get_branch(filename):
branch = "" branch = ""
for token in tokens: for token in tokens:
if token == "blender":
return branch
if branch == "": if branch == "":
branch = token branch = token
else: else:
branch = branch + "-" + token branch = branch + "-" + token
if token == "blender":
return branch
return "" return ""
# get filename # get filename
@@ -95,7 +95,7 @@ if not os.path.exists(filename):
try: try:
z = zipfile.ZipFile(filename, "r") z = zipfile.ZipFile(filename, "r")
except Exception as ex: except Exception, ex:
sys.stderr.write('Failed to open zip file: %s\n' % str(ex)) sys.stderr.write('Failed to open zip file: %s\n' % str(ex))
sys.exit(1) sys.exit(1)
@@ -112,28 +112,23 @@ branch = get_branch(packagename)
if platform == '': if platform == '':
sys.stderr.write('Failed to detect platform ' + sys.stderr.write('Failed to detect platform ' +
'from package: %r\n' % packagename) 'from package: %r\n' % packagename)
sys.exit(1) sys.exit(1)
# extract # extract
if not branch or branch == 'master': directory = 'public_html/download'
directory = 'public_html/download'
elif branch == 'experimental-build':
directory = 'public_html/download/experimental'
else:
directory = 'public_html/download'
try: try:
filename = os.path.join(directory, packagename)
zf = z.open(package) zf = z.open(package)
f = file(filename, "wb") f = file(os.path.join(directory, packagename), "wb")
shutil.copyfileobj(zf, f) shutil.copyfileobj(zf, f)
os.chmod(filename, 0644)
zf.close() zf.close()
z.close() z.close()
except Exception as ex:
os.remove(filename)
except Exception, ex:
sys.stderr.write('Failed to unzip package: %s\n' % str(ex)) sys.stderr.write('Failed to unzip package: %s\n' % str(ex))
sys.exit(1) sys.exit(1)
@@ -143,6 +138,6 @@ try:
if get_platform(f) == platform and get_branch(f) == branch: if get_platform(f) == platform and get_branch(f) == branch:
if f != packagename: if f != packagename:
os.remove(os.path.join(directory, f)) os.remove(os.path.join(directory, f))
except Exception as ex: except Exception, ex:
sys.stderr.write('Failed to remove old packages: %s\n' % str(ex)) sys.stderr.write('Failed to remove old packages: %s\n' % str(ex))
sys.exit(1) sys.exit(1)

View File

@@ -33,7 +33,7 @@ builder = sys.argv[1]
# we run from build/ directory # we run from build/ directory
blender_dir = '../blender.git' blender_dir = '../blender.git'
if 'cmake' in builder: if builder.find('cmake') != -1:
# cmake # cmake
# set build options # set build options
@@ -46,30 +46,16 @@ if 'cmake' in builder:
elif builder.endswith('mac_ppc_cmake'): elif builder.endswith('mac_ppc_cmake'):
cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc') cmake_options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=ppc')
if 'win64' in builder:
cmake_options.append(['-G', '"Visual Studio 12 2013 Win64"'])
elif 'win32' in builder:
cmake_options.append(['-G', '"Visual Studio 12 2013"'])
cmake_options.append("-C../blender.git/build_files/cmake/config/blender_full.cmake")
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=1")
# configure and make # configure and make
retcode = subprocess.call(['cmake', blender_dir] + cmake_options) retcode = subprocess.call(['cmake', blender_dir] + cmake_options)
if retcode != 0: if retcode != 0:
sys.exit(retcode) sys.exit(retcode)
if 'win' in builder: retcode = subprocess.call(['make', '-s', '-j4', 'install'])
retcode = subprocess.call(['msbuild', 'INSTALL.vcxproj', '/p:Configuration=Release'])
else:
retcode = subprocess.call(['make', '-s', '-j4', 'install'])
sys.exit(retcode) sys.exit(retcode)
else: else:
python_bin = 'python'
if builder.find('linux') != -1:
python_bin = '/opt/lib/python-2.7/bin/python2.7'
# scons # scons
os.chdir(blender_dir) os.chdir(blender_dir)
scons_cmd = [python_bin, 'scons/scons.py'] scons_cmd = ['python', 'scons/scons.py']
scons_options = ['BF_FANCY=False'] scons_options = ['BF_FANCY=False']
# We're using the same rules as release builder, so tweak # We're using the same rules as release builder, so tweak
@@ -116,8 +102,6 @@ else:
if config.find('player') != -1: if config.find('player') != -1:
scons_options.append('BF_BUILDDIR=%s_player' % (build_dir)) scons_options.append('BF_BUILDDIR=%s_player' % (build_dir))
elif config.find('cuda') != -1:
scons_options.append('BF_BUILDDIR=%s_cuda' % (build_dir))
else: else:
scons_options.append('BF_BUILDDIR=%s' % (build_dir)) scons_options.append('BF_BUILDDIR=%s' % (build_dir))
@@ -142,7 +126,7 @@ else:
retcode = subprocess.call(cur_scons_cmd + scons_options) retcode = subprocess.call(cur_scons_cmd + scons_options)
if retcode != 0: if retcode != 0:
print('Error building rules with config ' + config) print('Error building rules wuth config ' + config)
sys.exit(retcode) sys.exit(retcode)
sys.exit(0) sys.exit(0)
@@ -164,7 +148,7 @@ else:
scons_options.append('MSVS_VERSION=12.0') scons_options.append('MSVS_VERSION=12.0')
scons_options.append('MSVC_VERSION=12.0') scons_options.append('MSVC_VERSION=12.0')
scons_options.append('WITH_BF_CYCLES_CUDA_BINARIES=1') scons_options.append('WITH_BF_CYCLES_CUDA_BINARIES=1')
scons_options.append('BF_CYCLES_CUDA_NVCC=nvcc.exe') scons_options.append('BF_CYCLES_CUDA_NVCC=nvcc')
scons_options.append('BF_NUMJOBS=1') scons_options.append('BF_NUMJOBS=1')
elif builder.find('mac') != -1: elif builder.find('mac') != -1:
@@ -180,6 +164,8 @@ else:
os.makedirs(install_dir) os.makedirs(install_dir)
if builder.endswith('vc2013'): if builder.endswith('vc2013'):
dlls = ('msvcp120.dll', 'msvcr120.dll', 'vcomp120.dll') dlls = ('msvcp120.dll', 'msvcr120.dll', 'vcomp120.dll')
else:
dlls = ('msvcm90.dll', 'msvcp90.dll', 'msvcr90.dll', 'vcomp90.dll', 'Microsoft.VC90.CRT.manifest', 'Microsoft.VC90.OpenMP.manifest')
if builder.find('win64') == -1: if builder.find('win64') == -1:
dlls_path = '..\\..\\..\\redist\\x86' dlls_path = '..\\..\\..\\redist\\x86'
else: else:
@@ -187,6 +173,6 @@ else:
for dll in dlls: for dll in dlls:
shutil.copyfile(os.path.join(dlls_path, dll), os.path.join(install_dir, dll)) shutil.copyfile(os.path.join(dlls_path, dll), os.path.join(install_dir, dll))
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options) retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
sys.exit(retcode) sys.exit(retcode)

View File

@@ -33,15 +33,13 @@ if len(sys.argv) < 2:
sys.exit(1) sys.exit(1)
builder = sys.argv[1] builder = sys.argv[1]
# Never write branch if it is master. branch = ''
branch = sys.argv[2] if (len(sys.argv) >= 3 and sys.argv[2] != 'master') else ''
if len(sys.argv) >= 3:
branch = sys.argv[2]
# scons does own packaging # scons does own packaging
if builder.find('scons') != -1: if builder.find('scons') != -1:
python_bin = 'python'
if builder.find('linux') != -1:
python_bin = '/opt/lib/python-2.7/bin/python2.7'
os.chdir('../blender.git') os.chdir('../blender.git')
scons_options = ['BF_QUICK=slnt', 'BUILDBOT_BRANCH=' + branch, 'buildslave', 'BF_FANCY=False'] scons_options = ['BF_QUICK=slnt', 'BUILDBOT_BRANCH=' + branch, 'buildslave', 'BF_FANCY=False']
@@ -84,7 +82,7 @@ if builder.find('scons') != -1:
os.system('cp %s %s' % (software_gl, install_dir)) os.system('cp %s %s' % (software_gl, install_dir))
os.system('chmod 755 %s' % (os.path.join(install_dir, 'blender-softwaregl'))) os.system('chmod 755 %s' % (os.path.join(install_dir, 'blender-softwaregl')))
retcode = subprocess.call(['schroot', '-c', chroot_name, '--', python_bin, 'scons/scons.py'] + scons_options) retcode = subprocess.call(['schroot', '-c', chroot_name, '--', 'python', 'scons/scons.py'] + scons_options)
sys.exit(retcode) sys.exit(retcode)
else: else:
@@ -113,30 +111,8 @@ if builder.find('scons') != -1:
scons_options.append('BF_CONFIG=' + os.path.join(config_dir, config)) scons_options.append('BF_CONFIG=' + os.path.join(config_dir, config))
retcode = subprocess.call([python_bin, 'scons/scons.py'] + scons_options) retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
sys.exit(retcode) sys.exit(retcode)
else:
# CMake
if 'win' in builder:
files = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')]
for f in files:
os.remove(f)
retcode = subprocess.call(['cpack', '-G', 'ZIP'])
result_file = [f for f in os.listdir('.') if os.path.isfile(f) and f.endswith('.zip')][0]
os.rename(result_file, "{}.zip".format(builder))
# create zip file
try:
upload_zip = "buildbot_upload.zip"
if os.path.exists(upload_zip):
os.remove(upload_zip)
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write("{}.zip".format(builder))
z.close()
sys.exit(retcode)
except Exception as ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1)
# clean release directory if it already exists # clean release directory if it already exists
release_dir = 'release' release_dir = 'release'
@@ -149,7 +125,7 @@ if os.path.exists(release_dir):
# create release package # create release package
try: try:
subprocess.call(['make', 'package_archive']) subprocess.call(['make', 'package_archive'])
except Exception as ex: except Exception, ex:
sys.stderr.write('Make package release failed' + str(ex) + '\n') sys.stderr.write('Make package release failed' + str(ex) + '\n')
sys.exit(1) sys.exit(1)
@@ -180,6 +156,6 @@ try:
z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED) z = zipfile.ZipFile(upload_zip, "w", compression=zipfile.ZIP_STORED)
z.write(filepath, arcname=file) z.write(filepath, arcname=file)
z.close() z.close()
except Exception as ex: except Exception, ex:
sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n') sys.stderr.write('Create buildbot_upload.zip failed' + str(ex) + '\n')
sys.exit(1) sys.exit(1)

View File

@@ -1,103 +0,0 @@
# - Find Alembic library
# Find the native Alembic includes and library
# This module defines
# ALEMBIC_INCLUDE_DIRS, where to find Alembic headers.
# ALEMBIC_LIBRARIES, libraries to link against to use Alembic.
# ALEMBIC_ROOT_DIR, The base directory to search for Alembic.
# This can also be an environment variable.
# ALEMBIC_FOUND, If false, do not try to use Alembic.
# ALEMBIC_HDF5_FOUND, indicates whether Alembic supports HDF5
#=============================================================================
# Copyright 2013 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If ALEMBIC_ROOT_DIR was defined in the environment, use it.
IF(NOT ALEMBIC_ROOT_DIR AND NOT $ENV{ALEMBIC_ROOT_DIR} STREQUAL "")
SET(ALEMBIC_ROOT_DIR $ENV{ALEMBIC_ROOT_DIR})
ENDIF()
SET(_alembic_SEARCH_DIRS
${ALEMBIC_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/alembic
)
SET(_alembic_FIND_COMPONENTS
AlembicAbc
AlembicAbcCoreAbstract
AlembicAbcGeom
AlembicAbcCoreOgawa
AlembicOgawa
AlembicUtil
)
FIND_PATH(ALEMBIC_INCLUDE_DIR
NAMES
Alembic/Abc/All.h
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
include
)
SET(_alembic_LIBRARIES)
FOREACH(COMPONENT ${_alembic_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(ALEMBIC_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
lib
lib/static
)
MARK_AS_ADVANCED(ALEMBIC_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _alembic_LIBRARIES "${ALEMBIC_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
# Sepcial handling of optional libraries
FIND_LIBRARY(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY
NAMES
AlembicAbcCoreHDF5
HINTS
${_alembic_SEARCH_DIRS}
PATH_SUFFIXES
lib
lib/static
)
MARK_AS_ADVANCED(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY)
IF(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY)
LIST(APPEND _alembic_LIBRARIES "${ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY}")
SET(ALEMBIC_HDF5_FOUND TRUE)
ELSE()
SET(ALEMBIC_HDF5_FOUND FALSE)
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Alembic DEFAULT_MSG
_alembic_LIBRARIES ALEMBIC_INCLUDE_DIR)
IF(ALEMBIC_FOUND)
SET(ALEMBIC_LIBRARIES ${_alembic_LIBRARIES})
SET(ALEMBIC_INCLUDE_DIRS ${ALEMBIC_INCLUDE_DIR})
ENDIF(ALEMBIC_FOUND)
MARK_AS_ADVANCED(
ALEMBIC_INCLUDE_DIR
ALEMBIC_LIBRARIES
)

View File

@@ -1,56 +0,0 @@
# - Find Eigen3 library
# Find the native Eigen3 includes and library
# This module defines
# EIGEN3_INCLUDE_DIRS, where to find spnav.h, Set when
# EIGEN3_INCLUDE_DIR is found.
# EIGEN3_ROOT_DIR, The base directory to search for Eigen3.
# This can also be an environment variable.
# EIGEN3_FOUND, If false, do not try to use Eigen3.
#
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If EIGEN3_ROOT_DIR was defined in the environment, use it.
IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "")
SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR})
ENDIF()
SET(_eigen3_SEARCH_DIRS
${EIGEN3_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(EIGEN3_INCLUDE_DIR
NAMES
# header has no '.h' suffix
Eigen/Eigen
HINTS
${_eigen3_SEARCH_DIRS}
PATH_SUFFIXES
include/eigen3
)
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
EIGEN3_INCLUDE_DIR)
IF(EIGEN3_FOUND)
SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
ENDIF(EIGEN3_FOUND)
MARK_AS_ADVANCED(
EIGEN3_INCLUDE_DIR
)

View File

@@ -1,79 +1,59 @@
# - Find GLEW library
# Find the native Glew includes and library
# This module defines
# GLEW_INCLUDE_DIRS, where to find glew.h, Set when
# GLEW_INCLUDE_DIR is found.
# GLEW_ROOT_DIR, The base directory to search for Glew.
# This can also be an environment variable.
# GLEW_FOUND, If false, do not try to use Glew.
# #
# also defined, # Try to find GLEW library and include path.
# GLEW_LIBRARY, where to find the Glew library. # Once done this will define
# GLEW_MX_LIBRARY, where to find the GlewMX library.
#=============================================================================
# Copyright 2014 Blender Foundation.
# #
# Distributed under the OSI-approved BSD License (the "License"); # GLEW_FOUND
# see accompanying file Copyright.txt for details. # GLEW_INCLUDE_PATH
# # GLEW_LIBRARY
# This software is distributed WITHOUT ANY WARRANTY; without even the #
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If GLEW_ROOT_DIR was defined in the environment, use it. IF (WIN32)
IF(NOT GLEW_ROOT_DIR AND NOT $ENV{GLEW_ROOT_DIR} STREQUAL "") FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
SET(GLEW_ROOT_DIR $ENV{GLEW_ROOT_DIR}) $ENV{PROGRAMFILES}/GLEW/include
ENDIF() ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
DOC "The directory where GL/glew.h resides")
IF (NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
FIND_LIBRARY( GLEW_LIBRARY
NAMES glew64 glew64s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library (64-bit)"
)
ELSE(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
FIND_LIBRARY( GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library"
)
ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64")
ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
DOC "The directory where GL/glew.h resides")
FIND_LIBRARY( GLEW_LIBRARY
NAMES GLEW glew
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
DOC "The GLEW library")
ENDIF (WIN32)
SET(_glew_SEARCH_DIRS IF (GLEW_INCLUDE_PATH)
${GLEW_ROOT_DIR} SET(GLEW_FOUND TRUE)
/usr/local ELSE (GLEW_INCLUDE_PATH)
) SET(GLEW_FOUND FALSE)
ENDIF (GLEW_INCLUDE_PATH)
FIND_PATH(GLEW_INCLUDE_DIR MARK_AS_ADVANCED( GLEW_FOUND )
NAMES
GL/glew.h
HINTS
${_glew_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(GLEW_LIBRARY
NAMES
GLEW
HINTS
${_glew_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_LIBRARY(GLEW_MX_LIBRARY
NAMES
GLEWmx
HINTS
${_glew_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set GLEW_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glew DEFAULT_MSG
GLEW_LIBRARY GLEW_INCLUDE_DIR)
IF(GLEW_FOUND)
SET(GLEW_INCLUDE_DIRS ${GLEW_INCLUDE_DIR})
ENDIF(GLEW_FOUND)
MARK_AS_ADVANCED(
GLEW_INCLUDE_DIR
GLEW_LIBRARY
GLEW_MX_LIBRARY
)
UNSET(_glew_SEARCH_DIRS)

View File

@@ -1,75 +0,0 @@
# - Find HDF5 library
# Find the native hdf5 includes and library
# This module defines
# HDF5_INCLUDE_DIRS, where to find hdf5 headers.
# HDF5_LIBRARIES, libraries to link against to use hdf5.
# HDF5_ROOT_DIR, The base directory to search for hdf5.
# This can also be an environment variable.
# HDF5_FOUND, If false, do not try to use hdf5.
#=============================================================================
# Copyright 2013 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If HDF5_ROOT_DIR was defined in the environment, use it.
IF(NOT HDF5_ROOT_DIR AND NOT $ENV{HDF5_ROOT_DIR} STREQUAL "")
SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR})
ENDIF()
SET(_hdf5_SEARCH_DIRS
${HDF5_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/hdf5
)
SET(_hdf5_FIND_COMPONENTS
hdf5
hdf5_hl
)
FIND_PATH(_hdf5_INCLUDE_DIRS
NAMES
hdf5.h
HINTS
${_hdf5_SEARCH_DIRS}
)
SET(_hdf5_LIBRARIES)
FOREACH(COMPONENT ${_hdf5_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(HDF5_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_hdf5_SEARCH_DIRS}
)
MARK_AS_ADVANCED(HDF5_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _hdf5_LIBRARIES "${HDF5_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set HDF5_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(hdf5 DEFAULT_MSG
_hdf5_LIBRARIES _hdf5_INCLUDE_DIRS)
IF(HDF5_FOUND)
SET(HDF5_LIBRARIES ${_hdf5_LIBRARIES})
SET(HDF5_INCLUDE_DIRS ${_hdf5_INCLUDE_DIRS})
ENDIF(HDF5_FOUND)
MARK_AS_ADVANCED(
HDF5_INCLUDE_DIRS
HDF5_LIBRARIES
)

View File

@@ -33,7 +33,6 @@ SET(_jemalloc_SEARCH_DIRS
/sw # Fink /sw # Fink
/opt/local # DarwinPorts /opt/local # DarwinPorts
/opt/csw # Blastwave /opt/csw # Blastwave
/opt/lib/jemalloc
) )
FIND_PATH(JEMALLOC_INCLUDE_DIR FIND_PATH(JEMALLOC_INCLUDE_DIR

View File

@@ -1,94 +0,0 @@
# - Find LLVM library
# Find the native LLVM includes and library
# This module defines
# LLVM_INCLUDE_DIRS, where to find LLVM.h, Set when LLVM_INCLUDE_DIR is found.
# LLVM_LIBRARIES, libraries to link against to use LLVM.
# LLVM_ROOT_DIR, The base directory to search for LLVM.
# This can also be an environment variable.
# LLVM_FOUND, If false, do not try to use LLVM.
#
# also defined, but not for general use are
# LLVM_LIBRARY, where to find the LLVM library.
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
if(LLVM_ROOT_DIR)
if(DEFINED LLVM_VERSION)
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
endif()
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
endif()
else()
if(DEFINED LLVM_VERSION)
message(running llvm-config-${LLVM_VERSION})
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
endif()
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config)
endif()
endif()
if(NOT DEFINED LLVM_VERSION)
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_VERSION ${LLVM_VERSION} CACHE STRING "Version of LLVM to use")
endif()
if(NOT LLVM_ROOT_DIR)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_ROOT_DIR ${LLVM_ROOT_DIR} CACHE PATH "Path to the LLVM installation")
endif()
if(NOT LLVM_LIBPATH)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_LIBPATH ${LLVM_LIBPATH} CACHE PATH "Path to the LLVM library path")
mark_as_advanced(LLVM_LIBPATH)
endif()
if(LLVM_STATIC)
find_library(LLVM_LIBRARY
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
else()
find_library(LLVM_LIBRARY
NAMES LLVM-${LLVM_VERSION}
PATHS ${LLVM_LIBPATH})
endif()
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY "${LLVM_LIBRARY}")
endif()
endif()
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
LLVM_LIBRARY)
MARK_AS_ADVANCED(
LLVM_LIBRARY
)

View File

@@ -1,68 +0,0 @@
# - Find LZO library
# Find the native LZO includes and library
# This module defines
# LZO_INCLUDE_DIRS, where to find lzo1x.h, Set when
# LZO_INCLUDE_DIR is found.
# LZO_LIBRARIES, libraries to link against to use LZO.
# LZO_ROOT_DIR, The base directory to search for LZO.
# This can also be an environment variable.
# LZO_FOUND, If false, do not try to use LZO.
#
# also defined, but not for general use are
# LZO_LIBRARY, where to find the LZO library.
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If LZO_ROOT_DIR was defined in the environment, use it.
IF(NOT LZO_ROOT_DIR AND NOT $ENV{LZO_ROOT_DIR} STREQUAL "")
SET(LZO_ROOT_DIR $ENV{LZO_ROOT_DIR})
ENDIF()
SET(_lzo_SEARCH_DIRS
${LZO_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(LZO_INCLUDE_DIR lzo/lzo1x.h
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(LZO_LIBRARY
NAMES
lzo2
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
LZO_LIBRARY LZO_INCLUDE_DIR)
IF(LZO_FOUND)
SET(LZO_LIBRARIES ${LZO_LIBRARY})
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
ENDIF(LZO_FOUND)
MARK_AS_ADVANCED(
LZO_INCLUDE_DIR
LZO_LIBRARY
)

View File

@@ -140,8 +140,3 @@ IF(OPENCOLLADA_FOUND)
SET(OPENCOLLADA_LIBRARIES ${_opencollada_LIBRARIES}) SET(OPENCOLLADA_LIBRARIES ${_opencollada_LIBRARIES})
SET(OPENCOLLADA_INCLUDE_DIRS ${_opencollada_INCLUDES}) SET(OPENCOLLADA_INCLUDE_DIRS ${_opencollada_INCLUDES})
ENDIF(OPENCOLLADA_FOUND) ENDIF(OPENCOLLADA_FOUND)
UNSET(COMPONENT)
UNSET(UPPERCOMPONENT)
UNSET(_opencollada_LIBRARIES)
UNSET(_opencollada_INCLUDES)

View File

@@ -63,12 +63,11 @@ FOREACH(COMPONENT ${_opencolorio_FIND_COMPONENTS})
PATH_SUFFIXES PATH_SUFFIXES
lib64 lib lib64 lib
) )
IF(OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY) if(OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY)
LIST(APPEND _opencolorio_LIBRARIES "${OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY}") LIST(APPEND _opencolorio_LIBRARIES "${OPENCOLORIO_${UPPERCOMPONENT}_LIBRARY}")
ENDIF() endif()
ENDFOREACH() ENDFOREACH()
# handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set OPENCOLORIO_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
@@ -83,13 +82,5 @@ ENDIF(OPENCOLORIO_FOUND)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
OPENCOLORIO_INCLUDE_DIR OPENCOLORIO_INCLUDE_DIR
OPENCOLORIO_LIBRARY OPENCOLORIO_LIBRARY
OPENCOLORIO_OPENCOLORIO_LIBRARY
OPENCOLORIO_TINYXML_LIBRARY
OPENCOLORIO_YAML-CPP_LIBRARY
) )
UNSET(COMPONENT)
UNSET(UPPERCOMPONENT)
UNSET(_opencolorio_FIND_COMPONENTS)
UNSET(_opencolorio_LIBRARIES)
UNSET(_opencolorio_SEARCH_DIRS)

View File

@@ -34,9 +34,6 @@ IF(NOT OPENEXR_ROOT_DIR AND NOT $ENV{OPENEXR_ROOT_DIR} STREQUAL "")
SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR}) SET(OPENEXR_ROOT_DIR $ENV{OPENEXR_ROOT_DIR})
ENDIF() ENDIF()
# Old versions (before 2.0?) do not have any version string, just assuming this should be fine though.
SET(_openexr_libs_ver_init "2.0")
SET(_openexr_FIND_COMPONENTS SET(_openexr_FIND_COMPONENTS
Half Half
Iex Iex
@@ -51,7 +48,6 @@ SET(_openexr_SEARCH_DIRS
/sw # Fink /sw # Fink
/opt/local # DarwinPorts /opt/local # DarwinPorts
/opt/csw # Blastwave /opt/csw # Blastwave
/opt/lib/openexr
) )
FIND_PATH(OPENEXR_INCLUDE_DIR FIND_PATH(OPENEXR_INCLUDE_DIR
@@ -86,9 +82,12 @@ IF(OPENEXR_INCLUDE_DIR)
IF(OPENEXR_BUILD_SPECIFICATION) IF(OPENEXR_BUILD_SPECIFICATION)
MESSAGE(STATUS "${OPENEXR_BUILD_SPECIFICATION}") MESSAGE(STATUS "${OPENEXR_BUILD_SPECIFICATION}")
STRING(REGEX REPLACE ".*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"([.0-9]+)\".*" STRING(REGEX REPLACE ".*#define[ \t]+OPENEXR_VERSION_STRING[ \t]+\"([.0-9]+)\".*"
"\\1" _openexr_libs_ver_init ${OPENEXR_BUILD_SPECIFICATION}) "\\1" XYZ ${OPENEXR_BUILD_SPECIFICATION})
SET("OPENEXR_VERSION" ${XYZ} CACHE STRING "Version of OpenEXR lib")
ELSE() ELSE()
MESSAGE(WARNING "Could not determine ILMBase library version, assuming ${_openexr_libs_ver_init}.") # Old versions (before 2.0?) do not have any version string, just assuming 2.0 should be fine though.
MESSAGE(WARNING "Could not determine ILMBase library version, assuming 2.0.")
SET("OPENEXR_VERSION" "2.0" CACHE STRING "Version of OpenEXR lib")
ENDIF() ENDIF()
UNSET(_openexr_CONFIG CACHE) UNSET(_openexr_CONFIG CACHE)
@@ -96,9 +95,6 @@ IF(OPENEXR_INCLUDE_DIR)
ENDIF() ENDIF()
ENDIF() ENDIF()
SET("OPENEXR_VERSION" ${_openexr_libs_ver_init} CACHE STRING "Version of OpenEXR lib")
UNSET(_openexr_libs_ver_init)
STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION}) STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _openexr_libs_ver ${OPENEXR_VERSION})
SET(_openexr_LIBRARIES) SET(_openexr_LIBRARIES)
@@ -138,9 +134,3 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
MARK_AS_ADVANCED(OPENEXR_${UPPERCOMPONENT}_LIBRARY) MARK_AS_ADVANCED(OPENEXR_${UPPERCOMPONENT}_LIBRARY)
ENDFOREACH() ENDFOREACH()
UNSET(COMPONENT)
UNSET(UPPERCOMPONENT)
UNSET(_openexr_FIND_COMPONENTS)
UNSET(_openexr_LIBRARIES)
UNSET(_openexr_SEARCH_DIRS)

View File

@@ -1,78 +0,0 @@
# - Try to find OpenGLES
# Once done this will define
#
# OPENGLES_FOUND - system has OpenGLES and EGL
# OPENGL_EGL_FOUND - system has EGL
# OPENGLES_INCLUDE_DIR - the GLES include directory
# OPENGLES_LIBRARY - the GLES library
# OPENGLES_EGL_INCLUDE_DIR - the EGL include directory
# OPENGLES_EGL_LIBRARY - the EGL library
# OPENGLES_LIBRARIES - all libraries needed for OpenGLES
# OPENGLES_INCLUDES - all includes needed for OpenGLES
# If OPENGLES_ROOT_DIR was defined in the environment, use it.
IF(NOT OPENGLES_ROOT_DIR AND NOT $ENV{OPENGLES_ROOT_DIR} STREQUAL "")
SET(OPENGLES_ROOT_DIR $ENV{OPENGLES_ROOT_DIR})
ENDIF()
SET(_opengles_SEARCH_DIRS
${OPENGLES_ROOT_DIR}
/usr/local
)
FIND_PATH(OPENGLES_INCLUDE_DIR
NAMES
GLES2/gl2.h
HINTS
${_opengles_SEARCH_DIRS}
)
FIND_LIBRARY(OPENGLES_LIBRARY
NAMES
GLESv2
PATHS
${_opengles_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_PATH(OPENGLES_EGL_INCLUDE_DIR
NAMES
EGL/egl.h
HINTS
${_opengles_SEARCH_DIRS}
)
FIND_LIBRARY(OPENGLES_EGL_LIBRARY
NAMES
EGL
HINTS
${_opengles_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
IF(OPENGLES_EGL_LIBRARY AND OPENGLES_EGL_INCLUDE_DIR)
SET(OPENGL_EGL_FOUND "YES")
ELSE()
SET(OPENGL_EGL_FOUND "NO")
ENDIF()
IF(OPENGLES_LIBRARY AND OPENGLES_INCLUDE_DIR AND
OPENGLES_EGL_LIBRARY AND OPENGLES_EGL_INCLUDE_DIR)
SET(OPENGLES_LIBRARIES ${OPENGLES_LIBRARY} ${OPENGLES_LIBRARIES}
${OPENGLES_EGL_LIBRARY})
SET(OPENGLES_INCLUDES ${OPENGLES_INCLUDE_DIR} ${OPENGLES_EGL_INCLUDE_DIR})
SET(OPENGLES_FOUND "YES")
ELSE()
SET(OPENGLES_FOUND "NO")
ENDIF()
MARK_AS_ADVANCED(
OPENGLES_EGL_INCLUDE_DIR
OPENGLES_EGL_LIBRARY
OPENGLES_LIBRARY
OPENGLES_INCLUDE_DIR
)
UNSET(_opengles_SEARCH_DIRS)

View File

@@ -7,8 +7,6 @@
# OPENIMAGEIO_ROOT_DIR, The base directory to search for OpenImageIO. # OPENIMAGEIO_ROOT_DIR, The base directory to search for OpenImageIO.
# This can also be an environment variable. # This can also be an environment variable.
# OPENIMAGEIO_FOUND, If false, do not try to use OpenImageIO. # OPENIMAGEIO_FOUND, If false, do not try to use OpenImageIO.
# OPENIMAGEIO_PUGIXML_FOUND, Indicates whether OIIO has biltin PuguXML parser.
# OPENIMAGEIO_IDIFF, full path to idiff application if found.
# #
# also defined, but not for general use are # also defined, but not for general use are
# OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library. # OPENIMAGEIO_LIBRARY, where to find the OpenImageIO library.
@@ -56,14 +54,6 @@ FIND_LIBRARY(OPENIMAGEIO_LIBRARY
lib64 lib lib64 lib
) )
FIND_FILE(OPENIMAGEIO_IDIFF
NAMES
idiff
${OPENIMAGEIO_ROOT_DIR}
PATH_SUFFIXES
bin
)
# handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set OPENIMAGEIO_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
@@ -73,17 +63,9 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenImageIO DEFAULT_MSG
IF(OPENIMAGEIO_FOUND) IF(OPENIMAGEIO_FOUND)
SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY}) SET(OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR}) SET(OPENIMAGEIO_INCLUDE_DIRS ${OPENIMAGEIO_INCLUDE_DIR})
IF(EXISTS ${OPENIMAGEIO_INCLUDE_DIR}/OpenImageIO/pugixml.hpp) ENDIF(OPENIMAGEIO_FOUND)
SET(OPENIMAGEIO_PUGIXML_FOUND TRUE)
ENDIF()
ELSE()
SET(OPENIMAGEIO_PUGIXML_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
OPENIMAGEIO_INCLUDE_DIR OPENIMAGEIO_INCLUDE_DIR
OPENIMAGEIO_LIBRARY OPENIMAGEIO_LIBRARY
OPENIMAGEIO_IDIFF
) )
UNSET(_openimageio_SEARCH_DIRS)

View File

@@ -69,5 +69,3 @@ MARK_AS_ADVANCED(
OPENJPEG_INCLUDE_DIR OPENJPEG_INCLUDE_DIR
OPENJPEG_LIBRARY OPENJPEG_LIBRARY
) )
UNSET(_openjpeg_SEARCH_DIRS)

View File

@@ -1,98 +0,0 @@
# - Find OpenShadingLanguage library
# Find the native OpenShadingLanguage includes and library
# This module defines
# OSL_INCLUDE_DIRS, where to find OSL headers, Set when
# OSL_INCLUDE_DIR is found.
# OSL_LIBRARIES, libraries to link against to use OSL.
# OSL_ROOT_DIR, the base directory to search for OSL.
# This can also be an environment variable.
# OSL_COMPILER, full path to OSL script compiler.
# OSL_FOUND, if false, do not try to use OSL.
# OSL_LIBRARY_VERSION_MAJOR, OSL_LIBRARY_VERSION_MINOR, the major
# and minor versions of OSL library if found.
#
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If OSL_ROOT_DIR was defined in the environment, use it.
IF(NOT OSL_ROOT_DIR AND NOT $ENV{OSL_ROOT_DIR} STREQUAL "")
SET(OSL_ROOT_DIR $ENV{OSL_ROOT_DIR})
ENDIF()
SET(_osl_FIND_COMPONENTS
oslcomp
oslexec
oslquery
)
SET(_osl_SEARCH_DIRS
${OSL_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/osl
)
FIND_PATH(OSL_INCLUDE_DIR
NAMES
OSL/oslversion.h
HINTS
${_osl_SEARCH_DIRS}
PATH_SUFFIXES
include
)
SET(_osl_LIBRARIES)
FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
FIND_LIBRARY(OSL_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}
HINTS
${_osl_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
LIST(APPEND _osl_LIBRARIES "${OSL_${UPPERCOMPONENT}_LIBRARY}")
ENDFOREACH()
FIND_PROGRAM(OSL_COMPILER oslc
HINTS ${_osl_SEARCH_DIRS}
PATH_SUFFIXES bin)
# handle the QUIETLY and REQUIRED arguments and set OSL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OSL DEFAULT_MSG _osl_LIBRARIES OSL_INCLUDE_DIR OSL_COMPILER)
IF(OSL_FOUND)
SET(OSL_LIBRARIES ${_osl_LIBRARIES})
SET(OSL_INCLUDE_DIRS ${OSL_INCLUDE_DIR})
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_MAJOR
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+[0-9]+.*$")
FILE(STRINGS "${OSL_INCLUDE_DIR}/OSL/oslversion.h" OSL_LIBRARY_VERSION_MINOR
REGEX "^[ \t]*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+[0-9]+.*$")
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MAJOR[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_MAJOR ${OSL_LIBRARY_VERSION_MAJOR})
STRING(REGEX REPLACE ".*#define[ \t]+OSL_LIBRARY_VERSION_MINOR[ \t]+([.0-9]+).*"
"\\1" OSL_LIBRARY_VERSION_MINOR ${OSL_LIBRARY_VERSION_MINOR})
ENDIF(OSL_FOUND)
MARK_AS_ADVANCED(
OSL_INCLUDE_DIR
)
FOREACH(COMPONENT ${_osl_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
MARK_AS_ADVANCED(OSL_${UPPERCOMPONENT}_LIBRARY)
ENDFOREACH()

View File

@@ -40,6 +40,7 @@ FIND_PATH(PCRE_INCLUDE_DIR pcre.h
${_pcre_SEARCH_DIRS} ${_pcre_SEARCH_DIRS}
PATH_SUFFIXES PATH_SUFFIXES
include include
include
) )
FIND_LIBRARY(PCRE_LIBRARY FIND_LIBRARY(PCRE_LIBRARY

View File

@@ -1,73 +0,0 @@
# - Find PugiXML library
# Find the native PugiXML includes and library
# This module defines
# PUGIXML_INCLUDE_DIRS, where to find pugixml.hpp, Set when
# PugiXML is found.
# PUGIXML_LIBRARIES, libraries to link against to use PugiiXML.
# PUGIXML_ROOT_DIR, The base directory to search for PugiXML.
# This can also be an environment variable.
# PUGIXML_FOUND, If false, do not try to use PugiXML.
#
# also defined, but not for general use are
# PUGIXML_LIBRARY, where to find the PugiXML library.
#=============================================================================
# Copyright 2014 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If PUGIXML_ROOT_DIR was defined in the environment, use it.
IF(NOT PUGIXML_ROOT_DIR AND NOT $ENV{PUGIXML_ROOT_DIR} STREQUAL "")
SET(PUGIXML_ROOT_DIR $ENV{PUGIXML_ROOT_DIR})
ENDIF()
SET(_pugixml_SEARCH_DIRS
${PUGIXML_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/oiio
)
FIND_PATH(PUGIXML_INCLUDE_DIR
NAMES
pugixml.hpp
HINTS
${_pugixml_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(PUGIXML_LIBRARY
NAMES
pugixml
HINTS
${_pugixml_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set PUGIXML_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PUGIXML DEFAULT_MSG
PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
IF(PUGIXML_FOUND)
SET(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
SET(PUGIXML_INCLUDE_DIRS ${PUGIXML_INCLUDE_DIR})
ELSE()
SET(PUGIXML_PUGIXML_FOUND FALSE)
ENDIF()
MARK_AS_ADVANCED(
PUGIXML_INCLUDE_DIR
PUGIXML_LIBRARY
)

View File

@@ -14,7 +14,6 @@
# PYTHON_INCLUDE_CONFIG_DIRS # PYTHON_INCLUDE_CONFIG_DIRS
# PYTHON_LIBRARIES # PYTHON_LIBRARIES
# PYTHON_LIBPATH, Used for installation # PYTHON_LIBPATH, Used for installation
# PYTHON_SITE_PACKAGES, Used for installation (as a Python module)
# PYTHON_LINKFLAGS # PYTHON_LINKFLAGS
# PYTHON_ROOT_DIR, The base directory to search for Python. # PYTHON_ROOT_DIR, The base directory to search for Python.
# This can also be an environment variable. # This can also be an environment variable.
@@ -66,14 +65,6 @@ IF(DEFINED PYTHON_LIBPATH)
SET(_IS_LIB_PATH_DEF ON) SET(_IS_LIB_PATH_DEF ON)
ENDIF() ENDIF()
STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/lib/python-${PYTHON_VERSION}"
)
# only search for the dirs if we havn't already # only search for the dirs if we havn't already
IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF)) IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF))
@@ -83,7 +74,14 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
"dm;dmu;du;d" # debug "dm;dmu;du;d" # debug
) )
STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/lib/python-${PYTHON_VERSION}"
)
FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS}) FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
#IF(CMAKE_BUILD_TYPE STREQUAL Debug) #IF(CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -148,7 +146,6 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
ENDIF() ENDIF()
IF(PYTHON_LIBRARY AND PYTHON_LIBPATH AND PYTHON_INCLUDE_DIR AND PYTHON_INCLUDE_CONFIG_DIR) IF(PYTHON_LIBRARY AND PYTHON_LIBPATH AND PYTHON_INCLUDE_DIR AND PYTHON_INCLUDE_CONFIG_DIR)
SET(_PYTHON_ABI_FLAGS "${_CURRENT_ABI_FLAGS}")
break() break()
ELSE() ELSE()
# ensure we dont find values from 2 different ABI versions # ensure we dont find values from 2 different ABI versions
@@ -171,6 +168,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
UNSET(_CURRENT_PATH) UNSET(_CURRENT_PATH)
UNSET(_python_ABI_FLAGS) UNSET(_python_ABI_FLAGS)
UNSET(_python_SEARCH_DIRS)
ENDIF() ENDIF()
UNSET(_IS_INC_DEF) UNSET(_IS_INC_DEF)
@@ -189,41 +187,17 @@ IF(PYTHONLIBSUNIX_FOUND)
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR}) SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY}) SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
FIND_FILE(PYTHON_SITE_PACKAGES
NAMES
# debian specific
dist-packages
site-packages
HINTS
${PYTHON_LIBPATH}/python${PYTHON_VERSION}
)
# we need this for installation # we need this for installation
# XXX No more valid with debian-like py3.4 packages... # XXX No more valid with debian-like py3.4 packages...
# GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH) # GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
# not required for build, just used when bundling Python. # not used
FIND_PROGRAM( # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
PYTHON_EXECUTABLE
NAMES
"python${PYTHON_VERSION}${_PYTHON_ABI_FLAGS}"
"python${PYTHON_VERSION}"
"python"
HINTS
${_python_SEARCH_DIRS}
PATH_SUFFIXES bin
)
ENDIF() ENDIF()
UNSET(_PYTHON_VERSION_NO_DOTS)
UNSET(_PYTHON_ABI_FLAGS)
UNSET(_python_SEARCH_DIRS)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
PYTHON_INCLUDE_DIR PYTHON_INCLUDE_DIR
PYTHON_INCLUDE_CONFIG_DIR PYTHON_INCLUDE_CONFIG_DIR
PYTHON_LIBRARY PYTHON_LIBRARY
PYTHON_LIBPATH PYTHON_LIBPATH
PYTHON_SITE_PACKAGES
PYTHON_EXECUTABLE
) )

View File

@@ -1,72 +0,0 @@
# - Find SDL library
# Find the native SDL includes and library
# This module defines
# SDL2_INCLUDE_DIRS, where to find SDL.h, Set when SDL2_INCLUDE_DIR is found.
# SDL2_LIBRARIES, libraries to link against to use SDL.
# SDL2_ROOT_DIR, The base directory to search for SDL.
# This can also be an environment variable.
# SDL2_FOUND, If false, do not try to use SDL.
#
# also defined, but not for general use are
# SDL2_LIBRARY, where to find the SDL library.
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If SDL2_ROOT_DIR was defined in the environment, use it.
IF(NOT SDL2_ROOT_DIR AND NOT $ENV{SDL2_ROOT_DIR} STREQUAL "")
SET(SDL2_ROOT_DIR $ENV{SDL2_ROOT_DIR})
ENDIF()
SET(_sdl2_SEARCH_DIRS
${SDL2_ROOT_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(SDL2_INCLUDE_DIR
NAMES
SDL.h
HINTS
${_sdl2_SEARCH_DIRS}
PATH_SUFFIXES
include/SDL2 include
)
FIND_LIBRARY(SDL2_LIBRARY
NAMES
SDL2
HINTS
${_sdl2_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 DEFAULT_MSG
SDL2_LIBRARY SDL2_INCLUDE_DIR)
IF(SDL2_FOUND)
SET(SDL2_LIBRARIES ${SDL2_LIBRARY})
SET(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
ENDIF(SDL2_FOUND)
MARK_AS_ADVANCED(
SDL2_INCLUDE_DIR
SDL2_LIBRARY
)

View File

@@ -32,8 +32,6 @@ macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS)
bf_testing_main bf_testing_main
bf_intern_guardedalloc bf_intern_guardedalloc
extern_gtest extern_gtest
# needed for glog
${PTHREADS_LIBRARIES}
extern_glog) extern_glog)
set_target_properties(${NAME}_test PROPERTIES set_target_properties(${NAME}_test PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}" RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}"

View File

@@ -2,12 +2,12 @@
# ./source/creator/CMakeLists.txt to write ./source/creator/buildinfo.h # ./source/creator/CMakeLists.txt to write ./source/creator/buildinfo.h
# Extract working copy information for SOURCE_DIR into MY_XXX variables # Extract working copy information for SOURCE_DIR into MY_XXX variables
# with a default in case anything fails, for example when using git-svn # with a default in case anything fails, for examble when using git-svn
set(MY_WC_HASH "unknown") set(MY_WC_HASH "unknown")
set(MY_WC_BRANCH "unknown") set(MY_WC_BRANCH "unknown")
set(MY_WC_COMMIT_TIMESTAMP 0) set(MY_WC_COMMIT_TIMESTAMP 0)
# Guess if this is a git working copy and then look up the revision # Guess if this is a SVN working copy and then look up the revision
if(EXISTS ${SOURCE_DIR}/.git) if(EXISTS ${SOURCE_DIR}/.git)
# The FindGit.cmake module is part of the standard distribution # The FindGit.cmake module is part of the standard distribution
include(FindGit) include(FindGit)
@@ -60,8 +60,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
execute_process(COMMAND git log HEAD..@{u} execute_process(COMMAND git log HEAD..@{u}
WORKING_DIRECTORY ${SOURCE_DIR} WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_below_check OUTPUT_VARIABLE _git_below_check
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE)
ERROR_QUIET)
if(NOT _git_below_check STREQUAL "") if(NOT _git_below_check STREQUAL "")
# If there're commits between HEAD and upstream this means # If there're commits between HEAD and upstream this means
# that we're reset-ed to older revision. Use it's hash then. # that we're reset-ed to older revision. Use it's hash then.
@@ -111,7 +110,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
if(NOT _git_changed_files STREQUAL "") if(NOT _git_changed_files STREQUAL "")
set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)") set(MY_WC_BRANCH "${MY_WC_BRANCH} (modified)")
else() else()
# Unpushed commits are also considered local modifications # Unpushed commits are also considered local odifications
execute_process(COMMAND git log @{u}.. execute_process(COMMAND git log @{u}..
WORKING_DIRECTORY ${SOURCE_DIR} WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_unpushed_log OUTPUT_VARIABLE _git_unpushed_log
@@ -128,7 +127,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
endif() endif()
# BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake # BUILD_PLATFORM and BUILD_PLATFORM are taken from CMake
# but BUILD_DATE and BUILD_TIME are platform dependent # but BUILD_DATE and BUILD_TIME are plataform dependant
if(UNIX) if(UNIX)
execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BUILD_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND date "+%H:%M:%S" OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -138,7 +137,7 @@ if(WIN32)
execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND cmd /c time /t OUTPUT_VARIABLE BUILD_TIME OUTPUT_STRIP_TRAILING_WHITESPACE)
endif() endif()
# Write a file with the BUILD_HASH define # Write a file with the SVNVERSION define
file(WRITE buildinfo.h.txt file(WRITE buildinfo.h.txt
"#define BUILD_HASH \"${MY_WC_HASH}\"\n" "#define BUILD_HASH \"${MY_WC_HASH}\"\n"
"#define BUILD_COMMIT_TIMESTAMP ${MY_WC_COMMIT_TIMESTAMP}\n" "#define BUILD_COMMIT_TIMESTAMP ${MY_WC_COMMIT_TIMESTAMP}\n"
@@ -147,14 +146,6 @@ file(WRITE buildinfo.h.txt
"#define BUILD_TIME \"${BUILD_TIME}\"\n" "#define BUILD_TIME \"${BUILD_TIME}\"\n"
) )
# cleanup
unset(MY_WC_HASH)
unset(MY_WC_COMMIT_TIMESTAMP)
unset(MY_WC_BRANCH)
unset(BUILD_DATE)
unset(BUILD_TIME)
# Copy the file to the final header only if the version changes # Copy the file to the final header only if the version changes
# and avoid needless rebuilds # and avoid needless rebuilds
# TODO: verify this comment is true, as BUILD_TIME probably changes # TODO: verify this comment is true, as BUILD_TIME probably changes

View File

@@ -28,17 +28,13 @@ if not sys.version.startswith("3"):
sys.version.partition(" ")[0]) sys.version.partition(" ")[0])
sys.exit(1) sys.exit(1)
from cmake_consistency_check_config import ( from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR
IGNORE,
UTF8_CHECK,
SOURCE_DIR,
BUILD_DIR,
)
import os import os
from os.path import join, dirname, normpath, splitext from os.path import join, dirname, normpath, splitext
print("Scanning:", SOURCE_DIR)
global_h = set() global_h = set()
global_c = set() global_c = set()
global_refs = {} global_refs = {}
@@ -138,7 +134,6 @@ def cmake_get_src(f):
if found: if found:
cmake_base = dirname(f) cmake_base = dirname(f)
cmake_base_bin = os.path.join(BUILD_DIR, os.path.relpath(cmake_base, SOURCE_DIR))
while it is not None: while it is not None:
i += 1 i += 1
@@ -159,8 +154,6 @@ def cmake_get_src(f):
# replace dirs # replace dirs
l = l.replace("${CMAKE_CURRENT_SOURCE_DIR}", cmake_base) l = l.replace("${CMAKE_CURRENT_SOURCE_DIR}", cmake_base)
l = l.replace("${CMAKE_CURRENT_BINARY_DIR}", cmake_base_bin)
l = l.strip('"')
if not l: if not l:
pass pass
@@ -181,7 +174,7 @@ def cmake_get_src(f):
elif is_c(new_file): elif is_c(new_file):
sources_c.append(new_file) sources_c.append(new_file)
global_refs.setdefault(new_file, []).append((f, i)) global_refs.setdefault(new_file, []).append((f, i))
elif l in {"PARENT_SCOPE", }: elif l in ("PARENT_SCOPE", ):
# cmake var, ignore # cmake var, ignore
pass pass
elif new_file.endswith(".list"): elif new_file.endswith(".list"):
@@ -194,26 +187,21 @@ def cmake_get_src(f):
pass pass
elif new_file.endswith(".osl"): # open shading language elif new_file.endswith(".osl"): # open shading language
pass pass
elif new_file.endswith(".glsl"):
pass
else: else:
raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file)) raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file))
elif context_name == "INC": elif context_name == "INC":
if new_file.startswith(BUILD_DIR): if os.path.isdir(new_file):
# assume generated path
pass
elif os.path.isdir(new_file):
new_path_rel = os.path.relpath(new_file, cmake_base) new_path_rel = os.path.relpath(new_file, cmake_base)
if new_path_rel != l: if new_path_rel != l:
print("overly relative path:\n %s:%d\n %s\n %s" % (f, i, l, new_path_rel)) print("overly relative path:\n %s:%d\n %s\n %s" % (f, i, l, new_path_rel))
# # Save time. just replace the line ## Save time. just replace the line
# replace_line(f, i - 1, new_path_rel) # replace_line(f, i - 1, new_path_rel)
else: else:
raise Exception("non existent include %s:%d -> %s" % (f, i, new_file)) raise Exception("non existant include %s:%d -> %s" % (f, i, new_file))
# print(new_file) # print(new_file)
@@ -240,6 +228,10 @@ def cmake_get_src(f):
filen.close() filen.close()
for cmake in source_list(SOURCE_DIR, is_cmake):
cmake_get_src(cmake)
def is_ignore(f): def is_ignore(f):
for ig in IGNORE: for ig in IGNORE:
if ig in f: if ig in f:
@@ -247,83 +239,73 @@ def is_ignore(f):
return False return False
def main(): # First do stupid check, do these files exist?
print("\nChecking for missing references:")
is_err = False
errs = []
for f in (global_h | global_c):
if f.endswith("dna.c"):
continue
print("Scanning:", SOURCE_DIR) if not os.path.exists(f):
refs = global_refs[f]
if refs:
for cf, i in refs:
errs.append((cf, i))
else:
raise Exception("CMake referenecs missing, internal error, aborting!")
is_err = True
for cmake in source_list(SOURCE_DIR, is_cmake): errs.sort()
cmake_get_src(cmake) errs.reverse()
for cf, i in errs:
# First do stupid check, do these files exist? print("%s:%d" % (cf, i))
print("\nChecking for missing references:") # Write a 'sed' script, useful if we get a lot of these
is_err = False # print("sed '%dd' '%s' > '%s.tmp' ; mv '%s.tmp' '%s'" % (i, cf, cf, cf, cf))
errs = []
for f in (global_h | global_c):
if f.startswith(BUILD_DIR):
continue
if not os.path.exists(f):
refs = global_refs[f]
if refs:
for cf, i in refs:
errs.append((cf, i))
else:
raise Exception("CMake referenecs missing, internal error, aborting!")
is_err = True
errs.sort()
errs.reverse()
for cf, i in errs:
print("%s:%d" % (cf, i))
# Write a 'sed' script, useful if we get a lot of these
# print("sed '%dd' '%s' > '%s.tmp' ; mv '%s.tmp' '%s'" % (i, cf, cf, cf, cf))
if is_err: if is_err:
raise Exception("CMake referenecs missing files, aborting!") raise Exception("CMake referenecs missing files, aborting!")
del is_err del is_err
del errs del errs
# now check on files not accounted for. # now check on files not accounted for.
print("\nC/C++ Files CMake doesnt know about...") print("\nC/C++ Files CMake doesnt know about...")
for cf in sorted(source_list(SOURCE_DIR, is_c)): for cf in sorted(source_list(SOURCE_DIR, is_c)):
if not is_ignore(cf): if not is_ignore(cf):
if cf not in global_c: if cf not in global_c:
print("missing_c: ", cf) print("missing_c: ", cf)
# check if automake builds a corrasponding .o file. # check if automake builds a corrasponding .o file.
''' '''
if cf in global_c: if cf in global_c:
out1 = os.path.splitext(cf)[0] + ".o" out1 = os.path.splitext(cf)[0] + ".o"
out2 = os.path.splitext(cf)[0] + ".Po" out2 = os.path.splitext(cf)[0] + ".Po"
out2_dir, out2_file = out2 = os.path.split(out2) out2_dir, out2_file = out2 = os.path.split(out2)
out2 = os.path.join(out2_dir, ".deps", out2_file) out2 = os.path.join(out2_dir, ".deps", out2_file)
if not os.path.exists(out1) and not os.path.exists(out2): if not os.path.exists(out1) and not os.path.exists(out2):
print("bad_c: ", cf) print("bad_c: ", cf)
''' '''
print("\nC/C++ Headers CMake doesnt know about...") print("\nC/C++ Headers CMake doesnt know about...")
for hf in sorted(source_list(SOURCE_DIR, is_c_header)): for hf in sorted(source_list(SOURCE_DIR, is_c_header)):
if not is_ignore(hf): if not is_ignore(hf):
if hf not in global_h: if hf not in global_h:
print("missing_h: ", hf) print("missing_h: ", hf)
if UTF8_CHECK: if UTF8_CHECK:
# test encoding # test encoding
import traceback import traceback
for files in (global_c, global_h): for files in (global_c, global_h):
for f in sorted(files): for f in sorted(files):
if os.path.exists(f): if os.path.exists(f):
# ignore outside of our source tree # ignore outside of our source tree
if "extern" not in f: if "extern" not in f:
i = 1 i = 1
try: try:
for l in open(f, "r", encoding="utf8"): for l in open(f, "r", encoding="utf8"):
i += 1 i += 1
except UnicodeDecodeError: except:
print("Non utf8: %s:%d" % (f, i)) print("Non utf8: %s:%d" % (f, i))
if i > 1: if i > 1:
traceback.print_exc() traceback.print_exc()
if __name__ == "__main__":
main()

View File

@@ -2,7 +2,6 @@ import os
IGNORE = ( IGNORE = (
"/test/", "/test/",
"/tests/gtests/",
"/BSP_GhostTest/", "/BSP_GhostTest/",
"/release/", "/release/",
"/xembed/", "/xembed/",
@@ -74,6 +73,3 @@ IGNORE = (
UTF8_CHECK = True UTF8_CHECK = True
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..")))) SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))))
# doesn't have to exist, just use as reference
BUILD_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(SOURCE_DIR, "..", "build"))))

View File

@@ -24,24 +24,23 @@
""" """
Example linux usage Example linux usage
python3 ~/blender-git/blender/build_files/cmake/cmake_netbeans_project.py ~/blender-git/cmake python3 ~/blenderSVN/blender/build_files/cmake/cmake_netbeans_project.py ~/blenderSVN/cmake
Windows not supported so far Windows not supported so far
""" """
from project_info import ( from project_info import (SIMPLE_PROJECTFILE,
SIMPLE_PROJECTFILE, SOURCE_DIR,
SOURCE_DIR, CMAKE_DIR,
CMAKE_DIR, PROJECT_DIR,
PROJECT_DIR, source_list,
source_list, is_project_file,
is_project_file, is_c_header,
is_c_header, # is_py,
# is_py, cmake_advanced_info,
cmake_advanced_info, cmake_compiler_defines,
cmake_compiler_defines, project_name_get,
project_name_get, )
)
import os import os
@@ -68,7 +67,7 @@ def create_nb_project_main():
if 0: if 0:
PROJECT_NAME = "Blender" PROJECT_NAME = "Blender"
else: else:
# be tricky, get the project name from git if we can! # be tricky, get the project name from SVN if we can!
PROJECT_NAME = project_name_get() PROJECT_NAME = project_name_get()
# --------------- NB spesific # --------------- NB spesific
@@ -126,8 +125,6 @@ def create_nb_project_main():
f.write(' </configuration>\n') f.write(' </configuration>\n')
f.write('</project>\n') f.write('</project>\n')
f.close()
f = open(join(PROJECT_DIR_NB, "configurations.xml"), 'w') f = open(join(PROJECT_DIR_NB, "configurations.xml"), 'w')
f.write('<?xml version="1.0" encoding="UTF-8"?>\n') f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
@@ -246,8 +243,6 @@ def create_nb_project_main():
f.write('</configurationDescriptor>\n') f.write('</configurationDescriptor>\n')
f.close()
def main(): def main():
create_nb_project_main() create_nb_project_main()

View File

@@ -22,27 +22,26 @@
# <pep8 compliant> # <pep8 compliant>
r""" """
Example Linux usage:
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake
Example Win32 usage: Example Win32 usage:
c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build
example linux usage
python .~/blenderSVN/blender/build_files/cmake/cmake_qtcreator_project.py ~/blenderSVN/cmake
""" """
from project_info import ( from project_info import (SIMPLE_PROJECTFILE,
SIMPLE_PROJECTFILE, SOURCE_DIR,
SOURCE_DIR, # CMAKE_DIR,
# CMAKE_DIR, PROJECT_DIR,
PROJECT_DIR, source_list,
source_list, is_project_file,
is_project_file, is_c_header,
is_c_header, is_py,
is_py, cmake_advanced_info,
cmake_advanced_info, cmake_compiler_defines,
cmake_compiler_defines, project_name_get,
project_name_get, )
)
import os import os
import sys import sys
@@ -64,22 +63,21 @@ def create_qtc_project_main():
if SIMPLE_PROJECTFILE: if SIMPLE_PROJECTFILE:
# --- qtcreator specific, simple format # --- qtcreator specific, simple format
PROJECT_NAME = "Blender" PROJECT_NAME = "Blender"
FILE_NAME = PROJECT_NAME.lower() f = open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w')
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f: f.write("\n".join(files_rel))
f.write("\n".join(files_rel))
with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') as f: f = open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w')
f.write("\n".join(sorted(list(set(os.path.dirname(f) f.write("\n".join(sorted(list(set(os.path.dirname(f)
for f in files_rel if is_c_header(f)))))) for f in files_rel if is_c_header(f))))))
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME) qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
with open(qtc_prj, 'w') as f: f = open(qtc_prj, 'w')
f.write("[General]\n") f.write("[General]\n")
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME) qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
if not os.path.exists(qtc_cfg): if not os.path.exists(qtc_cfg):
with open(qtc_cfg, 'w') as f: f = open(qtc_cfg, 'w')
f.write("// ADD PREDEFINED MACROS HERE!\n") f.write("// ADD PREDEFINED MACROS HERE!\n")
else: else:
includes, defines = cmake_advanced_info() includes, defines = cmake_advanced_info()
@@ -98,30 +96,29 @@ def create_qtc_project_main():
PROJECT_NAME = project_name_get() PROJECT_NAME = project_name_get()
FILE_NAME = PROJECT_NAME.lower() FILE_NAME = PROJECT_NAME.lower()
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f: f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
f.write("\n".join(files_rel)) f.write("\n".join(files_rel))
with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w', encoding='utf-8') as f: f = open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w', encoding='utf-8')
f.write("\n".join(sorted(includes))) f.write("\n".join(sorted(includes)))
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME) qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
with open(qtc_prj, 'w') as f: f = open(qtc_prj, 'w')
f.write("[General]\n") f.write("[General]\n")
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME) qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
with open(qtc_cfg, 'w') as f: f = open(qtc_cfg, 'w')
f.write("// ADD PREDEFINED MACROS TO %s_custom.config!\n" % FILE_NAME) f.write("// ADD PREDEFINED MACROS TO %s_custom.config!\n" % FILE_NAME)
qtc_custom_cfg = os.path.join(PROJECT_DIR, "%s_custom.config" % FILE_NAME)
qtc_custom_cfg = os.path.join(PROJECT_DIR, "%s_custom.config" % FILE_NAME) if os.path.exists(qtc_custom_cfg):
if os.path.exists(qtc_custom_cfg): fc = open(qtc_custom_cfg, 'r')
with open(qtc_custom_cfg, 'r') as fc: f.write(fc.read())
f.write(fc.read()) fc.close()
f.write("\n") f.write("\n")
defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines]
defines_final = [("#define %s %s" % (item[0], quote_define(item[1]))) for item in defines] if sys.platform != "win32":
if sys.platform != "win32": defines_final += cmake_compiler_defines()
defines_final += cmake_compiler_defines() f.write("\n".join(defines_final))
f.write("\n".join(defines_final))
print("Blender project file written to: %r" % qtc_prj) print("Blender project file written to: %r" % qtc_prj)
# --- end # --- end
@@ -136,21 +133,21 @@ def create_qtc_project_python():
if 0: if 0:
PROJECT_NAME = "Blender_Python" PROJECT_NAME = "Blender_Python"
else: else:
# be tricky, get the project name from git if we can! # be tricky, get the project name from SVN if we can!
PROJECT_NAME = project_name_get() + "_Python" PROJECT_NAME = project_name_get() + "_Python"
FILE_NAME = PROJECT_NAME.lower() FILE_NAME = PROJECT_NAME.lower()
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f: f = open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w')
f.write("\n".join(files_rel)) f.write("\n".join(files_rel))
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME) qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
with open(qtc_prj, 'w') as f: f = open(qtc_prj, 'w')
f.write("[General]\n") f.write("[General]\n")
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME) qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
if not os.path.exists(qtc_cfg): if not os.path.exists(qtc_cfg):
with open(qtc_cfg, 'w') as f: f = open(qtc_cfg, 'w')
f.write("// ADD PREDEFINED MACROS HERE!\n") f.write("// ADD PREDEFINED MACROS HERE!\n")
print("Python project file written to: %r" % qtc_prj) print("Python project file written to: %r" % qtc_prj)

View File

@@ -1,62 +0,0 @@
# turn everything OFF except for python which defaults to ON
# and is needed for the UI
#
# Example usage:
# cmake -C../blender/build_files/cmake/config/blender_full.cmake ../blender
#
set(WITH_BUILDINFO ON CACHE BOOL "" FORCE)
set(WITH_BULLET ON CACHE BOOL "" FORCE)
set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_GAMEENGINE ON CACHE BOOL "" FORCE)
set(WITH_COMPOSITOR ON CACHE BOOL "" FORCE)
set(WITH_FREESTYLE ON CACHE BOOL "" FORCE)
set(WITH_GHOST_XDND ON CACHE BOOL "" FORCE)
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_FRAMESERVER ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_REDCODE ON CACHE BOOL "" FORCE)
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
set(WITH_INTERNATIONAL ON CACHE BOOL "" FORCE)
set(WITH_JACK ON CACHE BOOL "" FORCE)
set(WITH_LZMA ON CACHE BOOL "" FORCE)
set(WITH_LZO ON CACHE BOOL "" FORCE)
set(WITH_MOD_BOOLEAN ON CACHE BOOL "" FORCE)
set(WITH_MOD_FLUID ON CACHE BOOL "" FORCE)
set(WITH_MOD_REMESH ON CACHE BOOL "" FORCE)
set(WITH_MOD_SMOKE ON CACHE BOOL "" FORCE)
set(WITH_MOD_OCEANSIM ON CACHE BOOL "" FORCE)
set(WITH_AUDASPACE ON CACHE BOOL "" FORCE)
set(WITH_OPENAL ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA ON CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO ON CACHE BOOL "" FORCE)
set(WITH_OPENMP ON CACHE BOOL "" FORCE)
set(WITH_OPENNL ON CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE)
set(WITH_RAYOPTIMIZATION ON CACHE BOOL "" FORCE)
set(WITH_SDL ON CACHE BOOL "" FORCE)
set(WITH_X11_XINPUT ON CACHE BOOL "" FORCE)
set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
set(WITH_PLAYER ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
if(UNIX AND NOT APPLE)
set(WITH_DOC_MANPAGE ON CACHE BOOL "" FORCE)
endif()
if(APPLE)
set(WITH_CODEC_QUICKTIME ON CACHE BOOL "" FORCE)
endif()

View File

@@ -44,7 +44,6 @@ set(WITH_AUDASPACE OFF CACHE BOOL "" FORCE)
set(WITH_OPENAL OFF CACHE BOOL "" FORCE) set(WITH_OPENAL OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE) set(WITH_OPENCOLLADA OFF CACHE BOOL "" FORCE)
set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE) set(WITH_OPENCOLORIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE)
set(WITH_OPENMP OFF CACHE BOOL "" FORCE) set(WITH_OPENMP OFF CACHE BOOL "" FORCE)
set(WITH_OPENNL OFF CACHE BOOL "" FORCE) set(WITH_OPENNL OFF CACHE BOOL "" FORCE)
set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE) set(WITH_PYTHON_INSTALL OFF CACHE BOOL "" FORCE)

View File

@@ -118,19 +118,6 @@ macro(target_link_libraries_debug TARGET LIBS)
unset(_LIB) unset(_LIB)
endmacro() endmacro()
macro(target_link_libraries_decoupled target libraries_var)
if(NOT MSVC)
target_link_libraries(${target} ${${libraries_var}})
else()
# For MSVC we link to different libraries depending whether
# release or debug target is being built.
file_list_suffix(_libraries_debug "${${libraries_var}}" "_d")
target_link_libraries_debug(${target} "${_libraries_debug}")
target_link_libraries_optimized(${target} "${${libraries_var}}")
unset(_libraries_debug)
endif()
endmacro()
# Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/ # Nicer makefiles with -I/1/foo/ instead of -I/1/2/3/../../foo/
# use it instead of include_directories() # use it instead of include_directories()
macro(blender_include_dirs macro(blender_include_dirs
@@ -234,7 +221,7 @@ macro(SETUP_LIBDIRS)
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
link_directories(${PYTHON_LIBPATH}) link_directories(${PYTHON_LIBPATH})
endif() endif()
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD) if(WITH_SDL)
link_directories(${SDL_LIBPATH}) link_directories(${SDL_LIBPATH})
endif() endif()
if(WITH_CODEC_FFMPEG) if(WITH_CODEC_FFMPEG)
@@ -296,13 +283,9 @@ macro(setup_liblinks
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
target_link_libraries(${target} target_link_libraries(${target}
${OPENGL_gl_LIBRARY}
${OPENGL_glu_LIBRARY}
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${FREETYPE_LIBRARY}) ${FREETYPE_LIBRARY})
@@ -321,11 +304,8 @@ macro(setup_liblinks
endif() endif()
endif() endif()
if(WITH_LZO AND WITH_SYSTEM_LZO)
target_link_libraries(${target} ${LZO_LIBRARIES})
endif()
if(WITH_SYSTEM_GLEW) if(WITH_SYSTEM_GLEW)
target_link_libraries(${target} ${BLENDER_GLEW_LIBRARIES}) target_link_libraries(${target} ${GLEW_LIBRARY})
endif() endif()
if(WITH_BULLET AND WITH_SYSTEM_BULLET) if(WITH_BULLET AND WITH_SYSTEM_BULLET)
target_link_libraries(${target} ${BULLET_LIBRARIES}) target_link_libraries(${target} ${BULLET_LIBRARIES})
@@ -342,7 +322,7 @@ macro(setup_liblinks
if(WITH_CODEC_SNDFILE) if(WITH_CODEC_SNDFILE)
target_link_libraries(${target} ${SNDFILE_LIBRARIES}) target_link_libraries(${target} ${SNDFILE_LIBRARIES})
endif() endif()
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD) if(WITH_SDL)
target_link_libraries(${target} ${SDL_LIBRARY}) target_link_libraries(${target} ${SDL_LIBRARY})
endif() endif()
if(WITH_CODEC_QUICKTIME) if(WITH_CODEC_QUICKTIME)
@@ -357,9 +337,6 @@ macro(setup_liblinks
if(WITH_OPENCOLORIO) if(WITH_OPENCOLORIO)
target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES}) target_link_libraries(${target} ${OPENCOLORIO_LIBRARIES})
endif() endif()
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_BOOST) if(WITH_BOOST)
target_link_libraries(${target} ${BOOST_LIBRARIES}) target_link_libraries(${target} ${BOOST_LIBRARIES})
if(Boost_USE_STATIC_LIBS AND Boost_USE_ICU) if(Boost_USE_STATIC_LIBS AND Boost_USE_ICU)
@@ -381,6 +358,11 @@ macro(setup_liblinks
target_link_libraries(${target} ${OPENJPEG_LIBRARIES}) target_link_libraries(${target} ${OPENJPEG_LIBRARIES})
endif() endif()
if(WITH_CODEC_FFMPEG) if(WITH_CODEC_FFMPEG)
# Strange!, without this ffmpeg gives linking errors (on linux)
# even though its linked above
target_link_libraries(${target} ${OPENGL_glu_LIBRARY})
target_link_libraries(${target} ${FFMPEG_LIBRARIES}) target_link_libraries(${target} ${FFMPEG_LIBRARIES})
endif() endif()
if(WITH_OPENCOLLADA) if(WITH_OPENCOLLADA)
@@ -418,29 +400,16 @@ macro(setup_liblinks
if(WITH_MOD_CLOTH_ELTOPO) if(WITH_MOD_CLOTH_ELTOPO)
target_link_libraries(${target} ${LAPACK_LIBRARIES}) target_link_libraries(${target} ${LAPACK_LIBRARIES})
endif() endif()
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_LLVM) if(WITH_LLVM)
target_link_libraries(${target} ${LLVM_LIBRARY}) target_link_libraries(${target} ${LLVM_LIBRARY})
endif() endif()
if(WITH_ALEMBIC)
target_link_libraries(${target} ${ALEMBIC_LIBRARIES})
endif()
if(WITH_HDF5)
target_link_libraries(${target} ${HDF5_LIBRARIES})
endif()
if(WIN32 AND NOT UNIX) if(WIN32 AND NOT UNIX)
target_link_libraries(${target} ${PTHREADS_LIBRARIES}) target_link_libraries(${target} ${PTHREADS_LIBRARIES})
endif() endif()
# We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them..
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
target_link_libraries(${target} "extern_clew")
target_link_libraries(${target} "extern_cuew")
endif()
#system libraries with no dependencies such as platform link libs or opengl should go last
target_link_libraries(${target}
${BLENDER_GL_LIBRARIES})
target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS}) target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS})
endmacro() endmacro()
@@ -504,7 +473,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
bf_editor_object bf_editor_object
bf_editor_armature bf_editor_armature
bf_editor_physics bf_editor_physics
bf_editor_hair
bf_editor_render bf_editor_render
bf_editor_screen bf_editor_screen
bf_editor_sculpt_paint bf_editor_sculpt_paint
@@ -519,19 +487,17 @@ macro(SETUP_BLENDER_SORTED_LIBS)
bf_python_ext bf_python_ext
bf_python_mathutils bf_python_mathutils
bf_python_bmesh bf_python_bmesh
bf_python_bparticles
bf_freestyle bf_freestyle
bf_ikplugin bf_ikplugin
bf_modifiers bf_modifiers
bf_bmesh bf_bmesh
bf_gpu
bf_blenkernel bf_blenkernel
bf_physics
bf_nodes bf_nodes
bf_rna bf_gpu
bf_blenloader bf_blenloader
bf_imbuf bf_imbuf
bf_blenlib bf_blenlib
bf_depsgraph
bf_intern_ghost bf_intern_ghost
bf_intern_string bf_intern_string
bf_avi bf_avi
@@ -550,6 +516,7 @@ macro(SETUP_BLENDER_SORTED_LIBS)
ge_phys_dummy ge_phys_dummy
ge_phys_bullet ge_phys_bullet
bf_intern_smoke bf_intern_smoke
extern_minilzo
extern_lzma extern_lzma
extern_colamd extern_colamd
ge_logic_ketsji ge_logic_ketsji
@@ -566,10 +533,9 @@ macro(SETUP_BLENDER_SORTED_LIBS)
extern_openjpeg extern_openjpeg
extern_redcode extern_redcode
ge_videotex ge_videotex
bf_rna
bf_dna bf_dna
bf_blenfont bf_blenfont
bf_pointcache_alembic
bf_pointcache
bf_intern_audaspace bf_intern_audaspace
bf_intern_mikktspace bf_intern_mikktspace
bf_intern_dualcon bf_intern_dualcon
@@ -586,9 +552,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
extern_wcwidth extern_wcwidth
extern_libmv extern_libmv
extern_glog extern_glog
extern_sdlew
bf_intern_glew_mx
) )
if(WITH_COMPOSITOR) if(WITH_COMPOSITOR)
@@ -605,12 +568,8 @@ macro(SETUP_BLENDER_SORTED_LIBS)
list(APPEND BLENDER_SORTED_LIBS extern_eltopo) list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
endif() endif()
if(NOT WITH_SYSTEM_LZO)
list(APPEND BLENDER_SORTED_LIBS extern_minilzo)
endif()
if(NOT WITH_SYSTEM_GLEW) if(NOT WITH_SYSTEM_GLEW)
list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES}) list(APPEND BLENDER_SORTED_LIBS extern_glew)
endif() endif()
if(WITH_BINRELOC) if(WITH_BINRELOC)
@@ -754,8 +713,6 @@ macro(TEST_SSE_SUPPORT
endmacro() endmacro()
macro(TEST_STDBOOL_SUPPORT) macro(TEST_STDBOOL_SUPPORT)
include(CheckCSourceRuns)
# This program will compile correctly if and only if # This program will compile correctly if and only if
# this C compiler supports C99 stdbool. # this C compiler supports C99 stdbool.
check_c_source_runs(" check_c_source_runs("
@@ -941,7 +898,6 @@ macro(remove_strict_flags)
remove_cc_flag("-Wstrict-prototypes") remove_cc_flag("-Wstrict-prototypes")
remove_cc_flag("-Wmissing-prototypes") remove_cc_flag("-Wmissing-prototypes")
remove_cc_flag("-Wunused-parameter") remove_cc_flag("-Wunused-parameter")
remove_cc_flag("-Wunused-macros")
remove_cc_flag("-Wwrite-strings") remove_cc_flag("-Wwrite-strings")
remove_cc_flag("-Wredundant-decls") remove_cc_flag("-Wredundant-decls")
remove_cc_flag("-Wundef") remove_cc_flag("-Wundef")
@@ -971,20 +927,6 @@ macro(remove_strict_flags)
endmacro() endmacro()
macro(remove_extra_strict_flags)
if(CMAKE_COMPILER_IS_GNUCC)
remove_cc_flag("-Wunused-parameter")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
remove_cc_flag("-Wunused-parameter")
endif()
if(MSVC)
# TODO
endif()
endmacro()
# note, we can only append flags on a single file so we need to negate the options. # note, we can only append flags on a single file so we need to negate the options.
# at the moment we cant shut up ffmpeg deprecations, so use this, but will # at the moment we cant shut up ffmpeg deprecations, so use this, but will
# probably add more removals here. # probably add more removals here.
@@ -1045,16 +987,7 @@ macro(ADD_CHECK_CXX_COMPILER_FLAG
endif() endif()
endmacro() endmacro()
function(get_blender_version) macro(get_blender_version)
# extracts header vars and defines them in the parent scope:
#
# - BLENDER_VERSION (major.minor)
# - BLENDER_VERSION_MAJOR
# - BLENDER_VERSION_MINOR
# - BLENDER_SUBVERSION (used for internal versioning mainly)
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
# So cmake depends on BKE_blender.h, beware of inf-loops! # So cmake depends on BKE_blender.h, beware of inf-loops!
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done) ${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
@@ -1087,29 +1020,33 @@ function(get_blender_version)
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE") message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE")
endif() endif()
math(EXPR _out_version_major "${_out_version} / 100") math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
math(EXPR _out_version_minor "${_out_version} % 100") math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}")
set(BLENDER_SUBVERSION ${_out_subversion})
set(BLENDER_VERSION_CHAR ${_out_version_char})
set(BLENDER_VERSION_CYCLE ${_out_version_cycle})
# for packaging, alpha to numbers # for packaging, alpha to numbers
string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty) string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
if(${_out_version_char_empty}) if(${_out_version_char_empty})
set(_out_version_char_index "0") set(BLENDER_VERSION_CHAR_INDEX "0")
else() else()
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z) set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
list(FIND _char_ls ${_out_version_char} _out_version_char_index) list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
math(EXPR _out_version_char_index "${_out_version_char_index} + 1") math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1")
unset(_char_ls)
unset(_out_version_char_index)
endif() endif()
# output vars unset(_out_subversion)
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE) unset(_out_version_char)
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE) unset(_out_version_char_empty)
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE) unset(_out_version_cycle)
set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
endfunction() # message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
endmacro()
# hacks to override initial project settings # hacks to override initial project settings
@@ -1146,7 +1083,7 @@ endmacro()
macro(blender_project_hack_post) macro(blender_project_hack_post)
# -------------- # --------------
# MINGW HACK END # MINGW HACK END
if(_reset_standard_libraries) if (_reset_standard_libraries)
# Must come after projecINCt(...) # Must come after projecINCt(...)
# #
# MINGW workaround for -ladvapi32 being included which surprisingly causes # MINGW workaround for -ladvapi32 being included which surprisingly causes
@@ -1206,7 +1143,6 @@ macro(delayed_install
endif() endif()
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination}) set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination})
endforeach() endforeach()
unset(f)
endmacro() endmacro()
# note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir # note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir
@@ -1226,7 +1162,6 @@ function(delayed_do_install
list(GET destinations ${i} d) list(GET destinations ${i} d)
install(FILES ${f} DESTINATION ${targetdir}/${d}) install(FILES ${f} DESTINATION ${targetdir}/${d})
endforeach() endforeach()
unset(f)
endif() endif()
endfunction() endfunction()
@@ -1390,65 +1325,3 @@ macro(msgfmt_simple
unset(_file_to) unset(_file_to)
unset(_file_to_path) unset(_file_to_path)
endmacro() endmacro()
macro(find_python_package
package)
string(TOUPPER ${package} _upper_package)
# set but invalid
if((NOT ${PYTHON_${_upper_package}_PATH} STREQUAL "") AND
(NOT ${PYTHON_${_upper_package}_PATH} MATCHES NOTFOUND))
# if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}/${package}")
# message(WARNING "PYTHON_${_upper_package}_PATH is invalid, ${package} not found in '${PYTHON_${_upper_package}_PATH}' "
# "WITH_PYTHON_INSTALL_${_upper_package} option will be ignored when installing python")
# set(WITH_PYTHON_INSTALL${_upper_package} OFF)
# endif()
# not set, so initialize
else()
string(REPLACE "." ";" _PY_VER_SPLIT "${PYTHON_VERSION}")
list(GET _PY_VER_SPLIT 0 _PY_VER_MAJOR)
# re-cache
unset(PYTHON_${_upper_package}_PATH CACHE)
find_path(PYTHON_${_upper_package}_PATH
NAMES
${package}
HINTS
"${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
"${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
PATH_SUFFIXES
site-packages
dist-packages
NO_DEFAULT_PATH
)
if(NOT EXISTS "${PYTHON_${_upper_package}_PATH}")
message(WARNING "'${package}' path could not be found in:\n"
"'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${package}', "
"'${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/site-packages/${package}', "
"'${PYTHON_LIBPATH}/python${PYTHON_VERSION}/dist-packages/${package}', "
"'${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/dist-packages/${package}', "
"WITH_PYTHON_INSTALL_${_upper_package} option will be ignored when installing python")
set(WITH_PYTHON_INSTALL_${_upper_package} OFF)
else()
message(STATUS "${package} found at '${PYTHON_${_upper_package}_PATH}'")
endif()
unset(_PY_VER_SPLIT)
unset(_PY_VER_MAJOR)
endif()
unset(_upper_package)
endmacro()
# like Python's 'print(dir())'
macro(print_all_vars)
get_cmake_property(_vars VARIABLES)
foreach(_var ${_vars})
message("${_var}=${${_var}}")
endforeach()
unset(_vars)
unset(_var)
endmacro()

View File

@@ -2,6 +2,7 @@ set(PROJECT_DESCRIPTION "Blender is a very fast and versatile 3D modeller/rende
set(PROJECT_COPYRIGHT "Copyright (C) 2001-2012 Blender Foundation") set(PROJECT_COPYRIGHT "Copyright (C) 2001-2012 Blender Foundation")
set(PROJECT_CONTACT "foundation@blender.org") set(PROJECT_CONTACT "foundation@blender.org")
set(PROJECT_VENDOR "Blender Foundation") set(PROJECT_VENDOR "Blender Foundation")
set(ORG_WEBSITE "www.blender.org")
set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR}) set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
set(MINOR_VERSION ${BLENDER_VERSION_MINOR}) set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
@@ -27,12 +28,10 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
execute_process(COMMAND git rev-parse --short @{u} execute_process(COMMAND git rev-parse --short @{u}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE)
ERROR_QUIET)
endif() endif()
endif() endif()
set(BUILD_REV ${MY_WC_HASH}) set(BUILD_REV ${MY_WC_HASH})
unset(MY_WC_HASH)
# Force Package Name # Force Package Name
@@ -42,7 +41,7 @@ set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# RPM packages # RPM packages
include(build_files/cmake/RpmBuild.cmake) include(build_files/cmake/RpmBuild.cmake)
if(RPMBUILD_FOUND) if(RPMBUILD_FOUND AND NOT WIN32)
set(CPACK_GENERATOR "RPM") set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_PACKAGE_RELEASE "git${CPACK_DATE}.${BUILD_REV}") set(CPACK_RPM_PACKAGE_RELEASE "git${CPACK_DATE}.${BUILD_REV}")
set(CPACK_SET_DESTDIR "true") set(CPACK_SET_DESTDIR "true")
@@ -62,25 +61,7 @@ if(APPLE)
set(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE) set(CPACK_COMPONENT_LIBRARIES_HIDDEN TRUE)
endif() endif()
if(WIN32) set(CPACK_PACKAGE_EXECUTABLES "blender")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Blender Foundation/Blender")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Blender Foundation/Blender")
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/source/icons/winblender.ico)
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt)
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_SOURCE_DIR}/source/icons/winblender.ico)
set(CPACK_WIX_UPGRADE_GUID "B767E4FD-7DE7-4094-B051-3AE62E13A17A")
set(CPACK_WIX_UI_BANNER ${LIBDIR}/package/installer_wix/WIX_UI_BANNER.bmp)
set(CPACK_WIX_UI_DIALOG ${LIBDIR}/package/installer_wix/WIX_UI_DIALOG.bmp)
#force lzma instead of deflate
set(CPACK_WIX_LIGHT_EXTRA_FLAGS -dcl:high)
endif()
set(CPACK_PACKAGE_EXECUTABLES "blender" "blender")
include(CPack) include(CPack)
# Target for build_archive.py script, to automatically pass along # Target for build_archive.py script, to automatically pass along
@@ -95,8 +76,6 @@ macro(add_package_archive packagename extension)
OUTPUT ${package_output} OUTPUT ${package_output}
COMMAND ${build_archive} ${packagename} ${extension} bin release COMMAND ${build_archive} ${packagename} ${extension} bin release
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
unset(build_archive)
unset(package_output)
endmacro() endmacro()
if(APPLE) if(APPLE)
@@ -112,9 +91,3 @@ elseif(UNIX)
"tar.bz2") "tar.bz2")
endif() endif()
unset(MAJOR_VERSION)
unset(MINOR_VERSION)
unset(PATCH_VERSION)
unset(BUILD_REV)

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/python
# <pep8 compliant> # <pep8 compliant>

View File

@@ -12,12 +12,12 @@ blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blen
# map the version a -> 1 # map the version a -> 1
# not to be confused with blender's internal subversions # not to be confused with blender's internal subversions
if [ "$blender_version_char" ]; then if [ "$blender_version_char" ]; then
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char) blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
else else
blender_version_full=${blender_version} blender_version_full=${blender_version}
fi fi
blender_ver_string=$blender_version+git$blender_version_full blender_ver_string=$blender_version+svn$blender_version_full
pkgname=blender-snapshot pkgname=blender-snapshot
pkgver=$blender_ver_string pkgver=$blender_ver_string
@@ -27,8 +27,8 @@ arch=('i686' 'x86_64')
url="www.blender.org" url="www.blender.org"
license=('GPL') license=('GPL')
groups=() groups=()
depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.4' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg') depends=('libjpeg' 'libpng' 'openjpeg' 'libtiff' 'openexr' 'python>=3.2' 'gettext' 'libxi' 'libxmu' 'mesa' 'freetype2' 'openal' 'sdl' 'libsndfile' 'ffmpeg')
makedepends=('cmake' 'git') makedepends=('cmake' 'svn')
optdepends=() optdepends=()
provides=() provides=()
conflicts=('blender') conflicts=('blender')
@@ -36,7 +36,7 @@ replaces=('blender')
backup=() backup=()
options=() options=()
install=blender.install install=blender.install
# use current git to make the package. # use current svn to make the package.
# source=(http://download.blender.org/source/$pkgname-$pkgver.tar.gz) # source=(http://download.blender.org/source/$pkgname-$pkgver.tar.gz)
# md5sums=('27edb80c82c25252d43d6a01980d953a') #generate with 'makepkg -g' # md5sums=('27edb80c82c25252d43d6a01980d953a') #generate with 'makepkg -g'
source=() source=()
@@ -51,7 +51,11 @@ build() {
-DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_BUILD_TYPE:STRING=Release \
-DWITH_INSTALL_PORTABLE:BOOL=OFF \ -DWITH_INSTALL_PORTABLE:BOOL=OFF \
-DWITH_PYTHON_INSTALL:BOOL=OFF \ -DWITH_PYTHON_INSTALL:BOOL=OFF \
-DWITH_OPENCOLLADA:BOOL=OFF -DWITH_OPENCOLLADA:BOOL=OFF \
-DPYTHON_VERSION:STRING=3.2 \
-DPYTHON_LIBPATH:STRING=/usr/lib \
-DPYTHON_LIBRARY:STRING=python3.2mu \
-DPYTHON_INCLUDE_DIRS:STRING=/usr/include/python3.2mu
make $MAKEFLAGS make $MAKEFLAGS
} }
@@ -60,7 +64,7 @@ package() {
cd $srcdir/build cd $srcdir/build
make DESTDIR="$pkgdir" install make DESTDIR="$pkgdir" install
python -m compileall \ python -m compileall \
$pkgdir/usr/share/blender/$blender_version/scripts/startup \ $pkgdir/usr/share/blender/$blender_version/scripts/startup \
$pkgdir/usr/share/blender/$blender_version/scripts/modules \ $pkgdir/usr/share/blender/$blender_version/scripts/modules \
$pkgdir/usr/share/blender/$blender_version/scripts/addons $pkgdir/usr/share/blender/$blender_version/scripts/addons
} }

View File

@@ -68,7 +68,7 @@ BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib ${BF_FFMPEG}/lib' #ogg libs are stored i
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix) BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags) BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
BF_SDL_LIB = 'SDL2' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
BF_SDL_LIBPATH = '${BF_SDL}/lib' BF_SDL_LIBPATH = '${BF_SDL}/lib'
WITH_BF_OPENEXR = True WITH_BF_OPENEXR = True
@@ -154,7 +154,7 @@ BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada' BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada' BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include' BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa' BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa'
BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada' BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada'
BF_PCRE = LIBDIR + '/opencollada' BF_PCRE = LIBDIR + '/opencollada'
BF_PCRE_LIB = 'pcre' BF_PCRE_LIB = 'pcre'
@@ -181,7 +181,7 @@ WITH_BF_LLVM = True
BF_LLVM = LIBDIR + '/llvm' BF_LLVM = LIBDIR + '/llvm'
BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \ BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \ 'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
'LLVMTarget LLVMMC LLVMCore LLVMSupport LLVMObject' 'LLVMTarget LLVMMC LLVMCore LLVMSupport'
BF_LLVM_LIBPATH = '${BF_LLVM}/lib' BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
WITH_BF_OIIO = True WITH_BF_OIIO = True
@@ -205,7 +205,7 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_CYCLES_CUDA_BINARIES = False WITH_BF_CYCLES_CUDA_BINARIES = False
BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc' BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
#Freestyle #Freestyle
WITH_BF_FREESTYLE = True WITH_BF_FREESTYLE = True
@@ -237,7 +237,7 @@ LLIBS = ['stdc++']
REL_CFLAGS = [] REL_CFLAGS = []
REL_CXXFLAGS = [] REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2'] REL_CCFLAGS = ['-DNDEBUG', '-O2']
CC_WARN = ['-Wall'] CC_WARN = ['-Wall']
C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes'] C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
@@ -253,7 +253,7 @@ BF_PROFILE_LINKFLAGS = ['-pg']
BF_PROFILE = False BF_PROFILE = False
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
############################################################################# #############################################################################
################### Output directories ################## ################### Output directories ##################

View File

@@ -52,9 +52,9 @@ BF_OPENEXR = '/usr'
# BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include' # BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR' BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf-2_1 Iex-2_1 Imath-2_1 ' BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a' BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib' # BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
WITH_BF_DDS = True WITH_BF_DDS = True
@@ -144,7 +144,7 @@ BF_REDCODE_LIB = ''
BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now. BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
BF_REDCODE_LIBPATH='${BF_REDCODE}/lib' BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
# Mesa Libs should go here if you're using them as well.... # Mesa Libs should go here if your using them as well....
WITH_BF_STATICOPENGL = False WITH_BF_STATICOPENGL = False
BF_OPENGL = '/usr' BF_OPENGL = '/usr'
BF_OPENGL_INC = '${BF_OPENGL}/include' BF_OPENGL_INC = '${BF_OPENGL}/include'
@@ -197,7 +197,7 @@ BF_BOOST = '/usr'
BF_BOOST_INC = '${BF_BOOST}/include' BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'boost_filesystem boost_regex boost_system boost_thread boost_date_time' BF_BOOST_LIB = 'boost_filesystem boost_regex boost_system boost_thread boost_date_time'
BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \ BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
'${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a ' + \ '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a' + \
'${BF_BOOST_LIBPATH}/libboost_thread.a' '${BF_BOOST_LIBPATH}/libboost_thread.a'
BF_BOOST_LIB_INTERNATIONAL = 'boost_locale' BF_BOOST_LIB_INTERNATIONAL = 'boost_locale'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib' BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
@@ -226,25 +226,11 @@ BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
#Freestyle #Freestyle
WITH_BF_FREESTYLE = True WITH_BF_FREESTYLE = True
# HDF5
WITH_BF_HDF5 = True
BF_HDF5 = '/usr'
BF_HDF5_LIB = 'hdf5 hdf5_hl'
BF_HDF5_LIBPATH='${BF_HDF5}/lib'
# Alembic
WITH_BF_ALEMBIC = True
BF_ALEMBIC = '/opt/lib/alembic'
BF_ALEMBIC_LIB = 'AlembicAbcGeom AlembicAbc AlembicAbcCollection AlembicAbcCoreFactory AlembicAbcCoreHDF5 AlembicAbcCoreAbstract AlembicAbcCoreOgawa AlembicAbcMaterial AlembicOgawa AlembicUtil'
BF_ALEMBIC_INC = '${BF_ALEMBIC}/include'
BF_ALEMBIC_LIBPATH='${BF_ALEMBIC}/lib/static'
## ##
CC = 'gcc' CC = 'gcc'
CXX = 'g++' CXX = 'g++'
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE'] CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
CFLAGS = ['-std=gnu89']
CXXFLAGS = [] CXXFLAGS = []
CPPFLAGS = [] CPPFLAGS = []
@@ -255,7 +241,7 @@ if WITH_BF_FFMPEG:
CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ] CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
REL_CFLAGS = [] REL_CFLAGS = []
REL_CXXFLAGS = [] REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2'] REL_CCFLAGS = ['-DNDEBUG', '-O2']
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Wstrict-prototypes', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type'] C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Wstrict-prototypes', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
CC_WARN = ['-Wall'] CC_WARN = ['-Wall']
@@ -268,7 +254,7 @@ BF_PROFILE_CCFLAGS = ['-pg','-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS = ['-g'] BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
BF_BUILDDIR = '../build/linux' BF_BUILDDIR = '../build/linux'
BF_INSTALLDIR='../install/linux' BF_INSTALLDIR='../install/linux'
@@ -276,6 +262,6 @@ BF_INSTALLDIR='../install/linux'
#Link against pthread #Link against pthread
PLATFORM_LINKFLAGS = ['-pthread'] PLATFORM_LINKFLAGS = ['-pthread']
#Fix for LLVM conflict with Mesa llvmpipe, SDL dynload also requires symbols to be hidden. #Fix for LLVM conflict with Mesa llvmpipe
# TODO(sergey): Move this to SConstruct, so we can have this line depended on user config. if WITH_BF_LLVM:
PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map'] PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']

View File

@@ -170,8 +170,6 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_RAYOPTIMIZATION = True WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse'] BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
WITH_BF_IME = True
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
#CUDA #CUDA
@@ -192,16 +190,13 @@ CXXFLAGS = []
CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC'] CPPFLAGS = ['-DWIN32', '-DFREE_WINDOWS', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC']
REL_CFLAGS = [] REL_CFLAGS = []
REL_CXXFLAGS = [] REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2'] REL_CCFLAGS = ['-DNDEBUG', '-O2']
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes'] C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
CC_WARN = [ '-Wall' ] CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-ldbghelp'] LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi']
if WITH_BF_IME:
LLIBS.append('-limm32')
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152'] PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
@@ -210,7 +205,7 @@ PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"] # PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS= ['-g'] BF_DEBUG_CCFLAGS= ['-g', '-D_DEBUG']
BF_PROFILE_CCFLAGS = ['-pg', '-g'] BF_PROFILE_CCFLAGS = ['-pg', '-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']

View File

@@ -6,6 +6,9 @@ CL_STDOUT, CL_STDERR = CL_OUT.communicate()
if "18.00." in CL_STDERR: if "18.00." in CL_STDERR:
VC_VERSION = '12.0' VC_VERSION = '12.0'
LCGDIR = '#../lib/windows_vc12' LCGDIR = '#../lib/windows_vc12'
elif "15.00." in CL_STDERR:
VC_VERSION = '9.0'
LCGDIR = '#../lib/windows'
else: else:
import sys import sys
print("Visual C version not supported {}\n".format(CL_STDERR)) print("Visual C version not supported {}\n".format(CL_STDERR))
@@ -33,7 +36,7 @@ WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal' BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include ' BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'OpenAL32' BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_ICONV = True WITH_BF_ICONV = True
@@ -57,7 +60,7 @@ BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include' BF_SDL_INC = '${BF_SDL}/include'
BF_SDL_LIB = 'SDL2.lib' BF_SDL_LIB = 'SDL.lib'
BF_SDL_LIBPATH = '${BF_SDL}/lib' BF_SDL_LIBPATH = '${BF_SDL}/lib'
BF_PTHREADS = LIBDIR + '/pthreads' BF_PTHREADS = LIBDIR + '/pthreads'
@@ -69,7 +72,10 @@ WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr' BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR ' BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 ' if VC_VERSION == '12.0':
BF_OPENEXR_LIB = ' Iex-2_1 Half IlmImf-2_1 Imath-2_1 IlmThread-2_1 '
else:
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib' BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a' BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
@@ -148,11 +154,9 @@ BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada' BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada' BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa' BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa UTF'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
WITH_BF_IME = True
WITH_BF_3DMOUSE = True WITH_BF_3DMOUSE = True
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
@@ -192,14 +196,18 @@ WITH_BF_STATICOCIO = True
WITH_BF_BOOST = True WITH_BF_BOOST = True
BF_BOOST = '${LIBDIR}/boost' BF_BOOST = '${LIBDIR}/boost'
BF_BOOST_INC = '${BF_BOOST}/include' BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55' if VC_VERSION == '12.0':
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55' BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55'
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55'
else:
BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_49 libboost_filesystem-vc90-mt-s-1_49 libboost_regex-vc90-mt-s-1_49 libboost_system-vc90-mt-s-1_49 libboost_thread-vc90-mt-s-1_49 libboost_wave-vc90-mt-s-1_49'
BF_BOOST_LIB_INTERNATIONAL = 'libboost_locale-vc90-mt-s-1_49'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib' BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
#CUDA #CUDA
WITH_BF_CYCLES_CUDA_BINARIES = False WITH_BF_CYCLES_CUDA_BINARIES = False
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
#Ray trace optimization #Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True WITH_BF_RAYOPTIMIZATION = True
@@ -223,24 +231,18 @@ CCFLAGS = ['/nologo', '/J', '/W3', '/Gd', '/w34062', '/wd4018', '/wd4065', '/wd4
CXXFLAGS = ['/EHsc'] CXXFLAGS = ['/EHsc']
BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE'] BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
if VC_VERSION == '12.0':
CCFLAGS.append('/DOIIO_STATIC_BUILD') # OIIO api changed with 1.4 making this needed
BF_DEBUG_CCFLAGS = ['/Zi', '/Ob0', '/Od', '/FR${TARGET}.sbr'] BF_DEBUG_CCFLAGS = ['/Zi', '/Ob0', '/Od', '/FR${TARGET}.sbr']
CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC'] CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC']
REL_CFLAGS = [] REL_CFLAGS = []
REL_CXXFLAGS = [] REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2', '/Ob2'] REL_CCFLAGS = ['-O2', '/Ob2', '-DNDEBUG']
C_WARN = [] C_WARN = []
CC_WARN = [] CC_WARN = []
CXX_WARN = [] CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp'] LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
if WITH_BF_IME:
LLIBS.append('imm32')
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib'] PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
@@ -251,6 +253,10 @@ PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/IN
BF_BSC=False BF_BSC=False
BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" if VC_VERSION == '12.0':
BF_BUILDDIR = '..\\build\\win32-vc' BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
BF_INSTALLDIR='..\\install\\win32-vc' BF_BUILDDIR = '..\\build\\win32-vc'
BF_INSTALLDIR='..\\install\\win32-vc'
else:
BF_BUILDDIR = '..\\build\\win32-vc9'
BF_INSTALLDIR='..\\install\\win32-vc9'

View File

@@ -169,8 +169,6 @@ BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
WITH_BF_RAYOPTIMIZATION = True WITH_BF_RAYOPTIMIZATION = True
BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2'] BF_RAYOPTIMIZATION_SSE_FLAGS = ['-mmmx', '-msse', '-msse2']
WITH_BF_IME = True
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
#Freestyle #Freestyle
@@ -186,17 +184,13 @@ CXXFLAGS = [ '-fpermissive' ]
CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC'] CPPFLAGS = ['-DWIN32', '-DMS_WIN64', '-DFREE_WINDOWS', '-DFREE_WINDOWS64', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE64_SOURCE', '-DBOOST_ALL_NO_LIB', '-DBOOST_THREAD_USE_LIB', '-DGLEW_STATIC', '-DOPJ_STATIC']
REL_CFLAGS = [] REL_CFLAGS = []
REL_CXXFLAGS = [] REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2', '-ftree-vectorize'] REL_CCFLAGS = ['-DNDEBUG', '-O2', '-ftree-vectorize']
# NOTE: C_WARN seems to get ignored - at least -Wno-char-subscripts doesn't work!
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes'] C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-prototypes']
CC_WARN = [ '-Wall', '-Wno-char-subscripts' ] CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-ldbghelp'] LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread']
if WITH_BF_IME:
LLIBS.append('-limm32')
PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152'] PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
@@ -205,7 +199,7 @@ PLATFORM_LINKFLAGS = ['-Xlinker', '--stack=2097152']
# PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"] # PLATFORM_LINKFLAGS += ["-static-libgcc", "-static-libstdc++"]
BF_DEBUG = False BF_DEBUG = False
BF_DEBUG_CCFLAGS= ['-g'] BF_DEBUG_CCFLAGS= ['-g', '-D_DEBUG']
BF_PROFILE_CCFLAGS = ['-pg', '-g'] BF_PROFILE_CCFLAGS = ['-pg', '-g']
BF_PROFILE_LINKFLAGS = ['-pg'] BF_PROFILE_LINKFLAGS = ['-pg']

View File

@@ -6,6 +6,9 @@ CL_STDOUT, CL_STDERR = CL_OUT.communicate()
if "18.00." in CL_STDERR: if "18.00." in CL_STDERR:
VC_VERSION = '12.0' VC_VERSION = '12.0'
LCGDIR = '#../lib/win64_vc12' LCGDIR = '#../lib/win64_vc12'
elif "15.00." in CL_STDERR:
VC_VERSION = '9.0'
LCGDIR = '#../lib/win64'
else: else:
import sys import sys
print("Visual C version not supported {}\n".format(CL_STDERR)) print("Visual C version not supported {}\n".format(CL_STDERR))
@@ -34,7 +37,7 @@ WITH_BF_PYTHON_INSTALL_NUMPY = True
WITH_BF_OPENAL = True WITH_BF_OPENAL = True
BF_OPENAL = LIBDIR + '/openal' BF_OPENAL = LIBDIR + '/openal'
BF_OPENAL_INC = '${BF_OPENAL}/include ' BF_OPENAL_INC = '${BF_OPENAL}/include '
BF_OPENAL_LIB = 'OpenAL32' BF_OPENAL_LIB = 'wrap_oal'
BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
WITH_BF_SNDFILE = True WITH_BF_SNDFILE = True
@@ -52,7 +55,7 @@ BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
WITH_BF_SDL = True WITH_BF_SDL = True
BF_SDL = LIBDIR + '/sdl' BF_SDL = LIBDIR + '/sdl'
BF_SDL_INC = '${BF_SDL}/include' BF_SDL_INC = '${BF_SDL}/include'
BF_SDL_LIB = 'SDL2.lib' BF_SDL_LIB = 'SDL.lib'
BF_SDL_LIBPATH = '${BF_SDL}/lib' BF_SDL_LIBPATH = '${BF_SDL}/lib'
WITH_BF_JACK = False WITH_BF_JACK = False
@@ -66,7 +69,10 @@ WITH_BF_OPENEXR = True
WITH_BF_STATICOPENEXR = False WITH_BF_STATICOPENEXR = False
BF_OPENEXR = LIBDIR + '/openexr' BF_OPENEXR = LIBDIR + '/openexr'
BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR ' BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
BF_OPENEXR_LIB = ' Iex-2_2 Half IlmImf-2_2 Imath-2_2 IlmThread-2_2 ' if VC_VERSION == '12.0':
BF_OPENEXR_LIB = ' Iex-2_1 Half IlmImf-2_1 Imath-2_1 IlmThread-2_1 '
else:
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib' BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a' BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
@@ -151,11 +157,9 @@ BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada' BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada' BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa' BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa UTF'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada' BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
WITH_BF_IME = True
WITH_BF_3DMOUSE = True WITH_BF_3DMOUSE = True
WITH_BF_OPENMP = True WITH_BF_OPENMP = True
@@ -182,7 +186,7 @@ WITH_BF_OIIO = True
BF_OIIO = '${LIBDIR}/openimageio' BF_OIIO = '${LIBDIR}/openimageio'
BF_OIIO_INC = '${BF_OIIO}/include' BF_OIIO_INC = '${BF_OIIO}/include'
BF_OIIO_LIBPATH = '${BF_OIIO}/lib' BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib ${BF_OIIO_LIBPATH}/OpenImageIO_Util.lib' BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib'
WITH_BF_STATICOIIO = True WITH_BF_STATICOIIO = True
WITH_BF_OCIO = True WITH_BF_OCIO = True
@@ -195,14 +199,18 @@ WITH_BF_STATICOCIO = True
WITH_BF_BOOST = True WITH_BF_BOOST = True
BF_BOOST = '${LIBDIR}/boost' BF_BOOST = '${LIBDIR}/boost'
BF_BOOST_INC = '${BF_BOOST}/include' BF_BOOST_INC = '${BF_BOOST}/include'
BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55' if VC_VERSION == '12.0':
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55' BF_BOOST_LIB = 'libboost_date_time-vc120-mt-s-1_55 libboost_filesystem-vc120-mt-s-1_55 libboost_regex-vc120-mt-s-1_55 libboost_system-vc120-mt-s-1_55 libboost_thread-vc120-mt-s-1_55 libboost_wave-vc120-mt-s-1_55'
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc120-mt-s-1_55'
else:
BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_49 libboost_filesystem-vc90-mt-s-1_49 libboost_regex-vc90-mt-s-1_49 libboost_system-vc90-mt-s-1_49 libboost_thread-vc90-mt-s-1_49 libboost_wave-vc90-mt-s-1_49'
BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc90-mt-s-1_49'
BF_BOOST_LIBPATH = '${BF_BOOST}/lib' BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
#CUDA #CUDA
WITH_BF_CYCLES_CUDA_BINARIES = False WITH_BF_CYCLES_CUDA_BINARIES = False
#BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52'] BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50']
#Ray trace optimization #Ray trace optimization
WITH_BF_RAYOPTIMIZATION = True WITH_BF_RAYOPTIMIZATION = True
@@ -228,7 +236,6 @@ CCFLAGS = ['/nologo', '/J', '/W3', '/Gd', '/w34062', '/wd4018', '/wd4065', '/wd4
# We want to support Vista level ABI for x64 # We want to support Vista level ABI for x64
if VC_VERSION == '12.0': if VC_VERSION == '12.0':
CCFLAGS.append('/D_WIN32_WINNT=0x600') CCFLAGS.append('/D_WIN32_WINNT=0x600')
CCFLAGS.append('/DOIIO_STATIC_BUILD') # OIIO api changed with 1.4 making this needed
CXXFLAGS = ['/EHsc'] CXXFLAGS = ['/EHsc']
BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast'] BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast']
@@ -238,19 +245,19 @@ BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr', '/Od', '/Ob0']
CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC'] CPPFLAGS = ['-DWIN32', '-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC']
REL_CFLAGS = [] REL_CFLAGS = []
REL_CXXFLAGS = [] REL_CXXFLAGS = []
REL_CCFLAGS = ['-O2', '/Ob2'] REL_CCFLAGS = ['-O2', '/Ob2', '-DNDEBUG']
C_WARN = [] C_WARN = []
CC_WARN = [] CC_WARN = []
CXX_WARN = [] CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp'] LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
if WITH_BF_IME:
LLIBS.append('imm32')
PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib'] PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:X64','/STACK:2097152','/OPT:NOREF','/INCREMENTAL:NO', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
if VC_VERSION == '12.0':
BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" BF_CYCLES_CUDA_ENV="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd"
BF_BUILDDIR = '..\\build\\win64-vc' BF_BUILDDIR = '..\\build\\win64-vc'
BF_INSTALLDIR='..\\install\\win64-vc' BF_INSTALLDIR='..\\install\\win64-vc'
else:
BF_BUILDDIR = '..\\build\\win64-vc9'
BF_INSTALLDIR='..\\install\\win64-vc9'

138
build_files/scons/tools/Blender.py Normal file → Executable file
View File

@@ -143,7 +143,7 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_FREETYPE_LIBPATH']) libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
if lenv['WITH_BF_PYTHON']: if lenv['WITH_BF_PYTHON']:
libincs += Split(lenv['BF_PYTHON_LIBPATH']) libincs += Split(lenv['BF_PYTHON_LIBPATH'])
if lenv['WITH_BF_SDL'] and not lenv['WITH_BF_SDL_DYNLOAD']: if lenv['WITH_BF_SDL']:
libincs += Split(lenv['BF_SDL_LIBPATH']) libincs += Split(lenv['BF_SDL_LIBPATH'])
if lenv['WITH_BF_JACK'] and not lenv['WITH_BF_JACK_DYNLOAD']: if lenv['WITH_BF_JACK'] and not lenv['WITH_BF_JACK_DYNLOAD']:
libincs += Split(lenv['BF_JACK_LIBPATH']) libincs += Split(lenv['BF_JACK_LIBPATH'])
@@ -204,20 +204,10 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_OIIO_LIBPATH']) libincs += Split(lenv['BF_OIIO_LIBPATH'])
if lenv['WITH_BF_STATICOIIO']: if lenv['WITH_BF_STATICOIIO']:
statlibs += Split(lenv['BF_OIIO_LIB_STATIC']) statlibs += Split(lenv['BF_OIIO_LIB_STATIC'])
if lenv['WITH_BF_HDF5']:
libincs += Split(lenv['BF_HDF5_LIBPATH'])
if lenv['WITH_BF_ALEMBIC']:
libincs += Split(lenv['BF_ALEMBIC_LIBPATH'])
if lenv['WITH_BF_STATICALEMBIC']:
statlibs += Split(lenv['BF_ALEMBIC_LIB_STATIC'])
if lenv['WITH_BF_OPENEXR']: if lenv['WITH_BF_OPENEXR']:
libincs += Split(lenv['BF_OPENEXR_LIBPATH']) libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
if lenv['WITH_BF_STATICOPENEXR']: if lenv['WITH_BF_STATICOPENEXR']:
statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC']) statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
if lenv['WITH_BF_ZLIB'] and lenv['WITH_BF_STATICZLIB']: if lenv['WITH_BF_ZLIB'] and lenv['WITH_BF_STATICZLIB']:
statlibs += Split(lenv['BF_ZLIB_LIB_STATIC']) statlibs += Split(lenv['BF_ZLIB_LIB_STATIC'])
@@ -226,16 +216,16 @@ def setup_staticlibs(lenv):
if lenv['WITH_BF_STATICOCIO']: if lenv['WITH_BF_STATICOCIO']:
statlibs += Split(lenv['BF_OCIO_LIB_STATIC']) statlibs += Split(lenv['BF_OCIO_LIB_STATIC'])
if lenv['WITH_BF_CYCLES_OSL']:
libincs += Split(lenv['BF_OSL_LIBPATH'])
if lenv['WITH_BF_STATICOSL']:
statlibs += Split(lenv['BF_OSL_LIB_STATIC'])
if lenv['WITH_BF_BOOST']: if lenv['WITH_BF_BOOST']:
libincs += Split(lenv['BF_BOOST_LIBPATH']) libincs += Split(lenv['BF_BOOST_LIBPATH'])
if lenv['WITH_BF_STATICBOOST']: if lenv['WITH_BF_STATICBOOST']:
statlibs += Split(lenv['BF_BOOST_LIB_STATIC']) statlibs += Split(lenv['BF_BOOST_LIB_STATIC'])
if lenv['WITH_BF_CYCLES_OSL']:
libincs += Split(lenv['BF_OSL_LIBPATH'])
if lenv['WITH_BF_STATICOSL']:
statlibs += Split(lenv['BF_OSL_LIB_STATIC'])
if lenv['WITH_BF_LLVM']: if lenv['WITH_BF_LLVM']:
libincs += Split(lenv['BF_LLVM_LIBPATH']) libincs += Split(lenv['BF_LLVM_LIBPATH'])
if lenv['WITH_BF_STATICLLVM']: if lenv['WITH_BF_STATICLLVM']:
@@ -258,11 +248,6 @@ def setup_staticlibs(lenv):
libincs = [e for e in libincs if SCons.Subst.scons_subst(e, lenv, gvars=lenv.Dictionary()) != "/usr/lib"] libincs = [e for e in libincs if SCons.Subst.scons_subst(e, lenv, gvars=lenv.Dictionary()) != "/usr/lib"]
libincs.append('/usr/lib') libincs.append('/usr/lib')
# Hack to pass OSD libraries to linker before extern_{clew,cuew}
# Here we only store library path, actual library name will be added in setup_syslibs()
for syslib in create_blender_liblist(lenv, 'system'):
libincs.append(os.path.dirname(syslib))
return statlibs, libincs return statlibs, libincs
def setup_syslibs(lenv): def setup_syslibs(lenv):
@@ -293,16 +278,8 @@ def setup_syslibs(lenv):
if not lenv['WITH_BF_STATICOCIO']: if not lenv['WITH_BF_STATICOCIO']:
syslibs += Split(lenv['BF_OCIO_LIB']) syslibs += Split(lenv['BF_OCIO_LIB'])
if lenv['WITH_BF_HDF5']:
syslibs += Split(lenv['BF_HDF5_LIB'])
if lenv['WITH_BF_ALEMBIC']:
if not lenv['WITH_BF_STATICALEMBIC']:
syslibs += Split(lenv['BF_ALEMBIC_LIB'])
if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']: if lenv['WITH_BF_OPENEXR'] and not lenv['WITH_BF_STATICOPENEXR']:
syslibs += Split(lenv['BF_OPENEXR_LIB']) syslibs += Split(lenv['BF_OPENEXR_LIB'])
if lenv['WITH_BF_ZLIB'] and not lenv['WITH_BF_STATICZLIB']: if lenv['WITH_BF_ZLIB'] and not lenv['WITH_BF_STATICZLIB']:
syslibs += Split(lenv['BF_ZLIB_LIB']) syslibs += Split(lenv['BF_ZLIB_LIB'])
if lenv['WITH_BF_TIFF'] and not lenv['WITH_BF_STATICTIFF']: if lenv['WITH_BF_TIFF'] and not lenv['WITH_BF_STATICTIFF']:
@@ -321,7 +298,7 @@ def setup_syslibs(lenv):
if lenv['WITH_BF_ELTOPO']: if lenv['WITH_BF_ELTOPO']:
syslibs += Split(lenv['BF_LAPACK_LIB']) syslibs += Split(lenv['BF_LAPACK_LIB'])
''' '''
if lenv['WITH_BF_SDL'] and not lenv['WITH_BF_SDL_DYNLOAD']: if lenv['WITH_BF_SDL']:
syslibs += Split(lenv['BF_SDL_LIB']) syslibs += Split(lenv['BF_SDL_LIB'])
if not lenv['WITH_BF_STATICOPENGL']: if not lenv['WITH_BF_STATICOPENGL']:
syslibs += Split(lenv['BF_OPENGL_LIB']) syslibs += Split(lenv['BF_OPENGL_LIB'])
@@ -343,16 +320,16 @@ def setup_syslibs(lenv):
if lenv['WITH_BF_3DMOUSE']: if lenv['WITH_BF_3DMOUSE']:
if not lenv['WITH_BF_STATIC3DMOUSE']: if not lenv['WITH_BF_STATIC3DMOUSE']:
syslibs += Split(lenv['BF_3DMOUSE_LIB']) syslibs += Split(lenv['BF_3DMOUSE_LIB'])
if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
syslibs += Split(lenv['BF_BOOST_LIB'])
if lenv['WITH_BF_INTERNATIONAL']:
syslibs += Split(lenv['BF_BOOST_LIB_INTERNATIONAL'])
if lenv['WITH_BF_CYCLES_OSL'] and not lenv['WITH_BF_STATICOSL']: if lenv['WITH_BF_CYCLES_OSL'] and not lenv['WITH_BF_STATICOSL']:
syslibs += Split(lenv['BF_OSL_LIB']) syslibs += Split(lenv['BF_OSL_LIB'])
if lenv['WITH_BF_BOOST'] and not lenv['WITH_BF_STATICBOOST']:
syslibs += Split(lenv['BF_BOOST_LIB'])
if lenv['WITH_BF_INTERNATIONAL']:
syslibs += Split(lenv['BF_BOOST_LIB_INTERNATIONAL'])
if lenv['WITH_BF_LLVM'] and not lenv['WITH_BF_STATICLLVM']: if lenv['WITH_BF_LLVM'] and not lenv['WITH_BF_STATICLLVM']:
syslibs += Split(lenv['BF_LLVM_LIB']) syslibs += Split(lenv['BF_LLVM_LIB'])
@@ -362,10 +339,6 @@ def setup_syslibs(lenv):
if not lenv['WITH_BF_STATICPNG']: if not lenv['WITH_BF_STATICPNG']:
syslibs += Split(lenv['BF_PNG_LIB']) syslibs += Split(lenv['BF_PNG_LIB'])
# Hack to pass OSD libraries to linker before extern_{clew,cuew}
for syslib in create_blender_liblist(lenv, 'system'):
syslibs.append(os.path.basename(syslib))
syslibs += lenv['LLIBS'] syslibs += lenv['LLIBS']
return syslibs return syslibs
@@ -390,23 +363,7 @@ def propose_priorities():
def creator(env): def creator(env):
sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
incs = ['#/intern/guardedalloc', incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
'#/source/blender/blenlib',
'#/source/blender/blenkernel',
'#/source/blender/depsgraph',
'#/source/blender/editors/include',
'#/source/blender/blenloader',
'#/source/blender/imbuf',
'#/source/blender/renderconverter',
'#/source/blender/render/extern/include',
'#/source/blender/windowmanager',
'#/source/blender/makesdna',
'#/source/blender/makesrna',
'#/source/blender/pointcache',
'#/source/gameengine/BlenderRoutines',
'#/extern/glew/include',
'#/source/blender/gpu',
env['BF_OPENGL_INC']]
defs = [] defs = []
@@ -415,19 +372,12 @@ def creator(env):
defs.append('WITH_BINRELOC') defs.append('WITH_BINRELOC')
if env['WITH_BF_SDL']: if env['WITH_BF_SDL']:
if env['WITH_BF_SDL_DYNLOAD']:
defs.append('WITH_SDL_DYNLOAD')
incs.append('#/extern/sdlew/include')
defs.append('WITH_SDL') defs.append('WITH_SDL')
if env['WITH_BF_LIBMV']: if env['WITH_BF_LIBMV']:
incs.append('#/extern/libmv') incs.append('#/extern/libmv')
defs.append('WITH_LIBMV') defs.append('WITH_LIBMV')
if env['WITH_BF_CYCLES'] and env['WITH_BF_CYCLES_LOGGING']:
incs.append('#/intern/cycles/blender')
defs.append('WITH_CYCLES_LOGGING')
if env['WITH_BF_FFMPEG']: if env['WITH_BF_FFMPEG']:
defs.append('WITH_FFMPEG') defs.append('WITH_FFMPEG')
@@ -475,7 +425,7 @@ def buildinfo(lenv, build_type):
no_upstream = False no_upstream = False
try : try :
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}'], stderr=subprocess.STDOUT).strip() build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}']).strip()
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
# assume branch has no upstream configured # assume branch has no upstream configured
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', 'HEAD']).strip() build_hash = btools.get_command_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
@@ -664,7 +614,7 @@ def WinPyBundle(target=None, source=None, env=None):
py_tar+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '.tar.gz' py_tar+= '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '.tar.gz'
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#") py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
py_target = os.path.join(py_target, VERSION, 'python') py_target = os.path.join(py_target, VERSION, 'python', 'lib')
def printexception(func,path,ex): def printexception(func,path,ex):
if os.path.exists(path): #do not report if path does not exist. eg on a fresh build. if os.path.exists(path): #do not report if path does not exist. eg on a fresh build.
print str(func) + ' failed on ' + str(path) print str(func) + ' failed on ' + str(path)
@@ -688,7 +638,7 @@ def WinPyBundle(target=None, source=None, env=None):
# Extract Numpy # Extract Numpy
if env['WITH_BF_PYTHON_INSTALL_NUMPY']: if env['WITH_BF_PYTHON_INSTALL_NUMPY']:
py_tar = env.subst(env['LCGDIR']).lstrip("#") py_tar = env.subst(env['LCGDIR']).lstrip("#")
py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.9.tar.gz' py_tar += '/release/python' + env['BF_PYTHON_VERSION'].replace('.','') + '_numpy_1.8.tar.gz'
py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#") py_target = env.subst(env['BF_INSTALLDIR']).lstrip("#")
py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages') py_target = os.path.join(py_target, VERSION, 'python', 'lib', 'site-packages')
@@ -704,8 +654,6 @@ def WinPyBundle(target=None, source=None, env=None):
py_dir += '/release/site-packages' py_dir += '/release/site-packages'
# grr, we have to do one by one because the dir exists # grr, we have to do one by one because the dir exists
for f in os.listdir(py_dir): for f in os.listdir(py_dir):
if f == '.svn':
continue
fn_src = os.path.join(py_dir, f) fn_src = os.path.join(py_dir, f)
fn_dst = os.path.join(py_target, f) fn_dst = os.path.join(py_target, f)
@@ -754,37 +702,37 @@ def AppIt(target=None, source=None, env=None):
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,installdir, binary, binary) cmd = 'cp %s/%s %s/%s.app/Contents/MacOS/%s'%(builddir, binary,installdir, binary, binary)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'mkdir %s/%s.app/Contents/Resources/%s/'%(installdir, binary, VERSION) cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/'%(installdir, binary, VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION) cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION)
# blenderplayer doesn't need all the files # blenderplayer doesn't need all the files
if binary == 'blender': if binary == 'blender':
cmd = 'mkdir %s/%s.app/Contents/Resources/%s/datafiles'%(installdir, binary, VERSION) cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/datafiles'%(installdir, binary, VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/release/datafiles/fonts %s/%s.app/Contents/Resources/%s/datafiles/'%(bldroot,installdir,binary,VERSION) cmd = 'cp -R %s/release/datafiles/fonts %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
mo_dir = os.path.join(builddir[:-4], "locale") mo_dir = os.path.join(builddir[:-4], "locale")
for f in os.listdir(mo_dir): for f in os.listdir(mo_dir):
cmd = 'ditto %s/%s %s/%s.app/Contents/Resources/%s/datafiles/locale/%s/LC_MESSAGES/blender.mo'%(mo_dir, f, installdir, binary, VERSION, f[:-3]) cmd = 'ditto %s/%s %s/%s.app/Contents/MacOS/%s/datafiles/locale/%s/LC_MESSAGES/blender.mo'%(mo_dir, f, installdir, binary, VERSION, f[:-3])
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp %s/release/datafiles/locale/languages %s/%s.app/Contents/Resources/%s/datafiles/locale/'%(bldroot, installdir, binary, VERSION) cmd = 'cp %s/release/datafiles/locale/languages %s/%s.app/Contents/MacOS/%s/datafiles/locale/'%(bldroot, installdir, binary, VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
if env['WITH_BF_OCIO']: if env['WITH_BF_OCIO']:
cmd = 'cp -R %s/release/datafiles/colormanagement %s/%s.app/Contents/Resources/%s/datafiles/'%(bldroot,installdir,binary,VERSION) cmd = 'cp -R %s/release/datafiles/colormanagement %s/%s.app/Contents/MacOS/%s/datafiles/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/Resources/%s/'%(bldroot,installdir,binary,VERSION) cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
if VERSION_RELEASE_CYCLE == "release": if VERSION_RELEASE_CYCLE == "release":
cmd = 'rm -rf %s/%s.app/Contents/Resources/%s/scripts/addons_contrib'%(installdir,binary,VERSION) cmd = 'rm -rf %s/%s.app/Contents/MacOS/%s/scripts/addons_contrib'%(installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
if env['WITH_BF_CYCLES']: if env['WITH_BF_CYCLES']:
croot = '%s/intern/cycles' % (bldroot) croot = '%s/intern/cycles' % (bldroot)
cinstalldir = '%s/%s.app/Contents/Resources/%s/scripts/addons/cycles' % (installdir,binary,VERSION) cinstalldir = '%s/%s.app/Contents/MacOS/%s/scripts/addons/cycles' % (installdir,binary,VERSION)
cmd = 'mkdir %s' % (cinstalldir) cmd = 'mkdir %s' % (cinstalldir)
commands.getoutput(cmd) commands.getoutput(cmd)
@@ -798,7 +746,7 @@ def AppIt(target=None, source=None, env=None):
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/kernel/*.h %s/kernel/*.cl %s/kernel/*.cu %s/kernel/' % (croot, croot, croot, cinstalldir) cmd = 'cp -R %s/kernel/*.h %s/kernel/*.cl %s/kernel/*.cu %s/kernel/' % (croot, croot, croot, cinstalldir)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_math_fast.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir) cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/../intern/cycles/kernel/*.cubin %s/lib/' % (builddir, cinstalldir) cmd = 'cp -R %s/../intern/cycles/kernel/*.cubin %s/lib/' % (builddir, cinstalldir)
commands.getoutput(cmd) commands.getoutput(cmd)
@@ -812,11 +760,11 @@ def AppIt(target=None, source=None, env=None):
commands.getoutput(cmd) commands.getoutput(cmd)
if env['WITH_OSX_STATICPYTHON']: if env['WITH_OSX_STATICPYTHON']:
cmd = 'mkdir %s/%s.app/Contents/Resources/%s/python/'%(installdir,binary, VERSION) cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/Resources/%s/python/'%(libdir,python_zip,installdir,binary,VERSION) cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp -R %s/release/site-packages/ %s/%s.app/Contents/Resources/%s/python/lib/python%s/site-packages/'%(libdir,installdir,binary,VERSION,env['BF_PYTHON_VERSION']) cmd = 'cp -R %s/release/site-packages/ %s/%s.app/Contents/MacOS/%s/python/lib/python%s/site-packages/'%(libdir,installdir,binary,VERSION,env['BF_PYTHON_VERSION'])
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary) cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
@@ -833,26 +781,28 @@ def AppIt(target=None, source=None, env=None):
if env['C_COMPILER_ID'] == 'gcc' and env['CCVERSION'] >= '4.6.1': # for correct errorhandling with gcc >= 4.6.1 we need the gcc.dylib and gomp.dylib to link, thus distribute in app-bundle if env['C_COMPILER_ID'] == 'gcc' and env['CCVERSION'] >= '4.6.1': # for correct errorhandling with gcc >= 4.6.1 we need the gcc.dylib and gomp.dylib to link, thus distribute in app-bundle
print "Bundling libgcc and libgomp" print "Bundling libgcc and libgomp"
instname = env['BF_CXX'] instname = env['BF_CXX']
cmd = 'ditto --arch %s %s/lib/libgcc_s.1.dylib %s/%s.app/Contents/Resources/lib/'%(osxarch, instname, installdir, binary) # copy libgcc cmd = 'ditto --arch %s %s/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/lib/'%(osxarch, instname, installdir, binary) # copy libgcc
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'install_name_tool -id @executable_path/../Resources/lib/libgcc_s.1.dylib %s/%s.app/Contents/Resources/lib/libgcc_s.1.dylib'%(installdir, binary) # change id of libgcc cmd = 'install_name_tool -id @executable_path/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/lib/libgcc_s.1.dylib'%(installdir, binary) # change id of libgcc
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'ditto --arch %s %s/lib/libgomp.1.dylib %s/%s.app/Contents/Resources/lib/'%(osxarch, instname, installdir, binary) # copy libgomp cmd = 'ditto --arch %s %s/lib/libgomp.1.dylib %s/%s.app/Contents/MacOS/lib/'%(osxarch, instname, installdir, binary) # copy libgomp
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'install_name_tool -id @executable_path/../Resources/lib/libgomp.1.dylib %s/%s.app/Contents/Resources/lib/libgomp.1.dylib'%(installdir, binary) # change id of libgomp cmd = 'install_name_tool -id @executable_path/lib/libgomp.1.dylib %s/%s.app/Contents/MacOS/lib/libgomp.1.dylib'%(installdir, binary) # change id of libgomp
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'install_name_tool -change %s/lib/libgcc_s.1.dylib @executable_path/../Resources/lib/libgcc_s.1.dylib %s/%s.app/Contents/Resources/lib/libgomp.1.dylib'%(instname, installdir, binary) # change ref to libgcc cmd = 'install_name_tool -change %s/lib/libgcc_s.1.dylib @executable_path/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/lib/libgomp.1.dylib'%(instname, installdir, binary) # change ref to libgcc
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'install_name_tool -change %s/lib/libgcc_s.1.dylib @executable_path/../Resources/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/%s'%(instname, installdir, binary, binary) # change ref to libgcc ( blender ) cmd = 'install_name_tool -change %s/lib/libgcc_s.1.dylib @executable_path/lib/libgcc_s.1.dylib %s/%s.app/Contents/MacOS/%s'%(instname, installdir, binary, binary) # change ref to libgcc ( blender )
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'install_name_tool -change %s/lib/libgomp.1.dylib @executable_path/../Resources/lib/libgomp.1.dylib %s/%s.app/Contents/MacOS/%s'%(instname, installdir, binary, binary) # change ref to libgomp ( blender ) cmd = 'install_name_tool -change %s/lib/libgomp.1.dylib @executable_path/lib/libgomp.1.dylib %s/%s.app/Contents/MacOS/%s'%(instname, installdir, binary, binary) # change ref to libgomp ( blender )
commands.getoutput(cmd) commands.getoutput(cmd)
if env['C_COMPILER_ID'] == 'clang' and env['CCVERSION'] >= '3.4': if env['C_COMPILER_ID'] == 'clang' and env['CCVERSION'] >= '3.4':
print "Bundling libiomp5" print "Bundling libiomp5"
instname = env['LCGDIR'][1:] # made libiomp5 part of blender libs instname = env['LCGDIR'][1:] # made libiomp5 part of blender libs
cmd = 'ditto --arch %s %s/openmp/lib/libiomp5.dylib %s/%s.app/Contents/Resources/lib/'%(osxarch, instname, installdir, binary) # copy libiomp5 cmd = 'ditto --arch %s %s/openmp/lib/libiomp5.dylib %s/%s.app/Contents/MacOS/lib/'%(osxarch, instname, installdir, binary) # copy libiomp5
commands.getoutput(cmd) commands.getoutput(cmd)
cmd = 'cp %s/openmp/LICENSE.txt %s/LICENSE-libiomp5.txt'%(instname, installdir) # copy libiomp5 license cmd = 'install_name_tool -id @loader_path/lib/libiomp5.dylib %s/%s.app/Contents/MacOS/lib/libiomp5.dylib'%(installdir, binary) # change id of libiomp5
commands.getoutput(cmd)
cmd = 'install_name_tool -change @loader_path/libiomp5.dylib @loader_path/lib/libiomp5.dylib %s/%s.app/Contents/MacOS/%s'%(installdir, binary, binary) # change ref to libiomp5 ( blender )
commands.getoutput(cmd) commands.getoutput(cmd)
# extract copy system python, be sure to update other build systems # extract copy system python, be sure to update other build systems
@@ -877,7 +827,6 @@ def UnixPyBundle(target=None, source=None, env=None):
py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] ) py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
py_target = env.subst( dir + '/python/' + target_lib + '/python'+env['BF_PYTHON_VERSION'] ) py_target = env.subst( dir + '/python/' + target_lib + '/python'+env['BF_PYTHON_VERSION'] )
py_target_bin = env.subst(dir + '/python/bin')
# This is a bit weak, but dont install if its been installed before, makes rebuilds quite slow. # This is a bit weak, but dont install if its been installed before, makes rebuilds quite slow.
if os.path.exists(py_target): if os.path.exists(py_target):
@@ -897,11 +846,6 @@ def UnixPyBundle(target=None, source=None, env=None):
except: except:
pass pass
# install the executable
run("rm -rf '%s'" % py_target_bin)
os.makedirs(py_target_bin)
run("cp '%s' '%s'" % (env.subst(env['BF_PYTHON_BINARY']), py_target_bin))
run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target))) run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
run("rm -rf '%s/distutils'" % py_target) run("rm -rf '%s/distutils'" % py_target)
run("rm -rf '%s/lib2to3'" % py_target) run("rm -rf '%s/lib2to3'" % py_target)

View File

@@ -108,7 +108,7 @@ def validate_arguments(args, bc):
opts_list = [ opts_list = [
'WITH_BF_FREESTYLE', 'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'WITH_BF_PYTHON_SECURITY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LIBPATH_ARCH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS', 'WITH_BF_FREESTYLE', 'WITH_BF_PYTHON', 'WITH_BF_PYTHON_SAFETY', 'WITH_BF_PYTHON_SECURITY', 'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LIBPATH_ARCH', 'WITH_BF_STATICPYTHON', 'WITH_OSX_STATICPYTHON', 'BF_PYTHON_LIB_STATIC', 'BF_PYTHON_DLL', 'BF_PYTHON_ABI_FLAGS',
'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC', 'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH', 'WITH_BF_SDL_DYNLOAD', 'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', 'WITH_BF_JACK_DYNLOAD', 'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', 'WITH_BF_JACK_DYNLOAD',
'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC', 'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'WITH_BF_STATICSNDFILE', 'BF_SNDFILE_LIB_STATIC',
'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH', 'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
@@ -136,9 +136,6 @@ def validate_arguments(args, bc):
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH', 'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH', 'WITH_BF_STATICFFTW3', 'BF_FFTW3_LIB_STATIC', 'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH', 'WITH_BF_STATICFFTW3', 'BF_FFTW3_LIB_STATIC',
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC', 'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
'WITH_BF_EGL', 'WITH_BF_GLEW_ES', 'BF_GLEW_INC', 'WITH_BF_GL_PROFILE_CORE', 'WITH_BF_GL_PROFILE_COMPAT', 'WITH_BF_GL_PROFILE_ES20',
'WITH_BF_GLEW_MX', 'WITH_BF_GL_EGL', 'WITH_BF_GL_ANGLE',
'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH', 'WITH_BF_COLLADA', 'BF_COLLADA', 'BF_COLLADA_INC', 'BF_COLLADA_LIB', 'BF_OPENCOLLADA', 'BF_OPENCOLLADA_INC', 'BF_OPENCOLLADA_LIB', 'BF_OPENCOLLADA_LIBPATH', 'BF_PCRE', 'BF_PCRE_LIB', 'BF_PCRE_LIBPATH', 'BF_EXPAT', 'BF_EXPAT_LIB', 'BF_EXPAT_LIBPATH',
'WITH_BF_STATICOPENCOLLADA', 'BF_OPENCOLLADA_LIB_STATIC', 'WITH_BF_STATICOPENCOLLADA', 'BF_OPENCOLLADA_LIB_STATIC',
'WITH_BF_PLAYER', 'WITH_BF_PLAYER',
@@ -174,23 +171,20 @@ def validate_arguments(args, bc):
'WITH_BF_CXX_GUARDEDALLOC', 'WITH_BF_CXX_GUARDEDALLOC',
'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC', 'WITH_BF_JEMALLOC', 'WITH_BF_STATICJEMALLOC', 'BF_JEMALLOC', 'BF_JEMALLOC_INC', 'BF_JEMALLOC_LIBPATH', 'BF_JEMALLOC_LIB', 'BF_JEMALLOC_LIB_STATIC',
'BUILDBOT_BRANCH', 'BUILDBOT_BRANCH',
'WITH_BF_IME',
'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC', 'WITH_BF_3DMOUSE', 'WITH_BF_STATIC3DMOUSE', 'BF_3DMOUSE', 'BF_3DMOUSE_INC', 'BF_3DMOUSE_LIB', 'BF_3DMOUSE_LIBPATH', 'BF_3DMOUSE_LIB_STATIC',
'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'BF_CYCLES_CUDA_ENV', 'WITH_BF_CYCLES', 'WITH_BF_CYCLES_CUDA_BINARIES', 'BF_CYCLES_CUDA_NVCC', 'BF_CYCLES_CUDA_NVCC', 'WITH_BF_CYCLES_CUDA_THREADED_COMPILE', 'BF_CYCLES_CUDA_ENV',
'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH', 'WITH_BF_OIIO', 'WITH_BF_STATICOIIO', 'BF_OIIO', 'BF_OIIO_INC', 'BF_OIIO_LIB', 'BF_OIIO_LIB_STATIC', 'BF_OIIO_LIBPATH',
'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH', 'WITH_BF_OCIO', 'WITH_BF_STATICOCIO', 'BF_OCIO', 'BF_OCIO_INC', 'BF_OCIO_LIB', 'BF_OCIO_LIB_STATIC', 'BF_OCIO_LIBPATH',
'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_INTERNATIONAL', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH', 'WITH_BF_BOOST', 'WITH_BF_STATICBOOST', 'BF_BOOST', 'BF_BOOST_INC', 'BF_BOOST_LIB', 'BF_BOOST_LIB_INTERNATIONAL', 'BF_BOOST_LIB_STATIC', 'BF_BOOST_LIBPATH',
'WITH_BF_LIBMV', 'WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS', 'WITH_BF_LIBMV',
'WITH_BF_CYCLES_OSL', 'WITH_BF_STATICOSL', 'BF_OSL', 'BF_OSL_INC', 'BF_OSL_LIB', 'BF_OSL_LIBPATH', 'BF_OSL_LIB_STATIC', 'BF_OSL_COMPILER', 'WITH_BF_CYCLES_OSL', 'WITH_BF_STATICOSL', 'BF_OSL', 'BF_OSL_INC', 'BF_OSL_LIB', 'BF_OSL_LIBPATH', 'BF_OSL_LIB_STATIC', 'BF_OSL_COMPILER',
'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS', 'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS'
'WITH_BF_ALEMBIC', 'BF_ALEMBIC', 'BF_ALEMBIC_INC', 'BF_ALEMBIC_LIB', 'BF_ALEMBIC_LIBPATH',
] ]
# Have options here that scons expects to be lists # Have options here that scons expects to be lists
opts_list_split = [ opts_list_split = [
'BF_PYTHON_LINKFLAGS', 'BF_PYTHON_LINKFLAGS',
'BF_OPENGL_LINKFLAGS', 'BF_OPENGL_LINKFLAGS',
'BF_GL_DEFINITIONS',
'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS',
'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS', 'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS',
'BGE_CXXFLAGS', 'BGE_CXXFLAGS',
@@ -198,9 +192,7 @@ def validate_arguments(args, bc):
'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS', 'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
'C_WARN', 'CC_WARN', 'CXX_WARN', 'C_WARN', 'CC_WARN', 'CXX_WARN',
'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID', 'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID',
'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET', 'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET'
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING',
'WITH_BF_CPP11', 'WITH_BF_LEGACY_DEPSGRAPH',
] ]
@@ -303,7 +295,6 @@ def read_opts(env, cfg, args):
('BF_SDL_INC', 'SDL include path', ''), ('BF_SDL_INC', 'SDL include path', ''),
('BF_SDL_LIB', 'SDL library', ''), ('BF_SDL_LIB', 'SDL library', ''),
('BF_SDL_LIBPATH', 'SDL library path', ''), ('BF_SDL_LIBPATH', 'SDL library path', ''),
(BoolVariable('WITH_BF_SDL_DYNLOAD', 'Enable runtime dynamic SDL libraries loading (works only on Linux)', False)),
(BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)), (BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)),
('BF_JACK', 'jack base path', ''), ('BF_JACK', 'jack base path', ''),
@@ -470,18 +461,6 @@ def read_opts(env, cfg, args):
('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''), ('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''), ('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
(BoolVariable('WITH_BF_GLEW_MX', '', False)),
(BoolVariable('WITH_BF_GLEW_ES', '', False)),
(BoolVariable('WITH_BF_GL_EGL', '', False)),
(BoolVariable('WITH_BF_GL_PROFILE_COMPAT', '', True)),
(BoolVariable('WITH_BF_GL_PROFILE_CORE', '', False)),
(BoolVariable('WITH_BF_GL_PROFILE_ES20', '', False)),
(BoolVariable('WITH_BF_GL_ANGLE', '', False)),
('BF_GL_DEFINITIONS', '', []),
('BF_GLEW_INC', '', ''),
) # end of opts.AddVariables()
localopts.AddVariables(
(BoolVariable('WITH_BF_COLLADA', 'Build COLLADA import/export module if true', False)), (BoolVariable('WITH_BF_COLLADA', 'Build COLLADA import/export module if true', False)),
(BoolVariable('WITH_BF_STATICOPENCOLLADA', 'Staticly link to OpenCollada', False)), (BoolVariable('WITH_BF_STATICOPENCOLLADA', 'Staticly link to OpenCollada', False)),
('BF_COLLADA', 'COLLADA base path', ''), ('BF_COLLADA', 'COLLADA base path', ''),
@@ -510,8 +489,6 @@ def read_opts(env, cfg, args):
(BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)), (BoolVariable('WITH_BF_PLAYER', 'Build blenderplayer if true', False)),
(BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)), (BoolVariable('WITH_BF_NOBLENDER', 'Do not build blender if true', False)),
(BoolVariable('WITH_BF_IME', 'Enable Input Method Editor (IME) for complex Asian character input', False)),
(BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)), (BoolVariable('WITH_BF_3DMOUSE', 'Build blender with support of 3D mouses', False)),
(BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)), (BoolVariable('WITH_BF_STATIC3DMOUSE', 'Staticly link to 3d mouse library', False)),
('BF_3DMOUSE', '3d mouse library base path', ''), ('BF_3DMOUSE', '3d mouse library base path', ''),
@@ -579,22 +556,8 @@ def read_opts(env, cfg, args):
(BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)), (BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)),
(BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)), (BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)),
(BoolVariable('WITH_BF_LIBMV_SCHUR_SPECIALIZATIONS', 'Enable fixed-size schur specializations', True)),
(BoolVariable('WITH_BF_COMPOSITOR', 'Enable the tile based nodal compositor', True)), (BoolVariable('WITH_BF_COMPOSITOR', 'Enable the tile based nodal compositor', True)),
(BoolVariable('WITH_BF_HDF5', 'Use HDF5 if true', False)),
('BF_HDF5', 'HDF5 base path', ''),
('BF_HDF5_LIB', 'HDF5 library', ''),
('BF_HDF5_LIBPATH', 'HDF5 library path', ''),
(BoolVariable('WITH_BF_ALEMBIC', 'Use Alembic if true', False)),
(BoolVariable('WITH_BF_STATICALEMBIC', 'Staticly link to Alembic', False)),
('BF_ALEMBIC', 'Alembic base path', ''),
('BF_ALEMBIC_INC', 'Alembic include path', ''),
('BF_ALEMBIC_LIB', 'Alembic library', ''),
('BF_ALEMBIC_LIB_STATIC', 'Alembic static libraries', ''),
('BF_ALEMBIC_LIBPATH', 'Alembic library path', ''),
) # end of opts.AddOptions() ) # end of opts.AddOptions()
localopts.AddVariables( localopts.AddVariables(
@@ -622,8 +585,6 @@ def read_opts(env, cfg, args):
('BF_CYCLES_CUDA_NVCC', 'CUDA nvcc compiler path', ''), ('BF_CYCLES_CUDA_NVCC', 'CUDA nvcc compiler path', ''),
('BF_CYCLES_CUDA_ENV', 'preset environement nvcc will execute in', ''), ('BF_CYCLES_CUDA_ENV', 'preset environement nvcc will execute in', ''),
('BF_CYCLES_CUDA_BINARIES_ARCH', 'CUDA architectures to compile binaries for', []), ('BF_CYCLES_CUDA_BINARIES_ARCH', 'CUDA architectures to compile binaries for', []),
(BoolVariable('WITH_BF_CYCLES_DEBUG', 'Build Cycles engine with extra debugging capabilities', False)),
(BoolVariable('WITH_BF_CYCLES_LOGGING', 'Build Cycles engine with logging support', True)),
(BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)), (BoolVariable('WITH_BF_OIIO', 'Build with OpenImageIO', False)),
(BoolVariable('WITH_BF_STATICOIIO', 'Statically link to OpenImageIO', False)), (BoolVariable('WITH_BF_STATICOIIO', 'Statically link to OpenImageIO', False)),
@@ -668,11 +629,7 @@ def read_opts(env, cfg, args):
('BF_LLVM_LIBPATH', 'LLVM library path', ''), ('BF_LLVM_LIBPATH', 'LLVM library path', ''),
('BF_LLVM_LIB_STATIC', 'LLVM static library', ''), ('BF_LLVM_LIB_STATIC', 'LLVM static library', ''),
('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', ''), ('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', '')
(BoolVariable('WITH_BF_CPP11', '"Build with C++11 standard enabled, for development use only!', False)),
(BoolVariable('WITH_BF_LEGACY_DEPSGRAPH', 'Build Blender with legacy dependency graph', True)),
) # end of opts.AddOptions() ) # end of opts.AddOptions()
return localopts return localopts
@@ -729,6 +686,9 @@ def buildslave(target=None, source=None, env=None):
else: else:
platform = env['OURPLATFORM'].split('-')[0] platform = env['OURPLATFORM'].split('-')[0]
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc') and env['MSVC_VERSION'] == '9.0':
platform = platform + '-vc9'
if platform == 'linux': if platform == 'linux':
import platform import platform

View File

@@ -1,72 +0,0 @@
#!/bin/sh
# This script can run from any location,
# output is created in the $CWD
BASE_DIR="$PWD"
blender_srcdir=$(dirname -- $0)/../..
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender.h" | awk '{print $3}')
if [ "$blender_version_cycle" = "release" ] ; then
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
else
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
SUBMODULE_EXCLUDE="^$" # dummy regex
fi
MANIFEST="blender-$VERSION-manifest.txt"
TARBALL="blender-$VERSION.tar.gz"
cd "$blender_srcdir"
# not so nice, but works
FILTER_FILES_PY=\
"import os, sys; "\
"[print(l[:-1]) for l in sys.stdin.readlines() "\
"if os.path.isfile(l[:-1]) "\
"if os.path.basename(l[:-1]) not in {"\
"'.gitignore', "\
"'.gitmodules', "\
"'.arcconfig', "\
"}"\
"]"
# Build master list
echo -n "Building manifest of files: \"$BASE_DIR/$MANIFEST\" ..."
git ls-files | python3 -c "$FILTER_FILES_PY" > $BASE_DIR/$MANIFEST
# Enumerate submodules
for lcv in $(git submodule | awk '{print $2}' | grep -v "$SUBMODULE_EXCLUDE"); do
cd "$BASE_DIR"
cd "$blender_srcdir/$lcv"
git ls-files | python3 -c "$FILTER_FILES_PY" | awk '$0="'"$lcv"/'"$0' >> $BASE_DIR/$MANIFEST
cd "$BASE_DIR"
done
echo "OK"
# Create the tarball
cd "$blender_srcdir"
echo -n "Creating archive: \"$BASE_DIR/$TARBALL\" ..."
GZIP=-9 tar --transform "s,^,blender-$VERSION/,g" -zcf "$BASE_DIR/$TARBALL" -T "$BASE_DIR/$MANIFEST"
echo "OK"
# Create checksum file
cd "$BASE_DIR"
echo -n "Createing checksum: \"$BASE_DIR/$TARBALL.md5sum\" ..."
md5sum "$TARBALL" > "$TARBALL.md5sum"
echo "OK"
# Cleanup
echo -n "Cleaning up ..."
rm "$BASE_DIR/$MANIFEST"
echo "OK"
echo "Done!"

View File

@@ -112,7 +112,7 @@ class DNACatalogHTML:
# ${version} and ${revision} # ${version} and ${revision}
if bpy: if bpy:
version = '.'.join(map(str, bpy.app.version)) version = '.'.join(map(str, bpy.app.version))
revision = bpy.app.build_hash revision = bpy.app.build_revision[:-1]
else: else:
version = str(header.Version) version = str(header.Version)
revision = 'Unknown' revision = 'Unknown'
@@ -404,7 +404,7 @@ def main():
# Files # Files
if '--dna-versioned' in sys.argv: if '--dna-versioned' in sys.argv:
blender_version = '_'.join(map(str, bpy.app.version)) blender_version = '_'.join(map(str, bpy.app.version))
filename = 'dna-{0}-{1}_endian-{2}-{3}'.format(sys.arch, sys.byteorder, blender_version, bpy.app.build_hash) filename = 'dna-{0}-{1}_endian-{2}-r{3}'.format(sys.arch, sys.byteorder, blender_version, bpy.app.build_revision[2:-1])
else: else:
filename = 'dna' filename = 'dna'
dir = os.path.dirname(__file__) dir = os.path.dirname(__file__)
@@ -451,7 +451,7 @@ def main():
os.remove(Path_Blend) os.remove(Path_Blend)
# export dna to xhtml # export dna to xhtml
log.info("6: export sdna to xhtml file: %r" % Path_HTML) log.info("6: export sdna to xhtml file")
handleHTML = open(Path_HTML, "w") handleHTML = open(Path_HTML, "w")
catalog.WriteToHTML(handleHTML) catalog.WriteToHTML(handleHTML)
handleHTML.close() handleHTML.close()

View File

@@ -35,14 +35,13 @@
defaults. defaults.
Much of the actual functionality can be found in the python scripts Much of the actual functionality can be found in the python scripts
in the directory $BLENDERHOME/build_files/scons/tools, with in the directory $BLENDERHOME/tools, with Blender.py defining the
Blender.py defining the bulk of the functionality. btools.py has some bulk of the functionality. btools.py has some helper functions, and
helper functions, and bcolors.py is for the terminal bcolors.py is for the terminal colors. mstoolkit.py and crossmingw.py
colors. mstoolkit.py and crossmingw.py are modules which set up SCons are modules which set up SCons for the MS VC++ 2003 toolkit and
for the MS VC++ 2003 toolkit and the cross-compile toolset for the cross-compile toolset for compiling Windows binaries on Linux
compiling Windows binaries on Linux respectively. Note: the respectively. Note: the cross-compile doesn't work yet for Blender,
cross-compile doesn't work yet for Blender, but is added in but is added in preparation for having it work in the distant future.
preparation for having it work in the distant future.
BlenderEnvironment BlenderEnvironment
------------------ ------------------

View File

@@ -29,9 +29,9 @@
a scons-local installation, which can be found in the scons/ subdirectory. a scons-local installation, which can be found in the scons/ subdirectory.
This document uses the scons-local installation for its examples. This document uses the scons-local installation for its examples.
For build instructions, including dependencies, consult the appropriate Check from the page
section for your platform at http://www.blender.org/development/building-blender/getting-dependencies/
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender. Note that for that you have all dependencies needed for building Blender. Note that for
windows many of these dependencies already come in the lib/windows module windows many of these dependencies already come in the lib/windows module
from CVS. from CVS.
@@ -53,13 +53,12 @@
from the command-line is given, then all libraries and binaries to from the command-line is given, then all libraries and binaries to
build are configured. build are configured.
The build uses BF_BUILDDIR to build into and BF_INSTALLDIR to finally copy The build uses BF_BUILDDIR to build into and BF_INSTALLDIR to
all needed files to get a proper setup. The BF_DOCDIR is used to generate finally copy all needed files to get a proper setup. The BF_DOCDIR is
Blender Python documentation files to. These variables have default values used to generate Blender Python documentation files to. These
for every platform in variables have default values for every platform in
$BLENDERHOME/build_files/scons/config/(platform)-config.py. See the next $BLENDERHOME/config/(platform)-config.py. After the build successfully
section of this document for how to customize these paths. After the build completes, you can find everything you need in BF_INSTALLDIR.
successfully completes, you can find everything you need in BF_INSTALLDIR.
If you want to create the installer package of Blender on Windows you'll If you want to create the installer package of Blender on Windows you'll
need to install nullsoft scriptable install system from http://nsis.sf.net. need to install nullsoft scriptable install system from http://nsis.sf.net.
@@ -73,8 +72,8 @@
--------------------- ---------------------
The default values for your platform can be found in the directory The default values for your platform can be found in the directory
$BLENDERHOME/build_files/scons/config. Your platform specific defaults are $BLENDERHOME/config. Your platform specific defaults are in
in (platform)-config.py, where platform is one of: (platform)-config.py, where platform is one of:
- linux, for machines running Linux - linux, for machines running Linux
- win32-vc, for Windows machines, compiling with a Microsoft compiler - win32-vc, for Windows machines, compiling with a Microsoft compiler
@@ -82,13 +81,12 @@
- darwin, for OS X machines - darwin, for OS X machines
(TBD: add cygwin, solaris and freebsd support) (TBD: add cygwin, solaris and freebsd support)
These files you will normally not change. If you need to override a These files you will normally not change. If you need to override
default value, make a file called $BLENDERHOME/user-config.py, and copy a default value, make a file called $BLENDERHOME/user-config.py, and copy
settings from the build_files/scons/config/(platform)-config.py that you settings from the config/(platform)-config.py that you want to change. Don't
want to change. Don't copy the entire file (unless explicitly stated in copy the entire file (unless explicitely stated in the configuration file),
the configuration file), because you may not get updated options you don't because you may not get updated options you don't change yourself, which may
change yourself, which may result in build errors. You should NEVER have result in build errors.
to modify $BLENDERHOME/build_files/scons/config/(platform)-config.py.
You can use BF_CONFIG argument to override the default user-config.py You can use BF_CONFIG argument to override the default user-config.py
check. This is just like the user-config.py, but just with another name: check. This is just like the user-config.py, but just with another name:
@@ -115,6 +113,11 @@
(unless you have overridden any of them in your (unless you have overridden any of them in your
$BLENDERHOME/user-config.py). $BLENDERHOME/user-config.py).
NOTE: The best way to avoid confusion is the
copy $BLENDERHOME/config/(platform)-config.py to
$BLENDERHOME/user-config.py. You should NEVER have to modify
$BLENDERHOME/config/(platform)-config.py
Configuring the output Configuring the output
---------------------- ----------------------

File diff suppressed because it is too large Load Diff

View File

@@ -10,14 +10,26 @@
* \ingroup intern * \ingroup intern
*/ */
/** \defgroup boolop boolop
* \ingroup intern
*/
/** \defgroup ctr container /** \defgroup ctr container
* \ingroup intern * \ingroup intern
*/ */
/** \defgroup decimation decimation
* \ingroup intern
*/
/** \defgroup elbeem elbeem /** \defgroup elbeem elbeem
* \ingroup intern * \ingroup intern
*/ */
/** \defgroup bsp bsp
* \ingroup intern
*/
/** \defgroup iksolver iksolver /** \defgroup iksolver iksolver
* \ingroup intern * \ingroup intern
*/ */

View File

@@ -7,7 +7,7 @@
* These pages document the source code of blender. * These pages document the source code of blender.
* *
* \subsection implinks Important Links * \subsection implinks Important Links
* - <a href="http://developer.blender.org">developer.blender.org</a> with bug tracker * - <a href="http://projects.blender.org">projects.blender.org</a> with <a href="http://projects.blender.org/tracker/index.php?group_id=9&atid=498">bug tracker</a>
* - <a href="http://wiki.blender.org/index.php/Dev:Contents">Development documents</a> on our wiki. * - <a href="http://wiki.blender.org/index.php/Dev:Contents">Development documents</a> on our wiki.
* *
* \subsection blother Other * \subsection blother Other

View File

@@ -93,44 +93,36 @@
/* ================================ */ /* ================================ */
/** \defgroup blender Blender */ /** \defgroup blender blender */
/** \defgroup blf BlenFont /** \defgroup blf blenfont
* \ingroup blender * \ingroup blender
*/ */
/** \defgroup bke BlenKernel /** \defgroup bke blenkernel
* \ingroup blender * \ingroup blender
*/ */
/** \defgroup bli BlenLib /** \defgroup bli blenlib
* \ingroup blender * \ingroup blender
*/ */
/** \defgroup depsgraph Dependency Graph /** \defgroup nodes nodes
* \ingroup blender * \ingroup blender
*/ */
/** \defgroup bph Physics /** \defgroup cmpnodes cmpnodes
* \ingroup blender
*/
/** \defgroup nodes Nodes
* \ingroup blender
*/
/** \defgroup cmpnodes Nodes (Compositor)
* \ingroup nodes * \ingroup nodes
*/ */
/** \defgroup shdnodes Nodes (Shader) /** \defgroup shdnodes shdnodes
* \ingroup nodes * \ingroup nodes
*/ */
/** \defgroup texnodes Nodes (Texture) /** \defgroup texnodes texnodes
* \ingroup nodes * \ingroup nodes
*/ */
/** \defgroup modifiers Object Modifiers /** \defgroup modifiers modifiers
* \ingroup blender * \ingroup blender
*/ */
@@ -140,29 +132,29 @@
* \ingroup blender * \ingroup blender
*/ */
/** \defgroup ikplugin IK Plugin /** \defgroup ikplugin ikplugin
* \ingroup blender * \ingroup blender
*/ */
/** \defgroup DNA Struct DNA (File Format) /** \defgroup DNA sDNA
* \ingroup blender data * \ingroup blender data
*/ */
/** \defgroup RNA RNA (Data API) /** \defgroup RNA RNA
* \ingroup blender data * \ingroup blender data
*/ */
/** \defgroup blenloader Blend file IO /** \defgroup blenloader .blend read and write functions
* \ingroup blender data * \ingroup blender data
* \todo check if \ref blo and \ref blenloader groups can be * \todo check if \ref blo and \ref blenloader groups can be
* merged in docs. * merged in docs.
*/ */
/** \defgroup quicktime QuickTime /** \defgroup quicktime quicktime
* \ingroup blender * \ingroup blender
/** \defgroup gui GUI */ /** \defgroup gui GUI */
/** \defgroup wm Window Manager /** \defgroup wm windowmanager
* \ingroup blender gui * \ingroup blender gui
*/ */
@@ -332,7 +324,7 @@
* \ingroup externformats * \ingroup externformats
*/ */
/** \defgroup imbuf Image Buffer (ImBuf) /** \defgroup imbuf IMage Buffer
* \ingroup blender * \ingroup blender
*/ */

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/python
# ##### BEGIN GPL LICENSE BLOCK ##### # ##### BEGIN GPL LICENSE BLOCK #####
# #
@@ -31,6 +31,7 @@ and <output-filename> is where to write the generated man page.
# <pep8 compliant> # <pep8 compliant>
import subprocess import subprocess
import os
import sys import sys
import time import time

View File

@@ -20,15 +20,15 @@ constraint_type = 2
physics_id_1 = object_1.getPhysicsId() physics_id_1 = object_1.getPhysicsId()
physics_id_2 = object_2.getPhysicsId() physics_id_2 = object_2.getPhysicsId()
# use bottom right edge of Object1 for hinge position # Use bottom right edge of Object1 for hinge position
edge_position_x = 1.0 edge_position_x = 1.0
edge_position_y = 0.0 edge_position_y = 0.0
edge_position_z = -1.0 edge_position_z = -1.0
# rotate the pivot z axis about 90 degrees # use Object1 y axis for angle to point hinge
edge_angle_x = 0.0 edge_angle_x = 0.0
edge_angle_y = 0.0 edge_angle_y = 1.0
edge_angle_z = 90.0 edge_angle_z = 0.0
# create an edge constraint # create an edge constraint
constraints.createConstraint(physics_id_1, physics_id_2, constraints.createConstraint(physics_id_1, physics_id_2,

View File

@@ -1,19 +1,16 @@
""" """
.. _operator-execution_context:
Execution Context Execution Context
----------------- -----------------
When calling an operator you may want to pass the execution context. When calling an operator you may want to pass the execution context.
This determines the context that is given for the operator to run in, and whether This determines the context thats given to the operator to run in, and weather
invoke() is called or only execute(). invoke() is called or execute().
'EXEC_DEFAULT' is used by default, running only the execute() method, but you may 'EXEC_DEFAULT' is used by default but you may want the operator to take user
want the operator to take user interaction with 'INVOKE_DEFAULT' which will also interaction with 'INVOKE_DEFAULT'.
call invoke() if existing.
The execution context is one of: The execution context is as a non keyword, string argument in:
('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS', ('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT', 'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA', 'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',

View File

@@ -3,7 +3,7 @@ PropertyGroup Example
+++++++++++++++++++++ +++++++++++++++++++++
PropertyGroups can be used for collecting custom settings into one value PropertyGroups can be used for collecting custom settings into one value
to avoid many individual settings mixed in together. to avoid many indervidual settings mixed in together.
""" """
import bpy import bpy

View File

@@ -75,7 +75,7 @@ print(scene.test_float)
scene.test_array = (True, False) scene.test_array = (True, False)
print([x for x in scene.test_array]) print([x for x in scene.test_array])
# scene.test_date = "blah" # this would fail, property is read-only #scene.test_date = "blah" # this would fail, property is read-only
print(scene.test_date) print(scene.test_date)
scene.test_enum = 'BLUE' scene.test_enum = 'BLUE'

View File

@@ -6,7 +6,7 @@ Custom properties can be added to any subclass of an :class:`ID`,
:class:`Bone` and :class:`PoseBone`. :class:`Bone` and :class:`PoseBone`.
These properties can be animated, accessed by the user interface and python These properties can be animated, accessed by the user interface and python
like Blender's existing properties. like blenders existing properties.
""" """
import bpy import bpy

View File

@@ -1,11 +1,12 @@
""" """
Extending Menus Extending Menus
+++++++++++++++ +++++++++++++++
When creating menus for addons you can't reference menus in Blender's default When creating menus for addons you can't reference menus in blenders default
scripts. scripts.
Instead, the addon can add menu items to existing menus.
The function menu_draw acts like :class:`Menu.draw`. Instead the addon can add menu items to existing menus.
The function menu_draw acts like Menu.draw
""" """
import bpy import bpy

View File

@@ -1,20 +1,21 @@
""" """
Basic Menu Example Basic Menu Example
++++++++++++++++++ ++++++++++++++++++
Here is an example of a simple menu. Menus differ from panels in that they must This script is a simple menu, menus differ from panels in that they must
reference from a header, panel or another menu. reference from a header, panel or another menu.
Notice the 'CATEGORY_MT_name' in :class:`Menu.bl_idname`, this is a naming Notice the 'CATEGORY_MT_name' :class:`Menu.bl_idname`, this is a naming
convention for menus. convention for menus.
.. note:: .. note::
Menu subclasses must be registered before referencing them from blender. Menu subclasses must be registered before referencing them from blender.
.. note:: .. note::
Menus have their :class:`Layout.operator_context` initialized as Menu's have their :class:`Layout.operator_context` initialized as
'EXEC_REGION_WIN' rather than 'INVOKE_DEFAULT' (see :ref:`Execution Context <operator-execution_context>`). 'EXEC_REGION_WIN' rather then 'INVOKE_DEFAULT', so if the operator context
If the operator context needs to initialize inputs from the needs to initialize inputs from the :class:`Operator.invoke` function
:class:`Operator.invoke` function, then this needs to be explicitly set. then this needs to be explicitly set.
""" """
import bpy import bpy

View File

@@ -39,7 +39,7 @@ class ModalOperator(bpy.types.Operator):
self.execute(context) self.execute(context)
elif event.type == 'LEFTMOUSE': # Confirm elif event.type == 'LEFTMOUSE': # Confirm
return {'FINISHED'} return {'FINISHED'}
elif event.type in {'RIGHTMOUSE', 'ESC'}: # Cancel elif event.type in ('RIGHTMOUSE', 'ESC'): # Cancel
context.object.location.x = self.init_loc_x context.object.location.x = self.init_loc_x
return {'CANCELLED'} return {'CANCELLED'}

View File

@@ -7,7 +7,7 @@ A mix-in parent class can be used to share common properties and
import bpy import bpy
class View3DPanel: class View3DPanel():
bl_space_type = 'VIEW_3D' bl_space_type = 'VIEW_3D'
bl_region_type = 'TOOLS' bl_region_type = 'TOOLS'

View File

@@ -8,3 +8,4 @@ collection.foreach_get(attr, some_seq)
# Python equivalent # Python equivalent
for i in range(len(seq)): for i in range(len(seq)):
some_seq[i] = getattr(collection[i], attr) some_seq[i] = getattr(collection[i], attr)

View File

@@ -21,12 +21,3 @@ print(quat_out)
print("%.2f, %.2f, %.2f" % tuple(math.degrees(a) for a in quat_out.to_euler())) print("%.2f, %.2f, %.2f" % tuple(math.degrees(a) for a in quat_out.to_euler()))
print("(%.2f, %.2f, %.2f), %.2f" % (quat_out.axis[:] + print("(%.2f, %.2f, %.2f), %.2f" % (quat_out.axis[:] +
(math.degrees(quat_out.angle), ))) (math.degrees(quat_out.angle), )))
# multiple rotations can be interpolated using the exponential map
quat_c = mathutils.Quaternion((1.0, 0.0, 0.0), math.radians(15.0))
exp_avg = (quat_a.to_exponential_map() +
quat_b.to_exponential_map() +
quat_c.to_exponential_map()) / 3.0
quat_avg = mathutils.Quaternion(exp_avg)
print("Average rotation:")
print(quat_avg)

View File

@@ -18,16 +18,16 @@ matrix = mathutils.Matrix()
# Comparison operators can be done on Vector classes: # Comparison operators can be done on Vector classes:
# (In)equality operators == and != test component values, e.g. 1,2,3 != 3,2,1 # greater and less then test vector length.
vec_a == vec_b
vec_a != vec_b
# Ordering operators >, >=, > and <= test vector length.
vec_a > vec_b vec_a > vec_b
vec_a >= vec_b vec_a >= vec_b
vec_a < vec_b vec_a < vec_b
vec_a <= vec_b vec_a <= vec_b
# ==, != test vector values e.g. 1,2,3 != 3,2,1 even if they are the same length
vec_a == vec_b
vec_a != vec_b
# Math can be performed on Vector classes # Math can be performed on Vector classes
vec_a + vec_b vec_a + vec_b

View File

@@ -11,54 +11,50 @@ Physics Constraints (bge.constraints)
.. literalinclude:: ../examples/bge.constraints.py .. literalinclude:: ../examples/bge.constraints.py
:lines: 6- :lines: 6-
.. function:: createConstraint(physicsid_1, physicsid_2, constraint_type, pivot_X, pivot_y, pivot_z, axis_x, axis_y, axis_z, flag) .. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag]]]])
Creates a constraint. Creates a constraint.
Constraints types: :arg physicsid: the physics id of the first object in constraint
- :class:`POINTTOPOINT_CONSTRAINT` :type physicsid: int
- :class:`LINEHINGE_CONSTRAINT`
- :class:`ANGULAR_CONSTRAINT`
- :class:`CONETWIST_CONSTRAINT`
- :class:`VEHICLE_CONSTRAINT`
- :class:`GENERIC_6DOF_CONSTRAINT`
:arg physicsid_1: the physics id of the first object in constraint. :arg physicsid2: the physics id of the second object in constraint
:type physicsid_1: int :type physicsid2: int
:arg physicsid_2: the physics id of the second object in constraint. :arg constrainttype: the type of the constraint. The constraint types are:
:type physicsid_2: int
- :class:`POINTTOPOINT_CONSTRAINT`
- :class:`LINEHINGE_CONSTRAINT`
- :class:`ANGULAR_CONSTRAINT`
- :class:`CONETWIST_CONSTRAINT`
- :class:`VEHICLE_CONSTRAINT`
:arg constrainttype: the type of the constraint.
:type constrainttype: int :type constrainttype: int
:arg pivot_X: pivot X position (optional). :arg pivotX: pivot X position
:type pivot_X: float :type pivotX: float
:arg pivot_Y: pivot Y position (optional). :arg pivotY: pivot Y position
:type pivot_Y: float :type pivotY: float
:arg pivot_Z: pivot Z position (optional). :arg pivotZ: pivot Z position
:type pivot_Z: float :type pivotZ: float
:arg axis_X: X axis angle in degrees (optional). :arg axisX: X axis
:type axis_X: float :type axisX: float
:arg axis_Y: Y axis angle in degrees (optional). :arg axisY: Y axis
:type axis_Y: float :type axisY: float
:arg axis_Z: Z axis angle in degrees (optional). :arg axisZ: Z axis
:type axis_Z: float :type axisZ: float
:arg flag: 128 to disable collision between linked bodies (optional). :arg flag: .. to do
:type flag: int :type flag: int
:return: a constraint wrapper.
:rtype: :class:`bge.types.KX_ConstraintWrapper`
.. attribute:: error .. attribute:: error
Symbolic constant string that indicates error. Simbolic constant string that indicates error.
.. function:: exportBulletFile(filename) .. function:: exportBulletFile(filename)
@@ -372,10 +368,3 @@ Physics Constraints (bge.constraints)
Constraint type to be used with function :class:`createConstraint` Constraint type to be used with function :class:`createConstraint`
.. to do .. to do
.. data:: GENERIC_6DOF_CONSTRAINT
.. note::
Constraint type to be used with function :class:`createConstraint`
.. to do

View File

@@ -868,23 +868,6 @@ See :class:`bge.types.KX_SteeringActuator.behavior`
:value: 3 :value: 3
.. _logic-trackto-actuator:
-----------------
TrackTo Actuator
-----------------
See :class:`bge.types.KX_TrackToActuator`
.. data:: KX_TRACK_UPAXIS_POS_X
.. data:: KX_TRACK_UPAXIS_POS_Y
.. data:: KX_TRACK_UPAXIS_POS_Z
.. data:: KX_TRACK_TRAXIS_POS_X
.. data:: KX_TRACK_TRAXIS_POS_Y
.. data:: KX_TRACK_TRAXIS_POS_Z
.. data:: KX_TRACK_TRAXIS_NEG_X
.. data:: KX_TRACK_TRAXIS_NEG_Y
.. data:: KX_TRACK_TRAXIS_NEG_Z
======= =======
Various Various

View File

@@ -8,13 +8,9 @@ Intro
.. module:: bge.render .. module:: bge.render
Example of using a :class:`bge.types.SCA_MouseSensor`, and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook:
.. note::
This can also be achieved with the :class:`bge.types.KX_MouseActuator`.
.. code-block:: python .. code-block:: python
# Example Uses an L{SCA_MouseSensor}, and two L{KX_ObjectActuator}s to implement MouseLook::
# To use a mouse movement sensor "Mouse" and a # To use a mouse movement sensor "Mouse" and a
# motion actuator to mouse look: # motion actuator to mouse look:
import bge import bge
@@ -66,7 +62,7 @@ Constants
.. data:: KX_BLENDER_GLSL_MATERIAL .. data:: KX_BLENDER_GLSL_MATERIAL
Materials approximating blender materials with GLSL. Materials approximating blender materials with GLSL.
.. DATA:: VSYNC_OFF .. DATA:: VSYNC_OFF
Disables vsync Disables vsync
@@ -79,15 +75,6 @@ Constants
Enables adaptive vsync if supported. Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. Otherwise, vsync is diabled if the framerate is too low. Enables adaptive vsync if supported. Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. Otherwise, vsync is diabled if the framerate is too low.
.. data:: LEFT_EYE
Left eye being used during stereoscopic rendering.
.. data:: RIGHT_EYE
Right eye being used during stereoscopic rendering.
********* *********
Functions Functions
********* *********
@@ -95,55 +82,47 @@ Functions
.. function:: getWindowWidth() .. function:: getWindowWidth()
Gets the width of the window (in pixels) Gets the width of the window (in pixels)
:rtype: integer :rtype: integer
.. function:: getWindowHeight() .. function:: getWindowHeight()
Gets the height of the window (in pixels) Gets the height of the window (in pixels)
:rtype: integer :rtype: integer
.. function:: setWindowSize(width, height) .. function:: setWindowSize(width, height)
Set the width and height of the window (in pixels). This also works for fullscreen applications. Set the width and height of the window (in pixels). This also works for fullscreen applications.
:type width: integer :type width: integer
:type height: integer :type height: integer
.. function:: setFullScreen(enable) .. function:: setFullScreen(enable)
Set whether or not the window should be fullscreen. Set whether or not the window should be fullscreen.
:type enable: bool :type enable: bool
.. function:: getFullScreen() .. function:: getFullScreen()
Returns whether or not the window is fullscreen. Returns whether or not the window is fullscreen.
:rtype: bool
.. function:: getDisplayDimensions()
Get the actual display dimensions, in pixels, of the physical display (e.g., the monitor).
:type dimension: list [width,heigh] :rtype: bool
.. function:: makeScreenshot(filename) .. function:: makeScreenshot(filename)
Writes an image file with the current displayed frame. Writes a screenshot to the given filename.
The image is written to *'filename'*. The path may be absolute (eg. "/home/foo/image") or relative when started with If filename starts with // the image will be saved relative to the current directory.
"//" (eg. "//image"). Note that absolute paths are not portable between platforms. If the filename contains # it will be replaced with the frame number.
If the filename contains a "#", it will be replaced by an incremental index so that screenshots can be taken multiple
times without overwriting the previous ones (eg. "image-#"). The standalone player saves .png files. It does not support color space conversion
or gamma correction.
Settings for the image are taken from the render settings (file format and respective settings, gamma and colospace
conversion, etc). The image resolution matches the framebuffer, meaning, the window size and aspect ratio. When run from Blender, makeScreenshot supports all Blender image file formats like PNG, TGA, Jpeg and OpenEXR.
When running from the standalone player, instead of the embedded player, only PNG files are supported. Additional Gamma, Colorspace conversion and Jpeg compression are taken from the Render settings panels.
color conversions are also not supported.
:arg filename: path and name of the file to write
:type filename: string :type filename: string
@@ -155,29 +134,65 @@ Functions
.. function:: showMouse(visible) .. function:: showMouse(visible)
Enables or disables the operating system mouse cursor. Enables or disables the operating system mouse cursor.
:type visible: boolean :type visible: boolean
.. function:: setMousePosition(x, y) .. function:: setMousePosition(x, y)
Sets the mouse cursor position. Sets the mouse cursor position.
:type x: integer :type x: integer
:type y: integer :type y: integer
.. function:: setBackgroundColor(rgba) .. function:: setBackgroundColor(rgba)
Sets the window background color. (Deprecated: use KX_WorldInfo.background_color) Sets the window background color.
:type rgba: list [r, g, b, a] :type rgba: list [r, g, b, a]
.. function:: setMistColor(rgb)
Sets the mist color.
:type rgb: list [r, g, b]
.. function:: setAmbientColor(rgb)
Sets the color of ambient light.
:type rgb: list [r, g, b]
.. function:: setMistStart(start)
Sets the mist start value. Objects further away than start will have mist applied to them.
:type start: float
.. function:: setMistEnd(end)
Sets the mist end value. Objects further away from this will be colored solid with
the color set by setMistColor().
:type end: float
.. function:: disableMist()
Disables mist.
.. note:: Set any of the mist properties to enable mist.
.. function:: setEyeSeparation(eyesep) .. function:: setEyeSeparation(eyesep)
Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value. Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
:arg eyesep: The distance between the left and right eye. :arg eyesep: The distance between the left and right eye.
:type eyesep: float :type eyesep: float
@@ -185,36 +200,27 @@ Functions
.. function:: getEyeSeparation() .. function:: getEyeSeparation()
Gets the current eye separation for stereo mode. Gets the current eye separation for stereo mode.
:rtype: float :rtype: float
.. function:: setFocalLength(focallength) .. function:: setFocalLength(focallength)
Sets the focal length for stereo mode. It uses the current camera focal length as initial value. Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
:arg focallength: The focal length. :arg focallength: The focal length.
:type focallength: float :type focallength: float
.. function:: getFocalLength() .. function:: getFocalLength()
Gets the current focal length for stereo mode. Gets the current focal length for stereo mode.
:rtype: float :rtype: float
.. function:: getStereoEye()
Gets the current stereoscopy eye being rendered.
This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` callback
function to customize the camera projection matrices for each
stereoscopic eye.
:rtype: LEFT_EYE, RIGHT_EYE
.. function:: setMaterialMode(mode) .. function:: setMaterialMode(mode)
Set the material mode to use for OpenGL rendering. Set the material mode to use for OpenGL rendering.
:type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL :type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. note:: Changes will only affect newly created scenes. .. note:: Changes will only affect newly created scenes.
@@ -223,14 +229,14 @@ Functions
.. function:: getMaterialMode(mode) .. function:: getMaterialMode(mode)
Get the material mode to use for OpenGL rendering. Get the material mode to use for OpenGL rendering.
:rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL :rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. function:: setGLSLMaterialSetting(setting, enable) .. function:: setGLSLMaterialSetting(setting, enable)
Enables or disables a GLSL material setting. Enables or disables a GLSL material setting.
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures) :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:type enable: boolean :type enable: boolean
@@ -238,43 +244,43 @@ Functions
.. function:: getGLSLMaterialSetting(setting, enable) .. function:: getGLSLMaterialSetting(setting, enable)
Get the state of a GLSL material setting. Get the state of a GLSL material setting.
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures) :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:rtype: boolean :rtype: boolean
.. function:: setAnisotropicFiltering(level) .. function:: setAnisotropicFiltering(level)
Set the anisotropic filtering level for textures. Set the anisotropic filtering level for textures.
:arg level: The new anisotropic filtering level to use :arg level: The new anisotropic filtering level to use
:type level: integer (must be one of 1, 2, 4, 8, 16) :type level: integer (must be one of 1, 2, 4, 8, 16)
.. note:: Changing this value can cause all textures to be recreated, which can be slow. .. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getAnisotropicFiltering() .. function:: getAnisotropicFiltering()
Get the anisotropic filtering level used for textures. Get the anisotropic filtering level used for textures.
:rtype: integer (one of 1, 2, 4, 8, 16) :rtype: integer (one of 1, 2, 4, 8, 16)
.. function:: setMipmapping(value) .. function:: setMipmapping(value)
Change how to use mipmapping. Change how to use mipmapping.
:type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR :type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. note:: Changing this value can cause all textures to be recreated, which can be slow. .. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getMipmapping() .. function:: getMipmapping()
Get the current mipmapping setting. Get the current mipmapping setting.
:rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR :rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. function:: drawLine(fromVec,toVec,color) .. function:: drawLine(fromVec,toVec,color)
Draw a line in the 3D scene. Draw a line in the 3D scene.
:arg fromVec: the origin of the line :arg fromVec: the origin of the line
:type fromVec: list [x, y, z] :type fromVec: list [x, y, z]
:arg toVec: the end of the line :arg toVec: the end of the line
@@ -286,7 +292,7 @@ Functions
.. function:: enableMotionBlur(factor) .. function:: enableMotionBlur(factor)
Enable the motion blur effect. Enable the motion blur effect.
:arg factor: the ammount of motion blur to display. :arg factor: the ammount of motion blur to display.
:type factor: float [0.0 - 1.0] :type factor: float [0.0 - 1.0]

View File

@@ -37,7 +37,7 @@ base class --- :class:`PyObjectPlus`
The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character. The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character.
:type: Vector((x, y, z)) :type: list [x, y, z]
.. method:: jump() .. method:: jump()

View File

@@ -11,132 +11,8 @@ base class --- :class:`PyObjectPlus`
.. method:: getConstraintId(val) .. method:: getConstraintId(val)
Returns the contraint ID Returns the contraint's ID
:return: the constraint ID :return: the constraint's ID
:rtype: integer :rtype: integer
.. method:: setParam(axis, value0, value1)
Set the contraint limits
:arg axis:
:type axis: integer
.. note::
* Lowerlimit == Upperlimit -> axis is locked
* Lowerlimit > Upperlimit -> axis is free
* Lowerlimit < Upperlimit -> axis it limited in that range
For PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:
axis = 3 is a constraint limit, with low/high limit value
* 3: X axis angle
:arg value0 (min): Set the minimum limit of the axis
:type value0: float
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
For PHY_CONE_TWIST_CONSTRAINT = 4:
axis = 3..5 are constraint limits, high limit values
* 3: X axis angle
* 4: Y axis angle
* 5: Z axis angle
:arg value0 (min): Set the minimum limit of the axis
:type value0: float
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
For PHY_GENERIC_6DOF_CONSTRAINT = 12:
axis = 0..2 are constraint limits, with low/high limit value
* 0: X axis position
* 1: Y axis position
* 2: Z axis position
axis = 3..5 are relative constraint (Euler) angles in radians
* 3: X axis angle
* 4: Y axis angle
* 5: Z axis angle
:arg value0 (min): Set the minimum limit of the axis
:type value0: float
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
axis = 6..8 are translational motors, with value0=target velocity, value1 = max motor force
* 6: X axis position
* 7: Y axis position
* 8: Z axis position
axis = 9..11 are rotational motors, with value0=target velocity, value1 = max motor force
* 9: X axis angle
* 10: Y axis angle
* 11: Z axis angle
:arg value0 (speed): Set the linear velocity of the axis
:type value0: float Range: -10,000.00 to 10,000.00
:arg value1 (force): Set the maximum force limit of the axis
:type value1: float Range: -10,000.00 to 10,000.00
axis = 12..14 are for linear springs on each of the position of freedom
* 12: X axis position
* 13: Y axis position
* 14: Z axis position
axis = 15..17 are for angular springs on each of the angle of freedom in radians
* 15: X axis angle
* 16: Y axis angle
* 17: Z axis angle
:arg value0 (stiffness): Set the stiffness of the spring
:type value0: float
:arg value1 (damping): Tendency of the spring to return to it's original position
:type value1: float
1.0 = springs back to original position (no damping)
0.0 = don't springs back
.. method:: getParam(axis)
Get the contraint position or euler angle of a generic 6DOF constraint
:arg axis:
:type axis: integer
axis = 0..2 are linear constraint values
* 0: X axis position
* 1: Y axis position
* 2: Z axis position
:return: position
:rtype: float
axis = 3..5 are relative constraint (Euler) angles in radians
* 3: X axis angle
* 4: Y axis angle
* 5: Z axis angle
:return: angle
:rtype: float
.. attribute:: constraint_id
Returns the contraint ID (read only)
:type: integer
.. attribute:: constraint_type
Returns the contraint type (read only)
:type: integer
- 1 = :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
- 2 = :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
- 3 = :class:`~bge.constraints.ANGULAR_CONSTRAINT`
- 4 = :class:`~bge.constraints.CONETWIST_CONSTRAINT`
- 11 = :class:`~bge.constraints.VEHICLE_CONSTRAINT`
- 12 = :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`

View File

@@ -7,26 +7,6 @@ base class --- :class:`KX_GameObject`
.. class:: KX_FontObject(KX_GameObject) .. class:: KX_FontObject(KX_GameObject)
A Font object. TODO.
.. code-block:: python
# Display a message about the exit key using a Font object.
import bge
co = bge.logic.getCurrentController()
font = co.owner
exit_key = bge.events.EventToString(bge.logic.getExitKey())
if exit_key.endswith("KEY"):
exit_key = exit_key[:-3]
font.text = "Press key '%s' to quit the game." % exit_key
.. attribute:: text
The text displayed by this Font object.
:type: string

View File

@@ -78,35 +78,6 @@ base class --- :class:`SCA_IObject`
The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0. The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
.. attribute:: isSuspendDynamics
The object's dynamic state (read-only).
:type: boolean
.. seealso:: :py:meth:`suspendDynamics` and :py:meth:`restoreDynamics` allow you to change the state.
.. attribute:: linearDamping
The object's linear damping, also known as translational damping. Can be set simultaneously with angular damping using the :py:meth:`setDamping` method.
:type: float between 0 and 1 inclusive.
.. note::
The object must have a physics controller for the linear damping to be applied, otherwise the value will be returned as 0.0.
.. attribute:: angularDamping
The object's angular damping, also known as rotationation damping. Can be set simultaneously with linear damping using the :py:meth:`setDamping` method.
:type: float between 0 and 1 inclusive.
.. note::
The object must have a physics controller for the angular damping to be applied, otherwise the value will be returned as 0.0.
.. attribute:: linVelocityMin .. attribute:: linVelocityMin
Enforces the object keeps moving at a minimum velocity. Enforces the object keeps moving at a minimum velocity.
@@ -143,7 +114,7 @@ base class --- :class:`SCA_IObject`
the object's inertia vector in local coordinates. Read only. the object's inertia vector in local coordinates. Read only.
:type: Vector((ix, iy, iz)) :type: list [ix, iy, iz]
.. attribute:: parent .. attribute:: parent
@@ -153,70 +124,21 @@ base class --- :class:`SCA_IObject`
.. attribute:: groupMembers .. attribute:: groupMembers
Returns the list of group members if the object is a group object (dupli group instance), otherwise None is returned. Returns the list of group members if the object is a group object, otherwise None is returned.
:type: :class:`CListValue` of :class:`KX_GameObject` or None :type: :class:`CListValue` of :class:`KX_GameObject` or None
.. attribute:: groupObject .. attribute:: groupObject
Returns the group object (dupli group instance) that the object belongs to or None if the object is not part of a group. Returns the group object that the object belongs to or None if the object is not part of a group.
:type: :class:`KX_GameObject` or None :type: :class:`KX_GameObject` or None
.. attribute:: collisionGroup
The object's collision group.
:type: bitfield
.. attribute:: collisionMask
The object's collision mask.
:type: bitfield
.. attribute:: collisionCallbacks .. attribute:: collisionCallbacks
A list of functions to be called when a collision occurs. A list of callables to be run when a collision occurs.
:type: list of functions and/or methods :type: list
Callbacks should either accept one argument `(object)`, or three
arguments `(object, point, normal)`. For simplicity, per
colliding object only the first collision point is reported.
.. code-block:: python
# Function form
def callback_three(object, point, normal):
print('Hit by %r at %s with normal %s' % (object.name, point, normal))
def callback_one(object):
print('Hit by %r' % object.name)
def register_callback(controller):
controller.owner.collisionCallbacks.append(callback_three)
controller.owner.collisionCallbacks.append(callback_one)
# Method form
class YourGameEntity(bge.types.KX_GameObject):
def __init__(self, old_owner):
self.collisionCallbacks.append(self.on_collision_three)
self.collisionCallbacks.append(self.on_collision_one)
def on_collision_three(self, object, point, normal):
print('Hit by %r at %s with normal %s' % (object.name, point, normal))
def on_collision_one(self, object):
print('Hit by %r' % object.name)
.. note::
For backward compatibility, a callback with variable number of
arguments (using `*args`) will be passed only the `object`
argument. Only when there is more than one fixed argument (not
counting `self` for methods) will the three-argument form be
used.
.. attribute:: scene .. attribute:: scene
@@ -452,12 +374,6 @@ base class --- :class:`SCA_IObject`
If true, the object's and children's debug properties will be displayed on screen. If true, the object's and children's debug properties will be displayed on screen.
:type: boolean :type: boolean
.. attribute:: currentLodLevel
The index of the level of detail (LOD) currently used by this object (read-only).
:type: int
.. method:: endObject() .. method:: endObject()
@@ -580,7 +496,7 @@ base class --- :class:`SCA_IObject`
* True: you get the "local" velocity ie: relative to object orientation. * True: you get the "local" velocity ie: relative to object orientation.
:type local: boolean :type local: boolean
:return: the object's linear velocity. :return: the object's linear velocity.
:rtype: Vector((vx, vy, vz)) :rtype: list [vx, vy, vz]
.. method:: setLinearVelocity(velocity, local=False) .. method:: setLinearVelocity(velocity, local=False)
@@ -607,7 +523,7 @@ base class --- :class:`SCA_IObject`
* True: you get the "local" velocity ie: relative to object orientation. * True: you get the "local" velocity ie: relative to object orientation.
:type local: boolean :type local: boolean
:return: the object's angular velocity. :return: the object's angular velocity.
:rtype: Vector((vx, vy, vz)) :rtype: list [vx, vy, vz]
.. method:: setAngularVelocity(velocity, local=False) .. method:: setAngularVelocity(velocity, local=False)
@@ -631,7 +547,7 @@ base class --- :class:`SCA_IObject`
:arg point: optional point to return the velocity for, in local coordinates. :arg point: optional point to return the velocity for, in local coordinates.
:type point: 3D Vector :type point: 3D Vector
:return: the velocity at the specified point. :return: the velocity at the specified point.
:rtype: Vector((vx, vy, vz)) :rtype: list [vx, vy, vz]
.. method:: getReactionForce() .. method:: getReactionForce()
@@ -641,7 +557,7 @@ base class --- :class:`SCA_IObject`
This also includes impulses, eg from collisions. This also includes impulses, eg from collisions.
:return: the reaction force of this object. :return: the reaction force of this object.
:rtype: Vector((fx, fy, fz)) :rtype: list [fx, fy, fz]
.. note:: .. note::
@@ -664,28 +580,13 @@ base class --- :class:`SCA_IObject`
* True: you get the "local" impulse ie: relative to local coordinates with object orientation. * True: you get the "local" impulse ie: relative to local coordinates with object orientation.
:type local: boolean :type local: boolean
.. method:: setDamping(linear_damping, angular_damping) .. method:: suspendDynamics()
Sets both the :py:attr:`linearDamping` and :py:attr:`angularDamping` simultaneously. This is more efficient than setting both properties individually.
:arg linear_damping: Linear ("translational") damping factor.
:type linear_damping: float ∈ [0, 1]
:arg angular_damping: Angular ("rotational") damping factor.
:type angular_damping: float ∈ [0, 1]
.. method:: suspendDynamics([ghost])
Suspends physics for this object. Suspends physics for this object.
:arg ghost: When set to `True`, collisions with the object will be ignored, similar to the "ghost" checkbox in
Blender. When `False` (the default), the object becomes static but still collide with other objects.
:type ghost: bool
.. seealso:: :py:attr:`isSuspendDynamics` allows you to inspect whether the object is in a suspended state.
.. method:: restoreDynamics() .. method:: restoreDynamics()
Resumes physics for this object. Also reinstates collisions; the object will no longer be a ghost. Resumes physics for this object.
.. note:: .. note::
@@ -975,4 +876,4 @@ base class --- :class:`SCA_IObject`
:arg name: name of the property that added to the debug list. :arg name: name of the property that added to the debug list.
:type name: string :type name: string
:arg debug: the debug state. :arg debug: the debug state.
:type debug: boolean :type debug: boolean

View File

@@ -64,20 +64,3 @@ base class --- :class:`SCA_MouseSensor`
:type: boolean :type: boolean
.. attribute:: useXRay
If enabled it allows the sensor to see through game objects that don't have the selected property or material.
:type: boolean
.. attribute:: propName
The property or material the sensor is looking for.
:type: string
.. attribute:: useMaterial
Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property.
:type: boolean

View File

@@ -15,7 +15,7 @@ base class --- :class:`SCA_IActuator`
The force applied by the actuator. The force applied by the actuator.
:type: Vector((x, y, z)) :type: list [x, y, z]
.. attribute:: useLocalForce .. attribute:: useLocalForce
@@ -27,7 +27,7 @@ base class --- :class:`SCA_IActuator`
The torque applied by the actuator. The torque applied by the actuator.
:type: Vector((x, y, z)) :type: list [x, y, z]
.. attribute:: useLocalTorque .. attribute:: useLocalTorque
@@ -39,7 +39,7 @@ base class --- :class:`SCA_IActuator`
The displacement vector applied by the actuator. The displacement vector applied by the actuator.
:type: Vector((x, y, z)) :type: list [x, y, z]
.. attribute:: useLocalDLoc .. attribute:: useLocalDLoc
@@ -51,7 +51,7 @@ base class --- :class:`SCA_IActuator`
The angular displacement vector applied by the actuator The angular displacement vector applied by the actuator
:type: Vector((x, y, z)) :type: list [x, y, z]
.. note:: .. note::
@@ -67,7 +67,7 @@ base class --- :class:`SCA_IActuator`
The linear velocity applied by the actuator. The linear velocity applied by the actuator.
:type: Vector((x, y, z)) :type: list [x, y, z]
.. attribute:: useLocalLinV .. attribute:: useLocalLinV
@@ -83,7 +83,7 @@ base class --- :class:`SCA_IActuator`
The angular velocity applied by the actuator. The angular velocity applied by the actuator.
:type: Vector((x, y, z)) :type: list [x, y, z]
.. attribute:: useLocalAngV .. attribute:: useLocalAngV

View File

@@ -83,12 +83,6 @@ base class --- :class:`PyObjectPlus`
This can be set directly from python to avoid using the :class:`KX_SceneActuator`. This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
.. attribute:: world
The current active world, (read-only).
:type: :class:`KX_WorldInfo`
.. attribute:: suspended .. attribute:: suspended
True if the scene is suspended, (read-only). True if the scene is suspended, (read-only).
@@ -125,27 +119,21 @@ base class --- :class:`PyObjectPlus`
:type: list :type: list
.. attribute:: pre_draw_setup
A list of callables to be run before the drawing setup (i.e., before the model view and projection matrices are computed).
:type: list
.. attribute:: gravity .. attribute:: gravity
The scene gravity using the world x, y and z axis. The scene gravity using the world x, y and z axis.
:type: Vector((gx, gy, gz)) :type: list [fx, fy, fz]
.. method:: addObject(object, reference, time=0) .. method:: addObject(object, other, time=0)
Adds an object to the scene like the Add Object Actuator would. Adds an object to the scene like the Add Object Actuator would.
:arg object: The (name of the) object to add. :arg object: The object to add
:type object: :class:`KX_GameObject` or string :type object: :class:`KX_GameObject` or string
:arg reference: The (name of the) object which position, orientation, and scale to copy (optional), if the object to add is a light and there is not reference the light's layer will be the same that the active layer in the blender scene. :arg other: The object's center to use when adding the object
:type reference: :class:`KX_GameObject` or string :type other: :class:`KX_GameObject` or string
:arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever (optional). :arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
:type time: integer :type time: integer
:return: The newly added object. :return: The newly added object.
:rtype: :class:`KX_GameObject` :rtype: :class:`KX_GameObject`
@@ -164,8 +152,6 @@ base class --- :class:`PyObjectPlus`
:arg scene: The name of the scene to replace this scene with. :arg scene: The name of the scene to replace this scene with.
:type scene: string :type scene: string
:return: True if the scene exists and was scheduled for addition, False otherwise.
:rtype: boolean
.. method:: suspend() .. method:: suspend()

View File

@@ -37,25 +37,3 @@ base class --- :class:`SCA_IActuator`
:type: boolean :type: boolean
.. attribute:: upAxis
The axis that points upward.
:type: integer from 0 to 2
* KX_TRACK_UPAXIS_POS_X
* KX_TRACK_UPAXIS_POS_Y
* KX_TRACK_UPAXIS_POS_Z
.. attribute:: trackAxis
The axis that points to the target object.
:type: integer from 0 to 5
* KX_TRACK_TRAXIS_POS_X
* KX_TRACK_TRAXIS_POS_Y
* KX_TRACK_TRAXIS_POS_Z
* KX_TRACK_TRAXIS_NEG_X
* KX_TRACK_TRAXIS_NEG_Y
* KX_TRACK_TRAXIS_NEG_Z

View File

@@ -11,25 +11,22 @@ base class --- :class:`PyObjectPlus`
TODO - description TODO - description
.. method:: addWheel(wheel, attachPos, downDir, axleDir, suspensionRestLength, wheelRadius, hasSteering) .. method:: addWheel(wheel, attachPos, attachDir, axleDir, suspensionRestLength, wheelRadius, hasSteering)
Add a wheel to the vehicle Add a wheel to the vehicle
:arg wheel: The object to use as a wheel. :arg wheel: The object to use as a wheel.
:type wheel: :class:`KX_GameObject` or a :class:`KX_GameObject` name :type wheel: :class:`KX_GameObject` or a KX_GameObject name
:arg attachPos: The position to attach the wheel, relative to the chassis object center. :arg attachPos: The position that this wheel will attach to.
:type attachPos: vector of 3 floats :type attachPos: vector of 3 floats
:arg downDir: The direction vector pointing down to where the vehicle should collide with the floor. :arg attachDir: The direction this wheel points.
:type downDir: vector of 3 floats :type attachDir: vector of 3 floats
:arg axleDir: The axis the wheel rotates around, relative to the chassis. :arg axleDir: The direction of this wheels axle.
:type axleDir: vector of 3 floats :type axleDir: vector of 3 floats
:arg suspensionRestLength: The length of the suspension when no forces are being applied. :arg suspensionRestLength: TODO - Description
:type suspensionRestLength: float :type suspensionRestLength: float
:arg wheelRadius: The radius of the wheel (half the diameter). :arg wheelRadius: The size of the wheel.
:type wheelRadius: float :type wheelRadius: float
:arg hasSteering: True if the wheel should turn with steering, typically used in front wheels.
:type hasSteering: boolean
.. method:: applyBraking(force, wheelIndex) .. method:: applyBraking(force, wheelIndex)
@@ -41,7 +38,6 @@ base class --- :class:`PyObjectPlus`
:arg wheelIndex: index of the wheel where the force needs to be applied :arg wheelIndex: index of the wheel where the force needs to be applied
:type wheelIndex: integer :type wheelIndex: integer
.. method:: applyEngineForce(force, wheelIndex) .. method:: applyEngineForce(force, wheelIndex)
Apply an engine force to the specified wheel Apply an engine force to the specified wheel
@@ -52,7 +48,6 @@ base class --- :class:`PyObjectPlus`
:arg wheelIndex: index of the wheel where the force needs to be applied :arg wheelIndex: index of the wheel where the force needs to be applied
:type wheelIndex: integer :type wheelIndex: integer
.. method:: getConstraintId() .. method:: getConstraintId()
Get the constraint ID Get the constraint ID

View File

@@ -17,25 +17,25 @@ base class --- :class:`SCA_IObject`
The position of the vertex. The position of the vertex.
:type: Vector((x, y, z)) :type: list [x, y, z]
.. attribute:: UV .. attribute:: UV
The texture coordinates of the vertex. The texture coordinates of the vertex.
:type: Vector((u, v)) :type: list [u, v]
.. attribute:: normal .. attribute:: normal
The normal of the vertex. The normal of the vertex.
:type: Vector((nx, ny, nz)) :type: list [nx, ny, nz]
.. attribute:: color .. attribute:: color
The color of the vertex. The color of the vertex.
:type: Vector((r, g, b, a)) :type: list [r, g, b, a]
Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0] Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0]
@@ -110,13 +110,13 @@ base class --- :class:`SCA_IObject`
Gets the position of this vertex. Gets the position of this vertex.
:return: this vertexes position in local coordinates. :return: this vertexes position in local coordinates.
:rtype: Vector((x, y, z)) :rtype: list [x, y, z]
.. method:: setXYZ(pos) .. method:: setXYZ(pos)
Sets the position of this vertex. Sets the position of this vertex.
:type: Vector((x, y, z)) :type: list [x, y, z]
:arg pos: the new position for this vertex in local coordinates. :arg pos: the new position for this vertex in local coordinates.
@@ -125,26 +125,26 @@ base class --- :class:`SCA_IObject`
Gets the UV (texture) coordinates of this vertex. Gets the UV (texture) coordinates of this vertex.
:return: this vertexes UV (texture) coordinates. :return: this vertexes UV (texture) coordinates.
:rtype: Vector((u, v)) :rtype: list [u, v]
.. method:: setUV(uv) .. method:: setUV(uv)
Sets the UV (texture) coordinates of this vertex. Sets the UV (texture) coordinates of this vertex.
:type: Vector((u, v)) :type: list [u, v]
.. method:: getUV2() .. method:: getUV2()
Gets the 2nd UV (texture) coordinates of this vertex. Gets the 2nd UV (texture) coordinates of this vertex.
:return: this vertexes UV (texture) coordinates. :return: this vertexes UV (texture) coordinates.
:rtype: Vector((u, v)) :rtype: list [u, v]
.. method:: setUV2(uv, unit) .. method:: setUV2(uv, unit)
Sets the 2nd UV (texture) coordinates of this vertex. Sets the 2nd UV (texture) coordinates of this vertex.
:type: Vector((u, v)) :type: list [u, v]
:arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV :arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
:arg unit: integer :arg unit: integer
@@ -197,7 +197,7 @@ base class --- :class:`SCA_IObject`
Gets the normal vector of this vertex. Gets the normal vector of this vertex.
:return: normalized normal vector. :return: normalized normal vector.
:rtype: Vector((nx, ny, nz)) :rtype: list [nx, ny, nz]
.. method:: setNormal(normal) .. method:: setNormal(normal)

View File

@@ -1,79 +0,0 @@
KX_WordlInfo(PyObjectPlus)
=============================
.. module:: bge.types
base class --- :class:`PyObjectPlus`
.. class:: KX_WorldInfo(PyObjectPlus)
A wolrd object.
.. code-block:: python
# Set the mist color to red.
import bge
sce = bge.logic.getCurrentScene()
sce.world.mistColor = [1.0, 0.0, 0.0]
.. data:: KX_MIST_QUADRATIC
Type of quadratic attenuation used to fade mist.
.. data:: KX_MIST_LINEAR
Type of linear attenuation used to fade mist.
.. data:: KX_MIST_INV_QUADRATIC
Type of inverse quadratic attenuation used to fade mist.
.. attribute:: mistEnable
Return the state of the mist.
:type: bool
.. attribute:: mistStart
The mist start point.
:type: float
.. attribute:: mistDistance
The mist distance fom the start point to reach 100% mist.
:type: float
.. attribute:: mistIntensity
The mist intensity.
:type: float
.. attribute:: mistType
The type of mist - must be KX_MIST_QUADRATIC, KX_MIST_LINEAR or KX_MIST_INV_QUADRATIC
.. attribute:: mistColor
The color of the mist. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
Mist and background color sould always set to the same color.
:type: :class:`mathutils.Vector`
.. attribute:: backgroundColor
The color of the background. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
Mist and background color sould always set to the same color.
:type: :class:`mathutils.Vector`
.. attribute:: ambientColor
The color of the ambient light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
:type: :class:`mathutils.Vector`

View File

@@ -23,14 +23,8 @@ base class --- :class:`SCA_ILogicBrick`
.. attribute:: frequency .. attribute:: frequency
The frequency for pulse mode sensors. (Deprecated: use SCA_ISensor.skippedTicks) The frequency for pulse mode sensors.
:type: integer
.. attribute:: skippedTicks
Number of logic ticks skipped between 2 active pulses
:type: integer :type: integer
.. attribute:: level .. attribute:: level

View File

@@ -25,7 +25,7 @@ base class --- :class:`PyObjectPlus`
The normalized x and y position of the mouse cursor. The normalized x and y position of the mouse cursor.
:type: tuple (x, y) :type: list [x, y]
.. attribute:: visible .. attribute:: visible

View File

@@ -8,17 +8,19 @@ This module wraps OpenGL constants and functions, making them available from
within Blender Python. within Blender Python.
The complete list can be retrieved from the module itself, by listing its The complete list can be retrieved from the module itself, by listing its
contents: dir(bgl). A simple search on the web can point to more contents: dir(bgl). A simple search on the net can point to more
than enough material to teach OpenGL programming, from books to many than enough material to teach OpenGL programming, from books to many
collections of tutorials. collections of tutorials.
Here is a comprehensive `list of books <http://www.opengl.org/documentation/books/>`_ (non free). The `arcsynthesis tutorials <http://www.arcsynthesis.org/gltut/>`_ is one of the best resources to learn modern OpenGL and `g-truc <http://www.g-truc.net/post-tech-content-sample.html>`_ offers a set of extensive examples, including advanced features. The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
OpenGL}" and the online NeHe tutorials are two of the best resources.
.. note:: .. note::
You can use the :class:`Image` type to load and set textures. You can use the :class:`Image` type to load and set textures.
See :class:`Image.gl_load` and :class:`Image.gl_load`, See :class:`Image.gl_load` and :class:`Image.gl_load`,
for example. for example.
`OpenGL.org <http://www.opengl.org>`_
`NeHe GameDev <http://nehe.gamedev.net>`_
.. function:: glAccum(op, value): .. function:: glAccum(op, value):

View File

@@ -86,15 +86,9 @@ Consider the calculations that might go into working out the object's final tran
To avoid expensive recalculations every time a property is modified, Blender defers making the actual calculations until they are needed. To avoid expensive recalculations every time a property is modified, Blender defers making the actual calculations until they are needed.
However, while the script runs you may want to access the updated values. However, while the script runs you may want to access the updated values.
In this case you need to call :class:`bpy.types.Scene.update` after modifying values, for example:
.. code-block:: python This can be done by calling :class:`bpy.types.Scene.update` after modifying values which recalculates all data that is tagged to be updated.
bpy.context.object.location = 1, 2, 3
bpy.context.scene.update()
Now all dependent data (child objects, modifiers, drivers... etc) has been recalculated and is available to the script.
Can I redraw during the script? Can I redraw during the script?
------------------------------- -------------------------------
@@ -414,19 +408,17 @@ These returns the absolute path which can be used with native python modules.
Unicode Problems Unicode Problems
================ ================
Python supports many different encodings so there is nothing stopping you from Python supports many different encodings so there is nothing stopping you from writing a script in latin1 or iso-8859-15.
writing a script in ``latin1`` or ``iso-8859-15``.
See `pep-0263 <http://www.python.org/dev/peps/pep-0263/>`_ See `pep-0263 <http://www.python.org/dev/peps/pep-0263/>`_
However this complicates matters for Blender's Python API because ``.blend`` files don't have an explicit encoding. However this complicates things for the python api because blend files themselves don't have an encoding.
To avoid the problem for Python integration and script authors we have decided all strings in blend files To simplify the problem for python integration and script authors we have decided all strings in blend files **must** be UTF-8 or ASCII compatible.
**must** be ``UTF-8``, ``ASCII`` compatible.
This means assigning strings with different encodings to an object names for instance will raise an error. This means assigning strings with different encodings to an object names for instance will raise an error.
Paths are an exception to this rule since we cannot ignore the existence of non ``UTF-8`` paths on users file-system. Paths are an exception to this rule since we cannot ignore the existane of non-utf-8 paths on peoples filesystems.
This means seemingly harmless expressions can raise errors, eg. This means seemingly harmless expressions can raise errors, eg.

View File

@@ -11,22 +11,32 @@ This API is generally stable but some areas are still being added and improved.
The Blender/Python API can do the following: The Blender/Python API can do the following:
- Edit any data the user interface can (Scenes, Meshes, Particles etc.) * Edit any data the user interface can (Scenes, Meshes, Particles etc.)
- Modify user preferences, keymaps and themes
- Run tools with own settings * Modify user preferences, keymaps and themes
- Create user interface elements such as menus, headers and panels
- Create new tools * Run tools with own settings
- Create interactive tools
- Create new rendering engines that integrate with Blender * Create user interface elements such as menus, headers and panels
- Define new settings in existing Blender data
- Draw in the 3D view using OpenGL commands from Python * Create new tools
* Create interactive tools
* Create new rendering engines that integrate with Blender
* Define new settings in existing Blender data
* Draw in the 3D view using OpenGL commands from Python
The Blender/Python API **can't** (yet)... The Blender/Python API **can't** (yet)...
- Create new space types. * Create new space types.
- Assign custom properties to every type.
- Define callbacks or listeners to be notified when data is changed. * Assign custom properties to every type.
* Define callbacks or listeners to be notified when data is changed.
Before Starting Before Starting
@@ -37,21 +47,23 @@ This document isn't intended to fully cover each topic. Rather, its purpose is t
A quick list of helpful things to know before starting: A quick list of helpful things to know before starting:
- Blender uses Python 3.x; some online documentation still assumes 2.x. * Blender uses Python 3.x; some 3rd party extensions are not available yet.
- The interactive console is great for testing one-liners, It also has autocompletion so you can inspect the API quickly.
- Button tool tips show Python attributes and operator names.
- Right clicking on buttons and menu items directly links to API documentation.
- For more examples, the text menu has a templates section where some example operators can be found.
- To examine further scripts distributed with Blender, see:
| ``~/.blender/scripts/startup/bl_ui`` for the user interface, * The interactive console is great for testing one-liners, It also has autocompleation so you can inspect the api quickly.
| ``~/.blender/scripts/startup/bl_op`` for operators.
* Button tool tips show Python attributes and operator names.
* Right clicking on buttons and menu items directly links to API documentation.
* For more examples, the text menu has a templates section where some example operators can be found.
* To examine further scripts distributed with Blender, see ``~/.blender/scripts/startup/bl_ui`` for the user interface and ``~/.blender/scripts/startup/bl_op`` for operators.
Running Scripts Running Scripts
--------------- ---------------
The two most common ways to execute Python scripts are using the built-in text editor or entering commands in the Python console. The two most common ways to execute python scripts are using the built-in text editor or entering commands in the python console.
Both the **Text Editor** and **Python Console** are space types you can select from the view header. Both the **Text Editor** and **Python Console** are space types you can select from the view header.
@@ -70,7 +82,7 @@ Key Concepts
Data Access Data Access
----------- -----------
Accessing DataBlocks Accessing datablocks
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
Python accesses Blender's data in the same way as the animation system and user interface; this implies that any setting that can be changed via a button can also be changed from Python. Python accesses Blender's data in the same way as the animation system and user interface; this implies that any setting that can be changed via a button can also be changed from Python.
@@ -104,7 +116,7 @@ Unlike Python's dictionaries, both methods are acceptable; however, the index of
bpy.data.objects["Cube"] bpy.data.objects["Cube"]
Accessing Attributes Accessing attributes
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
Once you have a data block, such as a material, object, groups etc., its attributes can be accessed much like you would change a setting using the graphical interface. In fact, the tooltip for each button also displays the Python attribute which can help in finding what settings to change in a script. Once you have a data block, such as a material, object, groups etc., its attributes can be accessed much like you would change a setting using the graphical interface. In fact, the tooltip for each button also displays the Python attribute which can help in finding what settings to change in a script.
@@ -132,7 +144,7 @@ Example of a data path that can be quickly found via the console:
Data Creation/Removal Data Creation/Removal
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
Those of you familiar with other Python API's may be surprised that new datablocks in the bpy API can't be created by calling the class: Those of you familiar with other python api's may be surprised that new datablocks in the bpy api can't be created by calling the class:
>>> bpy.types.Mesh() >>> bpy.types.Mesh()
Traceback (most recent call last): Traceback (most recent call last):
@@ -141,9 +153,9 @@ Those of you familiar with other Python API's may be surprised that new databloc
This is an intentional part of the API design. This is an intentional part of the API design.
The Blender/Python API can't create Blender data that exists outside the main Blender database (accessed through :mod:`bpy.data`), because this data is managed by Blender (save/load/undo/append... etc). The blender/python api can't create blender data that exists outside the main blender database (accessed through bpy.data), because this data is managed by blender (save/load/undo/append... etc).
Data is added and removed via methods on the collections in :mod:`bpy.data`, eg: Data is added and removed via methods on the collections in bpy.data, eg:
>>> mesh = bpy.data.meshes.new(name="MyMesh") >>> mesh = bpy.data.meshes.new(name="MyMesh")
>>> print(mesh) >>> print(mesh)
@@ -155,8 +167,7 @@ Data is added and removed via methods on the collections in :mod:`bpy.data`, eg:
Custom Properties Custom Properties
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
Python can access properties on any datablock that has an ID (data that can be linked in and accessed from :mod:`bpy.data`. Python can access properties on any datablock that has an ID (data that can be linked in and accessed from :mod:`bpy.data`. When assigning a property, you can make up your own names, these will be created when needed or overwritten if they exist.
When assigning a property, you can make up your own names, these will be created when needed or overwritten if they exist.
This data is saved with the blend file and copied with objects. This data is saved with the blend file and copied with objects.
@@ -169,7 +180,7 @@ Example:
if "SomeProp" in bpy.context.object: if "SomeProp" in bpy.context.object:
print("Property found") print("Property found")
# Use the get function like a Python dictionary # Use the get function like a python dictionary
# which can have a fallback value. # which can have a fallback value.
value = bpy.data.scenes["Scene"].get("test_prop", "fallback value") value = bpy.data.scenes["Scene"].get("test_prop", "fallback value")
@@ -182,9 +193,11 @@ Example:
Note that these properties can only be assigned basic Python types. Note that these properties can only be assigned basic Python types.
- int, float, string * int, float, string
- array of ints/floats
- dictionary (only string keys are supported, values must be basic types too) * array of ints/floats
* dictionary (only string keys are supported, values must be basic types too)
These properties are valid outside of Python. They can be animated by curves or used in driver paths. These properties are valid outside of Python. They can be animated by curves or used in driver paths.
@@ -192,8 +205,7 @@ These properties are valid outside of Python. They can be animated by curves or
Context Context
------- -------
While it's useful to be able to access data directly by name or as a list, it's more common to operate on the user's selection. While it's useful to be able to access data directly by name or as a list, it's more common to operate on the user's selection. The context is always available from '''bpy.context''' and can be used to get the active object, scene, tool settings along with many other attributes.
The context is always available from ``bpy.context`` and can be used to get the active object, scene, tool settings along with many other attributes.
Common-use cases: Common-use cases:
@@ -208,10 +220,9 @@ So ``bpy.context.object = obj`` will raise an error.
But ``bpy.context.scene.objects.active = obj`` will work as expected. But ``bpy.context.scene.objects.active = obj`` will work as expected.
The context attributes change depending on where they are accessed. The context attributes change depending on where they are accessed. The 3D view has different context members than the console, so take care when accessing context attributes that the user state is known.
The 3D view has different context members than the console, so take care when accessing context attributes that the user state is known.
See :mod:`bpy.context` API reference. See :mod:`bpy.context` API reference
Operators (Tools) Operators (Tools)
@@ -230,17 +241,15 @@ Examples:
.. note:: .. note::
The menu item: :menuselection:`Help --> Operator Cheat Sheet` gives a list of all operators and their default values in Python syntax, along with the generated docs. The menu item: Help -> Operator Cheat Sheet" gives a list of all operators and their default values in Python syntax, along with the generated docs. This is a good way to get an overview of all blender's operators.
This is a good way to get an overview of all Blender's operators.
Operator Poll() Operator Poll()
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
Many operators have a "poll" function which may check that the mouse is in a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc). Many operators have a "poll" function which may check that the mouse is a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc). When an operator's poll function fails within python, an exception is raised.
When an operator's poll function fails within Python, an exception is raised.
For example, calling ``bpy.ops.view3d.render_border()`` from the console raises the following error: For example, calling bpy.ops.view3d.render_border() from the console raises the following error:
.. code-block:: python .. code-block:: python
@@ -261,10 +270,13 @@ Integration
Python scripts can integrate with Blender in the following ways: Python scripts can integrate with Blender in the following ways:
- By defining a rendering engine. * By defining a rendering engine.
- By defining operators.
- By defining menus, headers and panels. * By defining operators.
- By inserting new buttons into existing menus, headers and panels
* By defining menus, headers and panels.
* By inserting new buttons into existing menus, headers and panels
In Python, this is done by defining a class, which is a subclass of an existing type. In Python, this is done by defining a class, which is a subclass of an existing type.
@@ -279,17 +291,24 @@ Once this script runs, ``SimpleOperator`` is registered with Blender and can be
To run the script: To run the script:
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it. #. Highlight the above code then press Ctrl+C to copy it.
#. Start Blender #. Start Blender
#. Press :kbd:`Ctrl-Right` twice to change to the Scripting layout.
#. Press Ctrl+Right twice to change to the Scripting layout.
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block. #. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame).
#. Press Ctrl+V to paste the code into the text panel (the upper left frame).
#. Click on the button **Run Script**. #. Click on the button **Run Script**.
#. Move your mouse into the 3D view, press spacebar for the operator search menu, and type "Simple". #. Move your mouse into the 3D view, press spacebar for the operator search menu, and type "Simple".
#. Click on the "Simple Operator" item found in search. #. Click on the "Simple Operator" item found in search.
.. seealso:: The class members with the ``bl_`` prefix are documented in the API .. seealso:: The class members with the **bl_** prefix are documented in the API
reference :class:`bpy.types.Operator` reference :class:`bpy.types.Operator`
.. note:: The output from the ``main`` function is sent to the terminal; in order to see this, be sure to :ref:`use the terminal <use_the_terminal>`. .. note:: The output from the ``main`` function is sent to the terminal; in order to see this, be sure to :ref:`use the terminal <use_the_terminal>`.
@@ -297,25 +316,33 @@ To run the script:
Example Panel Example Panel
------------- -------------
Panels register themselves as a class, like an operator. Notice the extra ``bl_`` variables used to set the context they display in. Panels register themselves as a class, like an operator. Notice the extra **bl_** variables used to set the context they display in.
.. literalinclude:: ../../../release/scripts/templates_py/ui_panel_simple.py .. literalinclude:: ../../../release/scripts/templates_py/ui_panel_simple.py
To run the script: To run the script:
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it #. Highlight the above code then press Ctrl+C to copy it
#. Start Blender #. Start Blender
#. Press :kbd:`Ctrl-Right` twice to change to the Scripting layout
#. Press Ctrl+Right twice to change to the Scripting layout
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block. #. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame)
#. Press Ctrl+V to paste the code into the text panel (the upper left frame)
#. Click on the button **Run Script**. #. Click on the button **Run Script**.
To view the results: To view the results:
#. Select the the default cube. #. Select the the default cube.
#. Click on the Object properties icon in the buttons panel (far right; appears as a tiny cube). #. Click on the Object properties icon in the buttons panel (far right; appears as a tiny cube).
#. Scroll down to see a panel named **Hello World Panel**. #. Scroll down to see a panel named **Hello World Panel**.
#. Changing the object name also updates **Hello World Panel's** Name: field. #. Changing the object name also updates **Hello World Panel's** Name: field.
Note the row distribution and the label and properties that are available through the code. Note the row distribution and the label and properties that are available through the code.
@@ -334,14 +361,16 @@ Blender's Python API can be split up into 3 categories.
Native Types Native Types
------------ ------------
In simple cases returning a number or a string as a custom type would be cumbersome, so these are accessed as normal Python types. In simple cases returning a number or a string as a custom type would be cumbersome, so these are accessed as normal python types.
- Blender float/int/boolean -> float/int/boolean * blender float/int/boolean -> float/int/boolean
- Blender enumerator -> string
* blender enumerator -> string
>>> C.object.rotation_mode = 'AXIS_ANGLE' >>> C.object.rotation_mode = 'AXIS_ANGLE'
- Blender enumerator (multiple) -> set of strings
* blender enumerator (multiple) -> set of strings
.. code-block:: python .. code-block:: python
@@ -359,7 +388,7 @@ Used for Blender datablocks and collections: :class:`bpy.types.bpy_struct`
For data that contains its own attributes groups/meshes/bones/scenes... etc. For data that contains its own attributes groups/meshes/bones/scenes... etc.
There are 2 main types that wrap Blenders data, one for datablocks (known internally as ``bpy_struct``), another for properties. There are 2 main types that wrap Blenders data, one for datablocks (known internally as bpy_struct), another for properties.
>>> bpy.context.object >>> bpy.context.object
bpy.data.objects['Cube'] bpy.data.objects['Cube']

View File

@@ -19,17 +19,21 @@ Prerequisites
Before going through the tutorial you should... Before going through the tutorial you should...
- Familiarity with the basics of working in Blender. * Familiarity with the basics of working in Blender.
- Know how to run a script in Blender's text editor (as documented in the quick-start)
- Have an understanding of Python primitive types (int, boolean, string, list, tuple, dictionary, and set). * Know how to run a script in Blender's text editor (as documented in the quick-start)
- Be familiar with the concept of Python modules.
- Basic understanding of classes (object orientation) in Python. * Have an understanding of Python primitive types (int, boolean, string, list, tuple, dictionary, and set).
* Be familiar with the concept of Python modules.
* Basic understanding of classes (object orientation) in Python.
Suggested reading before starting this tutorial. Suggested reading before starting this tutorial.
- `Dive Into Python <http://getpython3.com/diveintopython3/index.html>`_ sections (1, 2, 3, 4, and 7). * `Dive Into Python <http://getpython3.com/diveintopython3/index.html>`_ sections (1, 2, 3, 4, and 7).
- :ref:`Blender API Quickstart <info_quickstart>` * :ref:`Blender API Quickstart <info_quickstart>`
to help become familiar with Blender/Python basics. to help become familiar with Blender/Python basics.
@@ -41,11 +45,13 @@ Documentation Links
While going through the tutorial you may want to look into our reference documentation. While going through the tutorial you may want to look into our reference documentation.
- :ref:`Blender API Overview <info_overview>`. - * :ref:`Blender API Overview <info_overview>`. -
*This document is rather detailed but helpful if you want to know more on a topic.* *This document is rather detailed but helpful if you want to know more on a topic.*
- :mod:`bpy.context` api reference. -
* :mod:`bpy.context` api reference. -
*Handy to have a list of available items your script may operate on.* *Handy to have a list of available items your script may operate on.*
- :class:`bpy.types.Operator`. -
* :class:`bpy.types.Operator`. -
*The following addons define operators, these docs give details and more examples of operators.* *The following addons define operators, these docs give details and more examples of operators.*
@@ -72,11 +78,11 @@ To give an example, here is the simplest possible addon.
print("Goodbye World") print("Goodbye World")
- ``bl_info`` is a dictionary containing addon meta-data such as the title, version and author to be displayed in the * ``bl_info`` is a dictionary containing addon meta-data such as the title, version and author to be displayed in the
user preferences addon list. user preferences addon list.
- ``register`` is a function which only runs when enabling the addon, this means the module can be loaded without * ``register`` is a function which only runs when enabling the addon, this means the module can be loaded without
activating the addon. activating the addon.
- ``unregister`` is a function to unload anything setup by ``register``, this is called when the addon is disabled. * ``unregister`` is a function to unload anything setup by ``register``, this is called when the addon is disabled.
@@ -178,15 +184,12 @@ This addon takes the body of the script above, and adds them to an operator's ``
register() register()
.. note:: .. note:: ``bl_info`` is split across multiple lines, this is just a style convention used to more easily add items.
``bl_info`` is split across multiple lines, this is just a style convention used to more easily add items. .. note:: Rather than using ``bpy.context.scene``, we use the ``context.scene`` argument passed to ``execute()``.
In most cases these will be the same however in some cases operators will be passed a custom context
.. note:: so script authors should prefer the ``context`` argument passed to operators.
Rather than using ``bpy.context.scene``, we use the ``context.scene`` argument passed to ``execute()``.
In most cases these will be the same however in some cases operators will be passed a custom context
so script authors should prefer the ``context`` argument passed to operators.
To test the script you can copy and paste this into Blender text editor and run it, this will execute the script To test the script you can copy and paste this into Blender text editor and run it, this will execute the script
directly and call register immediately. directly and call register immediately.
@@ -199,8 +202,8 @@ However running the script wont move any objects, for this you need to execute t
:height: 574px :height: 574px
:alt: Spacebar :alt: Spacebar
Do this by pressing :kbd:`Spacebar` to bring up the operator search dialog and type in Do this by pressing ``SpaceBar`` to bring up the operator search dialog and type in "Move X by One" (the ``bl_label``),
"Move X by One" (the ``bl_label``), then :kbd:`Enter`. then press ``Enter``.
@@ -211,8 +214,8 @@ The objects should move as before.
Install The Addon Install The Addon
----------------- -----------------
Once you have your addon within in Blender's text editor, Once you have your addon within in Blender's text editor, you will want to be able to install it so it can be enabled in
you will want to be able to install it so it can be enabled in the user preferences to load on startup. the user preferences to load on startup.
Even though the addon above is a test, lets go through the steps anyway so you know how to do it for later. Even though the addon above is a test, lets go through the steps anyway so you know how to do it for later.
@@ -560,26 +563,20 @@ Bringing it all together
# handle the keymap # handle the keymap
wm = bpy.context.window_manager wm = bpy.context.window_manager
# Note that in background mode (no GUI available), keyconfigs are not available either, so we have to check this km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
# to avoid nasty errors in background case. kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
kc = wm.keyconfigs.addon kmi.properties.total = 4
if kc: addon_keymaps.append((km, kmi))
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode', space_type='EMPTY')
kmi = km.keymap_items.new(ObjectCursorArray.bl_idname, 'SPACE', 'PRESS', ctrl=True, shift=True)
kmi.properties.total = 4
addon_keymaps.append((km, kmi))
def unregister(): def unregister():
# Note: when unregistering, it's usually good practice to do it in reverse order you registered. bpy.utils.unregister_class(ObjectCursorArray)
# Can avoid strange issues like keymap still referring to operators already unregistered... bpy.types.VIEW3D_MT_object.remove(menu_func)
# handle the keymap # handle the keymap
for km, kmi in addon_keymaps: for km, kmi in addon_keymaps:
km.keymap_items.remove(kmi) km.keymap_items.remove(kmi)
addon_keymaps.clear() addon_keymaps.clear()
bpy.utils.unregister_class(ObjectCursorArray)
bpy.types.VIEW3D_MT_object.remove(menu_func)
if __name__ == "__main__": if __name__ == "__main__":
register() register()
@@ -630,12 +627,15 @@ you want to see example code for, this is a good place to start.
Here are some sites you might like to check on after completing this tutorial. Here are some sites you might like to check on after completing this tutorial.
- :ref:`Blender/Python API Overview <info_overview>` - * :ref:`Blender/Python API Overview <info_overview>` -
*For more background details on Blender/Python integration.* *For more background details on Blender/Python integration.*
- `How to Think Like a Computer Scientist <http://interactivepython.org/courselib/static/thinkcspy/index.html>`_ -
* `How to Think Like a Computer Scientist <http://interactivepython.org/courselib/static/thinkcspy/index.html>`_ -
*Great info for those who are still learning Python.* *Great info for those who are still learning Python.*
- `Blender Development (Wiki) <http://wiki.blender.org/index.php/Dev:Contents>`_ -
* `Blender Development (Wiki) <http://wiki.blender.org/index.php/Dev:Contents>`_ -
*Blender Development, general information and helpful links.* *Blender Development, general information and helpful links.*
- `Blender Artists (Coding Section) <http://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
* `Blender Artists (Coding Section) <http://blenderartists.org/forum/forumdisplay.php?47-Coding>`_ -
*forum where people ask Python development questions* *forum where people ask Python development questions*

View File

@@ -145,7 +145,6 @@ def main():
"BMO_OPTYPE_FLAG_NORMALS_CALC", "BMO_OPTYPE_FLAG_NORMALS_CALC",
"BMO_OPTYPE_FLAG_UNTAN_MULTIRES", "BMO_OPTYPE_FLAG_UNTAN_MULTIRES",
"BMO_OPTYPE_FLAG_SELECT_FLUSH", "BMO_OPTYPE_FLAG_SELECT_FLUSH",
"BMO_OPTYPE_FLAG_SELECT_VALIDATE",
"BMO_OPTYPE_FLAG_NOP", "BMO_OPTYPE_FLAG_NOP",
) )
vars_dict = {} vars_dict = {}

View File

@@ -316,7 +316,7 @@ def main():
try: try:
import argparse import argparse
except ImportError: except:
print("Old Blender, just dumping") print("Old Blender, just dumping")
api_dump() api_dump()
return return

View File

@@ -1,22 +1,22 @@
# ##### BEGIN GPL LICENSE BLOCK ##### # ***** BEGIN GPL LICENSE BLOCK *****
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation, # along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
# Contributor(s): Campbell Barton # Contributor(s): Campbell Barton, Luca Bonavita
# #
# ##### END GPL LICENSE BLOCK ##### # #**** END GPL LICENSE BLOCK #****
# <pep8 compliant> # <pep8 compliant>
@@ -138,9 +138,19 @@ def handle_args():
parser.add_argument("-T", "--sphinx-theme", parser.add_argument("-T", "--sphinx-theme",
dest="sphinx_theme", dest="sphinx_theme",
type=str, type=str,
default="classic", default='default',
help="Sphinx theme (default='classic'), " help=
"see: http://sphinx-doc.org/theming.html", # see SPHINX_THEMES below
"Sphinx theme (default='default')\n"
"Available themes\n"
"----------------\n"
"(Blender Foundation) blender-org\n" # naiad
"(Sphinx) agogo, basic, epub, haiku, nature, "
"scrolls, sphinxdoc, traditional\n",
# choices=['naiad', 'blender-org'] + # bf
# ['agogo', 'basic', 'epub',
# 'haiku', 'nature', 'scrolls',
# 'sphinxdoc', 'traditional'], # sphinx
required=False) required=False)
parser.add_argument("-N", "--sphinx-named-output", parser.add_argument("-N", "--sphinx-named-output",
@@ -257,7 +267,6 @@ else:
"bpy.props", "bpy.props",
"bpy.types", # supports filtering "bpy.types", # supports filtering
"bpy.utils", "bpy.utils",
"bpy.utils.previews",
"bpy_extras", "bpy_extras",
"gpu", "gpu",
"mathutils", "mathutils",
@@ -265,12 +274,6 @@ else:
"mathutils.kdtree", "mathutils.kdtree",
"mathutils.noise", "mathutils.noise",
"freestyle", "freestyle",
"freestyle.chainingiterators",
"freestyle.functions",
"freestyle.predicates",
"freestyle.shaders",
"freestyle.types",
"freestyle.utils",
] ]
# ------ # ------
@@ -313,13 +316,7 @@ try:
__import__("freestyle") __import__("freestyle")
except ImportError: except ImportError:
BPY_LOGGER.debug("Warning: Built without 'freestyle' module, docs incomplete...") BPY_LOGGER.debug("Warning: Built without 'freestyle' module, docs incomplete...")
EXCLUDE_MODULES = list(EXCLUDE_MODULES) + ["freestyle", EXCLUDE_MODULES = list(EXCLUDE_MODULES) + ["freestyle"]
"freestyle.chainingiterators",
"freestyle.functions",
"freestyle.predicates",
"freestyle.shaders",
"freestyle.types",
"freestyle.utils"]
# examples # examples
EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples")) EXAMPLES_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, "examples"))
@@ -410,7 +407,23 @@ BLENDER_ZIP_FILENAME = "%s.zip" % REFERENCE_NAME
# -------------------------------SPHINX----------------------------------------- # -------------------------------SPHINX-----------------------------------------
if ARGS.sphinx_theme == "blender-org": SPHINX_THEMES = {'bf': ['blender-org'], # , 'naiad',
'sphinx': ['agogo',
'basic',
'default',
'epub',
'haiku',
'nature',
'scrolls',
'sphinxdoc',
'traditional']}
available_themes = SPHINX_THEMES['bf'] + SPHINX_THEMES['sphinx']
if ARGS.sphinx_theme not in available_themes:
print("Please choose a theme among: %s" % ', '.join(available_themes))
sys.exit()
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
SPHINX_THEME_DIR = os.path.join(ARGS.output_dir, ARGS.sphinx_theme) SPHINX_THEME_DIR = os.path.join(ARGS.output_dir, ARGS.sphinx_theme)
SPHINX_THEME_SVN_DIR = os.path.join(SCRIPT_DIR, ARGS.sphinx_theme) SPHINX_THEME_SVN_DIR = os.path.join(SCRIPT_DIR, ARGS.sphinx_theme)
@@ -455,11 +468,9 @@ ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
MethodDescriptorType = type(dict.get) MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real) GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None)) StaticMethodType = type(staticmethod(lambda: None))
from types import ( from types import (MemberDescriptorType,
MemberDescriptorType, MethodType,
MethodType, )
FunctionType,
)
_BPY_STRUCT_FAKE = "bpy_struct" _BPY_STRUCT_FAKE = "bpy_struct"
_BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection" _BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection"
@@ -636,26 +647,19 @@ def pyfunc2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_cla
func_type = "function" func_type = "function"
# ther rest are class methods # ther rest are class methods
elif arg_str.startswith("(self, ") or arg_str == "(self)": elif arg_str.startswith("(self, "):
arg_str = "()" if (arg_str == "(self)") else ("(" + arg_str[7:]) arg_str = "(" + arg_str[7:]
func_type = "method" func_type = "method"
elif arg_str.startswith("(cls, "): elif arg_str.startswith("(cls, "):
arg_str = "()" if (arg_str == "(cls)") else ("(" + arg_str[6:]) arg_str = "(" + arg_str[6:]
func_type = "classmethod" func_type = "classmethod"
else: else:
func_type = "staticmethod" func_type = "staticmethod"
doc = py_func.__doc__ fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
if (not doc) or (not doc.startswith(".. %s:: " % func_type)): if py_func.__doc__:
fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str)) write_indented_lines(ident + " ", fw, py_func.__doc__)
ident_temp = ident + " "
else:
ident_temp = ident
if doc:
write_indented_lines(ident_temp, fw, doc)
fw("\n") fw("\n")
del doc, ident_temp
if is_class: if is_class:
write_example_ref(ident + " ", fw, module_name + "." + type_name + "." + identifier) write_example_ref(ident + " ", fw, module_name + "." + type_name + "." + identifier)
@@ -679,7 +683,7 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
fw(ident + ".. data:: %s\n\n" % identifier) fw(ident + ".. data:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, doc, False) write_indented_lines(ident + " ", fw, doc, False)
fw("\n") fw("\n")
elif type(descr) in {MethodDescriptorType, ClassMethodDescriptorType}: elif type(descr) in (MethodDescriptorType, ClassMethodDescriptorType):
write_indented_lines(ident, fw, doc, False) write_indented_lines(ident, fw, doc, False)
fw("\n") fw("\n")
else: else:
@@ -871,9 +875,9 @@ def pymodule2sphinx(basepath, module_name, module, title):
module_dir_value_type.sort(key=lambda triple: str(triple[2])) module_dir_value_type.sort(key=lambda triple: str(triple[2]))
for attribute, value, value_type in module_dir_value_type: for attribute, value, value_type in module_dir_value_type:
if value_type == FunctionType: if value_type == types.FunctionType:
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False) pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof elif value_type in (types.BuiltinMethodType, types.BuiltinFunctionType): # both the same at the moment but to be future proof
# note: can't get args from these, so dump the string as is # note: can't get args from these, so dump the string as is
# this means any module used like this must have fully formatted docstrings. # this means any module used like this must have fully formatted docstrings.
py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False) py_c_func2sphinx("", fw, module_name, None, attribute, value, is_class=False)
@@ -921,29 +925,18 @@ def pymodule2sphinx(basepath, module_name, module, title):
fw(title_string(heading, heading_char)) fw(title_string(heading, heading_char))
# May need to be its own function # May need to be its own function
fw(".. class:: %s\n\n" % type_name)
if value.__doc__: if value.__doc__:
if value.__doc__.startswith(".. class::"): write_indented_lines(" ", fw, value.__doc__, False)
fw(value.__doc__) fw("\n")
else:
fw(".. class:: %s\n\n" % type_name)
write_indented_lines(" ", fw, value.__doc__, True)
else:
fw(".. class:: %s\n\n" % type_name)
fw("\n")
write_example_ref(" ", fw, module_name + "." + type_name) write_example_ref(" ", fw, module_name + "." + type_name)
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("_")] descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")]
for key, descr in descr_items: for key, descr in descr_items:
if type(descr) == ClassMethodDescriptorType: if type(descr) == ClassMethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key) py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
# needed for pure python classes
for key, descr in descr_items:
if type(descr) == FunctionType:
pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True)
for key, descr in descr_items: for key, descr in descr_items:
if type(descr) == MethodDescriptorType: if type(descr) == MethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key) py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
@@ -966,12 +959,10 @@ def pymodule2sphinx(basepath, module_name, module, title):
context_type_map = { context_type_map = {
"active_base": ("ObjectBase", False), "active_base": ("ObjectBase", False),
"active_bone": ("EditBone", False), "active_bone": ("EditBone", False),
"active_gpencil_frame": ("GreasePencilLayer", True),
"active_gpencil_layer": ("GPencilLayer", True),
"active_node": ("Node", False),
"active_object": ("Object", False), "active_object": ("Object", False),
"active_operator": ("Operator", False), "active_operator": ("Operator", False),
"active_pose_bone": ("PoseBone", False), "active_pose_bone": ("PoseBone", False),
"active_node": ("Node", False),
"armature": ("Armature", False), "armature": ("Armature", False),
"bone": ("Bone", False), "bone": ("Bone", False),
"brush": ("Brush", False), "brush": ("Brush", False),
@@ -987,11 +978,7 @@ context_type_map = {
"edit_object": ("Object", False), "edit_object": ("Object", False),
"edit_text": ("Text", False), "edit_text": ("Text", False),
"editable_bones": ("EditBone", True), "editable_bones": ("EditBone", True),
"editable_gpencil_layers": ("GPencilLayer", True),
"editable_gpencil_strokes": ("GPencilStroke", True),
"fluid": ("FluidSimulationModifier", False), "fluid": ("FluidSimulationModifier", False),
"gpencil_data": ("GreasePencel", False),
"gpencil_data_owner": ("ID", False),
"image_paint_object": ("Object", False), "image_paint_object": ("Object", False),
"lamp": ("Lamp", False), "lamp": ("Lamp", False),
"lattice": ("Lattice", False), "lattice": ("Lattice", False),
@@ -1031,7 +1018,6 @@ context_type_map = {
"vertex_paint_object": ("Object", False), "vertex_paint_object": ("Object", False),
"visible_bases": ("ObjectBase", True), "visible_bases": ("ObjectBase", True),
"visible_bones": ("EditBone", True), "visible_bones": ("EditBone", True),
"visible_gpencil_layers": ("GPencilLayer", True),
"visible_objects": ("Object", True), "visible_objects": ("Object", True),
"visible_pose_bones": ("PoseBone", True), "visible_pose_bones": ("PoseBone", True),
"weight_paint_object": ("Object", False), "weight_paint_object": ("Object", False),
@@ -1254,7 +1240,6 @@ def pyrna2sphinx(basepath):
fw("\n\n") fw("\n\n")
subclass_ids = [s.identifier for s in structs.values() if s.base is struct if not rna_info.rna_id_ignore(s.identifier)] subclass_ids = [s.identifier for s in structs.values() if s.base is struct if not rna_info.rna_id_ignore(s.identifier)]
subclass_ids.sort()
if subclass_ids: if subclass_ids:
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n") fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n")
@@ -1562,7 +1547,7 @@ def write_sphinx_conf_py(basepath):
if ARGS.sphinx_theme != 'default': if ARGS.sphinx_theme != 'default':
fw("html_theme = '%s'\n" % ARGS.sphinx_theme) fw("html_theme = '%s'\n" % ARGS.sphinx_theme)
if ARGS.sphinx_theme == "blender-org": if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
fw("html_theme_path = ['../']\n") fw("html_theme_path = ['../']\n")
# copied with the theme, exclude else we get an error [#28873] # copied with the theme, exclude else we get an error [#28873]
fw("html_favicon = 'favicon.ico'\n") # in <theme>/static/ fw("html_favicon = 'favicon.ico'\n") # in <theme>/static/
@@ -1623,7 +1608,6 @@ def write_rst_contents(basepath):
# py modules # py modules
"bpy.utils", "bpy.utils",
"bpy.utils.previews",
"bpy.path", "bpy.path",
"bpy.app", "bpy.app",
"bpy.app.handlers", "bpy.app.handlers",
@@ -1796,14 +1780,8 @@ def write_rst_importable_modules(basepath):
"mathutils.geometry" : "Geometry Utilities", "mathutils.geometry" : "Geometry Utilities",
"mathutils.kdtree" : "KDTree Utilities", "mathutils.kdtree" : "KDTree Utilities",
"mathutils.noise" : "Noise Utilities", "mathutils.noise" : "Noise Utilities",
"freestyle" : "Freestyle Module", "freestyle" : "Freestyle Data Types & Operators",
"freestyle.types" : "Freestyle Types", }
"freestyle.predicates" : "Freestyle Predicates",
"freestyle.functions" : "Freestyle Functions",
"freestyle.chainingiterators" : "Freestyle Chaining Iterators",
"freestyle.shaders" : "Freestyle Shaders",
"freestyle.utils" : "Freestyle Utilities",
}
for mod_name, mod_descr in importable_modules.items(): for mod_name, mod_descr in importable_modules.items():
if mod_name not in EXCLUDE_MODULES: if mod_name not in EXCLUDE_MODULES:
module = __import__(mod_name, module = __import__(mod_name,
@@ -1874,8 +1852,8 @@ def rna2sphinx(basepath):
# context # context
if "bpy.context" not in EXCLUDE_MODULES: if "bpy.context" not in EXCLUDE_MODULES:
# one of a kind, context doc (uses ctypes to extract info!) # one of a kind, context doc (uses ctypes to extract info!)
# doesn't work on mac and windows # doesn't work on mac
if PLATFORM not in {"darwin", "windows"}: if PLATFORM != "darwin":
pycontext2sphinx(basepath) pycontext2sphinx(basepath)
# internal modules # internal modules
@@ -1978,7 +1956,7 @@ def main():
copy_function=shutil.copy) copy_function=shutil.copy)
# eventually, copy the theme dir # eventually, copy the theme dir
if ARGS.sphinx_theme == "blender-org": if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
if os.path.exists(SPHINX_THEME_DIR): if os.path.exists(SPHINX_THEME_DIR):
shutil.rmtree(SPHINX_THEME_DIR, True) shutil.rmtree(SPHINX_THEME_DIR, True)
shutil.copytree(SPHINX_THEME_SVN_DIR, shutil.copytree(SPHINX_THEME_SVN_DIR,

Some files were not shown because too many files have changed in this diff Show More