Compare commits

..

443 Commits

Author SHA1 Message Date
96e40fef46 Fix tool system integration of hair edit brushes. 2018-12-20 13:29:01 +00:00
cb7d8a4a0f Operator for hair edit brush strokes (to be implemented). 2018-12-20 13:28:06 +00:00
62530672fe Fix identifier string for hair edit keymap. 2018-12-20 13:26:42 +00:00
7aed91a880 Fix memleaks from new hair drawing index buffer/texture. 2018-12-18 13:20:12 +00:00
fdca73fd4a Merge branch 'blender2.8' into hair_object 2018-12-18 10:58:54 +00:00
b62f226cac Tool generator functions for hair edit mode. 2018-12-17 15:36:40 +00:00
538c74a949 Add missing context attributes for hair edit mode. 2018-12-17 15:35:59 +00:00
7638044d2a Add missing RNA type for hair brush. 2018-12-17 10:05:08 +00:00
f252a59af5 Add missing padding in hair edit settings. 2018-12-17 09:59:14 +00:00
3bb345b7c5 temp: add brushes for hair editing. 2018-12-14 13:07:16 +00:00
bdb5cc1777 Shorter name for hair edit settings property. 2018-12-01 11:10:01 +00:00
2c004a257e Apply the hair curve transformation to vertices when drawing. 2018-11-28 08:27:06 +00:00
38a7d0e011 Fix element count for edit strand drawing to account for primitive restart. 2018-11-25 17:19:20 +00:00
cdd11a99f7 Fix invalid vertex location in draw buffers caused by shadowed variable. 2018-11-25 13:41:27 +00:00
e3ae01d83a Reenable the hair test operator using customdata. 2018-11-25 13:20:58 +00:00
8bb601ab51 Count hair data elements before creating draw buffers. 2018-11-25 13:20:22 +00:00
49caf35d8a Add masks for new customdata types. 2018-11-25 13:19:46 +00:00
f50611ed02 Fix accidental typo. 2018-11-25 13:19:13 +00:00
2b1cb59a96 Remove hair data arrays for verts/curves/follicles and use customdata instead.
This disables a bunch of topology-changing functions which will need to be replaced/removed.
2018-11-25 11:03:44 +00:00
d554502ad0 Merge branch 'blender2.8' into hair_object 2018-11-25 10:29:39 +00:00
6f8ae59d05 Add vertex, curve, and follicle base data layers by default. 2018-11-25 09:50:08 +00:00
ec72093d2e New customdata types for base hair curve data. 2018-11-18 13:33:42 +00:00
b8f91e8bff Merge HairPattern into HairCurveData, no reason to keep these separate any more. 2018-11-18 11:26:43 +00:00
3540ab88fd Introduce curve and vertex customdata for hair. 2018-11-18 10:51:54 +00:00
8637ef3455 Add 'nomain' hair creation functions for making hair systems. 2018-11-17 14:15:49 +00:00
1102e4572b Remove HairExport usage from draw code. 2018-11-12 08:51:19 +00:00
12f04a805a Depsgraph eval function for hair on object level that computes follicle space. 2018-11-11 11:45:27 +00:00
81e0057c5c Make return values for mesh sample eval optional. 2018-11-11 11:44:31 +00:00
036dc955c2 Dirty flags for follicle customdata. 2018-11-10 15:27:26 +00:00
deb760896b Runtime struct for non-serialized hair data, similar to Mesh runtime. 2018-11-10 14:44:20 +00:00
f1df9e8093 Add customdata for hair follicles. 2018-11-10 14:11:40 +00:00
154e6163d7 Fix incorrect segment count when creating hair segment index buffer.
The max size includes one element for primitive restart, but that must not
be included when creating actual indices.
2018-11-05 09:14:36 +00:00
c28425c406 Fix curve data copy function not copying counters. 2018-11-05 09:13:54 +00:00
3bb7970bd6 Simple hair curve generation function for the test operator. 2018-11-04 13:45:09 +00:00
4a5c60b81b Remove the "bind" flag and function for hair.
This is a remnant of the previous system where actual fibers were always
interpolated from one or more actual curves. Now each follicle simply gets
its own curve.
2018-11-04 12:00:43 +00:00
8856e155c9 Merge remote-tracking branch 'origin/blender2.8' into hair_object 2018-11-04 11:25:45 +00:00
1e243709ab Add missing ID base class declaration for HairSystem RNA. 2018-10-28 14:19:35 +00:00
6f596beb83 Fix renamed 'percentage' arg in layout splits. 2018-10-28 14:12:59 +00:00
45f7d11cc7 Check for valid scalp before running the test hair operator. 2018-10-28 14:08:10 +00:00
71df3bc00c Fix merge error in view3d ui script. 2018-10-28 08:59:24 +00:00
2cd1d9523c Merge branch 'blender2.8' into hair_object 2018-10-28 08:45:38 +00:00
05be2489aa Rename INFO menu to VIEW3D. 2018-10-28 07:49:17 +00:00
618f5a6ff2 Merge branch 'blender2.8' into hair_object 2018-10-27 08:01:14 +01:00
7500737fbe Merge branch 'blender2.8' into hair_object 2018-10-26 07:56:16 +01:00
6df397bcb2 Tag the object data block instead of the object to ensure correct updates after selection. 2018-09-23 14:13:47 +01:00
f3e455a0f8 Follicle selection flag and "select all" operator. 2018-09-23 14:04:20 +01:00
a2715716ba Remove deprecated texture cache from HairSystem. 2018-09-23 12:58:55 +01:00
0907277543 Hair selection mode enum for specifying what part of hair data tools should work on. 2018-09-23 10:35:14 +01:00
e18c5b7053 Fix submodules. 2018-09-23 09:32:14 +01:00
6a81f686eb Draw function for hair follicles. 2018-09-23 09:31:10 +01:00
babdb5a360 Draw mode for hair follicles in edit mode. 2018-09-16 12:57:31 +01:00
1180b90e13 Fix const-ness of hair primitive pointers for screen vertex callbacks. 2018-09-16 11:34:01 +01:00
1e58ce9797 Iterator functions and macros for hair primitives. 2018-09-16 10:22:25 +01:00
3746906fa7 Check follicle curve index validity when iterating, in case follicles are unbound. 2018-09-09 10:08:32 +01:00
b9e1f358bf Remove disused functions for generating hair interpolation texture buffers. 2018-09-09 09:59:23 +01:00
994c8e9efd Add a simple test operator for creating hair in edit mode. 2018-09-09 09:53:30 +01:00
8dd0ec09c5 Implement drawing function for hair curves in edit mode. 2018-09-05 08:30:47 +01:00
623f180537 Explicit object pointer needed for scalp access functions in RNA. 2018-09-02 11:40:13 +01:00
8caf3f7b12 Add missing switch case for the object geometry depsgraph builder. 2018-09-02 10:19:13 +01:00
9468d22844 Fix build errors. 2018-09-02 10:14:52 +01:00
e0a4b835ec New object type for hair systems. 2018-08-29 08:52:50 +01:00
e69b046825 Remove the hair modifier.
A new object type for hair will be used instead.
2018-08-12 13:48:01 +01:00
dc2d841b7c Merge branch 'blender2.8' into hair_guides 2018-08-12 12:52:49 +01:00
27b28e437d Merge branch 'tmp_hair_curves' into hair_guides 2018-08-12 11:05:36 +01:00
f854fefa17 Separate buffer texture for hair index for each vertex.
This is needed for allowing variable length hair strands, where the hair index can not
simply be calculated from the vertex index based on a fixed-length strand.
2018-08-12 10:33:21 +01:00
b60dcd85f9 Fix the hairStrandsRes uniform for particle hair. 2018-07-22 13:54:37 +01:00
58979947bc Correct point and element counts for particle hair. 2018-07-22 12:46:26 +01:00
1dba28221d Post merge fixes. 2018-07-15 13:07:29 +01:00
4a92042916 Post merge fixes. 2018-07-15 12:44:04 +01:00
31f371b200 Merge branch 'hair_guides' into tmp_hair_curves 2018-07-15 12:28:34 +01:00
a9be42dfa2 Merge branch 'blender2.8' into hair_guides 2018-07-15 12:16:27 +01:00
8915d9ed0d Change the uniform strand_res value to strands_len, point_len and elem_len counts. 2018-07-15 11:41:13 +01:00
47912ef922 Rename proc_buf to proc_point_buf to make it consistent with the main control point buffer. 2018-07-15 09:12:33 +01:00
51500addaa Merge branch 'hair_guides' into tmp_hair_curves 2018-07-10 07:53:09 +01:00
8a8b9d7ea9 Merge branch 'blender2.8' into hair_guides 2018-07-10 07:34:05 +01:00
a754d222ba Merge branch 'hair_guides' into tmp_hair_curves 2018-07-03 07:42:12 +01:00
08836b73fe Merge branch 'blender2.8' into hair_guides 2018-07-03 07:38:08 +01:00
54aaceaabc Construct hair strands data from hair systems (no real UV/MCol yet). 2018-07-03 07:33:38 +01:00
287968377f Extend default material function for Eevee to work with hair systems. 2018-07-03 07:32:36 +01:00
d09822c876 Fix a few minor crashes from unfinished hair shader code. 2018-07-02 08:22:04 +01:00
7ad71174fe Remove the parent interpolation hair shader and use the transform-feedback shader instead. 2018-07-02 07:42:51 +01:00
0042eb1077 Remove the mesh sample from fiber curve data.
Fiber curves are simple shapes for fibers now, not tied to a particular
place on the scalp mesh (cf. shape keys).
2018-06-30 13:01:52 +01:00
6751627797 Fix fur curve generation function. 2018-06-30 11:36:54 +01:00
487775dd87 Simple hair curve generation for testing per-follicle curves. 2018-06-30 10:56:08 +01:00
142112faec Add common ui draw function for hair display settings. 2018-06-30 10:42:39 +01:00
9b06c23dc3 Remove unused properties_hair.py file. 2018-06-30 10:20:18 +01:00
0875d8b569 Fix ui script for the hair modifier. 2018-06-30 09:51:01 +01:00
aa85cbee00 Replace parent indices and weights with single curve index.
Curves can be shared between follicles, but there will only be one
curve per follicle for defining the shape.
2018-06-30 08:02:15 +01:00
7cd45e1713 Rename "guide" curves to "fiber" curves.
Guide curves should be a higher-level concept. All fibers should have their
own curve control points, with subdivision on the GPU.
2018-06-29 16:42:29 +01:00
614868b571 Generic modifier copy already deletes target data, explicit freeing is redundant. 2018-06-29 13:32:34 +01:00
dc766bfffc Rename the fur modifier to hair modifier. 2018-06-29 13:30:11 +01:00
6af06e3c91 Merge branch 'blender2.8' into hair_guides 2018-06-26 22:23:49 +01:00
94f3cf23ec Merge branch 'blender2.8' into hair_guides 2018-06-21 18:56:13 +01:00
a927dbd17a Merge branch 'blender2.8' into hair_guides 2018-06-19 07:06:33 +01:00
cd71dd6382 Merge branch 'blender2.8' into hair_guides 2018-06-15 07:02:23 +01:00
dec92e6ba1 Backport hair drawing improvements and workbench support from the grooming branch. 2018-06-15 06:45:51 +01:00
08cdc98b54 Backport a few changes from the grooming branch.
material_index in hair system has been removed. The material/shader
for hair should be defined externally it doesn't make sense to rely
on the scalp object material slots for this.
2018-06-09 10:16:01 +01:00
2d8c39c97c Make the hair binding function more robust when no guide curves are defined. 2018-06-09 09:57:36 +01:00
34d61bfd83 Add missing include for mesh runtime. 2018-06-09 06:56:53 +01:00
b7b6f72cb5 Merge branch 'blender2.8' into hair_guides 2018-06-09 06:43:15 +01:00
4f2532e88c Use common_view_lib.glsl instead of including the ProjectionMatrix uniform directly in hair shaders. 2018-06-09 06:41:43 +01:00
7d5297305a Fix hair fiber prepass shader and add missin HAIR_SHADER define to compile it. 2018-06-06 21:34:40 +01:00
4e71eb53d1 Fix hair fiber vertex shaders and bring them closer to the particle hair shader. 2018-06-06 20:40:46 +01:00
b28c35daef Merge branch 'blender2.8' into hair_guides 2018-06-05 20:59:15 +01:00
4c2d7767cf Merge branch 'blender2.8' into hair_guides 2018-05-27 08:42:53 +01:00
38c28972c1 Add an offset to ensure hair guide curves start on the scalp in export caches. 2018-05-27 07:45:55 +01:00
d7977c7667 Properly set loop and poly indices in mesh samples where possible. 2018-05-27 07:45:28 +01:00
e288e3d368 Replace callback for loop weights with a simple array, since these are cached anyway. 2018-05-24 18:43:27 +01:00
a6dbdd5282 Extended hair follicle distribution function that allows geometry filtering. 2018-05-24 18:43:10 +01:00
4e05dd1dc5 Replace DerivedMesh with Mesh throughout hair code, 2018-05-24 17:29:38 +01:00
ba3a650dde Replace per-vertex sampling weights with per-loop for more control (e.g. face maps). 2018-05-24 17:28:53 +01:00
5a75ada839 Fix indexing for hair guide curve drawing. 2018-05-24 11:41:30 +01:00
6885b90564 Fix hair cache update flag combination, have to include dependencies regardless of cache state. 2018-05-24 10:50:59 +01:00
fe5b74c36c Only pass export cache to lower level draw functions, do export on higher levels. 2018-05-24 10:27:28 +01:00
9036a6e60b Draw mode for hair guide curves. 2018-05-24 10:26:42 +01:00
3cef615645 Handle hair cache dependencies internally during invalidation to make partial updates more flexible. 2018-05-24 10:26:42 +01:00
23cb7e81b0 Remove unused 'Axes' mode for follicle drawing. 2018-05-24 10:26:42 +01:00
4fd377990b Fix typo. 2018-05-23 09:04:11 +01:00
671ff29220 Missing forward declaration. 2018-05-22 13:26:44 +01:00
64e3744e8b Make Mesh based eval the default for mesh sampling (generators unchanged). 2018-05-22 10:39:11 +01:00
93177bce3e Don't do implicit update in the hair export cache constructor. 2018-05-22 09:48:09 +01:00
d3c5d74382 Change particle conversion for mesh samples from DerivedMesh to Mesh. 2018-05-22 05:51:19 +01:00
9c9ea7c75f Function for removing all guide curves in a hair system. 2018-05-21 14:47:56 +01:00
8a3861e5d9 Add assert in psys function to ensure DM->Mesh conversion is not forgotten. 2018-05-21 13:21:15 +01:00
b5fa901697 Cleanup: Temporarily removed all groom object type code, move it to a separate branch. 2018-05-21 10:53:45 +01:00
64f109026b Merge branch 'blender2.8' into hair_guides 2018-05-21 09:39:27 +01:00
6797d4f776 Revert "Add a hair system to particles to eventually replace the current pathcaches."
This reverts commit 3ba96b7c4d.
2018-05-19 15:59:54 +01:00
52d6f25d82 Comment on return value. 2018-05-18 16:30:17 +01:00
b2db8c07b9 More detailed API for partially updating hair export caches.
This will allow proper caching of draw data as well as optimization
of GPU buffer uploads when only guide curve deform changes.
2018-05-18 16:27:37 +01:00
3ba96b7c4d Add a hair system to particles to eventually replace the current pathcaches. 2018-05-17 09:37:23 +01:00
8a6b26cf5d Modifier copy function uses const now. 2018-05-15 08:01:58 +01:00
28b17a7fb6 Remove the simple hair guide generator, can test through the API now. 2018-05-15 08:00:05 +01:00
029ac8dc15 Merge branch 'blender2.8' into hair_guides 2018-05-15 07:20:55 +01:00
0ac09ed0da Merge branch 'blender2.8' into hair_guides 2018-05-13 10:20:05 +01:00
25a83cb3cb Fix indexing of vertex buffers for Cycles hair. 2018-05-13 09:46:31 +01:00
ec4ec90934 Render support for hair systems in Cycles. 2018-05-12 14:37:13 +01:00
383c6bc172 Also cache guide tangents and normals and fiber root positions in export data. 2018-05-12 10:42:16 +01:00
b44af40eec New HairExportCache struct to unify pre-computation of hair data for OpenGL, render, and eventual data export. 2018-05-12 09:41:58 +01:00
c155f3bc95 Cycles: split off particle data gathering into separate function.
The general particle caching "Obtain" functions can be used for any
curve-type data in objects, including the new hair system data.
2018-05-07 10:59:11 +01:00
c67adabdba Fix changed signature of applyModifier callback. 2018-05-07 09:58:29 +01:00
e7992b1279 Merge branch 'blender2.8' into hair_guides 2018-05-07 09:31:45 +01:00
d6e5d9a578 Add new modifier callbacks for switching from DerivedMesh. 2018-05-06 10:54:49 +01:00
1447fecbbf Merge branch 'blender2.8' into hair_guides 2018-05-06 10:29:52 +01:00
99b9636bf0 Depsgraph update after changing guide curves through the fur modifier. 2018-04-26 06:57:46 +01:00
298fd140f2 Make sure hair follicle binding is updated before using invalid indices in drawing. 2018-04-21 13:35:14 +01:00
58a70542e0 Merge branch 'blender2.8' into hair_guides 2018-04-21 12:36:52 +01:00
dcd9cb72f5 Test API in the fur modifier for creating custom guide curves with python.
The fur modifier is just a testbed for the underlying hair system.
The API is intended to allow specifying guide curves with python scripts
without having to worry about inconsistent state. All curves are first
defined in a python-friendly way, then applied to the hair system in one step.
2018-04-18 08:57:52 +01:00
974e55e3e6 Alternative guide curve setter function that works better for RNA. 2018-04-15 13:30:38 +01:00
e9cf9776f8 Move guide curve into a nested struct, so it can be replace in one operation. 2018-04-15 12:54:39 +01:00
25bb3669cc Disable unfinished code. 2018-04-15 11:17:07 +01:00
7e1832c8d5 Merge branch 'blender2.8' into hair_guides 2018-04-15 11:16:55 +01:00
c0c8df3f2c Initial system for generating guide curves from groom. 2018-04-15 09:30:15 +01:00
8fa55d3885 Popup for setting hair distribution operator properties. 2018-01-28 15:25:28 +00:00
471b410e43 Fix outdated usage of BLI_task_parallel_range. 2018-01-28 14:41:04 +00:00
9e56f6357f New operator for distributing hair follicles for a groom object. 2018-01-28 14:32:50 +00:00
49c19ca679 Merge branch 'blender2.8' into hair_guides 2018-01-28 13:18:10 +00:00
e15dd419d4 Depsgraph cleanup for groom curve cache eval. 2018-01-21 16:06:27 +00:00
4443f052f6 Operator for binding groom bundles to scalp regions. 2018-01-21 13:25:34 +00:00
57b3e8a137 Remove scalp binding from generic depsgraph groom updates, this should be an operator. 2018-01-21 12:49:23 +00:00
1e8139d912 Merge branch 'blender2.8' into hair_guides 2018-01-21 12:00:35 +00:00
95d8653c08 Disable rebinding during every update to prevent invalidating transform data. 2018-01-08 11:09:03 +00:00
7f2a7d97d6 Add back section edges drawing. 2018-01-08 10:57:10 +00:00
75f9c888f3 Calculate individual curves for each shape vertex.
This avoids overlap which happens on sharp turns when simply extending
the curve linearly from the center. It also simplifies the curve cache
data structure.
2018-01-08 10:47:17 +00:00
bbe8311948 Sparser edge drawing for grooms to reduce visual clutter. 2018-01-07 13:01:49 +00:00
3ee9d04db3 Shape binding for groom curves to the scalp mesh surface using face groups.
Face groups are used for now to define the origin of a groom bundle. This
is probably going to be replaced at some point with a dedicated surface
graph/mesh, but is much easier to implement and gives sufficient functionality.

When a face map is selected as the basis of a hair bundle it will update
the curve shape automatically. In the future this should perhaps be an
optional step (user operator) because it destructively changes existing
shapes.
2018-01-07 12:31:42 +00:00
1d26d50a46 Use existence of a bind value array instead of a flag to detect bound groom data. 2018-01-04 11:08:58 +00:00
22e7d5cbaf Validity flag in bundles to indicate when they are validly bound to the scalp.
This is updated through the depsgraph. Currently just checks for existing scalp
object and vertex groups, eventually will perform actual tracking of the mesh
surface to ensure the groom follows changes of the scalp mesh.
2018-01-04 09:40:56 +00:00
fb5d222217 Display the scalp vertex group as the main identifier of bundles in the list. 2018-01-04 09:14:29 +00:00
2228585912 RNA collection and UI list for groom bundles. 2018-01-04 08:57:12 +00:00
82b1143afa Merge branch 'blender2.8' into hair_guides 2018-01-03 13:17:06 +00:00
bf919ab830 Add missing context mode string for groom edit mode. 2018-01-03 13:13:10 +00:00
0206d49960 Static assert for correct strings from context mode enum.
Adding new context modes requires adding a string in CTX_data_mode_string,
but there is no error when omitting this other than panels using
incorrect contexts. The static assert should help detect simple
missing strings at least to avoid confusing errors.
2018-01-03 13:10:42 +00:00
dc34c0df3d Add missing switch break.
No effect so far for subsequent code.
2018-01-03 12:48:33 +00:00
36fac1e27c Merge branch 'blender2.8' into hair_guides 2018-01-03 10:24:05 +00:00
2a7dfcd927 Add missing editmode menu for groom objects. 2018-01-02 14:24:18 +00:00
be6965011b Use derivedFinal as scalp surface (for the time being).
Eventually DerivedMesh will be deprecated and Mesh used instead,
but until then the surface sampling algorithms use DerivedMesh.
2018-01-02 14:18:51 +00:00
8f46ae5ec9 New object pointer in groom ID to use as a "scalp" object for attaching hair. 2018-01-02 13:36:57 +00:00
359bef03df RNA and UI scripts for the hair system and draw settings in groom objects. 2018-01-02 12:54:36 +00:00
5ad90a874f Add a hair system in the groom ID block for creating renderable hairs. 2018-01-02 12:45:48 +00:00
5d17484d92 Fix transform recalc, 2D data only exists for section vertex transforms. 2018-01-02 12:44:25 +00:00
1d92d84bb1 Transform operator support for groom vertices. 2018-01-02 09:57:15 +00:00
ff381505fa Some tentative iterator macros for groom data. 2018-01-01 11:26:58 +00:00
a881edff7a Circle select implementation for groom objects. 2017-12-31 09:14:56 +00:00
a7f6ddba07 Box select implementation for groom objects. 2017-12-31 09:04:33 +00:00
160696a21d Lasso select implementation for groom object. 2017-12-31 08:59:42 +00:00
207d442496 Use a secondary cache for interpolated shape loops. 2017-12-30 15:20:17 +00:00
afdcd07b32 Mouse-picking operator for groom vertex selection. 2017-12-30 08:44:35 +00:00
71e731ef1e Curve cache for main groom bundle curves.
This stores interpolated cubic spline values for smooth curve rendering.
Local coordinate frames for sections are also computed alongside the cache.
2017-12-30 08:08:11 +00:00
ed27d3a398 Add UI script for groom data. 2017-12-30 08:03:34 +00:00
b3c4ee5266 Redraw notifier after changing groom edit sub-mode. 2017-12-27 11:04:49 +00:00
69bebcf8b5 Store section and vertex data in arrays instead of linked lists. 2017-12-25 16:20:44 +00:00
067c890b36 Simplify class name. 2017-12-25 15:30:41 +00:00
00dc4813c3 Vertex array for closed curves forming 2D groom sections. 2017-12-25 14:34:51 +00:00
1b971b0058 Depsgraph tag after adding new groom regions. 2017-12-25 11:22:53 +00:00
fe72fea762 Use the edit data for drawing when groom is in edit mode. 2017-12-25 11:18:45 +00:00
c673982b22 Select/Deselect all operator for groom vertices. 2017-12-25 10:29:02 +00:00
d1258f92f8 Use edit submode for groom overlay rendering. 2017-12-23 11:09:50 +00:00
c7414140a4 Sub-mode for groom editing, for editing different parts of the topology. 2017-12-22 14:41:41 +00:00
66f0df6907 Revert unused displist changes. 2017-12-22 12:40:14 +00:00
d70547b666 In object mode just draw simple wires for groom objects for now. 2017-12-22 11:17:33 +00:00
acfdf08ea2 Simple operator for adding a single groom curve in edit mode. 2017-12-22 11:02:08 +00:00
f70b6c96c5 Clean up after exiting groom object edit mode. 2017-12-21 11:17:59 +00:00
9660a2e2dd New draw engine for groom edit mode. 2017-12-21 11:08:53 +00:00
61fae8440d Edit mode data functions for creating, applying a freeing groom edit data. 2017-12-19 14:35:00 +00:00
b3c59d51e0 BKE_object_is_in_editmode case for groom object type. 2017-12-19 12:55:45 +00:00
da9fb8496c Proper freeing of groom data. 2017-12-19 12:01:37 +00:00
02ae16fd6e BoundBox recalc for groom. 2017-12-19 11:50:03 +00:00
e266d9d2b5 Serialization for groom internals. 2017-12-19 11:46:38 +00:00
5665c1b411 Stub edit data for groom. 2017-12-19 11:33:08 +00:00
5f41014a4c Stub displist function for groom. 2017-12-19 10:30:16 +00:00
1014b23cea Tentative DNA structs for groom internals. 2017-12-19 10:28:21 +00:00
f6c5948c5c Menu entries for adding groom objects in space_view3d. 2017-12-18 10:56:56 +00:00
6c28125efe Dummy icons for groom data. 2017-12-18 10:50:10 +00:00
eba518c040 Add groom data path to buttons context. 2017-12-18 10:25:53 +00:00
43e840b947 Merge branch 'blender2.8' into hair_guides 2017-12-18 10:19:01 +00:00
d2a75fb6dc Add basic outliner support for the groom object type. 2017-12-11 09:08:12 +00:00
3fbbef51c8 "add" operator for groom objects. 2017-12-10 12:46:11 +00:00
4e0d7349e8 writefile function for Groom. 2017-12-10 12:46:02 +00:00
56c3dbb656 Implement BKE_libblock_free_datablock for groom ID. 2017-12-10 11:52:23 +00:00
12200ce0b1 Add groom object id in a few more functions that need it. 2017-12-10 11:48:07 +00:00
91864d9bbe New RNA file for the groom ID. 2017-12-10 11:21:12 +00:00
e9a4bb925c Merge branch 'blender2.8' into hair_guides 2017-12-10 10:24:03 +00:00
7bdbc7e6f3 Add translation context and idcode entry for the new ID type. 2017-12-10 10:01:43 +00:00
7a8d3e623d Make sure MAX_LIBARRAY is large enough (also add a static assert for this). 2017-12-10 10:01:10 +00:00
047c05ed68 Add new Groom ID type to use for groom objects. 2017-12-10 09:42:45 +00:00
267f0e521e New OB_GROOM type for hair editing objects. 2017-12-07 08:37:35 +00:00
c53c6e99b3 Use material slot index instead of a direct Material pointer.
A Material pointer would be a nicer way to assign a hair material,
but unfortunately that does not work well with the context-based material
lookup of the node editor. There is no selection of an "active" modifier,
so the node editor will never display the material (unless it is placed
into a material stack as well).
2017-11-26 10:33:19 +00:00
56c1388ee4 Material pointer in hair systems. 2017-11-25 14:58:01 +00:00
5be3403a1d Simplified API for generating hair follicles with a fixed max count.
The final count is inversely proportional to the min_distance, so using that
as a user variable is difficult to control. Instead we just use the overall
count as the single variable now.

The actual final count will be less than this maximum count, because the
theoretical limit is never reached in practice. The min. distance could also
be stored as a result of the hair generation as feedback for the user.
2017-11-25 13:46:59 +00:00
08b8b4465d Merge branch 'blender2.8' into hair_guides 2017-11-25 11:17:08 +00:00
6855c5dab6 Fix strand vertex init loop, use correct stop index. 2017-11-25 10:49:51 +00:00
21c913f957 Need to call the subdiv function also for subdiv==0 to initialize vert positions. 2017-11-25 09:45:41 +00:00
2d24189369 Extend the fur generate modifier to also create guide curves. 2017-11-23 20:29:08 +00:00
f47f7383ce More meaningful flag names for hair system changes. 2017-11-23 08:55:55 +00:00
b4b07115cc Remove unused code, this has been replaced since. 2017-11-23 08:55:06 +00:00
cf3fce96b1 Fix for overflow of cell_index in the Poisson disk sample generator.
Using a single uint as combined cell index only leaves ~10 bits per
coordinate axis, which quickly leads to overflow for higher densities.
Now use 3 ints so that the sampling grid can have sufficiently small
cells.
2017-11-20 20:02:58 +00:00
ae84236ac3 Additional pass in object mode for drawing hair follicles and guide curves. 2017-11-19 17:23:49 +00:00
01968f95ed Merge branch 'blender2.8' into hair_guides 2017-11-19 10:56:04 +00:00
593fee0e7d Fix memleak from unfreed local array. 2017-11-19 10:05:17 +00:00
c6ddb6fdd9 Struct for hair draw settings.
This is outside of the hair system itself since it only affects drawing.
2017-11-19 10:00:59 +00:00
c8ef6904d1 Operator for generating hair follicles of the fur modifier. 2017-11-17 09:30:22 +00:00
a19f945476 Fix mesh sample inner loop for poisson disk generator, returned false always. 2017-11-17 08:58:49 +00:00
4276d302f6 Follicle generation function for hair systems. 2017-11-16 09:20:14 +00:00
d7ba494283 Rename "Hair" modifier to "Fur" modifier.
This will be a simple testbed for generating hair geometry.

The plan here is to use different modifiers for different editing methods
for hair. Each of these will use a HairSystem instance, but vary
in the editable data used to generate guide curves. The hair system
underneath is agnostic to the editing method used.
2017-11-15 08:40:51 +00:00
78428043d6 Remove the guide_object pointer from HairSystem.
Scalp mesh now is passed explicitly to the hair API functions again.

The idea is that hair systems can be created in any object and use
another object as the scalp. Sharing the same hair pattern should be
implemented at a later time, pending a good design for assigning
follicles to specific hair systems.
2017-11-14 09:12:24 +00:00
a5d69d81e8 Merge branch 'blender2.8' into hair_guides 2017-11-12 10:11:46 +00:00
b81ce32a59 Minor flag rename. 2017-11-12 10:10:28 +00:00
22c5c78c02 Free draw data when deleting a hair system. 2017-11-12 09:03:40 +00:00
a007de04b1 Remove deprecated UI code for the hair modifier. 2017-11-11 16:21:29 +00:00
cf11953996 Fix null pointer reads when there are no hair follicles (which is allowed). 2017-11-11 16:18:05 +00:00
e421ba7144 Parent indices and weights for hair follicles and a binding function. 2017-11-11 15:57:31 +00:00
1ddbde24ff Add fields for curve storage in hair systems and use it in draw code. 2017-11-11 14:13:47 +00:00
2d4694678a Implementation for BKE_hair_get_scalp. 2017-11-11 09:51:08 +00:00
45f30a9fdb Restructure the hair modifier so external tools define guide curves. 2017-11-10 09:31:42 +00:00
3aab7537e8 Remove the new hair edit mode.
The purpose of this branch is to create a new hair system with a dedicated
grooming tool, unlike the current direct editing of hair guide curves.

The modified bmesh-based strand edit mode is quite complex and distracts
from the main purpose of the branch, so its better to remove it for now
and implement a new tool.
2017-11-09 19:22:42 +00:00
9f74b66ab7 Merge branch 'blender2.8' into hair_guides 2017-11-09 08:12:04 +00:00
5e1888965b DNA data for explicitly storing hair guide curves.
The idea is to separate guide curves from the various methods of
generating them. Guides could be created explicitly (as hair
strands), or automatically from vertices or external mesh data.

A guide then forms the basis for interpolating the render data
(fibers).
2017-09-10 09:07:26 +01:00
fb7c003e99 Simple CSV mesh loading for tests.
File paths are crude and preliminary.
2017-08-28 08:21:57 +01:00
caded470a6 Fix neighbor conflict checks for Poisson disk distribution.
The cell size is chosen as r/sqrt(3) (i.e. max. 1 sample per cell),
which means that the influence of each cell extends beyond the 1st
neighbor. a 5x5x5 box (except the center and corners) needs to be
examined to find collisions.
2017-08-26 15:32:09 +01:00
d9a4945bb2 Added a 1-cell margin to the grid dimensions to simplify neighbor lookups. 2017-08-26 12:41:58 +01:00
188874af2f Separate step for mesh sample generators to bind them to a specific mesh. 2017-08-26 12:13:52 +01:00
e3033693f9 Initial implementation of Poisson disk sampling on meshes.
This is still buggy (uneven sample coverage) and needs changes to the
sampling system for better threading support.

The implementation is based on

Bowers, John, et al. "Parallel Poisson disk sampling with spectrum analysis on surfaces." ACM Transactions on Graphics (TOG). Vol. 29. No. 6. ACM, 2010.
2017-08-25 09:19:49 +01:00
ef67e13bdb Thread-safe implementation of the volume bounding-box raycast sampler. 2017-08-23 09:44:00 +01:00
9e8a41aadf Include other sample generators in tests.
Volume bbray method is currently excluded because the implementation
is not yet thread-safe.
2017-08-23 09:07:45 +01:00
8b607d77e5 New gtests for the mesh sampling system.
This should test general functionality and consistency of different methods
for generating samples. In particular it shoud ensure that threaded variants
produce the same samples as unthreaded variants when using the same generator
and seeds.
2017-08-22 18:49:01 +01:00
0d4fa23414 Use a consistent number of RNG steps in both sample generation and skipping.
This is to ensure that threaded generator usage creates the exact same results
as the non-threaded base version. Further improvements and testing will be
needed.
2017-08-21 06:42:59 +01:00
e3b80d6202 Multithreading support for the mesh sampling library.
Samples can be generated either one-by-one using the existing "make_sample"
function (which uses a default context), or use the more efficient batch
generation functions. These optionally support threading via the task scheduler
now.
2017-08-20 18:50:58 +01:00
ead00baab1 Fix hair follicle array write/read. 2017-08-19 12:26:02 +01:00
45f0f3dc04 Merge branch 'blender2.8' into strand_editmode 2017-08-19 12:02:03 +01:00
0d67f8d5c4 Removed unused shaders in the draw modes module. 2017-08-19 08:56:04 +01:00
438b3f95a1 Implement control strands generation for basic hair types along surface normals.
The default hair group type uses vertex normals to generate guide strands automatically.
2017-08-18 16:13:34 +01:00
1b837226ce Store the scalp mesh as part of the hair drawing interface.
The scalp mesh is always needed for evaluating root positions anyway.
2017-08-14 08:46:10 +01:00
6faa4d77c1 Removed fiber drawing from the strand edit mode to simplify code.
For rendering hair fibers the edit mode should just use the underlying data.
2017-08-14 08:19:54 +01:00
b0717ad91e Hair drawing data based on the new DNA hair groups. 2017-08-14 07:58:02 +01:00
91fd0a487d Store pointer into the hair follicle array in hair groups directly.
This creates a dependency of the hair groups on the validity of the pattern,
so care has to be taken to always update the groups when the pattern changes.
2017-08-11 08:57:04 +01:00
e7df5f8528 Split off hair drawing code into a separate file. 2017-08-11 08:17:03 +01:00
6fa838f6d3 List of 'Hair Groups' in hair patterns that will generate actual fibers for rendering.
Each group affects a subset of the hair follicles, so that multiple effects can be combined
without overlapping sample sets.
2017-08-07 18:04:30 +01:00
41e8bd9337 Merge branch 'blender2.8' of git.blender.org:blender into strand_editmode 2017-08-07 13:06:02 +01:00
77802b21a6 Operator for generating a hair follicle distribution. 2017-08-07 12:29:12 +01:00
8abe6745a4 DNA data + modifier for storing persistent hair data.
This stores basic hair follicle data, rather than full fiber caches
(which should only be generated for render data).

Note that deformation by strands will just be one possible way to generate
hair fibers, so strands should be kept separate from the hair follicle data somewhat.
2017-08-07 10:54:02 +01:00
53eb011e3d Prototype hair deformers for generated detail like clumping and curling.
Currently only clumping and curls are implemented. There is no proper input
for the parameters yet, these are just hardcoded atm. Eventually the hair system
should either define uniform values from hair system settings or enable per-fiber
values using a material or other node-based input.
2017-08-06 12:41:16 +01:00
801c20cebc Some optional timing for strand data buffer construction. 2017-08-04 08:41:20 +01:00
9feec51214 Subdivision of hair fibers for smoother shading.
Subdivision works on the parent strands for efficiency. The fibers lengths
are based on the final subdivided length of parents, so no changes to the
shader are required.

This would be nicer with a tesselation shader, but this feature is not
available in Blender 2.8.
2017-08-03 20:27:33 +01:00
e34ba9fb7a Use a 2D texture for the hair interpolation data instead of 1D for larger number of hairs.
It turns out that 1D textures have the same size limit on their 1 axis as 2D textures.
This limits the potential number of hair dramatically, even though the actual size of
the texture is very small. Using a 2D texture and wrapping the index avoids this problem.
2017-08-03 08:11:48 +01:00
c92457a87a Default settings for hair edit mode tool settings. 2017-08-02 22:35:57 +01:00
bf0f058954 Disable selection outline drawing on the object during hair edit mode. 2017-08-02 22:28:25 +01:00
e35f24fb28 Removed leftover hair fiber code from edit mode drawing (all in Eevee now). 2017-08-02 21:54:01 +01:00
e8ff620325 Moved the hair fiber shader from strand edit mode into Eevee.
This allows the shader to use proper lighting from the standard Eevee shaders.

The code for interpolating hair strands is in a glsl library file to facilitate
use in other engines later.
2017-08-02 21:40:52 +01:00
3a438c675f Hair fiber (child hair) drawing during edit mode, with heavy GPU leveraging.
Hair drawing requires fairly large vertex buffers. Vertices also need to be interpolated
and displaced according to the control (parent) hairs and hair-style features like curling
and clumping.

Instead of doing this in advance on the CPU and uploading a large vertex buffer every frame,
this work can be done on the GPU for realtime display, because interpolation and displacement
are highly parallelizable. The vertex buffers then only need to be uploaded once (as long
as strand lengths remain the same). The vertex format can also be very lightweight, requiring
only a curve parameter and index (half the size needed for full positions).

For interpolating a buffer texture is used in the shader, which contains all information
about the control curves (parents) from which to interpolate final vertex positions.
2017-08-01 08:10:05 +01:00
57cbaa15b6 Custom shaders for drawing strand selection. 2017-07-23 08:32:29 +01:00
679113fbd5 Basic drawing code for hair edit mode in the new 2.8 draw engine system. 2017-07-22 12:35:40 +01:00
65d2374c80 Merge branch 'blender2.8' into strand_editmode2.8 2017-07-16 11:48:39 +01:00
d3349e5e3f Merge branch 'master' into strand_editmode 2016-08-09 15:52:02 +02:00
5a7efaf287 Added "show_brush" option for hair edit settings, expected by common paint UI.
This setting has no effect yet for hair editing, but the UI script expects it.
2016-07-27 09:50:45 +02:00
f3bc942370 Merge branch 'master' into strand_editmode 2016-07-25 09:33:48 +02:00
07cffae7ea Fix for uninitialized v_mirr variable when using edge strokes with mirroring. 2016-07-20 09:44:39 +02:00
1b431c3cfe Merge branch 'master' into strand_editmode 2016-07-19 11:42:52 +02:00
dd1211ecb8 Merge branch 'master' into strand_editmode 2016-07-19 10:32:23 +02:00
1d28579daf Merge branch 'mesh_samples' into strand_editmode 2016-07-14 09:59:52 +02:00
48fc8b76b2 Merge branch 'master' into strand_editmode 2016-07-14 09:57:38 +02:00
bd4ca21b54 Merge branch 'master' into mesh_samples 2016-07-14 09:56:58 +02:00
28270f0953 Replace the deprecated TessFace usage for mesh sampling by LoopTri.
Also make sure a valid generator instance for random sampling is always
returned, regardless of triangle counts.
2016-07-14 09:55:18 +02:00
2f596756b7 Merge branch 'master' into strand_editmode 2016-07-13 16:50:23 +02:00
56ad4520cd Merge branch 'master' into strand_editmode 2016-07-09 09:09:47 +02:00
4e95617769 Merge branch 'master' into strand_editmode 2016-07-05 09:53:24 +02:00
548dfdbd31 Merge branch 'master' into mesh_samples 2016-06-28 11:17:44 +02:00
73140ca283 Merge branch 'master' into strand_editmode 2016-06-27 10:52:10 +02:00
32455e230a Fix unused function warning. 2016-04-20 12:34:04 +02:00
af594b7b85 Fix meamleak from unfreed edit data when exiting in hair edit mode. 2016-04-19 14:19:54 +02:00
5f67ac83bf Fix unfreed temporary buffers in strand relaxation. 2016-04-19 14:05:35 +02:00
b2cb4c448e Define BMEditStrands struct as an extension of BMEditMesh.
The advantage is that we can now use this struct in the (rather involved)
process of generating a display DerivedMesh and apply modifiers to it.
2016-04-19 14:01:41 +02:00
216aacbcba Disable regular mesh drawing in hair edit mode. 2016-04-19 13:27:20 +02:00
ec51e83798 Proof-of-concept: Hair edit data from regular meshes.
This adds the possibility to edit a regular mesh like strand data.
It's more of a test for independence from particles than a real use case,
but could come in handy anyway.
2016-04-18 18:13:26 +02:00
9a20f68295 Check mesh samples for zero weights on eval to detect invalid/unusable samples. 2016-04-18 17:48:25 +02:00
a85c9b241a Corrected implementation of the strand relaxation method ported from particles.
This is still the same algorithm as in particle edit mode, but cleaned up
some unnecessary complications and use much more meaningful variable names.
2016-04-17 15:08:46 +02:00
07221e980b Merge branch 'master' into strand_editmode 2016-04-16 18:10:37 +02:00
56d8228713 Merge branch 'master' into mesh_samples 2015-10-11 15:51:07 +02:00
892529029f Port over the improved mesh sampling API from the mesh_samples branch. 2015-09-19 17:33:37 +02:00
d820eb1265 Merge branch 'master' into mesh_samples 2015-09-19 16:59:26 +02:00
3aaca08aad Merge branch 'master' into strand_editmode
Conflicts:
	source/blender/editors/sculpt_paint/paint_ops.c
2015-09-19 16:29:04 +02:00
5f6d9e301e Implementation of Volume Sampling on meshes.
Based on the ray casting technique described here: http://www.joesfer.com/?p=84

Volume samples currently are not bound to mesh deformation in any way, they are
simple object-space locations. Potentially a harmonic weight approach as in
mesh cages could be used.
2015-08-21 16:45:36 +02:00
05281abca1 Merge branch 'master' into mesh_samples
Conflicts:
	release/datafiles/locale
	release/scripts/addons
	source/blender/blenkernel/CMakeLists.txt
2015-08-21 15:07:47 +02:00
38d9301674 Another fix for mirror editing of strand data.
Currently strand edit mode tool use the object data 'x mirror' flag.
This flag is only available on mesh objects, but the strand editing
can be used for dupli override caches etc. as well. Eventually strand
editing should get it's own independent flag to avoid this problem.
2015-05-05 14:27:44 +02:00
fbc70fa51c Fix for call to mirror functions when mirroring is not enabled, giving
warnings.
2015-05-05 14:03:59 +02:00
d52bdb6d3d Moved particle related functions of the strands edit mode into a
separate file.

This may seem a bit like overkill, but it helps ensure that no particle
depedencies messes up the strand editing code. The same will be done for
other use cases of the strand editing code in the future.
2015-05-04 18:37:45 +02:00
16b6d6c676 Added missing CD layer type name for MSurfaceSample. 2015-05-04 17:52:13 +02:00
bf7e8b42fa Merge branch 'master' into strand_editmode
Conflicts:
	source/blender/bmesh/bmesh_class.h
	source/blender/bmesh/intern/bmesh_mesh_conv.h
2015-05-04 17:14:25 +02:00
20e960215a Particle shapekey code is only in the gooseberry branch, disabled here. 2015-04-20 12:59:01 +02:00
9cafd3ae56 SimDebugData is now global, for easier usage and less intrusive code. 2015-04-20 12:58:16 +02:00
0dccffb7aa Fix for CustomDataType syntax error from merging. 2015-04-20 12:37:21 +02:00
7719a6365a Use the X mirror option in new strand edit stroke brush tools.
Note that currently this has virtually no effect, because the mirror
option relies on exact positions of vertices, which does not happen with
random hair placement (the add brush has no mirror option yet).

Eventually topological mirroring should help with this case, but is not
implemented for either old or new strand edit yet.
2015-04-20 12:25:18 +02:00
3a3327dcd5 Cleanup: rename function argument for consistency. 2015-04-20 12:25:18 +02:00
8ffcd1f434 Utility methods for mirrored strand editing.
These are a modified version of their BMEditMesh counterparts.

use_topology is not yet implemented for strands. Native strand topology
is not very useful for this. Instead, the topology of the scalp mesh
should be used for finding mirrored strand roots, then the arc- or
parametric length of a vertex from the root to find mirrored verts.

Conflicts:
	source/blender/blenkernel/BKE_editstrands.h
2015-04-20 12:25:15 +02:00
ed1dc43657 Fix for strands undo creating an invalid BMesh.
When copying mesh data to bmesh the MVERT and similar customdata types
have to be omitted. Otherwise the bmesh instance ends up with NULL
pointers in customdata layers, but entries in the typemap != -1. The
effect was that when storing new steps after one or more undo, the
resulting original data would be copied, and subsequent undo steps
are ignored.
2015-04-20 12:24:34 +02:00
5b9b779cab Minor code reshuffling. 2015-04-20 12:24:34 +02:00
4798464e8b Extended Mesh <-> BMesh copy function versions for specifying custom
data masks explicitly.

A dummy mesh is used for strand edit undo storage like in mesh edit
to prevent unnecessary code duplication. However, when copying from/to
BMesh only the mesh data layers are copied by default, omitting the new
data layers for strands (currently only MSurfaceSample hair root data).
2015-04-20 12:24:33 +02:00
299859e40b Sanity check: if there is no edited/active object for an undo step,
consider it invalid and clean up.
2015-04-20 12:24:33 +02:00
5e42aff397 Basic undo support in the new strand edit mode.
This uses the generalized undo stack system which is also used for
object data edit. An extension is necessary to tell the undo functions
which object is specifically used for generating undo data and
identifying the stack, since strand editing does not edit the obdata
itself.
2015-04-20 12:24:33 +02:00
3f539c987f Removed deprecated UI button for the hair debug flag. 2015-04-20 12:24:33 +02:00
6146b90312 Select Linked operator for hair edit mode (select all vertices of a
strand).
2015-04-20 12:24:03 +02:00
8b2ec99f57 Lasso Select operator for hair edit mode. 2015-04-20 12:24:03 +02:00
410998cdc6 Border Select operator for hair edit mode. 2015-04-20 12:24:03 +02:00
b6f4e0932d Mouse Select operator for hair edit mode. 2015-04-20 12:24:03 +02:00
62fa5c4a84 Select/Deselect All operator for hair edit mode. 2015-04-20 12:24:03 +02:00
2cddc3cda8 Disabled the partial IK strand relaxation for the time being.
First goal is to reproduce current particle edit tools in the strand
edit mode, then make improvements.
2015-04-20 12:24:03 +02:00
9120df6cb3 Missing bmesh include path in scons files. 2015-04-20 12:24:02 +02:00
48a86af388 IK solver for hair strands that provides a better solution for keeping
consistent segment lengths when transforming vertices.

Warning: The implementation is not correct yet, but all the steps should
be there.

The main idea is to treat strands as a sequence of joints that are
displaced out of their original locations by a transform or other tool.
The solver then tries to find a global per-strand solution that keeps
the segment lengths unmodified, with a minimum change in angles from
the original starting shape. Such a solution is much more usable and
efficient than the current O(n^2) attempt of "spreading the error"
across the strand.

The inverse kinematics method is very flexible. It can also include
stretching, which would be very welcome for features like the length
tool. Different parts of the strand could be weighted separately using
scaling factors for the angle/stretch parameters.

Conflicts:
	source/blender/physics/intern/implicit.h
2015-04-20 12:24:00 +02:00
eacc24ccf1 Ported over the relaxation method for hair vertices from particle edit
mode.

This method is simple, but not really very usable. It works by
successively relaxing segments that are too long or too short, moving
both vertices along the edge between them. This is repeated N^2 times
(N: number of vertices on the strand).

A true IK solver could give a lot better results, as well as providing
many opportunities to apply weighting for targets (e.g. preferring to
move non-selected over selected vertices). Many different methods for
simple IK solvers exist, so there should be one that works well for
large number of simple strands. See e.g.
http://www.math.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf
2015-04-20 12:23:49 +02:00
ac54ded29b Primitive transform operator support for strand vertices.
This does not yet prevent root transforms and/or length changes.
2015-04-20 12:23:49 +02:00
f7511b3d01 Improved hair combing tool, adjusting edge directions instead of
vertex positions.

This works a lot better with strokes perpendicular to the general hair
strand direction. With the previous comb tool such strokes would only
make a small dent in the hair curve and then vertices would slip out
of the tool circle. The edge combing affects the local direction of
strands, which acts as a kind of grabbing functionality by moving
further vertices in front of the tool circle. The result is that
drawing a curvy hair shape with the comb becomes much easier.

In addition, the new tool also uses edge filtering and weighting rather
than vertices. This means that small brushes also work well, instead
of having no effect when hitting the edge segments between vertices.

Further improvement could be achieved later by using a global strand
solver, which adjusts vertex positions based on an error metric along
the whole of the strand.
2015-04-20 12:23:48 +02:00
208ddcde2c Use a simple low-pass filter to generate a smoother, more stable
direction vector for the hair stroke tool.

This is necessary for directional tools such as combing, where the
stroke direction can lead to unwanted results if it changes too
abruptly.
2015-04-20 12:23:48 +02:00
f3b22c5769 Support for sim_debug drawing in hair edit mode (dev feature). 2015-04-20 12:23:48 +02:00
b70c815ac2 Renamed the edithair files in BKE to editstrands.
The rationale behind this is that the BKE code could be used for
modeling hair and fur as well as a number of other features such as
grass. The primary addition to BMesh is the limitation to strand-like
topology (simple vertex chains, optionally rooted on a mesh surface).

The editor code OTOH is quite hair specific, since the result should
be suitable for hair simulation, and the workflow should mimick actual
hair grooming intuitively. Eventually the hair edit mode could become
a generalized strand edit mode with slightly different tool sets for
various purposes, but for now it is quite specifically built for hair.

Conflicts:
	source/blender/blenkernel/CMakeLists.txt
	source/blender/blenkernel/intern/particle.c
2015-04-20 12:23:46 +02:00
d0a1fc8bb0 Sanity check for strand root/tip checks, now supports single vertices. 2015-04-20 12:23:23 +02:00
2d1d909817 MSVC compiler cannot handle standard C code.
Conflicts:
	source/blender/editors/physics/particle_edit.c
2015-04-20 12:23:20 +02:00
e9737da5f2 Fix scons build files for new hair edit code parts. 2015-04-20 12:23:16 +02:00
1e047231c6 Fix for hair-to-particle export: need to set weight=1.0 for hair roots,
since the particle system uses this for pinning them to the mesh.
2015-04-20 12:23:16 +02:00
142ef0b2e9 Fixed lib-linking for hair edit settings brush and object pointers. 2015-04-20 12:23:15 +02:00
56a09434c5 Basic Add tool for creating new strands in hair edit mode. 2015-04-20 12:23:15 +02:00
8672304e30 Fix for uninitialized return value. 2015-04-20 12:23:15 +02:00
f95dde244e Better feedback about valid sample from mesh sampling methods.
Conflicts:
	source/blender/editors/object/object_shapekey.c
2015-04-20 12:23:15 +02:00
79e649a3bf New simple storage method for single sample values. 2015-04-20 12:23:15 +02:00
e5b25e3c07 Generic raycast method for generating mesh surface samples.
Conflicts:
	source/blender/blenkernel/intern/mesh_sample.c
2015-04-20 12:23:15 +02:00
a4664ef88d New mesh sample evaluation function for shape key data. 2015-04-20 12:23:15 +02:00
be312b1399 First selection operator implementation for hair edit: circle select. 2015-04-20 12:23:14 +02:00
3edc512888 Show selection state of hair vertices with the usual theme colors. 2015-04-20 12:23:14 +02:00
b2ea8c1022 Added back different selection modes (strands, verts, tips) for hair
editing.
2015-04-20 12:23:14 +02:00
339a8b7521 Fix for OpenlGL state restoration after strand drawing, disable color
material option.
2015-04-20 12:23:14 +02:00
77da317cb1 Apply the same weight profile in the comb tool as in particle edit mode.
The comb tool will likely get a complete overhaul, but until then it
should just behave like the old tool.
2015-04-20 12:23:14 +02:00
2c0616b034 Support for common operators, keymap entries and radial controls for
hair brush settings.
2015-04-20 12:23:14 +02:00
a9fbd3b23b Fix for brush radius, the Brush.size property is actually the radius and
not the diameter.
2015-04-20 12:23:14 +02:00
687b5a1ec0 Implemented basic cursor drawing for hair edit mode brushes. 2015-04-20 12:23:13 +02:00
59efe23830 Primitive hair lighting in OpenGL solid shading, cleanup of strands
drawing code for edit mode.

The lighting uses the same method as the particle hair, interpreting
strand direction as the normal. This is nowhere near realistic hair
shading, but doing this with line shading alone in the fixed-function
pipeline is probably not possible. A GLSL shader could be used instead
for a more realistic alternative as part of the viewport project. At
least this simple shading mode gives some orientation feedback while
editing hair.
2015-04-20 12:23:13 +02:00
d16599ea04 Display basic brush properties in the toolbar for hair edit mode. 2015-04-20 12:23:13 +02:00
37d3a3331e Use the "official" brush size calculated by blenkernel and subdivide
the stroke step to avoid tunneling.
2015-04-20 12:23:13 +02:00
5254df30ba Filter affected hair vertices in edit mode based on the brush size and
z depth.
2015-04-20 12:23:13 +02:00
2590231315 Constrain hair root vertices to their mesh location after applying tools.
Conflicts:
	source/blender/bmesh/intern/bmesh_interp.c
	source/blender/bmesh/intern/bmesh_interp.h
2015-04-20 12:23:11 +02:00
83b20c7ddf Enforce hair constraints (constant segment length) after applying a tool.
Currently uses the same approach as old particle edit mode (rescale
hair segments from the root on). A more sophisticated approach using
least-square error minimization of the displacement could yield better
results.
2015-04-20 12:22:10 +02:00
0e06a60168 Make sure tool input data is in object space. 2015-04-20 12:22:10 +02:00
121677d7c8 Nicer vector math for mouse coordinates. 2015-04-20 12:22:10 +02:00
1615da133f Simplified first version of the hair stroke combing functionality.
Stroke tools will be categorized by the hair elements they operate on:
vertices, segments or strands (roots). In addition to that a filter
function defines the influence of the brush. This should be defined by
the other brush settings and be largely independent of the main tool
mode.
2015-04-20 12:22:10 +02:00
7ae6492c85 Lots of small fixes for paint system quirks to make hair brushes work
in the UI.

Conflicts:
	release/scripts/startup/bl_ui/space_view3d.py
	source/blender/editors/transform/manipulator_widget.c
2015-04-20 12:21:58 +02:00
7779166313 Define hair edit settings and brush types in the RNA, similar to paint
and sculpt settings.

Conflicts:
	source/blender/makesdna/DNA_brush_types.h
2015-04-20 12:19:28 +02:00
833a11f891 New image file icons for hair brush tools and an according tool enum in
the Brush RNA.
2015-04-20 12:17:16 +02:00
79959152e6 Calculate some basic info about mouse strokes and context and pass it
on to a general hair tool function.
2015-04-20 12:17:16 +02:00
4fd6a7a696 Revert previous hair edit operator scaffolding and port over the old
operator for strokes instead.

The paint system is much too complicated and does not add any real
advantage at this point.
2015-04-20 12:17:16 +02:00
98b15d9a7c Copied high-level operator code from the paint/sculpt system as a basis
for brush-stroke operators in hair edit mode.

Hopefully this can help avoid some redundant code and ensure consistent
keymapping etc.
2015-04-20 12:17:16 +02:00
a889a1458c Missing bmesh include folder for hair editor in scons. 2015-04-20 12:17:16 +02:00
7b6332f634 Apply the hair matrices when converting from particle keys to bmesh,
so the edit data is consistently in object space.
2015-04-20 12:17:16 +02:00
0a27e97fb7 Fix for GL buffer size for edges, needs to 2x for two vertex indices. 2015-04-20 12:17:16 +02:00
eb5257002b New drawing code for hair edit mode.
Conflicts:
	source/blender/editors/space_view3d/drawobject.c
	source/blender/editors/space_view3d/view3d_intern.h
2015-04-20 12:17:14 +02:00
23b284348b Removed deprecated code. 2015-04-20 12:15:17 +02:00
2d79994e39 Free strand edit memory after use. 2015-04-20 12:15:17 +02:00
fd34e3efbc Fix for verts-of-strand iterator: This requires a second pointer in
addition to the edge, otherwise the last point is omitted.
2015-04-20 12:15:17 +02:00
dc43df89cd CustomData layer for storing hair root locations as MSurfaceSamples.
This requires converting the old messy particle num/num_dmcache/fuv/foffset
data into the new mesh samples, which can potentially introduce floating
point errors and inaccuracies due to lack of face index mapping in the
new system. However, in any well-constructed particle system the hair
roots should be nearest to their num face, so mapping would be accurate
enough. If necessary face index data could be added to samples as a
legacy code hack, but probably it's best to eventually replace the
hair system as a whole anyway.
2015-04-20 12:15:17 +02:00
4e47239de2 Store the hair key weight in edit mode.
Currently particles only have a single weight value, controlling
pinning in the simulation (for root and virtual root verts) and goal
force scaling. This will be replaced by a full vertex group weight
system eventually.
2015-04-20 12:15:17 +02:00
991ee8a570 First customdata layer for particle mass.
This is more for testing purposes, since currently there is only a
single mass property for the psys as a whole. This should change in the
future though, to allow variable mass per strand or vertex.

Conflicts:
	source/blender/bmesh/intern/bmesh_interp.c
2015-04-20 12:15:15 +02:00
e43ef55e7f Basic particle data reconstruction when exiting edit mode. 2015-04-20 12:14:34 +02:00
1afd5be044 Fix for verts-of-strand iterator: After last edge step has to set the
edge to NULL to avoid infinite looping over the same edge (1-elem disk).
2015-04-20 12:14:34 +02:00
d550a29558 Fix for particle-to-bmesh: only was looping over totvert instead of
pa->totkey.
2015-04-20 12:14:34 +02:00
5f44f4a2ff Intermediate commit: switching strand edit data to BMesh.
Hair/Strand editing will only use a subset of the bmesh topology and
expect a specific topology that needs to be verified and enforced.
However, this extra requirement is much less work than reimplementing a
whole edit data system with the same feature set as bmesh and avoids
much redundant code.

Conflicts:
	source/blender/blenkernel/intern/customdata.c
	source/blender/makesdna/DNA_customdata_types.h
2015-04-20 12:14:30 +02:00
b0a9e48a19 New customdata type for mesh surface samples.
Conflicts:
	source/blender/makesdna/DNA_customdata_types.h
2015-04-20 12:14:23 +02:00
afb947c00c Switched the hair edit data to a bmesh-like structure for consistency.
This means using mempools to store curve and vertex data, which allows
arbitrary addition and removal of data more easily. Also this includes
an iterator system similar to bmesh iterators (although the simpler
topology makes it a lot less complex).

Conflicts:
	source/blender/blenkernel/intern/customdata.c
	source/blender/makesdna/DNA_customdata_types.h
2015-04-20 12:13:35 +02:00
f1e4d35489 Reconstruct most basic particle data when applying the hair edit, so
particle hairs remain visible.

Note that currently the hair root location (num/num_dmcache, fuv, foffset)
is not stored from edit data, so all hairs end up in a default location.
2015-04-20 12:12:01 +02:00
1c7053f7a0 Store hair edit data in particle systems and manage it in the operator
for entering/exiting the edit mode.

Conflicts:
	source/blender/blenkernel/intern/particle.c
2015-04-20 12:11:59 +02:00
7bb90a06e1 Moved code for the hair edit data structures to blenkernel.
This makes it work more like editmesh, and avoid the awkward and
basically bad-level approach in particles, where the edit data is an
anonymous pointer in particle systems together with a callback for
freeing.

Conflicts:
	source/blender/blenkernel/CMakeLists.txt
2015-04-20 12:11:44 +02:00
a9001adbb4 New edit mode for hair.
Conflicts:
	source/blender/blenloader/intern/readfile.c
2015-04-20 12:11:05 +02:00
dd69a3dbcf Finished the particle-to-edit conversion function. 2015-04-20 12:10:33 +02:00
c65f1b2e15 More work on particle conversion methods for hair edit mode. 2015-04-20 12:10:33 +02:00
09a7dbc29a New editor library for hair edit mode. 2015-04-20 12:10:33 +02:00
6078e79cea Minor syntax fix. 2015-04-20 12:10:33 +02:00
6783b15453 Shifted the dispatch from the algorithm side to the storage side of the
sampling system to keep the code simple.

Now there is a MSurfaceSampleStorage struct that encodes the storage
details, which the algorithms don't have to care about.
2015-04-20 12:10:33 +02:00
82132fc5b0 Added generalized method for creating an array of mesh samples with
arbitrary stride.
2015-04-20 12:10:32 +02:00
4b4f24607e Changed mesh sample definition to use 3 vertex weights instead of a
face index. This is easier to sample uniformly and avoids the need for
tesselation for evaluating.
2015-04-20 12:10:32 +02:00
fe48c353f1 Normalize the normal vector after sample eval to account for
interpolation.
2015-04-20 12:10:32 +02:00
308af3bfb3 Added a bool return to the eval function to give feedback on invalid
samples.
2015-04-20 12:10:32 +02:00
3f7d66ece4 Added a basic RNA definition for the mesh sampling system. 2015-04-20 12:10:32 +02:00
a952800ffc Eval function to get a location and normal vector from mesh samples. 2015-04-20 12:10:32 +02:00
71e34dad2b Usable random distribution algorithm.
Does not include area weighting yet.
2015-04-20 12:10:32 +02:00
24b77359ae Skeleton code for sampling meshes.
Conflicts:
	source/blender/blenkernel/CMakeLists.txt
2015-04-20 12:10:29 +02:00
62aabdd550 Merge remote-tracking branch 'github_lukastoenne/mesh_samples' into mesh_samples 2014-12-05 12:17:53 +01:00
2204bb092b Merge branch 'master' into mesh_samples 2014-12-05 11:23:38 +01:00
8374e08894 Mesh sampling system for unified point-on-mesh handling.
This code is not yet used by any feature in master, but has proved very useful in the Gooseberry branch and several WIP patches. Inclusion into master was requested to avoid diverging code in branches and get part of the Gooseberry code merged early on.

The core idea is to have a common way of identifying points on mesh surfaces. Efficient evaluation of such points after deformation and mappable modifiers (e.g. subdivision) tracks positions, normals and other surface attributes. This is used extensively in the particle/hair systems and could be useful for certain tools, duplicators, etc.. Currently the particle systems in particular are very fragile and succeptible to mesh changes because of the unreliable way mesh surface mapping is stored. While the new system at this point uses essentially the same method, it at least provides a centralized DNA type that can be improved easily without too much effort and compatiblity issues.

In addition to evaluating surface samples the system also provides a central place to implement surface sampling algorithms, such as random sampling, ray casting, paint-like tools, etc.

Differential Revision: https://developer.blender.org/D922
2014-12-01 15:10:16 +01:00
822949a3e2 Fix for uninitialized return value. 2014-12-01 14:42:18 +01:00
a86869af8f Better feedback about valid sample from mesh sampling methods.
Conflicts:
	source/blender/editors/object/object_shapekey.c
2014-12-01 14:41:02 +01:00
ca31ce144e New simple storage method for single sample values. 2014-12-01 14:38:03 +01:00
f61f7e2d57 Generic raycast method for generating mesh surface samples. 2014-12-01 14:36:10 +01:00
3036cedd90 New mesh sample evaluation function for shape key data. 2014-12-01 14:34:59 +01:00
cc5b3c2ff7 Merge branch 'mesh_samples' of github.com:lukastoenne/blender into mesh_samples 2014-12-01 14:29:41 +01:00
a30f9ffa87 Merge branch 'master' into mesh_samples
Conflicts:
	release/datafiles/locale
	release/scripts/addons
2014-12-01 14:29:09 +01:00
3361788b1c Merge branch 'master' into mesh_samples
Conflicts:
	release/datafiles/locale
	release/scripts/addons
2014-11-30 10:08:09 +01:00
21ab9ac9e3 Minor syntax fix. 2014-09-24 17:35:41 +02:00
18c6bb2436 Shifted the dispatch from the algorithm side to the storage side of the
sampling system to keep the code simple.

Now there is a MSurfaceSampleStorage struct that encodes the storage
details, which the algorithms don't have to care about.
2014-09-24 17:04:41 +02:00
a93841e3d4 Added generalized method for creating an array of mesh samples with
arbitrary stride.
2014-09-24 15:58:53 +02:00
728b6ed8e6 Merge branch 'master' into mesh_samples 2014-09-24 15:54:21 +02:00
fa0163b8c7 Changed mesh sample definition to use 3 vertex weights instead of a
face index. This is easier to sample uniformly and avoids the need for
tesselation for evaluating.
2014-03-04 15:39:48 +01:00
7112a531b2 Normalize the normal vector after sample eval to account for
interpolation.
2014-03-04 13:42:51 +01:00
60cde6ca4a Added a bool return to the eval function to give feedback on invalid
samples.
2014-03-04 13:42:06 +01:00
717db95210 Added a basic RNA definition for the mesh sampling system. 2014-03-03 17:57:56 +01:00
a944cf8450 Eval function to get a location and normal vector from mesh samples. 2014-03-03 14:10:58 +01:00
a1dd14c764 Usable random distribution algorithm.
Does not include area weighting yet.
2014-03-03 12:36:02 +01:00
47d024c2b0 Merge branch 'master' into mesh_samples 2014-03-03 11:56:02 +01:00
30e02b9a19 Skeleton code for sampling meshes. 2014-03-03 10:59:36 +01:00
7094 changed files with 1463344 additions and 1383840 deletions

View File

@@ -1,7 +1,7 @@
{
"project_id" : "Blender",
"conduit_uri" : "https://developer.blender.org/",
"git.default-relative-commit" : "origin/master",
"git.default-relative-commit" : "origin/blender2.8",
"arc.land.update.default" : "rebase",
"arc.land.onto.default" : "master"
"arc.land.onto.default" : "blender2.8"
}

View File

@@ -1,248 +0,0 @@
# Configuration of clang-format
# =============================
#
# Tested to work with versions: 6 to 8.
# This causes parameters on continuations to align to the opening brace.
#
# like_this_long_name(parameter_one,
# parameter_two,
# parameter_three);
#
AlignAfterOpenBracket: 'Align'
# Disallow short functions on one line; break them up.
AllowShortBlocksOnASingleLine: false
# These two settings trigger stacking of parameters in most cases; this is
# easier to read and also makes diffs easier to read (since an added or removed
# parameter is obvious). For example, function calls will look like this:
#
# like_this_long_name(parameter_one,
# parameter_two,
# parameter_three,
# parameter_four,
# parameter_five,
# parameter_six);
#
# Instead of:
#
# like_this_long_name(parameter_one, parameter_two, parameter_three, parameter_four,
# parameter_five, parameter_six);
#
BinPackArguments: false
BinPackParameters: false
# Line width (don't exceed 100).
ColumnLimit: 99
# Cause initializer lists to have one member initialized per line, in the case
# that all initializers can't fit on a single line.
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Indent the : after a constructor. For example:
#
# explicit foo_class ()
# : member1_(5)
# {
# }
#
ConstructorInitializerIndentWidth: 4
# Make access modifier slightly more visible.
AccessModifierOffset: -1
# This will unfortunately use spaces in some cases where it's not desired (like
# function calls) but the overall result is better since it will allow
# alignment to work properly with different tab width settings.
ContinuationIndentWidth: 4
# This tries to match Blender's style as much as possible. One
BreakBeforeBraces: Custom
BraceWrapping: {
AfterClass: 'false'
AfterControlStatement: 'false'
AfterEnum : 'false'
AfterFunction : 'true'
AfterNamespace : 'false'
AfterStruct : 'false'
AfterUnion : 'false'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
AfterObjCDeclaration: 'true'
}
# For switch statements, indent the cases.
IndentCaseLabels: true
# Indent after the hash inside preprocessor directives
IndentPPDirectives: AfterHash
BreakBeforeTernaryOperators: false
SpaceAfterTemplateKeyword: false
# Handy comment at the end of each C++ name space.
FixNamespaceComments: true
# Use "if (...)" instead of "if(...)", but have function calls like foo().
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
# Use two spaces before trailing comments, for example
#
# foo = bar; // comment
#
# Note that this doesn't work for C-style comments.
SpacesBeforeTrailingComments: 2
# Reflow comments, developers must disable formatting as with code to override this.
ReflowComments: true
# Never use tabs for indentation.
# Note: TabWidth and IndentWidth must be the same, or strange things happen.
UseTab: Never
TabWidth: 2
IndentWidth: 2
# Add a big penalty on breaking after the return type of functions. For example,
#
# static void foo(...)
#
# Instead of:
#
# static void
# foo(very long content here that maybe could be stacked)
#
PenaltyReturnTypeOnItsOwnLine: 10000
# Avoid having function calls broken onto a new line:
#
# int a = foo(
# long, list, of, many, params);
#
# Instead of:
#
# int a =
# foo(long, list, of, many, params);
#
PenaltyBreakAssignment: 100
AllowShortFunctionsOnASingleLine: None
# Disable for now since it complicates initial migration tests,
# TODO: look into enabling this in the future.
SortIncludes: false
# Don't right align escaped newlines to the right because we have a wide default
AlignEscapedNewlines: DontAlign
# Always break:
#
# const char *foo =
# "multi"
# "line";
#
# Instead of:
#
# const char *foo = "multi"
# "line";
#
AlwaysBreakBeforeMultilineStrings: true
# We don't want literal strings to break,
# however clang-format seems to ignore this (sigh).
PenaltyBreakString: 1000000
# There are macros in Blender for custom for loops; tell Clang to treat them
# like loops rather than an expression, and so put the { on the same line.
#
# To find these use multi-line regex search:
# "^\s+[A-Z][A-Z0-9_]+\s*\([^\n]*\)\n\s*\{"
ForEachMacros:
- BEGIN_ANIMFILTER_SUBCHANNELS
- BLI_FOREACH_SPARSE_RANGE
- BLI_SMALLSTACK_ITER_BEGIN
- BMO_ITER
- BMO_ITER_INDEX
- BMW_ITER
- BM_FACES_OF_VERT_ITER_BEGIN
- BM_ITER_BPY_BM_SEQ
- BM_ITER_ELEM
- BM_ITER_ELEM_INDEX
- BM_ITER_MESH
- BM_ITER_MESH_INDEX
- BM_ITER_MESH_MUTABLE
- BM_LOOPS_OF_VERT_ITER_BEGIN
- BOOST_FOREACH
- CTX_DATA_BEGIN
- CTX_DATA_BEGIN_WITH_ID
- DEG_OBJECT_ITER_BEGIN
- DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN
- DRIVER_TARGETS_LOOPER_BEGIN
- DRIVER_TARGETS_USED_LOOPER_BEGIN
- FOREACH_BASE_IN_EDIT_MODE_BEGIN
- FOREACH_BASE_IN_MODE_BEGIN
- FOREACH_BEGIN
- FOREACH_COLLECTION_BEGIN
- FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN
- FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN
- FOREACH_EDIT_OBJECT_BEGIN
- FOREACH_MAIN_ID_BEGIN
- FOREACH_MAIN_LISTBASE_BEGIN
- FOREACH_MAIN_LISTBASE_ID_BEGIN
- FOREACH_NODETREE_BEGIN
- FOREACH_OBJECT_BEGIN
- FOREACH_OBJECT_FLAG_BEGIN
- FOREACH_OBJECT_IN_EDIT_MODE_BEGIN
- FOREACH_OBJECT_IN_MODE_BEGIN
- FOREACH_OBJECT_RENDERABLE_BEGIN
- FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN
- FOREACH_PCHAN_VISIBLE_IN_OBJECT_BEGIN
- FOREACH_SCENE_COLLECTION_BEGIN
- FOREACH_SCENE_OBJECT_BEGIN
- FOREACH_SELECTED_BASE_BEGIN
- FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN
- FOREACH_SELECTED_OBJECT_BEGIN
- FOREACH_TRANS_DATA_CONTAINER
- FOREACH_VIEW_LAYER_TO_RENDER_BEGIN
- FOREACH_VISIBLE_BASE_BEGIN
- FOREACH_VISIBLE_OBJECT_BEGIN
- GHASH_FOREACH_BEGIN
- GHASH_ITER
- GHASH_ITER_INDEX
- GPU_SELECT_LOAD_IF_PICKSEL_LIST
- GP_EDITABLE_STROKES_BEGIN
- GSET_FOREACH_BEGIN
- GSET_ITER
- GSET_ITER_INDEX
- ITER_BEGIN
- ITER_PIXELS
- ITER_SLOTS
- LISTBASE_CIRCULAR_BACKWARD_BEGIN
- LISTBASE_CIRCULAR_FORWARD_BEGIN
- LISTBASE_FOREACH
- LISTBASE_FOREACH_MUTABLE
- MAN2D_ITER_AXES_BEGIN
- MAN_ITER_AXES_BEGIN
- NODE_INSTANCE_HASH_ITER
- NODE_SOCKET_TYPES_BEGIN
- NODE_TREE_TYPES_BEGIN
- NODE_TYPES_BEGIN
- PIXEL_LOOPER_BEGIN
- PIXEL_LOOPER_BEGIN_CHANNELS
- RNA_BEGIN
- RNA_PROP_BEGIN
- RNA_STRUCT_BEGIN
- RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
- SEQP_BEGIN
- SEQ_BEGIN
- foreach
# Use once we bump the minimum verison to version 8.
# # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).
# StatementMacros:
# - PyObject_VAR_HEAD
# - STRINGIFY

View File

@@ -3,18 +3,18 @@
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 99
indent_style = tab
indent_size = 4
max_line_length = 120
# CMake & Text
[*.{cmake,txt}]
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 99
indent_style = tab
indent_size = 4
max_line_length = 120
# Python
[*.py]
@@ -30,9 +30,9 @@ max_line_length = 120
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
max_line_length = 99
indent_style = tab
indent_size = 4
max_line_length = 120
# reStructuredText
[*.rst]

4
.gitignore vendored
View File

@@ -11,10 +11,6 @@ __pycache__/
*.swo
*#
# Indexes for emacs, vi & others
TAGS
tags
# QtCreator
CMakeLists.txt.user

4
.gitmodules vendored
View File

@@ -1,12 +1,12 @@
[submodule "release/scripts/addons"]
path = release/scripts/addons
url = ../blender-addons.git
branch = master
branch = blender2.8
ignore = all
[submodule "release/scripts/addons_contrib"]
path = release/scripts/addons_contrib
url = ../blender-addons-contrib.git
branch = master
branch = blender2.8
ignore = all
[submodule "release/datafiles/locale"]
path = release/datafiles/locale

View File

@@ -16,6 +16,11 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
#-----------------------------------------------------------------------------
@@ -344,7 +349,6 @@ option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)"
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_LZO "Use the system LZO library" OFF)
endif()
option(WITH_DRACO "Enable Draco mesh compression Python module (used for glTF)" ON)
# Camera/motion tracking
option(WITH_LIBMV "Enable Libmv structure from motion library" ON)
@@ -407,7 +411,7 @@ option(WITH_CYCLES_CUDA_BINARIES "Build Cycles CUDA binaries" OFF)
option(WITH_CYCLES_CUBIN_COMPILER "Build cubins with nvrtc based compiler instead of nvcc" OFF)
option(WITH_CYCLES_CUDA_BUILD_SERIAL "Build cubins one after another (useful on machines with limited RAM)" OFF)
mark_as_advanced(WITH_CYCLES_CUDA_BUILD_SERIAL)
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_75 CACHE STRING "CUDA architectures to build binaries for")
set(CYCLES_CUDA_BINARIES_ARCH sm_30 sm_35 sm_37 sm_50 sm_52 sm_60 sm_61 sm_70 sm_72 sm_75 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build Cycles with logging support" ON)
@@ -544,6 +548,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
endif()
# Dependency graph
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
mark_as_advanced(WITH_LEGACY_DEPSGRAPH)
if(WIN32)
# Use hardcoded paths or find_package to find externals
option(WITH_WINDOWS_FIND_MODULES "Use find_package to locate libraries" OFF)
@@ -558,24 +566,13 @@ if(WIN32)
set(WINDOWS_CODESIGN_PFX_PASSWORD CACHE STRING "password for pfx file used for codesigning.")
mark_as_advanced(WINDOWS_CODESIGN_PFX_PASSWORD)
option(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS "Organize the visual studio projects according to source folder structure." ON)
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
option(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS "Organize the source files in filters matching the source folders." ON)
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS)
option(WINDOWS_USE_VISUAL_STUDIO_FOLDERS "Organize the visual studio project according to source folders." ON)
mark_as_advanced(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
option(WINDOWS_PYTHON_DEBUG "Include the files needed for debugging python scripts with visual studio 2017+." OFF)
mark_as_advanced(WINDOWS_PYTHON_DEBUG)
endif()
# The following only works with the Ninja generator in CMake >= 3.0.
if("${CMAKE_GENERATOR}" MATCHES "Ninja")
option(WITH_NINJA_POOL_JOBS
"Enable Ninja pools of jobs, to try to ease building on machines with 16GB of RAM or less (if not yet defined, will try to set best values based on detected machine specifications)."
OFF)
mark_as_advanced(WITH_NINJA_POOL_JOBS)
endif()
# avoid using again
option_defaults_clear()
@@ -644,12 +641,6 @@ endif()
if(NOT WITH_PYTHON)
set(WITH_CYCLES OFF)
set(WITH_DRACO OFF)
endif()
if(WITH_DRACO AND NOT WITH_PYTHON_INSTALL)
message(STATUS "WITH_DRACO requires WITH_PYTHON_INSTALL to be ON, disabling WITH_DRACO for now")
set(WITH_DRACO OFF)
endif()
# enable boost for cycles, audaspace or i18n
@@ -772,8 +763,8 @@ if(WITH_PYTHON)
# Do this before main 'platform_*' checks,
# because UNIX will search for the old Python paths which may not exist.
# giving errors about missing paths before this case is met.
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.7")
message(FATAL_ERROR "At least Python 3.7 is required to build")
if(DEFINED PYTHON_VERSION AND "${PYTHON_VERSION}" VERSION_LESS "3.6")
message(FATAL_ERROR "At least Python 3.6 is required to build")
endif()
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/release/scripts/addons/modules")
@@ -822,12 +813,6 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${COMPILER_ASAN_CXXFLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COMPILER_ASAN_CXXFLAGS}")
if(WITH_CYCLES_OSL)
# With OSL, Cycles disables rtti in some modules, wich then breaks at linking
# when trying to use vptr sanitizer (included into 'undefined' general option).
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-sanitize=vptr")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-sanitize=vptr")
endif()
if(MSVC)
set(COMPILER_ASAN_LINKER_FLAGS "/FUNCTIONPADMIN:6")
endif()
@@ -1072,11 +1057,8 @@ if(WITH_GL_PROFILE_ES20)
endif()
else()
if(OpenGL_GL_PREFERENCE STREQUAL "LEGACY" AND OPENGL_gl_LIBRARY)
list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
else()
list(APPEND BLENDER_GL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY})
endif()
list(APPEND BLENDER_GL_LIBRARIES "${OPENGL_LIBRARIES}")
endif()
if(WITH_GL_EGL)
@@ -1137,10 +1119,7 @@ endif()
#-----------------------------------------------------------------------------
# Configure OpenMP.
if(WITH_OPENMP)
if(NOT OPENMP_CUSTOM)
find_package(OpenMP)
endif()
if(OPENMP_FOUND)
if(NOT WITH_OPENMP_STATIC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
@@ -1297,76 +1276,6 @@ if(WITH_LIBMV)
set(CERES_DEFINES -DCERES_STD_UNORDERED_MAP)
endif()
#-----------------------------------------------------------------------------
# Extra limits to number of jobs running in parallel for some kind os tasks.
# Only supported by Ninja build system currently.
if("${CMAKE_GENERATOR}" MATCHES "Ninja" AND WITH_NINJA_POOL_JOBS)
if(NOT NINJA_MAX_NUM_PARALLEL_COMPILE_JOBS AND
NOT NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS AND
NOT NINJA_MAX_NUM_PARALLEL_LINK_JOBS)
# Try to define good default values.
# Max mem of heavy cpp files compilation: about 2.5GB
# Max mem during linking: about 3.3GB
cmake_host_system_information(RESULT _NUM_CORES QUERY NUMBER_OF_LOGICAL_CORES)
# Note: this gives mem in MB.
cmake_host_system_information(RESULT _TOT_MEM QUERY TOTAL_PHYSICAL_MEMORY)
# Heuristics... the more cores we have, the more free mem we have to keep for the non-heavy tasks too.
if(${_TOT_MEM} LESS 8000 AND ${_NUM_CORES} GREATER 2)
set(_compile_heavy_jobs "1")
elseif(${_TOT_MEM} LESS 16000 AND ${_NUM_CORES} GREATER 4)
set(_compile_heavy_jobs "2")
elseif(${_TOT_MEM} LESS 24000 AND ${_NUM_CORES} GREATER 8)
set(_compile_heavy_jobs "3")
elseif(${_TOT_MEM} LESS 32000 AND ${_NUM_CORES} GREATER 16)
set(_compile_heavy_jobs "4")
elseif(${_TOT_MEM} LESS 64000 AND ${_NUM_CORES} GREATER 32)
set(_compile_heavy_jobs "8")
else()
set(_compile_heavy_jobs "")
endif()
set(NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS "${_compile_heavy_jobs}" CACHE STRING
"Define the maximum number of concurrent heavy compilation jobs, for ninja build system (used for some targets which cpp files can take several GB each during compilation)." FORCE)
mark_as_advanced(NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
set(_compile_heavy_jobs)
# Only set regular compile jobs if we set heavy jobs, otherwise default (using all cores) if fine.
if(NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
math(EXPR _compile_jobs "${_NUM_CORES} - 1")
else()
set(_compile_jobs "")
endif()
set(NINJA_MAX_NUM_PARALLEL_COMPILE_JOBS "${_compile_jobs}" CACHE STRING
"Define the maximum number of concurrent compilation jobs, for ninja build system." FORCE)
mark_as_advanced(NINJA_MAX_NUM_PARALLEL_COMPILE_JOBS)
set(_compile_jobs)
# In practice, even when there is RAM available, this proves to be quicker than running in parallel
# (due to slow disks accesses).
set(NINJA_MAX_NUM_PARALLEL_LINK_JOBS "1" CACHE STRING
"Define the maximum number of concurrent link jobs, for ninja build system." FORCE)
mark_as_advanced(NINJA_MAX_NUM_PARALLEL_LINK_JOBS)
set(_NUM_CORES)
set(_TOT_MEM)
endif()
if(NINJA_MAX_NUM_PARALLEL_COMPILE_JOBS)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${NINJA_MAX_NUM_PARALLEL_COMPILE_JOBS})
set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
endif()
if(NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_heavy_job_pool=${NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS})
endif()
if(NINJA_MAX_NUM_PARALLEL_LINK_JOBS)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${NINJA_MAX_NUM_PARALLEL_LINK_JOBS})
set(CMAKE_JOB_POOL_LINK link_job_pool)
endif()
endif()
#-----------------------------------------------------------------------------
# Extra compile flags
@@ -1464,8 +1373,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH -Wno-switch)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS -Wno-class-memaccess)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_COMMENT -Wno-comment)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_TYPEDEFS -Wno-unused-local-typedefs)
if(CMAKE_COMPILER_IS_GNUCC AND (NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "7.0"))
ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_IMPLICIT_FALLTHROUGH -Wno-implicit-fallthrough)
@@ -1518,8 +1425,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_NON_VIRTUAL_DTOR -Wno-non-virtual-dtor)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_MACROS -Wno-unused-macros)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_REORDER -Wno-reorder)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_COMMENT -Wno-comment)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_UNUSED_TYPEDEFS -Wno-unused-local-typedefs)
elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
@@ -1540,7 +1445,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# warning level:
"/W3"
"/w34062" # switch statement contains 'default' but no 'case' labels
"/w34115" # 'type' : named type definition in parentheses
"/w34189" # local variable is initialized but not referenced
# disable:
"/wd4018" # signed/unsigned mismatch
@@ -1555,7 +1459,6 @@ elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
"/wd4800" # forcing value to bool 'true' or 'false'
"/wd4828" # The file contains a character that is illegal
"/wd4996" # identifier was declared deprecated
"/wd4661" # no suitable definition provided for explicit template instantiation request
# errors:
"/we4013" # 'function' undefined; assuming extern returning int
"/we4133" # incompatible pointer types
@@ -1703,11 +1606,6 @@ endif()
add_subdirectory(tests)
#-----------------------------------------------------------------------------
# Define 'heavy' submodules (for Ninja builder when using pools).
setup_heavy_lib_pool()
#-----------------------------------------------------------------------------
# CPack for generating packages
include(build_files/cmake/packaging.cmake)

View File

@@ -24,138 +24,11 @@
# ../build_linux_i386
# This is for users who like to configure & build blender with a single command.
define HELP_TEXT
Convenience Targets
Provided for building Blender, (multiple at once can be used).
* debug: Build a debug binary.
* full: Enable all supported dependencies & options.
* lite: Disable non essential features for a smaller binary and faster build.
* headless: Build without an interface (renderfarm or server automation).
* cycles: Build Cycles standalone only, without Blender.
* bpy: Build as a python module which can be loaded from python directly.
* deps: Build library dependencies (intended only for platform maintainers).
* config: Run cmake configuration tool to set build options.
Note: passing the argument 'BUILD_DIR=path' when calling make will override the default build dir.
Note: passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments.
Project Files
Generate poject files for development environments.
* project_qtcreator: QtCreator Project Files.
* project_netbeans: NetBeans Project Files.
* project_eclipse: Eclipse CDT4 Project Files.
Package Targets
* package_debian: Build a debian package.
* package_pacman: Build an arch linux pacman package.
* package_archive: Build an archive package.
Testing Targets
Not associated with building Blender.
* test:
Run ctest, currently tests import/export,
operator execution and that python modules load
* test_cmake:
Runs our own cmake file checker
which detects errors in the cmake file list definitions
* test_pep8:
Checks all python script are pep8
which are tagged to use the stricter formatting
* test_deprecated:
Checks for deprecation tags in our code which may need to be removed
* test_style_c:
Checks C/C++ conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
* test_style_c_qtc:
Same as test_style but outputs QtCreator tasks format
* test_style_osl:
Checks OpenShadingLanguage conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
* test_style_osl_qtc:
Checks OpenShadingLanguage conforms with blenders style guide:
https://wiki.blender.org/wiki/Source/Code_Style
Static Source Code Checking
Not associated with building Blender.
* check_cppcheck: Run blender source through cppcheck (C & C++).
* check_clang_array: Run blender source through clang array checking script (C & C++).
* check_splint: Run blenders source through splint (C only).
* check_sparse: Run blenders source through sparse (C only).
* check_smatch: Run blenders source through smatch (C only).
* check_spelling_c: Check for spelling errors (C/C++ only).
* check_spelling_c_qtc: Same as check_spelling_c but outputs QtCreator tasks format.
* check_spelling_osl: Check for spelling errors (OSL only).
* check_spelling_py: Check for spelling errors (Python only).
* check_descriptions: Check for duplicate/invalid descriptions.
Utilities
Not associated with building Blender.
* icons:
Updates PNG icons from SVG files.
Optionally pass in variables: 'BLENDER_BIN', 'INKSCAPE_BIN'
otherwise default paths are used.
Example
make icons INKSCAPE_BIN=/path/to/inkscape
* icons_geom:
Updates Geometry icons from BLEND file.
Optionally pass in variable: 'BLENDER_BIN'
otherwise default paths are used.
Example
make icons_geom BLENDER_BIN=/path/to/blender
* tgz:
Create a compressed archive of the source code.
* update:
updates git and all submodules
* format
Format source code using clang (uses PATHS if passed in). For example::
make format PATHS="source/blender/blenlib source/blender/blenkernel"
Environment Variables
* BUILD_CMAKE_ARGS: Arguments passed to CMake.
* BUILD_DIR: Override default build path.
* PYTHON: Use this for the Python command (used for checking tools).
* NPROCS: Number of processes to use building (auto-detect when omitted).
Documentation Targets
Not associated with building Blender.
* doc_py: Generate sphinx python api docs.
* doc_doxy: Generate doxygen C/C++ docs.
* doc_dna: Generate blender file format reference.
* doc_man: Generate manpage.
Information
* help: This help message.
* help_features: Show a list of optional features when building.
endef
# HELP_TEXT (end)
# System Vars
OS:=$(shell uname -s)
OS_NCASE:=$(shell uname -s | tr '[A-Z]' '[a-z]')
CPU:=$(shell uname -m)
# CPU:=$(shell uname -m) # UNUSED
# Source and Build DIR's
@@ -182,7 +55,7 @@ ifndef DEPS_INSTALL_DIR
ifneq ($(OS_NCASE),darwin)
# Add processor type to directory name
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(CPU)
DEPS_INSTALL_DIR:=$(DEPS_INSTALL_DIR)_$(shell uname -p)
endif
endif
@@ -225,12 +98,10 @@ endif
# -----------------------------------------------------------------------------
# Blender binary path
# Allow passing in own BLENDER_BIN so developers who don't
# use the default build path can still use utility helpers.
ifeq ($(OS), Darwin)
BLENDER_BIN?="$(BUILD_DIR)/bin/Blender.app/Contents/MacOS/Blender"
BLENDER_BIN="$(BUILD_DIR)/bin/blender.app/Contents/MacOS/blender"
else
BLENDER_BIN?="$(BUILD_DIR)/bin/blender"
BLENDER_BIN="$(BUILD_DIR)/bin/blender"
endif
@@ -325,9 +196,87 @@ config: .FORCE
# -----------------------------------------------------------------------------
# Help for build targets
export HELP_TEXT
help: .FORCE
@echo "$$HELP_TEXT"
@echo ""
@echo "Convenience targets provided for building blender, (multiple at once can be used)"
@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 " * headless - build without an interface (renderfarm or server automation)"
@echo " * cycles - build Cycles standalone only, without Blender"
@echo " * bpy - build as a python module which can be loaded from python directly"
@echo " * deps - build library dependencies (intended only for platform maintainers)"
@echo ""
@echo " * config - run cmake configuration tool to set build options"
@echo ""
@echo " Note, passing the argument 'BUILD_DIR=path' when calling make will override the default build dir."
@echo " Note, passing the argument 'BUILD_CMAKE_ARGS=args' lets you add cmake arguments."
@echo ""
@echo ""
@echo "Project Files for IDE's"
@echo " * project_qtcreator - QtCreator Project Files"
@echo " * project_netbeans - NetBeans Project Files"
@echo " * project_eclipse - Eclipse CDT4 Project Files"
@echo ""
@echo "Package Targets"
@echo " * package_debian - build a debian package"
@echo " * package_pacman - build an arch linux pacman package"
@echo " * package_archive - build an archive package"
@echo ""
@echo "Testing Targets (not associated with building blender)"
@echo " * test - run ctest, currently tests import/export,"
@echo " operator execution and that python modules load"
@echo " * test_cmake - runs our own cmake file checker"
@echo " which detects errors in the cmake file list definitions"
@echo " * test_pep8 - checks all python script are pep8"
@echo " which are tagged to use the stricter formatting"
@echo " * test_deprecated - checks for deprecation tags in our code which may need to be removed"
@echo " * test_style_c - checks C/C++ conforms with blenders style guide:"
@echo " https://wiki.blender.org/wiki/Source/Code_Style"
@echo " * test_style_c_qtc - same as test_style but outputs QtCreator tasks format"
@echo " * test_style_osl - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " https://wiki.blender.org/wiki/Source/Code_Style"
@echo " * test_style_osl_qtc - checks OpenShadingLanguage conforms with blenders style guide:"
@echo " https://wiki.blender.org/wiki/Source/Code_Style"
@echo ""
@echo "Static Source Code Checking (not associated with building blender)"
@echo " * check_cppcheck - run blender source through cppcheck (C & C++)"
@echo " * check_clang_array - run blender source through clang array checking script (C & C++)"
@echo " * check_splint - run blenders source through splint (C only)"
@echo " * check_sparse - run blenders source through sparse (C only)"
@echo " * check_smatch - run blenders source through smatch (C only)"
@echo " * check_spelling_c - check for spelling errors (C/C++ only)"
@echo " * check_spelling_c_qtc - same as check_spelling_c but outputs QtCreator tasks format"
@echo " * check_spelling_osl - check for spelling errors (OSL only)"
@echo " * check_spelling_py - check for spelling errors (Python only)"
@echo " * check_descriptions - check for duplicate/invalid descriptions"
@echo ""
@echo "Utilities (not associated with building blender)"
@echo " * icons - Updates PNG icons from SVG files."
@echo " Set environment variables 'BLENDER_BIN' and 'INKSCAPE_BIN'"
@echo " to define your own commands."
@echo " * icons_geom - Updates Geometry icons from BLEND file."
@echo " Set environment variable 'BLENDER_BIN'"
@echo " to define your own command."
@echo " * tgz - create a compressed archive of the source code."
@echo " * update - updates git and all submodules"
@echo ""
@echo "Environment Variables"
@echo " * BUILD_CMAKE_ARGS - arguments passed to CMake."
@echo " * BUILD_DIR - override default build path."
@echo " * PYTHON - use this for the Python command (used for checking tools)."
@echo " * NPROCS - number of processes to use building (auto-detect when omitted)."
@echo ""
@echo "Documentation Targets (not associated with building blender)"
@echo " * doc_py - generate sphinx python api docs"
@echo " * doc_doxy - generate doxygen C/C++ docs"
@echo " * doc_dna - generate blender file format reference"
@echo " * doc_man - generate manpage"
@echo ""
@echo "Information"
@echo " * help - this help message"
@echo " * help_features - show a list of optional features when building"
@echo ""
# -----------------------------------------------------------------------------
# Packages
@@ -408,7 +357,7 @@ test_style_osl_qtc: .FORCE
#
project_qtcreator: .FORCE
$(PYTHON) build_files/cmake/cmake_qtcreator_project.py --build-dir "$(BUILD_DIR)"
$(PYTHON) build_files/cmake/cmake_qtcreator_project.py "$(BUILD_DIR)"
project_netbeans: .FORCE
$(PYTHON) build_files/cmake/cmake_netbeans_project.py "$(BUILD_DIR)"
@@ -491,11 +440,8 @@ check_descriptions: .FORCE
tgz: .FORCE
./build_files/utils/build_tgz.sh
INKSCAPE_BIN?="inkscape"
icons: .FORCE
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/blender_icons_update.py"
BLENDER_BIN=$(BLENDER_BIN) INKSCAPE_BIN=$(INKSCAPE_BIN) \
"$(BLENDER_DIR)/release/datafiles/prvicons_update.py"
icons_geom: .FORCE
@@ -512,12 +458,9 @@ update: .FORCE
fi
git pull --rebase
git submodule update --init --recursive
git submodule foreach git checkout master
git submodule foreach git pull --rebase origin master
format: .FORCE
PATH="../lib/${OS_NCASE}/llvm/bin/:$(PATH)" \
python3 source/tools/utils_maintenance/clang_format_paths.py $(PATHS)
# Use blender2.8 branch for submodules that have it.
git submodule foreach "git checkout blender2.8 || git checkout master"
git submodule foreach git pull --rebase origin
# -----------------------------------------------------------------------------

View File

@@ -30,11 +30,11 @@
# build_deps 2015 x64 / build_deps 2015 x86
#
# MAC OS X USAGE:
# Install with homebrew: brew install cmake autoconf automake libtool yasm nasm
# Install with homebrew: brew install autoconf automake libtool yasm nasm
# Run "make deps" from main Blender directory
#
# LINUX USAGE:
# Install compiler cmake autoconf automake libtool yasm nasm tcl
# Install compiler, cmake, autoconf, automake, libtool, yasm
# Run "make deps" from main Blender directory
#
####################################################################################################
@@ -91,11 +91,7 @@ include(cmake/openvdb.cmake)
include(cmake/python.cmake)
include(cmake/python_site_packages.cmake)
include(cmake/numpy.cmake)
if(UNIX AND NOT APPLE)
# Rely on PugiXML compiled with OpenImageIO
else()
include(cmake/pugixml.cmake)
endif()
if(WITH_WEBP)
include(cmake/webp.cmake)
@@ -118,7 +114,7 @@ endif()
if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/openjpeg.cmake)
if(NOT WIN32 OR BUILD_MODE STREQUAL Release)
if(BUILD_MODE STREQUAL Release)
if(WIN32)
include(cmake/zlib_mingw.cmake)
endif()

View File

@@ -102,6 +102,7 @@ function(harvest from to)
FILES_MATCHING PATTERN ${pattern}
PATTERN "pkgconfig" EXCLUDE
PATTERN "cmake" EXCLUDE
PATTERN "clang" EXCLUDE
PATTERN "__pycache__" EXCLUDE
PATTERN "tests" EXCLUDE)
endif()
@@ -128,15 +129,8 @@ harvest(jemalloc/lib jemalloc/lib "*.a")
harvest(jpg/include jpeg/include "*.h")
harvest(jpg/lib jpeg/lib "libjpeg.a")
harvest(lame/lib ffmpeg/lib "*.a")
harvest(clang/bin llvm/bin "clang-format")
harvest(clang/include llvm/include "*")
harvest(llvm/include llvm/include "*")
harvest(llvm/bin llvm/bin "llvm-config")
harvest(llvm/lib llvm/lib "libLLVM*.a")
if(APPLE)
harvest(openmp/lib openmp/lib "*")
harvest(openmp/include openmp/include "*.h")
endif()
harvest(ogg/lib ffmpeg/lib "*.a")
harvest(openal/include openal/include "*.h")
if(UNIX AND NOT APPLE)

View File

@@ -47,8 +47,7 @@ if(MSVC)
set(LLVM_HARVEST_COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/ ${HARVEST_TARGET}/llvm/ )
else()
set(LLVM_HARVEST_COMMAND
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/ &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/include/ ${HARVEST_TARGET}/llvm/debug/include/
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/llvm/lib/ ${HARVEST_TARGET}/llvm/debug/lib/
)
endif()
ExternalProject_Add_Step(ll after_install

View File

@@ -18,31 +18,18 @@
if(BUILD_MODE STREQUAL Release)
set(OPENAL_EXTRA_ARGS
-DALSOFT_UTILS=OFF
-DALSOFT_NO_CONFIG_UTIL=ON
-DALSOFT_EXAMPLES=OFF
-DALSOFT_TESTS=OFF
-DALSOFT_CONFIG=OFF
-DALSOFT_HRTF_DEFS=OFF
-DALSOFT_INSTALL=ON
-DALSOFT_BACKEND_SNDIO=OFF
-DALSOFT_UTILS=Off
-DALSOFT_NO_CONFIG_UTIL=On
-DALSOFT_EXAMPLES=Off
-DALSOFT_TESTS=Off
-DALSOFT_CONFIG=Off
-DALSOFT_HRTF_DEFS=Off
-DALSOFT_INSTALL=On
-DALSOFT_BACKEND_SNDIO=Off
)
if(UNIX)
set(OPENAL_EXTRA_ARGS
${OPENAL_EXTRA_ARGS}
-DLIBTYPE=STATIC
)
endif()
if(UNIX AND NOT APPLE)
# Ensure we have backends for playback.
set(OPENAL_EXTRA_ARGS
${OPENAL_EXTRA_ARGS}
-DALSOFT_REQUIRE_ALSA=ON
-DALSOFT_REQUIRE_OSS=ON
-DALSOFT_REQUIRE_PULSEAUDIO=ON
)
set(OPENAL_EXTRA_ARGS ${OPENAL_EXTRA_ARGS} -DLIBTYPE=STATIC)
endif()
ExternalProject_Add(external_openal

View File

@@ -23,8 +23,7 @@ ExternalProject_Add(external_openmp
URL_HASH MD5=${OPENMP_HASH}
PREFIX ${BUILD_DIR}/openmp
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openmp ${DEFAULT_CMAKE_FLAGS}
INSTALL_COMMAND cd ${BUILD_DIR}/openmp/src/external_openmp-build && install_name_tool -id @executable_path/../Resources/lib/libomp.dylib runtime/src/libomp.dylib && make install
INSTALL_DIR ${LIBDIR}/openmp
INSTALL_DIR ${LIBDIR}/clang
)
add_dependencies(

View File

@@ -70,6 +70,7 @@ ExternalProject_Add(external_opensubdiv
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENSUBDIV_Hash}
PREFIX ${BUILD_DIR}/opensubdiv
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/opensubdiv/src/external_opensubdiv < ${PATCH_DIR}/opensubdiv.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opensubdiv
)

View File

@@ -126,13 +126,14 @@ else()
OUTPUT_VARIABLE XCODE_DEV_PATH OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(OSX_ARCHITECTURES x86_64)
set(OSX_DEPLOYMENT_TARGET 10.11)
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk)
set(OSX_DEPLOYMENT_TARGET 10.9)
set(OSX_SDK_VERSION 10.13)
set(OSX_SYSROOT ${XCODE_DEV_PATH}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK_VERSION}.sdk)
set(PLATFORM_CFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_CXXFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET} -std=c++11 -stdlib=libc++")
set(PLATFORM_LDFLAGS "-isysroot ${OSX_SYSROOT} -mmacosx-version-min=${OSX_DEPLOYMENT_TARGET}")
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin15.0.0) # OS X 10.11
set(PLATFORM_BUILD_TARGET --build=x86_64-apple-darwin13.0.0) # OS X 10.9
set(PLATFORM_CMAKE_FLAGS
-DCMAKE_OSX_ARCHITECTURES:STRING=${OSX_ARCHITECTURES}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${OSX_DEPLOYMENT_TARGET}

View File

@@ -81,6 +81,11 @@ if(WIN32)
${OSL_EXTRA_ARGS}
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
elseif(UNIX AND NOT APPLE)
set(OSL_EXTRA_ARGS
${OSL_EXTRA_ARGS}
-DPUGIXML_HOME=${LIBDIR}/pugixml
)
elseif(APPLE)
# Make symbol hiding consistent with OIIO which defaults to OFF,
# avoids linker warnings on macOS
@@ -111,16 +116,8 @@ add_dependencies(
external_zlib
external_flexbison
external_openimageio
)
if(UNIX AND NOT APPLE)
# Rely on PugiXML compiled with OpenImageIO
else()
add_dependencies(
external_osl
external_pugixml
)
endif()
if(WIN32)
if(BUILD_MODE STREQUAL Release)

View File

@@ -36,7 +36,7 @@ add_dependencies(
external_zlib
)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_png after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_staticd${LIBEXT} ${LIBDIR}/png/lib/libpng16${LIBEXT}
DEPENDEES install

View File

@@ -17,6 +17,7 @@
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(PTHREAD_XCFLAGS /MD)
if(MSVC14) # vs2015 has timespec
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H /D_TIMESPEC_DEFINED ")
@@ -24,7 +25,7 @@ if(WIN32)
set(PTHREAD_CPPFLAGS "/I. /DHAVE_CONFIG_H ")
endif()
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XCFLAGS=${PTHREAD_XCFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
@@ -34,7 +35,8 @@ if(WIN32)
CONFIGURE_COMMAND echo .
BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/libpthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC3.dll ${LIBDIR}/pthreads/lib/pthreadVC3.dll &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/pthread.h ${LIBDIR}/pthreads/inc/pthread.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/sched.h ${LIBDIR}/pthreads/inc/sched.h &&
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/semaphore.h ${LIBDIR}/pthreads/inc/semaphore.h &&

View File

@@ -39,7 +39,7 @@ add_dependencies(
external_zlib
)
if(WIN32 AND BUILD_MODE STREQUAL Debug)
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tiff after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiffd${LIBEXT} ${LIBDIR}/tiff/lib/tiff${LIBEXT}
DEPENDEES install

View File

@@ -71,7 +71,7 @@ else()
endif()
set(FREETYPE_VERSION 2.9.1)
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_URI http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_HASH 3adb0e35d3c100c456357345ccfa8056)
set(GLEW_VERSION 1.13.0)
@@ -105,8 +105,8 @@ set(CUEW_GIT_UID 1744972026de9cf27c8a7dc39cf39cd83d5f922f)
set(CUEW_URI https://github.com/CudaWrangler/cuew/archive/${CUEW_GIT_UID}.zip)
set(CUEW_HASH 86760d62978ebfd96cd93f5aa1abaf4a)
set(OPENSUBDIV_VERSION v3_4_0_RC2)
set(OPENSUBDIV_Hash f6a10ba9efaa82fde86fe65aad346319)
set(OPENSUBDIV_VERSION v3_3_3)
set(OPENSUBDIV_Hash 29c79dc01ef616aab02670bed5544ddd)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.tar.gz)
set(SDL_VERSION 2.0.8)
@@ -251,7 +251,7 @@ set(JEMALLOC_URI https://github.com/jemalloc/jemalloc/releases/download/${JEMALL
set(JEMALLOC_HASH 507f7b6b882d868730d644510491d18f)
set(XML2_VERSION 2.9.4)
set(XML2_URI http://xmlsoft.org/sources/libxml2-${XML2_VERSION}.tar.gz)
set(XML2_URI ftp://xmlsoft.org/libxml2/libxml2-${XML2_VERSION}.tar.gz)
set(XML2_HASH ae249165c173b1ff386ee8ad676815f5)
set(TINYXML_VERSION 2_6_2)
@@ -284,7 +284,7 @@ set(BZIP2_URI http://http.debian.net/debian/pool/main/b/bzip2/bzip2_${BZIP2_VERS
set(BZIP2_HASH d70a9ccd8bdf47e302d96c69fecd54925f45d9c7b966bb4ef5f56b770960afa7)
set(FFI_VERSION 3.2.1)
set(FFI_URI https://sourceware.org/pub/libffi/libffi-${FFI_VERSION}.tar.gz)
set(FFI_URI ftp://sourceware.org/pub/libffi/libffi-${FFI_VERSION}.tar.gz)
set(FFI_HASH d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37)
set(LZMA_VERSION 5.2.4)

View File

@@ -40,8 +40,16 @@ if(WIN32)
)
endif()
else()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_zlib after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
DEPENDEES install
)
endif()
if (UNIX)
ExternalProject_Add_Step(external_zlib after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/libz.a ${LIBDIR}/zlib/lib/libz_pic.a
DEPENDEES install
)
endif()
endif()

View File

@@ -301,8 +301,6 @@ NO_BUILD=false
NO_CONFIRM=false
USE_CXX11=true
CLANG_FORMAT_VERSION_MIN="6.0"
PYTHON_VERSION="3.7.0"
PYTHON_VERSION_MIN="3.7"
PYTHON_FORCE_BUILD=false
@@ -358,7 +356,7 @@ OSL_FORCE_REBUILD=false
OSL_SKIP=false
# OpenSubdiv needs to be compiled for now
OSD_VERSION="3.4.0_RC2"
OSD_VERSION="3.3.3"
OSD_VERSION_MIN=$OSD_VERSION
OSD_FORCE_BUILD=false
OSD_FORCE_REBUILD=false
@@ -385,6 +383,7 @@ OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
EMBREE_VERSION="3.2.4"
EMBREE_FORCE_BUILD=false
EMBREE_FORCE_REBUILD=false
@@ -2629,7 +2628,7 @@ compile_FFmpeg() {
./configure --cc="gcc -Wl,--as-needed" \
--extra-ldflags="-pthread -static-libgcc" \
--prefix=$_inst --enable-static \
--disable-ffplay --disable-doc \
--disable-ffplay --disable-ffserver --disable-doc \
--enable-gray \
--enable-avfilter --disable-vdpau \
--disable-bzlib --disable-libgsm --disable-libspeex \
@@ -2789,17 +2788,6 @@ install_DEB() {
PRINT ""
fi
PRINT ""
CLANG_FORMAT="clang-format"
check_package_version_ge_DEB $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
if [ $? -eq 0 ]; then
_packages="$_packages $CLANG_FORMAT"
else
PRINT ""
WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
PRINT ""
fi
if [ "$WITH_JACK" = true ]; then
_packages="$_packages libspnav-dev"
# Only install jack if jack2 is not already installed!
@@ -3451,16 +3439,6 @@ install_RPM() {
install_packages_RPM libspnav-devel
fi
PRINT ""
CLANG_FORMAT="clang" # Yeah, on fedora/suse clang-format is part of main clang package...
check_package_version_ge_RPM $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_RPM $CLANG_FORMAT
else
PRINT ""
WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
PRINT ""
fi
PRINT ""
_do_compile_python=false
@@ -3908,18 +3886,6 @@ install_ARCH() {
fi
PRINT ""
CLANG_FORMAT="clang" # Yeah, on arch clang-format is part of main clang package...
check_package_version_ge_ARCH $CLANG_FORMAT $CLANG_FORMAT_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_ARCH $CLANG_FORMAT
else
PRINT ""
WARNING "clang-format $CLANG_FORMAT_VERSION_MIN or higher not found, this is NOT needed to get Blender compiling..."
PRINT ""
fi
PRINT ""
_do_compile_python=false
if [ "$PYTHON_SKIP" = true ]; then
@@ -4558,33 +4524,18 @@ print_info() {
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
if [ -d $INST/blosc ]; then
_1="-D BLOSC_ROOT_DIR=$INST/blosc"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$WITH_OPENCOLLADA" = true ]; then
_1="-D WITH_OPENCOLLADA=ON"
PRINT " $_1"
_buildargs="$_buildargs $_1"
if [ -d $INST/opencollada ]; then
_1="-D OPENCOLLADA_ROOT_DIR=$INST/opencollada"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$WITH_EMBREE" = true ]; then
_1="-D WITH_CYCLES_EMBREE=ON"
PRINT " $_1"
_buildargs="$_buildargs $_1"
if [ -d $INST/embree ]; then
_1="-D EMBREE_ROOT_DIR=$INST/embree"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$WITH_JACK" = true ]; then

View File

@@ -0,0 +1,13 @@
diff --git a/opensubdiv/far/topologyRefiner.cpp b/opensubdiv/far/topologyRefiner.cpp
index 3754b36e..7fe42bcc 100644
--- a/opensubdiv/far/topologyRefiner.cpp
+++ b/opensubdiv/far/topologyRefiner.cpp
@@ -263,7 +263,7 @@ namespace internal {
bool IsEmpty() const { return *((int_type*)this) == 0; }
FeatureMask() { Clear(); }
- FeatureMask(Options const & options, Sdc::SchemeType sType) { InitializeFeatures(options, sType); }
+ FeatureMask(Options const & options, Sdc::SchemeType sType) { Clear(); InitializeFeatures(options, sType); }
// These are the two primary methods intended for use -- intialization via a set of Options
// and reduction of the subsequent feature set (which presumes prior initialization with the

View File

@@ -2,22 +2,33 @@
include("${CMAKE_CURRENT_LIST_DIR}/../../cmake/config/blender_release.cmake")
# For libc-2.24 we are using chroot which runs on a 64bit system.
# There we can not use CPU bitness check since it is always 64bit. So instead
# we check for a specific libraries.
#
# Other builders we are runnign in a bare virtual machine, and the libraries
# are installed to /opt/.
# We assume that only 64bit builders exists in such configuration.
# Detect which libc we'll be linking against.
# Some of the paths will depend on this
if(EXISTS "/lib/x86_64-linux-gnu/libc-2.24.so")
message(STATUS "Building in GLibc-2.24 environment")
set(GLIBC "2.24")
set(MULTILIB "/x86_64-linux-gnu")
set(LIBDIR_NAME "linux_x86_64")
elseif(EXISTS "/lib/i386-linux-gnu//libc-2.24.so")
message(STATUS "Building in GLibc-2.24 environment")
set(GLIBC "2.24")
set(MULTILIB "/i386-linux-gnu")
set(LIBDIR_NAME "linux_i686")
elseif(EXISTS "/lib/x86_64-linux-gnu/libc-2.19.so")
message(STATUS "Building in GLibc-2.19 environment")
set(GLIBC "2.19")
set(MULTILIB "/x86_64-linux-gnu")
elseif(EXISTS "/lib/i386-linux-gnu//libc-2.19.so")
message(STATUS "Building in GLibc-2.19 environment")
set(GLIBC "2.19")
set(MULTILIB "/i386-linux-gnu")
elseif(EXISTS "/lib/libc-2.11.3.so")
message(STATUS "Building in GLibc-2.11 environment")
set(GLIBC "2.11")
set(MULTILIB "")
else()
message(STATUS "Building in generic 64bit environment")
set(LIBDIR_NAME "linux_x86_64")
message(FATAL_ERROR "Unknown build environment")
endif()
# Default to only build Blender
@@ -40,8 +51,122 @@ set(WITH_PYTHON_INSTALL_REQUESTS ON CACHE BOOL "" FORCE)
# ######## Release environment specific settings ########
if (NOT ${GLIBC} STREQUAL "2.24")
# All the hardcoded library paths and such
# LLVM libraries
set(LLVM_VERSION "3.4" CACHE STRING "" FORCE)
set(LLVM_ROOT_DIR "/opt/lib/llvm-${LLVM_VERSION}" CACHE STRING "" FORCE)
set(LLVM_STATIC ON CACHE BOOL "" FORCE)
# BOOST libraries
set(BOOST_ROOT "/opt/lib/boost" CACHE STRING "" FORCE)
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
# FFmpeg libraries
set(FFMPEG "/opt/lib/ffmpeg" CACHE STRING "" FORCE)
set(FFMPEG_LIBRARIES
avdevice avformat avcodec avutil avfilter swscale swresample
/usr/lib${MULTILIB}/libxvidcore.a
/usr/lib${MULTILIB}/libx264.a
/usr/lib${MULTILIB}/libmp3lame.a
/usr/lib${MULTILIB}/libvpx.a
/usr/lib${MULTILIB}/libvorbis.a
/usr/lib${MULTILIB}/libogg.a
/usr/lib${MULTILIB}/libvorbisenc.a
/usr/lib${MULTILIB}/libtheora.a
/usr/lib${MULTILIB}/libschroedinger-1.0.a
/usr/lib${MULTILIB}/liborc-0.4.a
CACHE STRING "" FORCE
)
# SndFile libraries
set(SNDFILE_LIBRARY "/usr/lib${MULTILIB}/libsndfile.a;/usr/lib${MULTILIB}/libFLAC.a" CACHE STRING "" FORCE)
# OpenAL libraries
set(OPENAL_ROOT_DIR "/opt/lib/openal" CACHE STRING "" FORCE)
set(OPENAL_INCLUDE_DIR "${OPENAL_ROOT_DIR}/include/AL" CACHE STRING "" FORCE)
set(OPENAL_LIBRARY
${OPENAL_ROOT_DIR}/lib/libopenal.a
${OPENAL_ROOT_DIR}/lib/libcommon.a
CACHE STRING "" FORCE
)
# OpenCollada libraries
set(OPENCOLLADA_UTF_LIBRARY "" CACHE STRING "" FORCE)
set(PCRE_INCLUDE_DIR "/usr/include" CACHE STRING "" FORCE)
set(PCRE_LIBRARY "/usr/lib${MULTILIB}/libpcre.a" CACHE STRING "" FORCE)
set(XML2_INCLUDE_DIR "/usr/include" CACHE STRING "" FORCE)
set(XML2_LIBRARY "/usr/lib${MULTILIB}/libxml2.a" CACHE STRING "" FORCE)
# OpenColorIO libraries
set(OPENCOLORIO_ROOT_DIR "/opt/lib/ocio" CACHE STRING "" FORCE)
set(OPENCOLORIO_OPENCOLORIO_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libOpenColorIO.a" CACHE STRING "" FORCE)
set(OPENCOLORIO_TINYXML_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libtinyxml.a" CACHE STRING "" FORCE)
set(OPENCOLORIO_YAML-CPP_LIBRARY "${OPENCOLORIO_ROOT_DIR}/lib/libyaml-cpp.a" CACHE STRING "" FORCE)
# Freetype
set(FREETYPE_INCLUDE_DIRS "/usr/include/freetype2" CACHE STRING "" FORCE)
set(FREETYPE_LIBRARY "/usr/lib${MULTILIB}/libfreetype.a" CACHE STRING "" FORCE)
# OpenImageIO
if(GLIBC EQUAL "2.19")
set(OPENIMAGEIO_LIBRARY
/opt/lib/oiio/lib/libOpenImageIO.a
/opt/lib/oiio/lib/libOpenImageIO_Util.a
/usr/lib${MULTILIB}/libwebp.a
/usr/lib${MULTILIB}/liblzma.a
/usr/lib${MULTILIB}/libjbig.a
${FREETYPE_LIBRARY}
CACHE STRING "" FORCE
)
endif()
# OpenSubdiv libraries
set(OPENSUBDIV_ROOT_DIR "/opt/lib/opensubdiv" CACHE STRING "" FORCE)
set(OPENSUBDIV_OSDCPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdCPU.a" CACHE STRING "" FORCE)
set(OPENSUBDIV_OSDGPU_LIBRARY "${OPENSUBDIV_ROOT_DIR}/lib/libosdGPU.a" CACHE STRING "" FORCE)
# OpenEXR libraries
set(OPENEXR_ROOT_DIR "/opt/lib/openexr" CACHE STRING "" FORCE)
set(OPENEXR_HALF_LIBRARY "/opt/lib/openexr/lib/libHalf.a" CACHE STRING "" FORCE)
set(OPENEXR_IEX_LIBRARY "/opt/lib/openexr/lib/libIex.a" CACHE STRING "" FORCE)
set(OPENEXR_ILMIMF_LIBRARY "/opt/lib/openexr/lib/libIlmImf.a" CACHE STRING "" FORCE)
set(OPENEXR_ILMTHREAD_LIBRARY "/opt/lib/openexr/lib/libIlmThread.a" CACHE STRING "" FORCE)
set(OPENEXR_IMATH_LIBRARY "/opt/lib/openexr/lib/libImath.a" CACHE STRING "" FORCE)
# JeMalloc library
set(JEMALLOC_LIBRARY "/opt/lib/jemalloc/lib/libjemalloc.a" CACHE STRING "" FORCE)
# Space navigation
set(SPACENAV_ROOT_DIR "/opt/lib/libspnav" CACHE STRING "" FORCE)
# Force some system libraries to be static
set(FFTW3_LIBRARY "/usr/lib${MULTILIB}/libfftw3.a" CACHE STRING "" FORCE)
set(JPEG_LIBRARY "/usr/lib${MULTILIB}/libjpeg.a" CACHE STRING "" FORCE)
set(PNG_LIBRARY "/usr/lib${MULTILIB}/libpng.a" CACHE STRING "" FORCE)
set(TIFF_LIBRARY "/usr/lib${MULTILIB}/libtiff.a" CACHE STRING "" FORCE)
set(ZLIB_LIBRARY "/usr/lib${MULTILIB}/libz.a" CACHE STRING "" FORCE)
# OpenVDB
set(OPENVDB_LIBRARY
/opt/lib/openvdb/lib/libopenvdb.a
CACHE BOOL "" FORCE
)
set(BLOSC_LIBRARY
/opt/lib/blosc/lib/libblosc.a
CACHE BOOL "" FORCE
)
else()
set(LIBDIR "/opt/blender-deps/${LIBDIR_NAME}" CACHE BOOL "" FORCE)
# TODO(sergey): Remove once Python is oficially bumped to 3.7.
set(PYTHON_VERSION 3.7 CACHE BOOL "" FORCE)
# Platform specific configuration, to ensure static linking against everything.
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
@@ -52,5 +177,7 @@ set(Boost_USE_STATIC_LIBS ON CACHE BOOL "" FORCE)
set(PCRE_INCLUDE_DIR "/usr/include" CACHE STRING "" FORCE)
set(PCRE_LIBRARY "${LIBDIR}/opencollada/lib/libpcre.a" CACHE STRING "" FORCE)
endif()
# Additional linking libraries
set(CMAKE_EXE_LINKER_FLAGS "-lrt -static-libstdc++ -no-pie" CACHE STRING "" FORCE)

View File

@@ -52,17 +52,20 @@ if 'cmake' in builder:
build_dir = os.path.abspath(os.path.join('..', 'build', builder))
install_dir = os.path.abspath(os.path.join('..', 'install', builder))
targets = ['blender']
command_prefix = []
chroot_name = None # If not None command will be delegated to that chroot
cuda_chroot_name = None # If not None cuda compilationcommand will be delegated to that chroot
build_cubins = True # Whether to build Cycles CUDA kernels
bits = 64
# Config file to be used (relative to blender's sources root)
cmake_config_file = "build_files/cmake/config/blender_release.cmake"
cmake_cuda_config_file = None
# Set build options.
cmake_options = []
cmake_extra_options = ['-DCMAKE_BUILD_TYPE:STRING=Release',
'-DWITH_GTESTS=ON']
cmake_extra_options = ['-DCMAKE_BUILD_TYPE:STRING=Release']
cuda_cmake_options = []
if builder.startswith('mac'):
# Set up OSX architecture
@@ -71,40 +74,93 @@ if 'cmake' in builder:
cmake_extra_options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
elif builder.startswith('win'):
if builder.endswith('_vs2017'):
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 15 2017 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 15 2017'])
elif builder.endswith('_vc2015'):
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 14 2015 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 14 2015'])
cmake_extra_options.append('-DCUDA_NVCC_FLAGS=--cl-version;2013;' +
'--compiler-bindir;C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin')
else:
if builder.startswith('win64'):
cmake_options.extend(['-G', 'Visual Studio 12 2013 Win64'])
elif builder.startswith('win32'):
bits = 32
cmake_options.extend(['-G', 'Visual Studio 12 2013'])
elif builder.startswith('linux'):
cmake_config_file = "build_files/buildbot/config/blender_linux.cmake"
tokens = builder.split("_")
glibc = tokens[1]
if glibc == 'glibc224':
deb_name = "stretch"
elif glibc == 'glibc219':
deb_name = "jessie"
elif glibc == 'glibc211':
deb_name = "squeeze"
cmake_config_file = "build_files/buildbot/config/blender_linux.cmake"
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_' + deb_name + '_x86_64'
targets = ['blender']
elif builder.endswith('i686_cmake'):
bits = 32
chroot_name = 'buildbot_' + deb_name + '_i686'
command_prefix = ['schroot', '-c', chroot_name, '--']
elif glibc == 'glibc217':
command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
targets = ['blender']
if deb_name != "stretch":
cmake_extra_options.extend(["-DCMAKE_C_COMPILER=/usr/bin/gcc-7",
"-DCMAKE_CXX_COMPILER=/usr/bin/g++-7"])
# Workaround to build only sm_7x kernels with CUDA 10, until
# older kernels work well with this version.
if builder.startswith('win'):
cmake_extra_options.append('-DCUDA_VERSION=9.1')
cmake_extra_options.append('-DCUDA_TOOLKIT_INCLUDE:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/include')
cmake_extra_options.append('-DCUDA_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1')
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v9.1/bin/nvcc.exe')
cmake_extra_options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0/bin/nvcc.exe')
cmake_extra_options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v10.0')
elif builder.startswith('linux'):
cmake_extra_options.append('-DCUDA_VERSION=9.1')
cmake_extra_options.append('-DCUDA_TOOLKIT_INCLDUE:PATH=/usr/local/cuda-9.1/include')
cmake_extra_options.append('-DCUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-9.1')
cmake_extra_options.append('-DCUDA_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-9.1/bin/nvcc')
cmake_extra_options.append('-DCUDA10_NVCC_EXECUTABLE:FILEPATH=/usr/local/cuda-10.0/bin/nvcc')
cmake_extra_options.append('-DCUDA10_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-10.0')
cmake_options.append("-C" + os.path.join(blender_dir, cmake_config_file))
# Prepare CMake options needed to configure cuda binaries compilation, 64bit only.
if bits == 64:
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=ON")
cmake_options.append("-DCUDA_64_BIT_DEVICE_CODE=ON")
cuda_cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=%s" % ('ON' if build_cubins else 'OFF'))
if build_cubins or 'cuda' in targets:
cuda_cmake_options.append("-DCUDA_64_BIT_DEVICE_CODE=ON")
# Only modify common cmake options if cuda doesn't require separate target.
if 'cuda' not in targets:
cmake_options += cuda_cmake_options
else:
cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=OFF")
cuda_cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=OFF")
cmake_options.append("-DCMAKE_INSTALL_PREFIX=%s" % (install_dir))
cmake_options += cmake_extra_options
# Prepare chroot command prefix if needed
if chroot_name:
chroot_prefix = ['schroot', '-c', chroot_name, '--']
else:
chroot_prefix = []
if cuda_chroot_name:
cuda_chroot_prefix = ['schroot', '-c', cuda_chroot_name, '--']
else:
cuda_chroot_prefix = chroot_prefix[:]
# Make sure no garbage remained from the previous run
if os.path.isdir(install_dir):
shutil.rmtree(install_dir)
@@ -113,19 +169,27 @@ if 'cmake' in builder:
print("Building target %s" % (target))
# Construct build directory name based on the target
target_build_dir = build_dir
target_command_prefix = command_prefix[:]
target_chroot_prefix = chroot_prefix[:]
if target != 'blender':
target_build_dir += '_' + target
target_name = 'install'
# Tweaking CMake options to respect the target
target_cmake_options = cmake_options[:]
if target == 'cuda':
target_cmake_options += cuda_cmake_options
target_chroot_prefix = cuda_chroot_prefix[:]
target_name = 'cycles_kernel_cuda'
# If cuda binaries are compiled as a separate target, make sure
# other targets don't compile cuda binaries.
if 'cuda' in targets and target != 'cuda':
target_cmake_options.append("-DWITH_CYCLES_CUDA_BINARIES=OFF")
# Do extra git fetch because not all platform/git/buildbot combinations
# update the origin remote, causing buildinfo to detect local changes.
os.chdir(blender_dir)
print("Fetching remotes")
command = ['git', 'fetch', '--all']
print(command)
retcode = subprocess.call(target_command_prefix + command)
retcode = subprocess.call(target_chroot_prefix + command)
if retcode != 0:
sys.exit(retcode)
# Make sure build directory exists and enter it
@@ -138,13 +202,7 @@ if 'cmake' in builder:
if os.path.exists('CMakeCache.txt'):
print("Removing CMake cache")
os.remove('CMakeCache.txt')
# Remove buildinfo files to force buildbot to re-generate them.
for buildinfo in ('buildinfo.h', 'buildinfo.h.txt', ):
full_path = os.path.join('source', 'creator', buildinfo)
if os.path.exists(full_path):
print("Removing {}" . format(buildinfo))
os.remove(full_path)
retcode = subprocess.call(target_command_prefix + ['cmake', blender_dir] + target_cmake_options)
retcode = subprocess.call(target_chroot_prefix + ['cmake', blender_dir] + target_cmake_options)
if retcode != 0:
print('Configuration FAILED!')
sys.exit(retcode)
@@ -156,11 +214,21 @@ if 'cmake' in builder:
print("Executing command:")
print(command)
retcode = subprocess.call(target_command_prefix + command)
retcode = subprocess.call(target_chroot_prefix + command)
if retcode != 0:
sys.exit(retcode)
if builder.startswith('linux') and target == 'cuda':
blender_h = os.path.join(blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
blender_version = int(parse_header_file(blender_h, 'BLENDER_VERSION'))
blender_version = "%d.%d" % (blender_version // 100, blender_version % 100)
kernels = os.path.join(target_build_dir, 'intern', 'cycles', 'kernel')
install_kernels = os.path.join(install_dir, blender_version, 'scripts', 'addons', 'cycles', 'lib')
os.mkdir(install_kernels)
print("Copying cuda binaries from %s to %s" % (kernels, install_kernels))
os.system('cp %s/*.cubin %s' % (kernels, install_kernels))
else:
print("Unknown building system")
sys.exit(1)

View File

@@ -107,8 +107,8 @@ if builder.find('cmake') != -1:
if builder.endswith('vc2015'):
platform += "-vc14"
builderified_name = 'blender-{}-{}-{}'.format(blender_full_version, git_hash, platform)
# NOTE: Blender 2.7 is already respected by blender_full_version.
if branch != '' and branch != 'blender2.7':
# NOTE: Blender 2.8 is already respected by blender_full_version.
if branch != '' and branch != 'blender2.8':
builderified_name = branch + "-" + builderified_name
os.rename(result_file, "{}.zip".format(builderified_name))
@@ -135,28 +135,24 @@ if builder.find('cmake') != -1:
blender_version = "%d.%d" % (blender_version // 100, blender_version % 100)
blender_hash = parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
blender_glibc = builder.split('_')[1]
command_prefix = []
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_jessie_x86_64'
bits = 64
blender_arch = 'x86_64'
if blender_glibc == 'glibc224':
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_stretch_x86_64'
elif builder.endswith('i686_cmake'):
chroot_name = 'buildbot_stretch_i686'
chroot_name = 'buildbot_jessie_i686'
bits = 32
blender_arch = 'i686'
command_prefix = ['schroot', '-c', chroot_name, '--']
elif blender_glibc == 'glibc217':
command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
# Strip all unused symbols from the binaries
print("Stripping binaries...")
subprocess.call(command_prefix + ['strip', '--strip-all', blender])
chroot_prefix = ['schroot', '-c', chroot_name, '--']
subprocess.call(chroot_prefix + ['strip', '--strip-all', blender])
print("Stripping python...")
py_target = os.path.join(install_dir, blender_version)
subprocess.call(command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
subprocess.call(chroot_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
# Copy all specific files which are too specific to be copied by
# the CMake rules themselves
@@ -177,8 +173,8 @@ if builder.find('cmake') != -1:
blender_hash,
blender_glibc,
blender_arch)
# NOTE: Blender 2.7 is already respected by blender_full_version.
if branch != '' and branch != 'blender2.7':
# NOTE: Blender 2.8 is already respected by blender_full_version.
if branch != '' and branch != 'blender2.8':
package_name = branch + "-" + package_name
upload_filename = package_name + ".tar.bz2"

View File

@@ -33,44 +33,27 @@ builder = sys.argv[1]
blender_dir = '../blender.git'
if "cmake" in builder:
# cmake
print("Automated tests are still DISABLED!")
sys.exit(0)
build_dir = os.path.abspath(os.path.join('..', 'build', builder))
install_dir = os.path.abspath(os.path.join('..', 'install', builder))
# NOTE: For quick test only to see if the approach work.
# n the future must be replaced with an actual blender version.
blender_version = '2.80'
blender_version_dir = os.path.join(install_dir, blender_version)
command_prefix = []
extra_ctest_args = []
chroot_name = None
chroot_prefix = []
if builder.startswith('win'):
extra_ctest_args += ['-C', 'Release']
elif builder.startswith('linux'):
tokens = builder.split("_")
glibc = tokens[1]
if glibc == 'glibc224':
deb_name = "stretch"
"""
if builder.endswith('x86_64_cmake'):
chroot_name = 'buildbot_' + deb_name + '_x86_64'
chroot_name = 'buildbot_jessie_x86_64'
elif builder.endswith('i686_cmake'):
chroot_name = 'buildbot_' + deb_name + '_i686'
command_prefix = ['schroot', '--preserve-environment', '-c', chroot_name, '--']
elif glibc == 'glibc217':
command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
ctest_env = os.environ.copy()
ctest_env['BLENDER_SYSTEM_SCRIPTS'] = os.path.join(blender_version_dir, 'scripts')
ctest_env['BLENDER_SYSTEM_DATAFILES'] = os.path.join(blender_version_dir, 'datafiles')
chroot_name = 'buildbot_jessie_i686'
if chroot_name:
chroot_prefix = ['schroot', '-c', chroot_name, '--']
"""
os.chdir(build_dir)
retcode = subprocess.call(command_prefix + ['ctest', '--output-on-failure'] + extra_ctest_args,
env=ctest_env)
# Always exit with a success, for until we know all the tests are passing
# on all builders.
sys.exit(0)
retcode = subprocess.call(chroot_prefix + ['ctest', '--output-on-failure'])
sys.exit(retcode)
else:
print("Unknown building system")
sys.exit(1)

View File

@@ -47,10 +47,10 @@ FIND_PATH(EMBREE_INCLUDE_DIR
SET(_embree_FIND_COMPONENTS
embree3
embree_avx
embree_avx2
embree_sse42
embree3
lexers
math
simd

View File

@@ -6,7 +6,7 @@
# LIBSNDFILE_LIBRARIES, libraries to link against to use SndFile.
# LIBSNDFILE_ROOT_DIR, The base directory to search for SndFile.
# This can also be an environment variable.
# SNDFILE_FOUND, If false, do not try to use SndFile.
# LIBSNDFILE_FOUND, If false, do not try to use SndFile.
#
# also defined, but not for general use are
# LIBSNDFILE_LIBRARY, where to find the SndFile library.
@@ -50,16 +50,16 @@ FIND_LIBRARY(LIBSNDFILE_LIBRARY
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set LIBSNDFILE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SndFile DEFAULT_MSG
LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
IF(SNDFILE_FOUND)
IF(LIBSNDFILE_FOUND)
SET(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
SET(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
ENDIF(SNDFILE_FOUND)
ENDIF(LIBSNDFILE_FOUND)
MARK_AS_ADVANCED(
LIBSNDFILE_INCLUDE_DIR

View File

@@ -1,3 +1,4 @@
#
# VLMC RPM Finder
# Authors: Rohit Yadav <rohityadav89@gmail.com>
#

View File

@@ -22,7 +22,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
if(MY_WC_BRANCH STREQUAL "HEAD")
# Detached HEAD, check whether commit hash is reachable
# in the master branch
execute_process(COMMAND git rev-parse --short=12 HEAD
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -80,12 +80,12 @@ if(EXISTS ${SOURCE_DIR}/.git)
if(NOT _git_below_check STREQUAL "")
# If there're commits between HEAD and upstream this means
# that we're reset-ed to older revision. Use it's hash then.
execute_process(COMMAND git rev-parse --short=12 HEAD
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
execute_process(COMMAND git rev-parse --short=12 @{u}
execute_process(COMMAND git rev-parse --short @{u}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -94,7 +94,7 @@ if(EXISTS ${SOURCE_DIR}/.git)
if(MY_WC_HASH STREQUAL "")
# Local branch, not set to upstream.
# Well, let's use HEAD for now
execute_process(COMMAND git rev-parse --short=12 HEAD
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -12,7 +12,6 @@ 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_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)

View File

@@ -17,7 +17,6 @@ set(WITH_CODEC_FFMPEG OFF CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
set(WITH_FFTW3 OFF CACHE BOOL "" FORCE)
set(WITH_LIBMV OFF CACHE BOOL "" FORCE)
set(WITH_LLVM OFF CACHE BOOL "" FORCE)

View File

@@ -13,7 +13,6 @@ 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_CYCLES_OSL ON CACHE BOOL "" FORCE)
set(WITH_DRACO ON CACHE BOOL "" FORCE)
set(WITH_FFTW3 ON CACHE BOOL "" FORCE)
set(WITH_LIBMV ON CACHE BOOL "" FORCE)
set(WITH_LIBMV_SCHUR_SPECIALIZATIONS ON CACHE BOOL "" FORCE)
@@ -53,8 +52,7 @@ set(WITH_X11_XF86VMODE ON CACHE BOOL "" FORCE)
set(WITH_MEM_JEMALLOC ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUDA_BINARIES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_CUBIN_COMPILER OFF CACHE BOOL "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_75 CACHE STRING "" FORCE)
set(CYCLES_CUDA_BINARIES_ARCH sm_30;sm_35;sm_37;sm_50;sm_52;sm_60;sm_61;sm_70;sm_72;sm_75 CACHE STRING "" FORCE)
# platform dependent options
if(UNIX AND NOT APPLE)

View File

@@ -30,8 +30,3 @@ set(WITH_INTERNATIONAL OFF CACHE BOOL "" FORCE)
set(WITH_BULLET OFF CACHE BOOL "" FORCE)
set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_ALEMBIC OFF CACHE BOOL "" FORCE)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
# jemalloc causes linking error on import, disable.
set(WITH_MEM_JEMALLOC OFF CACHE BOOL "" FORCE)
endif()

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# filters CMake output to be more like nan-makefiles
FILTER="^\[ *[0-9]*%] \|^Built target \|^Scanning "
make $@ | \
sed -u -e 's/^Linking .*\//Linking /' | \
sed -u -e 's/^.*\// /' | \
grep --line-buffered -v "$FILTER"
echo "Build Done"

View File

@@ -16,6 +16,11 @@
#
# The Original Code is Copyright (C) 2006, Blender Foundation
# All rights reserved.
#
# The Original Code is: all of this file.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
macro(list_insert_after
@@ -173,23 +178,9 @@ function(blender_source_group
sources
)
#if enabled, use the sources directories as filters.
if(WINDOWS_USE_VISUAL_STUDIO_SOURCE_FOLDERS)
foreach(_SRC ${sources})
# remove ../'s
get_filename_component(_SRC_DIR ${_SRC} REALPATH)
get_filename_component(_SRC_DIR ${_SRC_DIR} DIRECTORY)
string(FIND ${_SRC_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/" _pos)
if(NOT _pos EQUAL -1)
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" GROUP_ID ${_SRC_DIR})
string(REPLACE "/" "\\" GROUP_ID ${GROUP_ID})
source_group("${GROUP_ID}" FILES ${_SRC})
endif()
unset(_pos)
endforeach()
else()
# Group by location on disk
source_group("Source Files" FILES CMakeLists.txt)
foreach(_SRC ${sources})
get_filename_component(_SRC_EXT ${_SRC} EXT)
if((${_SRC_EXT} MATCHES ".h") OR
@@ -197,14 +188,11 @@ function(blender_source_group
(${_SRC_EXT} MATCHES ".hh"))
set(GROUP_ID "Header Files")
elseif(${_SRC_EXT} MATCHES ".glsl$")
set(GROUP_ID "Shaders")
else()
set(GROUP_ID "Source Files")
endif()
source_group("${GROUP_ID}" FILES ${_SRC})
endforeach()
endif()
endfunction()
@@ -239,7 +227,6 @@ function(blender_add_lib__impl
sources
includes
includes_sys
library_deps
)
# message(STATUS "Configuring library ${name}")
@@ -251,16 +238,12 @@ function(blender_add_lib__impl
add_library(${name} ${sources})
if(NOT "${library_deps}" STREQUAL "")
target_link_libraries(${name} INTERFACE "${library_deps}")
endif()
# works fine without having the includes
# listed is helpful for IDE's (QtCreator/MSVC)
blender_source_group("${sources}")
#if enabled, set the FOLDER property for visual studio projects
if(WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS)
if(WINDOWS_USE_VISUAL_STUDIO_FOLDERS)
get_filename_component(FolderDir ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
string(REPLACE ${CMAKE_SOURCE_DIR} "" FolderDir ${FolderDir})
set_target_properties(${name} PROPERTIES FOLDER ${FolderDir})
@@ -279,12 +262,11 @@ function(blender_add_lib_nolist
sources
includes
includes_sys
library_deps
)
add_cc_flags_custom_test(${name} PARENT_SCOPE)
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_deps}")
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}")
endfunction()
function(blender_add_lib
@@ -292,36 +274,15 @@ function(blender_add_lib
sources
includes
includes_sys
library_deps
)
add_cc_flags_custom_test(${name} PARENT_SCOPE)
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}" "${library_deps}")
blender_add_lib__impl(${name} "${sources}" "${includes}" "${includes_sys}")
set_property(GLOBAL APPEND PROPERTY BLENDER_LINK_LIBS ${name})
endfunction()
# Ninja only: assign 'heavy pool' to some targets that are especially RAM-consuming to build.
function(setup_heavy_lib_pool)
if(WITH_NINJA_POOL_JOBS AND NINJA_MAX_NUM_PARALLEL_COMPILE_HEAVY_JOBS)
if(WITH_CYCLES)
list(APPEND _HEAVY_LIBS "cycles_device" "cycles_kernel")
endif()
if(WITH_LIBMV)
list(APPEND _HEAVY_LIBS "bf_intern_libmv")
endif()
if(WITH_OPENVDB)
list(APPEND _HEAVY_LIBS "bf_intern_openvdb")
endif()
foreach(TARGET ${_HEAVY_LIBS})
if(TARGET ${TARGET})
set_property(TARGET ${TARGET} PROPERTY JOB_POOL_COMPILE compile_heavy_job_pool)
endif()
endforeach()
endif()
endfunction()
function(SETUP_LIBDIRS)
@@ -420,11 +381,19 @@ function(setup_liblinks
${FREETYPE_LIBRARY}
)
if(WITH_PYTHON)
# since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions
if(WITH_PYTHON) # AND NOT WITH_PYTHON_MODULE # WIN32 needs
target_link_libraries(${target} ${PYTHON_LINKFLAGS})
if(WIN32 AND NOT UNIX)
file_list_suffix(PYTHON_LIBRARIES_DEBUG "${PYTHON_LIBRARIES}" "_d")
target_link_libraries_debug(${target} "${PYTHON_LIBRARIES_DEBUG}")
target_link_libraries_optimized(${target} "${PYTHON_LIBRARIES}")
unset(PYTHON_LIBRARIES_DEBUG)
else()
target_link_libraries(${target} ${PYTHON_LIBRARIES})
endif()
endif()
if(WITH_LZO AND WITH_SYSTEM_LZO)
target_link_libraries(${target} ${LZO_LIBRARIES})
@@ -453,11 +422,8 @@ function(setup_liblinks
if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
target_link_libraries(${target} ${SDL_LIBRARY})
endif()
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_OPENVDB)
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
if(WITH_IMAGE_TIFF)
target_link_libraries(${target} ${TIFF_LIBRARY})
endif()
if(WITH_OPENIMAGEIO)
target_link_libraries(${target} ${OPENIMAGEIO_LIBRARIES})
@@ -468,6 +434,12 @@ function(setup_liblinks
if(WITH_OPENSUBDIV)
target_link_libraries(${target} ${OPENSUBDIV_LIBRARIES})
endif()
if(WITH_OPENVDB)
target_link_libraries(${target} ${OPENVDB_LIBRARIES} ${TBB_LIBRARIES} ${BLOSC_LIBRARIES})
endif()
if(WITH_CYCLES_OSL)
target_link_libraries(${target} ${OSL_LIBRARIES})
endif()
if(WITH_CYCLES_EMBREE)
target_link_libraries(${target} ${EMBREE_LIBRARIES})
endif()
@@ -481,9 +453,6 @@ function(setup_liblinks
if(WITH_ALEMBIC)
target_link_libraries(${target} ${ALEMBIC_LIBRARIES} ${HDF5_LIBRARIES})
endif()
if(WITH_IMAGE_TIFF)
target_link_libraries(${target} ${TIFF_LIBRARY})
endif()
if(WITH_IMAGE_OPENEXR)
target_link_libraries(${target} ${OPENEXR_LIBRARIES})
endif()
@@ -568,6 +537,267 @@ function(setup_liblinks
target_link_libraries(${target} ${PLATFORM_LINKLIBS})
endfunction()
function(SETUP_BLENDER_SORTED_LIBS)
get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
list(APPEND BLENDER_LINK_LIBS
bf_windowmanager
bf_render
)
if(WITH_MOD_FLUID)
list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
endif()
if(WITH_CYCLES)
list(APPEND BLENDER_LINK_LIBS
cycles_render
cycles_graph
cycles_bvh
cycles_device
cycles_kernel
cycles_util
cycles_subd)
if(WITH_CYCLES_OSL)
list(APPEND BLENDER_LINK_LIBS cycles_kernel_osl)
endif()
endif()
if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
list(APPEND BLENDER_LINK_LIBS
audaspace
audaspace-py)
endif()
# Sort libraries
set(BLENDER_SORTED_LIBS
bf_windowmanager
bf_editor_undo
bf_editor_space_api
bf_editor_space_action
bf_editor_space_buttons
bf_editor_space_console
bf_editor_space_file
bf_editor_space_graph
bf_editor_space_image
bf_editor_space_info
bf_editor_space_logic
bf_editor_space_nla
bf_editor_space_node
bf_editor_space_outliner
bf_editor_space_script
bf_editor_space_sequencer
bf_editor_space_statusbar
bf_editor_space_text
bf_editor_space_time
bf_editor_space_topbar
bf_editor_space_userpref
bf_editor_space_view3d
bf_editor_space_clip
bf_editor_transform
bf_editor_uvedit
bf_editor_curve
bf_editor_interface
bf_editor_gizmo_library
bf_editor_mesh
bf_editor_metaball
bf_editor_object
bf_editor_gpencil
bf_editor_lattice
bf_editor_armature
bf_editor_physics
bf_editor_render
bf_editor_scene
bf_editor_screen
bf_editor_sculpt_paint
bf_editor_sound
bf_editor_animation
bf_editor_datafiles
bf_editor_mask
bf_editor_io
bf_editor_util
bf_editor_hair
bf_render
bf_python
bf_python_ext
bf_python_mathutils
bf_python_gpu
bf_python_bmesh
bf_freestyle
bf_ikplugin
bf_modifiers
bf_gpencil_modifiers
bf_alembic
bf_bmesh
bf_gpu
bf_draw
bf_blenloader
bf_blenkernel
bf_shader_fx
bf_gpencil_modifiers
bf_physics
bf_nodes
bf_rna
bf_editor_gizmo_library # rna -> gizmo bad-level calls
bf_python
bf_imbuf
bf_blenlib
bf_depsgraph
bf_intern_ghost
bf_intern_string
bf_avi
bf_imbuf_cineon
bf_imbuf_openexr
bf_imbuf_openimageio
bf_imbuf_dds
bf_collada
bf_intern_elbeem
bf_intern_memutil
bf_intern_guardedalloc
bf_intern_ctr
bf_intern_utfconv
bf_intern_smoke
extern_lzma
extern_curve_fit_nd
bf_intern_moto
extern_openjpeg
bf_dna
bf_blenfont
bf_gpu # duplicate for blenfont
bf_blentranslation
bf_intern_audaspace
audaspace
audaspace-py
bf_intern_mikktspace
bf_intern_dualcon
bf_intern_cycles
cycles_device
cycles_render
cycles_graph
cycles_bvh
cycles_kernel
cycles_util
cycles_subd
bf_intern_opencolorio
bf_intern_gawain
bf_intern_eigen
extern_rangetree
extern_wcwidth
bf_intern_libmv
extern_sdlew
bf_intern_glew_mx
bf_intern_clog
bf_intern_opensubdiv
bf_intern_numaapi
)
if(NOT WITH_SYSTEM_GLOG)
list(APPEND BLENDER_SORTED_LIBS extern_glog)
endif()
if(NOT WITH_SYSTEM_GFLAGS)
list(APPEND BLENDER_SORTED_LIBS extern_gflags)
endif()
if(WITH_COMPOSITOR)
# added for opencl compositor
list_insert_before(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_compositor")
list_insert_after(BLENDER_SORTED_LIBS "bf_compositor" "bf_intern_opencl")
endif()
if(WITH_LIBMV)
list(APPEND BLENDER_SORTED_LIBS extern_ceres)
endif()
if(WITH_MOD_CLOTH_ELTOPO)
list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
endif()
if(NOT WITH_SYSTEM_LZO)
list(APPEND BLENDER_SORTED_LIBS extern_minilzo)
endif()
if(NOT WITH_SYSTEM_GLEW)
list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES})
endif()
if(WITH_BINRELOC)
list(APPEND BLENDER_SORTED_LIBS extern_binreloc)
endif()
if(WITH_CXX_GUARDEDALLOC)
list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
endif()
if(WITH_IK_SOLVER)
list_insert_after(BLENDER_SORTED_LIBS "bf_intern_elbeem" "bf_intern_iksolver")
endif()
if(WITH_IK_ITASC)
list(APPEND BLENDER_SORTED_LIBS bf_intern_itasc)
endif()
if(WITH_GHOST_XDND)
list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
endif()
if(WITH_CYCLES_OSL)
list_insert_after(BLENDER_SORTED_LIBS "cycles_kernel" "cycles_kernel_osl")
endif()
if(WITH_INTERNATIONAL)
list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
endif()
if(WITH_BULLET)
list_insert_after(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_intern_rigidbody")
endif()
if(WITH_BULLET AND NOT WITH_SYSTEM_BULLET)
list_insert_after(BLENDER_SORTED_LIBS "extern_openjpeg" "extern_bullet")
endif()
if(WIN32)
list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
endif()
if(WITH_OPENVDB)
list(APPEND BLENDER_SORTED_LIBS bf_intern_openvdb)
endif()
foreach(SORTLIB ${BLENDER_SORTED_LIBS})
set(REMLIB ${SORTLIB})
foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
if(${SEARCHLIB} STREQUAL ${SORTLIB})
set(REMLIB "")
endif()
endforeach()
if(REMLIB)
# message(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
list(APPEND REM_MSG ${REMLIB})
list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
endif()
endforeach()
if(REM_MSG)
list(SORT REM_MSG)
message(STATUS "Blender Skipping: (${REM_MSG})")
endif()
set(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} PARENT_SCOPE)
# for top-level tests
set_property(GLOBAL PROPERTY BLENDER_SORTED_LIBS_PROP ${BLENDER_SORTED_LIBS})
endfunction()
macro(TEST_SSE_SUPPORT
_sse_flags
_sse2_flags)
@@ -713,7 +943,7 @@ macro(remove_strict_flags)
endif()
if(MSVC)
remove_cc_flag(/w34189) # Restore warn C4189 (unused variable) back to w4
# TODO
endif()
endmacro()
@@ -955,7 +1185,6 @@ function(delayed_install
endif()
set_property(GLOBAL APPEND PROPERTY DELAYED_INSTALL_DESTINATIONS ${destination})
endforeach()
unset(f)
endfunction()
# note this is a function instead of a macro so that ${BUILD_TYPE} in targetdir
@@ -1238,26 +1467,3 @@ macro(WINDOWS_SIGN_TARGET target)
endif()
endif()
endmacro()
macro(blender_precompile_headers target cpp header)
if(MSVC)
# get the name for the pch output file
get_filename_component( pchbase ${cpp} NAME_WE )
set( pchfinal "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${pchbase}.pch" )
# mark the cpp as the one outputting the pch
set_property(SOURCE ${cpp} APPEND PROPERTY OBJECT_OUTPUTS "${pchfinal}")
# get all sources for the target
get_target_property(sources ${target} SOURCES)
# make all sources depend on the pch to enforce the build order
foreach(src ${sources})
set_property(SOURCE ${src} APPEND PROPERTY OBJECT_DEPENDS "${pchfinal}")
endforeach()
target_sources(${target} PRIVATE ${cpp} ${header})
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/Yu${header} /Fp${pchfinal} /FI${header}")
set_source_files_properties(${cpp} PROPERTIES COMPILE_FLAGS "/Yc${header} /Fp${pchfinal}")
endif()
endmacro()

View File

@@ -26,7 +26,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
find_package(Git)
if(GIT_FOUND)
# message(STATUS "Found Git: ${GIT_EXECUTABLE}")
execute_process(COMMAND git rev-parse --short=12 HEAD
execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -86,7 +86,7 @@ if(WIN32)
set(CPACK_NSIS_MUI_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/text/GPL3-license.txt)
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt)
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.ico)
set(CPACK_WIX_UPGRADE_GUID "B767E4FD-7DE7-4094-B051-3AE62E13A17A")

View File

@@ -16,11 +16,14 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Apple.
set(MACOSX_DEPLOYMENT_TARGET "10.11")
set(MACOSX_DEPLOYMENT_TARGET "10.9")
macro(find_package_wrapper)
# do nothing, just satisfy the macro
@@ -181,7 +184,7 @@ endif()
set(PLATFORM_CFLAGS "-pipe -funsigned-char")
set(PLATFORM_LINKFLAGS
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework Metal -framework QuartzCore"
"-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Cocoa -framework Carbon -framework AudioUnit -framework AudioToolbox -framework CoreAudio"
)
list(APPEND PLATFORM_LINKLIBS c++)
@@ -382,24 +385,13 @@ if(WITH_CYCLES_EMBREE)
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Xlinker -stack_size -Xlinker 0x100000")
endif()
# CMake FindOpenMP doesn't know about AppleClang before 3.12, so provide custom flags.
if(WITH_OPENMP)
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0")
# Use OpenMP from our precompiled libraries.
message(STATUS "Using ${LIBDIR}/openmp for OpenMP")
set(OPENMP_CUSTOM ON)
set(OPENMP_FOUND ON)
set(OpenMP_C_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
set(OpenMP_CXX_FLAGS "-Xclang -fopenmp -I'${LIBDIR}/openmp/include'")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L'${LIBDIR}/openmp/lib' -lomp")
# Copy libomp.dylib to allow executables like datatoc and tests to work.
execute_process(
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/Resources/lib
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/Resources/lib/libomp.dylib)
execute_process(
COMMAND mkdir -p ${CMAKE_BINARY_DIR}/bin/Resources/lib
COMMAND cp -p ${LIBDIR}/openmp/lib/libomp.dylib ${CMAKE_BINARY_DIR}/bin/Resources/lib/libomp.dylib)
execute_process(COMMAND ${CMAKE_C_COMPILER} --version OUTPUT_VARIABLE COMPILER_VENDOR)
string(SUBSTRING "${COMPILER_VENDOR}" 0 5 VENDOR_NAME) # truncate output
if(${VENDOR_NAME} MATCHES "Apple") # Apple does not support OpenMP reliable with gcc and not with clang
set(WITH_OPENMP OFF)
else() # vanilla gcc or clang_omp support OpenMP
message(STATUS "Using special OpenMP enabled compiler !") # letting find_package(OpenMP) module work for gcc
endif()
endif()

View File

@@ -16,6 +16,9 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Jacques Beaurain.
#
# ***** END GPL LICENSE BLOCK *****
# Xcode and system configuration for Apple.
@@ -93,14 +96,19 @@ else()
endif()
endif()
# 10.11 is our min. target, if you use higher sdk, weak linking happens
if(OSX_SYSTEM MATCHES 10.9)
# make sure syslibs and headers are looked up in sdk ( especially for 10.9 openGL atm. )
set(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT})
endif()
# 10.9 is our min. target, if you use higher sdk, weak linking happens
if(CMAKE_OSX_DEPLOYMENT_TARGET)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.11)
message(STATUS "Setting deployment target to 10.11, lower versions are not supported")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE)
if(${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.9)
message(STATUS "Setting deployment target to 10.9, lower versions are not supported")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
endif()
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "" FORCE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
endif()
if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")

View File

@@ -16,6 +16,9 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for any *nix system including Linux and Unix.
@@ -39,10 +42,6 @@ if(EXISTS ${LIBDIR})
set(WITH_OPENMP_STATIC ON)
endif()
if(WITH_STATIC_LIBS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++")
endif()
# Wrapper to prefer static libraries
macro(find_package_wrapper)
if(WITH_STATIC_LIBS)
@@ -156,7 +155,7 @@ endif()
# Codecs
if(WITH_CODEC_SNDFILE)
find_package_wrapper(SndFile)
if(NOT SNDFILE_FOUND)
if(NOT LIBSNDFILE_FOUND)
set(WITH_CODEC_SNDFILE OFF)
endif()
endif()
@@ -246,17 +245,13 @@ if(WITH_OPENVDB)
find_package_wrapper(OpenVDB)
find_package_wrapper(TBB)
find_package_wrapper(Blosc)
if(NOT TBB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "TBB not found, disabling OpenVDB")
elseif(NOT OPENVDB_FOUND)
if(NOT OPENVDB_FOUND OR NOT TBB_FOUND)
set(WITH_OPENVDB OFF)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "OpenVDB not found, disabling it")
elseif(NOT BLOSC_FOUND)
set(WITH_OPENVDB_BLOSC OFF)
message(STATUS "Blosc not found, disabling it for OpenVBD")
message(STATUS "Blosc not found, disabling it")
endif()
endif()

View File

@@ -16,6 +16,9 @@
#
# The Original Code is Copyright (C) 2016, Blender Foundation
# All rights reserved.
#
# Contributor(s): Sergey Sharybin.
#
# ***** END GPL LICENSE BLOCK *****
# Libraries configuration for Windows.
@@ -37,7 +40,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS})
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_FOLDERS})
if(NOT WITH_PYTHON_MODULE)
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT blender)
@@ -170,10 +173,7 @@ if(NOT DEFINED LIBDIR)
set(LIBDIR_BASE "windows")
endif()
# Can be 1910..1912
if(MSVC_VERSION GREATER 1919)
message(STATUS "Visual Studio 2019 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
elseif(MSVC_VERSION GREATER 1909)
if(MSVC_VERSION GREATER 1909)
message(STATUS "Visual Studio 2017 detected.")
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14)
elseif(MSVC_VERSION EQUAL 1900)
@@ -190,12 +190,6 @@ if(NOT EXISTS "${LIBDIR}/")
message(FATAL_ERROR "Windows requires pre-compiled libs at: '${LIBDIR}'")
endif()
# Mark libdir as system headers with a lower warn level, to resolve some warnings
# that we have very little control over
if(MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG)
add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0)
endif()
# Add each of our libraries to our cmake_prefix_path so find_package() could work
file(GLOB children RELATIVE ${LIBDIR} ${LIBDIR}/*)
foreach(child ${children})
@@ -345,8 +339,6 @@ if(WITH_PYTHON)
string(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
# Use shared libs for vc2008 and vc2010 until we actually have vc2010 libs
set(PYTHON_LIBRARY ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}.lib)
set(PYTHON_LIBRARY_DEBUG ${LIBDIR}/python/lib/python${_PYTHON_VERSION_NO_DOTS}_d.lib)
unset(_PYTHON_VERSION_NO_DOTS)
# Shared includes for both vc2008 and vc2010
@@ -354,7 +346,7 @@ if(WITH_PYTHON)
# uncached vars
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
set(PYTHON_LIBRARIES debug "${PYTHON_LIBRARY_DEBUG}" optimized "${PYTHON_LIBRARY}" )
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
endif()
if(WITH_BOOST)
@@ -435,7 +427,6 @@ endif()
if(WITH_LLVM)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_INCLUDE_DIRS ${LLVM_ROOT_DIR}/$<$<CONFIG:Debug>:Debug>/include CACHE PATH "Path to the LLVM include directory")
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_ROOT_DIR}/lib/*.lib)
if(EXISTS ${LLVM_ROOT_DIR}/debug/lib)

View File

@@ -16,6 +16,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton, M.G. Kishalmi
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -14,6 +14,8 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Contributor(s): Campbell Barton
#
# ***** END GPL LICENSE BLOCK *****
# <pep8 compliant>

View File

@@ -29,7 +29,7 @@ try:
os.remove(package_archive)
if os.path.exists(package_dir):
shutil.rmtree(package_dir)
except Exception as ex:
except Exception, ex:
sys.stderr.write('Failed to clean up old package files: ' + str(ex) + '\n')
sys.exit(1)
@@ -40,7 +40,7 @@ try:
for f in os.listdir(package_dir):
if f.startswith('makes'):
os.remove(os.path.join(package_dir, f))
except Exception as ex:
except Exception, ex:
sys.stderr.write('Failed to copy install directory: ' + str(ex) + '\n')
sys.exit(1)
@@ -58,13 +58,13 @@ try:
sys.exit(-1)
subprocess.call(archive_cmd)
except Exception as ex:
except Exception, ex:
sys.stderr.write('Failed to create package archive: ' + str(ex) + '\n')
sys.exit(1)
# empty temporary package dir
try:
shutil.rmtree(package_dir)
except Exception as ex:
except Exception, ex:
sys.stderr.write('Failed to clean up package directory: ' + str(ex) + '\n')
sys.exit(1)

View File

@@ -3,9 +3,6 @@ echo No explicit msvc version requested, autodetecting version.
call "%~dp0\detect_msvc2017.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2019.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete
call "%~dp0\detect_msvc2015.cmd"
if %ERRORLEVEL% EQU 0 goto DetectionComplete

View File

@@ -1,6 +1,5 @@
if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc14
if "%BUILD_ARCH%"=="x64" (
set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST%

View File

@@ -1,4 +1,4 @@
if NOT exist "%BLENDER_DIR%\source\tools\.git" (
if NOT exist "%BLENDER_DIR%/source/tools" (
echo Checking out sub-modules
if not "%GIT%" == "" (
"%GIT%" submodule update --init --recursive --progress

View File

@@ -1,5 +1,3 @@
set BUILD_GENERATOR_POST=
set BUILD_PLATFORM_SELECT=
if "%BUILD_ARCH%"=="x64" (
set MSBUILD_PLATFORM=x64
) else if "%BUILD_ARCH%"=="x86" (
@@ -11,7 +9,7 @@ if "%BUILD_ARCH%"=="x64" (
)
if "%WITH_CLANG%"=="1" (
set CLANG_CMAKE_ARGS=-T"llvm"
set CLANG_CMAKE_ARGS=-T"LLVM-vs2017"
if "%WITH_ASAN%"=="1" (
set ASAN_CMAKE_ARGS=-DWITH_COMPILER_ASAN=On
)
@@ -25,14 +23,7 @@ if "%WITH_CLANG%"=="1" (
if "%WITH_PYDEBUG%"=="1" (
set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
)
if "%BUILD_VS_YEAR%"=="2019" (
set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
) else (
set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
)
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
if NOT EXIST %BUILD_DIR%\nul (
mkdir %BUILD_DIR%
@@ -62,7 +53,7 @@ if "%MUST_CONFIGURE%"=="1" (
-H%BLENDER_DIR% ^
-B%BUILD_DIR%
if errorlevel 1 (
if %ERRORLEVEL% NEQ 0 (
echo "Configuration Failed"
exit /b 1
)

View File

@@ -1,3 +1,76 @@
if NOT "%verbose%" == "" (
echo Detecting msvc 2017
)
set BUILD_VS_VER=15
set BUILD_VS_YEAR=2017
call "%~dp0\detect_msvc_vswhere.cmd"
set ProgramFilesX86=%ProgramFiles(x86)%
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
if not exist "%vs_where%" (
if NOT "%verbose%" == "" (
echo Visual Studio 2017 ^(15.2 or newer^) is not detected
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
)
if "%VS_InstallDir%"=="" (
if NOT "%verbose%" == "" (
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
goto FAIL
)
)
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
if exist "%VCVARS%" (
call "%VCVARS%" %BUILD_ARCH%
) else (
if NOT "%verbose%" == "" (
echo "%VCVARS%" not found
)
goto FAIL
)
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
if NOT "%verbose%" == "" (
echo Visual Studio 2017 is detected successfully
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -1,3 +0,0 @@
set BUILD_VS_VER=16
set BUILD_VS_YEAR=2019
call "%~dp0\detect_msvc_vswhere.cmd"

View File

@@ -1,79 +0,0 @@
if NOT "%verbose%" == "" (
echo Detecting msvc %BUILD_VS_YEAR%
)
set ProgramFilesX86=%ProgramFiles(x86)%
if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles%
set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe
if not exist "%vs_where%" (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% is not detected
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo "%vs_where%" -latest %VSWHERE_ARGS% -version ^[%BUILD_VS_VER%.0^,%BUILD_VS_VER%.99^) -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64
)
for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest -version ^[%BUILD_VS_VER%.0^,%BUILD_VS_VER%.99^) %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do (
if /i "%%i"=="installationPath" set VS_InstallDir=%%j
)
if NOT "%verbose%" == "" (
echo VS_Installdir="%VS_InstallDir%"
)
if "%VS_InstallDir%"=="" (
if NOT "%verbose%" == "" (
echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled
goto FAIL
)
)
set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat
if exist "%VCVARS%" (
call "%VCVARS%" %BUILD_ARCH%
) else (
if NOT "%verbose%" == "" (
echo "%VCVARS%" not found
)
goto FAIL
)
rem try msbuild
msbuild /version > NUL
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% msbuild found
)
REM try the c++ compiler
cl 2> NUL 1>&2
if errorlevel 1 (
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found
)
goto FAIL
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found
)
if NOT "%verbose%" == "" (
echo Visual Studio %BUILD_VS_YEAR% is detected successfully
)
goto EOF
:FAIL
exit /b 1
:EOF

View File

@@ -1,25 +0,0 @@
if EXIST %BLENDER_DIR%\..\lib\win64_vc14\llvm\bin\clang-format.exe (
set CF_PATH=..\lib\win64_vc14\llvm\bin
goto detect_done
)
if EXIST %BLENDER_DIR%\..\lib\windows_vc14\llvm\bin\clang-format.exe (
set CF_PATH=..\lib\windows_vc14\llvm\bin
goto detect_done
)
echo clang-format not found
exit /b 1
:detect_done
echo found clang-format in %CF_PATH%
REM TODO(sergey): Switch to Python from libraries when available.
set PYTHON="python.exe"
set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths.py
REM The formatting script expects clang-format to be in the current PATH.
set PATH=%CF_PATH%;%PATH%
%PYTHON% %FORMAT_PATHS% %FORMAT_ARGS%
:EOF

View File

@@ -16,9 +16,7 @@ if NOT "%1" == "" (
set BUILD_DIR_OVERRRIDE="%BLENDER_DIR%..\%2"
shift /1
) else if "%1" == "with_tests" (
set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_GTESTS=On
) else if "%1" == "with_opengl_tests" (
set TESTS_CMAKE_ARGS=%TESTS_CMAKE_ARGS% -DWITH_OPENGL_DRAW_TESTS=On -DWITH_OPENGL_RENDER_TESTS=On
set TESTS_CMAKE_ARGS=-DWITH_GTESTS=On
) else if "%1" == "full" (
set TARGET=Full
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^
@@ -52,17 +50,10 @@ if NOT "%1" == "" (
) else if "%1" == "2017pre" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-prerelease
set BUILD_VS_YEAR=2017
) else if "%1" == "2017b" (
set BUILD_VS_YEAR=2017
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2019" (
set BUILD_VS_YEAR=2019
) else if "%1" == "2019pre" (
set BUILD_VS_YEAR=2019
set VSWHERE_ARGS=-prerelease
) else if "%1" == "2019b" (
set BUILD_VS_YEAR=2019
set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools
) else if "%1" == "2015" (
set BUILD_VS_YEAR=2015
) else if "%1" == "packagename" (
@@ -70,8 +61,6 @@ if NOT "%1" == "" (
shift /1
) else if "%1" == "nobuild" (
set NOBUILD=1
) else if "%1" == "nobuildinfo" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_BUILDINFO=Off
) else if "%1" == "pydebug" (
set WITH_PYDEBUG=1
) else if "%1" == "showhash" (
@@ -79,22 +68,12 @@ if NOT "%1" == "" (
REM Non-Build Commands
) else if "%1" == "update" (
SET BUILD_UPDATE=1
set BUILD_UPDATE_SVN=1
set BUILD_UPDATE_GIT=1
) else if "%1" == "code_update" (
SET BUILD_UPDATE=1
set BUILD_UPDATE_SVN=0
set BUILD_UPDATE_GIT=1
) else if "%1" == "ninja" (
SET BUILD_WITH_NINJA=1
) else if "%1" == "clean" (
set MUST_CLEAN=1
) else if "%1" == "verbose" (
set VERBOSE=1
) else if "%1" == "format" (
set FORMAT=1
set FORMAT_ARGS=%2 %3 %4 %5 %6 %7 %8 %9
goto EOF
) else (
echo Command "%1" unknown, aborting!
exit /b 1

View File

@@ -18,8 +18,6 @@ set WINDOWS_ARCH=
set TESTS_CMAKE_ARGS=
set VSWHERE_ARGS=
set BUILD_UPDATE=
set BUILD_UPDATE_GIT=
set BUILD_UPDATE_SVN=
set BUILD_SHOW_HASHES=
set SHOW_HELP=
set BUILD_WITH_NINJA=
@@ -29,4 +27,3 @@ set CLANG_CMAKE_ARGS=
set ASAN_CMAKE_ARGS=
set WITH_PYDEBUG=
set PYDEBUG_CMAKE_ARGS=
set FORMAT=

View File

@@ -9,16 +9,14 @@ echo - bpy
echo.
echo Utilities ^(not associated with building^)
echo - clean ^(Target must be set^)
echo - update ^(Update both SVN and GIT^)
echo - code_update ^(Update only GIT^)
echo - update
echo - nobuild ^(only generate project files^)
echo - showhash ^(Show git hashes of source tree^)
echo - format [path] ^(Format the source using clang-format, path is optional, requires python 3.x to be available^)
echo.
echo Configuration options
echo - verbose ^(enable diagnostic output during configuration^)
echo - with_tests ^(enable building unit tests^)
echo - nobuildinfo ^(disable buildinfo^)
echo - noge ^(disable building game engine and player^)
echo - debug ^(Build an unoptimized debuggable build^)
echo - packagename [newname] ^(override default cpack package name^)
echo - buildir [newdir] ^(override default build folder^)
@@ -30,7 +28,6 @@ echo - 2017b ^(build with visual studio 2017 Build Tools^)
echo.
echo Experimental options
echo - with_opengl_tests ^(enable both the render and draw opengl test suites^)
echo - 2015 ^(build with visual studio 2015^)
echo - clang ^(enable building with clang^)
echo - asan ^(enable asan when building with clang^)

View File

@@ -1,18 +1,20 @@
if "%BUILD_UPDATE_SVN%" == "1" (
if "%SVN%" == "" (
echo svn not found, cannot update libraries
goto UPDATE_GIT
)
"%SVN%" up "%BLENDER_DIR%/../lib/*"
)
:UPDATE_GIT
if "%BUILD_UPDATE_GIT%" == "1" (
if "%GIT%" == "" (
echo Git not found, cannot update code
goto EOF
)
"%GIT%" pull --rebase
"%GIT%" submodule foreach git pull --rebase origin master
)
"%GIT%" submodule update --init --recursive
rem Use blender2.8 branch for submodules that have it.
"%GIT%" submodule foreach "git checkout blender2.8 || git checkout master"
"%GIT%" submodule foreach git pull --rebase origin
:EOF

View File

@@ -57,6 +57,7 @@
import struct
import sys
import getopt # command line arguments handling
from string import Template # strings completion

View File

@@ -1,4 +1,4 @@
# Doxyfile 1.8.15
# Doxyfile 1.8.11
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@@ -17,11 +17,11 @@
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the configuration
# file that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
@@ -93,14 +93,6 @@ ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all generated output in the proper direction.
# Possible values are: None, LTR, RTL and Context.
# The default value is: None.
OUTPUT_TEXT_DIRECTION = None
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
@@ -244,12 +236,7 @@ TAB_SIZE = 4
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines (in the resulting output). You can put ^^ in the value part of an
# alias to insert a newline as if a physical newline was in the original file.
# When you need a literal { or } or , in the value part of an alias you have to
# escape them by means of a backslash (\), this can lead to conflicts with the
# commands \{ and \} for these it is advised to use the version @{ and @} or use
# a double escape (\\{ and \\})
# newlines.
ALIASES =
@@ -287,26 +274,17 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
# sources only. Doxygen will then generate output that is more tailored for that
# language. For instance, namespaces will be presented as modules, types will be
# separated into more groups, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_SLICE = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
# tries to guess whether the code is fixed or free formatted code, this is the
# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
# .inc files as Fortran files (default is PHP), and .f files as C (default is
# Fortran), use: inc=Fortran f=C.
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
@@ -317,7 +295,7 @@ EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See https://daringfireball.net/projects/markdown/ for details.
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
@@ -325,15 +303,6 @@ EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 0.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
TOC_INCLUDE_HEADINGS = 0
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
@@ -359,7 +328,7 @@ BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
@@ -762,7 +731,7 @@ WARNINGS = YES
# will automatically be disabled.
# The default value is: YES.
WARN_IF_UNDOCUMENTED = NO
WARN_IF_UNDOCUMENTED = YES
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
@@ -775,8 +744,7 @@ WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO, doxygen will only warn about wrong or incomplete
# parameter documentation, but not about the absence of documentation. If
# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
# parameter documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
@@ -824,7 +792,7 @@ INPUT = doxygen.main.h \
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
@@ -841,8 +809,8 @@ INPUT_ENCODING = UTF-8
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl,
# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js.
FILE_PATTERNS =
@@ -859,7 +827,7 @@ RECURSIVE = YES
# Note that relative paths are relative to the directory from which doxygen is
# run.
EXCLUDE = ../../build_files \
EXCLUDE = ../../build_files, \
../../release
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
@@ -1000,7 +968,7 @@ INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# entity all documented functions referencing it will be listed.
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
@@ -1032,12 +1000,12 @@ SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see https://www.gnu.org/software/global/global.html). You will need version
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
@@ -1213,17 +1181,6 @@ HTML_COLORSTYLE_GAMMA = 79
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via Javascript. If disabled, the navigation index will
# consists of multiple levels of tabs that are statically embedded in every HTML
# page. Disable this option to support browsers that do not have Javascript,
# like the Qt help browser.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_MENUS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
@@ -1247,13 +1204,13 @@ HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: https://developer.apple.com/xcode/), introduced with OSX
# 10.5 (Leopard). To create a documentation set, doxygen will generate a
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
# genXcode/_index.html for more information.
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
@@ -1292,7 +1249,7 @@ DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
@@ -1368,7 +1325,7 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1376,7 +1333,7 @@ QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1385,7 +1342,7 @@ QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1393,7 +1350,7 @@ QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@@ -1401,7 +1358,7 @@ QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
@@ -1494,7 +1451,7 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 10
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
@@ -1506,7 +1463,7 @@ FORMULA_FONTSIZE = 10
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# https://www.mathjax.org) which uses client side Javascript for the rendering
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
@@ -1533,8 +1490,8 @@ MATHJAX_FORMAT = HTML-CSS
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from https://www.mathjax.org before deployment.
# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://www.mathjax.org/mathjax
@@ -1595,7 +1552,7 @@ SERVER_BASED_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: https://xapian.org/).
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
@@ -1608,7 +1565,7 @@ EXTERNAL_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: https://xapian.org/). See the section "External Indexing and
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
@@ -1660,34 +1617,21 @@ LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when not enabling USE_PDFLATEX the default is latex when enabling
# USE_PDFLATEX the default is pdflatex and when in the later case latex is
# chosen this is overwritten by pdflatex. For specific output languages the
# default can have been set differently, this depends on the implementation of
# the output language.
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# Note: This tag is used in the Makefile / make.bat.
# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
# (.tex).
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
# generate index for LaTeX.
# Note: This tag is used in the generated output file (.tex).
# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
# The default value is: \makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_MAKEINDEX_CMD = \makeindex
# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
@@ -1822,14 +1766,6 @@ LATEX_BIB_STYLE = plain
LATEX_TIMESTAMP = NO
# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
# path from which the emoji images will be read. If a relative path is entered,
# it will be relative to the LATEX_OUTPUT directory. If left blank the
# LATEX_OUTPUT directory will be used.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@@ -1869,9 +1805,9 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
@@ -1880,8 +1816,8 @@ RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's configuration file. A template extensions file can be
# generated using doxygen -e rtf extensionFile.
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
@@ -1967,13 +1903,6 @@ XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
# namespace members in file scope as well, matching the HTML output.
# The default value is: NO.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
@@ -2006,9 +1935,9 @@ DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
# the structure of the code including all documentation. Note that this feature
# is still experimental and incomplete at the moment.
# AutoGen Definitions (see http://autogen.sf.net) file that captures the
# structure of the code including all documentation. Note that this feature is
# still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
@@ -2431,11 +2360,6 @@ DIAFILE_DIRS =
PLANTUML_JAR_PATH =
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
# configuration file for plantuml.
PLANTUML_CFG_FILE =
# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.

View File

@@ -71,7 +71,7 @@
* \ingroup audaspace
*/
/** \defgroup audsrc Audaspace SRC
*
* \ingroup audaspace
*/
/** \defgroup audffmpeg Audaspace FFMpeg
@@ -91,3 +91,4 @@
* \ingroup intern GUI
* \ref GHOSTPage
*/

View File

@@ -1,4 +1,10 @@
/** \defgroup blenderplayer Blender Player */
/** \defgroup blc bad level calls
* \ingroup blenderplayer
*/
/** \defgroup render Rendering
* \ingroup blender
*/
@@ -23,14 +29,15 @@
* \ingroup python
*/
/** \defgroup blpluginapi Blender pluginapi
* \ingroup blender
* \attention not in use currently
*/
/* ================================ */
/** \defgroup blender Blender */
/** \defgroup balembic BlenderAlembic
* \ingroup blender
*/
/** \defgroup blt BlenTranslation
* \ingroup blender
*/
@@ -74,10 +81,6 @@
* \ingroup blender
*/
/** \defgroup shader_fx Shader Effects
* \ingroup blender
*/
/** \defgroup data DNA, RNA and .blend access*/
/** \defgroup gpu GPU

View File

@@ -65,7 +65,7 @@ fw('.TH "BLENDER" "1" "%s" "Blender %s"\n' % (date_string, blender_version.repla
fw('''
.SH NAME
blender \- a full-featured 3D application''')
blender \- a 3D modelling and rendering package''')
fw('''
.SH SYNOPSIS
@@ -76,9 +76,9 @@ fw('''
.SH DESCRIPTION
.PP
.B blender
is a full-featured 3D application. It supports the entirety of the 3D pipeline - modeling, rigging, animation, simulation, rendering, compositing, motion tracking, and video editing.
is a 3D modelling and rendering package. Originating as the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
Use Blender to create 3D images and animations, films and commercials, content for games, architectural and industrial visualizatons, and scientific visualizations.
Use Blender to create TV commercials, to make technical visualizations, business graphics, to create content for games, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
http://www.blender.org''')

View File

@@ -6,6 +6,7 @@ Example of using the blf module. For this module to work we
need to use the OpenGL wrapper :class:`~bgl` as well.
"""
# import stand alone modules
import bgl
import blf
import bpy

View File

@@ -99,9 +99,10 @@ bm.free()
# Add the mesh to the scene
scene = bpy.context.scene
obj = bpy.data.objects.new("Object", me)
bpy.context.collection.objects.link(obj)
scene.objects.link(obj)
# Select and make active
bpy.context.view_layer.objects.active = obj
obj.select_set(True)
scene.objects.active = obj
obj.select = True

View File

@@ -19,6 +19,9 @@ if "Cube" in bpy.data.meshes:
# write images into a file next to the blend
import os
with open(os.path.splitext(bpy.data.filepath)[0] + ".txt", 'w') as fs:
file = open(os.path.splitext(bpy.data.filepath)[0] + ".txt", 'w')
for image in bpy.data.images:
fs.write("%s %d x %d\n" % (image.filepath, image.size[0], image.size[1]))
file.write("%s %d x %d\n" % (image.filepath, image.size[0], image.size[1]))
file.close()

View File

@@ -20,5 +20,5 @@ you would pass ``{'active_object': object}``.
# remove all objects in scene rather than the selected ones
import bpy
override = bpy.context.copy()
override['selected_objects'] = list(bpy.context.scene.objects)
override['selected_bases'] = list(bpy.context.scene.object_bases)
bpy.ops.object.delete(override)

View File

@@ -15,15 +15,13 @@ class OBJECT_OT_property_example(bpy.types.Operator):
bl_label = "Property Example"
bl_options = {'REGISTER', 'UNDO'}
my_float: bpy.props.FloatProperty(name="Some Floating Point")
my_bool: bpy.props.BoolProperty(name="Toggle Option")
my_string: bpy.props.StringProperty(name="String Value")
my_float = bpy.props.FloatProperty(name="Some Floating Point")
my_bool = bpy.props.BoolProperty(name="Toggle Option")
my_string = bpy.props.StringProperty(name="String Value")
def execute(self, context):
self.report(
{'INFO'}, 'F: %.2f B: %s S: %r' %
(self.my_float, self.my_bool, self.my_string)
)
self.report({'INFO'}, 'F: %.2f B: %s S: %r' %
(self.my_float, self.my_bool, self.my_string))
print('My float:', self.my_float)
print('My bool:', self.my_bool)
print('My string:', self.my_string)
@@ -34,8 +32,8 @@ class OBJECT_PT_property_example(bpy.types.Panel):
bl_idname = "object_PT_property_example"
bl_label = "Property Example"
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Tool"
bl_region_type = 'TOOLS'
bl_category = "Tools"
def draw(self, context):
# You can set the property values that should be used when the user
@@ -55,8 +53,5 @@ bpy.utils.register_class(OBJECT_OT_property_example)
bpy.utils.register_class(OBJECT_PT_property_example)
# Demo call. Be sure to also test in the 3D Viewport.
bpy.ops.object.property_example(
my_float=47,
my_bool=True,
my_string="Shouldn't that be 327?",
)
bpy.ops.object.property_example(my_float=47, my_bool=True,
my_string="Shouldn't that be 327?")

View File

@@ -10,14 +10,15 @@ import bpy
class MaterialSettings(bpy.types.PropertyGroup):
my_int: bpy.props.IntProperty()
my_float: bpy.props.FloatProperty()
my_string: bpy.props.StringProperty()
my_int = bpy.props.IntProperty()
my_float = bpy.props.FloatProperty()
my_string = bpy.props.StringProperty()
bpy.utils.register_class(MaterialSettings)
bpy.types.Material.my_settings = bpy.props.PointerProperty(type=MaterialSettings)
bpy.types.Material.my_settings = \
bpy.props.PointerProperty(type=MaterialSettings)
# test the new settings work
material = bpy.data.materials[0]

View File

@@ -9,17 +9,18 @@ Custom properties can be added to any subclass of an :class:`ID`,
import bpy
# Assign a collection.
# Assign a collection
class SceneSettingItem(bpy.types.PropertyGroup):
name: bpy.props.StringProperty(name="Test Property", default="Unknown")
value: bpy.props.IntProperty(name="Test Property", default=22)
name = bpy.props.StringProperty(name="Test Prop", default="Unknown")
value = bpy.props.IntProperty(name="Test Prop", default=22)
bpy.utils.register_class(SceneSettingItem)
bpy.types.Scene.my_settings = bpy.props.CollectionProperty(type=SceneSettingItem)
bpy.types.Scene.my_settings = \
bpy.props.CollectionProperty(type=SceneSettingItem)
# Assume an armature object selected.
# Assume an armature object selected
print("Adding 2 values!")
my_item = bpy.context.scene.my_settings.add()

View File

@@ -12,7 +12,7 @@ like Blender's existing properties.
import bpy
# Assign a custom property to an existing type.
bpy.types.Material.custom_float = bpy.props.FloatProperty(name="Test Property")
bpy.types.Material.custom_float = bpy.props.FloatProperty(name="Test Prob")
# Test the property is there.
bpy.data.materials[0].custom_float = 5.0

View File

@@ -22,15 +22,15 @@ class ExampleAddonPreferences(AddonPreferences):
# when defining this in a submodule of a python package.
bl_idname = __name__
filepath: StringProperty(
filepath = StringProperty(
name="Example File Path",
subtype='FILE_PATH',
)
number: IntProperty(
number = IntProperty(
name="Example Number",
default=4,
)
boolean: BoolProperty(
boolean = BoolProperty(
name="Example Boolean",
default=False,
)
@@ -50,8 +50,8 @@ class OBJECT_OT_addon_prefs_example(Operator):
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context):
preferences = context.preferences
addon_prefs = preferences.addons[__name__].preferences
user_preferences = context.user_preferences
addon_prefs = user_preferences.addons[__name__].preferences
info = ("Path: %s, Number: %d, Boolean %r" %
(addon_prefs.filepath, addon_prefs.number, addon_prefs.boolean))

View File

@@ -1,60 +0,0 @@
"""
Dependency graph: Evaluated ID example
++++++++++++++++++++++++++++++++++++++
This example demonstrates access to the evaluated ID (such as object, material, etc.) state from
an original ID.
This is needed every time one needs to access state with animation, constraints, and modifiers
taken into account.
"""
import bpy
class OBJECT_OT_evaluated_example(bpy.types.Operator):
"""Access evaluated object state and do something with it"""
bl_label = "DEG Access Evaluated Object"
bl_idname = "object.evaluated_example"
def execute(self, context):
# This is an original object. Its data does not have any modifiers applied.
obj = context.object
if obj is None or obj.type != 'MESH':
self.report({'INFO'}, "No active mesh object to get info from")
return {'CANCELLED'}
# Evaluated object exists within a specific dependency graph.
# We will request evaluated object from the dependency graph which corresponds to the
# current scene and view layer.
#
# NOTE: This call ensure the dependency graph is fully evaluated. This might be expensive
# if changes were made made to the scene, but is needed to ensure no dangling or incorrect
# pointers are exposed.
depsgraph = context.evaluated_depsgraph_get()
# Actually request evaluated object.
#
# This object has animation and drivers applied on it, together with constraints and
# modifiers.
#
# For mesh objects the object.data will be a mesh with all modifiers applied.
# This means that in access to vertices or faces after modifier stack happens via fields of
# object_eval.object.
#
# For other types of objects the object_eval.data does not have modifiers applied on it,
# but has animation applied.
#
# NOTE: All ID types have `evaluated_get()`, including materials, node trees, worlds.
object_eval = obj.evaluated_get(depsgraph)
mesh_eval = object_eval.data
self.report({'INFO'}, f"Number of evaluated vertices: {len(mesh_eval.vertices)}")
return {'FINISHED'}
def register():
bpy.utils.register_class(OBJECT_OT_evaluated_example)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_evaluated_example)
if __name__ == "__main__":
register()

View File

@@ -1,45 +0,0 @@
"""
Dependency graph: Original object example
+++++++++++++++++++++++++++++++++++++++++
This example demonstrates access to the original ID.
Such access is needed to check whether object is selected, or to compare pointers.
"""
import bpy
class OBJECT_OT_original_example(bpy.types.Operator):
"""Access original object and do something with it"""
bl_label = "DEG Access Original Object"
bl_idname = "object.original_example"
def check_object_selected(self, object_eval):
# Selection depends on a context and is only valid for original objects. This means we need
# to request the original object from the known evaluated one.
#
# NOTE: All ID types have an `original` field.
obj = object_eval.original
return obj.select_get()
def execute(self, context):
# NOTE: It seems redundant to iterate over original objects to request evaluated ones
# just to get original back. But we want to keep example as short as possible, but in real
# world there are cases when evaluated object is coming from a more meaningful source.
depsgraph = context.evaluated_depsgraph_get()
for obj in context.editable_objects:
object_eval = obj.evaluated_get(depsgraph)
if self.check_object_selected(object_eval):
self.report({'INFO'}, f"Object is selected: {object_eval.name}")
return {'FINISHED'}
def register():
bpy.utils.register_class(OBJECT_OT_original_example)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_original_example)
if __name__ == "__main__":
register()

View File

@@ -1,42 +0,0 @@
"""
Dependency graph: Iterate over all object instances
+++++++++++++++++++++++++++++++++++++++++++++++++++
Sometimes it is needed to know all the instances with their matrices (for example, when writing an
exporter or a custom render engine).
This example shows how to access all objects and instances in the scene.
"""
import bpy
class OBJECT_OT_object_instances(bpy.types.Operator):
"""Access original object and do something with it"""
bl_label = "DEG Iterate Object Instances"
bl_idname = "object.object_instances"
def execute(self, context):
depsgraph = context.evaluated_depsgraph_get()
for object_instance in depsgraph.object_instances:
# This is an object which is being instanced.
obj = object_instance.object
# `is_instance` denotes whether the object is coming from instances (as an opposite of
# being an emitting object. )
if not object_instance.is_instance:
print(f"Object {obj.name} at {object_instance.matrix_world}")
else:
# Instanced will additionally have fields like uv, random_id and others which are
# specific for instances. See Python API for DepsgraphObjectInstance for details,
print(f"Instance of {obj.name} at {object_instance.matrix_world}")
return {'FINISHED'}
def register():
bpy.utils.register_class(OBJECT_OT_object_instances)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_object_instances)
if __name__ == "__main__":
register()

View File

@@ -1,69 +0,0 @@
"""
Dependency graph: Object.to_mesh()
+++++++++++++++++++++++++++++++++++
Function to get a mesh from any object with geometry. It is typically used by exporters, render
engines and tools that need to access the evaluated mesh as displayed in the viewport.
Object.to_mesh() is closely interacting with dependency graph: its behavior depends on whether it
is used on original or evaluated object.
When is used on original object, the result mesh is calculated from the object without taking
animation or modifiers into account:
- For meshes this is similar to duplicating the source mesh.
- For curves this disables own modifiers, and modifiers of objects used as bevel and taper.
- For metaballs this produces an empty mesh since polygonization is done as a modifier evaluation.
When is used on evaluated object all modifiers are taken into account.
.. note:: The result mesh is owned by the object. It can be freed by calling `object.to_mesh_clear()`.
.. note::
The result mesh must be treated as temporary, and can not be referenced from objects in the main
database. If the mesh intended to be used in a persistent manner use bpy.data.meshes.new_from_object()
instead.
.. note:: If object does not have geometry (i.e. camera) the functions returns None.
"""
import bpy
class OBJECT_OT_object_to_mesh(bpy.types.Operator):
"""Convert selected object to mesh and show number of vertices"""
bl_label = "DEG Object to Mesh"
bl_idname = "object.object_to_mesh"
def execute(self, context):
# Access input original object.
obj = context.object
if obj is None:
self.report({'INFO'}, "No active mesh object to convert to mesh")
return {'CANCELLED'}
# Avoid annoying None checks later on.
if obj.type not in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META'}:
self.report({'INFO'}, "Object can not be converted to mesh")
return {'CANCELLED'}
depsgraph = context.evaluated_depsgraph_get()
# Invoke to_mesh() for original object.
mesh_from_orig = obj.to_mesh()
self.report({'INFO'}, f"{len(mesh_from_orig.vertices)} in new mesh without modifiers.")
# Remove temporary mesh.
obj.to_mesh_clear()
# Invoke to_mesh() for evaluated object.
object_eval = obj.evaluated_get(depsgraph)
mesh_from_eval = object_eval.to_mesh()
self.report({'INFO'}, f"{len(mesh_from_eval.vertices)} in new mesh with modifiers.")
# Remove temporary mesh.
object_eval.to_mesh_clear()
return {'FINISHED'}
def register():
bpy.utils.register_class(OBJECT_OT_object_to_mesh)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_object_to_mesh)
if __name__ == "__main__":
register()

View File

@@ -1,57 +0,0 @@
"""
Dependency graph: bpy.data.meshes.new_from_object()
+++++++++++++++++++++++++++++++++++++++++++++++++++
Function to copy a new mesh from any object with geometry. The mesh is added to the main
database and can be referenced by objects. Typically used by tools that create new objects
or apply modifiers.
When is used on original object, the result mesh is calculated from the object without taking
animation or modifiers into account:
- For meshes this is similar to duplicating the source mesh.
- For curves this disables own modifiers, and modifiers of objects used as bevel and taper.
- For metaballs this produces an empty mesh since polygonization is done as a modifier evaluation.
When is used on evaluated object all modifiers are taken into account.
All the references (such as materials) are re-mapped to original. This ensures validity and
consistency of the main database.
.. note:: If object does not have geometry (i.e. camera) the functions returns None.
"""
import bpy
class OBJECT_OT_mesh_from_object(bpy.types.Operator):
"""Convert selected object to mesh and show number of vertices"""
bl_label = "DEG Mesh From Object"
bl_idname = "object.mesh_from_object"
def execute(self, context):
# Access input original object.
obj = context.object
if obj is None:
self.report({'INFO'}, "No active mesh object to convert to mesh")
return {'CANCELLED'}
# Avoid annoying None checks later on.
if obj.type not in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META'}:
self.report({'INFO'}, "Object can not be converted to mesh")
return {'CANCELLED'}
depsgraph = context.evaluated_depsgraph_get()
object_eval = obj.evaluated_get(depsgraph)
mesh_from_eval = bpy.data.meshes.new_from_object(object_eval)
self.report({'INFO'}, f"{len(mesh_from_eval.vertices)} in new mesh, and is ready for use!")
return {'FINISHED'}
def register():
bpy.utils.register_class(OBJECT_OT_mesh_from_object)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_mesh_from_object)
if __name__ == "__main__":
register()

View File

@@ -1,61 +0,0 @@
"""
Dependency graph: Simple exporter
+++++++++++++++++++++++++++++++++
This example is a combination of all previous ones, and shows how to write a simple exporter
script.
"""
import bpy
class OBJECT_OT_simple_exporter(bpy.types.Operator):
"""Simple (fake) exporter of selected objects"""
bl_label = "DEG Export Selected"
bl_idname = "object.simple_exporter"
apply_modifiers: bpy.props.BoolProperty(name="Apply Modifiers")
def execute(self, context):
depsgraph = context.evaluated_depsgraph_get()
for object_instance in depsgraph.object_instances:
if not self.is_object_instance_from_selected(object_instance):
# We only export selected objects
continue
# NOTE: This will create a mesh for every instance, which is not ideal at all. In
# reality destination format will support some sort of instancing mechanism, so the
# code here will simply say "instance this object at object_instance.matrix_world".
mesh = self.create_mesh_for_object_instance(object_instance)
if mesh is None:
# Happens for non-geometry objects.
continue
print(f"Exporting mesh with {len(mesh.vertices)} vertices "
f"at {object_instance.matrix_world}")
object_instace.to_mesh_clear()
return {'FINISHED'}
def is_object_instance_from_selected(self, object_instance):
# For instanced objects we check selection of their instancer (more accurately: check
# selection status of the original object corresponding to the instancer).
if object_instance.parent:
return object_instance.parent.original.select_get()
# For non-instanced objects we check selection state of the original object.
return object_instance.object.original.select_get()
def create_mesh_for_object_instance(self, object_instance):
if self.apply_modifiers:
return object_instance.object.to_mesh()
else:
return object_instance.object.original.to_mesh()
def register():
bpy.utils.register_class(OBJECT_OT_simple_exporter)
def unregister():
bpy.utils.unregister_class(OBJECT_OT_simple_exporter)
if __name__ == "__main__":
register()

View File

@@ -24,7 +24,7 @@ class SubMenu(bpy.types.Menu):
layout.separator()
# expand each operator option into this menu
layout.operator_enum("object.light_add", "type")
layout.operator_enum("object.lamp_add", "type")
layout.separator()

View File

@@ -20,7 +20,7 @@ class OBJECT_MT_display_presets(Menu):
bl_label = "Object Display Presets"
preset_subdir = "object/display"
preset_operator = "script.execute_preset"
draw = Menu.draw_preset
display = Menu.display_preset
class AddPresetObjectDisplay(AddPresetBase, Operator):
@@ -54,8 +54,8 @@ def panel_func(self, context):
row = layout.row(align=True)
row.menu(OBJECT_MT_display_presets.__name__, text=OBJECT_MT_display_presets.bl_label)
row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_IN')
row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_OUT').remove_active = True
row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOMIN')
row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOMOUT').remove_active = True
classes = (

View File

@@ -16,7 +16,6 @@ import bpy
class CyclesNodeTree(bpy.types.NodeTree):
""" This operator is only visible when Cycles is the selected render engine"""
bl_label = "Cycles Node Tree"
bl_icon = 'NONE'
@classmethod
def poll(cls, context):

View File

@@ -7,6 +7,7 @@ object, placing it into a view layer, selecting it and making it active.
"""
import bpy
from mathutils import Matrix
view_layer = bpy.context.view_layer

View File

@@ -28,8 +28,8 @@ class SimpleMouseOperator(bpy.types.Operator):
bl_idname = "wm.mouse_position"
bl_label = "Invoke Mouse Operator"
x: bpy.props.IntProperty()
y: bpy.props.IntProperty()
x = bpy.props.IntProperty()
y = bpy.props.IntProperty()
def execute(self, context):
# rather than printing, use the report function,

View File

@@ -21,7 +21,7 @@ class ExportSomeData(bpy.types.Operator):
bl_idname = "export.some_data"
bl_label = "Export Some Data"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
filepath = bpy.props.StringProperty(subtype="FILE_PATH")
@classmethod
def poll(cls, context):

View File

@@ -11,15 +11,13 @@ class DialogOperator(bpy.types.Operator):
bl_idname = "object.dialog_operator"
bl_label = "Simple Dialog Operator"
my_float: bpy.props.FloatProperty(name="Some Floating Point")
my_bool: bpy.props.BoolProperty(name="Toggle Option")
my_string: bpy.props.StringProperty(name="String Value")
my_float = bpy.props.FloatProperty(name="Some Floating Point")
my_bool = bpy.props.BoolProperty(name="Toggle Option")
my_string = bpy.props.StringProperty(name="String Value")
def execute(self, context):
message = (
"Popup Values: %f, %d, '%s'" %
message = "Popup Values: %f, %d, '%s'" % \
(self.my_float, self.my_bool, self.my_string)
)
self.report({'INFO'}, message)
return {'FINISHED'}
@@ -30,5 +28,5 @@ class DialogOperator(bpy.types.Operator):
bpy.utils.register_class(DialogOperator)
# Test call.
# test call
bpy.ops.object.dialog_operator('INVOKE_DEFAULT')

View File

@@ -16,11 +16,11 @@ class CustomDrawOperator(bpy.types.Operator):
bl_idname = "object.custom_draw"
bl_label = "Simple Modal Operator"
filepath: bpy.props.StringProperty(subtype="FILE_PATH")
filepath = bpy.props.StringProperty(subtype="FILE_PATH")
my_float: bpy.props.FloatProperty(name="Float")
my_bool: bpy.props.BoolProperty(name="Toggle Option")
my_string: bpy.props.StringProperty(name="String Value")
my_float = bpy.props.FloatProperty(name="Float")
my_bool = bpy.props.BoolProperty(name="Toggle Option")
my_string = bpy.props.StringProperty(name="String Value")
def execute(self, context):
print("Test", self)

View File

@@ -11,8 +11,8 @@ will not run. Modal operators are especially useful for interactive tools, an
operator can have its own state where keys toggle options as the operator runs.
Grab, Rotate, Scale, and Fly-Mode are examples of modal operators.
:class:`Operator.invoke` is used to initialize the operator as being active
by returning ``{'RUNNING_MODAL'}``, initializing the modal loop.
:class:`Operator.invoke` is used to initialize the operator as being by
returning ``{'RUNNING_MODAL'}``, initializing the modal loop.
Notice ``__init__()`` and ``__del__()`` are declared.
For other operator types they are not useful but for modal operators they will

View File

@@ -14,7 +14,7 @@ class SearchEnumOperator(bpy.types.Operator):
bl_label = "Search Enum Operator"
bl_property = "my_search"
my_search: EnumProperty(
my_search = EnumProperty(
name="My Search",
items=(
('FOO', "Foo", ""),

View File

@@ -22,11 +22,17 @@ class ObjectSelectPanel(bpy.types.Panel):
def draw_header(self, context):
layout = self.layout
layout.label(text="My Select Panel")
obj = context.object
layout.prop(obj, "select", text="")
def draw(self, context):
layout = self.layout
obj = context.object
row = layout.row()
row.prop(obj, "hide_select")
row.prop(obj, "hide_render")
box = layout.box()
box.label(text="Selection Tools")
box.operator("object.select_all").action = 'TOGGLE'

View File

@@ -9,8 +9,7 @@ import bpy
class View3DPanel:
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "Tool"
bl_region_type = 'TOOLS'
@classmethod
def poll(cls, context):

View File

@@ -28,8 +28,8 @@ import bpy
class MyPropertyGroup(bpy.types.PropertyGroup):
custom_1: bpy.props.FloatProperty(name="My Float")
custom_2: bpy.props.IntProperty(name="My Int")
custom_1 = bpy.props.FloatProperty(name="My Float")
custom_2 = bpy.props.IntProperty(name="My Int")
bpy.utils.register_class(MyPropertyGroup)

View File

@@ -4,216 +4,82 @@ Simple Render Engine
"""
import bpy
import bgl
class CustomRenderEngine(bpy.types.RenderEngine):
# These three members are used by blender to set up the
# RenderEngine; define its internal name, visible name and capabilities.
bl_idname = "CUSTOM"
bl_label = "Custom"
bl_idname = "custom_renderer"
bl_label = "Flat Color Renderer"
bl_use_preview = True
# Init is called whenever a new render engine instance is created. Multiple
# instances may exist at the same time, for example for a viewport and final
# render.
def __init__(self):
self.scene_data = None
self.draw_data = None
# When the render engine instance is destroy, this is called. Clean up any
# render engine data here, for example stopping running render threads.
def __del__(self):
pass
# This is the method called by Blender for both final renders (F12) and
# small preview for materials, world and lights.
def render(self, depsgraph):
scene = depsgraph.scene
# This is the only method called by blender, in this example
# we use it to detect preview rendering and call the implementation
# in another method.
def render(self, scene):
scale = scene.render.resolution_percentage / 100.0
self.size_x = int(scene.render.resolution_x * scale)
self.size_y = int(scene.render.resolution_y * scale)
# Fill the render result with a flat color. The framebuffer is
# defined as a list of pixels, each pixel itself being a list of
# R,G,B,A values.
if self.is_preview:
color = [0.1, 0.2, 0.1, 1.0]
self.render_preview(scene)
else:
color = [0.2, 0.1, 0.1, 1.0]
self.render_scene(scene)
# In this example, we fill the preview renders with a flat green color.
def render_preview(self, scene):
pixel_count = self.size_x * self.size_y
rect = [color] * pixel_count
# The framebuffer is defined as a list of pixels, each pixel
# itself being a list of R,G,B,A values
green_rect = [[0.0, 1.0, 0.0, 1.0]] * pixel_count
# Here we write the pixel values to the RenderResult
result = self.begin_result(0, 0, self.size_x, self.size_y)
layer = result.layers[0].passes["Combined"]
layer.rect = rect
layer.rect = green_rect
self.end_result(result)
# For viewport renders, this method gets called once at the start and
# whenever the scene or 3D viewport changes. This method is where data
# should be read from Blender in the same thread. Typically a render
# thread will be started to do the work while keeping Blender responsive.
def view_update(self, context, depsgraph):
region = context.region
view3d = context.space_data
scene = depsgraph.scene
# In this example, we fill the full renders with a flat blue color.
def render_scene(self, scene):
pixel_count = self.size_x * self.size_y
# Get viewport dimensions
dimensions = region.width, region.height
# The framebuffer is defined as a list of pixels, each pixel
# itself being a list of R,G,B,A values
blue_rect = [[0.0, 0.0, 1.0, 1.0]] * pixel_count
if not self.scene_data:
# First time initialization
self.scene_data = []
first_time = True
# Here we write the pixel values to the RenderResult
result = self.begin_result(0, 0, self.size_x, self.size_y)
layer = result.layers[0].passes["Combined"]
layer.rect = blue_rect
self.end_result(result)
# Loop over all datablocks used in the scene.
for datablock in depsgraph.ids:
pass
else:
first_time = False
# Test which datablocks changed
for update in depsgraph.updates:
print("Datablock updated: ", update.id.name)
# Test if any material was added, removed or changed.
if depsgraph.id_type_updated('MATERIAL'):
print("Materials updated")
# Loop over all object instances in the scene.
if first_time or depsgraph.id_type_updated('OBJECT'):
for instance in depsgraph.object_instances:
pass
# For viewport renders, this method is called whenever Blender redraws
# the 3D viewport. The renderer is expected to quickly draw the render
# with OpenGL, and not perform other expensive work.
# Blender will draw overlays for selection and editing on top of the
# rendered image automatically.
def view_draw(self, context, depsgraph):
region = context.region
scene = depsgraph.scene
# Get viewport dimensions
dimensions = region.width, region.height
# Bind shader that converts from scene linear to display space,
bgl.glEnable(bgl.GL_BLEND)
bgl.glBlendFunc(bgl.GL_ONE, bgl.GL_ONE_MINUS_SRC_ALPHA);
self.bind_display_space_shader(scene)
if not self.draw_data or self.draw_data.dimensions != dimensions:
self.draw_data = CustomDrawData(dimensions)
self.draw_data.draw()
self.unbind_display_space_shader()
bgl.glDisable(bgl.GL_BLEND)
class CustomDrawData:
def __init__(self, dimensions):
# Generate dummy float image buffer
self.dimensions = dimensions
width, height = dimensions
pixels = [0.1, 0.2, 0.1, 1.0] * width * height
pixels = bgl.Buffer(bgl.GL_FLOAT, width * height * 4, pixels)
# Generate texture
self.texture = bgl.Buffer(bgl.GL_INT, 1)
bgl.glGenTextures(1, self.texture)
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, self.texture[0])
bgl.glTexImage2D(bgl.GL_TEXTURE_2D, 0, bgl.GL_RGBA16F, width, height, 0, bgl.GL_RGBA, bgl.GL_FLOAT, pixels)
bgl.glTexParameteri(bgl.GL_TEXTURE_2D, bgl.GL_TEXTURE_MIN_FILTER, bgl.GL_LINEAR)
bgl.glTexParameteri(bgl.GL_TEXTURE_2D, bgl.GL_TEXTURE_MAG_FILTER, bgl.GL_LINEAR)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, 0)
# Bind shader that converts from scene linear to display space,
# use the scene's color management settings.
shader_program = bgl.Buffer(bgl.GL_INT, 1)
bgl.glGetIntegerv(bgl.GL_CURRENT_PROGRAM, shader_program);
# Generate vertex array
self.vertex_array = bgl.Buffer(bgl.GL_INT, 1)
bgl.glGenVertexArrays(1, self.vertex_array)
bgl.glBindVertexArray(self.vertex_array[0])
texturecoord_location = bgl.glGetAttribLocation(shader_program[0], "texCoord");
position_location = bgl.glGetAttribLocation(shader_program[0], "pos");
bgl.glEnableVertexAttribArray(texturecoord_location);
bgl.glEnableVertexAttribArray(position_location);
# Generate geometry buffers for drawing textured quad
position = [0.0, 0.0, width, 0.0, width, height, 0.0, height]
position = bgl.Buffer(bgl.GL_FLOAT, len(position), position)
texcoord = [0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0]
texcoord = bgl.Buffer(bgl.GL_FLOAT, len(texcoord), texcoord)
self.vertex_buffer = bgl.Buffer(bgl.GL_INT, 2)
bgl.glGenBuffers(2, self.vertex_buffer)
bgl.glBindBuffer(bgl.GL_ARRAY_BUFFER, self.vertex_buffer[0])
bgl.glBufferData(bgl.GL_ARRAY_BUFFER, 32, position, bgl.GL_STATIC_DRAW)
bgl.glVertexAttribPointer(position_location, 2, bgl.GL_FLOAT, bgl.GL_FALSE, 0, None)
bgl.glBindBuffer(bgl.GL_ARRAY_BUFFER, self.vertex_buffer[1])
bgl.glBufferData(bgl.GL_ARRAY_BUFFER, 32, texcoord, bgl.GL_STATIC_DRAW)
bgl.glVertexAttribPointer(texturecoord_location, 2, bgl.GL_FLOAT, bgl.GL_FALSE, 0, None)
bgl.glBindBuffer(bgl.GL_ARRAY_BUFFER, 0)
bgl.glBindVertexArray(0)
def __del__(self):
bgl.glDeleteBuffers(2, self.vertex_buffer)
bgl.glDeleteVertexArrays(1, self.vertex_array)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, 0)
bgl.glDeleteTextures(1, self.texture)
def draw(self):
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, self.texture[0])
bgl.glBindVertexArray(self.vertex_array[0])
bgl.glDrawArrays(bgl.GL_TRIANGLE_FAN, 0, 4);
bgl.glBindVertexArray(0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, 0)
# RenderEngines also need to tell UI Panels that they are compatible with.
# We recommend to enable all panels marked as BLENDER_RENDER, and then
# exclude any panels that are replaced by custom panels registered by the
# render engine, or that are not supported.
def get_panels():
exclude_panels = {
'VIEWLAYER_PT_filter',
'VIEWLAYER_PT_layer_passes',
}
panels = []
for panel in bpy.types.Panel.__subclasses__():
if hasattr(panel, 'COMPAT_ENGINES') and 'BLENDER_RENDER' in panel.COMPAT_ENGINES:
if panel.__name__ not in exclude_panels:
panels.append(panel)
return panels
def register():
# Register the RenderEngine
bpy.utils.register_class(CustomRenderEngine)
for panel in get_panels():
panel.COMPAT_ENGINES.add('CUSTOM')
# RenderEngines also need to tell UI Panels that they are compatible
# Otherwise most of the UI will be empty when the engine is selected.
# In this example, we need to see the main render image button and
# the material preview panel.
from bl_ui import (
properties_render,
properties_material,
)
properties_render.RENDER_PT_render.COMPAT_ENGINES.add(CustomRenderEngine.bl_idname)
properties_material.MATERIAL_PT_preview.COMPAT_ENGINES.add(CustomRenderEngine.bl_idname)
def unregister():
bpy.utils.unregister_class(CustomRenderEngine)
for panel in get_panels():
if 'CUSTOM' in panel.COMPAT_ENGINES:
panel.COMPAT_ENGINES.remove('CUSTOM')
from bl_ui import (
properties_render,
properties_material,
)
properties_render.RENDER_PT_render.COMPAT_ENGINES.remove(CustomRenderEngine.bl_idname)
properties_material.MATERIAL_PT_preview.COMPAT_ENGINES.remove(CustomRenderEngine.bl_idname)
if __name__ == "__main__":

View File

@@ -40,6 +40,18 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
layout.prop(ma, "name", text="", emboss=False, icon_value=icon)
else:
layout.label(text="", translate=False, icon_value=icon)
# And now we can add other UI stuff...
# Here, we add nodes info if this material uses (old!) shading nodes.
if ma and not context.scene.render.use_shading_nodes:
manode = ma.active_node_material
if manode:
# The static method UILayout.icon returns the integer value of the icon ID "computed" for the given
# RNA object.
layout.label(text="Node %s" % manode.name, translate=False, icon_value=layout.icon(manode))
elif ma.use_nodes:
layout.label(text="Node <none>", translate=False)
else:
layout.label(text="")
# 'GRID' layout type should be as compact as possible (typically a single icon!).
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
@@ -47,10 +59,10 @@ class MATERIAL_UL_matslots_example(bpy.types.UIList):
# And now we can use this list everywhere in Blender. Here is a small example panel.
class UIListPanelExample1(bpy.types.Panel):
class UIListPanelExample(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "UIList Example 1 Panel"
bl_idname = "OBJECT_PT_ui_list_example_1"
bl_label = "UIList Panel"
bl_idname = "OBJECT_PT_ui_list_example"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
@@ -73,12 +85,12 @@ class UIListPanelExample1(bpy.types.Panel):
def register():
bpy.utils.register_class(MATERIAL_UL_matslots_example)
bpy.utils.register_class(UIListPanelExample1)
bpy.utils.register_class(UIListPanelExample)
def unregister():
bpy.utils.unregister_class(UIListPanelExample1)
bpy.utils.unregister_class(MATERIAL_UL_matslots_example)
bpy.utils.unregister_class(UIListPanelExample)
if __name__ == "__main__":

View File

@@ -15,24 +15,12 @@ class MESH_UL_vgroups_slow(bpy.types.UIList):
VGROUP_EMPTY = 1 << 0
# Custom properties, saved with .blend file.
use_filter_empty: bpy.props.BoolProperty(
name="Filter Empty",
default=False,
options=set(),
description="Whether to filter empty vertex groups",
)
use_filter_empty_reverse: bpy.props.BoolProperty(
name="Reverse Empty",
default=False,
options=set(),
description="Reverse empty filtering",
)
use_filter_name_reverse: bpy.props.BoolProperty(
name="Reverse Name",
default=False,
options=set(),
description="Reverse name filtering",
)
use_filter_empty = bpy.props.BoolProperty(name="Filter Empty", default=False, options=set(),
description="Whether to filter empty vertex groups")
use_filter_empty_reverse = bpy.props.BoolProperty(name="Reverse Empty", default=False, options=set(),
description="Reverse empty filtering")
use_filter_name_reverse = bpy.props.BoolProperty(name="Reverse Name", default=False, options=set(),
description="Reverse name filtering")
# This allows us to have mutually exclusive options, which are also all disable-able!
def _gen_order_update(name1, name2):
@@ -40,18 +28,12 @@ class MESH_UL_vgroups_slow(bpy.types.UIList):
if (getattr(self, name1)):
setattr(self, name2, False)
return _u
use_order_name: bpy.props.BoolProperty(
name="Name", default=False, options=set(),
use_order_name = bpy.props.BoolProperty(name="Name", default=False, options=set(),
description="Sort groups by their name (case-insensitive)",
update=_gen_order_update("use_order_name", "use_order_importance"),
)
use_order_importance: bpy.props.BoolProperty(
name="Importance",
default=False,
options=set(),
update=_gen_order_update("use_order_name", "use_order_importance"))
use_order_importance = bpy.props.BoolProperty(name="Importance", default=False, options=set(),
description="Sort groups by their average weight in the mesh",
update=_gen_order_update("use_order_importance", "use_order_name"),
)
update=_gen_order_update("use_order_importance", "use_order_name"))
# Usual draw item function.
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index, flt_flag):
@@ -177,37 +159,3 @@ class MESH_UL_vgroups_slow(bpy.types.UIList):
flt_neworder = helper_funcs.sort_items_helper(_sort, lambda e: e[1], True)
return flt_flags, flt_neworder
# Minimal code to use above UIList...
class UIListPanelExample2(bpy.types.Panel):
"""Creates a Panel in the Object properties window"""
bl_label = "UIList Example 2 Panel"
bl_idname = "OBJECT_PT_ui_list_example_2"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
def draw(self, context):
layout = self.layout
obj = context.object
# template_list now takes two new args.
# The first one is the identifier of the registered UIList to use (if you want only the default list,
# with no custom draw code, use "UI_UL_list").
layout.template_list("MESH_UL_vgroups_slow", "", obj, "vertex_groups", obj.vertex_groups, "active_index")
def register():
bpy.utils.register_class(MESH_UL_vgroups_slow)
bpy.utils.register_class(UIListPanelExample2)
def unregister():
bpy.utils.unregister_class(UIListPanelExample2)
bpy.utils.unregister_class(MESH_UL_vgroups_slow)
if __name__ == "__main__":
register()

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