Compare commits

..

2361 Commits

Author SHA1 Message Date
6692ca602c Merge branch 'master' into functions 2020-04-14 11:59:47 +02:00
dabd59ba23 Merge branch 'master' into functions 2020-04-09 11:59:24 +02:00
43f895a592 Merge branch 'master' into functions 2020-04-06 11:10:19 +02:00
52606afaa6 Merge branch 'master' into functions 2020-03-31 11:16:32 +02:00
cd5f9516db Merge branch 'master' into functions 2020-03-30 12:04:42 +02:00
8ce5c50411 Merge branch 'master' into functions 2020-03-23 11:22:59 +01:00
37ee4d4e2a Merge branch 'master' into functions 2020-03-21 12:09:13 +01:00
d9356a5b8d Cleanup: make format after SortedIncludes 2020-03-19 11:22:15 +01:00
edd0928d09 Merge branch 'master' into functions 2020-03-19 11:19:05 +01:00
0feed991e2 Merge branch 'master' into functions 2020-03-16 11:59:54 +01:00
26e7498b0c Merge branch 'master' into functions 2020-03-13 13:55:58 +01:00
4a8a7cc3ca Merge branch 'master' into functions 2020-03-12 11:16:44 +01:00
78d8e9f962 fix after merge 2020-03-09 15:30:52 +01:00
4f8b24e0c5 Merge branch 'master' into functions 2020-03-09 15:27:27 +01:00
8471b2f22e Merge branch 'master' into functions 2020-03-05 11:41:38 +01:00
743443ac14 fix after merge 2020-03-02 15:44:31 +01:00
7686f1a8fe Merge branch 'master' into functions 2020-03-02 15:36:29 +01:00
b350b85aba Merge branch 'master' into functions 2020-03-02 10:59:03 +01:00
87d20d7c92 remove leftovers from initial simulation node tree 2020-02-28 13:42:46 +01:00
ee292426a7 Merge branch 'master' into functions 2020-02-28 13:31:11 +01:00
4ed7334ef6 Merge branch 'master' into functions 2020-02-28 09:01:15 +01:00
b92b1a4fe5 Use new LinearAllocatedVector in various places 2020-02-23 17:37:15 +01:00
096856a700 new LinearAllocatedVector<T>
This is a vector that does not own the memory its elements are stored in.
Instead, a linear allocator is passed to every call to `append`, that will
be used if the vector has to grow. Since a linear allocator does not support
deallocation, no memory is dealloced until the linear allocator is destructed.

This structure can be used when many small vectors of initially unknown
size are required.
2020-02-23 17:35:47 +01:00
beed795e5a Merge branch 'master' into functions 2020-02-23 15:25:05 +01:00
fcfe9784cb Merge branch 'master' into functions 2020-02-20 09:27:28 +01:00
3b1c34267b improve copying StringRef to new buffer 2020-02-19 11:49:03 +01:00
3fe710aeaf Merge branch 'master' into functions 2020-02-19 10:17:36 +01:00
6399bfcee3 add missing include 2020-02-17 15:32:19 +01:00
7f35aa99c7 Merge branch 'master' into functions 2020-02-17 15:07:46 +01:00
1945a23259 Merge branch 'master' into functions 2020-02-17 10:47:28 +01:00
fad8e475c7 remove UNUSED_FUNCTION_NDEBUG macro again 2020-02-16 12:45:25 +01:00
b80585ba30 remove unused code 2020-02-16 12:41:01 +01:00
ecc78d29d6 bring back more correct duplicate removal 2020-02-16 12:39:16 +01:00
4d74116218 initial MultiFunctionID 2020-02-15 17:55:18 +01:00
bd42f7c275 remove operation hash of functions, a more reliable system is necessary 2020-02-15 17:52:52 +01:00
e543c9ad32 add global sin and cos functions 2020-02-14 11:40:02 +01:00
bdd69570e2 make naming more consistent 2020-02-14 11:31:23 +01:00
3e533af702 make some functions more reusable 2020-02-14 11:29:49 +01:00
8363204347 use faster CPPType access 2020-02-14 11:03:32 +01:00
0e0f6a9216 provide faster access to builtin CPPTypes 2020-02-14 10:59:37 +01:00
2b83d33032 Merge branch 'master' into functions 2020-02-14 10:01:16 +01:00
4526aa70e5 remove unused timers 2020-02-13 19:01:28 +01:00
1df94f6257 remove obselete BLI_math_cxx.h file 2020-02-13 18:58:34 +01:00
9564cd045a remove lazy init code 2020-02-13 18:44:50 +01:00
de23a2c35b remove lazy init usage 2020-02-13 18:39:38 +01:00
fd46b5e9fe remove lazy init usage 2020-02-13 18:33:56 +01:00
10927b6747 fix allocator usage for StringMap 2020-02-13 18:33:42 +01:00
ba1fcdf41a give test node a poll function 2020-02-13 18:33:29 +01:00
9906e5313b remove usage of lazy init macro 2020-02-13 18:21:15 +01:00
2e1d18600f remove unused code 2020-02-13 18:16:31 +01:00
e4343f6aa2 add license headers 2020-02-13 18:08:38 +01:00
953b8d6066 cleanup 2020-02-13 17:59:32 +01:00
f943f4f99c move rgba_b and rgba_f to separate file 2020-02-13 17:59:05 +01:00
350bc04f56 move float3 -> float2 conversion to different file 2020-02-13 17:55:15 +01:00
9933b5bc27 move float4x4 into separate file 2020-02-13 17:53:03 +01:00
2e950e3b89 move float2 to separate file 2020-02-13 17:47:04 +01:00
bb4b0cc954 move float3 to separate file 2020-02-13 17:45:26 +01:00
1c81255cdb try socket decl in c++ 2020-02-13 15:07:02 +01:00
90b41c7c2f create socket in new node 2020-02-13 12:52:29 +01:00
2630b4c231 new node type for testing 2020-02-13 12:43:01 +01:00
630da3b5e3 Initial builtin simulation node tree type 2020-02-13 12:04:41 +01:00
a88db0aa7d fix warning 2020-02-13 11:53:15 +01:00
f72b3f33a0 define UNUSED_FUNCTION_NDEBUG macro 2020-02-13 11:53:05 +01:00
2c077e741d test commit with different email 2020-02-13 11:12:18 +01:00
94c410a5af Merge branch 'master' into functions 2020-02-13 11:07:28 +01:00
a2a8932981 cleanup 2020-02-12 20:32:48 +01:00
e4a3186aad fix after merge 2020-02-12 19:02:03 +01:00
dc89a3ec7c Merge branch 'master' into functions 2020-02-12 19:00:59 +01:00
b4bf6b9cc9 remove pad_up function 2020-02-10 16:23:14 +01:00
2d36836616 cleanup dot export 2020-02-10 14:46:44 +01:00
0b9888d038 fix after merge 2020-02-10 14:40:04 +01:00
43e2ca8fd1 Merge branch 'master' into functions 2020-02-10 14:23:37 +01:00
8cda8bef1e Merge branch 'master' into functions 2020-02-10 14:14:16 +01:00
ff21d33bfe Don't allow getting mutable reference to vector set 2020-02-10 13:32:02 +01:00
bae72c4b8e remove unused classes 2020-02-10 13:27:30 +01:00
23b52a1958 remove unused class 2020-02-10 13:24:46 +01:00
6218f315bb remove unused class 2020-02-10 12:58:20 +01:00
3f65050354 remove unused classes 2020-02-10 12:53:44 +01:00
f363ff348c remove temporary allocator 2020-02-10 12:42:24 +01:00
003dc7ffc9 fix after merge 2020-02-10 12:26:14 +01:00
605928c15b Merge branch 'master' into functions 2020-02-10 12:01:07 +01:00
9880bebd1a improve linear allocator 2020-02-10 11:47:17 +01:00
9677fbe029 rename MonotonicAllocator to LinearAllocator 2020-02-10 10:51:18 +01:00
6989f9be3d add StringRef.substr method 2020-02-10 09:53:33 +01:00
ce14c2c7bd store default value per CPPType 2020-02-06 16:44:32 +01:00
09149b4f0d Zero initialize before default construction to make it more deterministic 2020-02-06 15:42:08 +01:00
cb46cc6705 Merge branch 'master' into functions 2020-02-05 17:34:24 +01:00
8fa26bf7e1 disable duplicate removal 2020-02-05 10:26:33 +01:00
cf59daf62f fix killing particles 2020-02-04 16:48:46 +01:00
601ed4061a cleanup 2020-02-02 14:17:49 +01:00
6905633e57 fix generating operation hash
this needs some more work
2020-02-02 14:17:39 +01:00
79b3de9a63 assert data types when inserting links 2020-02-02 14:16:58 +01:00
975decb5e3 new Vector Length node 2020-02-02 14:16:21 +01:00
58ec7b44fe fix memory leak 2020-02-02 12:39:13 +01:00
57a063f599 new normalize vector node 2020-02-02 12:37:59 +01:00
d944146ebe fix stack use out of scope error 2020-02-02 12:26:37 +01:00
2e5ab9640e vectorize Map Range node 2020-02-02 12:26:11 +01:00
7c06e2e8d2 new ceil and floor float nodes 2020-02-02 11:43:33 +01:00
a20c781343 Merge branch 'master' into functions 2020-02-02 10:40:56 +01:00
599e8f7bb1 cleanup same size asserts 2020-02-01 11:58:50 +01:00
26f4fa9de7 utility to add input/output dummy nodes 2020-02-01 11:37:36 +01:00
e52941fe5b utility for printing arrays 2020-02-01 11:34:57 +01:00
337b918b92 missing value forwarding 2020-01-29 21:21:10 +01:00
323c20bbb7 remove unused data structure 2020-01-29 21:18:41 +01:00
a11b21f1eb Merge branch 'master' into functions 2020-01-29 21:14:40 +01:00
2430d76b1e Write to output buffer directly instead of doing a copy in the end 2020-01-29 21:05:07 +01:00
9e490d7cf5 make naming more specific 2020-01-29 19:07:23 +01:00
2929bc8d7e cleanup 2020-01-29 18:56:49 +01:00
a5470fe0ca cleanup 2020-01-29 18:47:51 +01:00
06ddde0daa new way to construct custom functions at compile time 2020-01-29 18:43:52 +01:00
477d15998c add utility function 2020-01-27 23:04:02 +01:00
e8ea904cee fix compile error 2020-01-27 23:03:54 +01:00
d17a352f23 Merge branch 'master' into functions 2020-01-27 22:13:42 +01:00
787f6c8a7e enable node tree optimizations 2020-01-27 22:05:55 +01:00
f6334efbd8 cleanup naming 2020-01-27 22:05:44 +01:00
3a27fb824e fix typo 2020-01-27 21:57:50 +01:00
a39dc76dec pass buffer cache to functions via context 2020-01-27 21:30:59 +01:00
3f29c1dd39 remove array allocator 2020-01-27 21:08:12 +01:00
b4a5df88fa try using BufferCache instead of ArrayAllocator 2020-01-27 21:07:03 +01:00
9c0cd8d7a3 cleanup 2020-01-27 16:36:26 +01:00
62bc3b2716 cleanup 2020-01-27 16:23:23 +01:00
fb953e0d8d restructure file 2020-01-27 16:04:48 +01:00
92b5b1fb69 cleanup naming 2020-01-27 15:59:41 +01:00
638a48885a cleanup 2020-01-27 15:41:10 +01:00
45619f2f2f cleanup 2020-01-27 15:40:24 +01:00
1824b8fb52 make single element execution work again 2020-01-26 21:56:41 +01:00
cbadf3e29a cleanup warning 2020-01-26 21:55:32 +01:00
e7a9d2ce96 cleanup 2020-01-26 21:00:34 +01:00
a5b08c1d95 minor improvement 2020-01-26 20:56:05 +01:00
0116cc1f4d fix 2020-01-26 20:54:09 +01:00
4141c905f3 cleanup 2020-01-26 20:50:02 +01:00
4202a208c2 compute dependency depths in network implementation 2020-01-26 20:39:41 +01:00
8c45804a1c initial deepest depth first heuristic 2020-01-26 17:26:45 +01:00
97b6d31f41 use new network evaluation storage 2020-01-26 13:16:43 +01:00
24724b70f0 new network evaluation storage (unused so far) 2020-01-26 12:32:11 +01:00
8667a87134 Revert "try storing values per input differently"
This reverts commit fee675ffe0.
2020-01-26 11:06:54 +01:00
fee675ffe0 try storing values per input differently 2020-01-23 16:02:24 +01:00
ce3ec2f172 remove print 2020-01-23 16:01:55 +01:00
3ad9ccaba7 initial array allocator 2020-01-23 15:15:29 +01:00
dae7527f4f Merge branch 'master' into functions 2020-01-23 14:31:59 +01:00
9f63f863f1 Merge branch 'master' into functions 2020-01-23 12:34:12 +01:00
83d5b3be12 disable optimizations 2020-01-19 12:44:21 +01:00
2e28fc0dd6 cleanup 2020-01-19 12:31:07 +01:00
c5868657aa support for deduplicating many more functions 2020-01-19 12:24:12 +01:00
04bfe684c9 rename 2020-01-19 12:06:24 +01:00
e1a5d15d95 set more operation hashes 2020-01-19 12:05:54 +01:00
00b1399593 deduplicate Particle Attribute node 2020-01-19 11:47:56 +01:00
85c43fbd2e store a random hash per type 2020-01-19 11:47:43 +01:00
65237b2346 support deduplicating vectorized nodes 2020-01-19 11:39:00 +01:00
35af9ecd3d support deduplicating all math nodes 2020-01-19 11:35:22 +01:00
32b02c13d8 operation hash for converters 2020-01-19 11:10:34 +01:00
bf74ef2e40 should not iterate over array that is being changed 2020-01-19 11:10:18 +01:00
b40bdad104 utility to generate constant random numbers per line 2020-01-19 10:57:14 +01:00
ea5fa56ca9 disable optimizations for now 2020-01-18 20:15:20 +01:00
0db9e85a7a replace Vector.index with Vector.index_try 2020-01-18 20:10:53 +01:00
5697fd53f2 implement initial Remove Duplicates optimization 2020-01-18 20:03:10 +01:00
4afdb40b4e set operation hash for some functions 2020-01-18 20:00:14 +01:00
296fd08875 support for storing operation hash per function 2020-01-18 19:59:40 +01:00
03f51bf4e1 add utilities to MFNetworkBuilder 2020-01-18 19:59:01 +01:00
a73b17564c fix Vector.remove_first_occurrence_and_reorder 2020-01-18 19:58:37 +01:00
2b0041e4dd new Optional.set_new methods 2020-01-18 19:58:28 +01:00
7dad14ae79 simplify constant folding 2020-01-18 18:20:16 +01:00
40bac586dc improve naming 2020-01-18 17:54:54 +01:00
f439518781 Merge branch 'functions' into network-builder-refactor 2020-01-18 17:24:13 +01:00
ed89a010cb Merge branch 'master' into functions 2020-01-18 17:23:52 +01:00
0982fdccd9 fix alignment in BLI::Optional 2020-01-16 21:59:00 +01:00
d8ca0ea86d cleanup dead node elimination 2020-01-11 17:15:52 +01:00
f6c377aa5b remove unused nodes optimization 2020-01-11 16:35:35 +01:00
4684b69405 give nodes and sockets an id again 2020-01-11 16:09:06 +01:00
d46ac7934a add utility to debug allocated amount in monotonic allocator 2020-01-11 15:56:37 +01:00
238059ac2a store network more compactly 2020-01-11 15:51:06 +01:00
41df03637e store data in network builder more compactly 2020-01-11 15:34:52 +01:00
090ae9aefe avoid unnecessary type casting 2020-01-11 14:09:09 +01:00
6aa7a269ae remove nodes after constant folding 2020-01-11 13:21:18 +01:00
8ddf71d880 initial network builder refactor to enable support for removing nodes 2020-01-11 12:59:37 +01:00
2d7fee45d6 add method to access all nodes 2020-01-11 10:40:26 +01:00
d54eebbfa7 support constant folding for vectors 2020-01-09 17:41:10 +01:00
f1fc372df1 move constant functions to separate file 2020-01-09 17:20:33 +01:00
c8afdc93f9 Merge branch 'master' into functions 2020-01-09 17:09:36 +01:00
c2c6d152ad Merge branch 'master' into functions 2020-01-05 16:37:20 +01:00
66fdcd5f33 minor fixes 2020-01-04 16:38:09 +01:00
e3ee421314 better to string conversion for generic types 2020-01-04 16:21:03 +01:00
83308760a2 initial constant folding of multi function network 2020-01-04 16:07:59 +01:00
f526c8d303 rename Stack.empty to Stack.is_empty 2020-01-04 14:42:39 +01:00
d95b52f1c9 cleanup link insertion 2020-01-04 14:25:53 +01:00
6b9e7dc585 simplify conversion insertion 2020-01-04 13:59:39 +01:00
bc48280fed refactor: extract methods 2020-01-04 13:42:39 +01:00
7a931deab2 simplify names 2020-01-04 13:37:27 +01:00
b7f6be1b8b simplify names 2020-01-04 13:27:56 +01:00
9c20241272 simplify names 2020-01-04 13:26:17 +01:00
b2fb025153 rename FunctionNodeTree to FunctionTree 2020-01-04 13:24:29 +01:00
5e49e3df6e move code into sub namespace 2020-01-04 13:23:35 +01:00
5bbc1b2e16 refactor: initial removal of FunctionTreeMFNetworkBuilder 2020-01-04 13:17:33 +01:00
ea9282cbd6 extract class for managing the socket mapping 2020-01-03 15:02:41 +01:00
2c68bb3e51 cleanup naming 2020-01-03 14:43:00 +01:00
c505fc4d23 cleanup naming 2020-01-03 14:41:18 +01:00
4063e6c058 extract actual build step from builder 2020-01-03 14:30:47 +01:00
be23e6e2f2 extract members from builder 2020-01-03 14:21:17 +01:00
b7a8ef4b9f replace IdMultiMap with more generic IndexToRefMultiMap 2020-01-03 14:16:58 +01:00
1934749029 cleanup 2020-01-03 13:44:54 +01:00
35aaf2fe51 use IndexToRefMap instead of IndexMap 2020-01-03 13:40:31 +01:00
9c2e7a4e1c only map dummy sockets when function network has been created 2020-01-03 13:17:37 +01:00
e083ab2d02 remove unused method 2020-01-03 12:51:12 +01:00
2b00e17124 extract IdMultiMap data structure 2020-01-03 12:44:41 +01:00
089ee94b88 add missing hash function 2020-01-03 12:06:22 +01:00
ab3498b057 Merge branch 'master' into functions 2020-01-03 11:39:41 +01:00
7d4fb6880e use BLI::parallel_for when creating tetrahedons 2020-01-02 17:14:30 +01:00
d238e6410f improve copying of generic data 2020-01-02 17:09:02 +01:00
187844f712 use StringMultiMap in more places 2020-01-02 16:37:17 +01:00
6732a03531 introduce StringMultiMap 2020-01-02 16:28:55 +01:00
8753f92cb2 utility to iterate over string map in parallel 2020-01-02 16:05:41 +01:00
0ebb98ab3d cleanup 2020-01-02 15:49:41 +01:00
30b50638a0 rename index_iterator to index_range 2020-01-02 15:22:20 +01:00
25fc970f44 move tbb wrappers to blenlib 2020-01-02 15:20:44 +01:00
1e2401a5ff more parallelization 2020-01-02 15:12:26 +01:00
2025065931 simulate particles in parallel 2020-01-02 14:58:39 +01:00
169bdd890f extract method 2020-01-02 14:43:46 +01:00
ecfed4d70f cleanup parallel for/invoke 2020-01-02 14:39:52 +01:00
8a8223c193 cleanup parallel for 2020-01-02 14:36:07 +01:00
1273af1bdd simulate particle systems in parallel 2020-01-02 14:31:38 +01:00
3e325b42bb run emitters in parallel 2020-01-02 14:23:12 +01:00
f12b544515 new multi map implementation that can deal with non trivial types 2020-01-02 14:06:21 +01:00
fb512bfa3d initial working version with ParticleSet 2020-01-02 13:18:12 +01:00
0099355bc6 continue with ParticleSet 2019-12-31 16:48:01 +01:00
799fb759a7 improve particle set 2019-12-31 15:35:08 +01:00
0cda96f1be initial particle set 2019-12-31 14:59:58 +01:00
c2d3708224 introduce MutableAttributesRef 2019-12-31 14:59:48 +01:00
36221652a4 rename various types and variables 2019-12-31 14:17:44 +01:00
7ed83e0bee Move inlined node tree to functions folder 2019-12-31 13:53:48 +01:00
06e7d91f55 Merge branch 'master' into functions 2019-12-31 13:40:45 +01:00
4e0c2a8abd Merge branch 'master' into functions 2019-12-30 13:35:53 +01:00
04c0c92f87 use less generic tbb include 2019-12-28 13:28:06 +01:00
ad58b620b2 make surface hooks work in function deform/points modifiers 2019-12-28 12:23:17 +01:00
d7f18db74a fix evaluation of single input math function with constant input 2019-12-28 12:13:09 +01:00
1eca32bb84 improve usage of TBB 2019-12-28 11:29:34 +01:00
4601ea8f82 Merge branch 'master' into functions 2019-12-28 11:13:44 +01:00
bf4f376060 simplify some names 2019-12-22 15:04:13 +01:00
ee8dfc0062 replace time span with float interval 2019-12-22 14:21:25 +01:00
335b5bc540 cleanup influences collector 2019-12-22 13:53:24 +01:00
7250dfeb2e cleanup 2019-12-22 13:44:27 +01:00
feb938dfb8 remove task c++ wrapper in favor of tbb 2019-12-22 13:42:46 +01:00
4b8cd2cebd use tbb for parallel code 2019-12-22 13:22:55 +01:00
64b707eb67 use IndexMask in more places 2019-12-22 12:48:55 +01:00
f85c4ca3ae cleanup 2019-12-22 12:40:44 +01:00
a80ffa4bc5 cleanup usage of IndexMask 2019-12-22 12:37:42 +01:00
866894454f use IndexMask in more places 2019-12-22 12:32:43 +01:00
717beed8d7 cleanup naming 2019-12-22 12:26:34 +01:00
03dbcd82a4 cleanup naming 2019-12-22 11:10:54 +01:00
9c68e2ecc9 speedup multi function evaluation 2019-12-22 10:58:28 +01:00
b4b25eac9a access event filter duration in node tree 2019-12-20 17:43:13 +01:00
bed1a7cdb7 change some pointers to references 2019-12-20 17:09:23 +01:00
6600c532c4 change particle function evaluation api 2019-12-20 17:01:14 +01:00
81573c53b6 replace compare node 2019-12-20 16:43:04 +01:00
d00557bd19 use IndexMask in more places 2019-12-20 16:37:50 +01:00
dca21ef42f start improving custom events 2019-12-20 16:19:38 +01:00
70ada64a98 use index mask in event interface 2019-12-20 15:44:47 +01:00
d40031df15 remove event storage concept 2019-12-20 15:39:17 +01:00
adfd43db6b new Node Instance Identifier node 2019-12-20 15:22:21 +01:00
aabe38f06c change names displayed in search 2019-12-20 15:03:10 +01:00
a183cc3c4e handle not-found linked groups better 2019-12-20 14:59:33 +01:00
3b65445f4e Merge branch 'master' into functions 2019-12-20 14:21:54 +01:00
a549241728 bring back functionality of old actions 2019-12-19 15:52:10 +01:00
b3c93cfe90 initial ParticleAction class 2019-12-19 14:59:43 +01:00
35ee68ab69 fix when there is no nodelib 2019-12-19 14:58:11 +01:00
6caf9be863 remove variation input of age reached node 2019-12-19 14:35:40 +01:00
1b6e9574a6 leave group when active node is not selected 2019-12-19 14:14:26 +01:00
e8990fd220 cache node group names in .blend file 2019-12-19 13:21:06 +01:00
a1f79adde9 improve debug dot output 2019-12-19 13:17:38 +01:00
6cc8f3cd71 remove builtin group nodes 2019-12-19 13:11:33 +01:00
3c519d4917 new Join Text List node 2019-12-19 12:58:07 +01:00
9d885235eb better float3 printing 2019-12-19 12:38:37 +01:00
e97a45ef8c replace Kill Particle node with group 2019-12-19 12:24:51 +01:00
74eeb7a759 improve debug dot output 2019-12-19 12:12:24 +01:00
ed64bcfb71 remove Particle Info node 2019-12-19 11:53:30 +01:00
c78896e675 cleanup 2019-12-19 11:47:43 +01:00
aae54f903c fix path filter 2019-12-19 11:46:33 +01:00
98376bc8ee automatically load node groups from nodelib 2019-12-19 11:41:21 +01:00
150d76aa7b handle unknown node better 2019-12-19 11:24:38 +01:00
3d4f0fe7fe remove mockup nodes 2019-12-19 11:17:23 +01:00
e733615650 remove actions that can be build as node groups 2019-12-19 10:52:12 +01:00
54fe936849 remove unused action 2019-12-19 10:37:21 +01:00
136ac83c82 change IndexMask constructor 2019-12-19 10:37:13 +01:00
7b0ddb2420 replace MFMask with IndexMask 2019-12-19 10:11:31 +01:00
717283c038 Merge branch 'master' into functions 2019-12-19 09:49:43 +01:00
15c15d95e9 fix missing include 2019-12-18 15:21:26 +01:00
f72a4ab0af Remove Explode Particle node 2019-12-18 15:03:15 +01:00
a7ce3fc324 use Tab to open/close groups 2019-12-18 14:59:27 +01:00
7329734ec2 fix file load error 2019-12-18 14:59:09 +01:00
545e1b60f1 implement start-stop mode in Float Range node 2019-12-18 13:53:16 +01:00
5c90bec61e simplify socket identifiers 2019-12-18 13:38:51 +01:00
ec6fc1aaec support for inserting group nodes from search 2019-12-18 13:34:26 +01:00
17d18351c6 extract method to find callable trees 2019-12-18 13:17:49 +01:00
1c7e0b1755 improve node layout of group nodes 2019-12-18 13:11:48 +01:00
9fa91b8719 support for sampling random vectors in a sphere 2019-12-18 13:04:45 +01:00
c6cf1082cb new Multiply Vector with Float node 2019-12-18 12:53:02 +01:00
68b8979137 new Vector from Value node 2019-12-18 12:39:02 +01:00
4c5332cae7 new Random Vectors node 2019-12-18 12:31:19 +01:00
ceb5471884 improve Random Vector node 2019-12-18 12:11:02 +01:00
375ac4f37a new Random Vector node 2019-12-18 11:42:42 +01:00
06adff95b4 cleanup Spawn Particles node 2019-12-18 11:18:55 +01:00
6bb09a50fb support for computing vectors per particle 2019-12-18 11:06:55 +01:00
298b0cd863 Remove Action Context concept for now 2019-12-18 10:04:53 +01:00
e810f4dd7b Merge branch 'master' into functions 2019-12-18 09:54:06 +01:00
2d1cd3076f fix missing update 2019-12-17 15:05:39 +01:00
ced689a43a new Random Floats node 2019-12-17 14:48:05 +01:00
d16d58e6f9 show position attribute by default 2019-12-17 13:52:45 +01:00
79c5b4d4af fix socket drawing 2019-12-17 13:36:53 +01:00
ccc8d664fc initial Spawn Action node 2019-12-17 13:28:38 +01:00
71124e192f minor changes 2019-12-17 13:27:49 +01:00
e1e1069b45 initial spawn node ui 2019-12-17 12:04:09 +01:00
57ab7cefdd introduce ScopedVector 2019-12-17 11:48:33 +01:00
bd5be7c70a Rename TemporaryVector/Array to LargeScopedVector/Array 2019-12-17 11:40:26 +01:00
0144b11673 Support inline storage in BLI::Array 2019-12-17 11:35:13 +01:00
ae44dad2e1 cleanup 2019-12-17 11:18:25 +01:00
c03bb9db0d store name of node and sockets in dummy node 2019-12-17 11:13:00 +01:00
1fd9485a51 set dot background color utility 2019-12-17 11:12:19 +01:00
54229b8e82 support for removing execute sockets 2019-12-17 10:39:32 +01:00
eba730f986 Simplify execute socket naming 2019-12-17 10:09:25 +01:00
fba5b503f5 fix after merge 2019-12-17 09:46:17 +01:00
9a3b370061 Merge branch 'master' into functions 2019-12-17 09:34:13 +01:00
2b84a7d5b0 fix wrong comparison 2019-12-14 18:33:39 +01:00
f31dc22ebb fix some warnings 2019-12-14 18:25:42 +01:00
34d06de0dc remove some old tests 2019-12-14 18:07:18 +01:00
b6945930e8 remove unused functionality 2019-12-14 17:57:19 +01:00
67724f884a use new indices functions 2019-12-14 17:50:33 +01:00
b52c4ddfb9 more low level generic CPPType functions 2019-12-14 17:44:56 +01:00
617ab7847f add more functions to CPPType 2019-12-14 17:16:05 +01:00
2225dab801 optimize fill operation 2019-12-14 17:06:07 +01:00
e1a662ee3a optimize float range 2019-12-14 16:53:51 +01:00
f0cb97c9a3 cleanup 2019-12-14 16:49:21 +01:00
5419ae4d83 optimize generic extend operation 2019-12-14 16:19:16 +01:00
fc30d4e272 support for removing sockets in Select node 2019-12-14 15:36:00 +01:00
21ebaf9bc6 initial Select node 2019-12-14 15:28:13 +01:00
a1b0d7e982 print warning when inputs incorrectly depend on particles 2019-12-14 14:46:40 +01:00
510da24778 keep track of contexts used by function network 2019-12-14 14:46:21 +01:00
2646b9016f more utility functions for vector and stack 2019-12-14 14:45:37 +01:00
cd2385f608 refactor signature builder 2019-12-14 14:02:33 +01:00
5381fbc1a3 turn attribute name into an input socket 2019-12-14 13:15:28 +01:00
d720463300 support nicer drawing of sockets 2019-12-14 12:18:17 +01:00
776562623c new Multi Execute node 2019-12-14 11:35:27 +01:00
8a41c15bf9 prevent trails and explosion in a the same particle system 2019-12-14 11:29:49 +01:00
46b29a75a0 remove unused code 2019-12-14 11:10:55 +01:00
984ba7e943 Merge branch 'master' into functions 2019-12-14 11:02:49 +01:00
764857eb37 fix: find IDs used by output sockets as well 2019-12-13 19:42:49 +01:00
dc0d0d3936 Merge branch 'master' into functions 2019-12-13 19:40:19 +01:00
5c83319029 new Find Non Close Points node 2019-12-12 18:28:14 +01:00
d7d365f6eb new Get List Elements node 2019-12-12 15:34:53 +01:00
b716661366 support for vertex weights in Sample Object Surface node 2019-12-12 14:59:39 +01:00
4de6eafba3 sample hooks on surface 2019-12-12 13:05:08 +01:00
ee52b2f7d8 Merge branch 'master' into functions 2019-12-12 11:17:04 +01:00
6d3cd34bd5 fix compile error 2019-12-11 17:13:16 +01:00
df783a4ee1 access emitter time info in node tree 2019-12-11 16:32:48 +01:00
4d72f25e9a make vertex group name an input socket 2019-12-11 16:05:47 +01:00
5d8036c675 access position and normal directly in Closest surface hook node 2019-12-11 15:50:06 +01:00
03bde25be9 fix context in vectorized functions 2019-12-11 15:27:53 +01:00
3a1aec54a7 cleanup 2019-12-11 15:20:21 +01:00
2a25a0bd60 cleanup 2019-12-11 15:08:54 +01:00
a080464e31 extract function vectorizer to separate file 2019-12-11 15:03:19 +01:00
95e0ea69a2 extract customizable functions into separate file 2019-12-11 14:59:14 +01:00
a678e0df39 remove unused code 2019-12-11 14:55:32 +01:00
5d686b19a5 extract particle input functions from others 2019-12-11 14:52:48 +01:00
a908d95d9f extract surface hook functions to separate file 2019-12-11 14:48:40 +01:00
423060ac2f optimize closest surface hook on object node 2019-12-11 14:37:36 +01:00
fa942b5e6f optimize get weight on surface 2019-12-11 14:24:32 +01:00
f4a9e125bf optimize get normal on surface node 2019-12-11 14:16:10 +01:00
642fa43b13 optimize get position on surface node 2019-12-11 14:10:55 +01:00
e60516bdee cleanup 2019-12-11 14:03:13 +01:00
980b128b37 cleanup 2019-12-11 14:00:39 +01:00
bd92ed7e11 optimize single value case 2019-12-11 13:58:08 +01:00
bf85e6a637 improve grouping of similar indices 2019-12-11 13:53:53 +01:00
35989c6715 convert image to socket 2019-12-11 13:01:55 +01:00
aa10876c62 vectorize surface hook nodes 2019-12-11 12:18:56 +01:00
6dd8723620 fix memory leak 2019-12-11 11:42:30 +01:00
e985b20a77 more generic way to add per element and global contexts 2019-12-11 11:36:40 +01:00
d6f8ebf1f0 Merge branch 'master' into functions 2019-12-11 10:52:23 +01:00
28c554ec27 initial static class id system 2019-12-11 10:50:08 +01:00
eaa0c567fc make element contexts non virtual 2019-12-11 10:21:44 +01:00
9e056e8fd4 Merge branch 'master' into functions 2019-12-11 09:10:17 +01:00
73ed33953a don't register keymap in background mode 2019-12-11 00:10:44 +01:00
032c685472 fix endless recursion 2019-12-10 23:42:03 +01:00
a7d26bdc33 add external data cache to emitter function 2019-12-10 23:32:18 +01:00
5685b0a72a support for accessing id data blocks from emitter function 2019-12-10 23:26:45 +01:00
5dada6b465 new birth time modes for custom emitter 2019-12-10 23:20:50 +01:00
b93d0f8975 support for removing sockets in custom emitter 2019-12-10 22:59:47 +01:00
60b3fc8239 better handling of attribute name collisions 2019-12-10 22:53:32 +01:00
f961ef3e6b improve ui of Custom Emitter node 2019-12-10 22:52:54 +01:00
d91b7625cf fix warning 2019-12-10 18:19:23 +01:00
4df45d1c4c initial Custom Emitter node 2019-12-10 18:12:51 +01:00
826a132791 support nested properties in inferencer 2019-12-10 16:46:31 +01:00
24a7851fbe new Value node 2019-12-10 16:06:32 +01:00
daf119f2a7 initial support for custom particle attributes 2019-12-10 15:30:42 +01:00
4dccb3767a optimize some math nodes 2019-12-10 14:30:07 +01:00
ea5f871d29 deduplicate code 2019-12-10 14:17:55 +01:00
4755ab5b50 optimize variadic math functions 2019-12-10 14:05:31 +01:00
6d05b0910a optimize math functions a bit 2019-12-10 13:15:01 +01:00
e5f9640223 remove some timers 2019-12-10 11:47:05 +01:00
32c25e8c89 Merge branch 'master' into functions 2019-12-10 11:29:00 +01:00
4e4d350967 remove timer 2019-12-08 23:01:28 +01:00
2ce315c588 avoid computing the computing the same things many times 2019-12-08 23:01:21 +01:00
34d68139ac extend single elements when necessary 2019-12-08 22:01:31 +01:00
b09c2c7d00 Merge branch 'master' into functions 2019-12-08 21:31:53 +01:00
a382054837 Merge branch 'master' into functions 2019-12-07 11:01:54 +01:00
56dce4ae43 initital check for whether a function can be called once only 2019-12-06 13:55:03 +01:00
2390af8430 move class from header to cc 2019-12-06 13:34:52 +01:00
7c03565594 add utility to check if an input is only a single value 2019-12-06 13:30:10 +01:00
e93fe105d1 cleanup 2019-12-06 13:01:11 +01:00
de56346eee extract methods 2019-12-06 12:58:01 +01:00
a5790756e0 extract methods 2019-12-06 12:50:54 +01:00
94a280cb99 cleanup 2019-12-06 12:42:58 +01:00
039a1134cd cleanup data copying in network evaluation 2019-12-06 12:39:03 +01:00
ce35f42c0a simplify forwarding in network evaluation 2019-12-06 12:27:41 +01:00
6ec5ece968 cleanup naming 2019-12-06 11:50:10 +01:00
29106bdaee simplify allocation in multi function network evaluation 2019-12-06 11:48:40 +01:00
98d9f2bdfa store whether function depends on per element context 2019-12-06 11:35:34 +01:00
1996429dc6 Merge branch 'master' into functions 2019-12-06 11:25:26 +01:00
e1e1dad668 Merge branch 'master' into functions 2019-12-05 20:00:52 +01:00
d3dbacea08 open group interface panel from V pie menu 2019-12-05 14:14:36 +01:00
293c476822 initial support for reordering group inputs 2019-12-05 13:58:38 +01:00
e57a0ec211 handle other socket types in operator 2019-12-05 13:14:23 +01:00
95b2871550 make it easier to create group outputs 2019-12-05 13:10:35 +01:00
d4d0360604 better default value initialization 2019-12-05 12:47:58 +01:00
eb9f980912 initial V shortcut to create group inputs 2019-12-05 12:43:41 +01:00
dd452a314a improve group node ui 2019-12-05 11:21:24 +01:00
ab678735ab Merge branch 'master' into functions 2019-12-05 09:55:13 +01:00
c44fdcfab2 fix node identifier when node is in a group 2019-12-04 17:10:31 +01:00
d5ec476e36 simplify influence generation from xnodes 2019-12-04 16:42:04 +01:00
985e3e8ddc simplify action building code 2019-12-04 16:03:15 +01:00
f101aa6c4b fix naming after recent refactor 2019-12-04 15:32:30 +01:00
ee58e62f23 rename Surface Location to Surface Hook 2019-12-04 15:04:10 +01:00
db26a32601 store emit location in particles 2019-12-04 14:27:11 +01:00
2012ea2e9d add id handle lookups to function modifiers 2019-12-04 13:49:24 +01:00
c6a00f46ad pass around Object handles instead of pointers 2019-12-04 13:33:49 +01:00
907f72d4bc initial IDHandle implementation 2019-12-04 13:21:05 +01:00
182a56e3b0 improve SurfaceLocations members 2019-12-04 12:17:22 +01:00
e5e295beed fix when having emitter in node group 2019-12-04 11:53:15 +01:00
672b085264 Merge branch 'master' into functions 2019-12-04 11:33:48 +01:00
d709399b64 new Get Normal on Surface node 2019-12-03 16:00:02 +01:00
7fb768e2c4 cleanup: remove unused class 2019-12-03 15:17:38 +01:00
f6e39cc95d add StringMap.add method 2019-12-03 15:11:46 +01:00
4127c7ff87 make execute and influence sockets work in groups 2019-12-03 15:07:40 +01:00
90529a8d4d Merge branch 'master' into functions 2019-12-03 11:55:39 +01:00
9c102058e1 new Get Image Color on Surface node 2019-12-03 11:51:47 +01:00
9e8f68f4fa remove concept of particle function inputs from code 2019-11-30 15:34:38 +01:00
f9f6ab0251 remove remaining particle input nodes 2019-11-30 15:17:59 +01:00
a4cc5f1cbb make Is In Group a normal multi-function 2019-11-30 15:14:10 +01:00
d7b991aeb7 remove Particle Randomness node 2019-11-30 14:40:07 +01:00
f71eec7604 remove Surface Weight node 2019-11-30 14:38:01 +01:00
710c3b8312 new Get Weight on Surface node 2019-11-30 14:36:19 +01:00
a561a457dc initial Get Position on Surface node 2019-11-30 13:30:34 +01:00
945a752902 update closest location on object node 2019-11-27 18:15:48 +01:00
28a70ff15c new surface location data type 2019-11-27 17:06:58 +01:00
98a4a08fce various automated variable renamings 2019-11-27 16:06:55 +01:00
ea0b7dc6d1 make multifunction generation work with inlined node trees 2019-11-27 15:47:40 +01:00
a57e050f43 cleanup creation of group input nodes 2019-11-27 15:46:10 +01:00
49c3eb8478 replace virtual with inlined tree 2019-11-27 14:42:15 +01:00
529987089d Merge branch 'master' into functions 2019-11-27 10:19:26 +01:00
ceca20b798 color exported dot clusters randomly 2019-11-26 17:52:29 +01:00
02aef365ba add some noinline attributes 2019-11-26 17:26:53 +01:00
0a667c6614 cleanup 2019-11-26 17:12:06 +01:00
cfac0f5914 refactor: extract method 2019-11-26 17:10:46 +01:00
d33d8f5b20 refactor: extract methods 2019-11-26 17:01:39 +01:00
70fe3d8dea extract functions 2019-11-26 16:52:58 +01:00
288b562e46 cleanup 2019-11-26 16:41:31 +01:00
021650c4c0 cleanup 2019-11-26 16:34:28 +01:00
352afcd0b3 use array instead of map 2019-11-26 16:14:34 +01:00
413af94fd2 deduplicate node creation 2019-11-26 16:03:25 +01:00
4ade6cdfc0 initialize ids of xnodes 2019-11-26 15:33:38 +01:00
d148d2a447 free memory of inlined node tree 2019-11-26 15:27:27 +01:00
5d42b6a204 add accessor functions for inlined node tree 2019-11-26 13:30:10 +01:00
97a5f427d0 add clusters to inlined node tree dot export 2019-11-26 13:13:46 +01:00
48f2f3cea6 change cluster usage in dot exporter 2019-11-26 12:57:47 +01:00
abe3c18cf6 Merge branch 'master' into functions 2019-11-26 10:40:54 +01:00
0e1a4f39ac use generic dot export to export function networks 2019-11-24 15:24:46 +01:00
a4cf1eb035 export inlined node tree as dot graph 2019-11-24 14:58:43 +01:00
c0d0aff4da import dot export 2019-11-24 13:56:34 +01:00
8ae3debad0 node shape utility 2019-11-24 13:30:28 +01:00
0fea5c5d59 dot file export 2019-11-24 12:55:58 +01:00
afe4577256 initial InlinedNodeTree structure 2019-11-23 18:04:56 +01:00
1f52afb3fd new Vector.remove_first_occurence_and_reorder method 2019-11-23 17:25:41 +01:00
f63d9357bf new Vector.append_and_get_index function 2019-11-23 14:57:27 +01:00
2780bb1000 Merge branch 'master' into functions 2019-11-23 13:55:40 +01:00
0a7e29739d Merge branch 'master' into functions 2019-11-21 15:55:44 +01:00
89335330fa simplify some code 2019-11-21 15:42:06 +01:00
5c316f0910 remove unused code 2019-11-21 15:12:27 +01:00
47e7a8966e cleanup nodes mapping 2019-11-21 15:10:26 +01:00
d81273eaed cleanup 2019-11-21 14:46:26 +01:00
e36da5e16e cleanup 2019-11-21 14:38:14 +01:00
2335aaf58b improve naming 2019-11-21 14:29:03 +01:00
7f9e7c23e0 improve naming 2019-11-21 14:20:14 +01:00
7de6eb1b49 define multi function to node mapping 2019-11-21 14:08:54 +01:00
3ca095f1eb simplify vsocket to multi function mapping 2019-11-21 13:44:56 +01:00
92130916d5 fix network evaluation 2019-11-21 12:48:13 +01:00
92d4376c8e make VirtualNodeTree specific to one bNodeTree 2019-11-20 18:20:16 +01:00
00b4b90361 new try_lookup method for StringMap 2019-11-20 18:11:12 +01:00
6d71136e4a new vnode to multifunction mapping 2019-11-20 17:37:28 +01:00
2c83e550c4 change the node mapping a bit 2019-11-20 17:08:47 +01:00
0cf8799ef7 more utility functions 2019-11-19 14:34:03 +01:00
046204e7b2 extract preprocessed vtree data from builder 2019-11-19 13:38:25 +01:00
3d16a8193f improved debug error checking 2019-11-19 10:49:34 +01:00
1aef4b1298 cleanup parameter checks 2019-11-19 10:17:33 +01:00
ca19757aec refactor MFParamType 2019-11-17 12:10:48 +01:00
e81dbbaa2e add missing static keywords 2019-11-15 16:09:50 +01:00
2d4f8209a7 optimize Get Nearest Point when the object is the same for every element 2019-11-15 16:03:54 +01:00
3ecb692b43 fix task scheduling 2019-11-15 16:03:19 +01:00
ca1de7fe4c use more global external data cache 2019-11-15 15:30:12 +01:00
be57a27d6d fix Map Range clamping 2019-11-15 15:28:49 +01:00
459b54b45c remove unused code 2019-11-15 15:06:36 +01:00
9843ca071c prevent recursive node groups 2019-11-14 16:31:24 +01:00
5e72329889 make group defaults work 2019-11-14 15:39:00 +01:00
2423f1c531 add Random Float node 2019-11-14 15:20:07 +01:00
44320e9e08 remove unnecessarily complex code 2019-11-14 14:43:16 +01:00
057ec4bc97 remove unused nodes 2019-11-14 13:40:10 +01:00
4e61bfbb15 initial working function groups 2019-11-14 13:38:39 +01:00
758a751fb2 new group nodes 2019-11-13 15:29:00 +01:00
7398acb56d initial group input node 2019-11-13 14:55:42 +01:00
16f7804d5f bring back Clamp and Map Range nodes 2019-11-13 14:23:21 +01:00
ccfe2a2db1 initial Closest Point on Object node 2019-11-13 13:48:03 +01:00
03d7ba7055 Make Particle Info node a normal function 2019-11-13 12:40:12 +01:00
3235d6cd41 pass MFContext directly 2019-11-13 12:02:16 +01:00
4dfc1e9026 pass MFParams directly 2019-11-13 11:53:28 +01:00
ce59ef0ea9 pass MFMask directly 2019-11-13 11:29:31 +01:00
d5e9fa61d9 testing another way to use multi function contexts 2019-11-12 15:53:00 +01:00
112ffb49d1 fix default node tree 2019-11-12 14:26:21 +01:00
1ac1081953 remove other forces, they should be build using Particle functions 2019-11-12 14:16:36 +01:00
54b40587e4 output vector from Perlin Noise node 2019-11-12 14:15:59 +01:00
ad96830a4b support mapping input vsockets to multiple new sockets 2019-11-12 14:15:08 +01:00
1d69abe558 new Custom Force and Perlin Noise node 2019-11-12 11:00:19 +01:00
a924c1a401 Merge branch 'master' into functions 2019-11-12 10:08:57 +01:00
bb15b89375 Merge branch 'functions' into functions-experimental-refactor 2019-11-08 20:46:56 +01:00
ef2b03e317 Merge branch 'master' into functions 2019-11-08 20:46:43 +01:00
b6027a2f15 fix Is In Group input 2019-11-08 20:34:01 +01:00
a74a2882ed bring back compare node 2019-11-08 20:33:44 +01:00
3a3970c2e0 change uint8_t to bool 2019-11-08 19:50:23 +01:00
a708562177 move attribute defaults back into AttributesInfo 2019-11-08 19:48:04 +01:00
b9d42020be make function name more precise 2019-11-08 19:19:54 +01:00
fea9c7c1a3 cleanup 2019-11-08 19:15:21 +01:00
9cc27bd6ff remove a node 2019-11-08 18:49:49 +01:00
5f8bd0fa71 make switch node work again 2019-11-08 18:21:26 +01:00
de3d75110c bring back object mesh info node 2019-11-08 17:50:19 +01:00
2bae4dd503 remove some nodes for now 2019-11-08 17:33:29 +01:00
8e1ced7596 bring back color nodes 2019-11-08 17:32:20 +01:00
d47962f7a9 boolean math nodes 2019-11-08 17:11:29 +01:00
366a427f04 more vector math 2019-11-08 16:56:06 +01:00
fa7c300edc more vector math 2019-11-08 16:27:58 +01:00
e390a51cc7 bring back some vector math nodes 2019-11-08 16:12:43 +01:00
470a2ce330 fix compile error 2019-11-07 15:17:44 +01:00
4e0b5fd215 cleanup 2019-11-07 14:03:46 +01:00
eada832040 make AttributesInfo non copy and non movable 2019-11-07 13:59:47 +01:00
9116016f93 rename GET_TYPE to CPP_TYPE 2019-11-07 13:48:30 +01:00
bef3e0022c use monotonic allocator for network builder 2019-11-07 13:38:51 +01:00
a4a46d8a97 use monotonic allocator for vtree generation 2019-11-07 13:21:39 +01:00
1fb8e34c9c rename functions2 to functions 2019-11-07 11:57:35 +01:00
ae862db1f4 remove old function system 2019-11-07 11:54:00 +01:00
7884ae9bc3 port particle system to new functions system 2019-11-07 11:44:08 +01:00
856049d771 merge bparticles node tree into functions node tree 2019-11-06 16:08:20 +01:00
cccaca258b simplify naming 2019-11-06 13:05:26 +01:00
6e135618be use monotonic allocator to allocate functions 2019-11-05 15:54:44 +01:00
06e398f427 rename OwnedResources to ResourceCollector 2019-11-05 15:40:03 +01:00
2ae8040373 improve aligned allocation in monotonic allocator 2019-11-05 15:32:53 +01:00
7317074eb3 bring back some more math operations 2019-11-05 14:36:45 +01:00
ab2625529c bring back more math nodes 2019-11-05 14:17:35 +01:00
a35f5ff3c8 improve add/mul/min/max math nodes 2019-11-05 13:47:57 +01:00
3a4d9fa228 remove unused code 2019-11-05 11:56:37 +01:00
720edd0c30 cleanup 2019-11-05 11:53:24 +01:00
e0554f7f31 access time from node tree 2019-11-05 11:48:29 +01:00
55ecd940ac initial more generic context handling 2019-11-05 11:19:57 +01:00
07ac997f1c make Float Range node work again 2019-11-04 23:17:01 +01:00
09862e2b2f assert earlier when nodes were not inserted correctly 2019-11-04 23:16:46 +01:00
62cd4cca56 Merge branch 'functions' into functions-experimental-refactor 2019-11-04 22:09:23 +01:00
a63b896055 Merge branch 'master' into functions 2019-11-04 22:09:06 +01:00
f52e43554f simplify interface for generating functions from node trees 2019-11-03 16:32:23 +01:00
b1bee3ffc5 update Function Points modifier to use new system 2019-11-03 16:06:25 +01:00
d5bcdeef9f rename pack list socket declaration to something more generic 2019-11-03 15:31:30 +01:00
9fdef6ae5b attributes block container compression and utilities 2019-11-03 15:09:21 +01:00
5e20def930 cleanup function allocation 2019-11-03 14:30:45 +01:00
1a90ef6e58 cleanup builder 2019-11-03 14:19:05 +01:00
f1dfadb3cb initial MFContext usage 2019-11-03 14:12:34 +01:00
fa18a28277 move multi function context to separate file 2019-11-03 13:55:49 +01:00
30a1a0bf58 separate some files 2019-11-03 13:44:31 +01:00
146f6a827b add utility to destruct and reorder attribute arrays 2019-11-03 13:08:35 +01:00
da0169bca4 simplify CPPType construction 2019-11-03 12:08:34 +01:00
dafbb5daf7 properly align inline storage in vector and map 2019-11-03 11:37:10 +01:00
5a6da2c1b1 update attribute blocks 2019-11-02 21:31:56 +01:00
45fd15f824 initial attributes block container in functions2 2019-11-02 20:48:35 +01:00
61609e90d5 initial AttributesRef in functions2 2019-11-02 20:19:49 +01:00
8523b03473 cleanup 2019-11-02 19:22:05 +01:00
4a0b22d449 cleanup 2019-11-02 19:12:46 +01:00
2c8ad4ef0b cleanup 2019-11-02 19:07:37 +01:00
4b1532b064 move file 2019-11-02 18:53:29 +01:00
74e7816a22 move node inserters to separate file 2019-11-02 13:45:22 +01:00
8ed320be86 fix memory leak 2019-11-02 13:29:06 +01:00
ed727f3c0f refactor mapping from vtree to multi functions 2019-11-02 13:26:02 +01:00
100ff71944 New VirtualNodeTree implementation 2019-11-02 12:34:39 +01:00
ef636af49e move network generation to separate file 2019-11-01 20:31:13 +01:00
fcfa225e5d move multi function network evaluation to functions2 2019-11-01 20:14:01 +01:00
e778aba584 move VTreeMFNetworkBuilder to functions2 2019-11-01 20:02:51 +01:00
ed47df29e3 move VTreeMFNetwork to functions2 2019-11-01 19:56:11 +01:00
f91bd73986 remove code from blenkernel (now lives in functions2) 2019-11-01 19:51:34 +01:00
11808ee3c2 update functiondeform modifier to using functions2 2019-11-01 19:46:54 +01:00
e9fd7c335f move tuple to functions2 2019-11-01 19:37:25 +01:00
617d8ab8dc move multi function network to functions2 2019-11-01 19:32:52 +01:00
2b805f0ae8 move multi functions to functions2 2019-11-01 19:30:31 +01:00
72eb10b467 copy generic data structures to functions2 2019-11-01 19:11:53 +01:00
324537287f initial functions2 folder 2019-11-01 19:05:09 +01:00
6379f1d035 improve performance when iterating over mask indices 2019-11-01 14:37:58 +01:00
f354aebc6f cleanup name access 2019-11-01 14:35:44 +01:00
ae8332f7c6 introduce MFMask 2019-11-01 14:17:09 +01:00
3ba1c11f3b fix memory leak 2019-10-31 15:01:53 +01:00
5b60e21f1b make text socket work again 2019-10-31 14:57:40 +01:00
badad91ac3 make Object socket work again 2019-10-31 14:39:16 +01:00
92e04dcd15 rename placeholder to dummy 2019-10-31 14:15:27 +01:00
d218811e85 access function and parameter names 2019-10-31 14:11:11 +01:00
db0ee0fe36 further improve MultiFunction API 2019-10-31 13:51:05 +01:00
e09e429f57 cleanup MultiFunction API 2019-10-31 13:43:44 +01:00
cdd69f8e6d dot export 2019-10-31 13:32:53 +01:00
53d345a897 add missing implicit conversions 2019-10-31 13:15:33 +01:00
b7c516a121 add more primitive conversions 2019-10-31 12:55:23 +01:00
16150b75ac cleanup network generation code 2019-10-31 12:27:35 +01:00
5816f75544 initial automatic node vectorization 2019-10-31 11:44:01 +01:00
0ceef31d99 support for full pointer array in virtual list 2019-10-31 10:59:46 +01:00
568315b0b8 make Get List Element node work again 2019-10-30 16:39:33 +01:00
3baf1f7ffa remove unused code 2019-10-30 16:31:23 +01:00
be738fa181 make Pack List node work again 2019-10-30 16:27:53 +01:00
cdeb4ecf8e make some list nodes work again 2019-10-30 15:32:33 +01:00
98577ce2b2 initial non recursive multi-function evaluator 2019-10-30 14:01:00 +01:00
aec147ec74 new ArrayRef.first_index method 2019-10-29 16:52:38 +01:00
cdb7f3c192 change GenericVectorArray 2019-10-29 16:31:36 +01:00
269488d1c3 use virtual list list ref in multi functions 2019-10-29 15:46:25 +01:00
c6ebe25337 initial VirtualListListRef 2019-10-29 15:00:47 +01:00
353af1c51a Support for implicit conversions, float math node and int type 2019-10-29 13:32:22 +01:00
e1ca6c4129 Merge branch 'functions' into functions-experimental-refactor 2019-10-29 11:21:58 +01:00
cacbe466b2 Merge branch 'master' into functions 2019-10-29 11:15:49 +01:00
7bef9b83fb initial MultiFunction generation from node tree 2019-10-22 13:54:55 +02:00
dfa3ed8761 insert links function 2019-10-22 13:04:54 +02:00
73a709844b make VirtualNodeTree const in many places 2019-10-22 12:51:46 +02:00
bc8d442717 initial new node inserters 2019-10-22 11:47:29 +02:00
4adbf49d83 improve ArrayRef 2019-10-22 11:47:00 +02:00
59df914983 replace ArrayOrSingleRef with VirtualListRef 2019-10-20 15:55:33 +02:00
b04aed8db6 experimental VirtualListRef 2019-10-20 15:11:52 +02:00
fc1ca9a2e2 fixes 2019-10-20 14:53:17 +02:00
f6f4f2914c utility functions 2019-10-20 14:27:54 +02:00
4d61b8b1f9 initial VTreeMFNetwork and VTreeMFNetworkBuilder 2019-10-20 13:29:38 +02:00
31ecaf4a8a make MultiFunction const in more places 2019-10-18 17:49:12 +02:00
ff29177a4c make CPPType const everywhere 2019-10-18 17:47:02 +02:00
84baab05b2 remove unused code 2019-10-18 17:46:51 +02:00
838ac481f2 cleanup 2019-10-18 17:40:18 +02:00
5151d05625 cleanup 2019-10-18 17:37:33 +02:00
53d3d32992 use MF prefix in more places 2019-10-18 17:31:22 +02:00
9dbe43f044 start using MF prefix for some classes 2019-10-18 17:23:35 +02:00
36310012ff allow passing destruct_ptr to OwnedResources 2019-10-18 17:08:55 +02:00
2f6ea75758 move destruct_ptr to BLI 2019-10-18 16:46:15 +02:00
d0dd083cbb multi function with constant output 2019-10-18 15:08:20 +02:00
416d6a17dc first created and executed multi function graph 2019-10-17 17:53:04 +02:00
59dc9f1f1a implement initial conversion from builder to network 2019-10-17 16:35:09 +02:00
c2aea94511 give nodes and sockets ids 2019-10-17 15:21:10 +02:00
94d06d7094 initial network structure 2019-10-17 15:08:00 +02:00
2f02949798 initial multi function network builder 2019-10-17 14:19:21 +02:00
0d4a90000d Merge branch 'functions' into functions-experimental-refactor 2019-10-17 10:49:29 +02:00
b660768ae0 Merge branch 'master' into functions 2019-10-17 10:49:00 +02:00
586a9c14ad pass context into multi functions 2019-10-16 13:05:57 +02:00
376f4813dd experiment with an interface to specify external data dependencies 2019-10-16 12:57:21 +02:00
b08bcb1ef4 remove unused code 2019-10-16 12:37:30 +02:00
c1d570ebb1 separate concept of data types from parameter types 2019-10-16 12:19:38 +02:00
76655021c2 remove unused code 2019-10-16 12:19:22 +02:00
2b781131ed experimental AnyAllocator 2019-10-16 11:39:27 +02:00
4d08c352c3 cleanup 2019-10-16 11:39:16 +02:00
f4455b442c separate vector function 2019-10-15 15:52:53 +02:00
34a66dea4e Combine Vector multi function 2019-10-15 15:32:06 +02:00
9952cbc715 initial multi function node tree evaluation 2019-10-15 15:12:48 +02:00
0cc550108a new add vectors multi function 2019-10-15 12:32:05 +02:00
2c06ccec82 initial params builder 2019-10-15 12:05:43 +02:00
56ab056637 test function call 2019-10-13 22:04:01 +02:00
78aa2d5f02 further implement signature builder 2019-10-13 18:32:47 +02:00
a9a8741270 further develop Signature 2019-10-13 18:32:47 +02:00
f0b62c43ef start implementing Params 2019-10-13 18:32:47 +02:00
a1308c1f98 init stuff 2019-10-13 18:32:47 +02:00
42894aa3df don't use old function system for function deform modifier 2019-10-13 18:32:47 +02:00
8a3ce65044 fix 2019-10-13 18:32:47 +02:00
630d32b159 new socket type mapping 2019-10-13 18:32:47 +02:00
7588b4e493 separate declaration and implementation 2019-10-13 18:32:47 +02:00
745c6dec4d move functions to other file 2019-10-13 18:32:47 +02:00
59b077c020 fix test 2019-10-13 18:32:47 +02:00
cad83fee9f move multi function to separate header 2019-10-13 18:32:47 +02:00
9cd357768d fix 2019-10-13 18:32:47 +02:00
029e63093d fix 2019-10-13 18:32:47 +02:00
f84f8b2a02 combine lists 2019-10-13 18:32:47 +02:00
c696a29058 list lengths 2019-10-13 18:32:47 +02:00
2ef5959f8a GenericVectorArrayOrSingleRef 2019-10-13 18:32:47 +02:00
b38ee6daab generic array or single ref 2019-10-13 18:32:47 +02:00
b4130c3d2a more generic vector array functionality 2019-10-13 18:32:47 +02:00
1ee3c53ed2 prototyping vector array usage 2019-10-13 18:32:47 +02:00
c365ec7c61 initial GenericVectorArray 2019-10-13 18:32:47 +02:00
2efdb20b0b use allocator in MonotonicAllocator and use minimum allocation size 2019-10-13 18:32:47 +02:00
0627a6b2d5 cleanup 2019-10-13 18:32:47 +02:00
375a600b8b initial ArrayOrSingleRef implementation 2019-10-13 18:32:47 +02:00
909dc85f2f node functions 2019-10-13 18:32:47 +02:00
2892434cdf improve naming 2019-10-13 18:32:47 +02:00
5ab8cc2eaf add generic mutable array ref 2019-10-13 18:32:47 +02:00
2cfb80f68c cleanup 2019-10-13 18:32:47 +02:00
ffad150868 rename 2019-10-13 18:32:47 +02:00
cfaa0e566a rename TypeCPP to CPPType 2019-10-13 18:32:47 +02:00
326878d82c initial new function type 2019-10-13 18:32:47 +02:00
bdfc3e9a6b GenericArrayRef type 2019-10-13 18:32:47 +02:00
b75cdf36a8 new tuple implementation 2019-10-13 18:32:47 +02:00
55d0c80611 add more type attributes 2019-10-13 18:32:47 +02:00
302e1e9a86 initial cpp type 2019-10-13 18:32:47 +02:00
faf2184f52 Merge branch 'master' into functions 2019-10-13 18:12:07 +02:00
65e6598e7e avoid ambiguous call to make_unique 2019-09-27 16:59:04 +02:00
503fadaeb9 cleanup Tuple class 2019-09-27 15:40:40 +02:00
37bc9ffc53 remove using namespace BLI 2019-09-27 15:27:33 +02:00
123d945027 function is noncopyable and nonmovable 2019-09-27 15:17:53 +02:00
254b69417b remove refcounter from Function class 2019-09-27 15:15:10 +02:00
0102c06cb2 remove Falloff implementation
The plan is to achieve the same functionality in a different way
that allows more customization.
2019-09-27 14:14:39 +02:00
4086bf9823 make particle colors work again
This broke in rBa168c3d282083bb4.
2019-09-27 12:35:02 +02:00
d724444dba remove some debug prints 2019-09-27 12:33:26 +02:00
033924c630 Merge branch 'master' into functions 2019-09-27 10:58:21 +02:00
ab9a01313f add resources to data graph instead of function 2019-09-26 18:15:55 +02:00
ea6db832a0 utility to print resource names 2019-09-26 18:07:59 +02:00
2263656526 add resource via VTreeDataGraphBuilder 2019-09-26 17:57:02 +02:00
d31da8e870 data graph can own arbitrary resources now 2019-09-26 17:42:52 +02:00
727a8da77f make Function class a bit smaller 2019-09-26 17:35:59 +02:00
3bca19b38a separate owned resources container from function 2019-09-26 17:23:16 +02:00
387a97ae42 experimental lazy init for unique pointers 2019-09-26 16:46:52 +02:00
b65a28b9d7 use make_unique in some places 2019-09-26 16:18:53 +02:00
f2b2279c1a Remove owns_mem attribute from Tuple 2019-09-26 15:41:19 +02:00
cdcae9d22e remove run_destructors member from Tuple 2019-09-26 15:21:17 +02:00
5b0d883e50 remove refcount from TupleMeta 2019-09-26 15:02:07 +02:00
be2358fe61 remove refcounter from data graph 2019-09-26 14:35:42 +02:00
802c820334 improved static and dynamic type checking for function bodies 2019-09-26 14:05:16 +02:00
abed72f22c store tuple as resource in function 2019-09-26 13:49:11 +02:00
74fba99cc6 initial resource storage for functions 2019-09-26 13:35:06 +02:00
5460fa6efc store StringRef directly in function
That increases the size slightly, but is easier to debug
2019-09-26 12:46:51 +02:00
353d6112d2 use header guards 2019-09-26 12:06:20 +02:00
d942d6daa7 rename file 2019-09-26 12:03:29 +02:00
7ba7667d8e reduce error handling complexity 2019-09-26 11:04:27 +02:00
b34c174dfb Merge branch 'master' into functions 2019-09-26 10:43:33 +02:00
c3d30f2992 cleanup 2019-09-26 10:43:14 +02:00
6cdc6ce355 Merge branch 'master' into functions 2019-09-25 16:02:22 +02:00
d4e58e630c Replace Falloff with weight input 2019-09-23 12:08:36 +02:00
31a3dc769d start using monotonic allocator when parsing bparticles tree 2019-09-23 11:42:04 +02:00
89db5e8946 Merge branch 'master' into functions 2019-09-23 11:01:22 +02:00
e64fa963de initial particle group implementation 2019-09-22 15:05:45 +02:00
e0b82c6616 access influences collector from action parsers 2019-09-22 14:37:20 +02:00
5c733ab445 move responsibility of registering attributes to node frontend 2019-09-22 14:14:03 +02:00
fcd6a9ddcb allow only one collision per time step 2019-09-22 13:54:48 +02:00
93c0fdcd45 pass simulation state to interfaces 2019-09-22 13:54:30 +02:00
5eecfaf824 better distinction between particle simulation and system 2019-09-22 12:59:13 +02:00
63116f2c8c improved handling of moving colliders 2019-09-22 12:44:07 +02:00
ad8733038e Merge branch 'master' into functions 2019-09-22 12:01:54 +02:00
e397b67946 cleanup 2019-09-20 16:37:41 +02:00
97da5f31d4 move responsibility to ensure that attributes exist out of simulator 2019-09-20 16:32:59 +02:00
9c46c784d5 move attributes declaration out of simulate code 2019-09-20 16:21:02 +02:00
cdfb3d3a28 move responsibility of keeping track of particle ids 2019-09-20 16:09:01 +02:00
8d860d4a9b use shared particle allocator instead of one per thread 2019-09-20 16:00:26 +02:00
f1a7d102dc don't access particles state through allocator 2019-09-20 15:09:45 +02:00
cab2f0f6bd declare more attributes in same place 2019-09-20 15:04:00 +02:00
cb974c4c66 Merge branch 'master' into functions 2019-09-20 14:38:43 +02:00
691f2d449a Merge branch 'master' into functions 2019-09-19 10:34:45 +02:00
d2bd35eab4 fix usage of frame nodes 2019-09-19 10:34:13 +02:00
21889a5475 fix crash with negative emitter rate 2019-09-19 10:30:24 +02:00
c3e289440d Merge branch 'master' into functions 2019-09-18 17:42:59 +02:00
16d5919206 copy color to new particles in trails node 2019-09-17 15:27:24 +02:00
5b1d7afb9c new particle randomness input 2019-09-17 15:04:23 +02:00
df47dd16ce reorder menu entries 2019-09-17 14:02:27 +02:00
561450715b add missing nodes to menu 2019-09-17 13:49:38 +02:00
4d4eeedfa0 rename file 2019-09-17 13:49:24 +02:00
9fecdb3a45 use reference to indicate that action cannot be null 2019-09-17 12:43:59 +02:00
872ee8bbe0 add some node mockups 2019-09-17 12:32:44 +02:00
8d285ee398 Merge branch 'master' into functions 2019-09-17 09:56:59 +02:00
e6ef82180f add execute input to point emitter 2019-09-16 17:00:37 +02:00
d51f6b010d add execute input to initial grid emitter 2019-09-16 16:56:00 +02:00
afada870e7 rename to Influences 2019-09-16 16:43:21 +02:00
8a3348d49b make it easier to add a new particle system 2019-09-16 16:40:57 +02:00
b5d2265b60 remove unused functions 2019-09-16 11:57:59 +02:00
7e3e301bb1 more centralized ownership of actions 2019-09-16 11:39:43 +02:00
a3080c2bc3 don't crash when connecting certain sockets 2019-09-16 11:15:23 +02:00
609147a4d9 improve error handling of various nodes 2019-09-16 11:04:25 +02:00
6384a61a99 Add arrow and star operator to BLI::Optional 2019-09-16 11:04:05 +02:00
4a9bfa95ed centralize function evaluation a bit more 2019-09-16 10:51:08 +02:00
881b5377cf change ownership of name vectors 2019-09-16 10:41:37 +02:00
a5e1f95467 move system discovery to vtreedata 2019-09-16 10:33:13 +02:00
f54bf13cc1 missing file in cmakelists 2019-09-16 10:26:49 +02:00
f45badafd5 Merge branch 'master' into functions 2019-09-16 10:10:22 +02:00
5f5a7fcd62 fixes after merge 2019-09-15 12:46:14 +02:00
35de65ec81 Merge branch 'master' into functions 2019-09-15 12:42:24 +02:00
0d81bf5cb0 fixes after merge 2019-09-14 12:48:25 +02:00
345b86ca4e Merge branch 'master' into functions 2019-09-14 12:44:31 +02:00
4de668c30c Merge branch 'master' into functions 2019-09-14 12:41:02 +02:00
214964b2a0 Merge branch 'master' into functions 2019-09-13 17:08:02 +02:00
f21586cfa1 fix after rename 2019-09-13 16:32:28 +02:00
5b9ee5a55e use NamedTupleRef in more places 2019-09-13 15:47:35 +02:00
c5c05aa40b improve NameTupleRef abstraction 2019-09-13 14:55:48 +02:00
71184d2bc8 fix overflow in color conversion 2019-09-13 14:24:47 +02:00
e26301b30a Rename Particle Type to Particle System and Behaviors to Influences 2019-09-13 14:09:32 +02:00
2232300639 Merge branch 'master' into functions 2019-09-13 12:28:43 +02:00
a86dda2a80 fix cmake after merge 2019-09-13 12:27:35 +02:00
ef7f059216 Merge branch 'master' into functions 2019-09-13 12:16:59 +02:00
3c4d8b1f59 rename BLI_hash.hpp to BLI_hash_cxx.h 2019-09-12 17:13:10 +02:00
d24380dd43 remove unused function 2019-09-12 16:31:02 +02:00
3cdc35dfc4 test OutputTupleRef abstraction 2019-09-12 16:29:40 +02:00
9e9e150b74 size parameter in turbulence force node 2019-09-12 15:55:47 +02:00
592470b07b simplify code by changing ownership of particle functions 2019-09-12 15:45:55 +02:00
971ad95f2b solve merge conflicts 2019-09-12 14:59:16 +02:00
cabc40db81 Merge branch 'master' into functions 2019-09-12 14:49:38 +02:00
e23abea88d add license header to memory utils 2019-09-12 12:49:18 +02:00
7b4a2d578f rename BLI_memory.h to BLI_memory_utils_cxx.h 2019-09-12 12:48:36 +02:00
e7aa06520a change .cpp to .cc in blenlib 2019-09-12 12:45:55 +02:00
2e21ec0d88 change .hpp to .h in blenlib 2019-09-12 12:41:14 +02:00
54350b7db2 change .hpp to .h 2019-09-12 12:23:42 +02:00
590b231124 reflow comment 2019-09-12 12:21:40 +02:00
7825047f47 Merge branch 'master' into functions 2019-09-12 10:09:01 +02:00
1f957995f6 Fix birth moments of emitted particles 2019-09-11 17:59:45 +02:00
1b9cc8bfb1 Merge branch 'master' into functions 2019-09-11 17:46:43 +02:00
09ffcc5de1 initial Always Execute node 2019-09-11 17:24:47 +02:00
23de6e6960 new Falloff input for Turbulence Force 2019-09-11 16:05:51 +02:00
f082115395 Merge branch 'master' into functions 2019-09-11 15:17:11 +02:00
0f47a7d0d7 use Array instead of Vector 2019-09-11 13:29:17 +02:00
8d31f929db fix Array and add tests 2019-09-11 13:28:40 +02:00
a988a16e3d new Change Particle Position node 2019-09-11 11:36:52 +02:00
5743c0eab6 new Custom Event node 2019-09-11 11:24:45 +02:00
3f28239efe move events ui to same file 2019-09-11 10:55:37 +02:00
ef8775b676 allocate VTreeDataGraph on heap 2019-09-11 10:41:47 +02:00
880c5a4360 store size of vector in debug builds to ease debugging 2019-09-11 10:18:34 +02:00
cd48588cf6 Merge branch 'master' into functions 2019-09-11 09:50:12 +02:00
972760397f fix keymap registration 2019-09-10 17:41:32 +02:00
8024da670c testing initial bit array ref implementation 2019-09-10 17:02:23 +02:00
72a05f9f4f remove unnecessary inline keywords 2019-09-10 16:14:48 +02:00
29c7232f4f comments 2019-09-10 16:11:18 +02:00
bfdf90e68c quiet warning 2019-09-10 16:05:38 +02:00
ff3f7c5291 invert Mesh Distance Falloff 2019-09-10 15:59:20 +02:00
a9112c4932 do not register keymap in background mode 2019-09-10 15:46:53 +02:00
b928050af3 initial Mesh Distance Falloff node 2019-09-10 15:44:58 +02:00
01e97d117f initial experimental Mesh Force node 2019-09-10 14:23:52 +02:00
2c0397edfb Merge branch 'master' into functions 2019-09-10 13:26:17 +02:00
a911775cbe store attributes info directly instead of unique pointer 2019-09-10 13:02:12 +02:00
c339917d7f don't store attributes info ref directly in block 2019-09-10 12:56:54 +02:00
1b3ee092db move attributes block container stuff to same file again 2019-09-10 12:39:18 +02:00
b22dc19ce7 new Dot Production operation in vector math node 2019-09-10 12:18:58 +02:00
844c2c8a79 new Project operation in vector math node 2019-09-10 12:10:40 +02:00
147863ac7c Improve copy and move constructor of Vector 2019-09-10 11:54:03 +02:00
dcd84a1051 remove limit for index range arrays 2019-09-09 17:58:43 +02:00
cfb50f6581 implement multiple density modes in Mesh Emitter node 2019-09-09 17:22:54 +02:00
cdc432429f Falloff input in Drag Force node 2019-09-09 16:23:38 +02:00
5d319ba8ff new Drag Force node 2019-09-09 16:17:32 +02:00
706bd95ae8 Merge branch 'master' into functions 2019-09-09 15:45:19 +02:00
40e9cf9df8 initial new attributes block storage 2019-09-09 15:43:23 +02:00
c541e31931 cleanup some nonmovable and noncopyable functions 2019-09-09 12:17:28 +02:00
b2a449e783 test if it builds on buildbot without alembic tests 2019-09-09 11:51:35 +02:00
11d61f3d00 test moving functions to bf_functions 2019-09-09 11:41:07 +02:00
dc02a49fb7 test adding a virtual destructor to solve a linker issue 2019-09-09 11:33:54 +02:00
63133ee688 Merge branch 'master' into functions 2019-09-09 10:55:21 +02:00
da598e31eb support for outputting None/Points/Tetrahedons 2019-09-06 17:44:25 +02:00
e876360aaa Merge branch 'master' into functions 2019-09-06 17:07:59 +02:00
aa5ea9f0fe New UInt32 attribute type 2019-09-06 16:51:32 +02:00
5045219ca9 separate BParticles Output modifier 2019-09-06 16:34:21 +02:00
d30979dddb new Constant Falloff node 2019-09-06 15:51:03 +02:00
57ceacf8b4 move falloff implementations out of header 2019-09-06 15:42:54 +02:00
12663d2e21 cleanup boolean math 2019-09-06 15:34:03 +02:00
0b8514a99c fix memory leak 2019-09-06 15:32:04 +02:00
264719c0b4 simplify string type 2019-09-06 14:50:13 +02:00
213d807a08 deduplicate some code 2019-09-06 14:14:33 +02:00
524df333bc use correct wrapper for Object pointers 2019-09-06 12:49:42 +02:00
3d85989efa rename 2019-09-06 12:26:36 +02:00
199d201cce rename 2019-09-06 12:21:32 +02:00
f45791f436 remove unused class 2019-09-06 12:18:53 +02:00
a22b7177d2 improve llvm type info for shared immutable types 2019-09-06 12:17:16 +02:00
9ba1fce608 use specialized llvm type info for pointer references 2019-09-06 11:37:25 +02:00
4e2ee7e962 remove unused code 2019-09-06 11:27:58 +02:00
d0eafffed4 Initial Falloff implementation 2019-09-06 11:21:53 +02:00
6163ce3dee Merge branch 'master' into functions 2019-09-06 09:21:28 +02:00
02cdf856f6 fix attribute initialization 2019-09-05 19:07:08 +02:00
d226d46144 Merge branch 'master' into functions 2019-09-05 18:30:52 +02:00
58997f47af initial passive modifier mode
This allows creating separate meshes for the different particle types.
2019-09-05 18:30:36 +02:00
66c07705f9 Initial Size Over Time node 2019-09-05 16:58:35 +02:00
bc654dd3dd support for choosing uv layer by name 2019-09-05 16:21:32 +02:00
882e7e4903 cleanup usage of temporary allocator 2019-09-05 15:17:43 +02:00
f541e79196 add comments 2019-09-05 14:27:02 +02:00
942cf217c5 add some comments 2019-09-05 14:18:48 +02:00
02f4bf505a more comments 2019-09-05 12:53:58 +02:00
b39ddcd628 add some comments 2019-09-05 12:43:53 +02:00
5420375d4a return StringRef from virtual node/socket 2019-09-05 12:36:45 +02:00
f59ea9a10f support not-equal operator for StringRef 2019-09-05 12:35:27 +02:00
242e027dea cleanup Vector Adaptor 2019-09-05 12:27:13 +02:00
ded8e6f0af rename test files 2019-09-05 12:17:47 +02:00
d6ac3fd2f2 rename file 2019-09-05 12:14:57 +02:00
a61852a5e2 store size in IndexRange 2019-09-05 12:12:08 +02:00
1ed83f1004 use another constructor for IndexRange 2019-09-05 11:51:54 +02:00
d22cf2fd77 replace generic Range with IndexRange 2019-09-05 11:46:55 +02:00
3a17600bed move ChunkedRange to separate file 2019-09-05 11:30:48 +02:00
3939274a46 cleanup names 2019-09-05 11:20:22 +02:00
964ee85777 access surface color from chained action context 2019-09-05 11:15:40 +02:00
f58f26a35d cleanup vertex weight input provider 2019-09-05 11:00:50 +02:00
fd8244fb26 new Combine Behaviors node 2019-09-05 10:38:03 +02:00
a6d08dfccb Merge branch 'master' into functions 2019-09-05 10:05:08 +02:00
b14e8f35f7 vertices should have a unit length normal 2019-09-04 18:05:06 +02:00
1c8f6d8807 cleanup 2019-09-04 16:27:13 +02:00
5f91002b51 better time sampling in mesh emitter 2019-09-04 16:27:13 +02:00
0e528d5361 improve spacing of trail particles 2019-09-04 16:27:13 +02:00
30185113fd take triangle areas into account 2019-09-04 16:27:13 +02:00
f0c354c97a refactor triangle weight computation 2019-09-04 16:27:13 +02:00
6e828316b3 compute barycentric weights more centrally 2019-09-04 16:27:13 +02:00
d979cd2690 use Surface Info node instead of Collision Info 2019-09-04 16:27:13 +02:00
c665ef49ad store surface velocities in surface context 2019-09-04 16:27:13 +02:00
c718c9e6c5 refactor usage of MeshSurfaceContext 2019-09-04 16:27:13 +02:00
1b1292b7b1 assert that the number of temporary buffers does not grow unbounded 2019-09-04 16:27:13 +02:00
560b55c4c8 cleanup 2019-09-04 16:27:13 +02:00
22624ad774 cleanup handling of emitter action contexts 2019-09-04 16:27:13 +02:00
cb35556472 support slicing ArrayRef with range 2019-09-04 16:27:13 +02:00
185ef25243 temporarily remove unnecessary emitter sockets 2019-09-04 16:27:13 +02:00
848603d032 Merge branch 'master' into functions 2019-09-04 16:27:02 +02:00
db230d4833 skip matrix interpolation when not necessary 2019-09-04 11:33:56 +02:00
716cc34a87 move AttributesRef to BKE namespace 2019-09-04 11:09:36 +02:00
fbe0a3950f more accurate runtime type checking in debug builds 2019-09-04 10:51:06 +02:00
90aaf67e5a Merge branch 'master' into functions 2019-09-04 09:45:37 +02:00
0edb87c629 Merge branch 'master' into functions 2019-09-03 18:12:57 +02:00
4dd3773283 Merge branch 'master' into functions 2019-09-03 16:30:22 +02:00
8443f319e3 quiet warning 2019-09-03 16:22:55 +02:00
d3210c2547 deduplicate vertex weights input code 2019-09-03 16:17:22 +02:00
24a02ee51b initial action context chaining 2019-09-03 16:07:31 +02:00
fc0a7648b5 fix finding execute sockets 2019-09-03 16:07:03 +02:00
a72bcf11e0 new Surface Weights input node 2019-09-03 15:13:27 +02:00
3398112573 refactor how input providers are parsed 2019-09-03 14:06:57 +02:00
f7206f9910 cleanup iterating over AttributeRefs 2019-09-03 13:50:22 +02:00
b245562d0e better error handling when expected action context is not given 2019-09-03 12:34:45 +02:00
2491dc812f rename stride to size 2019-09-03 11:58:45 +02:00
ee8f58eb66 move particle function input providers to separate file 2019-09-03 11:56:49 +02:00
e3454c0708 new Change Particle Size node 2019-09-03 11:39:11 +02:00
61ec4a3d89 move change color/velocity node to same file 2019-09-03 11:20:04 +02:00
370a506ad0 refactor age reached event 2019-09-03 11:16:17 +02:00
c78acc85f3 initial variation input for age reached event 2019-09-03 11:07:17 +02:00
b9a2dc60e1 rename attribute reference classes
AttributeArrays -> AttributesRef
NewParticles -> AttributesRefGroup
2019-09-03 10:53:07 +02:00
b513079ee2 Merge branch 'master' into functions 2019-09-03 10:30:32 +02:00
410599dca2 reorganize where interfaces are declared 2019-09-02 19:01:33 +02:00
551ca28108 remove unused parameter 2019-09-02 18:13:24 +02:00
147d2dfac5 don't pass particle allocator using BlockStepData 2019-09-02 18:08:44 +02:00
1d15c51bf9 use annotation for properties 2019-09-02 17:58:19 +02:00
0d700d201a remove ParticleSet and ParticleSets abstraction 2019-09-02 17:56:14 +02:00
d2fe280a6e improved Change Particle Velocity node 2019-09-02 16:09:52 +02:00
fce176dbd0 fix mesh emitter action context 2019-09-02 15:40:13 +02:00
49b6e1dccf abstract mesh surface action context 2019-09-02 15:13:49 +02:00
27081694f9 rename 2019-09-02 15:07:24 +02:00
4d46c481ac Merge branch 'master' into functions 2019-09-02 14:42:45 +02:00
06565e21ea use action context in mesh emitter 2019-09-02 12:31:49 +02:00
e45fb9e735 use more generic mesh surface action context 2019-09-02 12:11:58 +02:00
e485f030e8 fix temporary deallocation 2019-09-02 12:05:16 +02:00
2412efdf89 simplify mesh emitter more 2019-09-02 11:33:20 +02:00
9ff4828501 cleanup mesh emitter 2019-09-02 11:20:22 +02:00
bde76782eb sample varying float4x4 2019-09-02 11:13:19 +02:00
36016e2960 extract triangle sampling 2019-09-02 11:02:24 +02:00
381ece9410 extract birth moment computation 2019-09-02 10:48:21 +02:00
5f31282c46 Merge branch 'master' into functions 2019-09-02 09:59:03 +02:00
acd7915371 fix computing cumulative distribution 2019-08-28 18:05:39 +02:00
a55745ba7f sample weighted triangles differently 2019-08-28 18:01:10 +02:00
42c58fe840 support allocating larger buffers with temporary allocator 2019-08-28 16:29:30 +02:00
ea068aeb22 start implementing vertex group support in emitter 2019-08-28 14:23:38 +02:00
bc218feff1 append n times function for vector adaptor 2019-08-28 14:23:10 +02:00
fac51ca754 store attribute indices in string map 2019-08-28 12:16:51 +02:00
6e5e1e7ee7 store Range in AttributeArrays 2019-08-28 10:50:55 +02:00
c238c179d7 Merge branch 'master' into functions 2019-08-28 10:25:02 +02:00
25e5488594 don't store particle name in particle sets structure 2019-08-27 17:40:20 +02:00
b52c3b3fc7 Initial string socket type
The internal implementation is working, but not very efficient yet (every string
is allocated separately without any cache). I'm still thinking about a better
solution, but for now having any working text socket is more important.
2019-08-27 17:22:47 +02:00
7ca34c3838 Merge branch 'master' into functions 2019-08-27 14:23:35 +02:00
0ee75f415a bring back transform interpolation for mesh emitter 2019-08-27 13:54:03 +02:00
d95073c9c7 roll back some changes regarding world transition handling 2019-08-27 13:48:51 +02:00
5a7dfe59da fix some more warnings 2019-08-27 12:24:25 +02:00
c5449eb30f avoid some warnings 2019-08-27 12:20:54 +02:00
e12b1cf8ce fix some warnings 2019-08-27 12:17:56 +02:00
a32472bd31 remove unnecessary semicolon 2019-08-27 11:55:47 +02:00
955c931b45 Merge branch 'master' into functions 2019-08-27 11:19:58 +02:00
5ef500c27b cleanup arrayref and stringref 2019-08-26 15:48:26 +02:00
645a54107c add missing include 2019-08-26 15:37:16 +02:00
cd0f866aef move time from ParticlesState to SimulationState 2019-08-26 15:21:10 +02:00
2cf9e5070a start updating how the world state is used 2019-08-26 14:54:20 +02:00
357be047aa build virtual node tree in constructor 2019-08-26 12:17:51 +02:00
bccd47ab4f remove particle block from interfaces 2019-08-26 11:58:01 +02:00
5a3a155438 remove StepDescription and ParticleType entirely 2019-08-26 11:33:50 +02:00
3f01ddd5d2 don't use ParticleType abstraction in simulation code 2019-08-26 11:09:31 +02:00
0c98f500e2 don't use StepDescription abstraction in simulation code 2019-08-26 10:49:47 +02:00
3c541ff26c initial step simulator abstraction 2019-08-26 10:27:20 +02:00
7b08fe78e5 move simulation state to separate file 2019-08-26 10:05:08 +02:00
9efc8d1d9f combine particle and world state in c api 2019-08-26 09:57:40 +02:00
a5260c143c implicitely convert StringRef to std::string 2019-08-26 09:37:04 +02:00
43b449fc18 add missing const 2019-08-26 09:27:49 +02:00
08f0727864 add missing const 2019-08-26 09:25:42 +02:00
f4e3d5f30e Merge branch 'master' into functions 2019-08-26 09:18:17 +02:00
23c31ec27d add float hash 2019-08-25 14:34:10 +02:00
2e712d4eec add test 2019-08-25 14:30:36 +02:00
7e4715a534 remove unused macro 2019-08-25 14:23:32 +02:00
58754850ca remove unused mempool 2019-08-25 14:19:31 +02:00
dbdd6b88ef unify hash tables a bit 2019-08-25 14:07:56 +02:00
c52a4316d0 update the hashing template 2019-08-25 13:58:01 +02:00
bb81caeb1e Fix build error 2019-08-24 21:28:36 +02:00
6d0dad6290 Update Vector implementation 2019-08-23 17:35:19 +02:00
1e74b276c4 don't inline grow for other data structures 2019-08-23 16:57:24 +02:00
d49f1f8772 don't inline grow functions 2019-08-23 16:52:24 +02:00
f35171a9a8 add some comments 2019-08-23 16:32:49 +02:00
a3d9fc20cf store usable slots in open addressing array 2019-08-23 16:25:43 +02:00
c52e381c8b Add license header 2019-08-23 16:06:07 +02:00
af89849067 replace magic number 2019-08-23 16:04:21 +02:00
4d2dcb6a5f Initial implementation of updated ui proposal 2019-08-23 15:41:33 +02:00
9c05112910 fix after merge 2019-08-23 10:12:22 +02:00
dc383b2bfd Merge branch 'master' into functions 2019-08-23 10:01:55 +02:00
c20301adf1 fix build error 2019-08-22 14:19:30 +02:00
ac4c2b3a48 Merge branch 'master' into functions 2019-08-22 12:14:56 +02:00
Eitan
9644f7c8c7 New boolean math node with And, Or and Not operation 2019-08-22 11:47:30 +02:00
1a0a642063 fix boolean c++/llvm conversion 2019-08-22 11:44:56 +02:00
b0034fd7a2 more comments 2019-08-21 18:24:05 +02:00
33949188a7 add some comments 2019-08-21 17:57:42 +02:00
fda6430d6a improve const correctness in many places 2019-08-21 17:38:54 +02:00
700ff7b073 Merge branch 'master' into functions 2019-08-21 17:29:22 +02:00
6f511f6722 Fix raw allocator
This allocator is necessary because sometimes we don't want to use
Blenders guarded allocator. Especially when an object lives longer
than the guarded allocator.
2019-08-21 14:44:09 +02:00
7f79bc3054 Merge branch 'master' into functions 2019-08-21 09:27:24 +02:00
8c95d02504 more tests 2019-08-20 18:45:26 +02:00
6c78f41a2f add StringMap tests 2019-08-20 18:31:19 +02:00
0b2164c5ed remove unused MappedArrayRef class 2019-08-20 18:12:20 +02:00
b45cd6b8bd implement an actual string map that does not rely on std::string 2019-08-20 18:08:17 +02:00
dc01c108d4 improve ArrayRef and StringRef 2019-08-20 18:07:31 +02:00
075a36ae95 Merge branch 'master' into functions 2019-08-20 18:05:44 +02:00
c26a23f245 fix set vector remove 2019-08-20 12:34:39 +02:00
f591503f32 Merge branch 'master' into functions 2019-08-20 09:57:12 +02:00
206495642f Merge branch 'master' into functions 2019-08-19 18:42:56 +02:00
a6b66db204 cleanup Map 2019-08-19 18:34:26 +02:00
ecb8d0bdae cleanup Set 2019-08-19 18:30:16 +02:00
a00101ae5d move hash table slot iterators out of class 2019-08-19 18:24:16 +02:00
6f79e52665 Initial support for custom allocators for containers 2019-08-19 18:18:20 +02:00
607942330c Merge branch 'master' into functions 2019-08-19 10:39:12 +02:00
38b973a679 New Map, Set and SetVector implementation
All tests are runnings still, but I need to do more testing in the upcoming days.
This implementation uses a different approach for sharing code between
the different structures. I tried different abstractions in the last weeks
and this is the best one I found so far.
2019-08-18 16:31:48 +02:00
de8a52dcee low level memory utilities in blenlib 2019-08-18 12:12:39 +02:00
b0ca3469ed Merge branch 'master' into functions 2019-08-18 12:05:11 +02:00
25ab857e4d Fix particle tetrahedon mesh generation 2019-08-18 12:05:00 +02:00
a8eb9448e7 Merge branch 'master' into functions 2019-08-16 15:03:06 +02:00
f52b66c7ec cleanup type usage 2019-08-14 15:32:26 +02:00
a0d9f387bb free types when Blender exits 2019-08-14 15:20:33 +02:00
e16afbe4f5 use guarded allocator for some core types 2019-08-14 14:59:24 +02:00
7921c6cb7e store types in global variables 2019-08-14 14:39:39 +02:00
def527c9b0 Do not use a reference counter for Types
Types can be expected to stay alive until Blender exists.
This also works well with the fact that they are identified
by their pointer.

Furthermore, the number of types is fairly low, but they
are passed around a lot. Maintaining a thread-safe reference
count seems to be unnecessary overhead.
2019-08-14 13:59:05 +02:00
f073f232cf improve map method names 2019-08-14 11:53:08 +02:00
b7bc639d00 add more license headers 2019-08-14 11:46:29 +02:00
d39f5109cc add license header to blenlib files 2019-08-14 11:44:11 +02:00
1ca951cb6f Merge branch 'master' into functions 2019-08-14 09:57:15 +02:00
8b0706a6c1 fix compile error 2019-08-13 13:27:43 +02:00
180d46c76e remove copy to clipboard 2019-08-13 11:43:20 +02:00
a1fef73075 Merge branch 'master' into functions 2019-08-13 11:28:49 +02:00
1ebfffa310 fix compile error on windows 2019-08-12 17:55:52 +02:00
artem ivanov
0b15817ad2 More Float Math operations
Differential Revision: https://developer.blender.org/D5433
2019-08-12 16:36:31 +02:00
Eitan
e0ebaf8f3c Add multiply and divide to vector math node
Differential Revision: https://developer.blender.org/D5430
2019-08-12 16:24:58 +02:00
8aa6ff8ec9 Reimplement the way many arrays are allocated
This new implementation is more generic and easier to use.
2019-08-12 15:50:08 +02:00
52578524bd remove AttributeArrayCore class
It worked well, but having it does not provide enough value
to justify the additional complexity.
2019-08-12 10:30:51 +02:00
00d456761f Merge branch 'master' into functions 2019-08-12 09:23:25 +02:00
8ef0c6b0df Merge branch 'master' into functions 2019-08-07 12:02:06 +02:00
b277709d53 comment some library functions 2019-08-07 12:00:23 +02:00
f8909cfab7 only wrap intrusive listbases for now 2019-08-07 11:40:16 +02:00
4457268059 add some comments 2019-08-07 11:14:14 +02:00
b429156131 experimental reloadable function inputs 2019-08-07 11:04:30 +02:00
2428486775 allocate aligned from monotonic allocator 2019-08-07 10:54:01 +02:00
468be50313 remove unnecessary small object optimization for monotonic allocator 2019-08-07 09:33:37 +02:00
e231654e24 cleanup llvm function type creation 2019-08-06 17:40:25 +02:00
b0585aa4d4 rename element_amount to size 2019-08-06 17:23:00 +02:00
b04ec4faa5 move function to correct file 2019-08-06 17:17:34 +02:00
b46e26cd34 Fix exception when using the node search 2019-08-06 16:17:35 +02:00
71ec8895b7 rename tuple folder to cpp 2019-08-06 11:59:36 +02:00
4022d8784c New list implementation
Instead of using a templated list, it is easier to use a "generic" list, that can
handle every type with a CPPTypeInfo extension. This simplifies the code quite
a bit, because templates can be avoided in many places.
This also makes it easier to add new types.

The list will still be refcounted and still have the shared immutability semantic.
So when a list has more than one user, it is immutable.
2019-08-06 11:54:49 +02:00
a0364a6227 rename files for consistency 2019-08-05 18:18:59 +02:00
2a7b684a8a Merge branch 'master' into functions 2019-08-05 17:17:16 +02:00
b3d5ef9971 remove unused function 2019-08-05 16:35:27 +02:00
bd56ee7a78 cleanup cpp type extension 2019-08-05 15:51:05 +02:00
18820b10fd rename file 2019-08-05 14:59:34 +02:00
39989cb106 rename multimap to multi_map 2019-08-05 13:43:00 +02:00
4f282b4216 Allow passing unlinked input handlers to graph generation 2019-08-05 13:13:09 +02:00
3ea03318bb fix compile error and warning on macos 2019-08-05 13:07:40 +02:00
d5546057f2 rename classes 2019-08-05 12:58:31 +02:00
31c6db7d2a separate unlinked input grouper from inserter 2019-08-05 12:51:32 +02:00
5b8feb038d simple multivector data structure 2019-08-05 12:49:21 +02:00
80ce0cd20f join map.lookup and map.lookup_ref 2019-08-05 12:10:00 +02:00
artem ivanov
d0cdadc81e More vector math operations: Subtract, Cross Product, Reflect 2019-08-05 11:50:00 +02:00
db88d6e1a5 fix auto vectorization when function does not have certain bodies 2019-08-05 11:49:15 +02:00
6b1e4f51c0 Merge branch 'master' into functions 2019-08-05 10:39:52 +02:00
05d85c52a2 rename 2019-08-02 19:18:13 +02:00
8e9323cafa experiment with different ways to group unlinked inputs 2019-08-02 19:12:13 +02:00
afe19d51e3 remember placeholder nodes after they are created 2019-08-02 18:57:19 +02:00
f149445d38 vector.fill_indices 2019-08-02 18:51:02 +02:00
c21f39578f easily create dot graph from vtree data graph builder 2019-08-02 17:42:45 +02:00
d51db9a526 don't create array ref from single value 2019-08-02 17:42:15 +02:00
fb034c8e14 fix dot export after recent changes 2019-08-02 17:41:45 +02:00
5176484fbc rename UnlinkedInputsHandler to InputInserter 2019-08-02 16:22:06 +02:00
71d8ebd201 refactor how information about the node tree is stored 2019-08-02 16:11:25 +02:00
375577cfb9 improve file names 2019-08-02 14:10:39 +02:00
92319905a0 unify mapping names 2019-08-02 14:07:14 +02:00
2f3ccb7e90 move all tree mappings into folder 2019-08-02 14:00:46 +02:00
d537af9303 execute action for new particles after explosion 2019-08-02 13:43:56 +02:00
2be7226e86 new rgba_b attribute type 2019-08-02 13:21:12 +02:00
d022328974 new float2 particle attribute type 2019-08-02 13:18:57 +02:00
7f802fb750 initial texture color access after collision 2019-08-02 12:56:10 +02:00
3411511499 new float2 and rgba_b types 2019-08-02 12:52:40 +02:00
645293e2d9 remove redundant values 2019-08-02 10:08:51 +02:00
c5caaafd7f move collision info and particle info node in same file 2019-08-02 09:37:37 +02:00
363ba2ee7a Merge branch 'master' into functions 2019-08-02 09:27:17 +02:00
219573de22 Fix: Build error with MSVC
Zero sized arrays not being at the end of struct/class makes MSVC sad
2019-08-01 15:25:07 -06:00
480e284250 Merge branch 'master' into functions 2019-08-01 18:24:20 +02:00
f0b7499750 support for default values for vectorized inputs 2019-08-01 18:19:58 +02:00
d63f673e05 move input handlers to separate file 2019-08-01 17:55:47 +02:00
b07626e48b fix use after free in python 2019-08-01 17:25:54 +02:00
79b85c1426 add ability to store socket values as constants in IR 2019-08-01 17:18:34 +02:00
787e97057a return function body instead of bool 2019-08-01 17:18:07 +02:00
eb403083c6 support that tuples own their meta data 2019-08-01 17:17:36 +02:00
d3763513ff remove timer 2019-08-01 16:35:23 +02:00
f9a555a60a don't load socket values dynamically 2019-08-01 16:35:06 +02:00
d91a5b69d9 cleanup socket loaders 2019-08-01 16:06:25 +02:00
46bd09b789 cleanup 2019-08-01 15:56:00 +02:00
faeb98b48e compute type of every socket only once 2019-08-01 15:36:37 +02:00
0b970bc160 fix fill constructor of vector 2019-08-01 15:36:16 +02:00
795bae3410 cleanup type mappings 2019-08-01 15:07:04 +02:00
e606316ed6 rename refresh to sync_tree 2019-08-01 14:55:55 +02:00
13dce85083 fix float math node inputs 2019-08-01 14:55:20 +02:00
0ef25d8001 cleanup 2019-08-01 14:36:52 +02:00
104df5f5f2 support color in Custom Emitter node 2019-08-01 14:16:12 +02:00
69a8699b54 fix use-after-free crash from python 2019-08-01 14:15:56 +02:00
3d1de1e44e cache enum items in python 2019-08-01 14:15:28 +02:00
ffbe506a55 rename DFGraphSocket to DataSocket 2019-08-01 13:33:40 +02:00
3d2e279b3d rename DataFlowGraph to just DataGraph 2019-08-01 13:30:13 +02:00
6dc48fd18d replace DataFlowGraphBuilder implementation 2019-08-01 13:26:34 +02:00
218fcf4473 replace another map with a vector 2019-08-01 10:28:30 +02:00
1fd26737b5 use virtual socket index to replace a map with a vector 2019-08-01 10:16:56 +02:00
2f948952b5 store an index per virtual socket 2019-08-01 10:16:36 +02:00
f6ef23ebe7 remove IndexedNodeTree data structure in favor of VirtualNodeTree 2019-08-01 09:59:55 +02:00
fe5356bf25 Merge branch 'master' into functions 2019-08-01 09:52:03 +02:00
4c8746a965 Merge branch 'master' into functions 2019-07-31 18:41:50 +02:00
28ba204e17 easy access to identifier of socket 2019-07-31 18:41:06 +02:00
56e541dba6 identify types with idname 2019-07-31 18:35:24 +02:00
27b365058e remove last remainings of GraphInserters 2019-07-31 18:28:14 +02:00
22bd4ad4fb move more code out of GraphInserters 2019-07-31 17:53:37 +02:00
7ffa849297 start removing graph inserters 2019-07-31 17:43:46 +02:00
385e61a122 cleanup VTreeDataGraph creation 2019-07-31 17:28:48 +02:00
a5bc1b002f rename file 2019-07-31 17:21:43 +02:00
8e8049fa28 move VTreeDataGraph to separate file 2019-07-31 17:18:29 +02:00
b1fb402e1b cleanup VTreeDataGraph 2019-07-31 17:11:26 +02:00
69b0da1987 rename BTreeGraphBuilder to VTreeDataGraphBuilder 2019-07-31 17:01:33 +02:00
ed4db612f8 new Combine Color node 2019-07-31 16:57:04 +02:00
3e406633f7 only compile when there are outputs 2019-07-31 16:49:12 +02:00
529b78160c move ui code of multiple nodes in the same file 2019-07-31 16:29:14 +02:00
38463de2d9 extract some methods from llvm array execution 2019-07-31 16:09:20 +02:00
b6e533a0d9 don't expose different array execution functions 2019-07-31 15:48:50 +02:00
0f80acd54b don't prepare execution stack when not necessary 2019-07-31 15:40:11 +02:00
0f3b50329c cleanup llvm ir when stack info is maintained 2019-07-31 15:18:36 +02:00
14bb065f13 support for compiling particle functions down to machine code 2019-07-31 14:54:28 +02:00
eaaa8610fa some llvm usage improvements 2019-07-31 14:27:30 +02:00
36f0132394 llvm does not permit void*, so replace all uses with i8* 2019-07-31 14:24:44 +02:00
670537ed8a initial tuple call array execution 2019-07-31 11:23:13 +02:00
bff87f3a9a fix merge conflict 2019-07-31 10:35:33 +02:00
5878add697 Merge branch 'master' into functions 2019-07-31 10:30:30 +02:00
3e0fd90605 use another strategy to create functions for unlinked inputs 2019-07-30 16:13:44 +02:00
042cc17bab clang-format 2019-07-30 15:06:22 +02:00
760e084791 show node search in menu 2019-07-30 14:59:28 +02:00
9d3a92d3e3 use background color for particle type node 2019-07-30 14:59:28 +02:00
e54acfa2ff rename 2019-07-30 14:59:28 +02:00
5841005187 add buttons to create particle type nodes 2019-07-30 14:59:28 +02:00
4f5093f403 renamed particle_modifier_output to particle_effector_output 2019-07-30 14:55:15 +02:00
26d0bbffa8 added point force node for particle nodes 2019-07-30 14:41:28 +02:00
773b6bbd42 rename modifier to effector in some places
That was missing in a previous commit.
2019-07-30 13:58:17 +02:00
c2e63d660b add color attribute type 2019-07-30 13:44:39 +02:00
33c29f35b8 simplify the way attribute information is stored 2019-07-30 13:27:37 +02:00
4bbee4acf2 new Change Particle Color node 2019-07-30 12:14:42 +02:00
99e5f16d4a new Separate Color node 2019-07-30 12:01:33 +02:00
093583620c new color socket type 2019-07-30 12:01:00 +02:00
d29052a514 make object an input in mesh collision event 2019-07-30 10:59:51 +02:00
937dde6060 fix wrong element size due to alignment 2019-07-30 10:59:34 +02:00
e41084f94a cleanup style 2019-07-30 10:20:40 +02:00
40b3c50837 Merge branch 'master' into functions 2019-07-30 10:08:15 +02:00
9fb73c42fd windows compile fixes - missing includes 2019-07-29 20:28:30 +02:00
c62b1850e3 rename "size_of_type" to just "size" 2019-07-29 17:55:52 +02:00
910431e382 start taking alignment of types into account when constructing tuples 2019-07-29 17:53:12 +02:00
bd514d20e0 remove more redundant code 2019-07-29 17:21:21 +02:00
e38e761ba6 remove more redundant code 2019-07-29 17:17:38 +02:00
b645fa8d12 remove more redundant code 2019-07-29 17:13:42 +02:00
0bf70bde16 rename try_get_T to try_get<T> 2019-07-29 17:07:03 +02:00
f78e2837ff change get_T to get<T> when accessing attributes 2019-07-29 17:03:32 +02:00
deecc8c6f8 fix error when using Call node 2019-07-29 16:43:11 +02:00
555d29a0fe initialize particles with IDs 2019-07-29 16:39:35 +02:00
c28a441a9d fix coyp paste error 2019-07-29 16:05:08 +02:00
74bdbb94e5 add integer attribute type 2019-07-29 15:48:59 +02:00
d2c1f7b9ca initial particles block id 2019-07-29 15:16:21 +02:00
aa1c4663a1 remove lots of redundant code 2019-07-29 15:08:05 +02:00
ac5bf8e4f9 initial age output in particle info node 2019-07-29 14:50:19 +02:00
e87cd0c807 introduce input provider interface 2019-07-29 14:02:04 +02:00
e2a6763be3 support for freeing particle function input arrays 2019-07-29 13:51:41 +02:00
c2461a8b87 extract method to create particle function input provider 2019-07-29 13:39:17 +02:00
f2d3539cb5 new particle function input providers abstraction 2019-07-29 13:30:55 +02:00
dbc453f414 extract methods from particle function evaluation 2019-07-29 12:30:59 +02:00
58c67cdde4 remove unnecessary typedef 2019-07-29 12:19:01 +02:00
4ed19b6b1e cleanup particle function builder 2019-07-29 12:16:55 +02:00
888aec8234 move particle function building to separate file 2019-07-29 12:07:08 +02:00
5a1a8fa917 handle inputs with no dependencies separately 2019-07-29 11:55:25 +02:00
ed2180832e use debug name checking again 2019-07-29 11:20:42 +02:00
904966b3ef particle function contains two functions: with/without dependencies 2019-07-29 11:14:38 +02:00
6e83213a5f utility to iterate over trivial particle indices 2019-07-29 10:06:48 +02:00
41f83ef571 scoped timer per element 2019-07-29 10:03:27 +02:00
a8c46c4bf0 fix after merge 2019-07-29 09:13:38 +02:00
1b274efd7c Merge branch 'master' into functions 2019-07-29 09:09:33 +02:00
248ee40712 Cleanup: Fix build error with msvc. 2019-07-25 15:18:33 -06:00
7db0b9c265 add utility to combine strings on the stack 2019-07-25 15:09:57 +02:00
7a3e5c1dad simplify creating particle function 2019-07-25 14:31:25 +02:00
9b3e1859ef simplify action builders 2019-07-25 14:20:36 +02:00
63a9949c27 compute particle functions more centrally for events 2019-07-25 10:18:22 +02:00
6c3afa7801 create particle function for force inputs more centrally 2019-07-25 10:06:03 +02:00
7e4c489778 use particle function for gravity force 2019-07-25 10:01:10 +02:00
c92dd7bed6 create particle function more centrally for offset handlers 2019-07-25 09:54:46 +02:00
7de561f930 Merge branch 'master' into functions 2019-07-25 09:42:45 +02:00
03f4489e4d Merge branch 'master' into functions 2019-07-24 19:19:46 +02:00
93b01da75e use threading again 2019-07-24 19:10:55 +02:00
3976570539 use particle function in Age Reached event 2019-07-24 19:07:55 +02:00
2d925db8b0 fix double free and optimize when particle function inputs have no dependencies 2019-07-24 19:07:38 +02:00
fd0226f614 handle type extensions as references instead of pointers by default 2019-07-24 17:52:22 +02:00
85536c5e75 use function bodies as references instead of pointers by default 2019-07-24 17:43:00 +02:00
f54507724f rename 2019-07-24 17:13:33 +02:00
54724cc5b3 simplify usage of particle functions 2019-07-24 17:12:13 +02:00
b60b193384 do more checks when debugging 2019-07-24 16:27:07 +02:00
299ba77cc9 fix false positive memory leak 2019-07-24 16:15:06 +02:00
c0fd3b6962 remove tests because their are more trouble than they are worth currently 2019-07-24 16:14:50 +02:00
dec218643e use particle function in turbulence node 2019-07-24 15:54:16 +02:00
1cc5f83442 introduce force interface 2019-07-24 15:46:30 +02:00
e468ca977e use particle function in trails node 2019-07-24 15:25:43 +02:00
d9f02f209b further simplify usage of particle function 2019-07-24 15:09:55 +02:00
f169a5eeb7 improve particle function 2019-07-24 15:06:07 +02:00
bdcca74b23 rename 2019-07-24 14:47:05 +02:00
1f79a069d3 move particle function to separate file 2019-07-24 14:44:36 +02:00
d4f57524be rename 2019-07-24 13:58:04 +02:00
89001688d6 rename EventInfo to ActionContext 2019-07-24 13:56:07 +02:00
2859cf6902 cleanup executing actions 2019-07-24 13:50:36 +02:00
bc9d51d048 expose collision normal in new Collision Info node 2019-07-24 13:33:12 +02:00
712701a4ef remember socket that triggered an action 2019-07-24 12:52:35 +02:00
f777ac8a52 use new function creation method for action and offset handlers 2019-07-24 12:36:13 +02:00
efa9b1cc41 use error handling for event nodes 2019-07-24 11:47:37 +02:00
5de6dca2f5 create function to compute force inputs 2019-07-24 11:43:28 +02:00
cb091c196f use better error handling for other emitters 2019-07-24 11:37:30 +02:00
d9348adb33 better error handling when creating function for emitter inputs 2019-07-24 11:33:15 +02:00
f1c69c71c6 move FunctionBuilder to separate file and add more methods 2019-07-24 11:32:40 +02:00
b1425fc68b namespace fix 2019-07-24 11:31:53 +02:00
556691b19a Improve error handling with ValueOrError class
We might want to use exceptions instead of this.
I'm not sure yet.
2019-07-24 10:58:11 +02:00
a0f9564d1b cleanup finding placeholder dependencies 2019-07-24 10:14:51 +02:00
c21d8bd0d9 cleanup finding node inputs 2019-07-23 19:03:49 +02:00
a18d338d3f minor improvements 2019-07-23 19:02:39 +02:00
a781b6fc3a rename BTreeDataGraph to VTreeDataGraph 2019-07-23 18:06:41 +02:00
17dd4e03b8 move function generation file to correct file 2019-07-23 18:04:27 +02:00
fa26630d87 fix uninitialized memory 2019-07-23 18:00:24 +02:00
937a448de2 Remove Composition data structure
This simplifies the code and speeds up accessing function
bodies and type extensions. Now, a lock is only necessary
when create new bodies or extensions.

This is achieved at the cost of having a slighly less generic
system, because we have to give e.g. different function body
types different IDs. Since the number of different types
is expected to be fairly low, this trade off is worth it.
2019-07-23 16:54:40 +02:00
d6a7832f6d simplify virtual node tree usage 2019-07-23 14:59:18 +02:00
9869bc3bc4 Merge branch 'master' into functions 2019-07-23 09:46:00 +02:00
d6b7aecbbc reorder lines 2019-07-22 17:58:31 +02:00
5bcc78ada9 remove builders that are not necessary for now 2019-07-22 17:57:20 +02:00
c900098170 remove unnecessary usings 2019-07-22 17:34:03 +02:00
51fb6b5098 remove unnecessary type definitions 2019-07-22 17:31:20 +02:00
5a269bfb57 remove "small" from test names 2019-07-22 17:19:35 +02:00
f0c164b861 rename SmallVector to Vector 2019-07-22 17:17:47 +02:00
a1ba33090b rename SmallMap to Map 2019-07-22 17:10:42 +02:00
6a63774f43 rename SmallMultiMap to MultiMap 2019-07-22 17:07:58 +02:00
d0d6f38754 rename SmallStack to Stack 2019-07-22 17:05:37 +02:00
f179b2dd30 rename SmallSetVector to SetVector 2019-07-22 16:59:52 +02:00
f9caf48eab Rename SmallSet to just Set
The fact that the data structure has small object optimization
is not important enough to justify a more complex name.
Following commits will rename other data structures.
2019-07-22 16:57:59 +02:00
f039c43f95 cleanup 2019-07-22 16:47:32 +02:00
4b42c112fd cleanup accessing rna of virtual node 2019-07-22 16:46:11 +02:00
3dfbbf606e cleanup accessing node names 2019-07-22 16:40:29 +02:00
9a4d125533 use virtual node tree for parsing particle system node trees 2019-07-22 16:35:49 +02:00
7d5ee7c689 start using virtual node tree to generate functions 2019-07-22 15:49:13 +02:00
c71997dd67 initial virtual node tree 2019-07-22 14:19:12 +02:00
fb26304aa2 ArrayRef.contains_ptr 2019-07-22 14:18:43 +02:00
8a69395d6a rename SocketBuilder to NodeBuilder 2019-07-22 12:41:02 +02:00
86fb4243d1 cleanup 2019-07-22 12:37:31 +02:00
ddf0b72870 make socket.data_type a class property 2019-07-22 12:32:51 +02:00
b7efaadb8e get socket data type from idname 2019-07-22 12:04:42 +02:00
227a28e9e5 remove dead code 2019-07-22 10:49:46 +02:00
b1d21db61b remove colored socket builder 2019-07-22 10:48:34 +02:00
6356f27a87 Merge branch 'master' into functions 2019-07-22 10:24:28 +02:00
fa9f34c056 show particle type names in nodes 2019-07-20 14:21:22 +02:00
1180996832 add ability to select output mesh type in modifier settings 2019-07-20 14:06:51 +02:00
dd47cbf3b7 use constant velocity integrator when there are no forces 2019-07-20 13:40:00 +02:00
0767dad328 rename function 2019-07-20 13:39:17 +02:00
9fa5d75d80 Fix moving sets and maps 2019-07-20 12:57:12 +02:00
ff398d29a6 Merge branch 'master' into functions 2019-07-20 11:53:07 +02:00
9a965af529 move offset handlers to separate file 2019-07-18 17:34:40 +02:00
49d2d8b47e add timer 2019-07-18 17:18:52 +02:00
10c81747fe splitup remainings of core.hpp 2019-07-18 17:16:40 +02:00
c23ccfc0ac separate files for particle state and allocator 2019-07-18 16:59:31 +02:00
0645752ab7 cleanup 2019-07-18 16:59:08 +02:00
bd49708841 rename target to new_particles 2019-07-18 16:49:20 +02:00
c67953c53e move particle set to separate file 2019-07-18 16:47:10 +02:00
182cc12015 fix trail creation for partial time steps 2019-07-18 16:39:28 +02:00
83e75345a2 simple rate input for Trail node 2019-07-18 16:19:31 +02:00
e29914292a missing destructor 2019-07-18 15:57:34 +02:00
6793bab243 use proper constructors for step description and particle type 2019-07-18 15:39:05 +02:00
2c0c758d72 make StepDescription class non-virtual 2019-07-18 15:30:48 +02:00
234f5d9407 make ParticleType class non-virtual 2019-07-18 15:28:08 +02:00
d0eed2a7ac change how particle types declare which attributes they need 2019-07-18 15:23:45 +02:00
023f477bdd rename AttributesInfoBuilder to AttributesDeclaration 2019-07-18 15:04:23 +02:00
8dd5be76c0 initial step desription builder 2019-07-18 14:59:07 +02:00
24c5a21977 remove redundant particle type name storage 2019-07-18 14:30:53 +02:00
f2737b927d rename ForwardListener to OffsetHandler 2019-07-18 14:04:38 +02:00
1272208b2b remove redundant information 2019-07-18 13:52:58 +02:00
d908edbc8a cleanup 2019-07-18 13:47:13 +02:00
9fd56bed3f cleanup 2019-07-18 13:44:29 +02:00
e47c49c872 remove redundant information 2019-07-18 13:40:36 +02:00
168f5964b6 remove redundant information 2019-07-18 13:37:04 +02:00
fe8cace993 use block step data in more places 2019-07-18 12:56:22 +02:00
ea6bbc1aec use step block data in more functions 2019-07-18 12:39:02 +02:00
d1f05d2415 use step block data in more functions 2019-07-18 12:22:47 +02:00
a6914c973f introduce BlockStepData as container for data that would have to be passed into many functions 2019-07-18 12:16:10 +02:00
7aa22a24a7 initial forwarding listeners + particle trail node
Still looking for a better name instead of Forwarding Listeners
2019-07-18 12:08:36 +02:00
4672d7aa83 Merge branch 'master' into functions 2019-07-18 10:37:40 +02:00
d6230d1563 don't always use cache for now since it makes testing more annoying 2019-07-17 18:01:25 +02:00
e800a2d5fa experimental initial grid emitter 2019-07-17 17:45:44 +02:00
0df9c55578 pass time step in from the modifier 2019-07-17 17:11:05 +02:00
a2b128a451 experimental Close By Points event 2019-07-17 16:46:13 +02:00
54f7163310 minor changes 2019-07-17 15:57:17 +02:00
09bc3a0aac Revert "use evaluated node tree"
This reverts commit eddb4d0af4.

Sometimes the evaluated node trees are not updated when the real
node tree changes. Use original trees until this is fixed.
2019-07-17 11:20:47 +02:00
da04c045fe velocity and size input for point emitter 2019-07-16 18:18:53 +02:00
ce2081e5b3 support for interpolated float values 2019-07-16 18:18:09 +02:00
06d8ed1a8a store color per particle 2019-07-16 17:59:20 +02:00
ec7054772b utility operators to create emitter and particle system trees 2019-07-16 17:33:13 +02:00
bd573cf2d7 use vector adaptor instead of pointer+length in fgraph tuple call 2019-07-16 16:29:13 +02:00
667b56f87b use "ifdef DEBUG" instead of "if DEBUG" 2019-07-16 16:28:49 +02:00
eddb4d0af4 use evaluated node tree 2019-07-16 16:12:56 +02:00
c41a9d0e88 fix fgraph tuple call 2019-07-16 16:12:06 +02:00
55a74c35dd fix vector math node 2019-07-16 15:59:42 +02:00
c35feef507 new node to get the vertices of a mesh 2019-07-16 15:36:22 +02:00
9a02226aa2 support for geometry dependencies of functions 2019-07-16 15:35:50 +02:00
f4dac36c05 extract another function for linking 2019-07-16 14:52:06 +02:00
a5b90dc661 extract method that links functions 2019-07-16 14:43:47 +02:00
70f8f3231b Custom Emitter functions can have inputs now 2019-07-16 14:33:08 +02:00
6a8985dfa5 utility to map multiple sockets 2019-07-16 13:22:58 +02:00
f0cc032f83 construct SmallVector from arbitrary containers 2019-07-16 13:04:26 +02:00
39ebd2fd1f more general function tree dependency discovery 2019-07-16 12:57:30 +02:00
8fec347121 more powerful custom emitter 2019-07-16 11:37:43 +02:00
f058e7b11a remove unnecessary check 2019-07-16 11:32:12 +02:00
8ba1856a13 fix bug in fgraph tuple call 2019-07-16 11:32:01 +02:00
38e223e392 initialize attributes by repeating a given array 2019-07-16 10:00:57 +02:00
f388fdc4f1 Merge branch 'master' into functions 2019-07-16 09:37:19 +02:00
36bd4e1225 get rid of static block size 2019-07-15 18:09:07 +02:00
e95c0078a2 initial custom function emitter 2019-07-15 17:56:02 +02:00
94d2a11636 more debug time checks 2019-07-15 17:25:19 +02:00
ad6fa16304 use more debug time checks 2019-07-15 17:19:02 +02:00
c5d18a0a8a check that indices correspond to correct outputs in debug build 2019-07-15 17:09:32 +02:00
6d208e3183 remove indirection 2019-07-15 16:54:47 +02:00
89a8b1f4f5 cleanup events 2019-07-15 16:51:23 +02:00
aefdc1807a cleanup emitters 2019-07-15 16:43:27 +02:00
b5a74ae166 remove a level of indirection 2019-07-15 16:23:42 +02:00
034956978e more boilerplate code removal 2019-07-15 16:18:59 +02:00
fa9bf0c5b1 cleanup 2019-07-15 16:15:06 +02:00
719357ffda revisit autorefcount 2019-07-15 16:07:24 +02:00
f2421c042e abstract interpolated vectors and matrices 2019-07-15 15:35:45 +02:00
0b3ff01ba4 bring back some emitter settings 2019-07-15 15:23:20 +02:00
39476c5ce3 remove boilerplate code for emitters 2019-07-15 15:18:35 +02:00
419f0de8d3 initialize emitter differently 2019-07-15 15:11:36 +02:00
25b3b122e6 experiment with remembering last point emitter position 2019-07-15 14:39:59 +02:00
2e1ba1c02a interpolate vectors 2019-07-15 14:37:37 +02:00
65f2000075 cleanup variable shadowing 2019-07-15 13:49:29 +02:00
3c979ed37e delete particles in same taskpool as simulation 2019-07-15 12:08:23 +02:00
89b625a0ce Merge branch 'master' into functions 2019-07-15 11:47:47 +02:00
b6b26efb9f Merge branch 'master' into functions 2019-07-12 15:06:01 +02:00
a84fcf8cde actually use threading... 2019-07-12 14:49:30 +02:00
60a2d39782 remove temporary code 2019-07-12 14:08:34 +02:00
45b4704df6 use function to compute point input of point emitter 2019-07-12 14:05:33 +02:00
3915ca912a remove unused code 2019-07-12 13:58:11 +02:00
82844c5f11 cleanup dependency builder 2019-07-12 13:51:20 +02:00
b6c1d3e1bd make updating depsgraph work again 2019-07-12 12:39:57 +02:00
fe4c294656 improve fgraph dependencies 2019-07-12 12:24:43 +02:00
b6820e4a87 fixes 2019-07-12 12:17:43 +02:00
da34e3476e cleanup 2019-07-12 12:02:26 +02:00
b0015fc7cd multimap fix 2019-07-12 12:00:39 +02:00
c77abe1e8d initial revised function dependency handling 2019-07-12 10:33:22 +02:00
5366c5c827 utility functions to access data flow graph 2019-07-12 10:27:52 +02:00
53d00eb08b simplify array printing 2019-07-12 10:14:27 +02:00
b124984220 fix when there are no triangles in mesh 2019-07-12 10:14:12 +02:00
3708e233b5 add multiple in multimap 2019-07-12 09:16:44 +02:00
5b7f49edc4 comment in stringmap 2019-07-11 16:34:53 +02:00
800a578ed7 use StringMap everywhere 2019-07-11 16:30:46 +02:00
12149d8e1b initial string map 2019-07-11 15:50:46 +02:00
05d742427f cleanup action builders 2019-07-11 15:39:06 +02:00
d8719603f8 pass build context instead of separate parameters 2019-07-11 15:30:13 +02:00
db6a45ce1f reorder functions 2019-07-11 15:21:11 +02:00
e0a7c11dd0 cleanup simple emitter builders 2019-07-11 15:14:12 +02:00
32e435bbc3 simplify event inserters 2019-07-11 14:44:01 +02:00
9f1c625056 cleanup force node handling 2019-07-11 14:29:17 +02:00
abb76708d1 simplify create function for node inputs 2019-07-11 13:47:53 +02:00
79ec9180e6 rename GeneratedGraph to BTreeDataGraph 2019-07-11 13:37:43 +02:00
57f7d83def cleanup executing actions for a subset 2019-07-11 12:47:05 +02:00
8eb57698c4 cleanup running action from event 2019-07-11 12:36:09 +02:00
401ff628bd settings size in point emitter is not necessary anymore 2019-07-11 12:28:31 +02:00
75cc874922 introduce attributes info builder 2019-07-11 12:24:06 +02:00
7a62e775bb simplify calling action from emitter 2019-07-11 11:46:10 +02:00
615269b749 rename modifiers to effectors 2019-07-11 11:20:15 +02:00
202708eeae run action on particle birth 2019-07-11 11:17:53 +02:00
5114a48fd7 correct usage of attribute offsets that are not available 2019-07-11 10:15:56 +02:00
35dcbf506d fill an array partially 2019-07-11 09:53:39 +02:00
ed9bc5f5c0 Merge branch 'master' into functions 2019-07-11 09:37:08 +02:00
5f02cc2d3a simple clear cache operator 2019-07-10 17:17:26 +02:00
5216bf6014 get rid of particles.range() 2019-07-10 16:53:39 +02:00
dee695f2da cleanup usage of particle indices 2019-07-10 16:45:05 +02:00
4d6b6ab7e3 fix wrong index access 2019-07-10 16:34:07 +02:00
d7fd4ed39c rename particle_indices to pindices 2019-07-10 16:30:45 +02:00
b5af31fb57 use particle indices to trigger particles 2019-07-10 16:28:43 +02:00
157f0aedcb remove unused code 2019-07-10 16:23:16 +02:00
37a3a41de8 cleanup 2019-07-10 16:21:28 +02:00
8e2ae56b25 access time factors to next event with particle indices 2019-07-10 16:19:31 +02:00
25e7319488 access next event indices with particle indices 2019-07-10 16:11:31 +02:00
18e8a12ef1 use particle indices to access remaining durations 2019-07-10 15:58:53 +02:00
9386bcb29a rename durations to remaining_durations 2019-07-10 15:45:28 +02:00
0135d47a06 compute remaining durations in every thread again 2019-07-10 15:43:10 +02:00
1f9186c270 store remaining durations instead of end times 2019-07-10 15:17:56 +02:00
85b8376829 pass array allocator to emitter and execute event interface 2019-07-10 14:56:44 +02:00
3d93967292 take event execute interface out of action interface 2019-07-10 14:35:57 +02:00
8b13cd86ec more centralized solution to getting an array ref for a range 2019-07-10 14:21:53 +02:00
ab0f8b46a6 use ParticleSets abstraction instead of emitter targets 2019-07-10 13:54:33 +02:00
8ea9f57601 simplify event execute interface 2019-07-10 12:59:20 +02:00
d00457ba64 cleanup ParticleAllocators class 2019-07-10 12:39:15 +02:00
ee70791626 rename BlockAllocator to ParticleAllocator 2019-07-10 12:35:20 +02:00
1104d30f9e remove intermediate class 2019-07-10 12:32:18 +02:00
d191a1cee7 start simplifying the emitter interface 2019-07-10 12:27:18 +02:00
d58a5ac3aa Merge branch 'master' into functions 2019-07-10 11:58:14 +02:00
f09794f280 size input for mesh emitter 2019-07-10 11:36:04 +02:00
b197bf5903 sync node trees when file is loaded 2019-07-10 11:33:33 +02:00
317a2ff1e9 unify float and float3 caching 2019-07-10 11:22:27 +02:00
d34c240ebf Cache particle blocks in container for reuse 2019-07-10 11:05:46 +02:00
804ea8fe82 store and cache size per particle 2019-07-10 10:26:48 +02:00
5e22b41ce1 normal and emitter velocity inputs 2019-07-09 17:07:56 +02:00
ab6106149f move world state to mesh emitter 2019-07-09 17:01:58 +02:00
7b674cc684 pass emitter object and rate into mesh emitter node 2019-07-09 16:56:19 +02:00
fa483d50d1 pass object into object transforms node 2019-07-09 16:23:57 +02:00
7c10fa0ac3 object list type 2019-07-09 16:20:40 +02:00
761090b9d4 object type in function system 2019-07-09 16:09:22 +02:00
0a07de8839 object data type in ui 2019-07-09 16:02:30 +02:00
1b1fcd79da basic caching system so that particles can be rendered 2019-07-09 15:56:38 +02:00
52040433a1 rename modifier 2019-07-09 13:48:00 +02:00
a9c1831b07 remove unused code 2019-07-09 13:33:06 +02:00
d2e4f94205 move action builders to separate functions 2019-07-09 13:32:20 +02:00
4b9b9c7813 simplify inserters 2019-07-09 13:24:16 +02:00
72913dbafc initial process node interface 2019-07-09 12:55:15 +02:00
6ab1d300d6 fix variable names 2019-07-09 12:29:30 +02:00
1bfe567129 new node_frontend interface 2019-07-09 12:27:26 +02:00
fb1fdbd217 remove unnecessary includes 2019-07-09 12:16:54 +02:00
43d037b086 move inserters to separate file 2019-07-09 12:13:34 +02:00
d845e15750 move integrator to seprate file 2019-07-09 12:02:11 +02:00
8364c3aafc move step description to separate file 2019-07-09 11:53:36 +02:00
81795f30b4 move world state to separate file 2019-07-09 11:44:37 +02:00
f3b06e8b15 taking emitter velocity into account 2019-07-09 11:23:06 +02:00
3d919e445a add ability to cache the world state to avoid stepping effects 2019-07-09 10:53:56 +02:00
9863f2bfec new map.add_override method 2019-07-09 10:53:14 +02:00
438aae9d0f remove Function from displace modifier (was only for testing) 2019-07-09 09:58:12 +02:00
30dee2dbd2 specify default inputs for some nodes 2019-07-09 09:50:07 +02:00
d94c249194 add ability to specify default values for data sockets 2019-07-09 09:49:55 +02:00
0d28e20bc3 move possibly empty arrays to end of struct for msvc compatibility 2019-07-09 09:32:35 +02:00
b01071a4f3 Merge branch 'master' into functions 2019-07-08 17:55:29 +02:00
435698e219 rename insert to add 2019-07-08 17:55:07 +02:00
ad7c91b346 new compare function 2019-07-08 17:34:48 +02:00
fed773cec6 random number node should have float instead of int input 2019-07-08 17:14:02 +02:00
9d79363098 move functions to correct file 2019-07-08 17:09:29 +02:00
317158e106 reintroduce unique_ptr for actions and events 2019-07-08 17:08:31 +02:00
6e86e314ef move action interface to separate file 2019-07-08 16:56:27 +02:00
65292981a4 improve ActionInterface 2019-07-08 16:50:28 +02:00
6dd1e480b5 initial Action interface 2019-07-08 16:21:44 +02:00
2a0abf0adf initial condition action 2019-07-08 16:09:32 +02:00
f7e7335123 improved event info usage 2019-07-08 15:39:54 +02:00
49e5434e94 initial collision event info 2019-07-08 15:13:57 +02:00
b293739f1f initial event info 2019-07-08 14:23:08 +02:00
c8816dbd31 StringRef.drop_prefix 2019-07-08 14:14:45 +02:00
6bfa473b60 simplify StringRef operator overloads 2019-07-08 14:02:19 +02:00
cba2b0367c stringref: iterate, startswith and endswith 2019-07-08 13:57:25 +02:00
1251ef30aa gather required attributes from particle type and events 2019-07-08 13:30:58 +02:00
fe697e5c1f SmallSet.add_multiple_new 2019-07-08 13:30:08 +02:00
db89c65746 remove separate EventFilter class 2019-07-08 12:57:39 +02:00
03e95e569b distribute tetrahedons in parallel 2019-07-08 12:43:39 +02:00
d71543bf60 new utility to process a range with multiple threads 2019-07-08 12:42:35 +02:00
fce3694f0d new ChunkedRange 2019-07-08 12:42:13 +02:00
d824cb4a7f allow using array allocator in integrator 2019-07-08 11:53:38 +02:00
16a23f4195 rename FixedArrayAllocator to just ArrayAllocator 2019-07-08 11:44:21 +02:00
7387e36267 simplify allocating arrays and vectors from fixed array allocator 2019-07-08 11:41:38 +02:00
fc412c78b4 comment on fixed array allocator 2019-07-08 11:08:23 +02:00
ef8cbccd54 simplify method names 2019-07-08 11:03:26 +02:00
5503207730 use scoped array allocations to simplify memory management 2019-07-08 11:00:41 +02:00
fff24d71f7 cleanup multimap 2019-07-08 10:37:28 +02:00
3c67bda1d2 Merge branch 'master' into functions 2019-07-08 09:56:40 +02:00
2e701cbaaf rename file to BLI_small_multimap 2019-07-06 18:01:23 +02:00
20bd3b5ed1 add vertex colors to tetrahedons for visualization 2019-07-06 17:30:00 +02:00
e852f7d356 create SmallVector from MappedArrayRef 2019-07-06 17:12:11 +02:00
6715600796 flatten float3 attribute of container 2019-07-06 16:49:12 +02:00
b832be6206 improved particle to tetrahedon conversion 2019-07-06 16:38:26 +02:00
b2188f052b initial particle info node 2019-07-06 15:36:02 +02:00
f204ea5624 Fix append_n_time reallocating every time 2019-07-06 15:14:51 +02:00
1d2adb08f8 Fix ArrayLookup for the case when all slots are used or dummies 2019-07-06 14:43:31 +02:00
f7e0f429e2 remove unused modifier properties 2019-07-05 18:07:12 +02:00
2746f423bd initial turbulence node 2019-07-05 17:38:29 +02:00
f67431d729 use gravity node in simulation 2019-07-05 16:56:40 +02:00
30c6880fe0 initial gravity force node ui 2019-07-05 16:39:29 +02:00
fa79121db2 initial mesh collision event node 2019-07-05 15:40:58 +02:00
d5f21d2aac cleanup age reached event inserter 2019-07-05 15:19:33 +02:00
7beef61562 get node of socket from indexed tree 2019-07-05 15:13:28 +02:00
57cb7849fa construct SmallStack from array 2019-07-05 15:03:48 +02:00
cc8ff01d8e deduplicate function create code 2019-07-05 14:49:18 +02:00
2c8e8d547f add speed input to explode node 2019-07-05 14:42:54 +02:00
681ae8d03c initial explode particle node 2019-07-05 14:38:35 +02:00
0380b22606 better handling of zero duration 2019-07-05 13:42:52 +02:00
452369f1b7 simulate more events per step, again 2019-07-05 12:57:03 +02:00
278dc870c0 allow event filters to add attributes to a particle type 2019-07-05 12:53:37 +02:00
f9edcf46b3 improved change direction action 2019-07-05 12:23:45 +02:00
873f483836 new change direction action 2019-07-05 11:15:57 +02:00
7de0213588 access element at index in listbase 2019-07-05 11:15:31 +02:00
821b7e5360 initial build action from nodes 2019-07-05 10:48:44 +02:00
fc490e4236 new action that does nothing 2019-07-05 10:38:58 +02:00
b71291c96d cleanup 2019-07-05 10:38:44 +02:00
e02befdd2c remove unnecessary IndexedBParticlesTree 2019-07-05 10:28:43 +02:00
5e7dc72f11 better function signature for inserters 2019-07-05 10:24:38 +02:00
057455726c new kill particle node ui 2019-07-05 10:14:01 +02:00
c5330b6d94 new control flow socket 2019-07-05 10:11:40 +02:00
9328e6f0bf Merge branch 'master' into functions 2019-07-05 09:53:41 +02:00
d3c5e882b0 Use monotonic allocator instead of more complex ones 2019-07-04 18:04:58 +02:00
16c92706d8 some comments for allocators 2019-07-04 17:33:46 +02:00
7f410f0655 initial replaceable unlinked inputs handler
Depending the use case, unlinked node inputs should be handled differently.
Sometimes, it is okay to load them from RNA on every call, but
sometimes they should also be hardcoded into the generated assembly.
2019-07-04 16:30:31 +02:00
cdd5d41e6e fix memory leak 2019-07-04 16:08:07 +02:00
3a0cfed4aa first time using the function nodes within bparticle nodes 2019-07-04 15:57:38 +02:00
82ae82488e cleanup data flow graph generation 2019-07-04 15:31:09 +02:00
e7ff5b1470 don't use output parameter when building data flow graph 2019-07-04 15:02:10 +02:00
7a6ab07e9e make it possible to build data flow graphs for any node tree 2019-07-04 14:49:53 +02:00
bee737bbad store list with non-reroute and non-frame nodes explicitely 2019-07-04 14:03:06 +02:00
d66644dd87 cleanup finding input and output nodes of function 2019-07-04 13:57:05 +02:00
be0ed93f99 use indexed node tree in more places 2019-07-04 13:44:33 +02:00
b06ed62500 initial age reached event node 2019-07-04 13:29:49 +02:00
8628f329e8 cleanup rna access 2019-07-04 11:34:49 +02:00
4ae4d125cd simple point emitter node for testing 2019-07-04 11:30:49 +02:00
c44a8e5ede initial emitter inserter 2019-07-04 11:17:21 +02:00
4cb0cb6a06 improve indexed node tree 2019-07-04 10:54:17 +02:00
96f4921704 refactor IndexedBParticlesTree 2019-07-04 10:32:57 +02:00
a6b5767d27 rename NodeTreeQuery to IndexedNodeTree 2019-07-04 10:29:35 +02:00
28c4b3e6f8 identify particle types with name instead of integer
While this might be less efficient, it is much more comfortable to work with.
Also it might be possible to make it a bit more efficient again in the future.
2019-07-04 10:20:32 +02:00
fefeaec48d Merge branch 'master' into functions 2019-07-03 19:11:23 +02:00
5aa6c03fbc use BLI_STATIC_ASSERT 2019-07-03 19:10:07 +02:00
f16c8eec40 optimize adding multiple new values to multimap 2019-07-03 19:02:49 +02:00
10437bba07 only use new multimap implementation 2019-07-03 19:01:14 +02:00
2df06e3172 fix issue with multiple links at same socket 2019-07-03 18:49:57 +02:00
d14073a5fc better multimap implementation for a specific use case 2019-07-03 18:42:29 +02:00
918cdba723 missing from last commit 2019-07-03 18:42:01 +02:00
33dda8463d improved lookup or insert functions for map 2019-07-03 18:41:16 +02:00
b9fee1a5d7 return index when value was inserted before 2019-07-03 17:09:33 +02:00
9af1aa48ab remove unnecessary template parameter 2019-07-03 16:56:01 +02:00
d9277bf1c4 support storing multiple connected sockets per socket 2019-07-03 16:35:36 +02:00
5db4d8269e add multiple new elements to multimap 2019-07-03 16:33:53 +02:00
d037390cd2 iterate keys of multimap 2019-07-03 16:13:35 +02:00
011e88d03c convert linked list to array for further processing 2019-07-03 15:57:56 +02:00
29413c894b class to simplify querying bparticle node tree 2019-07-03 15:51:39 +02:00
b80000f073 rename BNodeTreeLookup to NodeTreeQuery 2019-07-03 15:36:32 +02:00
9c7ef45214 Use float3 instead of custom vector type in function system 2019-07-03 15:34:47 +02:00
bf55ab38d8 comment on llvm builder and types 2019-07-03 15:16:22 +02:00
2448312278 comment on tuple-call 2019-07-03 15:01:54 +02:00
8840be2fb9 Merge branch 'master' into functions 2019-07-03 11:19:24 +02:00
aaef6e6e3a comment on tuple 2019-07-02 18:38:06 +02:00
7a7592e615 comment on CPPTypeInfo 2019-07-02 18:01:06 +02:00
c347373fc6 Comment on SourceInfo, FunctionGraph and DataFlowGraphBuilder 2019-07-02 17:51:10 +02:00
32fdee4444 comment on data flow graph 2019-07-02 17:41:56 +02:00
f5358bc122 comment on Function class 2019-07-02 17:27:00 +02:00
9a9b1e1595 separate declaration from implementation for Function type 2019-07-02 17:11:20 +02:00
6e786c85ea comment on type system 2019-07-02 17:01:14 +02:00
49804947e9 separate declaration and implementation of methods of type 2019-07-02 16:42:20 +02:00
b22a82869c get rid of using TypeVector 2019-07-02 16:33:12 +02:00
4fcd92f624 Tuple now has a weak reference to its metadata to prevent synchronization overhead 2019-07-02 16:31:34 +02:00
d94d68afde parse very simple bparticles node tree 2019-07-02 16:09:56 +02:00
5481e5119b use multimap to more generally store socket origins 2019-07-02 15:31:01 +02:00
1a7507709f get number of values stored per key in multimap 2019-07-02 15:30:32 +02:00
a0cff9838a utility to get nodes with idname 2019-07-02 15:05:38 +02:00
deb642d2ec disable bmesh unit test due to linker errors that I cannot fix now 2019-07-02 15:01:22 +02:00
e0af39a0dc construct SmallVector from ListBase 2019-07-02 15:00:38 +02:00
7db1888bf2 move node tree lookup utilities to BKE 2019-07-02 14:15:20 +02:00
a4fd3f7cc4 store pointer to node tree in modifier data 2019-07-02 12:51:32 +02:00
33e09fe233 initial particle type and mesh emitter node 2019-07-02 12:40:01 +02:00
d41e65e44c rename function_nodes folder to nodes and add bparticles tree type 2019-07-02 12:13:16 +02:00
d5b0df396a various small improvements 2019-07-02 12:02:54 +02:00
940776370c Merge branch 'master' into functions 2019-07-02 09:13:37 +02:00
59d9310b28 initial point randomization accross surface 2019-07-01 17:45:21 +02:00
77d8f118ef avoid stepping when the emitter is moving quickly 2019-07-01 17:29:14 +02:00
2e2fab2f3b cleanup 2019-07-01 17:12:10 +02:00
145e061bce minor cleanup 2019-07-01 17:02:26 +02:00
05027c4d41 cleanup bounce code a little 2019-07-01 16:57:43 +02:00
d7e2e5f99d remove comments that are more confusing than helpful 2019-07-01 15:53:46 +02:00
ad516eda2f cleanup event handling code 2019-07-01 15:47:56 +02:00
6ae9324ada comment on time span 2019-07-01 15:40:22 +02:00
8a6a59d99e comment on particle block 2019-07-01 15:36:15 +02:00
7e2418a877 rename block.size() to block.capacity() 2019-07-01 15:26:28 +02:00
7afeb9775a rename inactive to unused to avoid confusion 2019-07-01 15:25:09 +02:00
f52ff92cc3 rename block.slice() to block.attributes_slice() 2019-07-01 15:21:01 +02:00
ab0c7b8485 rename block.slice_all() to block.attributes_all() 2019-07-01 15:19:24 +02:00
f67bb0ad35 rename block.slice_active() to block.attributes() 2019-07-01 15:16:12 +02:00
c74de0c2e9 comment on particles container 2019-07-01 15:14:39 +02:00
b9baffc59d Comment on AttributeArraysCore and AttributeArrays 2019-07-01 15:02:39 +02:00
eb3fc2c23a comments for AttributeInfo 2019-07-01 14:48:27 +02:00
468e2b8e66 cleanup extracting all particle positions 2019-07-01 14:14:02 +02:00
0de90d6f88 make sure event data is not overwritten by later events 2019-07-01 14:01:06 +02:00
50802c0e6c comment remaining api functions 2019-07-01 13:43:27 +02:00
00bde8527d more comments on api 2019-07-01 12:59:59 +02:00
ac57332ddf access current simulation time through accessor 2019-07-01 12:42:08 +02:00
eb2da8bc5a improve attribute interface 2019-07-01 12:39:02 +02:00
6f069a03d1 new integrator interface 2019-07-01 12:20:55 +02:00
4bdc04e8fb comment particle system api 2019-07-01 12:12:05 +02:00
37c0e0e6e9 cleanup: separate declarations from implementations 2019-07-01 11:42:15 +02:00
a8eb1d28db start cleaning up core.hpp 2019-07-01 11:24:22 +02:00
585d6a51c0 initial api for threading with thread local data
This does look quite ugly so far, but it is still better than doing it manually every time.
2019-07-01 11:08:00 +02:00
6335c3dee8 change threading api 2019-07-01 10:16:29 +02:00
6289393f7b initial c++ api for parallel processing on top of BLI_task 2019-07-01 09:57:34 +02:00
d65427ca94 Merge branch 'master' into functions 2019-07-01 09:37:12 +02:00
2c3d53cf7f minor changes 2019-06-30 15:59:47 +02:00
3c5f321639 fix indices errors 2019-06-30 15:51:18 +02:00
af46f07ef5 initial bounce test 2019-06-30 15:21:43 +02:00
b7b2849c82 initial event storage 2019-06-30 14:34:31 +02:00
ae346fb579 bring back old test setup 2019-06-30 14:07:58 +02:00
4fb660d036 rename run_actions to execute_events 2019-06-30 13:55:20 +02:00
27149c94ee rename EventAction to Event + interface name changes 2019-06-30 13:54:22 +02:00
2618c497c5 rename old Event to EventFilter 2019-06-30 13:49:18 +02:00
3c80e4bc92 code for testing 2019-06-30 13:47:20 +02:00
59e58328ec multithread deletion of tagged particles 2019-06-30 13:42:31 +02:00
c839b2b7b5 use Vector Adapator to simulate to next event 2019-06-30 13:29:01 +02:00
ea5a9c8ec0 use array allocator in simulate_with_max_n_events function 2019-06-30 13:11:26 +02:00
88f5ba087a remove last event times for now 2019-06-30 12:17:23 +02:00
749af6d36c enable threading again 2019-06-30 12:10:40 +02:00
b60dcf9765 store fixed array allocator per thread 2019-06-30 11:51:03 +02:00
8e6bdabb00 always display nanoseconds for now 2019-06-30 11:27:18 +02:00
eb78369271 initial usage of fixed array allocator in simulation 2019-06-30 11:16:14 +02:00
686fa5ca84 utility to allocate attributes from array allocator 2019-06-30 11:12:02 +02:00
0fd83de6c3 new fixed array allocator 2019-06-30 11:11:34 +02:00
80a84f7c11 remove some timers 2019-06-30 11:00:48 +02:00
aaf4b00ba1 test impact of manual vectorization (2x speedup) 2019-06-30 10:40:31 +02:00
2ec577c75e separate methods of integrator 2019-06-30 10:40:08 +02:00
2f91feeb03 allocate attributes at 64 byte aligned addresses 2019-06-30 10:37:49 +02:00
78362edb49 optimization when indices are trivial 2019-06-30 09:55:54 +02:00
1e45e1b6b2 don't check for events when there are none 2019-06-30 09:53:24 +02:00
0bbf940965 better timing statistics 2019-06-30 09:49:10 +02:00
d183496162 cleanup: pass events instead of particle type 2019-06-30 09:26:04 +02:00
b6e0a11e41 prepare simulation for optimizations 2019-06-30 09:22:28 +02:00
a8473ead9e new emitter for testing 2019-06-30 09:21:56 +02:00
ffb79ef037 support printing timings in nanoseconds 2019-06-30 09:04:54 +02:00
e9b83d74d2 cleanup 2019-06-29 16:19:12 +02:00
d53b5af637 refactor high level simulation code 2019-06-29 16:17:01 +02:00
5f7e8e6670 refactor simulation main entry point 2019-06-29 16:04:42 +02:00
ee16f26610 remove unnecessary use of smart pointers 2019-06-29 15:56:25 +02:00
c2e13a2f94 combine event and action 2019-06-29 15:51:38 +02:00
19dda33497 optimization for the case when particle indices are trivial 2019-06-29 15:36:51 +02:00
8dd4082b27 easy access of first and last element in array ref 2019-06-29 15:36:13 +02:00
d206062e10 implicitely convert SmallSetVector to ArrayRef 2019-06-29 15:11:22 +02:00
1d031a92a5 define attributes as part of particle type 2019-06-29 15:05:15 +02:00
425d620d57 more generic way to apply attribute offsets 2019-06-29 14:14:48 +02:00
f77dfe6e94 cleanup: rename to attribute_offsets 2019-06-29 13:48:59 +02:00
b65783941c separate integrator from simulation 2019-06-29 13:44:00 +02:00
0f26e99517 bring back loop to simulate n events 2019-06-29 13:08:48 +02:00
506b6d7df9 temporarily unrolled event loop 2019-06-29 12:53:19 +02:00
efd91c4701 integrate particles of entire block instead of a particle set 2019-06-29 12:29:06 +02:00
21dfdbc58b Merge branch 'master' into functions 2019-06-28 17:42:08 +02:00
7e767d0858 initial experimental vector adaptor data structure 2019-06-28 17:41:15 +02:00
3be92ce31b function to simulate a block 2019-06-28 16:41:18 +02:00
bb537df8d0 cleanup remove unused return parameter 2019-06-28 15:46:15 +02:00
3dbd8b81ba compute ideal offsets only once per particle per time step
I have to bring back simulating multiple events per particle now.
2019-06-28 15:43:50 +02:00
6c5a2fecf6 refactor: move computation of ideal offsets up 2019-06-28 15:33:56 +02:00
4c85e861ea refactor applying remaining particle offsets 2019-06-28 15:31:36 +02:00
b0f2b24160 cleanup 2019-06-28 15:12:42 +02:00
40f65055e3 loop only over particles with events instead of all 2019-06-28 14:58:18 +02:00
624794e006 float3 * scalar operator 2019-06-28 14:46:15 +02:00
a0fcdb0f98 extract method to compute current time per particle 2019-06-28 14:29:16 +02:00
035d92dd1a faster temporary random number function 2019-06-28 14:20:04 +02:00
a4a69e605c improve interface for killing particles 2019-06-28 14:11:06 +02:00
105353359c improve birth time handling in action interface 2019-06-28 13:49:47 +02:00
c500e94670 cleanup handling of birth times in emitters 2019-06-28 13:30:36 +02:00
d2e050e5e1 experimental explode action 2019-06-28 12:50:16 +02:00
485b07dc55 give action access to current time per particle 2019-06-28 12:30:50 +02:00
58452b095d initial test for spawning new particles in an action 2019-06-28 11:32:08 +02:00
788297480f split EmitTarget into EmitTargetBase and TimeSpanEmitTarget 2019-06-28 10:53:15 +02:00
fad7613963 simulate newly created particles until there are no new ones 2019-06-28 10:45:15 +02:00
b928475df0 separate partial simulation of new particles from emitters 2019-06-28 10:34:38 +02:00
2835c8df6f allow SmallVector to use ArrayRef 2019-06-28 09:59:32 +02:00
83a8f830c0 simulate particles of all types at the same time 2019-06-28 09:16:09 +02:00
7326d0a3f8 Merge branch 'master' into functions 2019-06-28 08:56:38 +02:00
17441b327b use one block allocator per thread instead of per block 2019-06-27 17:03:44 +02:00
700c2c823a keep track of newly allocated blocks 2019-06-27 16:21:29 +02:00
58253b535f make Block Allocator part of action interface 2019-06-27 15:41:25 +02:00
dd55ac9128 cleanup: remove unnecessary state parameter 2019-06-27 15:30:56 +02:00
878028d385 make it easier for emitters to specify birth moments 2019-06-27 15:07:39 +02:00
42d70c8152 emitter decides at which time individual particles are spawned 2019-06-27 14:29:26 +02:00
ab136cb188 size-value constructor for SmallVector 2019-06-27 13:59:18 +02:00
f2ed497129 initialize attributes with default values 2019-06-27 13:46:03 +02:00
e858f2e9ff thread safe block creation and deletion 2019-06-27 13:27:52 +02:00
551ae21bff use block allocator to allow muliple emitters to emit into the same block 2019-06-27 13:25:01 +02:00
2fa66f6f96 move function from header to cpp 2019-06-27 12:40:33 +02:00
8349161f14 refactor emitter interface internals
The problem previously was that all the information about which
blocks contain the attributes was not accessible by the emitter.
2019-06-27 12:36:47 +02:00
db8c116f5c remove request_raw function from public emitter interface 2019-06-27 11:21:59 +02:00
938bd0edc4 ParticleSet should know the block it is in 2019-06-27 11:13:48 +02:00
40a2f975dc Merge branch 'master' into functions 2019-06-27 10:02:07 +02:00
06fab69664 visualize different particle types with vertex colors 2019-06-26 18:18:38 +02:00
ddb44cefbd figure out how to add vertex colors to a new mesh 2019-06-26 15:58:32 +02:00
6ea4623ea1 ability to store attribute defaults in AttributeInfo 2019-06-26 15:34:57 +02:00
1d807a8399 Allow emitters to emit multiple types of particles 2019-06-26 14:46:44 +02:00
6704c82293 new ActionInterface class 2019-06-26 14:12:12 +02:00
333d82ebc0 remove unused variable 2019-06-26 12:52:08 +02:00
165580c661 Update attribute arrays based on which attributes are required 2019-06-26 12:51:58 +02:00
9728f45e89 particles container has responsibility to allocate attribute arrays again 2019-06-26 12:06:22 +02:00
2d7673578e comment out unused variables 2019-06-26 11:41:12 +02:00
6736ce6a03 Merge branch 'master' into functions 2019-06-26 11:34:08 +02:00
059639e301 new EventInterface abstraction 2019-06-24 12:37:27 +02:00
c2e4c7490f take reference to emitter interface 2019-06-24 09:47:30 +02:00
4b5a23b096 rename EmitterHelper to EmitterInterface 2019-06-24 09:44:14 +02:00
c5744593ec rename pindex_of to get_particle_index 2019-06-24 09:40:51 +02:00
b12daf64ca separate tuple from tuple-call 2019-06-24 09:38:54 +02:00
450d3be01f Merge branch 'master' into functions 2019-06-24 09:13:21 +02:00
7c4208f8a9 Merge branch 'master' into functions 2019-06-21 18:52:00 +02:00
5f0286302e Comment methods of ArrayRef and StringRef 2019-06-21 18:51:37 +02:00
da5f1dd8e5 comment methods of some more data structures 2019-06-21 18:41:04 +02:00
b247fc7d46 comments for methods of SmallVector 2019-06-21 18:12:07 +02:00
a19a5f8675 initial code layout for updating the required attributes 2019-06-21 16:56:19 +02:00
3a87096f24 allocate attributes arrays in AttributeArraysCore 2019-06-21 16:48:19 +02:00
8ee05156e6 simulate all particle types with description 2019-06-21 16:21:25 +02:00
098cb4ceaa cleanup copying ArrayRef to pointer 2019-06-21 16:12:16 +02:00
cf81da2547 refactor towards supporting multiple particle types 2019-06-21 16:03:30 +02:00
ab51c0e7dc initial particle type intermediate class 2019-06-21 15:10:23 +02:00
3e5fb5d83e fix using wrong length 2019-06-21 14:56:13 +02:00
d5bc8a6840 support point and tetrahedon mesh creation 2019-06-21 14:45:41 +02:00
db06b3a0b4 comment to note invariants of particle indices arrays 2019-06-21 14:14:34 +02:00
da1524fca8 new ParticleSet abstraction: attribute arrays + particle indices 2019-06-21 14:09:59 +02:00
5a31c30b5c transform emitter mesh to world space 2019-06-21 13:28:17 +02:00
cae29a0d9d transform collision rays to object space 2019-06-21 13:23:55 +02:00
c9958be749 initial mesh collision event 2019-06-21 12:53:51 +02:00
1294a9b5b4 generate tetraeders for particles 2019-06-21 12:02:27 +02:00
9f53e98472 minor cleanup 2019-06-21 11:32:55 +02:00
a7a6fe3ebc initial double event avoidance 2019-06-21 11:19:16 +02:00
5d590fc1bb extract method to simulate multiple events per step 2019-06-21 11:00:48 +02:00
e5fa7e58ba Merge branch 'master' into functions 2019-06-21 10:24:06 +02:00
f1369dd6ac bring back multithreading support 2019-06-20 15:49:49 +02:00
ad051d46aa don't inline simulation functions to make profiles more useful 2019-06-20 15:20:55 +02:00
a29da3be76 remove outdated simulation code 2019-06-20 15:17:23 +02:00
82c4bdc6d0 move events and actions to separate files 2019-06-20 15:16:57 +02:00
f0cca10248 use mesh surface emitter again 2019-06-20 15:05:08 +02:00
0bf6fa4729 test multiple events 2019-06-20 14:56:42 +02:00
9c7c2d0de3 support for multiple events per particle per time step 2019-06-20 14:34:09 +02:00
0886cdb1fe support killing particles again 2019-06-20 14:23:39 +02:00
c7b1129e77 bring back event handling 2019-06-20 13:57:32 +02:00
bcc877e180 compress blocks after each simulation step 2019-06-20 12:51:07 +02:00
2a9316d33c actually free emitters etc. 2019-06-20 12:44:07 +02:00
831d5665b0 apply forces to particles again 2019-06-20 12:36:23 +02:00
cfb18bb6c3 Pass particle influences into the right functions 2019-06-20 12:21:30 +02:00
dd8d2517d6 separate emitters from particle influencers 2019-06-20 12:16:43 +02:00
5561684337 support emitting particles again 2019-06-20 12:10:07 +02:00
f7cca29528 bring back creating the combined positon array 2019-06-20 11:18:54 +02:00
c8bf758a9a restructure solver api
Now I have to bring back all the functionality that was there already.
2019-06-20 11:04:45 +02:00
c74934cbf9 remove abstractions that are wrong for now 2019-06-20 10:17:09 +02:00
10fe6f6037 Merge branch 'master' into functions 2019-06-20 09:43:01 +02:00
05969e5418 initial curve emitter 2019-06-19 12:24:20 +02:00
0a7715e308 move forces into separate file 2019-06-19 11:06:23 +02:00
3138c7c5d7 rename files 2019-06-19 10:39:02 +02:00
3134c78661 remove turbulence force to have less distorted profiles 2019-06-19 10:34:30 +02:00
20c7fa6bcc extract temporary method for old particle deletion 2019-06-19 10:34:08 +02:00
d43d28a348 avoid creating the same arrays many times 2019-06-19 10:29:58 +02:00
5554851f15 refactor moving particles to next event time 2019-06-18 18:23:10 +02:00
ae80a416bd extract methods to simulate to next event vs. to next frame 2019-06-18 16:45:18 +02:00
7b15ec8713 Integrate particles again after an event 2019-06-18 16:22:05 +02:00
647503ec47 remove specialized step function for new particles 2019-06-18 15:18:31 +02:00
7629b86581 use indices mask to update only certain particles 2019-06-18 15:02:59 +02:00
913e130897 naming cleanup 2019-06-18 14:26:57 +02:00
de5971b1df initial positional event abstraction 2019-06-18 14:21:35 +02:00
d600fb3a45 more explicit particle integration step 2019-06-18 14:02:32 +02:00
17bff65c6b Use multithreading when moving particles forward
Timings in my current test file (nanoseconds per particle per time step):
* Debug Build: 150ns
* Optimized Build: 47ns
* With threading: 9ns
2019-06-18 12:35:22 +02:00
962a64aaaa restructure simulation steps in solver 2019-06-18 12:03:46 +02:00
5d08ae535a Utility to convert SmallSet to SmallVector 2019-06-18 12:03:15 +02:00
dd856ee973 Cleanup: reorder some functions 2019-06-18 11:49:15 +02:00
e8e94a6800 Allow emitters to emit into separate buffers 2019-06-18 11:46:14 +02:00
14125d2652 minor emitter API improvement 2019-06-18 10:05:16 +02:00
155c1de9ad improved particle attribute handling 2019-06-17 15:52:04 +02:00
8482ee2be9 utilities to create a range before/after another 2019-06-17 15:51:06 +02:00
270f4cb1f0 SmallVector: Append N Times 2019-06-17 15:13:19 +02:00
125ff9f320 initial mesh surface emitter 2019-06-17 12:16:41 +02:00
e8ecbf3a42 Emit from other objects origin 2019-06-17 11:19:26 +02:00
b010464151 simple point emitter 2019-06-17 10:59:04 +02:00
e77d269088 Merge branch 'master' into functions 2019-06-17 10:14:23 +02:00
dd201e3fc3 Merge branch 'master' into functions 2019-06-13 11:31:10 +02:00
4faf2de83a initial particle action abstraction 2019-06-10 12:23:15 +02:00
aa05731607 compute new positions and velocities in separate buffer 2019-06-10 12:05:28 +02:00
81eecb252a cleanup naming 2019-06-10 12:04:16 +02:00
97ecf23069 ArrayRef.copy_from 2019-06-10 12:03:29 +02:00
8e3178e1f2 use NamedBuffers in more places 2019-06-10 11:11:32 +02:00
2d73ff2380 rename buffer accessors 2019-06-10 11:07:40 +02:00
c49ca5c99f rename Vec3 to float3 2019-06-10 10:53:36 +02:00
b5fda893ce add byte attribute type 2019-06-09 13:51:37 +02:00
bcc8a07fd3 experimental turbulence force 2019-06-09 13:18:55 +02:00
5da27a41c1 improve naming 2019-06-09 12:59:41 +02:00
da1eb092eb flag killed particles in step function 2019-06-09 12:55:26 +02:00
93e38f5f6b cleanup stepping a slice of particles 2019-06-09 12:45:24 +02:00
4ffc3c46a1 partial step newly emitted particles 2019-06-09 12:37:21 +02:00
a38b89ecb5 initial emitter info class 2019-06-09 11:58:00 +02:00
270cee3d4a fix old particle removal 2019-06-08 14:02:51 +02:00
dc26770356 keep track of time since simulation start 2019-06-08 14:00:24 +02:00
a4de314d20 ArrayRef take_front and take_back methods 2019-06-08 13:55:21 +02:00
c77945366c pass elapsed seconds into step function 2019-06-08 13:39:49 +02:00
f693a5b66d automatically initialize attributes the emitter does not care about 2019-06-08 13:30:33 +02:00
c76ed1781b method to fill an ArrayRef 2019-06-08 13:28:35 +02:00
941159fba5 emitter can decide which attributes it initializes 2019-06-08 12:59:04 +02:00
e3d3d2eec7 introduce concept of particle block slices 2019-06-08 12:38:30 +02:00
3fd4418cfd fix lazy init unit test 2019-06-08 12:37:49 +02:00
c0b36372d0 easy access last element in vector 2019-06-08 12:37:39 +02:00
3c04bdbddb cleanup naming and implement some destructors 2019-06-08 11:54:45 +02:00
17804e4ecb experiment with an emitter abstraction 2019-06-07 23:12:35 +02:00
dbc50aa156 initial deletion or particles and compression of blocks 2019-06-07 22:43:29 +02:00
c2fa4a33fa test NamedBuffersRef abstraction to separate components
More specifically this separates implementation details of
Forces and ParticleBlocks.
2019-06-07 18:07:54 +02:00
9351db7146 work-in-progress functions to compress a set of particle blocks 2019-06-07 17:50:33 +02:00
4c0e7a285a initial particles container 2019-06-07 17:18:18 +02:00
d0cbd39310 initial force implementation 2019-06-07 15:53:48 +02:00
2c519ceb63 simple Vec3 type 2019-06-07 15:53:12 +02:00
2bcf091ba9 control simulation with some properties 2019-06-07 15:13:11 +02:00
80ec80cb83 don't reset simulation when pausing playback 2019-06-07 12:34:15 +02:00
ed02e1d252 cleanup interface to solver 2019-06-07 12:30:39 +02:00
d3013152ce little bit more interesting particle movement 2019-06-07 12:24:28 +02:00
3d797d0070 splitup bparticles code into multiple files 2019-06-07 12:17:22 +02:00
41cbcf96e9 try a different approach to connect state to solvers 2019-06-07 12:00:02 +02:00
01196be661 initial particle system api test
Still not happy with the way solver-dependent state is handled.
2019-06-07 11:04:01 +02:00
741ed59745 very simple particles state reset logic 2019-06-06 17:43:23 +02:00
b61fce82f9 more consistent naming in C wrappers 2019-06-06 11:33:46 +02:00
c5850f6ef1 use runtime data in modifier 2019-06-06 11:21:31 +02:00
56a0a71649 new simulations folder with some test code 2019-06-06 10:42:01 +02:00
6f728beec9 Merge branch 'master' into functions 2019-06-06 10:10:35 +02:00
6262b2bf7c initial empty particle nodes modifier 2019-06-05 10:28:26 +02:00
0387abd20f better explanation for lazy-init macros 2019-06-05 10:05:27 +02:00
473b79b4c2 remove unused include 2019-06-05 09:58:01 +02:00
6ffab86a4d simplify naming for lazy init macros 2019-06-05 09:56:25 +02:00
63c4712450 lazy init: thread safe registration and utility to list all 2019-06-05 09:47:27 +02:00
4df64a4393 improve move semantic usage in BLI::Optional 2019-06-04 18:14:37 +02:00
6ac4a72b28 free cached vectorized functions 2019-06-04 18:05:15 +02:00
77df7c61e6 Destruct lazy initialized objects when Blender quits 2019-06-04 17:38:05 +02:00
b8cb48b630 Merge branch 'master' into functions 2019-06-04 16:31:37 +02:00
a5413ba0f8 sort includes 2019-05-28 15:18:19 +02:00
5ea27e3d14 cleanup SmallVector 2019-05-28 15:14:20 +02:00
a34761afc0 Reduce wasted space in Function class
This is achieved by storing strings in a single buffer instead
of using `std::string`, which does small object optimization
for every string individually. This optimization can be done
because all strings are known when the function is build and
don't change later on.
2019-05-28 12:11:11 +02:00
5c72fb6a34 implement == operator for StringRef 2019-05-28 11:42:53 +02:00
3913b81f9e construct StringRefNull from pointer and length 2019-05-28 11:15:50 +02:00
a02cf6a05b Merge branch 'master' into functions 2019-05-28 10:53:36 +02:00
68174cf0b2 Merge branch 'master' into functions 2019-05-23 17:27:26 +02:00
cbb8bd467b better cross platform exponent computation 2019-05-22 17:31:43 +02:00
8c37c378a4 more assertions in ArrayLookup 2019-05-22 17:21:12 +02:00
e59d0263ba create ArrayRef from std::vector and std::array 2019-05-22 17:11:09 +02:00
dac0f4864d cleanup SmallMap 2019-05-22 17:00:10 +02:00
28887080a5 ArrayRef constructor for SmallSet 2019-05-22 16:41:53 +02:00
3ab2a2af29 correct small object optimization for sets and maps 2019-05-22 16:37:07 +02:00
d5b707b6fb improve SmallStack class 2019-05-22 16:22:47 +02:00
9ec8e308e7 more efficient small vector extend 2019-05-22 16:16:34 +02:00
b3283176a0 fix memory leaks in unit tests 2019-05-22 16:05:01 +02:00
24c3b57ec3 remove unused StringCollection 2019-05-22 15:53:15 +02:00
7863cf89de cleanup ScopedTimer 2019-05-22 15:41:20 +02:00
900e7f6352 Merge branch 'master' into functions 2019-05-22 15:31:28 +02:00
bddc6999b0 support for caching auto vectorized functions 2019-05-20 11:19:06 +02:00
357fa4a5ba equality operator for functions 2019-05-20 11:07:41 +02:00
0338da1063 smallmap: lookup or insert using key function 2019-05-20 11:07:23 +02:00
341b078d91 allow creating small vector with different size from array ref 2019-05-20 11:06:53 +02:00
d8d6f2a521 smallmap: lookup or insert using callback 2019-05-20 10:55:15 +02:00
92a3a4e029 speedup when all types in tuple meta are trivially destructible 2019-05-20 09:51:33 +02:00
0b63963c5a llvm vectors are not stored as struct anymore 2019-05-20 09:42:29 +02:00
a10f336346 Merge branch 'master' into functions 2019-05-20 09:36:28 +02:00
1bde9ab004 remove signature and paramter classes 2019-05-17 12:02:22 +02:00
ffeea91347 don't use signature in function anymore 2019-05-17 11:59:40 +02:00
e0032e8446 remove more dependencies on signature and parameter types 2019-05-17 11:46:31 +02:00
d6eb9668a0 move more signature logic into function 2019-05-17 11:18:30 +02:00
3bc03102d8 Merge branch 'master' into functions 2019-05-17 11:11:49 +02:00
3cddf75818 use StringRef and ArrayRef in more places 2019-05-16 12:02:57 +02:00
9d92456c88 use ArrayRef in more places 2019-05-16 11:52:56 +02:00
9107197320 use ArrayRef in more places 2019-05-16 11:46:39 +02:00
0a66b12776 less usage of InputParameter and OutputParameter type 2019-05-16 11:40:12 +02:00
9de7d3fa45 use new FunctionBuilder instead of creating Signature manually 2019-05-16 10:46:57 +02:00
3f82445d43 windows build fix 2019-05-16 10:15:21 +02:00
eb74be102e Rename StridedArrayRef to MappedArrayRef 2019-05-15 18:03:08 +02:00
836a780649 Merge branch 'master' into functions 2019-05-15 17:55:11 +02:00
8ab87c1998 initial StringCollection class 2019-05-15 17:16:47 +02:00
39d4e0182c use string ref in llvm ir builder 2019-05-15 11:39:25 +02:00
23c1b1edc8 deduplicate string ref code 2019-05-15 11:38:06 +02:00
13e06e7670 use string ref in more places 2019-05-15 11:22:50 +02:00
6dedb028d8 use string ref in more places 2019-05-15 11:17:20 +02:00
3b6bed43cd use string ref for type names 2019-05-15 11:10:02 +02:00
92c1d9044c new StringRefNull class 2019-05-15 11:00:07 +02:00
6e4866465d initial StringRef class 2019-05-15 10:49:38 +02:00
dbced1d563 Merge branch 'master' into functions 2019-05-15 10:16:35 +02:00
4b6799394f Some documentation for the C++ data structures in BLI 2019-05-13 18:38:37 +02:00
f7fd87d9d2 Merge branch 'master' into functions 2019-05-13 10:05:30 +02:00
3cb181ffe0 utilities to access function parameters 2019-05-12 20:25:49 +02:00
f959f4d2b2 use ArrayRef in more places 2019-05-12 20:07:16 +02:00
f2e5ed0e34 missing from last commit 2019-05-12 20:04:36 +02:00
38531114f7 initial support for defaults when using auto vectorization 2019-05-12 20:04:16 +02:00
4a2193927d improve ArrayRef 2019-05-12 19:47:46 +02:00
a2ef8e34d5 support different list lengths in llvm vectorization 2019-05-12 17:53:41 +02:00
ec2c1e54ed print with stacktrace from IR 2019-05-09 13:20:29 +02:00
d9c7df2492 put current loop iteration on stack 2019-05-09 13:02:41 +02:00
9f6e0a74cb float comparison IR 2019-05-09 12:43:58 +02:00
192b5e9cfb simplify usage of construct builders 2019-05-09 12:29:00 +02:00
e0c2784327 support for calling printf from llvm ir 2019-05-09 12:23:12 +02:00
9880a1b366 printing from Ir cleanup 2019-05-09 10:57:30 +02:00
6151808f1b initial if then else construct helper 2019-05-09 10:45:07 +02:00
989c2691ac improve ir loop constructs 2019-05-09 10:31:22 +02:00
5fe4ad93bc more specialized iterations loop builder 2019-05-09 10:20:24 +02:00
dbb52fec27 initial for loop builder helper 2019-05-09 09:51:45 +02:00
6df353d805 Merge branch 'master' into functions 2019-05-08 18:06:43 +02:00
bbb3770be2 speedup size constructor of small vector 2019-05-03 12:42:50 +02:00
49131279ee generate more readable IR 2019-05-03 12:39:21 +02:00
c1267d9e01 allow passing function pointer name 2019-05-03 12:18:35 +02:00
4cd8792882 cleanup code builder interface 2019-05-03 12:16:00 +02:00
6ad32d6675 create llvm wrapper function for calls to pointers 2019-05-03 12:09:40 +02:00
4390091f8b utility to create a float constant 2019-05-03 11:38:33 +02:00
2a957e405d cleanup small vector 2019-05-03 11:37:58 +02:00
c38b9e12b2 Merge branch 'master' into functions 2019-05-03 10:43:49 +02:00
2a87cfd809 allocate function bodies within function 2019-05-02 11:39:42 +02:00
0ca57c14af rename extend to add_extension 2019-05-02 11:21:52 +02:00
5d4bf32c40 allocate type extensions in type directly
This makes sense, since every extension is owned
by a Type object. Also this improves thread safety.
2019-05-02 11:19:05 +02:00
9deeb8eb22 use centralized pool to reuse llvm contexts 2019-05-02 10:48:30 +02:00
676918e7a1 Merge branch 'master' into functions 2019-05-02 10:16:52 +02:00
6e652a42fc splitup llvm vectorization into multiple methods 2019-05-01 19:26:51 +02:00
640a744d54 start simplifying automatic vectorization 2019-05-01 19:12:04 +02:00
1ab8b7f658 move c functions to access lists to lists.cpp 2019-05-01 18:26:42 +02:00
28051e2754 rerun clang format on functions folder 2019-05-01 18:01:03 +02:00
bde00c4aed Merge branch 'master' into functions 2019-05-01 17:59:27 +02:00
576243ba39 Initial automatic function vectorization with llvm 2019-05-01 15:27:00 +02:00
f09f8ad61f move slicing functionality to ArrayRef 2019-05-01 11:39:05 +02:00
034639a877 initial vector slicing API 2019-05-01 10:57:26 +02:00
fd5d972efb Merge branch 'master' into functions 2019-05-01 10:20:10 +02:00
ffe0796c41 use first-class llvm vector for Vector type 2019-04-30 13:58:13 +02:00
e8e0e7bc69 rename SimpleLLVMTypeInfo to PackedLLVMTypeInfo 2019-04-30 12:48:44 +02:00
dc2979a942 cleanup LLVMBool type info 2019-04-30 12:42:26 +02:00
2524a5e509 new TrivialLLVMTypeInfo to simplify creating other types 2019-04-30 12:35:19 +02:00
45271f785a clear cached node states on file load 2019-04-30 12:07:20 +02:00
f5d0dbed20 move btree lookup class to separate file 2019-04-30 11:57:38 +02:00
3b00f6625c Merge branch 'master' into functions
This also removes dependency creation for function drivers
(due to merge conflicts that I could not resolve yet).
2019-04-30 10:55:36 +02:00
d1aa60da80 Merge branch 'master' into functions 2019-04-29 11:42:58 +02:00
0e0495cf32 Merge branch 'master' into functions 2019-04-29 10:52:11 +02:00
8f70d4986e splitup forwarding function 2019-04-28 21:15:43 +02:00
6c1e5d7f34 extract method that ensure all inputs 2019-04-28 19:30:39 +02:00
1aa827d496 extract method that ensures required inputs 2019-04-28 19:23:59 +02:00
b287de4e68 deduplicate stack setup code 2019-04-28 19:20:24 +02:00
f16e64435f deduplicate some code 2019-04-28 19:15:57 +02:00
26ce24b928 better type names 2019-04-28 19:12:26 +02:00
e80d9a5391 destruct unused values as early as possible 2019-04-28 18:56:16 +02:00
f48b9823a4 deduplicate code to setup tuples 2019-04-28 18:45:09 +02:00
1242de1b6d deduplicate some code 2019-04-28 18:38:47 +02:00
64210d6682 simplify stack info setup 2019-04-28 18:33:36 +02:00
049d66aa80 initial support for lazy inputs in new fgraph evaluation 2019-04-28 18:25:29 +02:00
da3d297b3f subscript operator for range 2019-04-28 17:50:44 +02:00
7b75b665d3 group node info into a struct 2019-04-28 15:06:23 +02:00
c9eb9f4ad1 fix error in last merge 2019-04-28 14:49:59 +02:00
df0b4a4d0e Merge branch 'master' into functions 2019-04-28 14:42:08 +02:00
c27bbb3eca use more correct type name 2019-04-27 23:59:33 +02:00
3f6357b970 initialize llvm for tests 2019-04-27 23:40:53 +02:00
93dea8967d unit test for Float Range function 2019-04-27 23:29:33 +02:00
5b6dde93e9 initial unit test for functions system 2019-04-27 23:18:14 +02:00
1db1ac121a reduce likelyhood for heap allocation in fgraph evaluation 2019-04-27 22:32:11 +02:00
b76f54e540 splitup graph evaluation in three parts 2019-04-27 22:23:23 +02:00
d01cc80b08 move more into the value storage abstraction 2019-04-27 22:16:28 +02:00
76c3bd772e move value storage into separate struct 2019-04-27 22:03:04 +02:00
e0531b4338 use macro for pointer offset 2019-04-27 20:21:41 +02:00
05985d98ff put values in a struct that are accessed together 2019-04-27 20:15:58 +02:00
833cdfdd0c remove unused socket flag 2019-04-27 19:58:30 +02:00
21f1e501a7 do less unnecessary data copies 2019-04-27 19:49:33 +02:00
bbede5b3bd copy computed value to fn_out immediatly 2019-04-27 19:34:49 +02:00
bae0d22e06 make it optional to run value destructors when tuple is destructed 2019-04-27 17:04:55 +02:00
eece95823c multipool tried to deallocate the wrong pointer 2019-04-27 12:55:07 +02:00
9ca8b7a444 initial non recursive evaluation of new data flow graph 2019-04-27 12:48:04 +02:00
a9efbd6bcd utility set functions 2019-04-27 12:21:13 +02:00
04a4f1aa4d extract ensure tuple calls function 2019-04-27 10:24:43 +02:00
ad168871b1 dot export for new data flow graph 2019-04-27 10:01:36 +02:00
4346e88286 Split up the data flow graph data structure
The main goal is to be able to traverse the graph very efficiently
once it is build. This is hard when the structure has to be dynamic
(i.e. it can be changed). The solution is to use a builder that
can dynamically construct the graph. Once everything is set up,
the graph is converted into the compact form for further use.
2019-04-26 19:21:28 +02:00
ccc4285dee Merge branch 'master' into functions 2019-04-26 17:09:11 +02:00
a8bc2fc2b7 Merge branch 'master' into functions 2019-04-25 09:57:14 +02:00
81b9187dda Merge branch 'master' into functions 2019-04-24 09:22:11 +02:00
844745da77 Simple range iterator with tests 2019-04-19 13:56:49 +02:00
34fda46a3e produce lookup statistics for map and set 2019-04-19 11:19:23 +02:00
866e9c31e9 socket builder utility function 2019-04-19 10:34:22 +02:00
6a7efc26bd support conversions in all directions between bool, int and float 2019-04-18 11:25:20 +02:00
12904214d1 update inferencing to new type rules 2019-04-18 11:01:17 +02:00
9b3e36f6c4 concept of conversion groups in type system 2019-04-18 10:42:39 +02:00
7178267f20 start using a better defined type system 2019-04-18 10:19:30 +02:00
2141478180 implicit conversions between float and integer lists 2019-04-18 09:42:29 +02:00
5333710282 Merge branch 'master' into functions 2019-04-18 09:13:01 +02:00
8c6457820b bring back llvm include dirs 2019-04-17 11:10:51 +02:00
bd54f55f3a add bf_functions to LIB 2019-04-17 11:00:22 +02:00
2213234715 Merge 'master' into 'functions' 2019-04-17 10:28:33 +02:00
9e1d43367c Merge 'master' into 'functions' 2019-04-17 10:26:56 +02:00
06a966ebe7 Merge 'master' into 'functions' 2019-04-17 10:25:47 +02:00
d348a27380 improved reuse of dummy slots in array lookup 2019-04-15 15:33:56 +02:00
b07b7d0a63 deduplicate some array lookup code 2019-04-15 15:03:23 +02:00
5d83b59751 splitup tests for set and set_vector 2019-04-15 14:48:07 +02:00
9bd835e1fb don't use linear search in SmallSetVector 2019-04-15 14:31:18 +02:00
4687f961f0 remove refcount class that is not used anymore 2019-04-15 14:26:16 +02:00
6615900384 pack list declaration handles implicitely convertable types 2019-04-15 10:39:05 +02:00
955dc9f977 add LIB to CMakeLists.txt 2019-04-15 10:33:39 +02:00
a628f1842b Merge branch 'master' into functions 2019-04-15 10:24:47 +02:00
158425fc61 use a multimap data structure to store links of output sockets 2019-04-11 13:47:01 +02:00
f92bc17cb3 utility to count the number of times an output socket is used 2019-04-08 18:57:01 +02:00
7e2f02b019 more generic function to find relevant sockets in a function graph 2019-04-08 18:35:58 +02:00
45917d435d utility functions for set and map 2019-04-08 18:34:35 +02:00
e352d7d3ca new Float Range node 2019-04-08 17:29:04 +02:00
750d47e4d9 fix inferencing of vectorized nodes 2019-04-08 17:06:11 +02:00
db03f3399c fix probing function 2019-04-08 17:03:24 +02:00
54d4464a29 remove "small" from some type names 2019-04-08 16:13:44 +02:00
5a1279fdce faster adding to array lookup 2019-04-08 16:01:16 +02:00
6742728ff1 don't use llvm fgraph execution for now 2019-04-08 12:39:03 +02:00
338d84676f cleanup array lookup structure 2019-04-08 12:35:30 +02:00
b26a74c470 method to pop item from map 2019-04-07 20:22:06 +02:00
d866113089 End all files with a newline 2019-04-07 19:44:27 +02:00
76a1e9bdb8 Merge branch 'master' into functions 2019-04-07 17:21:30 +02:00
f6f8323082 Fix Sin operation in Float Math node
The patch only fixed the python part. I added the c++ part.

Differential Revision: https://developer.blender.org/D4658
2019-04-07 17:17:29 +02:00
0f1b4d7c38 Use actual hash tables instead of linear search
The hash functions themselves are not optimized yet.
2019-04-07 17:01:31 +02:00
6f96045c2f rename ptr to rna to avoid confusing with actual pointers 2019-04-07 00:01:41 +02:00
9e8babf885 vectorize Float Math node 2019-04-06 23:54:06 +02:00
ece895e7d5 remove some redundency 2019-04-06 23:43:35 +02:00
be53a35ad3 allow lazy tuple call in fgraph ir generation 2019-04-06 23:42:57 +02:00
e38e04e9af cleanup vectorized node inserters 2019-04-06 23:24:12 +02:00
44d8980780 cleanup and vectorize Vector Math node 2019-04-06 23:07:12 +02:00
5ea3eca380 use function name prefix for inserters 2019-04-06 22:50:20 +02:00
954b2de3d5 improve method names 2019-04-06 22:42:52 +02:00
28f239a384 remove BuilderContext 2019-04-06 22:27:58 +02:00
decd4d8ecf rename Builder to GraphBuilder 2019-04-06 22:13:24 +02:00
d3b807ff02 move BuilderContext into Builder 2019-04-06 22:08:13 +02:00
87b472e1f6 use common prefix for type getters 2019-04-06 21:48:43 +02:00
586210c437 use common prefix for function getters 2019-04-06 21:44:10 +02:00
b4a3d036a9 cleanup auto vectorization function 2019-04-06 21:18:08 +02:00
49553de662 vectorized Separate Vector node 2019-04-06 21:06:06 +02:00
59116b27ea Merge branch 'master' into functions 2019-04-06 18:52:37 +02:00
c251ddeafc simplify execution stack management 2019-04-06 18:46:42 +02:00
362f8ec767 remove debug print 2019-04-06 18:14:26 +02:00
66e4eb795d higher level macro for tuple allocation 2019-04-06 18:12:48 +02:00
05e3ee5ae6 automatically destruct stack allocated tuples in c++ 2019-04-06 18:05:34 +02:00
5296f03f9f initial generic automatic vectorization, used in Combine Vector node 2019-04-06 17:21:07 +02:00
acbfda0c6b Implicit conversion from individual elements to lists 2019-04-06 15:23:17 +02:00
7c5cf3fd79 vectorized output sockets don't need a property 2019-04-06 14:58:29 +02:00
84670db6ea List Length node and fail early when socket types don't match 2019-04-06 12:00:35 +02:00
2e2f289d25 Vectorization support for Node UI 2019-04-06 11:05:40 +02:00
1456a030f4 initial IR for vector addition 2019-04-05 19:31:11 +02:00
0f42dd82ac new Vector Math node 2019-04-05 18:57:31 +02:00
cb158219e0 Generate LLVM IR for Mul and Sin 2019-04-05 18:44:01 +02:00
6fa863f6d9 Sin operation in Float Math node 2019-04-05 12:45:11 +02:00
3273d6be58 remove notes and unused variable 2019-04-05 12:31:34 +02:00
4a3720740d use the socket name directly, instead of a getter function 2019-04-05 12:29:07 +02:00
52ff44d02c Validate more aspects of the node tree while syncing 2019-04-05 12:10:30 +02:00
23a8864669 Splitup C API for separate components in different files 2019-04-05 11:32:34 +02:00
072fbb030a fix for reroute nodes 2019-04-04 17:53:37 +02:00
2865ca6fb6 Merge branch 'master' into functions 2019-04-04 17:49:29 +02:00
c789c5288d Fix: print python error message if there is one 2019-04-04 14:29:52 +02:00
dd5c352af5 More robust node tree update after changes
This implements a tree wide synching procedure, that corrects
all invalid things it can find. Also, trees are updated in
the correct order, when they depend on each other.
2019-04-04 14:26:20 +02:00
8675779372 Merge branch 'master' into functions 2019-04-03 19:01:49 +02:00
6ce1e30539 Merge branch 'master' into functions 2019-04-03 18:26:41 +02:00
4e84ea3da0 Merge branch 'master' into functions 2019-04-03 15:19:27 +02:00
2a8c7b8230 use cache to avoid building the same function ir twice 2019-04-03 11:55:11 +02:00
bcb6fa6e51 use better socket names in conversion to functions 2019-04-03 11:13:52 +02:00
ac7107df7c better socket name accessor function 2019-04-03 10:25:11 +02:00
d9097f7484 initial automatic update of call node 2019-04-03 10:05:26 +02:00
c1ba8dcd85 Fix 2019-04-02 12:35:49 +02:00
118ce79baf initial reroute support in graph conversion 2019-04-02 12:30:45 +02:00
6e78ef3ce5 initial support for reroutes in the ui 2019-04-02 11:29:31 +02:00
40d37cc8a0 Fix Get List Element node 2019-04-01 13:52:15 +02:00
9b2f1c0b38 fix modifier definition 2019-04-01 13:51:55 +02:00
212014e0d2 Merge branch 'master' into functions 2019-04-01 12:23:44 +02:00
7ace279696 cleanup pack list node converter 2019-04-01 10:42:13 +02:00
62059b465f improve Pack List node UI 2019-04-01 10:32:54 +02:00
c7447b51bd Pack List nodes have two inputs by default 2019-04-01 10:27:50 +02:00
02765a86cc create pack list node if certain type from search 2019-04-01 10:20:19 +02:00
62f4467a49 simple operators to create new function trees from modifier 2019-04-01 10:11:56 +02:00
25e1a10de6 type extension base class 2019-03-29 15:57:24 +01:00
7b210749bb simple operator to setup new function trees 2019-03-29 14:11:37 +01:00
b9a4ff5d38 Refactor node socket declaration 2019-03-29 13:56:14 +01:00
166e05b6ed store node in declaration 2019-03-29 09:53:36 +01:00
b958410308 cleanup 2019-03-29 09:39:12 +01:00
9f3ffe53bd name some virtual registers 2019-03-28 19:55:58 +01:00
b0f77c11d1 utility functions to optimize and print generated code 2019-03-28 19:55:44 +01:00
6af5d940db cleanup 2019-03-28 18:17:34 +01:00
bd480232ee remove LLVMCompiledBody 2019-03-28 18:09:46 +01:00
8259f92110 don't cache llvm type per context 2019-03-28 17:48:41 +01:00
6304ecbb06 ability to turn stack maintance on and off 2019-03-28 17:39:14 +01:00
40c12c675f move execution context pointer through llvm 2019-03-28 17:25:29 +01:00
b60be30ed5 cleanup pointer calls 2019-03-28 16:30:48 +01:00
cdf4591edb Improve interface of IR generators and wrap IRBuilder<> 2019-03-28 12:47:29 +01:00
c7bf98a186 push initial function caller information on execution stack 2019-03-28 09:50:12 +01:00
031bc7ca2d Use Vector List in Function Points modifier 2019-03-27 12:18:25 +01:00
721581c366 fix 2019-03-27 12:16:45 +01:00
925b0b732c show problems in separate problems panel 2019-03-27 11:36:26 +01:00
65ee9b6233 cleanup 2019-03-27 10:34:32 +01:00
439fdfcda7 initial ability to show warning messages in nodes 2019-03-27 10:30:55 +01:00
80a994776b use multi mempool for source information 2019-03-26 17:34:41 +01:00
aebddd0ed6 initial multi mempool 2019-03-26 17:34:12 +01:00
1a8bc27052 Use Blender's guarded allocators 2019-03-26 16:56:23 +01:00
0b2baaab1a missing include guards 2019-03-26 16:55:05 +01:00
895f68c8b2 fix panel idname 2019-03-26 11:28:59 +01:00
f0524205d6 Merge branch 'master' into functions 2019-03-26 11:23:05 +01:00
a90dca0ff5 also keep track of link sources 2019-03-26 11:20:33 +01:00
c23e2becdc print with traceback utility 2019-03-26 11:00:08 +01:00
72593ecaed cleanup 2019-03-26 10:51:49 +01:00
6b72c23e0a data flow graph manages source info allocation 2019-03-26 10:45:50 +01:00
024247797f keep track of original nodes 2019-03-26 10:33:10 +01:00
de7094a930 new SourceInfo class to keep track of where functions come from 2019-03-26 10:02:57 +01:00
9539b402b8 initial Execution Stack 2019-03-26 09:52:14 +01:00
8b777f5acf function should not be copied 2019-03-26 09:51:38 +01:00
9295e3bdde pass (currently empty) execution context into tuple call 2019-03-26 09:31:23 +01:00
bf8a98ffc5 experimental lazy fgraph evaluation 2019-03-25 09:57:44 +01:00
20e12025ea Merge branch 'master' into functions 2019-03-24 18:41:02 +01:00
9421bf6655 initial body type for lazy input evaluation 2019-03-24 18:40:23 +01:00
d79805e1db cleanup classes that are used in a composition 2019-03-24 17:29:06 +01:00
13ef2b1065 remove special type info for lists 2019-03-24 17:03:07 +01:00
f463cfb4c9 fix 2019-03-24 16:38:50 +01:00
c3a3b2e9b1 new Switch node 2019-03-24 16:16:59 +01:00
28a1b801b1 new Boolean type 2019-03-24 16:14:25 +01:00
b033626948 experimental byte code interpreter for function graph 2019-03-24 13:52:44 +01:00
0c15bc41b0 better naming 2019-03-24 13:52:14 +01:00
d819361cc5 simplify allocating tuple in prepared buffer 2019-03-24 11:31:33 +01:00
dc171b2a3e non recursive method to find required sockets 2019-03-24 10:41:01 +01:00
e77a8b97e1 initial support for calling subprograms 2019-03-22 11:57:03 +01:00
cf72da183d fail early when node inserter does not work 2019-03-22 11:52:49 +01:00
0efee91b63 rename tree type 2019-03-22 10:51:53 +01:00
95ccb24857 implement custom search terms for nodes 2019-03-22 10:21:01 +01:00
24d89e1cce better file naming 2019-03-21 18:44:47 +01:00
ad79af4843 typo 2019-03-21 18:40:36 +01:00
c6e4c29988 implement concept of implicit conversions 2019-03-21 12:17:35 +01:00
b31b4d5df8 cleanup 2019-03-21 12:16:14 +01:00
b52af3a031 refactor frontend data type definition system 2019-03-21 11:12:35 +01:00
8450e44cb6 move data type information into a separate file 2019-03-21 11:01:04 +01:00
fb038ebe53 refactor list decision inferencing 2019-03-21 10:56:11 +01:00
1a73618b36 cleanup file structure 2019-03-21 10:46:05 +01:00
8968155985 improve file name 2019-03-21 10:41:53 +01:00
5cc1bbd6de update tree automatically after changes 2019-03-21 10:39:57 +01:00
1ae0a8d760 Fix ListCPPTypeInfo 2019-03-20 20:03:45 +01:00
6db961e8b2 Merge branch 'master' into functions 2019-03-20 19:36:45 +01:00
1d64c35c3b allow removal of sockets from pack list node 2019-03-20 19:33:34 +01:00
e25a0c4bb3 remove dead code 2019-03-20 19:11:23 +01:00
81d5383ce2 save socket states 2019-03-20 19:07:35 +01:00
8788431086 allow changing type of Pack List node 2019-03-20 18:51:02 +01:00
1b90194608 allow declarations to draw in node 2019-03-20 18:16:55 +01:00
8d5f02a191 New Pack List Input operator 2019-03-20 18:11:56 +01:00
28fc08bff9 replace Append to List and Combine Lists nodes with Pack List 2019-03-20 18:06:27 +01:00
c59b457ee5 Merge branch 'master' into functions 2019-03-20 12:53:45 +01:00
46f5cf2b41 remove code that is not used currently 2019-03-20 12:53:04 +01:00
a2ca81bf6e initial version of less automatic inferencer 2019-03-20 12:46:30 +01:00
7533b4416e decision id cleanup 2019-03-19 17:11:49 +01:00
4c499e6d09 Merge branch 'master' into functions 2019-03-19 12:05:06 +01:00
fae338bf7c initial variadic list declaration 2019-03-19 12:03:47 +01:00
37bb26a217 cleanup list function generation 2019-03-19 11:06:38 +01:00
882ce6812f cleanup graph generation for combine lists and get list element 2019-03-19 10:51:46 +01:00
f7a9d8f447 cleanup Graph generation for Append to List node 2019-03-19 10:40:10 +01:00
c7e2b27199 Merge branch 'master' into functions 2019-03-18 16:08:50 +01:00
af2f924b11 Unified socket declaration system
Function input/output use the same structure to declare
sockets as other nodes now.

The type inferencer can be invoked in the panel on the
right in the node editor.

The list nodes work with floats, vectors and ints.
2019-03-18 16:05:21 +01:00
d0ae91b7c0 Merge branch 'master' into functions 2019-03-14 10:41:28 +01:00
dee5ee40e0 actually run the inferencer on a node tree 2019-03-13 16:21:30 +01:00
614c8be1d8 Use data type names instead of idname in c++ 2019-03-12 18:47:57 +01:00
51885aea9d simple inferencer in python with tests 2019-03-12 18:29:16 +01:00
185c80e9ba data type socket builder 2019-03-12 17:20:10 +01:00
255e1fe149 data type info 2019-03-12 16:48:00 +01:00
bd3334feaa allow more advanced socket declarations 2019-03-12 16:30:41 +01:00
c15103f454 steps towards a second list type 2019-03-11 17:58:36 +01:00
121189e560 disable some debug prints 2019-03-10 19:15:51 +01:00
163af9c8cb Merge branch 'master' into functions 2019-03-10 19:07:23 +01:00
a0627749b6 cleanup c wrapper 2019-03-10 18:59:44 +01:00
5a637fafd2 typo 2019-03-10 18:32:30 +01:00
391ee16746 new Combine Lists node 2019-03-10 18:29:00 +01:00
cfafdde927 use function to generate a list of floats 2019-03-10 18:10:53 +01:00
eaf5914496 allow float list input and output in frontend 2019-03-10 17:36:31 +01:00
a8cb18c644 new Function Points modifier for testing 2019-03-10 17:26:08 +01:00
b5f64cdb6e float list type in C interface 2019-03-10 16:28:14 +01:00
5ab0eca7c6 fgraph ir builder prefers precompiled ir if available 2019-03-10 16:21:24 +01:00
6281aa7f5d fix double value forwarding 2019-03-10 16:04:14 +01:00
5c916fa8f8 utility to copy dot format to clipboard 2019-03-10 15:49:15 +01:00
7fa6389d62 Get List Element and Append to List node 2019-03-10 15:38:11 +01:00
dcd90fae85 start implementing float list in frontend 2019-03-10 15:03:53 +01:00
9f850e5e4e get float list element function 2019-03-10 14:56:05 +01:00
5b3f7c09d2 cleanup 2019-03-10 14:55:34 +01:00
fe5c13386c use control2 as seed 2019-03-10 14:27:32 +01:00
4688ed1e28 use ctrl+A to open the node search 2019-03-10 14:27:22 +01:00
20f9248222 simple node search 2019-03-10 14:16:59 +01:00
657204dfce use auto load for registration 2019-03-10 13:57:37 +01:00
6c49690847 also allow heap allocation for tuples in C 2019-03-10 13:11:02 +01:00
57450b4fbe improve thread safety 2019-03-10 12:51:44 +01:00
1c844a694a cleanup 2019-03-10 12:17:37 +01:00
a53b2b4564 allow tuple stack allocation in C 2019-03-10 12:06:51 +01:00
ac02c2daf2 cleanup C wrapper 2019-03-10 10:44:20 +01:00
e57c3996bd store possible tuple meta in tuple call body 2019-03-10 10:26:19 +01:00
f6d994faac stack allocate tuple 2019-03-10 10:00:51 +01:00
0c8c082f9d improve shared lists 2019-03-09 16:11:10 +01:00
2e5df2cfa6 allow tuple call to modify fn_in 2019-03-09 14:22:14 +01:00
01d09210ff use shared list in tuple 2019-03-08 14:54:36 +01:00
75ecfd03ab more generic CPP and LLVM type info for lists 2019-03-08 14:31:50 +01:00
468f4f7985 Rename "Shared" to "AutoRefCount" 2019-03-08 14:09:29 +01:00
dcd4e2f767 more specific tuple access functions 2019-03-08 14:06:16 +01:00
151c9cd9ff make SharedImmutable work with the automatic refcounting 2019-03-08 13:56:50 +01:00
9697e81dab use intrusive refcounter because it simplifies things quite a bit 2019-03-08 13:42:55 +01:00
70534e5106 Merge branch 'master' into functions 2019-03-08 13:12:57 +01:00
d11b9c7239 cleanup 2019-03-07 11:38:48 +01:00
e60d04b129 rename RefCounted to RefCountedPtr 2019-03-07 11:22:50 +01:00
2c5ca6c7be refcounter cleanup 2019-03-07 11:17:49 +01:00
b0552bbe57 Merge branch 'master' into functions 2019-03-06 13:59:30 +01:00
51aa004a39 initial list types implementation 2019-03-06 13:59:00 +01:00
ebab49d135 define separate and combine vector nodes in terms of llvm ir 2019-03-06 11:37:54 +01:00
8b0c9e4331 don't hardcode llvm include dirs 2019-03-06 11:23:04 +01:00
4b39cbdeef fix "make full" on windows 2019-03-06 09:45:28 +01:00
8ba4f227ea remove printing 2019-03-05 15:22:56 +01:00
771074d848 improve ir wrapper for tuple call 2019-03-05 15:13:48 +01:00
b23cf5f41a put multiple unlinked inputs into a single function 2019-03-05 14:55:39 +01:00
8f5e6cf087 destruct tuple in wrapper 2019-03-05 13:48:00 +01:00
c4f1560ef3 Merge branch 'master' into functions 2019-03-05 13:36:52 +01:00
c1bad0da7a improve LLVMCompiledBody 2019-03-04 16:29:56 +01:00
3dcfe05354 build llvm ir for function graph 2019-03-04 16:14:45 +01:00
a6374a2896 missing renamings 2019-03-04 14:19:34 +01:00
5a81ea8dcd cleanup file naming 2019-03-04 14:16:15 +01:00
d8815d5b41 cleanup naming of function bodies and derive functions 2019-03-04 14:12:01 +01:00
f0d53df716 rename "LLVMGenBody" -> "LLVMGenerateIRBody" 2019-03-04 13:37:00 +01:00
7310c95ab7 Merge branch 'master' into functions 2019-03-04 13:29:50 +01:00
8a8b7d40ac deduplicate compilation code 2019-03-03 20:41:54 +01:00
21fc76b50d precompiled llvm function body 2019-03-03 20:13:24 +01:00
662b5ade05 generate separate wrapper functions 2019-03-03 15:03:56 +01:00
0e177a3b50 initial llvm wrapper for tuple call 2019-03-03 13:53:30 +01:00
149e6aa58c don't use SmallVector in tuple 2019-03-03 11:36:00 +01:00
c090a2f821 cleanup 2019-03-03 11:07:39 +01:00
e99f72ae6d common base class for function bodies 2019-03-03 10:56:57 +01:00
aa179bdfa3 separate tuple from its meta data 2019-03-02 22:00:47 +01:00
0ed75e7dbe only types know how they should be stored/loaded 2019-03-02 12:48:47 +01:00
910d7d4be0 compile llvm to tuple call 2019-03-02 12:14:06 +01:00
5ad9010ebf initial llvm integration (include path is still hardcoded...) 2019-03-01 19:30:20 +01:00
a42fe3e7df cleanup 2019-03-01 18:07:13 +01:00
a74e970b1d minor improvement 2019-03-01 17:30:22 +01:00
80efd2fed8 split core into multiple files 2019-03-01 17:19:36 +01:00
2cdb3d825a Merge branch 'master' into functions 2019-03-01 16:33:35 +01:00
8085925bc6 naming cleanup 2019-03-01 16:31:41 +01:00
1f504e3bd9 separate dependencies from tuple call body 2019-03-01 16:27:45 +01:00
73ceb30a98 cleanup 2019-03-01 16:08:57 +01:00
b25aa2c753 only equal types are allowed to be linked 2019-03-01 15:51:40 +01:00
7260d0333e fix 2019-03-01 15:44:13 +01:00
bdf1522fae move CPU specific stuff to backend folder 2019-03-01 15:34:11 +01:00
7333478220 refactor function generation from data flow nodes 2019-03-01 13:41:54 +01:00
4a502bef3c fix 2019-03-01 13:40:51 +01:00
d26f3663b1 Merge branch 'master' into functions 2019-03-01 10:32:36 +01:00
dd372c4d3d first test using optional value 2019-02-28 14:42:54 +01:00
c4d221b149 simple BLI::optional<T> type (C++11 compatible) 2019-02-28 14:18:06 +01:00
dbc584ea9c move some files 2019-02-28 14:01:47 +01:00
97997dd056 header cleanup 2019-02-28 12:40:20 +01:00
060a6c0e06 rename function headers 2019-02-28 12:31:34 +01:00
451884d2ea better separation between functions and nodes 2019-02-28 12:25:57 +01:00
367b065369 Merge branch 'master' into functions 2019-02-28 11:45:46 +01:00
5c72773a6d typo and minor improvement 2019-02-25 17:35:06 +01:00
b7ec20cc27 Merge branch 'master' into functions 2019-02-25 15:56:19 +01:00
3901ae2cb7 init defaults in tuple 2019-02-22 15:42:32 +01:00
e8187d58e5 Map Range node 2019-02-22 15:09:47 +01:00
9458baa8fe pass seed to driver function 2019-02-22 14:44:11 +01:00
c9a9e8670b pass index to function in displace modifier 2019-02-22 14:28:33 +01:00
5846212aab fix and cleanup 2019-02-22 14:27:53 +01:00
4108d2f4f9 integer socket 2019-02-22 14:27:34 +01:00
eaeda7dc6b remove unnecessary file 2019-02-22 13:53:47 +01:00
adba334093 utility function 2019-02-22 13:53:25 +01:00
36efb78551 improved naming 2019-02-22 13:42:41 +01:00
038a32ce1c Merge branch 'master' into functions 2019-02-21 16:56:36 +01:00
95f02d7806 new Driver Variable type that evaluates a function 2019-02-21 16:56:00 +01:00
be308462b4 vector socket actually works now 2019-02-21 16:54:41 +01:00
660ca276ca add function relations 2019-02-21 16:51:42 +01:00
daaa02f8b1 Use weight function in displace modifier 2019-02-21 14:32:59 +01:00
6593ba7e6b improved C function API 2019-02-21 14:27:10 +01:00
4f686995c8 read from original tree 2019-02-21 13:40:49 +01:00
2fbdd08636 Merge branch 'master' into functions 2019-02-20 17:20:01 +01:00
1472b4a77f simple to use function timer 2019-02-20 17:19:09 +01:00
de6a5ea3a0 clamp node as combination of min and max functions 2019-02-20 16:59:21 +01:00
d82a6a89b4 min and max of floats 2019-02-20 16:44:21 +01:00
72b67178dc vector distance node 2019-02-20 16:32:31 +01:00
dbd5c54510 debug print for functions 2019-02-20 16:21:40 +01:00
2218d7bf9e check function signature in modifier 2019-02-20 16:06:09 +01:00
e865bc730d check function signature with c wrapper 2019-02-20 15:48:22 +01:00
c4f39dd4aa remove some testing code 2019-02-20 15:34:52 +01:00
263bf06f66 annotation... 2019-02-20 15:25:48 +01:00
fa306a3c4a more generic float math node 2019-02-20 15:25:04 +01:00
08da311c74 dynamically add and remove sockets 2019-02-20 15:05:47 +01:00
513b7b3c78 add outputs dynamically 2019-02-20 14:21:54 +01:00
2ac967c63e typo 2019-02-20 13:48:06 +01:00
7699ea4d27 refactor graph generation 2019-02-20 13:44:03 +01:00
e3c61a30e1 refactor data flow graph generation 2019-02-20 12:50:58 +01:00
c1c17ba542 lookup_default 2019-02-20 12:49:44 +01:00
0267002a47 Merge branch 'master' into functions 2019-02-19 19:27:51 +01:00
dfdc955b1c cleanup 2019-02-19 17:54:57 +01:00
144a90688c better lazy init macro 2019-02-19 17:54:00 +01:00
a2ecba884a missing pragma once 2019-02-19 17:53:24 +01:00
e417f07ee2 use mempool to allocate nodes 2019-02-19 17:17:38 +01:00
66389f8933 inference list relations properly 2019-02-18 18:18:47 +01:00
cca48e2d00 different way to store Type Relations 2019-02-18 17:22:52 +01:00
d533afa17b all_equal tests 2019-02-18 17:21:23 +01:00
1a282bdca1 Signature.has_interface 2019-02-18 17:21:09 +01:00
6922161179 SmallVector::all_equal 2019-02-18 17:20:34 +01:00
a5cf0149dc Merge branch 'master' into functions 2019-02-18 16:24:46 +01:00
30d7e0814f fix SmallVector 2019-02-18 15:00:33 +01:00
c3b7bfbded use allowed namespace definition syntax only 2019-02-18 14:59:46 +01:00
7df89986a5 Merge branch 'functions-in-train' into functions 2019-02-17 21:17:11 +01:00
34e1684fa2 Merge branch 'master' into functions 2019-02-17 21:09:08 +01:00
47ea90771d initial type relations and improved inferencer 2019-02-17 17:44:21 +01:00
d93ecc84bb initial type inferencer 2019-02-17 15:54:00 +01:00
b166e18d56 small vector - remove and reorder 2019-02-17 15:49:43 +01:00
d7fca3e468 initial lazy init macro 2019-02-17 14:46:54 +01:00
e3cdeb80b1 MemPool 2019-02-17 14:17:48 +01:00
f2c8e39d29 small stack 2019-02-17 13:32:29 +01:00
27dd613a84 Merge branch 'master' into functions 2019-02-13 17:00:47 +01:00
aafe1034bb store node tree pointer in modifier
Unfortunately, there are still issues with the COW system resulting in a crash.
2019-02-12 19:20:45 +01:00
393f220f48 setup object dependencies correctly 2019-02-12 14:32:14 +01:00
79d2ea4f41 cleanup 2019-02-11 18:20:27 +01:00
139cdff657 object transforms node 2019-02-11 18:01:48 +01:00
10395fd00d separate vector node 2019-02-11 17:33:34 +01:00
e49edb2ef1 actually read socket value 2019-02-11 17:13:31 +01:00
fb3e05ff62 better usage of wrapper 2019-02-11 16:57:36 +01:00
548eb3a822 listbase wrapper 2019-02-11 16:51:33 +01:00
62cfea48a3 initial node tree to function conversion 2019-02-11 16:10:17 +01:00
caa03d7a5d cleanup 2019-02-10 20:14:26 +01:00
edad572189 FunctionGraph - a graph with specified inputs and outputs 2019-02-10 20:14:25 +01:00
8133fb0fad cleanup 2019-02-10 20:14:25 +01:00
4c1a59fa96 cleanup 2019-02-10 20:14:25 +01:00
49385f89b9 function input and output node 2019-02-10 20:14:25 +01:00
c4364f3499 initial node tree 2019-02-10 20:14:25 +01:00
791902b2d2 better dot exprot 2019-02-10 20:14:25 +01:00
785289594b SmallMap.add should not replace existing entries 2019-02-10 20:14:25 +01:00
ffdf77dd59 better naming 2019-02-10 20:14:25 +01:00
6ad32098af do not use this-> for prefixed member variables 2019-02-10 20:14:25 +01:00
34026205f0 store more type info in Type 2019-02-10 20:14:25 +01:00
5743ffc46f cmake fix 2019-02-10 20:14:25 +01:00
c3b0b85d47 move Composition to BLI 2019-02-10 20:14:25 +01:00
ac8555af9e Function and Type are final classes - can still be extended with Composition 2019-02-10 20:14:25 +01:00
999a802600 generate function from data flow graph 2019-02-10 20:14:25 +01:00
59d589e736 move concrete type definitions into separate translation unit 2019-02-10 20:14:24 +01:00
4c3941745a types don't have to be const everywhere 2019-02-10 20:14:24 +01:00
04350ca976 initial value iterator 2019-02-10 20:14:24 +01:00
ff59b09f02 cleanup 2019-02-10 20:14:24 +01:00
d5e675bddb append rvalue reference to smallvector 2019-02-10 20:14:24 +01:00
ecd2e2b454 move shared without incref and decref 2019-02-10 20:14:24 +01:00
a9c1796470 use shared ownership for functions and types 2019-02-10 20:14:24 +01:00
05f9492580 actually free elements in small vector 2019-02-10 20:14:24 +01:00
328a6e9c91 use shared ownership for functions and types 2019-02-10 20:14:24 +01:00
7773e1c2af better separation of concerns for shared objects 2019-02-10 20:14:24 +01:00
542caff21b custom reference counter that supports manual incref and decref 2019-02-10 20:14:24 +01:00
4d572be4e6 small set vector 2019-02-10 20:14:23 +01:00
74e40a8863 Tuple::copy_element 2019-02-10 20:14:23 +01:00
8d55ff177d extend set and vector data structure 2019-02-10 20:14:23 +01:00
fff8781973 dot export for data flow graph 2019-02-10 20:14:23 +01:00
252e46a346 input and output parameter class 2019-02-10 20:14:23 +01:00
010a4a76b5 data flow graph 2019-02-10 20:14:23 +01:00
434e2afe3c more generic dynamic composition of types and functions 2019-02-10 20:14:23 +01:00
5784e17ff7 renaming 2019-02-10 20:14:23 +01:00
617d35315c test dynamic composition instead of inheritance for functions 2019-02-10 20:14:23 +01:00
f63f7c1c86 minor fix, should be solved differently.. 2019-02-10 20:14:23 +01:00
d5e25680df separate actual core from cpu functions 2019-02-10 20:14:23 +01:00
6185d5fa7d typo 2019-02-10 20:14:23 +01:00
25ff42d7d5 use const ref parameter 2019-02-10 20:14:23 +01:00
317a2880f6 fill test 2019-02-10 20:14:23 +01:00
f4e7621ee7 don't construct unneeded objects in SmallVector 2019-02-10 20:14:22 +01:00
cbefe2ad55 initial SmallMap 2019-02-10 20:14:22 +01:00
0774265195 modifier fix 2019-02-10 20:14:22 +01:00
3012e7a3c2 Tuple structure (no copy/move functionality yet) 2019-02-10 20:14:22 +01:00
a22763349a use static size information to increase performance 2019-02-10 20:14:22 +01:00
4328946e12 work better with uninitialized memory + tests for SmallVector 2019-02-10 20:14:21 +01:00
be5c59f09a cleanup api a bit 2019-02-10 20:14:20 +01:00
a52d9b4bac actually deform something 2019-02-10 20:14:20 +01:00
59970cc12f move test code to new modifier 2019-02-10 20:14:20 +01:00
46a4cf3697 new deform modifier 2019-02-10 20:14:20 +01:00
ebc898756a deform function test 2019-02-10 20:14:20 +01:00
a9322b7e58 small buffer inherits small vector 2019-02-10 20:14:20 +01:00
54b8d6ba0b more const 2019-02-10 20:14:20 +01:00
a3aaf9d4f9 implement move semantics properly, hopefully 2019-02-10 20:14:20 +01:00
b36a4d7c72 first successful execution 2019-02-10 20:14:20 +01:00
178d41c250 fix 2019-02-10 20:14:20 +01:00
520d7cd663 better naming 2019-02-10 20:14:20 +01:00
bd44822f89 implement other small vector constructors 2019-02-10 20:14:20 +01:00
37e0362215 cleanup 2019-02-10 20:14:19 +01:00
9b3a4c1697 real SmallVector implementation + make types const 2019-02-10 20:14:19 +01:00
09a561aa25 more initial setup 2019-02-10 20:14:19 +01:00
7fbebda942 basic code structure 2019-02-10 20:14:19 +01:00
ade4c61063 function api design 2019-02-10 20:14:19 +01:00
3080 changed files with 144715 additions and 167708 deletions

View File

@@ -256,11 +256,6 @@ ForEachMacros:
- SEQ_BEGIN
- SURFACE_QUAD_ITER_BEGIN
- foreach
- ED_screen_areas_iter
- SLOT_PROBING_BEGIN
- SET_SLOT_PROBING_BEGIN
- MAP_SLOT_PROBING_BEGIN
- VECTOR_SET_SLOT_PROBING_BEGIN
# Use once we bump the minimum version to version 8.
# # Without this string literals that in-line 'STRINGIFY' behave strangely (a bug?).

View File

@@ -138,6 +138,11 @@ get_blender_version()
#-----------------------------------------------------------------------------
# Options
# First platform specific non-cached vars
if(UNIX AND NOT (APPLE OR HAIKU))
set(WITH_X11 ON)
endif()
# Blender internal features
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
mark_as_advanced(WITH_BLENDER)
@@ -202,15 +207,7 @@ mark_as_advanced(WITH_GHOST_DEBUG)
option(WITH_GHOST_SDL "Enable building Blender against SDL for windowing rather than the native APIs" OFF)
mark_as_advanced(WITH_GHOST_SDL)
if(UNIX AND NOT (APPLE OR HAIKU))
option(WITH_GHOST_X11 "Enable building Blender against X11 for windowing" ON)
mark_as_advanced(WITH_GHOST_X11)
option(WITH_GHOST_WAYLAND "Enable building Blender against Wayland for windowing (under development)" OFF)
mark_as_advanced(WITH_GHOST_WAYLAND)
endif()
if(WITH_GHOST_X11)
if(WITH_X11)
option(WITH_GHOST_XDND "Enable drag'n'drop support on X11 using XDND protocol" ON)
endif()
@@ -235,7 +232,7 @@ if(UNIX AND NOT APPLE)
mark_as_advanced(WITH_OPENMP_STATIC)
endif()
if(WITH_GHOST_X11)
if(WITH_X11)
option(WITH_X11_XINPUT "Enable X11 Xinput (tablet support and unicode input)" ON)
option(WITH_X11_XF86VMODE "Enable X11 video mode switching" ON)
option(WITH_X11_XFIXES "Enable X11 XWayland cursor warping workaround" ON)
@@ -278,9 +275,10 @@ option(WITH_CODEC_SNDFILE "Enable libsndfile Support (http://www.mega-nerd
# Alembic support
option(WITH_ALEMBIC "Enable Alembic Support" ON)
option(WITH_ALEMBIC_HDF5 "Enable Legacy Alembic Support (not officially supported)" OFF)
# Universal Scene Description support
option(WITH_USD "Enable Universal Scene Description (USD) Support" ON)
option(WITH_USD "Enable Universal Scene Description (USD) Support" OFF)
# 3D format support
# Disable opencollada when we don't have precompiled libs
@@ -321,6 +319,10 @@ mark_as_advanced(WITH_SYSTEM_GLOG)
# Freestyle
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
# New object types
option(WITH_NEW_OBJECT_TYPES "Enable new hair and pointcloud objects (use for development only, don't save in files)" OFF)
mark_as_advanced(WITH_NEW_OBJECT_TYPES)
# Misc
if(WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
@@ -362,7 +364,7 @@ option(WITH_CYCLES "Enable Cycles Render Engine" ON)
option(WITH_CYCLES_STANDALONE "Build Cycles standalone application" OFF)
option(WITH_CYCLES_STANDALONE_GUI "Build Cycles standalone with GUI" OFF)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ON)
option(WITH_CYCLES_EMBREE "Build Cycles with Embree support" ON)
option(WITH_CYCLES_EMBREE "Build Cycles with Embree support" OFF)
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)
@@ -427,8 +429,6 @@ endif()
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_OPENGL_RENDER_TESTS "Enable OpenGL render related unit testing (Experimental)" OFF)
option(WITH_OPENGL_DRAW_TESTS "Enable OpenGL UI drawing related unit testing (Experimental)" OFF)
set(TEST_PYTHON_EXE "" CACHE PATH "Python executable to run unit tests")
mark_as_advanced(TEST_PYTHON_EXE)
# Documentation
if(UNIX AND NOT APPLE)
@@ -469,8 +469,6 @@ endif()
if(CMAKE_COMPILER_IS_GNUCC)
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
mark_as_advanced(WITH_LINKER_GOLD)
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
mark_as_advanced(WITH_LINKER_LLD)
endif()
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
@@ -534,15 +532,6 @@ if(WIN32)
option(WITH_WINDOWS_BUNDLE_CRT "Bundle the C runtime for install free distribution." ON)
mark_as_advanced(WITH_WINDOWS_BUNDLE_CRT)
option(WITH_WINDOWS_SCCACHE "Use sccache to speed up builds (Ninja builder only)" OFF)
mark_as_advanced(WITH_WINDOWS_SCCACHE)
option(WITH_WINDOWS_PDB "Generate a pdb file for client side stacktraces" ON)
mark_as_advanced(WITH_WINDOWS_PDB)
option(WITH_WINDOWS_STRIPPED_PDB "Use a stripped PDB file" On)
mark_as_advanced(WITH_WINDOWS_STRIPPED_PDB)
endif()
# The following only works with the Ninja generator in CMake >= 3.0.
@@ -619,6 +608,12 @@ if(WITH_PYTHON_MODULE AND WITH_PYTHON_INSTALL)
message(FATAL_ERROR "WITH_PYTHON_MODULE requires WITH_PYTHON_INSTALL to be OFF")
endif()
# may as well build python module without a UI
if(WITH_PYTHON_MODULE)
set(WITH_HEADLESS ON)
endif()
if(NOT WITH_PYTHON)
set(WITH_CYCLES OFF)
set(WITH_DRACO OFF)
@@ -646,7 +641,6 @@ if(WITH_BOOST AND NOT (WITH_CYCLES OR WITH_OPENIMAGEIO OR WITH_INTERNATIONAL OR
set(WITH_BOOST OFF)
endif()
set_and_warn_dependency(WITH_TBB WITH_CYCLES OFF)
set_and_warn_dependency(WITH_TBB WITH_USD OFF)
set_and_warn_dependency(WITH_TBB WITH_OPENIMAGEDENOISE OFF)
set_and_warn_dependency(WITH_TBB WITH_OPENVDB OFF)
@@ -684,8 +678,7 @@ if(WITH_INSTALL_PORTABLE)
endif()
if(WITH_GHOST_SDL OR WITH_HEADLESS)
set(WITH_GHOST_WAYLAND OFF)
set(WITH_GHOST_X11 OFF)
set(WITH_X11 OFF)
set(WITH_X11_XINPUT OFF)
set(WITH_X11_XF86VMODE OFF)
set(WITH_X11_XFIXES OFF)
@@ -1238,7 +1231,7 @@ endif()
if(WITH_LIBMV)
# We always have C++11 which includes unordered_map.
set(CERES_DEFINES "-DCERES_STD_UNORDERED_MAP;-DCERES_USE_CXX_THREADS")
set(CERES_DEFINES -DCERES_STD_UNORDERED_MAP)
endif()
#-----------------------------------------------------------------------------
@@ -1554,15 +1547,20 @@ if(WITH_PYTHON)
endif()
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
# MSVC needs to be tested first, since clang on windows will
# match the compiler test below but clang-cl does not accept -std=c++11
# since it is on by default and cannot be turned off.
#
# Nothing special is needed, C++11 features are available by default.
elseif(
CMAKE_COMPILER_IS_GNUCC OR
CMAKE_C_COMPILER_ID MATCHES "Clang" OR
CMAKE_C_COMPILER_ID MATCHES "Intel"
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
# TODO(sergey): Do we want c++11 or gnu-c++11 here?
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++17 build")
message(FATAL_ERROR "Unknown compiler ${CMAKE_C_COMPILER_ID}, can't enable C++11 build")
endif()
# Visual Studio has all standards it supports available by default
@@ -1720,7 +1718,6 @@ if(FIRST_RUN)
info_cfg_option(WITH_ALEMBIC)
info_cfg_option(WITH_QUADRIFLOW)
info_cfg_option(WITH_USD)
info_cfg_option(WITH_TBB)
info_cfg_text("Compiler Options:")
info_cfg_option(WITH_BUILDINFO)

View File

@@ -32,7 +32,6 @@ Convenience Targets
* debug: Build a debug binary.
* full: Enable all supported dependencies & options.
* lite: Disable non essential features for a smaller binary and faster build.
* release Complete build with all options enabled including CUDA and Optix, matching the releases on blender.org
* 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.
@@ -72,6 +71,17 @@ Testing Targets
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.
@@ -142,10 +152,6 @@ Information
endef
# HELP_TEXT (end)
# This makefile is not meant for Windows
ifeq ($(OS),Windows_NT)
$(error On Windows, use "cmd //c make.bat" instead of "make")
endif
# System Vars
OS:=$(shell uname -s)
@@ -212,10 +218,6 @@ ifneq "$(findstring lite, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_lite
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_lite.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring release, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_release
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/blender_release.cmake" $(CMAKE_CONFIG_ARGS)
endif
ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_cycles
CMAKE_CONFIG_ARGS:=-C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake" $(CMAKE_CONFIG_ARGS)
@@ -326,7 +328,6 @@ all: .FORCE
debug: all
full: all
lite: all
release: all
cycles: all
headless: all
bpy: all
@@ -401,6 +402,45 @@ test_cmake: .FORCE
test_deprecated: .FORCE
$(PYTHON) tests/check_deprecated.py
test_style_c: .FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
--no-length-check
test_style_c_qtc: .FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/source/blender" \
"$(BLENDER_DIR)/source/creator" \
--no-length-check \
> \
"$(BLENDER_DIR)/test_style.tasks"
@echo "written: test_style.tasks"
test_style_osl: .FORCE
# run our own checks on C/C++ style
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl"
test_style_osl_qtc: .FORCE
# run our own checks on C/C++ style
USE_QTC_TASK=1 \
PYTHONIOENCODING=utf_8 $(PYTHON) \
"$(BLENDER_DIR)/source/tools/check_source/check_style_c.py" \
"$(BLENDER_DIR)/intern/cycles/kernel/shaders" \
"$(BLENDER_DIR)/release/scripts/templates_osl" \
> \
"$(BLENDER_DIR)/test_style.tasks"
@echo "written: test_style.tasks"
# -----------------------------------------------------------------------------
# Project Files

View File

@@ -48,7 +48,11 @@ include(cmake/options.cmake)
include(cmake/versions.cmake)
if(ENABLE_MINGW64)
include(cmake/setup_mingw64.cmake)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
include(cmake/setup_mingw64.cmake)
else()
include(cmake/setup_mingw32.cmake)
endif()
else()
set(mingw_LIBDIR ${LIBDIR})
endif()
@@ -93,18 +97,17 @@ if(UNIX)
else()
include(cmake/pugixml.cmake)
endif()
include(cmake/ispc.cmake)
include(cmake/openimagedenoise.cmake)
include(cmake/embree.cmake)
if(NOT APPLE)
include(cmake/xr_openxr.cmake)
endif()
include(cmake/xr_openxr.cmake)
if(WITH_WEBP)
include(cmake/webp.cmake)
endif()
if(WIN32)
# HMD branch deps
include(cmake/hidapi.cmake)
# OCIO deps
include(cmake/tinyxml.cmake)
include(cmake/yamlcpp.cmake)
@@ -127,6 +130,7 @@ if(NOT WIN32 OR ENABLE_MINGW64)
include(cmake/vpx.cmake)
include(cmake/x264.cmake)
include(cmake/xvidcore.cmake)
include(cmake/faad.cmake)
include(cmake/ffmpeg.cmake)
include(cmake/fftw.cmake)
include(cmake/sndfile.cmake)

View File

@@ -16,6 +16,16 @@
#
# ***** END GPL LICENSE BLOCK *****
if(ALEMBIC_HDF5)
set(ALEMBIC_HDF5_HL)
# in debug mode we do not build HDF5_hdf5_hl_LIBRARY which makes cmake really
# unhappy, stub it with the debug mode lib. it's not linking it in at this
# point in time anyhow
if(BUILD_MODE STREQUAL Debug)
set(ALEMBIC_HDF5_HL -DHDF5_hdf5_hl_LIBRARY=${LIBDIR}/hdf5/lib/libhdf5_hl_D.${LIBEXT})
endif()
endif()
set(ALEMBIC_EXTRA_ARGS
-DBUILDSTATIC=ON
-DLINKSTATIC=ON
@@ -28,7 +38,6 @@ set(ALEMBIC_EXTRA_ARGS
-DBoost_DEBUG=ON
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DILMBASE_ROOT=${LIBDIR}/openexr
-DALEMBIC_ILMBASE_INCLUDE_DIRECTORY=${LIBDIR}/openexr/include/OpenEXR
-DALEMBIC_ILMBASE_HALF_LIB=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
@@ -43,6 +52,7 @@ set(ALEMBIC_EXTRA_ARGS
-DUSE_PRMAN=0
-DUSE_HDF5=Off
-DUSE_STATIC_HDF5=Off
-DHDF5_ROOT=${LIBDIR}/hdf5
-DUSE_TESTS=Off
-DALEMBIC_NO_OPENGL=1
-DUSE_BINARIES=ON
@@ -51,6 +61,7 @@ set(ALEMBIC_EXTRA_ARGS
-DGLUT_INCLUDE_DIR=""
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
${ALEMBIC_HDF5_HL}
)
ExternalProject_Add(external_alembic

View File

@@ -25,8 +25,6 @@ if(UNIX AND NOT APPLE)
set(BZIP2_CFLAGS "-fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64")
set(BZIP2_CONFIGURE_ENV ${BZIP2_CONFIGURE_ENV} && export LDFLAGS=${BZIP2_LDFLAGS} && export CFLAGS=${BZIP2_CFLAGS}
&& export PREFIX=${BZIP2_PREFIX})
else()
set(BZIP2_CONFIGURE_ENV ${CONFIGURE_ENV})
endif()
ExternalProject_Add(external_bzip2

View File

@@ -26,20 +26,10 @@ set(EMBREE_EXTRA_ARGS
-DEMBREE_RAY_MASK=ON
-DEMBREE_FILTER_FUNCTION=ON
-DEMBREE_BACKFACE_CULLING=OFF
-DEMBREE_TASKING_SYSTEM=INTERNAL
-DEMBREE_MAX_ISA=AVX2
-DEMBREE_TASKING_SYSTEM=TBB
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
)
if(TBB_STATIC_LIBRARY)
set(EMBREE_EXTRA_ARGS
${EMBREE_EXTRA_ARGS}
-DEMBREE_TBB_LIBRARY_NAME=tbb_static
-DEMBREE_TBBMALLOC_LIBRARY_NAME=tbbmalloc_static
)
endif()
if(WIN32)
set(EMBREE_BUILD_DIR ${BUILD_MODE}/)
else()
@@ -51,16 +41,9 @@ ExternalProject_Add(external_embree
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${EMBREE_HASH}
PREFIX ${BUILD_DIR}/embree
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/embree/src/external_embree < ${PATCH_DIR}/embree.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/embree ${DEFAULT_CMAKE_FLAGS} ${EMBREE_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/embree
)
add_dependencies(
external_embree
external_tbb
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)

View File

@@ -0,0 +1,40 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(FAAD_EXTRA_ARGS)
if(WIN32)
set(FAAD_EXTRA_CONFIGURE "utils\\win32\\ac2ver.exe" "faad2" "configure.ac" > libfaad\\win32_ver.h)
else()
set(FAAD_EXTRA_CONFIGURE echo .)
endif()
ExternalProject_Add(external_faad
URL ${FAAD_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FAAD_HASH}
PREFIX ${BUILD_DIR}/faad
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && ${FAAD_EXTRA_CONFIGURE} && ${CONFIGURE_COMMAND} --disable-shared --enable-static --prefix=${LIBDIR}/faad
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/faad/src/external_faad/ && make install
INSTALL_DIR ${LIBDIR}/faad
)
if(MSVC)
set_target_properties(external_faad PROPERTIES FOLDER Mingw)
endif()

View File

@@ -127,6 +127,7 @@ endif()
add_dependencies(
external_ffmpeg
external_zlib
external_faad
external_openjpeg
external_xvidcore
external_x264

View File

@@ -19,12 +19,8 @@
set(FFTW_EXTRA_ARGS)
if(WIN32)
set(FFTW3_ENV set CFLAGS=-fno-stack-check -fno-stack-protector -mno-stack-arg-probe -fno-lto &&)
set(FFTW3_PATCH_COMMAND ${PATCH_CMD} --verbose -p 0 -N -d ${BUILD_DIR}/fftw3/src/external_fftw3 < ${PATCH_DIR}/fftw3.diff)
set(FFTW_EXTRA_ARGS --disable-static --enable-shared)
set(FFTW_INSTALL install-strip)
else()
set(FFTW_EXTRA_ARGS --enable-static)
set(FFTW_INSTALL install)
endif()
ExternalProject_Add(external_fftw3
@@ -32,10 +28,10 @@ ExternalProject_Add(external_fftw3
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${FFTW_HASH}
PREFIX ${BUILD_DIR}/fftw3
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} ${FFTW_EXTRA_ARGS} --prefix=${mingw_LIBDIR}/fftw3
CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${FFTW3_ENV} cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && ${CONFIGURE_COMMAND} --enable-static --prefix=${mingw_LIBDIR}/fftw3
PATCH_COMMAND ${FFTW3_PATCH_COMMAND}
BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make -j${MAKE_THREADS}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make ${FFTW_INSTALL}
INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/fftw3/src/external_fftw3/ && make install
INSTALL_DIR ${LIBDIR}/fftw3
)
@@ -43,8 +39,7 @@ if(MSVC)
set_target_properties(external_fftw3 PROPERTIES FOLDER Mingw)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_fftw3 after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/lib/libfftw3.dll.a ${HARVEST_TARGET}/fftw3/lib/libfftw.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/bin/libfftw3-3.dll ${HARVEST_TARGET}/fftw3/lib/libfftw3-3.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/lib/libfftw3.a ${HARVEST_TARGET}/fftw3/lib/libfftw.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/fftw3/include/fftw3.h ${HARVEST_TARGET}/fftw3/include/fftw3.h
DEPENDEES install
)

View File

@@ -31,6 +31,10 @@ if(BUILD_MODE STREQUAL Release)
COMMAND # jpeg rename libfile + copy include
${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
# OpenImageIO
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe &&
# png
${CMAKE_COMMAND} -E copy ${LIBDIR}/png/lib/libpng16_static.lib ${HARVEST_TARGET}/png/lib/libpng.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/png/include/ ${HARVEST_TARGET}/png/include/ &&
@@ -40,13 +44,30 @@ if(BUILD_MODE STREQUAL Release)
# glew-> opengl
${CMAKE_COMMAND} -E copy ${LIBDIR}/glew/lib/libglew32.lib ${HARVEST_TARGET}/opengl/lib/glew.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/glew/include/ ${HARVEST_TARGET}/opengl/include/ &&
# sndfile
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/lib/libsndfile.dll.a ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h &&
# tiff
${CMAKE_COMMAND} -E copy ${LIBDIR}/tiff/lib/tiff.lib ${HARVEST_TARGET}/tiff/lib/libtiff.lib &&
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/tiff/include/ ${HARVEST_TARGET}/tiff/include/ &&
# hidapi
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hidapi/ ${HARVEST_TARGET}/hidapi/
DEPENDS
)
endif()
if(BUILD_MODE STREQUAL Debug)
add_custom_target(Harvest_Debug_Results
# OpenImageIO
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib &&
${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib &&
# hdf5
${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/hdf5/lib ${HARVEST_TARGET}/hdf5/lib &&
DEPENDS Package_Python
)
endif()
else(WIN32)
function(harvest from to)

View File

@@ -14,31 +14,29 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# The Original Code is Copyright (C) 2020, Blender Foundation
# All rights reserved.
# ***** END GPL LICENSE BLOCK *****
set(INC
.
..
../../../source/blender/blenkernel
../../../source/blender/blenlib
../../../source/blender/editors/include
../../../source/blender/makesdna
../../../source/blender/makesrna
../../../intern/guardedalloc
../../../intern/atomic
set(HDF5_EXTRA_ARGS
-DHDF5_ENABLE_THREADSAFE=Off
-DHDF5_BUILD_CPP_LIB=Off
-DBUILD_TESTING=Off
-DHDF5_BUILD_TOOLS=Off
-DHDF5_BUILD_EXAMPLES=Off
-DHDF5_BUILD_HL_LIB=On
-DBUILD_STATIC_CRT_LIBS=On
-DBUILD_SHARED_LIBS=On
)
setup_libdirs()
include_directories(${INC})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${PLATFORM_LINKFLAGS_DEBUG}")
if(WITH_BUILDINFO)
set(BUILDINFO buildinfoobj)
if(WIN32)
set(HDF5_PATCH ${PATCH_CMD} --verbose -p 0 -d ${BUILD_DIR}/hdf5/src/external_hdf5 < ${PATCH_DIR}/hdf5.diff)
endif()
BLENDER_TEST(BKE_armature "bf_blenloader;bf_blenkernel;bf_blenlib;${BUILDINFO}")
BLENDER_TEST(BKE_fcurve "bf_blenloader;bf_blenkernel;bf_editor_animation;${BUILDINFO}")
ExternalProject_Add(external_hdf5
URL ${HDF5_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${HDF5_HASH}
PREFIX ${BUILD_DIR}/hdf5
PATCH_COMMAND ${HDF5_PATCH}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hdf5 ${HDF5_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/hdf5
)

View File

@@ -0,0 +1,29 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
set(HIDAPI_EXTRA_ARGS)
ExternalProject_Add(external_hidapi
URL ${HIDAPI_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${HIDAPI_HASH}
PREFIX ${BUILD_DIR}/hidapi
PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_hidapi.txt ${BUILD_DIR}/hidapi/src/external_hidapi/cmakelists.txt && ${PATCH_CMD} -p 0 -d ${BUILD_DIR}/hidapi/src/external_hidapi < ${PATCH_DIR}/hidapi.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/hidapi -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${HIDAPI_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/hidapi
)

View File

@@ -1,63 +0,0 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
set(ISPC_EXTRA_ARGS_WIN
-DFLEX_EXECUTABLE=${LIBDIR}/flexbison/win_flex.exe
-DBISON_EXECUTABLE=${LIBDIR}/flexbison/win_bison.exe
-DM4_EXECUTABLE=${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe
)
endif()
set(ISPC_EXTRA_ARGS
-DARM_ENABLED=Off
-DISPC_NO_DUMPS=On
-DISPC_INCLUDE_EXAMPLES=Off
-DISPC_INCLUDE_TESTS=Off
-DLLVM_ROOT=${LIBDIR}/llvm/lib/cmake/llvm
-DLLVM_LIBRARY_DIR=${LIBDIR}/llvm/lib
-DCLANG_EXECUTABLE=${LIBDIR}/clang/bin/clang
-DISPC_INCLUDE_TESTS=Off
-DCLANG_LIBRARY_DIR=${LIBDIR}/clang/lib
-DCLANG_INCLUDE_DIRS=${LIBDIR}/clang/include
${ISPC_EXTRA_ARGS_WIN}
)
ExternalProject_Add(external_ispc
URL ${ISPC_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${ISPC_HASH}
PREFIX ${BUILD_DIR}/ispc
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/ispc/src/external_ispc < ${PATCH_DIR}/ispc.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/ispc -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${ISPC_EXTRA_ARGS} ${BUILD_DIR}/ispc/src/external_ispc
INSTALL_DIR ${LIBDIR}/ispc
)
add_dependencies(
external_ispc
ll
external_clang
)
if(WIN32)
add_dependencies(
external_ispc
external_flexbison
)
endif()

View File

@@ -18,7 +18,7 @@
if(WIN32)
# cmake for windows
set(JPEG_EXTRA_ARGS -DNASM=${NASM_PATH} -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d -DWITH_CRT_DLL=On)
set(JPEG_EXTRA_ARGS -DNASM=${NASM_PATH} -DWITH_JPEG8=ON -DCMAKE_DEBUG_POSTFIX=d)
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
@@ -42,17 +42,20 @@ if(WIN32)
set(JPEG_LIBRARY jpeg-staticd${LIBEXT})
endif()
else(WIN32)
# cmake for unix
set(JPEG_EXTRA_ARGS
-DWITH_JPEG8=ON
-DENABLE_STATIC=ON
-DENABLE_SHARED=OFF
-DCMAKE_INSTALL_LIBDIR=${LIBDIR}/jpg/lib)
# autoconf for unix
if(APPLE)
set(JPEG_EXTRA_ARGS --host x86_64-apple-darwin --with-jpeg8)
else()
set(JPEG_EXTRA_ARGS --with-jpeg8)
endif()
ExternalProject_Add(external_jpeg
URL ${JPEG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${JPEG_HASH}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && autoreconf -fiv && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/jpg NASM=yasm ${JPEG_EXTRA_ARGS}
BUILD_IN_SOURCE 1
BUILD_COMMAND ${CONFIGURE_ENV} && make install
PREFIX ${BUILD_DIR}/jpg
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/jpg ${DEFAULT_CMAKE_FLAGS} ${JPEG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/jpg

View File

@@ -52,6 +52,7 @@ if(BUILD_MODE STREQUAL Release)
PREFIX ${BUILD_DIR}/openal
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openal ${DEFAULT_CMAKE_FLAGS} ${OPENAL_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openal
PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/openal/src/external_openal < ${PATCH_DIR}/openal.diff
)
if(WIN32)

View File

@@ -18,41 +18,26 @@
set(OIDN_EXTRA_ARGS
-DOIDN_APPS=OFF
-DWITH_EXAMPLE=OFF
-DWITH_TEST=OFF
-DTBB_ROOT=${LIBDIR}/tbb
-DTBB_STATIC_LIB=${TBB_STATIC_LIBRARY}
-DTBB_STATIC_LIB=ON
-DOIDN_STATIC_LIB=ON
-DOIDN_STATIC_RUNTIME=OFF
-DISPC_EXECUTABLE=${LIBDIR}/ispc/bin/ispc
)
if(WIN32)
set(OIDN_EXTRA_ARGS
${OIDN_EXTRA_ARGS}
-DTBB_DEBUG_LIBRARY=${LIBDIR}/tbb/lib/tbb.lib
-DTBB_DEBUG_LIBRARY_MALLOC=${LIBDIR}/tbb/lib/tbbmalloc.lib
)
else()
set(OIDN_EXTRA_ARGS
${OIDN_EXTRA_ARGS}
-Dtbb_LIBRARY_RELEASE=${LIBDIR}/tbb/lib/tbb_static.a
-Dtbbmalloc_LIBRARY_RELEASE=${LIBDIR}/tbb/lib/tbbmalloc_static.a
)
endif()
ExternalProject_Add(external_openimagedenoise
URL ${OIDN_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OIDN_HASH}
PREFIX ${BUILD_DIR}/openimagedenoise
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimagedenoise ${DEFAULT_CMAKE_FLAGS} ${OIDN_EXTRA_ARGS}
PATCH_COMMAND ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/openimagedenoise/src/external_openimagedenoise < ${PATCH_DIR}/openimagedenoise.diff
INSTALL_DIR ${LIBDIR}/openimagedenoise
)
add_dependencies(
external_openimagedenoise
external_tbb
external_ispc
)
if(WIN32)
@@ -61,7 +46,7 @@ if(WIN32)
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/openimagedenoise/include ${HARVEST_TARGET}/openimagedenoise/include
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/openimagedenoise.lib ${HARVEST_TARGET}/openimagedenoise/lib/openimagedenoise.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/common.lib ${HARVEST_TARGET}/openimagedenoise/lib/common.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/dnnl.lib ${HARVEST_TARGET}/openimagedenoise/lib/dnnl.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/mkldnn.lib ${HARVEST_TARGET}/openimagedenoise/lib/mkldnn.lib
DEPENDEES install
)
endif()
@@ -69,7 +54,7 @@ if(WIN32)
ExternalProject_Add_Step(external_openimagedenoise after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/openimagedenoise.lib ${HARVEST_TARGET}/openimagedenoise/lib/openimagedenoise_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/common.lib ${HARVEST_TARGET}/openimagedenoise/lib/common_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/dnnl.lib ${HARVEST_TARGET}/openimagedenoise/lib/dnnl_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimagedenoise/lib/mkldnn.lib ${HARVEST_TARGET}/openimagedenoise/lib/mkldnn_d.lib
DEPENDEES install
)
endif()

View File

@@ -32,7 +32,7 @@ endif()
if(WIN32)
set(PNG_LIBNAME libpng16_static${LIBEXT})
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2)
set(OIIO_SIMD_FLAGS -DUSE_SIMD=sse2 -DOPJ_STATIC=1)
set(OPENJPEG_POSTFIX _msvc)
else()
set(PNG_LIBNAME libpng${LIBEXT})
@@ -49,17 +49,23 @@ endif()
if(MSVC)
set(OPENJPEG_FLAGS
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg_msvc
-DOPENJPEG_HOME=${LIBDIR}/openjpeg_msvc
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg_msvc/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg_msvc/lib/openjp2${LIBEXT}
-DOPENJPEG_LIBRARY_DEBUG=${LIBDIR}/openjpeg_msvc/lib/openjp2${LIBEXT}
)
else()
set(OPENJPEG_FLAGS
-DOpenJpeg_ROOT=${LIBDIR}/openjpeg
-DOPENJPEG_INCLUDE_DIR=${LIBDIR}/openjpeg/include/openjpeg-${OPENJPEG_SHORT_VERSION}
-DOPENJPEG_LIBRARY=${LIBDIR}/openjpeg/lib/${OPENJPEG_LIBRARY}
)
endif()
set(OPENIMAGEIO_EXTRA_ARGS
-DBUILD_SHARED_LIBS=OFF
-DBUILDSTATIC=ON
${OPENIMAGEIO_LINKSTATIC}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/openexr/
-DOPENEXR_ILMIMF_LIBRARIES=${LIBDIR}/openexr/lib/IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DBoost_COMPILER:STRING=${BOOST_COMPILER_STRING}
-DBoost_USE_MULTITHREADED=ON
-DBoost_USE_STATIC_LIBS=ON
@@ -67,16 +73,7 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-OIIO_BUILD_CPP11=ON
-DUSE_LIBSQUISH=OFF
-DUSE_QT5=OFF
-DUSE_NUKE=OFF
-DUSE_OPENVDB=OFF
-DUSE_BZIP2=OFF
-DUSE_FREETYPE=OFF
-DUSE_DCMTK=OFF
-DUSE_LIBHEIF=OFF
-DUSE_OPENGL=OFF
-DUSE_TBB=OFF
-DUSE_FIELD3D=OFF
@@ -84,12 +81,15 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DUSE_PYTHON=OFF
-DUSE_GIF=OFF
-DUSE_OPENCV=OFF
-DUSE_OPENSSL=OFF
-DUSE_OPENJPEG=ON
-DUSE_FFMPEG=OFF
-DUSE_PTEX=OFF
-DUSE_FREETYPE=OFF
-DUSE_LIBRAW=OFF
-DUSE_OPENCOLORIO=OFF
-DUSE_PYTHON=OFF
-DUSE_PYTHON3=OFF
-DUSE_OCIO=OFF
-DUSE_WEBP=${WITH_WEBP}
-DOIIO_BUILD_TOOLS=${OIIO_TOOLS}
-DOIIO_BUILD_TESTS=OFF
@@ -103,13 +103,17 @@ set(OPENIMAGEIO_EXTRA_ARGS
-DJPEG_LIBRARY=${LIBDIR}/jpg/lib/${JPEG_LIBRARY}
-DJPEG_INCLUDE_DIR=${LIBDIR}/jpg/include
${OPENJPEG_FLAGS}
-DOCIO_PATH=${LIBDIR}/opencolorio/
-DOpenEXR_USE_STATIC_LIBS=On
-DOPENEXR_HOME=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_PATH=${LIBDIR}/openexr/
-DILMBASE_PACKAGE_PREFIX=${LIBDIR}/openexr/
-DILMBASE_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_HALF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Half${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IMATH_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Imath${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_ILMTHREAD_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmThread${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_IEX_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}Iex${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DOPENEXR_INCLUDE_DIR=${LIBDIR}/openexr/include/
-DOPENEXR_ILMIMF_LIBRARY=${LIBDIR}/openexr/lib/${LIBPREFIX}IlmImf${OPENEXR_VERSION_POSTFIX}${LIBEXT}
-DSTOP_ON_WARNING=OFF
${WEBP_FLAGS}
@@ -121,38 +125,27 @@ ExternalProject_Add(external_openimageio
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENIMAGEIO_HASH}
PREFIX ${BUILD_DIR}/openimageio
PATCH_COMMAND ${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio.diff
PATCH_COMMAND
${PATCH_CMD} -p 0 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/src/include < ${PATCH_DIR}/openimageio_gdi.diff &&
${PATCH_CMD} -p 1 -N -d ${BUILD_DIR}/openimageio/src/external_openimageio/ < ${PATCH_DIR}/openimageio_static_libs.diff
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/openimageio ${DEFAULT_CMAKE_FLAGS} ${OPENIMAGEIO_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/openimageio
)
add_dependencies(
external_openimageio
external_png
external_zlib
external_png external_zlib
external_openexr
external_jpeg
external_boost
external_tiff
external_opencolorio
external_openjpeg${OPENJPEG_POSTFIX}
${WEBP_DEP}
)
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_openimageio after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/include ${HARVEST_TARGET}/OpenImageIO/include
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/OpenImageIO/lib ${HARVEST_TARGET}/OpenImageIO/lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/OpenImageIO/bin/idiff.exe ${HARVEST_TARGET}/OpenImageIO/bin/idiff.exe
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_openimageio after_install
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/openimageio/lib/OpenImageIO_Util.lib ${HARVEST_TARGET}/openimageio/lib/OpenImageIO_Util_d.lib
DEPENDEES install
)
endif()
if(NOT WIN32)
add_dependencies(
external_openimageio
external_opencolorio_extra
)
endif()

View File

@@ -36,7 +36,7 @@ if(WIN32)
set(OPENSUBDIV_EXTRA_ARGS
${OPENSUBDIV_EXTRA_ARGS}
-DTBB_INCLUDE_DIR=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb.lib
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/tbb_static.lib
-DCLEW_INCLUDE_DIR=${LIBDIR}/clew/include/CL
-DCLEW_LIBRARY=${LIBDIR}/clew/lib/clew${LIBEXT}
-DCUEW_INCLUDE_DIR=${LIBDIR}/cuew/include
@@ -67,7 +67,7 @@ endif()
ExternalProject_Add(external_opensubdiv
URL ${OPENSUBDIV_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH MD5=${OPENSUBDIV_HASH}
URL_HASH MD5=${OPENSUBDIV_Hash}
PREFIX ${BUILD_DIR}/opensubdiv
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/opensubdiv -Wno-dev ${DEFAULT_CMAKE_FLAGS} ${OPENSUBDIV_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/opensubdiv

View File

@@ -27,7 +27,6 @@ set(OPENVDB_EXTRA_ARGS
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DZLIB_LIBRARY=${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
-DZLIB_INCLUDE_DIR=${LIBDIR}/zlib/include/
-DBlosc_INCLUDE_DIR=${LIBDIR}/blosc/include/

View File

@@ -17,7 +17,7 @@
# ***** END GPL LICENSE BLOCK *****
if(WIN32)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/fftw3 by installing mingw64" ON)
option(ENABLE_MINGW64 "Enable building of ffmpeg/iconv/libsndfile/lapack/fftw3 by installing mingw64" ON)
endif()
option(WITH_WEBP "Enable building of oiio with webp support" OFF)
set(MAKE_THREADS 1 CACHE STRING "Number of threads to run make with")
@@ -45,7 +45,11 @@ message("PATCH_DIR = ${PATCH_DIR}")
message("BUILD_DIR = ${BUILD_DIR}")
if(WIN32)
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/patch.exe)
else()
set(PATCH_CMD ${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/patch.exe)
endif()
set(LIBEXT ".lib")
set(LIBPREFIX "")
@@ -78,10 +82,17 @@ if(WIN32)
set(PLATFORM_CXX_FLAGS)
set(PLATFORM_CMAKE_FLAGS)
set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw64)
set(MINGW_SHELL ming64sh.cmd)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl/portableshell.bat)
set(MINGW_HOST x86_64-w64-mingw32)
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw64)
set(MINGW_SHELL ming64sh.cmd)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl/portableshell.bat)
set(MINGW_HOST x86_64-w64-mingw32)
else()
set(MINGW_PATH ${DOWNLOAD_DIR}/mingw/mingw32)
set(MINGW_SHELL ming32sh.cmd)
set(PERL_SHELL ${DOWNLOAD_DIR}/perl32/portableshell.bat)
set(MINGW_HOST i686-w64-mingw32)
endif()
set(CONFIGURE_ENV
cd ${MINGW_PATH} &&

View File

@@ -44,7 +44,6 @@ set(OSL_EXTRA_ARGS
-DBOOST_ROOT=${LIBDIR}/boost
-DBOOST_LIBRARYDIR=${LIBDIR}/boost/lib/
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DLLVM_DIRECTORY=${LIBDIR}/llvm
-DLLVM_INCLUDES=${LIBDIR}/llvm/include
-DLLVM_LIB_DIR=${LIBDIR}/llvm/lib
@@ -75,7 +74,6 @@ set(OSL_EXTRA_ARGS
-DUSE_LLVM_BITCODE=OFF
-DUSE_PARTIO=OFF
-DUSE_QT=OFF
-DINSTALL_DOCS=OFF
${OSL_SIMD_FLAGS}
-DPARTIO_LIBRARIES=
)

View File

@@ -25,7 +25,7 @@ set(PNG_EXTRA_ARGS
ExternalProject_Add(external_png
URL ${PNG_URI}
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${PNG_HASH}
URL_HASH MD5=${PNG_HASH}
PREFIX ${BUILD_DIR}/png
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/png ${DEFAULT_CMAKE_FLAGS} ${PNG_EXTRA_ARGS}
INSTALL_DIR ${LIBDIR}/png

View File

@@ -24,7 +24,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})
set(PTHREADS_BUILD cd ${BUILD_DIR}/pthreads/src/external_pthreads/ && cd && nmake VC-static /e CPPFLAGS=${PTHREAD_CPPFLAGS} /e XLIBS=/NODEFAULTLIB:msvcr)
ExternalProject_Add(external_pthreads
URL ${PTHREADS_URI}
@@ -32,7 +32,6 @@ if(WIN32)
URL_HASH MD5=${PTHREADS_HASH}
PREFIX ${BUILD_DIR}/pthreads
CONFIGURE_COMMAND echo .
PATCH_COMMAND COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/pthreads/src/external_pthreads < ${PATCH_DIR}/pthreads.diff
BUILD_COMMAND ${PTHREADS_BUILD}
INSTALL_COMMAND COMMAND
${CMAKE_COMMAND} -E copy ${BUILD_DIR}/pthreads/src/external_pthreads/libpthreadVC3${LIBEXT} ${LIBDIR}/pthreads/lib/pthreadVC3${LIBEXT} &&

View File

@@ -0,0 +1,227 @@
# ***** BEGIN GPL LICENSE BLOCK *****
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ***** END GPL LICENSE BLOCK *****
####################################################################################################################
# Mingw32 Builds
####################################################################################################################
# This installs mingw32+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
####################################################################################################################
message("LIBDIR = ${LIBDIR}")
macro(cmake_to_msys_path MsysPath ResultingPath)
string(REPLACE ":" "" TmpPath "${MsysPath}")
string(SUBSTRING ${TmpPath} 0 1 Drive)
string(SUBSTRING ${TmpPath} 1 255 PathPart)
string(TOLOWER ${Drive} LowerDrive)
string(CONCAT ${ResultingPath} "/" ${LowerDrive} ${PathPart})
endmacro()
cmake_to_msys_path(${LIBDIR} mingw_LIBDIR)
message("mingw_LIBDIR = ${mingw_LIBDIR}")
message("Checking for mingw32")
# download mingw32
if(NOT EXISTS "${DOWNLOAD_DIR}/i686-4.9.4-release-win32-sjlj-rt_v5-rev0.7z")
message("Downloading mingw32")
file(DOWNLOAD "https://astuteinternet.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.4/threads-win32/sjlj/i686-4.9.4-release-win32-sjlj-rt_v5-rev0.7z" "${DOWNLOAD_DIR}/i686-4.9.4-release-win32-sjlj-rt_v5-rev0.7z")
endif()
# make mingw root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/mingw
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract mingw32
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd") AND (EXISTS "${DOWNLOAD_DIR}/i686-4.9.4-release-win32-sjlj-rt_v5-rev0.7z"))
message("Extracting mingw32")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/i686-4.9.4-release-win32-sjlj-rt_v5-rev0.7z
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw
)
endif()
message("Checking for pkg-config")
if(NOT EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
message("Downloading pkg-config")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/pkgconfiglite/0.28-1/pkg-config-lite-0.28-1_bin-win32.zip" "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip")
endif()
# extract pkgconfig
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe") AND (EXISTS "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"))
message("Extracting pkg-config")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1_bin-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/pkg-config-lite-0.28-1/bin/pkg-config.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/pkg-config.exe"
)
endif()
message("Checking for nasm")
if(NOT EXISTS "${DOWNLOAD_DIR}/nasm-2.13.02-win32.zip")
message("Downloading nasm")
file(DOWNLOAD "http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/win32/nasm-2.13.02-win32.zip" "${DOWNLOAD_DIR}/nasm-2.13.02-win32.zip")
endif()
# extract nasm
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe") AND (EXISTS "${DOWNLOAD_DIR}/nasm-2.13.02-win32.zip"))
message("Extracting nasm")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/nasm-2.13.02-win32.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/nasm-2.13.02/nasm.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe"
)
endif()
SET(NASM_PATH ${DOWNLOAD_DIR}/mingw/mingw32/bin/nasm.exe)
message("Checking for mingwGet")
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
message("Downloading mingw-get")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/Installer/mingw-get/mingw-get-0.6.2-beta-20131004-1/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip" "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip")
endif()
# extract mingw_get
if((NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (EXISTS "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"))
message("Extracting mingw-get")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf "${DOWNLOAD_DIR}/mingw-get-0.6.2-mingw32-beta-20131004-1-bin.zip"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/
)
endif()
if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/make.exe"))
message("Installing MSYS")
execute_process(
COMMAND ${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get install msys msys-patch
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/bin/
)
endif()
if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/mktemp.exe"))
message("Installing mktemp")
execute_process(
COMMAND ${DOWNLOAD_DIR}/mingw/mingw32/bin/mingw-get install msys msys-mktemp
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw32/bin/
)
endif()
message("Checking for CoreUtils")
# download old core_utils for pr.exe (ffmpeg needs it to build)
if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
message("Downloading CoreUtils 5.97")
file(DOWNLOAD "https://nchc.dl.sourceforge.net/project/mingw/MSYS/Base/msys-core/_obsolete/coreutils-5.97-MSYS-1.0.11-2/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2" "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")
endif()
if((EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"))
message("Installing pr from CoreUtils 5.97")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/tmp_coreutils
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${DOWNLOAD_DIR}/tmp_coreutils/coreutils-5.97/bin/pr.exe "${DOWNLOAD_DIR}/mingw/mingw32/msys/1.0/bin/pr.exe"
WORKING_DIRECTORY ${DOWNLOAD_DIR}/tmp_coreutils/
)
endif()
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd")
message("Installing ming32sh.cmd")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/ming32sh.cmd ${DOWNLOAD_DIR}/mingw/mingw32/ming32sh.cmd
)
endif()
message("Checking for perl")
# download perl for libvpx
if(NOT EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
message("Downloading perl")
file(DOWNLOAD "http://strawberryperl.com/download/5.22.1.3/strawberry-perl-5.22.1.3-32bit-portable.zip" "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip")
endif()
# make perl root directory
if(NOT EXISTS "${DOWNLOAD_DIR}/perl32")
execute_process(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOWNLOAD_DIR}/perl32
WORKING_DIRECTORY ${DOWNLOAD_DIR}
)
endif()
# extract perl
if((NOT EXISTS "${DOWNLOAD_DIR}/perl32/portable.perl") AND (EXISTS "${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip"))
message("Extracting perl")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${DOWNLOAD_DIR}/strawberry-perl-5.22.1.3-32bit-portable.zip
WORKING_DIRECTORY ${DOWNLOAD_DIR}/perl32
)
endif()
# get yasm for vpx
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
message("Downloading yasm")
file(DOWNLOAD "http://www.tortall.net/projects/yasm/releases/yasm-1.3.0-win32.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/yasm.exe")
endif()
message("checking i686-w64-mingw32-strings")
# copy strings.exe to i686-w64-mingw32-strings for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe")
message("fixing i686-w64-mingw32-strings.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strings.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strings.exe"
)
endif()
message("checking i686-w64-mingw32-ar.exe")
# copy ar.exe to i686-w64-mingw32-ar.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe")
message("fixing i686-w64-mingw32-ar.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ar.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ar.exe"
)
endif()
message("checking i686-w64-mingw32-strip.exe")
# copy strip.exe to i686-w64-mingw32-strip.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe")
message("fixing i686-w64-mingw32-strip.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/strip.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-strip.exe"
)
endif()
message("checking i686-w64-mingw32-ranlib.exe")
# copy ranlib.exe to i686-w64-mingw32-ranlib.exe for x264
if(NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe")
message("fixing i686-w64-mingw32-ranlib.exe")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy "${DOWNLOAD_DIR}/mingw/mingw32/bin/ranlib.exe" "${DOWNLOAD_DIR}/mingw/mingw32/bin/i686-w64-mingw32-ranlib.exe"
)
endif()

View File

@@ -19,7 +19,7 @@
####################################################################################################################
# Mingw64 Builds
####################################################################################################################
# This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/fftw3
# This installs mingw64+msys to compile ffmpeg/iconv/libsndfile/lapack/fftw3
####################################################################################################################
message("LIBDIR = ${LIBDIR}")
@@ -128,14 +128,6 @@ if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (NOT EXISTS "$
)
endif()
if((EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get.exe") AND (NOT EXISTS "${DOWNLOAD_DIR}/mingw/mingw64/msys/1.0/bin/m4.exe"))
message("Installing m4")
execute_process(
COMMAND ${DOWNLOAD_DIR}/mingw/mingw64/bin/mingw-get install msys msys-m4
WORKING_DIRECTORY ${DOWNLOAD_DIR}/mingw/mingw64/bin/
)
endif()
message("Checking for CoreUtils")
# download old core_utils for pr.exe (ffmpeg needs it to build)
if(NOT EXISTS "${DOWNLOAD_DIR}/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2")

View File

@@ -60,14 +60,3 @@ if(UNIX)
external_flac
)
endif()
if(BUILD_MODE STREQUAL Release AND WIN32)
ExternalProject_Add_Step(external_sndfile after_install
COMMAND lib /def:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.def /machine:x64 /out:${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/bin/libsndfile-1.dll ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.dll
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/sndfile/src/external_sndfile/src/libsndfile-1.lib ${HARVEST_TARGET}/sndfile/lib/libsndfile-1.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/sndfile/include/sndfile.h ${HARVEST_TARGET}/sndfile/include/sndfile.h
DEPENDEES install
)
endif()

View File

@@ -1,4 +1,4 @@
my %targets = (
%targets = (
"blender-linux-x86" => {
inherit_from => [ "linux-x86" ],

View File

@@ -20,10 +20,8 @@ if(WIN32)
-DTBB_BUILD_SHARED=On
-DTBB_BUILD_TBBMALLOC=On
-DTBB_BUILD_TBBMALLOC_PROXY=On
-DTBB_BUILD_STATIC=Off
)
set(TBB_LIBRARY tbb)
set(TBB_STATIC_LIBRARY Off)
-DTBB_BUILD_STATIC=On
)
else()
set(TBB_EXTRA_ARGS
-DTBB_BUILD_SHARED=Off
@@ -31,8 +29,6 @@ else()
-DTBB_BUILD_TBBMALLOC_PROXY=Off
-DTBB_BUILD_STATIC=On
)
set(TBB_LIBRARY tbb_static)
set(TBB_STATIC_LIBRARY On)
endif()
# CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
@@ -50,15 +46,7 @@ ExternalProject_Add(external_tbb
if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_tbb after_install
# findtbb.cmake in some deps *NEEDS* to find tbb_debug.lib even if they are not going to use it
# to make that test pass, we place a copy with the right name in the lib folder.
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc_debug.dll
# Normal collection of build artifacts
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb.dll ${HARVEST_TARGET}/tbb/lib/tbb.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy.lib
@@ -69,12 +57,7 @@ if(WIN32)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_tbb after_install
# findtbb.cmake in some deps *NEEDS* to find tbb.lib even if they are not going to use it
# to make that test pass, we place a copy with the right name in the lib folder.
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${LIBDIR}/tbb/lib/tbb.lib
# Normal collection of build artifacts
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.lib ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_debug.dll ${HARVEST_TARGET}/tbb/lib/debug/tbb_debug.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbb_static.lib ${HARVEST_TARGET}/tbb/lib/tbb_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.lib ${HARVEST_TARGET}/tbb/lib/tbbmalloc_proxy_debug.lib
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc.dll
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/tbb/lib/tbbmalloc_proxy.dll ${HARVEST_TARGET}/tbb/lib/debug/tbbmalloc_proxy.dll

View File

@@ -22,14 +22,9 @@ set(USD_EXTRA_ARGS
-DBoost_USE_STATIC_LIBS=ON
-DBoost_USE_STATIC_RUNTIME=OFF
-DBOOST_ROOT=${LIBDIR}/boost
-DBoost_NO_SYSTEM_PATHS=ON
-DBoost_NO_BOOST_CMAKE=ON
-DTBB_INCLUDE_DIRS=${LIBDIR}/tbb/include
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
# USD wants the tbb debug lib set even when you are doing a release build
# Otherwise it will error out during the cmake configure phase.
-DTBB_LIBRARIES_DEBUG=${LIBDIR}/tbb/lib/${LIBPREFIX}${TBB_LIBRARY}${LIBEXT}
-DTBB_LIBRARIES=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
-DTbb_TBB_LIBRARY=${LIBDIR}/tbb/lib/${LIBPREFIX}tbb_static${LIBEXT}
# This is a preventative measure that avoids possible conflicts when add-ons
# try to load another USD library into the same process space.
@@ -81,14 +76,14 @@ if(WIN32)
if(BUILD_MODE STREQUAL Release)
ExternalProject_Add_Step(external_usd after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/ ${HARVEST_TARGET}/usd
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/usd_m.lib ${HARVEST_TARGET}/usd/lib/libusd_m.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Release/libusd_m.lib ${HARVEST_TARGET}/usd/lib/libusd_m.lib
DEPENDEES install
)
endif()
if(BUILD_MODE STREQUAL Debug)
ExternalProject_Add_Step(external_usd after_install
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/usd/lib ${HARVEST_TARGET}/usd/lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/usd_m_d.lib ${HARVEST_TARGET}/usd/lib/libusd_m_d.lib
COMMAND ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/usd/src/external_usd-build/pxr/Debug/libusd_m_d.lib ${HARVEST_TARGET}/usd/lib/libusd_m_d.lib
DEPENDEES install
)
endif()

View File

@@ -20,17 +20,17 @@ set(ZLIB_VERSION 1.2.11)
set(ZLIB_URI https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
set(ZLIB_HASH 1c9f62f0778697a09d36121ead88e08e)
set(OPENAL_VERSION 1.20.1)
set(OPENAL_VERSION 1.18.2)
set(OPENAL_URI http://openal-soft.org/openal-releases/openal-soft-${OPENAL_VERSION}.tar.bz2)
set(OPENAL_HASH 556695068ce8375b89986083d810fd35)
set(OPENAL_HASH d4eeb0889812e2fdeaa1843523d76190)
set(PNG_VERSION 1.6.37)
set(PNG_VERSION 1.6.35)
set(PNG_URI http://prdownloads.sourceforge.net/libpng/libpng-${PNG_VERSION}.tar.xz)
set(PNG_HASH 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca)
set(PNG_HASH 678b7e696a62a193ed3503b04bf449d6)
set(JPEG_VERSION 2.0.4)
set(JPEG_VERSION 1.5.3)
set(JPEG_URI https://github.com/libjpeg-turbo/libjpeg-turbo/archive/${JPEG_VERSION}.tar.gz)
set(JPEG_HASH 44c43e4a9fb352f47090804529317c88)
set(JPEG_HASH 5b7549d440b86c98a517355c102d155e)
set(BOOST_VERSION 1.70.0)
set(BOOST_VERSION_NODOTS 1_70_0)
@@ -66,9 +66,9 @@ else()
set(OPENEXR_VERSION_POSTFIX)
endif()
set(FREETYPE_VERSION 2.10.2)
set(FREETYPE_VERSION 2.10.1)
set(FREETYPE_URI http://prdownloads.sourceforge.net/freetype/freetype-${FREETYPE_VERSION}.tar.gz)
set(FREETYPE_HASH b1cb620e4c875cd4d1bfa04945400945)
set(FREETYPE_HASH c50a3c9e5e62bdc938a6e1598a782947)
set(GLEW_VERSION 1.13.0)
set(GLEW_URI http://prdownloads.sourceforge.net/glew/glew/${GLEW_VERSION}/glew-${GLEW_VERSION}.tgz)
@@ -78,6 +78,10 @@ set(FREEGLUT_VERSION 3.0.0)
set(FREEGLUT_URI http://pilotfiber.dl.sourceforge.net/project/freeglut/freeglut/${FREEGLUT_VERSION}/freeglut-${FREEGLUT_VERSION}.tar.gz)
set(FREEGLUT_HASH 90c3ca4dd9d51cf32276bc5344ec9754)
set(HDF5_VERSION 1.8.17)
set(HDF5_URI https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.gz)
set(HDF5_HASH 7d572f8f3b798a628b8245af0391a0ca)
set(ALEMBIC_VERSION 1.7.12)
set(ALEMBIC_URI https://github.com/alembic/alembic/archive/${ALEMBIC_VERSION}.tar.gz)
set(ALEMBIC_MD5 e2b3777f23c5c09481a008cc6f0f8a40)
@@ -97,21 +101,21 @@ 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_3)
set(OPENSUBDIV_VERSION v3_4_0_RC2)
set(OPENSUBDIV_Hash f6a10ba9efaa82fde86fe65aad346319)
set(OPENSUBDIV_URI https://github.com/PixarAnimationStudios/OpenSubdiv/archive/${OPENSUBDIV_VERSION}.tar.gz)
set(OPENSUBDIV_HASH 7bbfa275d021fb829e521df749160edb)
set(SDL_VERSION 2.0.12)
set(SDL_VERSION 2.0.8)
set(SDL_URI https://www.libsdl.org/release/SDL2-${SDL_VERSION}.tar.gz)
set(SDL_HASH 783b6f2df8ff02b19bb5ce492b99c8ff)
set(SDL_HASH 3800d705cef742c6a634f202c37f263f)
set(OPENCOLLADA_VERSION v1.6.68)
set(OPENCOLLADA_URI https://github.com/KhronosGroup/OpenCOLLADA/archive/${OPENCOLLADA_VERSION}.tar.gz)
set(OPENCOLLADA_HASH ee7dae874019fea7be11613d07567493)
set(OPENCOLORIO_VERSION 1.1.1)
set(OPENCOLORIO_URI https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
set(OPENCOLORIO_HASH 23d8b9ac81599305539a5a8674b94a3d)
set(OPENCOLORIO_VERSION 1.1.0)
set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/v${OPENCOLORIO_VERSION}.tar.gz)
set(OPENCOLORIO_HASH 802d8f5b1d1fe316ec5f76511aa611b8)
set(LLVM_VERSION 9.0.1)
set(LLVM_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.xz)
@@ -123,23 +127,23 @@ set(CLANG_HASH 13468e4a44940efef1b75e8641752f90)
set(OPENMP_URI https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/openmp-${LLVM_VERSION}.src.tar.xz)
set(OPENMP_HASH 6eade16057edbdecb3c4eef9daa2bfcf)
set(OPENIMAGEIO_VERSION 2.1.15.0)
set(OPENIMAGEIO_VERSION 1.8.13)
set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.tar.gz)
set(OPENIMAGEIO_HASH f03aa5e3ac4795af04771ee4146e9832)
set(OPENIMAGEIO_HASH f5526c3c9878029ee900d84856683f93)
set(TIFF_VERSION 4.1.0)
set(TIFF_VERSION 4.0.9)
set(TIFF_URI http://download.osgeo.org/libtiff/tiff-${TIFF_VERSION}.tar.gz)
set(TIFF_HASH 2165e7aba557463acc0664e71a3ed424)
set(TIFF_HASH 54bad211279cc93eb4fca31ba9bfdc79)
set(OSL_VERSION 1.10.10)
set(OSL_VERSION 1.10.9)
set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.tar.gz)
set(OSL_HASH 00dec08a93c8084e53848b9ad047889f)
set(OSL_HASH a94f1e8506f7e8f5e993653de5c5fa00)
set(PYTHON_VERSION 3.7.7)
set(PYTHON_VERSION 3.7.4)
set(PYTHON_SHORT_VERSION 3.7)
set(PYTHON_SHORT_VERSION_NO_DOTS 37)
set(PYTHON_URI https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz)
set(PYTHON_HASH 172c650156f7bea68ce31b2fd01fa766)
set(PYTHON_HASH d33e4aae66097051c2eca45ee3604803)
set(TBB_VERSION 2019_U9)
set(TBB_URI https://github.com/oneapi-src/oneTBB/archive/${TBB_VERSION}.tar.gz)
@@ -149,24 +153,24 @@ set(OPENVDB_VERSION 7.0.0)
set(OPENVDB_URI https://github.com/dreamworksanimation/openvdb/archive/v${OPENVDB_VERSION}.tar.gz)
set(OPENVDB_HASH fd6c4f168282f7e0e494d290cd531fa8)
set(IDNA_VERSION 2.9)
set(IDNA_VERSION 2.8)
set(CHARDET_VERSION 3.0.4)
set(URLLIB3_VERSION 1.25.9)
set(CERTIFI_VERSION 2020.4.5.2)
set(REQUESTS_VERSION 2.23.0)
set(URLLIB3_VERSION 1.25.3)
set(CERTIFI_VERSION 2019.6.16)
set(REQUESTS_VERSION 2.22.0)
set(NUMPY_VERSION 1.17.5)
set(NUMPY_VERSION v1.17.0)
set(NUMPY_SHORT_VERSION 1.17)
set(NUMPY_URI https://github.com/numpy/numpy/releases/download/v${NUMPY_VERSION}/numpy-${NUMPY_VERSION}.zip)
set(NUMPY_HASH 763a5646fa6eef7a22f4895bca0524f2)
set(NUMPY_URI https://files.pythonhosted.org/packages/da/32/1b8f2bb5fb50e4db68543eb85ce37b9fa6660cd05b58bddfafafa7ed62da/numpy-1.17.0.zip)
set(NUMPY_HASH aed49b31bcb44ec73b8155be78566135)
set(LAME_VERSION 3.100)
set(LAME_URI http://downloads.sourceforge.net/project/lame/lame/3.100/lame-${LAME_VERSION}.tar.gz)
set(LAME_HASH 83e260acbe4389b54fe08e0bdbf7cddb)
set(OGG_VERSION 1.3.4)
set(OGG_VERSION 1.3.3)
set(OGG_URI http://downloads.xiph.org/releases/ogg/libogg-${OGG_VERSION}.tar.gz)
set(OGG_HASH fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e)
set(OGG_HASH c2e8a485110b97550f453226ec644ebac6cb29d1caef2902c007edab4308d985)
set(VORBIS_VERSION 1.3.6)
set(VORBIS_URI http://downloads.xiph.org/releases/vorbis/libvorbis-${VORBIS_VERSION}.tar.gz)
@@ -176,41 +180,51 @@ set(THEORA_VERSION 1.1.1)
set(THEORA_URI http://downloads.xiph.org/releases/theora/libtheora-${THEORA_VERSION}.tar.bz2)
set(THEORA_HASH b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc)
set(FLAC_VERSION 1.3.3)
set(FLAC_VERSION 1.3.2)
set(FLAC_URI http://downloads.xiph.org/releases/flac/flac-${FLAC_VERSION}.tar.xz)
set(FLAC_HASH 213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748)
set(FLAC_HASH 91cfc3ed61dc40f47f050a109b08610667d73477af6ef36dcad31c31a4a8d53f)
set(VPX_VERSION 1.8.2)
set(VPX_VERSION 1.7.0)
set(VPX_URI https://github.com/webmproject/libvpx/archive/v${VPX_VERSION}/libvpx-v${VPX_VERSION}.tar.gz)
set(VPX_HASH 8735d9fcd1a781ae6917f28f239a8aa358ce4864ba113ea18af4bb2dc8b474ac)
set(VPX_HASH 1fec931eb5c94279ad219a5b6e0202358e94a93a90cfb1603578c326abfc1238)
set(OPUS_VERSION 1.3.1)
set(OPUS_URI https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz)
set(OPUS_HASH 65b58e1e25b2a114157014736a3d9dfeaad8d41be1c8179866f144a2fb44ff9d)
set(X264_URI https://code.videolan.org/videolan/x264/-/archive/33f9e1474613f59392be5ab6a7e7abf60fa63622/x264-33f9e1474613f59392be5ab6a7e7abf60fa63622.tar.gz)
set(X264_HASH 5456450ee1ae02cd2328be3157367a232a0ab73315e8c8f80dab80469524f525)
set(X264_URI http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20180811-2245-stable.tar.bz2)
set(X264_HASH ae8a868a0e236a348b35d79f3ee80294b169d1195408b689f9851383661ed7aa)
set(XVIDCORE_VERSION 1.3.7)
set(XVIDCORE_URI https://downloads.xvid.com/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH abbdcbd39555691dd1c9b4d08f0a031376a3b211652c0d8b3b8aa9be1303ce2d)
set(XVIDCORE_VERSION 1.3.5)
set(XVIDCORE_URI http://downloads.xvid.org/downloads/xvidcore-${XVIDCORE_VERSION}.tar.gz)
set(XVIDCORE_HASH 165ba6a2a447a8375f7b06db5a3c91810181f2898166e7c8137401d7fc894cf0)
set(OPENJPEG_VERSION 2.3.1)
# This has to be in sync with the version in blenders /extern folder.
set(OPENJPEG_VERSION 2.3.0)
set(OPENJPEG_SHORT_VERSION 2.3)
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/v${OPENJPEG_VERSION}.tar.gz)
set(OPENJPEG_HASH 63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9)
# Use slightly newer commit after release which includes a cmake fix
set(OPENJPEG_URI https://github.com/uclouvain/openjpeg/archive/66297f07a43.zip)
set(OPENJPEG_HASH 8242b18d908c7c42174e4231a741cfa7ce7c26b6ed5c9644feb9df7b3054310b)
set(FFMPEG_VERSION 4.2.3)
set(FAAD_VERSION 2-2.8.8)
set(FAAD_URI http://downloads.sourceforge.net/faac/faad${FAAD_VERSION}.tar.gz)
set(FAAD_HASH 28f6116efdbe9378269f8a6221767d1f)
set(FFMPEG_VERSION 4.0.2)
set(FFMPEG_URI http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2)
set(FFMPEG_HASH 695fad11f3baf27784e24cb0e977b65a)
set(FFMPEG_HASH 5576e8a22f80b6a336db39808f427cfb)
set(FFTW_VERSION 3.3.8)
set(FFTW_URI http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz)
set(FFTW_HASH 8aac833c943d8e90d51b697b27d4384d)
set(ICONV_VERSION 1.16)
set(ICONV_VERSION 1.15)
set(ICONV_URI http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${ICONV_VERSION}.tar.gz)
set(ICONV_HASH 7d2a800b952942bb2880efb00cfd524c)
set(ICONV_HASH ace8b5f2db42f7b3b3057585e80d9808)
set(LAPACK_VERSION 3.6.0)
set(LAPACK_URI http://www.netlib.org/lapack/lapack-${LAPACK_VERSION}.tgz)
set(LAPACK_HASH f2f6c67134e851fe189bb3ca1fbb5101)
set(SNDFILE_VERSION 1.0.28)
set(SNDFILE_URI http://www.mega-nerd.com/libsndfile/files/libsndfile-${SNDFILE_VERSION}.tar.gz)
@@ -232,13 +246,13 @@ set(SPNAV_VERSION 0.2.3)
set(SPNAV_URI http://downloads.sourceforge.net/project/spacenav/spacenav%20library%20%28SDK%29/libspnav%20${SPNAV_VERSION}/libspnav-${SPNAV_VERSION}.tar.gz)
set(SPNAV_HASH 44d840540d53326d4a119c0f1aa7bf0a)
set(JEMALLOC_VERSION 5.2.1)
set(JEMALLOC_VERSION 5.0.1)
set(JEMALLOC_URI https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/jemalloc-${JEMALLOC_VERSION}.tar.bz2)
set(JEMALLOC_HASH 3d41fbf006e6ebffd489bdb304d009ae)
set(JEMALLOC_HASH 507f7b6b882d868730d644510491d18f)
set(XML2_VERSION 2.9.10)
set(XML2_VERSION 2.9.4)
set(XML2_URI http://xmlsoft.org/sources/libxml2-${XML2_VERSION}.tar.gz)
set(XML2_HASH 10942a1dc23137a8aa07f0639cbfece5)
set(XML2_HASH ae249165c173b1ff386ee8ad676815f5)
set(TINYXML_VERSION 2_6_2)
set(TINYXML_VERSION_DOTS 2.6.2)
@@ -253,9 +267,9 @@ set(LCMS_VERSION 2.9)
set(LCMS_URI https://nchc.dl.sourceforge.net/project/lcms/lcms/${LCMS_VERSION}/lcms2-${LCMS_VERSION}.tar.gz)
set(LCMS_HASH 8de1b7724f578d2995c8fdfa35c3ad0e)
set(PUGIXML_VERSION 1.10)
set(PUGIXML_URI https://github.com/zeux/pugixml/archive/v${PUGIXML_VERSION}.tar.gz)
set(PUGIXML_HASH 0c208b0664c7fb822bf1b49ad035e8fd)
set(PUGIXML_VERSION 1.9)
set(PUGIXML_URI https://github.com/zeux/pugixml/archive/v1.9.tar.gz)
set(PUGIXML_HASH 9346ca1dce2c48f1748c12fdac41a714)
set(FLEXBISON_VERSION 2.5.5)
set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_bison-2.5.5.zip)
@@ -265,37 +279,37 @@ set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
# NOTE: bzip.org domain does no longer belong to BZip 2 project, so we download
# sources from Debian packaging.
set(BZIP2_VERSION 1.0.8)
set(BZIP2_URI http://http.debian.net/debian/pool/main/b/bzip2/bzip2_${BZIP2_VERSION}.orig.tar.gz)
set(BZIP2_HASH ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269)
set(BZIP2_VERSION 1.0.6)
set(BZIP2_URI http://http.debian.net/debian/pool/main/b/bzip2/bzip2_${BZIP2_VERSION}.orig.tar.bz2)
set(BZIP2_HASH d70a9ccd8bdf47e302d96c69fecd54925f45d9c7b966bb4ef5f56b770960afa7)
set(FFI_VERSION 3.3)
set(FFI_VERSION 3.2.1)
set(FFI_URI https://sourceware.org/pub/libffi/libffi-${FFI_VERSION}.tar.gz)
set(FFI_HASH 72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056)
set(FFI_HASH d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37)
set(LZMA_VERSION 5.2.5)
set(LZMA_VERSION 5.2.4)
set(LZMA_URI https://tukaani.org/xz/xz-${LZMA_VERSION}.tar.bz2)
set(LZMA_HASH 5117f930900b341493827d63aa910ff5e011e0b994197c3b71c08a20228a42df)
set(LZMA_HASH 3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf)
set(SSL_VERSION 1.1.1g)
set(SSL_VERSION 1.1.0i)
set(SSL_URI https://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz)
set(SSL_HASH ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46)
set(SSL_HASH ebbfc844a8c8cc0ea5dc10b86c9ce97f401837f3fa08c17b2cdadc118253cf99)
set(SQLITE_VERSION 3.31.1)
set(SQLITE_VERSION 3.24.0)
set(SQLITE_URI https://www.sqlite.org/2018/sqlite-src-3240000.zip)
set(SQLITE_HASH fb558c49ee21a837713c4f1e7e413309aabdd9c7)
set(EMBREE_VERSION 3.10.0)
set(EMBREE_VERSION 3.8.0)
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
set(EMBREE_HASH 4bbe29e7eaa46417efc75fc5f1e8eb87)
set(EMBREE_HASH ac504d5426945fe25dec1267e0c39d52)
set(USD_VERSION 20.05)
set(USD_VERSION 19.11)
set(USD_URI https://github.com/PixarAnimationStudios/USD/archive/v${USD_VERSION}.tar.gz)
set(USD_HASH 6d679e739e7f65725d9c029e37dda9fc)
set(USD_HASH 79ff176167b3fe85f4953abd6cc5e0cc)
set(OIDN_VERSION 1.2.1)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.tar.gz)
set(OIDN_HASH cbebc1a25eb6de62af3a59e943063608)
set(OIDN_VERSION 1.0.0)
set(OIDN_URI https://github.com/OpenImageDenoise/oidn/releases/download/v${OIDN_VERSION}/oidn-${OIDN_VERSION}.src.zip)
set(OIDN_HASH 19fe67b0164e8f020ac8a4f520defe60)
set(LIBGLU_VERSION 9.0.1)
set(LIBGLU_URI ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${LIBGLU_VERSION}.tar.xz)
@@ -305,9 +319,6 @@ set(MESA_VERSION 18.3.1)
set(MESA_URI ftp://ftp.freedesktop.org/pub/mesa//mesa-${MESA_VERSION}.tar.xz)
set(MESA_HASH d60828056d77bfdbae0970f9b15fb1be)
set(XR_OPENXR_SDK_VERSION 1.0.8)
set(XR_OPENXR_SDK_VERSION 1.0.6)
set(XR_OPENXR_SDK_URI https://github.com/KhronosGroup/OpenXR-SDK/archive/release-${XR_OPENXR_SDK_VERSION}.tar.gz)
set(XR_OPENXR_SDK_HASH c6de63d2e0f9029aa58dfa97cad8ce07)
set(ISPC_VERSION v1.13.0)
set(ISPC_URI https://github.com/ispc/ispc/archive/${ISPC_VERSION}.tar.gz)
set(ISPC_HASH 4bf5e8d0020c4b9980faa702c1a6f25f)
set(XR_OPENXR_SDK_HASH 21daea7c3bfec365298d779a0e19caa1)

View File

@@ -18,6 +18,9 @@
if(WIN32)
set(X264_EXTRA_ARGS --enable-win32thread --cross-prefix=${MINGW_HOST}- --host=${MINGW_HOST})
set(X264_PATCH_CMD ${PATCH_CMD} --verbose -p 1 -N -d ${BUILD_DIR}/x264/src/external_x264 < ${PATCH_DIR}/x264.diff)
else()
set(X264_PATCH_CMD echo .)
endif()
@@ -26,6 +29,7 @@ ExternalProject_Add(external_x264
DOWNLOAD_DIR ${DOWNLOAD_DIR}
URL_HASH SHA256=${X264_HASH}
PREFIX ${BUILD_DIR}/x264
PATCH_COMMAND ${X264_PATCH_CMD}
CONFIGURE_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/x264/src/external_x264/ && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/x264
--enable-static
--enable-pic

View File

@@ -53,15 +53,15 @@ getopt \
--long source:,install:,tmp:,info:,threads:,help,show-deps,no-sudo,no-build,no-confirm,\
with-all,with-opencollada,with-jack,with-embree,with-oidn,\
ver-ocio:,ver-oiio:,ver-llvm:,ver-osl:,ver-osd:,ver-openvdb:,ver-xr-openxr:,\
force-all,force-python,force-numpy,force-boost,force-tbb,\
force-all,force-python,force-numpy,force-boost,\
force-ocio,force-openexr,force-oiio,force-llvm,force-osl,force-osd,force-openvdb,\
force-ffmpeg,force-opencollada,force-alembic,force-embree,force-oidn,force-usd,\
force-xr-openxr,\
build-all,build-python,build-numpy,build-boost,build-tbb,\
build-all,build-python,build-numpy,build-boost,\
build-ocio,build-openexr,build-oiio,build-llvm,build-osl,build-osd,build-openvdb,\
build-ffmpeg,build-opencollada,build-alembic,build-embree,build-oidn,build-usd,\
build-xr-openxr,\
skip-python,skip-numpy,skip-boost,skip-tbb,\
skip-python,skip-numpy,skip-boost,\
skip-ocio,skip-openexr,skip-oiio,skip-llvm,skip-osl,skip-osd,skip-openvdb,\
skip-ffmpeg,skip-opencollada,skip-alembic,skip-embree,skip-oidn,skip-usd,\
skip-xr-openxr \
@@ -191,9 +191,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--build-boost
Force the build of Boost.
--build-tbb
Force the build of TBB.
--build-ocio
Force the build of OpenColorIO.
@@ -258,9 +255,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--force-boost
Force the rebuild of Boost.
--force-tbb
Force the rebuild of TBB.
--force-ocio
Force the rebuild of OpenColorIO.
@@ -318,9 +312,6 @@ ARGUMENTS_INFO="\"COMMAND LINE ARGUMENTS:
--skip-boost
Unconditionally skip Boost installation/building.
--skip-tbb
Unconditionally skip TBB installation/building.
--skip-ocio
Unconditionally skip OpenColorIO installation/building.
@@ -376,9 +367,8 @@ USE_CXX11=true
CLANG_FORMAT_VERSION_MIN="6.0"
PYTHON_VERSION="3.7.7"
PYTHON_VERSION="3.7.4"
PYTHON_VERSION_MIN="3.7"
PYTHON_VERSION_INSTALLED=$PYTHON_VERSION_MIN
PYTHON_FORCE_BUILD=false
PYTHON_FORCE_REBUILD=false
PYTHON_SKIP=false
@@ -395,13 +385,6 @@ BOOST_FORCE_BUILD=false
BOOST_FORCE_REBUILD=false
BOOST_SKIP=false
TBB_VERSION="2019"
TBB_VERSION_UPDATE="_U9" # Used for source packages...
TBB_VERSION_MIN="2018"
TBB_FORCE_BUILD=false
TBB_FORCE_REBUILD=false
TBB_SKIP=false
OCIO_VERSION="1.1.0"
OCIO_VERSION_MIN="1.0"
OCIO_FORCE_BUILD=false
@@ -437,7 +420,7 @@ OSL_FORCE_REBUILD=false
OSL_SKIP=false
# OpenSubdiv needs to be compiled for now
OSD_VERSION="3.4.3"
OSD_VERSION="3.4.0_RC2"
OSD_VERSION_MIN=$OSD_VERSION
OSD_FORCE_BUILD=false
OSD_FORCE_REBUILD=false
@@ -459,7 +442,7 @@ ALEMBIC_FORCE_BUILD=false
ALEMBIC_FORCE_REBUILD=false
ALEMBIC_SKIP=false
USD_VERSION="20.05"
USD_VERSION="19.11"
USD_FORCE_BUILD=false
USD_FORCE_REBUILD=false
USD_SKIP=false
@@ -469,7 +452,7 @@ OPENCOLLADA_FORCE_BUILD=false
OPENCOLLADA_FORCE_REBUILD=false
OPENCOLLADA_SKIP=false
EMBREE_VERSION="3.10.0"
EMBREE_VERSION="3.8.0"
EMBREE_FORCE_BUILD=false
EMBREE_FORCE_REBUILD=false
EMBREE_SKIP=false
@@ -479,14 +462,14 @@ OIDN_FORCE_BUILD=false
OIDN_FORCE_REBUILD=false
OIDN_SKIP=false
FFMPEG_VERSION="4.2.3"
FFMPEG_VERSION="4.0.2"
FFMPEG_VERSION_MIN="2.8.4"
FFMPEG_FORCE_BUILD=false
FFMPEG_FORCE_REBUILD=false
FFMPEG_SKIP=false
_ffmpeg_list_sep=";"
XR_OPENXR_VERSION="1.0.8"
XR_OPENXR_VERSION="1.0.6"
XR_OPENXR_FORCE_BUILD=false
XR_OPENXR_FORCE_REBUILD=false
XR_OPENXR_SKIP=false
@@ -670,7 +653,6 @@ while true; do
PYTHON_FORCE_BUILD=true
NUMPY_FORCE_BUILD=true
BOOST_FORCE_BUILD=true
TBB_FORCE_BUILD=true
OCIO_FORCE_BUILD=true
OPENEXR_FORCE_BUILD=true
OIIO_FORCE_BUILD=true
@@ -700,9 +682,6 @@ while true; do
--build-boost)
BOOST_FORCE_BUILD=true; shift; continue
;;
--build-tbb)
TBB_FORCE_BUILD=true; shift; continue
;;
--build-ocio)
OCIO_FORCE_BUILD=true; shift; continue
;;
@@ -749,7 +728,6 @@ while true; do
PYTHON_FORCE_REBUILD=true
NUMPY_FORCE_REBUILD=true
BOOST_FORCE_REBUILD=true
TBB_FORCE_REBUILD=true
OCIO_FORCE_REBUILD=true
OPENEXR_FORCE_REBUILD=true
OIIO_FORCE_REBUILD=true
@@ -777,9 +755,6 @@ while true; do
--force-boost)
BOOST_FORCE_REBUILD=true; shift; continue
;;
--force-tbb)
TBB_FORCE_REBUILD=true; shift; continue
;;
--force-ocio)
OCIO_FORCE_REBUILD=true; shift; continue
;;
@@ -831,9 +806,6 @@ while true; do
--skip-boost)
BOOST_SKIP=true; shift; continue
;;
--skip-tbb)
TBB_SKIP=true; shift; continue
;;
--skip-ocio)
OCIO_SKIP=true; shift; continue
;;
@@ -926,12 +898,9 @@ PYTHON_SOURCE=( "https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHO
NUMPY_SOURCE=( "https://github.com/numpy/numpy/releases/download/v$NUMPY_VERSION/numpy-$NUMPY_VERSION.tar.gz" )
_boost_version_nodots=`echo "$BOOST_VERSION" | sed -r 's/\./_/g'`
BOOST_SOURCE=( "https://dl.bintray.com/boostorg/release/$BOOST_VERSION/source/boost_$_boost_version_nodots.tar.bz2" )
BOOST_SOURCE=( "http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_$_boost_version_nodots.tar.bz2/download" )
BOOST_BUILD_MODULES="--with-system --with-filesystem --with-thread --with-regex --with-locale --with-date_time --with-wave --with-iostreams --with-python --with-program_options"
TBB_SOURCE=( "https://github.com/oneapi-src/oneTBB/archive/$TBB_VERSION$TBB_VERSION_UPDATE.tar.gz" )
TBB_SOURCE_CMAKE=( "https://raw.githubusercontent.com/wjakob/tbb/master/CMakeLists.txt" )
OCIO_USE_REPO=false
OCIO_SOURCE=( "https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/v$OCIO_VERSION.tar.gz")
#~ OCIO_SOURCE_REPO=( "https://github.com/imageworks/OpenColorIO.git" )
@@ -1030,7 +999,7 @@ Those libraries should be available as packages in all recent distributions (opt
* libjpeg, libpng, libtiff, [openjpeg2], [libopenal].
* libx11, libxcursor, libxi, libxrandr, libxinerama (and other libx... as needed).
* libsqlite3, libbz2, libssl, libfftw3, libxml2, libtinyxml, yasm, libyaml-cpp.
* libsdl2, libglew, [libglewmx].\""
* libsdl1.2, libglew, [libglewmx].\""
DEPS_SPECIFIC_INFO="\"BUILDABLE DEPENDENCIES:
@@ -1042,7 +1011,6 @@ You may also want to build them yourself (optional ones are [between brackets]):
* Python $PYTHON_VERSION_MIN (from $PYTHON_SOURCE).
* [NumPy $NUMPY_VERSION_MIN] (from $NUMPY_SOURCE).
* Boost $BOOST_VERSION_MIN (from $BOOST_SOURCE, modules: $BOOST_BUILD_MODULES).
* TBB $TBB_VERSION_MIN (from $TBB_SOURCE).
* [FFMpeg $FFMPEG_VERSION_MIN (needs libvorbis, libogg, libtheora, libx264, libmp3lame, libxvidcore, libvpx, ...)] (from $FFMPEG_SOURCE).
* [OpenColorIO $OCIO_VERSION_MIN] (from $OCIO_SOURCE).
* ILMBase $OPENEXR_VERSION_MIN (from $OPENEXR_SOURCE).
@@ -1280,10 +1248,8 @@ _update_deps_python() {
clean_Python() {
clean_Numpy
_init_python
if [ -d $_inst ]; then
_update_deps_python
fi
_clean
_update_deps_python
}
compile_Python() {
@@ -1366,10 +1332,8 @@ _update_deps_numpy() {
clean_Numpy() {
_init_numpy
if [ -d $_inst ]; then
_update_deps_numpy
fi
_clean
_update_deps_numpy
}
compile_Numpy() {
@@ -1454,10 +1418,8 @@ _update_deps_boost() {
clean_Boost() {
_init_boost
if [ -d $_inst ]; then
_update_deps_boost
fi
_clean
_update_deps_boost
}
compile_Boost() {
@@ -1522,130 +1484,6 @@ compile_Boost() {
run_ldconfig "boost"
}
# ----------------------------------------------------------------------------
# Build TBB
_init_tbb() {
_src=$SRC/TBB-$TBB_VERSION
_git=false
_inst=$INST/tbb-$TBB_VERSION
_inst_shortcut=$INST/tbb
}
_update_deps_tbb() {
OSD_FORCE_REBUILD=true
OPENVDB_FORCE_REBUILD=true
USD_FORCE_REBUILD=true
EMBREE_FORCE_REBUILD=true
OIDN_FORCE_REBUILD=true
if [ "$_is_building" = true ]; then
OSD_FORCE_BUILD=true
OPENVDB_FORCE_BUILD=true
USD_FORCE_BUILD=true
EMBREE_FORCE_BUILD=true
OIDN_FORCE_BUILD=true
fi
}
clean_TBB() {
_init_tbb
if [ -d $_inst ]; then
_update_deps_tbb
fi
_clean
}
compile_TBB() {
if [ "$NO_BUILD" = true ]; then
WARNING "--no-build enabled, TBB will not be compiled!"
return
fi
# To be changed each time we make edits that would modify the compiled result!
tbb_magic=0
_init_tbb
# Clean install if needed!
magic_compile_check tbb-$TBB_VERSION $tbb_magic
if [ $? -eq 1 -o "$TBB_FORCE_REBUILD" = true ]; then
clean_TBB
fi
if [ ! -d $_inst ]; then
INFO "Building TBB-$TBB_VERSION$TBB_VERSION_UPDATE"
_is_building=true
# Rebuild dependencies as well!
_update_deps_tbb
prepare_opt
if [ ! -d $_src ]; then
INFO "Downloading TBB-$TBB_VERSION$TBB_VERSION_UPDATE"
mkdir -p $SRC
download TBB_SOURCE[@] $_src.tar.gz
INFO "Unpacking TBB-$TBB_VERSION$TBB_VERSION_UPDATE"
tar -C $SRC --transform "s,(.*/?)oneTBB[^/]*(.*),\1TBB-$TBB_VERSION\2,x" \
-xf $_src.tar.gz
INFO
# Super-hack: Add some cmake builder to tbb... since they don't even have an install target by default, sic.
download TBB_SOURCE_CMAKE[@] $_src/CMakeLists.txt
cp $_src/build/vs2013/version_string.ver $_src/build/version_string.ver.in
fi
cd $_src
# Always refresh the whole build!
if [ -d cmake_build ]; then
rm -rf cmake_build
fi
mkdir cmake_build
cd cmake_build
cmake_d="-D CMAKE_BUILD_TYPE=Release"
cmake_d="$cmake_d -D CMAKE_PREFIX_PATH=$_inst"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D TBB_BUILD_SHARED=ON"
cmake_d="$cmake_d -D TBB_BUILD_STATIC=OFF"
cmake_d="$cmake_d -D TBB_BUILD_TBBMALLOC=ON"
cmake_d="$cmake_d -D TBB_BUILD_TBBMALLOC_PROXY=OFF"
cmake_d="$cmake_d -D TBB_BUILD_TESTS=OFF"
if file /bin/cp | grep -q '32-bit'; then
cflags="-fPIC -m32 -march=i686"
else
cflags="-fPIC"
fi
cmake $cmake_d -D CMAKE_CXX_FLAGS="$cflags" -D CMAKE_EXE_LINKER_FLAGS="-lgcc_s -lgcc" ..
make -j$THREADS && make install
make clean
if [ -d $_inst ]; then
_create_inst_shortcut
else
ERROR "TBB-$TBB_VERSION$TBB_VERSION_UPDATE failed to compile, exiting"
exit 1
fi
magic_compile_set tbb-$TBB_VERSION $tbb_magic
cd $CWD
INFO "Done compiling TBB-$TBB_VERSION$TBB_VERSION_UPDATE!"
_is_building=false
else
INFO "Own TBB-$TBB_VERSION$TBB_VERSION_UPDATE is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-tbb option."
fi
run_ldconfig "tbb"
}
# ----------------------------------------------------------------------------
# Build OCIO
@@ -1666,10 +1504,8 @@ _update_deps_ocio() {
clean_OCIO() {
_init_ocio
if [ -d $_inst ]; then
_update_deps_ocio
fi
_clean
_update_deps_ocio
}
compile_OCIO() {
@@ -1691,7 +1527,7 @@ compile_OCIO() {
if [ ! -d $_inst ]; then
INFO "Building OpenColorIO-$OCIO_VERSION"
_is_building=true
# Rebuild dependencies as well!
_update_deps_ocio
@@ -1781,7 +1617,7 @@ compile_OCIO() {
_init_openexr() {
_src=$SRC/OpenEXR-$OPENEXR_VERSION
_git=false
_inst=$INST/openexr-$OPENEXR_VERSION
_inst=$_openexr_inst
_inst_shortcut=$INST/openexr
}
@@ -1796,10 +1632,8 @@ _update_deps_openexr() {
clean_OPENEXR() {
_init_openexr
if [ -d $_inst ]; then
_update_deps_openexr
fi
_clean
_update_deps_openexr
}
compile_OPENEXR() {
@@ -1817,6 +1651,7 @@ compile_OPENEXR() {
clean_OPENEXR
fi
_openexr_inst=$INST/openexr-$OPENEXR_VERSION
PRINT ""
_init_openexr
@@ -1862,7 +1697,7 @@ compile_OPENEXR() {
mkdir build
cd build
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_openexr_inst"
cmake_d="$cmake_d -D CMAKE_INSTALL_DOCDIR=/dev/null" # Hack, there is no option to disable that currently...
cmake_d="$cmake_d -D BUILD_SHARED_LIBS=ON"
cmake_d="$cmake_d -D BUILD_TESTING=OFF"
@@ -1924,10 +1759,8 @@ _update_deps_oiio() {
clean_OIIO() {
_init_oiio
if [ -d $_inst ]; then
_update_deps_oiio
fi
_clean
_update_deps_oiio
}
compile_OIIO() {
@@ -2079,10 +1912,8 @@ _update_deps_llvm() {
clean_LLVM() {
_init_llvm
if [ -d $_inst ]; then
_update_deps_llvm
fi
_clean
_update_deps_llvm
}
compile_LLVM() {
@@ -2188,10 +2019,8 @@ _update_deps_osl() {
clean_OSL() {
_init_osl
if [ -d $_inst ]; then
_update_deps_osl
fi
_clean
_update_deps_osl
}
compile_OSL() {
@@ -2333,10 +2162,8 @@ _update_deps_osd() {
clean_OSD() {
_init_osd
if [ -d $_inst ]; then
_update_deps_osd
fi
_clean
_update_deps_osd
}
compile_OSD() {
@@ -2395,9 +2222,6 @@ compile_OSD() {
mkdir build
cd build
if [ -d $INST/tbb ]; then
cmake_d="$cmake_d $cmake_d -D TBB_LOCATION=$INST/tbb"
fi
cmake_d="-D CMAKE_BUILD_TYPE=Release"
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
# ptex is only needed when nicholas bishop is ready
@@ -2450,10 +2274,8 @@ _update_deps_blosc() {
clean_BLOSC() {
_init_blosc
if [ -d $_inst ]; then
_update_deps_blosc
fi
_clean
_update_deps_blosc
}
compile_BLOSC() {
@@ -2547,10 +2369,8 @@ _update_deps_openvdb() {
clean_OPENVDB() {
_init_openvdb
if [ -d $_inst ]; then
_update_deps_openvdb
fi
_clean
_update_deps_openvdb
}
compile_OPENVDB() {
@@ -2609,9 +2429,6 @@ compile_OPENVDB() {
if [ -d $INST/boost ]; then
make_d="$make_d BOOST_INCL_DIR=$INST/boost/include BOOST_LIB_DIR=$INST/boost/lib"
fi
if [ -d $INST/tbb ]; then
make_d="$make_d TBB_ROOT=$INST/tbb TBB_USE_STATIC_LIBS=OFF"
fi
if [ "$_with_built_openexr" = true ]; then
make_d="$make_d ILMBASE_INCL_DIR=$INST/openexr/include ILMBASE_LIB_DIR=$INST/openexr/lib"
@@ -2665,10 +2482,8 @@ _update_deps_alembic() {
clean_ALEMBIC() {
_init_alembic
if [ -d $_inst ]; then
_update_deps_alembic
fi
_clean
_update_deps_alembic
}
compile_ALEMBIC() {
@@ -2770,10 +2585,8 @@ _update_deps_usd() {
clean_USD() {
_init_usd
if [ -d $_inst ]; then
_update_deps_usd
fi
_clean
_update_deps_usd
}
compile_USD() {
@@ -2817,10 +2630,6 @@ compile_USD() {
if [ -d $INST/boost ]; then
cmake_d="$cmake_d $cmake_d -D BOOST_ROOT=$INST/boost"
fi
if [ -d $INST/tbb ]; then
cmake_d="$cmake_d $cmake_d -D TBB_ROOT_DIR=$INST/tbb"
fi
cmake_d="$cmake_d -DPXR_SET_INTERNAL_NAMESPACE=usdBlender"
cmake_d="$cmake_d -DPXR_ENABLE_PYTHON_SUPPORT=OFF"
cmake_d="$cmake_d -DPXR_BUILD_IMAGING=OFF"
@@ -2845,7 +2654,7 @@ compile_USD() {
cd $CWD
INFO "Done compiling USD-$USD_VERSION!"
_is_building=false
_is_building=true
else
INFO "Own USD-$USD_VERSION is up to date, nothing to do!"
INFO "If you want to force rebuild of this lib, use the --force-usd option."
@@ -2869,10 +2678,8 @@ _update_deps_collada() {
clean_OpenCOLLADA() {
_init_opencollada
if [ -d $_inst ]; then
_update_deps_collada
fi
_clean
_update_deps_collada
}
compile_OpenCOLLADA() {
@@ -2975,10 +2782,8 @@ _update_deps_embree() {
clean_Embree() {
_init_embree
if [ -d $_inst ]; then
_update_deps_embree
fi
_clean
_update_deps_embree
}
compile_Embree() {
@@ -2988,7 +2793,7 @@ compile_Embree() {
fi
# To be changed each time we make edits that would modify the compiled results!
embree_magic=10
embree_magic=9
_init_embree
# Clean install if needed!
@@ -3042,13 +2847,9 @@ compile_Embree() {
cmake_d="$cmake_d -D EMBREE_RAY_MASK=ON"
cmake_d="$cmake_d -D EMBREE_FILTER_FUNCTION=ON"
cmake_d="$cmake_d -D EMBREE_BACKFACE_CULLING=OFF"
cmake_d="$cmake_d -D EMBREE_TASKING_SYSTEM=INTERNAL"
cmake_d="$cmake_d -D EMBREE_MAX_ISA=AVX2"
cmake_d="$cmake_d -D EMBREE_TASKING_SYSTEM=TBB"
if [ -d $INST/tbb ]; then
make_d="$make_d EMBREE_TBB_ROOT=$INST/tbb"
fi
cmake $cmake_d ../
make -j$THREADS && make install
@@ -3088,10 +2889,8 @@ _update_deps_oidn() {
clean_oidn() {
_init_oidn
if [ -d $_inst ]; then
_update_deps_oidn
fi
_clean
_update_deps_oidn
}
compile_OIDN() {
@@ -3153,10 +2952,6 @@ compile_OIDN() {
cmake_d="$cmake_d -D WITH_TEST=OFF"
cmake_d="$cmake_d -D OIDN_STATIC_LIB=ON"
if [ -d $INST/tbb ]; then
make_d="$make_d TBB_ROOT=$INST/tbb"
fi
cmake $cmake_d ../
make -j$THREADS && make install
@@ -3197,10 +2992,8 @@ _update_deps_ffmpeg() {
clean_FFmpeg() {
_init_ffmpeg
if [ -d $_inst ]; then
_update_deps_ffmpeg
fi
_clean
_update_deps_ffmpeg
}
compile_FFmpeg() {
@@ -3326,10 +3119,8 @@ _update_deps_xr_openxr_sdk() {
clean_XR_OpenXR_SDK() {
_init_xr_openxr_sdk
if [ -d $_inst ]; then
_update_deps_xr_openxr_sdk
fi
_clean
_update_deps_xr_openxr_sdk
}
compile_XR_OpenXR_SDK() {
@@ -3343,7 +3134,7 @@ compile_XR_OpenXR_SDK() {
_init_xr_openxr_sdk
# Clean install if needed!
magic_compile_check xr-openxr-$XR_OPENXR_VERSION $xr_openxr_magic
magic_compile_check xr-openxr-$OPENXR_VERSION $xr_openxr_magic
if [ $? -eq 1 -o "$XR_OPENXR_FORCE_REBUILD" = true ]; then
clean_XR_OpenXR_SDK
fi
@@ -3520,11 +3311,11 @@ install_DEB() {
THEORA_DEV="libtheora-dev"
_packages="gawk cmake cmake-curses-gui build-essential libjpeg-dev libpng-dev libtiff-dev \
git libfreetype6-dev libx11-dev flex bison libxxf86vm-dev \
git libfreetype6-dev libx11-dev flex bison libtbb-dev libxxf86vm-dev \
libxcursor-dev libxi-dev wget libsqlite3-dev libxrandr-dev libxinerama-dev \
libbz2-dev libncurses5-dev libssl-dev liblzma-dev libreadline-dev \
libopenal-dev libglew-dev yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV \
libsdl2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
libsdl1.2-dev libfftw3-dev patch bzip2 libxml2-dev libtinyxml-dev libjemalloc-dev"
# libglewmx-dev (broken in deb testing currently...)
VORBIS_USE=true
@@ -3675,11 +3466,9 @@ install_DEB() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
check_package_version_ge_DEB python3-dev $PYTHON_VERSION_MIN
check_package_DEB python$PYTHON_VERSION_MIN-dev
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_DEB python3-dev` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_DEB python3-dev
install_packages_DEB python$PYTHON_VERSION_MIN-dev
clean_Python
PRINT ""
if [ "$NUMPY_SKIP" = true ]; then
@@ -3731,23 +3520,6 @@ install_DEB() {
fi
PRINT ""
if [ "$TBB_SKIP" = true ]; then
WARNING "Skipping TBB installation, as requested..."
elif [ "$TBB_FORCE_BUILD" = true ]; then
INFO "Forced TBB building, as requested..."
compile_TBB
else
check_package_version_ge_DEB libtbb-dev $TBB_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_DEB libtbb-dev
clean_TBB
else
compile_TBB
fi
fi
PRINT ""
if [ "$OCIO_SKIP" = true ]; then
WARNING "Skipping OpenColorIO installation, as requested..."
@@ -3892,6 +3664,7 @@ install_DEB() {
INFO "Forced Alembic building, as requested..."
compile_ALEMBIC
else
# No package currently, only HDF5!
compile_ALEMBIC
fi
@@ -4171,7 +3944,7 @@ install_RPM() {
THEORA_DEV="libtheora-devel"
_packages="gcc gcc-c++ git make cmake tar bzip2 xz findutils flex bison \
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL2-devel \
libtiff-devel libjpeg-devel libpng-devel sqlite-devel fftw-devel SDL-devel \
libX11-devel libXi-devel libXcursor-devel libXrandr-devel libXinerama-devel \
wget ncurses-devel readline-devel $OPENJPEG_DEV openal-soft-devel \
glew-devel yasm $THEORA_DEV $VORBIS_DEV $OGG_DEV patch \
@@ -4183,7 +3956,7 @@ install_RPM() {
THEORA_USE=true
if [ "$RPM" = "FEDORA" -o "$RPM" = "RHEL" ]; then
_packages="$_packages freetype-devel"
_packages="$_packages freetype-devel tbb-devel"
if [ "$WITH_JACK" = true ]; then
_packages="$_packages jack-audio-connection-kit-devel"
@@ -4224,6 +3997,17 @@ install_RPM() {
PRINT ""
install_packages_RPM $_packages
PRINT ""
# Install TBB on openSUSE, from temporary repo
check_package_RPM tbb-devel
if [ $? -eq 0 ]; then
install_packages_RPM tbb-devel
else
$SUDO zypper ar -f http://download.opensuse.org/repositories/devel:/libraries:/c_c++/openSUSE_$_suse_rel/devel:libraries:c_c++.repo
$SUDO zypper -n --gpg-auto-import-keys install tbb-devel
$SUDO zypper rr devel_libraries_c_c++
fi
PRINT ""
X264_DEV="libx264-devel"
check_package_version_ge_RPM $X264_DEV $X264_VERSION_MIN
@@ -4298,10 +4082,8 @@ install_RPM() {
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
else
check_package_version_ge_RPM python3-devel $PYTHON_VERSION_MIN
check_package_version_match_RPM python3-devel $PYTHON_VERSION_MIN
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_RPM python3-devel` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_RPM python3-devel
clean_Python
PRINT ""
@@ -4361,23 +4143,6 @@ install_RPM() {
fi
PRINT ""
if [ "$TBB_SKIP" = true ]; then
WARNING "Skipping TBB installation, as requested..."
elif [ "$TBB_FORCE_BUILD" = true ]; then
INFO "Forced TBB building, as requested..."
compile_TBB
else
check_package_version_ge_RPM tbb-devel $TBB_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_RPM tbb-devel
clean_TBB
else
compile_TBB
fi
fi
PRINT ""
if [ "$OCIO_SKIP" = true ]; then
WARNING "Skipping OpenColorIO installation, as requested..."
@@ -4734,7 +4499,7 @@ install_ARCH() {
_packages="$BASE_DEVEL git cmake \
libxi libxcursor libxrandr libxinerama glew libpng libtiff wget openal \
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl2 fftw \
$OPENJPEG_DEV $VORBIS_DEV $OGG_DEV $THEORA_DEV yasm sdl fftw intel-tbb \
libxml2 yaml-cpp tinyxml python-requests jemalloc"
OPENJPEG_USE=true
@@ -4825,8 +4590,6 @@ install_ARCH() {
else
check_package_version_ge_ARCH python $PYTHON_VERSION_MIN
if [ $? -eq 0 ]; then
PYTHON_VERSION_INSTALLED=$(echo `get_package_version_ARCH python` | sed -r 's/^([0-9]+\.[0-9]+).*/\1/')
install_packages_ARCH python
clean_Python
PRINT ""
@@ -4875,23 +4638,6 @@ install_ARCH() {
fi
PRINT ""
if [ "$TBB_SKIP" = true ]; then
WARNING "Skipping TBB installation, as requested..."
elif [ "$TBB_FORCE_BUILD" = true ]; then
INFO "Forced TBB building, as requested..."
compile_TBB
else
check_package_version_ge_ARCH intel-tbb $TBB_VERSION_MIN
if [ $? -eq 0 ]; then
install_packages_ARCH intel-tbb
clean_TBB
else
compile_TBB
fi
fi
PRINT ""
if [ "$OCIO_SKIP" = true ]; then
WARNING "Skipping OpenColorIO installation, as requested..."
@@ -5186,10 +4932,15 @@ install_OTHER() {
fi
PRINT ""
_do_compile_python=false
if [ "$PYTHON_SKIP" = true ]; then
WARNING "Skipping Python/NumPy installation, as requested..."
elif [ "$PYTHON_FORCE_BUILD" = true ]; then
INFO "Forced Python/NumPy building, as requested..."
_do_compile_python=true
fi
if [ "$_do_compile_python" = true ]; then
compile_Python
PRINT ""
if [ "$NUMPY_SKIP" = true ]; then
@@ -5209,15 +4960,6 @@ install_OTHER() {
fi
PRINT ""
if [ "$TBB_SKIP" = true ]; then
WARNING "Skipping TBB installation, as requested..."
elif [ "$TBB_FORCE_BUILD" = true ]; then
INFO "Forced TBB building, as requested..."
compile_TBB
fi
PRINT ""
if [ "$OCIO_SKIP" = true ]; then
WARNING "Skipping OpenColorIO installation, as requested..."
@@ -5247,10 +4989,16 @@ install_OTHER() {
PRINT ""
have_llvm=false
_do_compile_llvm=false
if [ "$LLVM_SKIP" = true ]; then
WARNING "Skipping LLVM installation, as requested (this also implies skipping OSL!)..."
elif [ "$LLVM_FORCE_BUILD" = true ]; then
INFO "Forced LLVM building, as requested..."
_do_compile_llvm=true
fi
if [ "$_do_compile_llvm" = true ]; then
PRINT ""
compile_LLVM
have_llvm=true
LLVM_VERSION_FOUND=$LLVM_VERSION
@@ -5258,10 +5006,15 @@ install_OTHER() {
PRINT ""
_do_compile_osl=false
if [ "$OSL_SKIP" = true ]; then
WARNING "Skipping OpenShadingLanguage installation, as requested..."
elif [ "$OSL_FORCE_BUILD" = true ]; then
INFO "Forced OpenShadingLanguage building, as requested..."
_do_compile_osl=true
fi
if [ "$_do_compile_osl" = true ]; then
if [ "$have_llvm" = true ]; then
PRINT ""
compile_OSL
@@ -5272,40 +5025,66 @@ install_OTHER() {
PRINT ""
_do_compile_osd=false
if [ "$OSD_SKIP" = true ]; then
WARNING "Skipping OpenSubdiv installation, as requested..."
elif [ "$OSD_FORCE_BUILD" = true ]; then
INFO "Forced OpenSubdiv building, as requested..."
_do_compile_osd=true
fi
if [ "$_do_compile_osd" = true ]; then
PRINT ""
compile_OSD
fi
if [ "$WITH_OPENCOLLADA" = true ]; then
_do_compile_collada=false
PRINT ""
if [ "$OPENCOLLADA_SKIP" = true ]; then
WARNING "Skipping OpenCOLLADA installation, as requested..."
elif [ "$OPENCOLLADA_FORCE_BUILD" = true ]; then
INFO "Forced OpenCollada building, as requested..."
_do_compile_collada=true
fi
if [ "$_do_compile_collada" = true ]; then
PRINT ""
compile_OpenCOLLADA
fi
fi
if [ "$WITH_EMBREE" = true ]; then
_do_compile_embree=false
PRINT ""
if [ "$EMBREE_SKIP" = true ]; then
WARNING "Skipping Embree installation, as requested..."
elif [ "$EMBREE_FORCE_BUILD" = true ]; then
INFO "Forced Embree building, as requested..."
_do_compile_embree=true
fi
if [ "$_do_compile_embree" = true ]; then
PRINT ""
compile_Embree
fi
fi
if [ "$WITH_OIDN" = true ]; then
_do_compile_oidn=false
PRINT ""
if [ "$OIDN_SKIP" = true ]; then
WARNING "Skipping OpenImgeDenoise installation, as requested..."
elif [ "$OIDN_FORCE_BUILD" = true ]; then
INFO "Forced OpenImageDenoise building, as requested..."
_do_compile_oidn=true
else
# No package currently!
_do_compile_oidn=true
fi
if [ "$_do_compile_oidn" = true ]; then
compile_OIDN
fi
fi
@@ -5324,6 +5103,9 @@ install_OTHER() {
elif [ "$XR_OPENXR_FORCE_BUILD" = true ]; then
INFO "Forced OpenXR-SDK building, as requested..."
compile_XR_OpenXR_SDK
else
# No package currently!
compile_XR_OpenXR_SDK
fi
}
@@ -5409,7 +5191,7 @@ print_info() {
PRINT ""
PRINT "If you're using CMake add this to your configuration flags:"
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost* -U *TBB*"
_buildargs="-U *SNDFILE* -U PYTHON* -U *BOOST* -U *Boost*"
_buildargs="$_buildargs -U *OPENCOLORIO* -U *OPENEXR* -U *OPENIMAGEIO* -U *LLVM* -U *CYCLES*"
_buildargs="$_buildargs -U *OPENSUBDIV* -U *OPENVDB* -U *COLLADA* -U *FFMPEG* -U *ALEMBIC* -U *USD*"
@@ -5417,11 +5199,11 @@ print_info() {
PRINT " $_1"
_buildargs="$_buildargs $_1"
_1="-D PYTHON_VERSION=$PYTHON_VERSION_INSTALLED"
_1="-D PYTHON_VERSION=$PYTHON_VERSION_MIN"
PRINT " $_1"
_buildargs="$_buildargs $_1"
if [ -d "$INST/python-$PYTHON_VERSION_INSTALLED" ]; then
_1="-D PYTHON_ROOT_DIR=$INST/python-$PYTHON_VERSION_INSTALLED"
if [ -d "$INST/python-$PYTHON_VERSION_MIN" ]; then
_1="-D PYTHON_ROOT_DIR=$INST/python-$PYTHON_VERSION_MIN"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
@@ -5434,12 +5216,6 @@ print_info() {
_buildargs="$_buildargs $_1 $_2"
fi
if [ -d $INST/tbb ]; then
_1="-D TBB_ROOT_DIR=$INST/tbb"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
if [ "$OCIO_SKIP" = false ]; then
_1="-D WITH_OPENCOLORIO=ON"
PRINT " $_1"
@@ -5578,11 +5354,6 @@ print_info() {
_1="-D WITH_USD=ON"
PRINT " $_1"
_buildargs="$_buildargs $_1"
if [ -d $INST/usd ]; then
_1="-D USD_ROOT_DIR=$INST/usd"
PRINT " $_1"
_buildargs="$_buildargs $_1"
fi
fi
if [ "$NO_SYSTEM_GLEW" = true ]; then

View File

@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 2.8)
project(hidapi)
set(SRC_FILES
windows/hid.c
)
set(HEADER_FILES
hidapi/hidapi.h
)
include_directories(hidapi)
add_definitions(-DHID_API_STATIC)
add_library(hidapi STATIC ${SRC_FILES} ${HEADER_FILES})
install(TARGETS hidapi DESTINATION lib)
INSTALL(FILES hidapi/hidapi.h
DESTINATION "include"
)

View File

@@ -109,9 +109,6 @@ if (WIN32)
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/${ARCH_PREFIX}-tbbmalloc-export.def
COMMENT "Preprocessing tbbmalloc.def"
)
list(APPEND tbb_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/tbb_resource.rc)
list(APPEND tbbmalloc_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
list(APPEND tbbmalloc_proxy_src ${CMAKE_CURRENT_SOURCE_DIR}/src/tbbmalloc/tbbmalloc.rc)
else()
add_custom_command(OUTPUT tbb.def
COMMAND ${CMAKE_CXX_COMPILER} -xc++ -E ${CMAKE_CURRENT_SOURCE_DIR}/src/tbb/${ARCH_PREFIX}-tbb-export.def -I ${CMAKE_CURRENT_SOURCE_DIR}/include -o tbb.def
@@ -148,12 +145,8 @@ if (TBB_BUILD_SHARED)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "-Wl,-version-script,${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
elseif(WIN32)
set_property(TARGET tbb APPEND PROPERTY LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/tbb.def")
endif()
install(TARGETS tbb DESTINATION lib)
if(WIN32)
set_target_properties(tbb PROPERTIES OUTPUT_NAME "tbb$<$<CONFIG:Debug>:_debug>")
endif()
endif()
if(CMAKE_COMPILER_IS_GNUCC)
@@ -203,7 +196,7 @@ if(TBB_BUILD_TBBMALLOC_PROXY)
add_library(tbbmalloc_proxy SHARED ${tbbmalloc_proxy_src})
set_property(TARGET tbbmalloc_proxy APPEND PROPERTY COMPILE_DEFINITIONS "__TBBMALLOC_BUILD=1")
set_property(TARGET tbbmalloc_proxy APPEND_STRING PROPERTY COMPILE_FLAGS ${DISABLE_RTTI})
target_link_libraries(tbbmalloc_proxy tbbmalloc)
link_libraries(tbbmalloc_proxy tbbmalloc)
install(TARGETS tbbmalloc_proxy DESTINATION lib)
endif()
endif()

View File

@@ -1,14 +0,0 @@
diff -Naur orig/common/sys/platform.h external_embree/common/sys/platform.h
--- orig/common/sys/platform.h 2020-05-13 23:08:53 -0600
+++ external_embree/common/sys/platform.h 2020-06-13 17:40:26 -0600
@@ -84,8 +84,8 @@
////////////////////////////////////////////////////////////////////////////////
#ifdef __WIN32__
-#define dll_export __declspec(dllexport)
-#define dll_import __declspec(dllimport)
+#define dll_export
+#define dll_import
#else
#define dll_export __attribute__ ((visibility ("default")))
#define dll_import

View File

@@ -0,0 +1,15 @@
--- hidapi/hidapi.h 2011-10-25 20:58:16 -0600
+++ hidapi/hidapi.h 2016-11-01 12:05:58 -0600
@@ -30,7 +30,11 @@
#include <wchar.h>
#ifdef _WIN32
- #define HID_API_EXPORT __declspec(dllexport)
+ #ifdef HID_API_STATIC
+ #define HID_API_EXPORT
+ #else
+ #define HID_API_EXPORT __declspec(dllexport)
+ #endif
#define HID_API_CALL
#else
#define HID_API_EXPORT /**< API export macro */

View File

@@ -1,36 +0,0 @@
diff -Naur external_ispc/CMakeLists.txt external_ispc_fixed/CMakeLists.txt
--- external_ispc/CMakeLists.txt 2020-04-23 17:29:06 -0600
+++ external_ispc_fixed/CMakeLists.txt 2020-05-05 09:01:09 -0600
@@ -389,7 +389,7 @@
# Link against Clang libraries
foreach(clangLib ${CLANG_LIBRARY_LIST})
- find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS})
+ find_library(${clangLib}Path NAMES ${clangLib} HINTS ${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIR})
list(APPEND CLANG_LIBRARY_FULL_PATH_LIST ${${clangLib}Path})
endforeach()
target_link_libraries(${PROJECT_NAME} ${CLANG_LIBRARY_FULL_PATH_LIST})
diff -Naur orig/CMakeLists.txt external_ispc/CMakeLists.txt
--- orig/CMakeLists.txt 2020-05-05 09:19:11 -0600
+++ external_ispc/CMakeLists.txt 2020-05-05 09:26:44 -0600
@@ -333,7 +333,7 @@
# Include directories
target_include_directories(${PROJECT_NAME} PRIVATE
- ${LLVM_INCLUDE_DIRS}
+ ${LLVM_INCLUDE_DIRS} ${CLANG_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
# Compile options
diff -Naur orig/cmake/GenerateBuiltins.cmake.txt external_ispc/cmake/GenerateBuiltins.cmake.txt
+++ orig/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
+++ external_ispc/cmake/GenerateBuiltins.cmake 2020-05-25 13:32:40.830803821 +0200
@@ -97,6 +97,8 @@
if ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "x86")
set(target_arch "i386")
+ # Blender: disable 32bit due to build issues on Linux and being unnecessary.
+ set(SKIP ON)
elseif ("${bit}" STREQUAL "64" AND ${arch} STREQUAL "x86")
set(target_arch "x86_64")
elseif ("${bit}" STREQUAL "32" AND ${arch} STREQUAL "arm")

View File

@@ -0,0 +1,13 @@
diff -Naur external_openal_original/CMakeLists.txt external_openal/CMakeLists.txt
--- external_openal_original/CMakeLists.txt 2016-01-24 20:12:39 -0700
+++ external_openal/CMakeLists.txt 2018-06-02 12:16:52 -0600
@@ -885,7 +885,8 @@
OPTION(ALSOFT_REQUIRE_MMDEVAPI "Require MMDevApi backend" OFF)
IF(HAVE_WINDOWS_H)
# Check MMSystem backend
- CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H -D_WIN32_WINNT=0x0502)
+ set(CMAKE_REQUIRED_FLAGS "-D_WIN32_WINNT=0x0502")
+ CHECK_INCLUDE_FILES("windows.h;mmsystem.h" HAVE_MMSYSTEM_H)
IF(HAVE_MMSYSTEM_H)
CHECK_SHARED_FUNCTION_EXISTS(waveOutOpen "windows.h;mmsystem.h" winmm "" HAVE_LIBWINMM)
IF(HAVE_LIBWINMM)

View File

@@ -0,0 +1,131 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70ec895..e616b63 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,7 +178,9 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY SOVERSION "0")
## Open Image Denoise examples
## ----------------------------------------------------------------------------
-add_subdirectory(examples)
+if(WITH_EXAMPLE)
+ add_subdirectory(examples)
+endif()
## ----------------------------------------------------------------------------
## Open Image Denoise install and packaging
Submodule mkl-dnn contains modified content
diff --git a/mkl-dnn/cmake/TBB.cmake b/mkl-dnn/cmake/TBB.cmake
index 0711e699..c14210b6 100644
--- a/mkl-dnn/cmake/TBB.cmake
+++ b/mkl-dnn/cmake/TBB.cmake
@@ -90,8 +90,8 @@ if(WIN32)
NO_DEFAULT_PATH
)
set(TBB_LIB_DIR ${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
- find_library(TBB_LIBRARY tbb PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY tbb_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static PATHS ${TBB_LIB_DIR} ${TBB_ROOT}/lib NO_DEFAULT_PATH)
endif()
else()
@@ -138,13 +138,13 @@ else()
set(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
if(APPLE)
find_path(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
- find_library(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY tbb_static PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
else()
find_path(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
set(TBB_HINTS HINTS ${TBB_ROOT}/lib/intel64/gcc4.4 ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 PATHS /usr/libx86_64-linux-gnu/)
- find_library(TBB_LIBRARY tbb ${TBB_HINTS})
- find_library(TBB_LIBRARY_MALLOC tbbmalloc ${TBB_HINTS})
+ find_library(TBB_LIBRARY tbb_static ${TBB_HINTS})
+ find_library(TBB_LIBRARY_MALLOC tbbmalloc_static ${TBB_HINTS})
endif()
endif()
diff '--ignore-matching-lines=:' -ur '--exclude=*.svn*' -u -r
--- a/cmake/install.cmake 2019-08-12 18:02:20.794402575 +0200
+++ b/cmake/install.cmake 2019-08-12 18:06:07.470045703 +0200
@@ -18,6 +18,13 @@
## Install library
## ----------------------------------------------------------------------------
+if(UNIX)
+install(FILES
+ ${CMAKE_BINARY_DIR}/libOpenImageDenoise.a
+ ${CMAKE_BINARY_DIR}/libmkldnn.a
+ ${CMAKE_BINARY_DIR}/libcommon.a
+ DESTINATION ${CMAKE_INSTALL_LIBDIR})
+else()
install(TARGETS ${PROJECT_NAME}
EXPORT
${PROJECT_NAME}_Export
@@ -38,6 +45,7 @@
DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT devel
)
endif()
+endif()
## ----------------------------------------------------------------------------
## Install headers
@@ -78,6 +86,7 @@
## Install CMake configuration files
## ----------------------------------------------------------------------------
+if(NOT UNIX)
install(EXPORT ${PROJECT_NAME}_Export
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
#NAMESPACE ${PROJECT_NAME}::
@@ -92,3 +101,4 @@
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
COMPONENT devel
)
+endif()
diff '--ignore-matching-lines=:' -ur '--exclude=*.svn*' -u -r
--- a/CMakeLists.txt 2019-08-12 14:22:00.974078598 +0200
+++ b/CMakeLists.txt 2019-08-12 18:05:05.949057375 +0200
@@ -14,7 +14,11 @@
## limitations under the License. ##
## ======================================================================== ##
-cmake_minimum_required(VERSION 3.1)
+if(UNIX)
+ cmake_minimum_required(VERSION 3.1)
+else()
+ cmake_minimum_required(VERSION 3.13)
+endif()
set(OIDN_VERSION_MAJOR 1)
set(OIDN_VERSION_MINOR 0)
@@ -32,13 +36,8 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
# Build as shared or static library
-if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.13.0")
- option(OIDN_STATIC_LIB "Build Open Image Denoise as a static library.")
- mark_as_advanced(CLEAR OIDN_STATIC_LIB)
-else()
- set(OIDN_STATIC_LIB OFF CACHE BOOL "Build Open Image Denoise as a static library." FORCE)
- mark_as_advanced(OIDN_STATIC_LIB)
-endif()
+option(OIDN_STATIC_LIB "Build Open Image Denoise as a static library.")
+mark_as_advanced(CLEAR OIDN_STATIC_LIB)
if(OIDN_STATIC_LIB)
set(OIDN_LIB_TYPE STATIC)
else()
diff -Naur orig/core/api.cpp external_openimagedenoise/core/api.cpp
--- orig/core/api.cpp 2019-07-19 08:37:04 -0600
+++ external_openimagedenoise/core/api.cpp 2020-01-21 15:10:56 -0700
@@ -15,7 +15,7 @@
// ======================================================================== //
#ifdef _WIN32
-# define OIDN_API extern "C" __declspec(dllexport)
+# define OIDN_API extern "C"
#else
# define OIDN_API extern "C" __attribute__ ((visibility ("default")))
#endif

View File

@@ -1,36 +0,0 @@
diff -Naur orig/CMakeLists.txt external_openimageio/CMakeLists.txt
--- orig/CMakeLists.txt 2020-05-10 21:43:52 -0600
+++ external_openimageio/CMakeLists.txt 2020-05-13 17:03:35 -0600
@@ -170,7 +170,7 @@
add_subdirectory (src/iinfo)
add_subdirectory (src/maketx)
add_subdirectory (src/oiiotool)
- add_subdirectory (src/testtex)
+ #add_subdirectory (src/testtex)
add_subdirectory (src/iv)
endif ()
diff -Naur orig/src/cmake/compiler.cmake external_openimageio/src/cmake/compiler.cmake
--- orig/src/cmake/compiler.cmake 2020-05-10 21:43:52 -0600
+++ external_openimageio/src/cmake/compiler.cmake 2020-05-13 17:02:54 -0600
@@ -172,6 +172,7 @@
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
add_definitions (-DJAS_WIN_MSVC_BUILD)
+ add_definitions (-DOPJ_STATIC)
endif (MSVC)
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
diff -Naur orig/src/include/OpenImageIO/platform.h external_openimageio/src/include/OpenImageIO/platform.h
--- orig/src/include/OpenImageIO/platform.h 2020-05-10 21:43:52 -0600
+++ external_openimageio/src/include/OpenImageIO/platform.h 2020-05-13 17:04:36 -0600
@@ -41,6 +41,9 @@
# ifndef NOMINMAX
# define NOMINMAX
# endif
+# ifndef NOGDI
+# define NOGDI
+# endif
# include <windows.h>
#endif

View File

@@ -0,0 +1,26 @@
Index: OpenImageIO/osdep.h
===================================================================
--- OpenImageIO/osdep.h (revision 61595)
+++ OpenImageIO/osdep.h (working copy)
@@ -34,6 +34,7 @@
# define WIN32_LEAN_AND_MEAN
# define VC_EXTRALEAN
# define NOMINMAX
+# define NOGDI
# include <windows.h>
#endif
Index: OpenImageIO/platform.h
===================================================================
--- OpenImageIO/platform.h (revision 61595)
+++ OpenImageIO/platform.h (working copy)
@@ -77,6 +77,9 @@
# ifndef NOMINMAX
# define NOMINMAX
# endif
+# ifndef NOGDI
+# define NOGDI
+# endif
# include <windows.h>
#endif

View File

@@ -0,0 +1,22 @@
diff -Naur external_openimageio.orig/src/cmake/compiler.cmake external_openimageio/src/cmake/compiler.cmake
--- external_openimageio.orig/src/cmake/compiler.cmake 2018-07-31 23:45:19 -0600
+++ external_openimageio/src/cmake/compiler.cmake 2018-08-16 12:50:12 -0600
@@ -152,6 +152,7 @@
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
add_definitions (-DJAS_WIN_MSVC_BUILD)
+ add_definitions (-DOPJ_STATIC)
endif (MSVC)
# Use ccache if found
--- external_openimageio.orig/CMakeLists.txt 2018-07-31 23:45:19 -0600
+++ external_openimageio/CMakeLists.txt 2018-08-17 15:22:56 -0600
@@ -169,7 +169,7 @@
add_subdirectory (src/iinfo)
add_subdirectory (src/maketx)
add_subdirectory (src/oiiotool)
- add_subdirectory (src/testtex)
+# add_subdirectory (src/testtex)
add_subdirectory (src/iv)
endif ()

View File

@@ -48,22 +48,3 @@ diff -Naur OpenShadingLanguage-Release-1.9.9/src/liboslexec/llvm_util.cpp extern
size_t
LLVM_Util::total_jit_memory_held ()
diff -Naur OpenShadingLanguage-Release-1.9.9/CMakeLists.txt external_osl/CMakeLists.txt
--- orig/CMakeLists.txt 2020-01-27 16:22:31 -0700
+++ external_osl/CMakeLists.txt 2020-05-13 18:04:52 -0600
@@ -102,10 +102,11 @@
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
set (CUDA_TARGET_ARCH "sm_35" CACHE STRING "CUDA GPU architecture (e.g. sm_35)")
-# set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
-# if (USE_OIIO_STATIC)
-# add_definitions ("-DOIIO_STATIC_BUILD=1")
-# endif ()
+set (USE_OIIO_STATIC ON CACHE BOOL "If OIIO is built static")
+if (USE_OIIO_STATIC)
+ add_definitions ("-DOIIO_STATIC_BUILD=1")
+ add_definitions ("-DOIIO_STATIC_DEFINE=1")
+endif ()
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
if (OSL_NO_DEFAULT_TEXTURESYSTEM)

View File

@@ -1,12 +1,13 @@
diff -Naur orig/Makefile external_pthreads/Makefile
--- orig/Makefile 2018-08-08 04:47:40 -0600
+++ external_pthreads/Makefile 2020-05-09 11:20:28 -0600
@@ -185,7 +185,7 @@
@ $(MAKE) /E /nologo XCFLAGS="/MTd" EHFLAGS="$(VSEFLAGSD) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_SEH pthreadVSE$(PTW32_VER_DEBUG).inlined_static_stamp
--- pthread.h.orig 2012-05-26 22:16:45 -0600
+++ pthread.h 2016-04-01 09:20:36 -0600
@@ -109,6 +109,10 @@
/* Include everything */
#endif
VC-static:
- @ $(MAKE) /E /nologo XCFLAGS="/MT" EHFLAGS="$(VCFLAGS) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_C pthreadVC$(PTW32_VER).inlined_static_stamp
+ @ $(MAKE) /E /nologo XCFLAGS="/MD" EHFLAGS="$(VCFLAGS) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_C pthreadVC$(PTW32_VER).inlined_static_stamp
VC-static-debug:
@ $(MAKE) /E /nologo XCFLAGS="/MTd" EHFLAGS="$(VCFLAGSD) /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED" CLEANUP=__PTW32_CLEANUP_C pthreadVC$(PTW32_VER_DEBUG).inlined_static_stamp
+#if _MSC_VER >= 1900
+# define HAVE_STRUCT_TIMESPEC 1
+#endif
+
#if defined(_UWIN)
# define HAVE_STRUCT_TIMESPEC 1
# define HAVE_SIGNAL_H 1

View File

@@ -1,3 +1,14 @@
diff -x .git -ur usd.orig/cmake/defaults/Options.cmake external_usd/cmake/defaults/Options.cmake
--- usd.orig/cmake/defaults/Options.cmake 2019-10-24 22:39:53.000000000 +0200
+++ external_usd/cmake/defaults/Options.cmake 2019-11-28 13:00:33.197957712 +0100
@@ -25,6 +25,7 @@
option(PXR_VALIDATE_GENERATED_CODE "Validate script generated code" OFF)
option(PXR_HEADLESS_TEST_MODE "Disallow GUI based tests, useful for running under headless CI systems." OFF)
option(PXR_BUILD_TESTS "Build tests" ON)
+option(PXR_BUILD_USD_TOOLS "Build commandline tools" ON)
option(PXR_BUILD_IMAGING "Build imaging components" ON)
option(PXR_BUILD_EMBREE_PLUGIN "Build embree imaging plugin" OFF)
option(PXR_BUILD_OPENIMAGEIO_PLUGIN "Build OpenImageIO plugin" OFF)
diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defaults/Packages.cmake
--- usd.orig/cmake/defaults/Packages.cmake 2019-10-24 22:39:53.000000000 +0200
+++ external_usd/cmake/defaults/Packages.cmake 2019-11-28 13:00:33.185957483 +0100
@@ -10,11 +21,11 @@ diff -x .git -ur usd.orig/cmake/defaults/Packages.cmake external_usd/cmake/defau
add_definitions(${TBB_DEFINITIONS})
# --math
diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plug/initConfig.cpp
--- usd.orig/pxr/base/plug/initConfig.cpp.orig 2020-06-12 17:20:07.478199779 +0200
+++ external_usd/pxr/base/plug/initConfig.cpp 2020-06-12 17:25:28.648588552 +0200
@@ -69,10 +69,40 @@
diff -x .git -ur usd.orig/pxr/base/lib/plug/initConfig.cpp external_usd/pxr/base/lib/plug/initConfig.cpp
--- usd.orig/pxr/base/lib/plug/initConfig.cpp 2019-10-24 22:39:53.000000000 +0200
+++ external_usd/pxr/base/lib/plug/initConfig.cpp 2019-12-11 11:00:37.643323127 +0100
@@ -69,8 +69,38 @@
ARCH_CONSTRUCTOR(Plug_InitConfig, 2, void)
{
+ /* The contents of this constructor have been moved to usd_initialise_plugin_path(...) */
@@ -39,9 +50,7 @@ diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plu
+usd_initialise_plugin_path(const char *datafiles_usd_path)
+{
std::vector<std::string> result;
std::vector<std::string> debugMessages;
+ // Add Blender-specific paths. They MUST end in a slash, or symlinks will not be treated as directory.
+ if (datafiles_usd_path != NULL && datafiles_usd_path[0] != '\0') {
+ std::string datafiles_usd_path_str(datafiles_usd_path);
@@ -51,14 +60,14 @@ diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plu
+ result.push_back(datafiles_usd_path_str);
+ }
+
// Determine the absolute path to the Plug shared library. Any relative
// paths specified in the plugin search path will be anchored to this
// directory, to allow for relocatability. Note that this can fail when pxr
@@ -114,9 +144,24 @@
_AppendPathList(&result, installLocation, binaryPath);
// Determine the absolute path to the Plug shared library.
// Any relative paths specified in the plugin search path will be
// anchored to this directory, to allow for relocatability.
@@ -94,9 +124,24 @@
_AppendPathList(&result, installLocation, sharedLibPath);
#endif // PXR_INSTALL_LOCATION
- Plug_SetPaths(result, debugMessages);
- Plug_SetPaths(result);
-}
+ if (!TfGetenv("PXR_PATH_DEBUG").empty()) {
+ printf("USD Plugin paths: (%zu in total):\n", result.size());
@@ -66,10 +75,10 @@ diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plu
+ printf(" %s\n", path.c_str());
+ }
+ }
+ Plug_SetPaths(result, debugMessages);
+ Plug_SetPaths(result);
}
PXR_NAMESPACE_CLOSE_SCOPE
+
+/* Workaround to make it possible to pass a path at runtime to USD. */
@@ -81,6 +90,37 @@ diff -x .git -ur usd.orig/pxr/base/plug/initConfig.cpp external_usd/pxr/base/plu
+ PXR_NS::usd_initialise_plugin_path(datafiles_usd_path);
+}
+}
diff -x .git -ur usd.orig/pxr/usd/CMakeLists.txt external_usd/pxr/usd/CMakeLists.txt
--- usd.orig/pxr/usd/CMakeLists.txt 2019-10-24 22:39:53.000000000 +0200
+++ external_usd/pxr/usd/CMakeLists.txt 2019-11-28 13:00:33.197957712 +0100
@@ -1,6 +1,5 @@
set(DIRS
lib
- bin
plugin
)
@@ -8,3 +7,8 @@
add_subdirectory(${d})
endforeach()
+if (PXR_BUILD_USD_TOOLS)
+ add_subdirectory(bin)
+else()
+ message(STATUS "Skipping commandline tools because PXR_BUILD_USD_TOOLS=OFF")
+endif()
diff -Naur external_usd_orig/pxr/base/lib/tf/preprocessorUtils.h external_usd/pxr/base/lib/tf/preprocessorUtils.h
--- external_usd_orig/pxr/base/lib/tf/preprocessorUtils.h 2019-10-24 14:39:53 -0600
+++ external_usd/pxr/base/lib/tf/preprocessorUtils.h 2020-01-14 09:30:18 -0700
@@ -189,7 +189,7 @@
/// Exapnds to 1 if the argument is a tuple, and 0 otherwise.
/// \ingroup group_tf_Preprocessor
/// \hideinitializer
-#if defined(ARCH_OS_WINDOWS)
+#if defined(ARCH_COMPILER_MSVC)
#define TF_PP_IS_TUPLE(sequence) \
BOOST_VMD_IS_TUPLE(sequence)
#else
diff -Naur external_usd_base/cmake/macros/Public.cmake external_usd/cmake/macros/Public.cmake
--- external_usd_base/cmake/macros/Public.cmake 2019-10-24 14:39:53 -0600
+++ external_usd/cmake/macros/Public.cmake 2020-01-11 13:33:29 -0700

View File

@@ -0,0 +1,22 @@
--- x264-snapshot-20180811-2245-stable\configure 2018-08-11 14:45:05 -0600
+++ external_x264\configure 2018-08-11 23:51:35 -0600
@@ -396,7 +396,7 @@
# list of all preprocessor HAVE values we can define
CONFIG_HAVE="MALLOC_H ALTIVEC ALTIVEC_H MMX ARMV6 ARMV6T2 NEON BEOSTHREAD POSIXTHREAD WIN32THREAD THREAD LOG2F SWSCALE \
LAVF FFMS GPAC AVS GPL VECTOREXT INTERLACED CPU_COUNT OPENCL THP LSMASH X86_INLINE_ASM AS_FUNC INTEL_DISPATCHER \
- MSA MMAP WINRT VSX ARM_INLINE_ASM STRTOK_R BITDEPTH8 BITDEPTH10"
+ MSA MMAP WINRT VSX ARM_INLINE_ASM BITDEPTH8 BITDEPTH10"
# parse options
@@ -1071,10 +1071,6 @@
define HAVE_LOG2F
fi
-if cc_check 'string.h' '' 'strtok_r(0, 0, 0);' ; then
- define HAVE_STRTOK_R
-fi
-
if [ "$SYS" != "WINDOWS" ] && cpp_check "sys/mman.h unistd.h" "" "defined(MAP_PRIVATE)"; then
define HAVE_MMAP
fi

View File

@@ -8,7 +8,7 @@ Code signing is done as part of INSTALL target, which makes it possible to sign
files which are aimed into a bundle and coming from a non-signed source (such as
libraries SVN).
This is achieved by specifying `worker_codesign.cmake` as a post-install script
This is achieved by specifying `slave_codesign.cmake` as a post-install script
run by CMake. This CMake script simply involves an utility script written in
Python which takes care of an actual signing.

View File

@@ -40,8 +40,8 @@ class Builder:
# Buildbot runs from build/ directory
self.blender_dir = os.path.abspath(os.path.join('..', 'blender.git'))
self.build_dir = os.path.abspath(os.path.join('..', 'build'))
self.install_dir = os.path.abspath(os.path.join('..', 'install'))
self.build_dir = os.path.abspath(os.path.join('..', 'build', name))
self.install_dir = os.path.abspath(os.path.join('..', 'install', name))
self.upload_dir = os.path.abspath(os.path.join('..', 'install'))
# Detect platform
@@ -51,7 +51,7 @@ class Builder:
elif name.startswith('linux'):
self.platform = 'linux'
if is_tool('scl'):
self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
self.command_prefix = ['scl', 'enable', 'devtoolset-6', '--']
else:
self.command_prefix = []
elif name.startswith('win'):
@@ -78,26 +78,27 @@ class VersionInfo:
blender_h = os.path.join(builder.blender_dir, "source", "blender", "blenkernel", "BKE_blender_version.h")
version_number = int(self._parse_header_file(blender_h, 'BLENDER_VERSION'))
version_number_patch = int(self._parse_header_file(blender_h, 'BLENDER_VERSION_PATCH'))
version_numbers = (version_number // 100, version_number % 100, version_number_patch)
self.short_version = "%d.%02d" % (version_numbers[0], version_numbers[1])
self.version = "%d.%02d.%d" % version_numbers
self.version = "%d.%d" % (version_number // 100, version_number % 100)
self.version_char = self._parse_header_file(blender_h, 'BLENDER_VERSION_CHAR')
self.version_cycle = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE')
self.version_cycle_number = self._parse_header_file(blender_h, 'BLENDER_VERSION_CYCLE_NUMBER')
self.hash = self._parse_header_file(buildinfo_h, 'BUILD_HASH')[1:-1]
if self.version_cycle == "release":
# Final release
self.full_version = self.version
self.full_version = self.version + self.version_char
self.is_development_build = False
elif self.version_cycle == "rc":
# Release candidate
version_cycle = self.version_cycle + self.version_cycle_number
self.full_version = self.version + version_cycle
if len(self.version_char) == 0:
self.full_version = self.version + version_cycle
else:
self.full_version = self.version + self.version_char + '-' + version_cycle
self.is_development_build = False
else:
# Development build
self.full_version = self.version + '-' + self.hash
self.full_version = self.version + self.version_char + '-' + self.hash
self.is_development_build = True
def _parse_header_file(self, filename, define):

View File

@@ -48,7 +48,6 @@ import shutil
import subprocess
import time
import tarfile
import uuid
from pathlib import Path
from tempfile import TemporaryDirectory
@@ -122,10 +121,21 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
# Consider this an input of the code signing server.
unsigned_storage_dir: Path
# Information about archive which contains files which are to be signed.
#
# This archive is created by the buildbot worked and acts as an input for
# the code signing server.
unsigned_archive_info: ArchiveWithIndicator
# Storage where signed files are stored.
# Consider this an output of the code signer server.
signed_storage_dir: Path
# Information about archive which contains signed files.
#
# This archive is created by the code signing server.
signed_archive_info: ArchiveWithIndicator
# Platform the code is currently executing on.
platform: util.Platform
@@ -136,44 +146,50 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
# Unsigned (signing server input) configuration.
self.unsigned_storage_dir = absolute_shared_storage_dir / 'unsigned'
self.unsigned_archive_info = ArchiveWithIndicator(
self.unsigned_storage_dir, 'unsigned_files.tar', 'ready.stamp')
# Signed (signing server output) configuration.
self.signed_storage_dir = absolute_shared_storage_dir / 'signed'
self.signed_archive_info = ArchiveWithIndicator(
self.signed_storage_dir, 'signed_files.tar', 'ready.stamp')
self.platform = util.get_current_platform()
"""
General note on cleanup environment functions.
It is expected that there is only one instance of the code signer server
running for a given input/output directory, and that it serves a single
buildbot worker.
By its nature, a buildbot worker only produces one build at a time and
never performs concurrent builds.
This leads to a conclusion that when starting in a clean environment
there shouldn't be any archives remaining from a previous build.
However, it is possible to have various failure scenarios which might
leave the environment in a non-clean state:
- Network hiccup which makes buildbot worker to stop current build
and re-start it after connection to server is re-established.
Note, this could also happen during buildbot server maintenance.
- Signing server might get restarted due to updates or other reasons.
Requiring manual interaction in such cases is not something good to
require, so here we simply assume that the system is used the way it is
intended to and restore environment to a prestine clean state.
"""
def cleanup_environment_for_builder(self) -> None:
# TODO(sergey): Revisit need of cleaning up the existing files.
# In practice it wasn't so helpful, and with multiple clients
# talking to the same server it becomes even mor etricky.
pass
self.unsigned_archive_info.clean()
self.signed_archive_info.clean()
def cleanup_environment_for_signing_server(self) -> None:
# TODO(sergey): Revisit need of cleaning up the existing files.
# In practice it wasn't so helpful, and with multiple clients
# talking to the same server it becomes even mor etricky.
pass
def generate_request_id(self) -> str:
"""
Generate an unique identifier for code signing request.
"""
return str(uuid.uuid4())
def archive_info_for_request_id(
self, path: Path, request_id: str) -> ArchiveWithIndicator:
return ArchiveWithIndicator(
path, f'{request_id}.tar', f'{request_id}.ready')
def signed_archive_info_for_request_id(
self, request_id: str) -> ArchiveWithIndicator:
return self.archive_info_for_request_id(
self.signed_storage_dir, request_id)
def unsigned_archive_info_for_request_id(
self, request_id: str) -> ArchiveWithIndicator:
return self.archive_info_for_request_id(
self.unsigned_storage_dir, request_id)
# Don't clear the requested to-be-signed archive since we might be
# restarting signing machine while the buildbot is busy.
self.signed_archive_info.clean()
############################################################################
# Buildbot worker side helpers.
@@ -216,7 +232,7 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
if self.check_file_is_to_be_signed(file)]
return files_to_be_signed
def wait_for_signed_archive_or_die(self, request_id) -> None:
def wait_for_signed_archive_or_die(self) -> None:
"""
Wait until archive with signed files is available.
@@ -224,19 +240,13 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
is still no responce from the signing server the application will exit
with a non-zero exit code.
"""
signed_archive_info = self.signed_archive_info_for_request_id(
request_id)
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
request_id)
timeout_in_seconds = self.config.TIMEOUT_IN_SECONDS
time_start = time.monotonic()
while not signed_archive_info.is_ready():
while not self.signed_archive_info.is_ready():
time.sleep(1)
time_slept_in_seconds = time.monotonic() - time_start
if time_slept_in_seconds > timeout_in_seconds:
unsigned_archive_info.clean()
self.unsigned_archive_info.clean()
raise SystemExit("Signing server didn't finish signing in "
f"{timeout_in_seconds} seconds, dying :(")
@@ -293,19 +303,13 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
return
logger_builder.info('Found %d files to sign.', len(files))
request_id = self.generate_request_id()
signed_archive_info = self.signed_archive_info_for_request_id(
request_id)
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
request_id)
pack_files(files=files,
archive_filepath=unsigned_archive_info.archive_filepath)
unsigned_archive_info.tag_ready()
archive_filepath=self.unsigned_archive_info.archive_filepath)
self.unsigned_archive_info.tag_ready()
# Wait for the signing server to finish signing.
logger_builder.info('Waiting signing server to sign the files...')
self.wait_for_signed_archive_or_die(request_id)
self.wait_for_signed_archive_or_die()
# Extract signed files from archive and move files to final location.
with TemporaryDirectory(prefix='blender-buildbot-') as temp_dir_str:
@@ -313,7 +317,7 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
logger_builder.info('Extracting signed files from archive...')
extract_files(
archive_filepath=signed_archive_info.archive_filepath,
archive_filepath=self.signed_archive_info.archive_filepath,
extraction_dir=unpacked_signed_files_dir)
destination_dir = path
@@ -323,44 +327,19 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
unpacked_signed_files_dir, destination_dir)
logger_builder.info('Removing archive with signed files...')
signed_archive_info.clean()
self.signed_archive_info.clean()
############################################################################
# Signing server side helpers.
def wait_for_sign_request(self) -> str:
def wait_for_sign_request(self) -> None:
"""
Wait for the buildbot to request signing of an archive.
Returns an identifier of signing request.
"""
# TOOD(sergey): Support graceful shutdown on Ctrl-C.
logger_server.info(
f'Waiting for a request directory {self.unsigned_storage_dir} to appear.')
while not self.unsigned_storage_dir.exists():
while not self.unsigned_archive_info.is_ready():
time.sleep(1)
logger_server.info(
'Waiting for a READY indicator of any signing request.')
request_id = None
while request_id is None:
for file in self.unsigned_storage_dir.iterdir():
if file.suffix != '.ready':
continue
request_id = file.stem
logger_server.info(f'Found READY for request ID {request_id}.')
if request_id is None:
time.sleep(1)
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
request_id)
while not unsigned_archive_info.is_ready():
time.sleep(1)
return request_id
@abc.abstractmethod
def sign_all_files(self, files: List[AbsoluteAndRelativeFileName]) -> None:
"""
@@ -369,7 +348,7 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
NOTE: Signing should happen in-place.
"""
def run_signing_pipeline(self, request_id: str):
def run_signing_pipeline(self):
"""
Run the full signing pipeline starting from the point when buildbot
worker have requested signing.
@@ -381,14 +360,9 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
with TemporaryDirectory(prefix='blender-codesign-') as temp_dir_str:
temp_dir = Path(temp_dir_str)
signed_archive_info = self.signed_archive_info_for_request_id(
request_id)
unsigned_archive_info = self.unsigned_archive_info_for_request_id(
request_id)
logger_server.info('Extracting unsigned files from archive...')
extract_files(
archive_filepath=unsigned_archive_info.archive_filepath,
archive_filepath=self.unsigned_archive_info.archive_filepath,
extraction_dir=temp_dir)
logger_server.info('Collecting all files which needs signing...')
@@ -400,11 +374,11 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
logger_server.info('Packing signed files...')
pack_files(files=files,
archive_filepath=signed_archive_info.archive_filepath)
signed_archive_info.tag_ready()
archive_filepath=self.signed_archive_info.archive_filepath)
self.signed_archive_info.tag_ready()
logger_server.info('Removing signing request...')
unsigned_archive_info.clean()
self.unsigned_archive_info.clean()
logger_server.info('Signing is complete.')
@@ -415,11 +389,11 @@ class BaseCodeSigner(metaclass=abc.ABCMeta):
while True:
logger_server.info('Waiting for the signing request in %s...',
self.unsigned_storage_dir)
request_id = self.wait_for_sign_request()
self.wait_for_sign_request()
logger_server.info(
f'Beging signign procedure for request ID {request_id}.')
self.run_signing_pipeline(request_id)
'Got signing request, beging signign procedure.')
self.run_signing_pipeline()
############################################################################
# Command executing.

View File

@@ -30,7 +30,7 @@ from tempfile import TemporaryDirectory, NamedTemporaryFile
from typing import List
BUILDBOT_DIRECTORY = Path(__file__).absolute().parent
CODESIGN_SCRIPT = BUILDBOT_DIRECTORY / 'worker_codesign.py'
CODESIGN_SCRIPT = BUILDBOT_DIRECTORY / 'slave_codesign.py'
BLENDER_GIT_ROOT_DIRECTORY = BUILDBOT_DIRECTORY.parent.parent
DARWIN_DIRECTORY = BLENDER_GIT_ROOT_DIRECTORY / 'release' / 'darwin'

View File

@@ -33,7 +33,7 @@ else()
endif()
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/worker_codesign.py"
COMMAND ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/slave_codesign.py"
"${CMAKE_INSTALL_PREFIX}"
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
RESULT_VARIABLE exit_code

View File

@@ -25,7 +25,7 @@ import buildbot_utils
def get_cmake_options(builder):
post_install_script = os.path.join(
builder.blender_dir, 'build_files', 'buildbot', 'worker_codesign.cmake')
builder.blender_dir, 'build_files', 'buildbot', 'slave_codesign.cmake')
config_file = "build_files/cmake/config/blender_release.cmake"
options = ['-DCMAKE_BUILD_TYPE:STRING=Release',
@@ -35,7 +35,7 @@ def get_cmake_options(builder):
options.append('-DCMAKE_OSX_ARCHITECTURES:STRING=x86_64')
options.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9')
elif builder.platform == 'win':
options.extend(['-G', 'Visual Studio 16 2019', '-A', 'x64'])
options.extend(['-G', 'Visual Studio 15 2017 Win64'])
options.extend(['-DPOSTINSTALL_SCRIPT:PATH=' + post_install_script])
elif builder.platform == 'linux':
config_file = "build_files/buildbot/config/blender_linux.cmake"

View File

@@ -18,7 +18,7 @@
# <pep8 compliant>
# Runs on buildbot worker, creating a release package using the build
# Runs on buildbot slave, creating a release package using the build
# system and zipping it into buildbot_upload.zip. This is then uploaded
# to the master in the next buildbot step.
@@ -110,7 +110,7 @@ def pack_mac(builder):
release_dir = os.path.join(builder.blender_dir, 'release', 'darwin')
buildbot_dir = os.path.join(builder.blender_dir, 'build_files', 'buildbot')
bundle_script = os.path.join(buildbot_dir, 'worker_bundle_dmg.py')
bundle_script = os.path.join(buildbot_dir, 'slave_bundle_dmg.py')
command = [bundle_script]
command += ['--dmg', package_filepath]
@@ -167,7 +167,7 @@ def pack_linux(builder):
buildbot_utils.call(builder.command_prefix + ['strip', '--strip-all', blender_executable])
print("Stripping python...")
py_target = os.path.join(builder.install_dir, info.short_version)
py_target = os.path.join(builder.install_dir, info.version)
buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
# Construct package name

View File

@@ -16,24 +16,22 @@
#
# ##### END GPL LICENSE BLOCK #####
import bpy
# <pep8 compliant>
class NewSimulation(bpy.types.Operator):
"""Create a new simulation data block and edit it in the opened simulation editor"""
# Runs on buildbot slave, rsync zip directly to buildbot server rather
# than using upload which is much slower
bl_idname = "simulation.new"
bl_label = "New Simulation"
bl_options = {'REGISTER', 'UNDO'}
import buildbot_utils
import os
import sys
@classmethod
def poll(cls, context):
return context.area.type == 'NODE_EDITOR' and context.space_data.tree_type == 'SimulationNodeTree'
if __name__ == "__main__":
builder = buildbot_utils.create_builder_from_arguments()
def execute(self, context):
simulation = bpy.data.simulations.new("Simulation")
context.space_data.simulation = simulation
return {'FINISHED'}
# rsync, this assumes ssh keys are setup so no password is needed
local_zip = "buildbot_upload.zip"
remote_folder = "builder.blender.org:/data/buildbot-master/uploaded/"
remote_zip = remote_folder + "buildbot_upload_" + builder.name + ".zip"
classes = (
NewSimulation,
)
command = ["rsync", "-avz", local_zip, remote_zip]
buildbot_utils.call(command)

View File

@@ -0,0 +1,65 @@
# - Find HDF5 library
# Find the native HDF5 includes and libraries
# This module defines
# HDF5_INCLUDE_DIRS, where to find hdf5.h, Set when HDF5_INCLUDE_DIR is found.
# HDF5_LIBRARIES, libraries to link against to use HDF5.
# HDF5_ROOT_DIR, The base directory to search for HDF5.
# This can also be an environment variable.
# HDF5_FOUND, If false, do not try to use HDF5.
#
#=============================================================================
# Copyright 2016 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If HDF5_ROOT_DIR was defined in the environment, use it.
IF(NOT HDF5_ROOT_DIR AND NOT $ENV{HDF5_ROOT_DIR} STREQUAL "")
SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR})
ENDIF()
SET(_hdf5_SEARCH_DIRS
${HDF5_ROOT_DIR}
/opt/lib/hdf5
)
FIND_LIBRARY(HDF5_LIBRARY
NAMES
hdf5
HINTS
${_hdf5_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
FIND_PATH(HDF5_INCLUDE_DIR
NAMES
hdf5.h
HINTS
${_hdf5_SEARCH_DIRS}
PATH_SUFFIXES
include
)
# handle the QUIETLY and REQUIRED arguments and set HDF5_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HDF5 DEFAULT_MSG HDF5_LIBRARY HDF5_INCLUDE_DIR)
IF(HDF5_FOUND)
SET(HDF5_LIBRARIES ${HDF5_LIBRARY})
SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
ENDIF(HDF5_FOUND)
MARK_AS_ADVANCED(
HDF5_INCLUDE_DIR
HDF5_LIBRARY
)
UNSET(_hdf5_SEARCH_DIRS)

View File

@@ -49,6 +49,7 @@ if(NOT LLVM_ROOT_DIR)
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_ROOT_DIR ${LLVM_ROOT_DIR} CACHE PATH "Path to the LLVM installation")
set(LLVM_INCLUDE_DIRS ${LLVM_ROOT_DIR}/include CACHE PATH "Path to the LLVM include directory")
endif()
if(NOT LLVM_LIBPATH)
execute_process(COMMAND ${LLVM_CONFIG} --libdir

View File

@@ -104,7 +104,6 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}-${_openexr_libs_ver} ${COMPONENT}
NAMES_PER_DIR
HINTS
${_openexr_SEARCH_DIRS}
PATH_SUFFIXES

View File

@@ -48,14 +48,7 @@ SET(_openimagedenoise_FIND_COMPONENTS
# These are needed when building statically
SET(_openimagedenoise_FIND_STATIC_COMPONENTS
common
# These additional library names change between versions, we list all of them
# so builds work with multiple versions. Missing libraries are skipped.
dnnl_cpu
dnnl_common
dnnl_cpu # Second time because of circular dependency
mkldnn
dnnl
)
SET(_openimagedenoise_LIBRARIES)

View File

@@ -43,7 +43,6 @@ FIND_PATH(USD_INCLUDE_DIR
FIND_LIBRARY(USD_LIBRARY
NAMES
usd_m usd_ms
NAMES_PER_DIR
HINTS
${_usd_SEARCH_DIRS}
PATH_SUFFIXES

View File

@@ -66,9 +66,6 @@ macro(BLENDER_SRC_GTEST_EX)
if(UNIX AND NOT APPLE)
target_link_libraries(${TARGET_NAME} bf_intern_libc_compat)
endif()
if(WITH_TBB)
target_link_libraries(${TARGET_NAME} ${TBB_LIBRARIES})
endif()
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(GENERATOR_IS_MULTI_CONFIG)

View File

@@ -11,7 +11,6 @@ set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_EMBREE 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)

View File

@@ -15,7 +15,6 @@ set(WITH_CODEC_AVI OFF CACHE BOOL "" FORCE)
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_EMBREE OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_OSL OFF CACHE BOOL "" FORCE)
set(WITH_CYCLES_DEVICE_OPTIX OFF CACHE BOOL "" FORCE)
set(WITH_DRACO OFF CACHE BOOL "" FORCE)
@@ -53,7 +52,6 @@ set(WITH_OPENVDB OFF CACHE BOOL "" FORCE)
set(WITH_QUADRIFLOW OFF CACHE BOOL "" FORCE)
set(WITH_SDL OFF CACHE BOOL "" FORCE)
set(WITH_TBB OFF CACHE BOOL "" FORCE)
set(WITH_USD OFF CACHE BOOL "" FORCE)
if(UNIX AND NOT APPLE)
set(WITH_GHOST_XDND OFF CACHE BOOL "" FORCE)

View File

@@ -12,7 +12,6 @@ set(WITH_CODEC_AVI ON CACHE BOOL "" FORCE)
set(WITH_CODEC_FFMPEG ON CACHE BOOL "" FORCE)
set(WITH_CODEC_SNDFILE ON CACHE BOOL "" FORCE)
set(WITH_CYCLES ON CACHE BOOL "" FORCE)
set(WITH_CYCLES_EMBREE 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)

View File

@@ -437,14 +437,7 @@ function(SETUP_LIBDIRS)
if(WITH_ALEMBIC)
link_directories(${ALEMBIC_LIBPATH})
endif()
if(WITH_GHOST_WAYLAND)
link_directories(
${wayland-client_LIBRARY_DIRS}
${wayland-egl_LIBRARY_DIRS}
${xkbcommon_LIBRARY_DIRS}
${wayland-cursor_LIBRARY_DIRS})
link_directories(${HDF5_LIBPATH})
endif()
if(WIN32 AND NOT UNIX)
@@ -755,7 +748,8 @@ function(get_blender_version)
# - BLENDER_VERSION (major.minor)
# - BLENDER_VERSION_MAJOR
# - BLENDER_VERSION_MINOR
# - BLENDER_VERSION_PATCH
# - BLENDER_SUBVERSION (used for internal versioning mainly)
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
# So cmake depends on BKE_blender.h, beware of inf-loops!
@@ -765,15 +759,25 @@ function(get_blender_version)
file(STRINGS ${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender_version.h _contents REGEX "^#define[ \t]+BLENDER_.*$")
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION[ \t]+([0-9]+).*" "\\1" _out_version "${_contents}")
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_PATCH[ \t]+([0-9]+).*" "\\1" _out_version_patch "${_contents}")
string(REGEX REPLACE ".*#define[ \t]+BLENDER_SUBVERSION[ \t]+([0-9]+).*" "\\1" _out_subversion "${_contents}")
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CHAR[ \t]+([a-z]+).*" "\\1" _out_version_char "${_contents}")
string(REGEX REPLACE ".*#define[ \t]+BLENDER_VERSION_CYCLE[ \t]+([a-z]+).*" "\\1" _out_version_cycle "${_contents}")
if(NOT ${_out_version} MATCHES "[0-9]+")
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION")
endif()
if(NOT ${_out_version_patch} MATCHES "[0-9]+")
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_PATCH")
if(NOT ${_out_subversion} MATCHES "[0-9]+")
message(FATAL_ERROR "Version parsing failed for BLENDER_SUBVERSION")
endif()
# clumsy regex, only single char are ok but it could be unset
string(LENGTH "${_out_version_char}" _out_version_char_len)
if(NOT _out_version_char_len EQUAL 1)
set(_out_version_char "")
elseif(NOT ${_out_version_char} MATCHES "[a-z]+")
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CHAR")
endif()
if(NOT ${_out_version_cycle} MATCHES "[a-z]+")
@@ -783,11 +787,23 @@ function(get_blender_version)
math(EXPR _out_version_major "${_out_version} / 100")
math(EXPR _out_version_minor "${_out_version} % 100")
# for packaging, alpha to numbers
string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty)
if(${_out_version_char_empty})
set(_out_version_char_index "0")
else()
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
list(FIND _char_ls ${_out_version_char} _out_version_char_index)
math(EXPR _out_version_char_index "${_out_version_char_index} + 1")
endif()
# output vars
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
set(BLENDER_VERSION_PATCH "${_out_version_patch}" PARENT_SCOPE)
set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
endfunction()

View File

@@ -7,7 +7,7 @@ set(PROJECT_VENDOR "Blender Foundation")
set(MAJOR_VERSION ${BLENDER_VERSION_MAJOR})
set(MINOR_VERSION ${BLENDER_VERSION_MINOR})
set(PATCH_VERSION ${BLENDER_VERSION_PATCH})
set(PATCH_VERSION ${BLENDER_VERSION_CHAR_INDEX})
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
set(CPACK_PACKAGE_DESCRIPTION ${PROJECT_DESCRIPTION})

View File

@@ -57,7 +57,6 @@ if(EXISTS ${LIBDIR})
set(BOOST_ROOT ${LIBDIR}/boost)
set(BOOST_LIBRARYDIR ${LIBDIR}/boost/lib)
set(Boost_NO_SYSTEM_PATHS ON)
set(OPENEXR_ROOT_DIR ${LIBDIR}/openexr)
endif()
if(WITH_STATIC_LIBS)
@@ -265,8 +264,14 @@ endif()
if(WITH_ALEMBIC)
find_package_wrapper(Alembic)
if(NOT ALEMBIC_FOUND)
if(WITH_ALEMBIC_HDF5)
set(HDF5_ROOT_DIR ${LIBDIR}/hdf5)
find_package_wrapper(HDF5)
endif()
if(NOT ALEMBIC_FOUND OR (WITH_ALEMBIC_HDF5 AND NOT HDF5_FOUND))
set(WITH_ALEMBIC OFF)
set(WITH_ALEMBIC_HDF5 OFF)
endif()
endif()
@@ -499,27 +504,7 @@ if(WITH_SYSTEM_AUDASPACE)
endif()
endif()
if(WITH_GHOST_WAYLAND)
find_package(PkgConfig)
pkg_check_modules(wayland-client REQUIRED wayland-client>=1.12)
pkg_check_modules(wayland-egl REQUIRED wayland-egl)
pkg_check_modules(wayland-scanner REQUIRED wayland-scanner)
pkg_check_modules(xkbcommon REQUIRED xkbcommon)
pkg_check_modules(wayland-cursor REQUIRED wayland-cursor)
set(WITH_GL_EGL ON)
if(WITH_GHOST_WAYLAND)
list(APPEND PLATFORM_LINKLIBS
${wayland-client_LIBRARIES}
${wayland-egl_LIBRARIES}
${xkbcommon_LIBRARIES}
${wayland-cursor_LIBRARIES}
)
endif()
endif()
if(WITH_GHOST_X11)
if(WITH_X11)
find_package(X11 REQUIRED)
find_path(X11_XF86keysym_INCLUDE_PATH X11/XF86keysym.h ${X11_INC_SEARCH_PATH})
@@ -590,19 +575,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
unset(LD_VERSION)
endif()
if(WITH_LINKER_LLD)
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=lld -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if("${LD_VERSION}" MATCHES "LLD")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
else()
message(STATUS "LLD linker isn't available, using the default system linker.")
endif()
unset(LD_VERSION)
endif()
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")

View File

@@ -51,10 +51,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} \"${CLANG_OPENMP_LIB}\"")
endif()
if(WITH_WINDOWS_STRIPPED_PDB)
message(WARNING "stripped pdb not supported with clang, disabling..")
set(WITH_WINDOWS_STRIPPED_PDB Off)
endif()
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ${WINDOWS_USE_VISUAL_STUDIO_PROJECT_FOLDERS})
@@ -111,13 +107,12 @@ endif()
unset(_min_ver)
# needed for some MSVC installations
# 4099 : PDB 'filename' was not found with 'object/library'
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO /ignore:4099")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO /ignore:4099")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO /ignore:4099")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32 version
ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32
advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp Shlwapi
)
@@ -139,12 +134,7 @@ add_definitions(-D_ALLOW_KEYWORD_MACROS)
# We want to support Windows 7 level ABI
add_definitions(-D_WIN32_WINNT=0x601)
include(build_files/cmake/platform/platform_win32_bundle_crt.cmake)
remove_cc_flag("/MDd" "/MD" "/Zi")
if(WITH_WINDOWS_PDB)
set(PDB_INFO_OVERRIDE_FLAGS "/Z7")
set(PDB_INFO_OVERRIDE_LINKER_FLAGS "/DEBUG /OPT:REF /OPT:ICF /INCREMENTAL:NO")
endif()
remove_cc_flag("/MDd" "/MD")
if(MSVC_CLANG) # Clangs version of cl doesn't support all flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARN_FLAGS} /nologo /J /Gd /EHsc -Wno-unused-command-line-argument -Wno-microsoft-enum-forward-reference ")
@@ -161,42 +151,27 @@ if(MSVC_VERSION GREATER 1911 AND NOT MSVC_CLANG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:twoPhase-")
endif()
if(WITH_WINDOWS_SCCACHE AND CMAKE_VS_MSBUILD_COMMAND)
message(WARNING "Disabling sccache, sccache is not supported with msbuild")
set(WITH_WINDOWS_SCCACHE Off)
endif()
if(WITH_WINDOWS_SCCACHE)
set(CMAKE_C_COMPILER_LAUNCHER sccache)
set(CMAKE_CXX_COMPILER_LAUNCHER sccache)
set(SYMBOL_FORMAT /Z7)
else()
unset(CMAKE_C_COMPILER_LAUNCHER)
unset(CMAKE_CXX_COMPILER_LAUNCHER)
set(SYMBOL_FORMAT /ZI)
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /ZI")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd /ZI")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd ${SYMBOL_FORMAT}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /MD ${PDB_INFO_OVERRIDE_FLAGS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MD ${SYMBOL_FORMAT}")
unset(SYMBOL_FORMAT)
# JMC is available on msvc 15.8 (1915) and up
if(MSVC_VERSION GREATER 1914 AND NOT MSVC_CLANG)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /JMC")
endif()
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /SUBSYSTEM:CONSOLE /STACK:2097152 /INCREMENTAL:NO ")
set(PLATFORM_LINKFLAGS_RELEASE "/NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
set(PLATFORM_LINKFLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG} /IGNORE:4099 /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcmtd.lib")
# Ignore meaningless for us linker warnings.
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /ignore:4049 /ignore:4217 /ignore:4221")
set(PLATFORM_LINKFLAGS_RELEASE "${PLATFORM_LINKFLAGS} ${PDB_INFO_OVERRIDE_LINKER_FLAGS}")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
if(CMAKE_CL_64)
@@ -234,7 +209,7 @@ 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 AND NOT WITH_WINDOWS_SCCACHE)
if(MSVC_VERSION GREATER_EQUAL 1914 AND NOT MSVC_CLANG)
add_compile_options(/experimental:external /external:templates- /external:I "${LIBDIR}" /external:W0)
endif()
@@ -478,7 +453,7 @@ if(WITH_OPENIMAGEIO)
set(OPENIMAGEIO_DEFINITIONS "-DUSE_TBB=0")
set(OPENCOLORIO_DEFINITIONS "-DOCIO_STATIC_BUILD")
set(OPENIMAGEIO_IDIFF "${OPENIMAGEIO}/bin/idiff.exe")
add_definitions(-DOIIO_STATIC_DEFINE)
add_definitions(-DOIIO_STATIC_BUILD)
add_definitions(-DOIIO_NO_SSE=1)
endif()
@@ -539,10 +514,10 @@ if(WITH_OPENIMAGEDENOISE)
set(OPENIMAGEDENOISE_LIBRARIES
optimized ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise.lib
optimized ${OPENIMAGEDENOISE_LIBPATH}/common.lib
optimized ${OPENIMAGEDENOISE_LIBPATH}/dnnl.lib
optimized ${OPENIMAGEDENOISE_LIBPATH}/mkldnn.lib
debug ${OPENIMAGEDENOISE_LIBPATH}/OpenImageDenoise_d.lib
debug ${OPENIMAGEDENOISE_LIBPATH}/common_d.lib
debug ${OPENIMAGEDENOISE_LIBPATH}/dnnl_d.lib)
debug ${OPENIMAGEDENOISE_LIBPATH}/mkldnn_d.lib)
set(OPENIMAGEDENOISE_DEFINITIONS)
endif()
@@ -597,7 +572,7 @@ if(WITH_SYSTEM_AUDASPACE)
endif()
if(WITH_TBB)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/debug/tbb_debug.lib)
set(TBB_LIBRARIES optimized ${LIBDIR}/tbb/lib/tbb.lib debug ${LIBDIR}/tbb/lib/tbb_debug.lib)
set(TBB_INCLUDE_DIR ${LIBDIR}/tbb/include)
set(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
if(WITH_TBB_MALLOC_PROXY)

View File

@@ -7,14 +7,15 @@ BASE_DIR="$PWD"
blender_srcdir=$(dirname -- $0)/../..
blender_version=$(grep "BLENDER_VERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_patch=$(grep "BLENDER_VERSION_PATCH\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h" | awk '{print $3}')
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100).$blender_version_patch
if [ "$blender_version_cycle" = "release" ] ; then
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)$blender_version_char
SUBMODULE_EXCLUDE="^\(release/scripts/addons_contrib\)$"
else
VERSION=$VERSION-$blender_version_cycle
VERSION=$(expr $blender_version / 100).$(expr $blender_version % 100)_$blender_subversion
SUBMODULE_EXCLUDE="^$" # dummy regex
fi

View File

@@ -2,11 +2,6 @@ set BUILD_GENERATOR_POST=
set BUILD_PLATFORM_SELECT=
set MSBUILD_PLATFORM=x64
if "%BUILD_WITH_SCCACHE%"=="1" (
echo sccache is only supported with ninja as the build system.
exit /b 1
)
if "%WITH_CLANG%"=="1" (
set CLANG_CMAKE_ARGS=-T"llvm"
if "%WITH_ASAN%"=="1" (

View File

@@ -6,13 +6,6 @@ if %ERRORLEVEL% NEQ 0 (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Ninja" %TESTS_CMAKE_ARGS% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%
if "%BUILD_WITH_SCCACHE%"=="1" (
set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -DWITH_WINDOWS_SCCACHE=On
if NOT "%verbose%" == "" (
echo Enabling sccache
)
)
if "%WITH_CLANG%" == "1" (
set LLVM_DIR=
for /F "usebackq skip=2 tokens=1-2*" %%A IN (`REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM" /ve 2^>nul`) DO set LLVM_DIR=%%C

View File

@@ -86,8 +86,6 @@ if NOT "%1" == "" (
set BUILD_UPDATE_ARGS="--no-libraries"
) else if "%1" == "ninja" (
SET BUILD_WITH_NINJA=1
) else if "%1" == "sccache" (
SET BUILD_WITH_SCCACHE=1
) else if "%1" == "clean" (
set MUST_CLEAN=1
) else if "%1" == "verbose" (

View File

@@ -30,4 +30,3 @@ set WITH_PYDEBUG=
set PYDEBUG_CMAKE_ARGS=
set FORMAT=
set TEST=
set BUILD_WITH_SCCACHE=

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = Blender
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = "V2.90"
PROJECT_NUMBER = "V2.83"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -51,7 +51,7 @@ PROJECT_BRIEF =
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
# the logo to the output directory.
PROJECT_LOGO = ../../release/freedesktop/icons/scalable/apps/blender.svg
PROJECT_LOGO = ../../release/freedesktop/icons/48x48/apps/blender.png
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
@@ -1720,7 +1720,7 @@ COMPACT_LATEX = NO
# The default value is: a4.
# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4
PAPER_TYPE = a4wide
# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
# that should be included in the LaTeX output. The package can be specified just

View File

@@ -119,24 +119,4 @@ Examples
To try these examples, just copy them into Blenders text editor and execute them.
To keep the examples relatively small, they just register a draw function that can't easily be removed anymore.
Blender has to be restarted in order to delete the draw handlers.
3D Lines with Single Color
--------------------------
"""
import bpy
import gpu
from gpu_extras.batch import batch_for_shader
coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)]
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'LINES', {"pos": coords})
def draw():
shader.bind()
shader.uniform_float("color", (1, 1, 0, 1))
batch.draw(shader)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

View File

@@ -1,65 +1,41 @@
"""
Custom Shader for dotted 3D Line
--------------------------------
Rendering the 3D View into a Texture
------------------------------------
In this example the arc length (distance to the first point on the line) is calculated in every vertex.
Between the vertex and fragment shader that value is automatically interpolated
for all points that will be visible on the screen.
In the fragment shader the ``sin`` of the arc length is calculated.
Based on the result a decision is made on whether the fragment should be drawn or not.
The scene has to have a camera for this example to work.
You could also make this independent of a specific camera,
but Blender does not expose good functions to create view and projection matrices yet.
"""
import bpy
import bgl
import gpu
from random import random
from mathutils import Vector
from gpu_extras.batch import batch_for_shader
from gpu_extras.presets import draw_texture_2d
vertex_shader = '''
uniform mat4 u_ViewProjectionMatrix;
WIDTH = 512
HEIGHT = 256
in vec3 position;
in float arcLength;
out float v_ArcLength;
void main()
{
v_ArcLength = arcLength;
gl_Position = u_ViewProjectionMatrix * vec4(position, 1.0f);
}
'''
fragment_shader = '''
uniform float u_Scale;
in float v_ArcLength;
void main()
{
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
gl_FragColor = vec4(1.0);
}
'''
coords = [Vector((random(), random(), random())) * 5 for _ in range(5)]
arc_lengths = [0]
for a, b in zip(coords[:-1], coords[1:]):
arc_lengths.append(arc_lengths[-1] + (a - b).length)
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(
shader, 'LINE_STRIP',
{"position": coords, "arcLength": arc_lengths},
)
offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
def draw():
shader.bind()
matrix = bpy.context.region_data.perspective_matrix
shader.uniform_float("u_ViewProjectionMatrix", matrix)
shader.uniform_float("u_Scale", 10)
batch.draw(shader)
context = bpy.context
scene = context.scene
view_matrix = scene.camera.matrix_world.inverted()
projection_matrix = scene.camera.calc_matrix_camera(
context.evaluated_depsgraph_get(), x=WIDTH, y=HEIGHT)
offscreen.draw_view3d(
scene,
context.view_layer,
context.space_data,
context.region,
view_matrix,
projection_matrix)
bgl.glDisable(bgl.GL_DEPTH_TEST)
draw_texture_2d(offscreen.color_texture, (10, 10), WIDTH, HEIGHT)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')

View File

@@ -0,0 +1,65 @@
"""
Custom Shader for dotted 3D Line
--------------------------------
In this example the arc length (distance to the first point on the line) is calculated in every vertex.
Between the vertex and fragment shader that value is automatically interpolated
for all points that will be visible on the screen.
In the fragment shader the ``sin`` of the arc length is calculated.
Based on the result a decision is made on whether the fragment should be drawn or not.
"""
import bpy
import gpu
from random import random
from mathutils import Vector
from gpu_extras.batch import batch_for_shader
vertex_shader = '''
uniform mat4 u_ViewProjectionMatrix;
in vec3 position;
in float arcLength;
out float v_ArcLength;
void main()
{
v_ArcLength = arcLength;
gl_Position = u_ViewProjectionMatrix * vec4(position, 1.0f);
}
'''
fragment_shader = '''
uniform float u_Scale;
in float v_ArcLength;
void main()
{
if (step(sin(v_ArcLength * u_Scale), 0.5) == 1) discard;
gl_FragColor = vec4(1.0);
}
'''
coords = [Vector((random(), random(), random())) * 5 for _ in range(5)]
arc_lengths = [0]
for a, b in zip(coords[:-1], coords[1:]):
arc_lengths.append(arc_lengths[-1] + (a - b).length)
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(
shader, 'LINE_STRIP',
{"position": coords, "arcLength": arc_lengths},
)
def draw():
shader.bind()
matrix = bpy.context.region_data.perspective_matrix
shader.uniform_float("u_ViewProjectionMatrix", matrix)
shader.uniform_float("u_Scale", 10)
batch.draw(shader)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

View File

@@ -1,45 +1,19 @@
"""
Triangle with Custom Shader
---------------------------
3D Lines with Single Color
--------------------------
"""
import bpy
import gpu
from gpu_extras.batch import batch_for_shader
vertex_shader = '''
uniform mat4 viewProjectionMatrix;
in vec3 position;
out vec3 pos;
void main()
{
pos = position;
gl_Position = viewProjectionMatrix * vec4(position, 1.0f);
}
'''
fragment_shader = '''
uniform float brightness;
in vec3 pos;
void main()
{
gl_FragColor = vec4(pos * brightness, 1.0);
}
'''
coords = [(1, 1, 1), (2, 0, 0), (-2, -1, 3)]
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(shader, 'TRIS', {"position": coords})
coords = [(1, 1, 1), (-2, 0, 0), (-2, -1, 3), (0, 1, 1)]
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'LINES', {"pos": coords})
def draw():
shader.bind()
matrix = bpy.context.region_data.perspective_matrix
shader.uniform_float("viewProjectionMatrix", matrix)
shader.uniform_float("brightness", 0.5)
shader.uniform_float("color", (1, 1, 0, 1))
batch.draw(shader)

View File

@@ -1,29 +1,45 @@
"""
Wireframe Cube using Index Buffer
---------------------------------
Triangle with Custom Shader
---------------------------
"""
import bpy
import gpu
from gpu_extras.batch import batch_for_shader
coords = (
(-1, -1, -1), (+1, -1, -1),
(-1, +1, -1), (+1, +1, -1),
(-1, -1, +1), (+1, -1, +1),
(-1, +1, +1), (+1, +1, +1))
vertex_shader = '''
uniform mat4 viewProjectionMatrix;
indices = (
(0, 1), (0, 2), (1, 3), (2, 3),
(4, 5), (4, 6), (5, 7), (6, 7),
(0, 4), (1, 5), (2, 6), (3, 7))
in vec3 position;
out vec3 pos;
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices)
void main()
{
pos = position;
gl_Position = viewProjectionMatrix * vec4(position, 1.0f);
}
'''
fragment_shader = '''
uniform float brightness;
in vec3 pos;
void main()
{
gl_FragColor = vec4(pos * brightness, 1.0);
}
'''
coords = [(1, 1, 1), (2, 0, 0), (-2, -1, 3)]
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(shader, 'TRIS', {"position": coords})
def draw():
shader.bind()
shader.uniform_float("color", (1, 0, 0, 1))
matrix = bpy.context.region_data.perspective_matrix
shader.uniform_float("viewProjectionMatrix", matrix)
shader.uniform_float("brightness", 0.5)
batch.draw(shader)

View File

@@ -1,39 +1,30 @@
"""
Mesh with Random Vertex Colors
------------------------------
Wireframe Cube using Index Buffer
---------------------------------
"""
import bpy
import gpu
import bgl
import numpy as np
from random import random
from gpu_extras.batch import batch_for_shader
mesh = bpy.context.active_object.data
mesh.calc_loop_triangles()
coords = (
(-1, -1, -1), (+1, -1, -1),
(-1, +1, -1), (+1, +1, -1),
(-1, -1, +1), (+1, -1, +1),
(-1, +1, +1), (+1, +1, +1))
vertices = np.empty((len(mesh.vertices), 3), 'f')
indices = np.empty((len(mesh.loop_triangles), 3), 'i')
indices = (
(0, 1), (0, 2), (1, 3), (2, 3),
(4, 5), (4, 6), (5, 7), (6, 7),
(0, 4), (1, 5), (2, 6), (3, 7))
mesh.vertices.foreach_get(
"co", np.reshape(vertices, len(mesh.vertices) * 3))
mesh.loop_triangles.foreach_get(
"vertices", np.reshape(indices, len(mesh.loop_triangles) * 3))
vertex_colors = [(random(), random(), random(), 1) for _ in range(len(mesh.vertices))]
shader = gpu.shader.from_builtin('3D_SMOOTH_COLOR')
batch = batch_for_shader(
shader, 'TRIS',
{"pos": vertices, "color": vertex_colors},
indices=indices,
)
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices)
def draw():
bgl.glEnable(bgl.GL_DEPTH_TEST)
shader.bind()
shader.uniform_float("color", (1, 0, 0, 1))
batch.draw(shader)
bgl.glDisable(bgl.GL_DEPTH_TEST)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

View File

@@ -1,26 +1,39 @@
"""
2D Rectangle
------------
Mesh with Random Vertex Colors
------------------------------
"""
import bpy
import gpu
import bgl
import numpy as np
from random import random
from gpu_extras.batch import batch_for_shader
vertices = (
(100, 100), (300, 100),
(100, 200), (300, 200))
mesh = bpy.context.active_object.data
mesh.calc_loop_triangles()
indices = (
(0, 1, 2), (2, 1, 3))
vertices = np.empty((len(mesh.vertices), 3), 'f')
indices = np.empty((len(mesh.loop_triangles), 3), 'i')
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)
mesh.vertices.foreach_get(
"co", np.reshape(vertices, len(mesh.vertices) * 3))
mesh.loop_triangles.foreach_get(
"vertices", np.reshape(indices, len(mesh.loop_triangles) * 3))
vertex_colors = [(random(), random(), random(), 1) for _ in range(len(mesh.vertices))]
shader = gpu.shader.from_builtin('3D_SMOOTH_COLOR')
batch = batch_for_shader(
shader, 'TRIS',
{"pos": vertices, "color": vertex_colors},
indices=indices,
)
def draw():
shader.bind()
shader.uniform_float("color", (0, 0.5, 0.5, 1.0))
bgl.glEnable(bgl.GL_DEPTH_TEST)
batch.draw(shader)
bgl.glDisable(bgl.GL_DEPTH_TEST)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

View File

@@ -1,36 +1,25 @@
"""
2D Image
--------
To use this example you have to provide an image that should be displayed.
2D Rectangle
------------
"""
import bpy
import gpu
import bgl
from gpu_extras.batch import batch_for_shader
IMAGE_NAME = "Untitled"
image = bpy.data.images[IMAGE_NAME]
vertices = (
(100, 100), (300, 100),
(100, 200), (300, 200))
shader = gpu.shader.from_builtin('2D_IMAGE')
batch = batch_for_shader(
shader, 'TRI_FAN',
{
"pos": ((100, 100), (200, 100), (200, 200), (100, 200)),
"texCoord": ((0, 0), (1, 0), (1, 1), (0, 1)),
},
)
indices = (
(0, 1, 2), (2, 1, 3))
if image.gl_load():
raise Exception()
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)
def draw():
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)
shader.bind()
shader.uniform_int("image", 0)
shader.uniform_float("color", (0, 0.5, 0.5, 1.0))
batch.draw(shader)

View File

@@ -1,86 +1,37 @@
"""
Generate a texture using Offscreen Rendering
--------------------------------------------
2D Image
--------
#. Create an :class:`gpu.types.GPUOffScreen` object.
#. Draw some circles into it.
#. Make a new shader for drawing a planar texture in 3D.
#. Draw the generated texture using the new shader.
To use this example you have to provide an image that should be displayed.
"""
import bpy
import gpu
import bgl
from mathutils import Matrix
from gpu_extras.batch import batch_for_shader
from gpu_extras.presets import draw_circle_2d
# Create and fill offscreen
##########################################
IMAGE_NAME = "Untitled"
image = bpy.data.images[IMAGE_NAME]
offscreen = gpu.types.GPUOffScreen(512, 512)
with offscreen.bind():
bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
with gpu.matrix.push_pop():
# reset matrices -> use normalized device coordinates [-1, 1]
gpu.matrix.load_matrix(Matrix.Identity(4))
gpu.matrix.load_projection_matrix(Matrix.Identity(4))
amount = 10
for i in range(-amount, amount + 1):
x_pos = i / amount
draw_circle_2d((x_pos, 0.0), (1, 1, 1, 1), 0.5, 200)
# Drawing the generated texture in 3D space
#############################################
vertex_shader = '''
uniform mat4 modelMatrix;
uniform mat4 viewProjectionMatrix;
in vec2 position;
in vec2 uv;
out vec2 uvInterp;
void main()
{
uvInterp = uv;
gl_Position = viewProjectionMatrix * modelMatrix * vec4(position, 0.0, 1.0);
}
'''
fragment_shader = '''
uniform sampler2D image;
in vec2 uvInterp;
void main()
{
gl_FragColor = texture(image, uvInterp);
}
'''
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
shader = gpu.shader.from_builtin('2D_IMAGE')
batch = batch_for_shader(
shader, 'TRI_FAN',
{
"position": ((-1, -1), (1, -1), (1, 1), (-1, 1)),
"uv": ((0, 0), (1, 0), (1, 1), (0, 1)),
"pos": ((100, 100), (200, 100), (200, 200), (100, 200)),
"texCoord": ((0, 0), (1, 0), (1, 1), (0, 1)),
},
)
if image.gl_load():
raise Exception()
def draw():
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, offscreen.color_texture)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)
shader.bind()
shader.uniform_float("modelMatrix", Matrix.Translation((1, 2, 3)) @ Matrix.Scale(3, 4))
shader.uniform_float("viewProjectionMatrix", bpy.context.region_data.perspective_matrix)
shader.uniform_float("image", 0)
shader.uniform_int("image", 0)
batch.draw(shader)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')

View File

@@ -1,28 +1,23 @@
"""
Copy Offscreen Rendering result back to RAM
-------------------------------------------
Generate a texture using Offscreen Rendering
--------------------------------------------
This will create a new image with the given name.
If it already exists, it will override the existing one.
Currently almost all of the execution time is spent in the last line.
In the future this will hopefully be solved by implementing the Python buffer protocol
for :class:`bgl.Buffer` and :class:`bpy.types.Image.pixels` (aka ``bpy_prop_array``).
#. Create an :class:`gpu.types.GPUOffScreen` object.
#. Draw some circles into it.
#. Make a new shader for drawing a planar texture in 3D.
#. Draw the generated texture using the new shader.
"""
import bpy
import gpu
import bgl
import random
from mathutils import Matrix
from gpu_extras.batch import batch_for_shader
from gpu_extras.presets import draw_circle_2d
IMAGE_NAME = "Generated Image"
WIDTH = 512
HEIGHT = 512
RING_AMOUNT = 10
# Create and fill offscreen
##########################################
offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
offscreen = gpu.types.GPUOffScreen(512, 512)
with offscreen.bind():
bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
@@ -31,20 +26,61 @@ with offscreen.bind():
gpu.matrix.load_matrix(Matrix.Identity(4))
gpu.matrix.load_projection_matrix(Matrix.Identity(4))
for i in range(RING_AMOUNT):
draw_circle_2d(
(random.uniform(-1, 1), random.uniform(-1, 1)),
(1, 1, 1, 1), random.uniform(0.1, 1), 20)
buffer = bgl.Buffer(bgl.GL_BYTE, WIDTH * HEIGHT * 4)
bgl.glReadBuffer(bgl.GL_BACK)
bgl.glReadPixels(0, 0, WIDTH, HEIGHT, bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)
offscreen.free()
amount = 10
for i in range(-amount, amount + 1):
x_pos = i / amount
draw_circle_2d((x_pos, 0.0), (1, 1, 1, 1), 0.5, 200)
if not IMAGE_NAME in bpy.data.images:
bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT)
image = bpy.data.images[IMAGE_NAME]
image.scale(WIDTH, HEIGHT)
image.pixels = [v / 255 for v in buffer]
# Drawing the generated texture in 3D space
#############################################
vertex_shader = '''
uniform mat4 modelMatrix;
uniform mat4 viewProjectionMatrix;
in vec2 position;
in vec2 uv;
out vec2 uvInterp;
void main()
{
uvInterp = uv;
gl_Position = viewProjectionMatrix * modelMatrix * vec4(position, 0.0, 1.0);
}
'''
fragment_shader = '''
uniform sampler2D image;
in vec2 uvInterp;
void main()
{
gl_FragColor = texture(image, uvInterp);
}
'''
shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
batch = batch_for_shader(
shader, 'TRI_FAN',
{
"position": ((-1, -1), (1, -1), (1, 1), (-1, 1)),
"uv": ((0, 0), (1, 0), (1, 1), (0, 1)),
},
)
def draw():
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, offscreen.color_texture)
shader.bind()
shader.uniform_float("modelMatrix", Matrix.Translation((1, 2, 3)) @ Matrix.Scale(3, 4))
shader.uniform_float("viewProjectionMatrix", bpy.context.region_data.perspective_matrix)
shader.uniform_float("image", 0)
batch.draw(shader)
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_VIEW')

View File

@@ -1,41 +1,50 @@
"""
Rendering the 3D View into a Texture
------------------------------------
Copy Offscreen Rendering result back to RAM
-------------------------------------------
The scene has to have a camera for this example to work.
You could also make this independent of a specific camera,
but Blender does not expose good functions to create view and projection matrices yet.
This will create a new image with the given name.
If it already exists, it will override the existing one.
Currently almost all of the execution time is spent in the last line.
In the future this will hopefully be solved by implementing the Python buffer protocol
for :class:`bgl.Buffer` and :class:`bpy.types.Image.pixels` (aka ``bpy_prop_array``).
"""
import bpy
import bgl
import gpu
from gpu_extras.presets import draw_texture_2d
import bgl
import random
from mathutils import Matrix
from gpu_extras.presets import draw_circle_2d
IMAGE_NAME = "Generated Image"
WIDTH = 512
HEIGHT = 256
HEIGHT = 512
RING_AMOUNT = 10
offscreen = gpu.types.GPUOffScreen(WIDTH, HEIGHT)
with offscreen.bind():
bgl.glClear(bgl.GL_COLOR_BUFFER_BIT)
with gpu.matrix.push_pop():
# reset matrices -> use normalized device coordinates [-1, 1]
gpu.matrix.load_matrix(Matrix.Identity(4))
gpu.matrix.load_projection_matrix(Matrix.Identity(4))
def draw():
context = bpy.context
scene = context.scene
for i in range(RING_AMOUNT):
draw_circle_2d(
(random.uniform(-1, 1), random.uniform(-1, 1)),
(1, 1, 1, 1), random.uniform(0.1, 1), 20)
view_matrix = scene.camera.matrix_world.inverted()
buffer = bgl.Buffer(bgl.GL_BYTE, WIDTH * HEIGHT * 4)
bgl.glReadBuffer(bgl.GL_BACK)
bgl.glReadPixels(0, 0, WIDTH, HEIGHT, bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)
projection_matrix = scene.camera.calc_matrix_camera(
context.evaluated_depsgraph_get(), x=WIDTH, y=HEIGHT)
offscreen.draw_view3d(
scene,
context.view_layer,
context.space_data,
context.region,
view_matrix,
projection_matrix)
bgl.glDisable(bgl.GL_DEPTH_TEST)
draw_texture_2d(offscreen.color_texture, (10, 10), WIDTH, HEIGHT)
offscreen.free()
bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')
if not IMAGE_NAME in bpy.data.images:
bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT)
image = bpy.data.images[IMAGE_NAME]
image.scale(WIDTH, HEIGHT)
image.pixels = [v / 255 for v in buffer]

View File

@@ -1,2 +1,2 @@
Sphinx==3.1.1
sphinx_rtd_theme==0.5.0
Sphinx==1.8.5
sphinx_rtd_theme==0.4.3

View File

@@ -427,7 +427,7 @@ offers a set of extensive examples, including advanced features.
Return evaluator parameters
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMap.xml>`__
.. seealso:: `OpenGL Docs <https://www.opengl.org/sdk/docs/man2/xhtml/glGetMap.xml>`_
:type target: Enumerated constant
:arg target: Specifies the symbolic name of a map.

View File

@@ -1,5 +1,5 @@
..
This document is appended to the auto generated BMesh API doc to avoid clogging up the C files with details.
This document is appended to the auto generated bmesh api doc to avoid clogging up the C files with details.
to test this run:
./blender.bin -b -noaudio -P doc/python_api/sphinx_doc_gen.py -- \
--partial bmesh* ; cd doc/python_api ; sphinx-build sphinx-in sphinx-out ; cd ../../
@@ -19,24 +19,25 @@ Submodules:
Introduction
------------
This API gives access the Blender's internal mesh editing API, featuring geometry connectivity data and
This API gives access the blenders internal mesh editing api, featuring geometry connectivity data and
access to editing operations such as split, separate, collapse and dissolve.
The features exposed closely follow the C API,
giving Python access to the functions used by Blender's own mesh editing tools.
giving python access to the functions used by blenders own mesh editing tools.
For an overview of BMesh data types and how they reference each other see:
`BMesh Design Document <https://wiki.blender.org/index.php/Dev:Source/Modeling/BMesh/Design>`__.
`BMesh Design Document <https://wiki.blender.org/index.php/Dev:Source/Modeling/BMesh/Design>`_ .
.. note::
**Disk** and **Radial** data is not exposed by the Python API since this is for internal use only.
**Disk** and **Radial** data is not exposed by the python api since this is for internal use only.
.. warning:: TODO items are...
- add access to BMesh **walkers**.
- add custom-data manipulation functions add, remove or rename.
* add access to BMesh **walkers**
* add custom-data manipulation functions add/remove/rename.
Example Script
@@ -45,52 +46,55 @@ Example Script
.. literalinclude:: __/__/__/release/scripts/templates_py/bmesh_simple.py
Standalone Module
^^^^^^^^^^^^^^^^^
Stand-Alone Module
^^^^^^^^^^^^^^^^^^
The BMesh module is written to be standalone except for :mod:`mathutils`
The bmesh module is written to be standalone except for :mod:`mathutils`
which is used for vertex locations and normals.
The only other exception to this are when converting mesh data to and from :class:`bpy.types.Mesh`.
Mesh Access
-----------
There are two ways to access BMesh data, you can create a new BMesh by converting a mesh from
:class:`bpy.types.BlendData.meshes` or by accessing the current Edit-Mode mesh.
See: :class:`bmesh.types.BMesh.from_mesh` and :mod:`bmesh.from_edit_mesh` respectively.
There are 2 ways to access BMesh data, you can create a new BMesh by converting a mesh from
:class:`bpy.types.BlendData.meshes` or by accessing the current edit mode mesh.
see: :class:`bmesh.types.BMesh.from_mesh` and :mod:`bmesh.from_edit_mesh` respectively.
When explicitly converting from mesh data Python **owns** the data, that means that
the mesh only exists while Python holds a reference to it.
The script is responsible for putting it back into a mesh data-block when the edits are done.
When explicitly converting from mesh data python **owns** the data, that is to say -
that the mesh only exists while python holds a reference to it,
and the script is responsible for putting it back into a mesh data-block when the edits are done.
Note that unlike :mod:`bpy`, a BMesh does not necessarily correspond to data in the currently open blend-file,
Note that unlike :mod:`bpy`, a BMesh does not necessarily correspond to data in the currently open blend file,
a BMesh can be created, edited and freed without the user ever seeing or having access to it.
Unlike Edit-Mode, the BMesh module can use multiple BMesh instances at once.
Unlike edit mode, the bmesh module can use multiple BMesh instances at once.
Take care when dealing with multiple BMesh instances since the mesh data can use a lot of memory.
While a mesh that the Python script owns will be freed when the script holds no references to it,
it's good practice to call :class:`bmesh.types.BMesh.free` which will remove all the mesh data immediately
and disable further access.
Take care when dealing with multiple BMesh instances since the mesh data can use a lot of memory, while a mesh that
python owns will be freed in when the script holds no references to it,
its good practice to call :class:`bmesh.types.BMesh.free` which will remove all the mesh data immediately and disable
further access.
Edit-Mode Tessellation
^^^^^^^^^^^^^^^^^^^^^^
EditMode Tessellation
^^^^^^^^^^^^^^^^^^^^^
When writing scripts that operate on Edit-Mode data you will normally want to re-calculate the tessellation after
running the script, this needs to be called explicitly.
The BMesh itself does not store the triangulated faces, instead they are stored in the :class:`bpy.types.Mesh`,
When writing scripts that operate on editmode data you will normally want to re-calculate the tessellation after
running the script, this needs to be called explicitly.
The BMesh its self does not store the triangulated faces, they are stored in the :class:`bpy.types.Mesh`,
to refresh tessellation triangles call :class:`bpy.types.Mesh.calc_loop_triangles`.
CustomData Access
-----------------
BMesh has a unified way to access mesh attributes such as UVs, vertex colors, shape keys, edge crease, etc.
This works by having a **layers** property on BMesh data sequences to access the custom data layers
which can then be used to access the actual data on each vert, edge, face or loop.
BMesh has a unified way to access mesh attributes such as UV's vertex colors, shape keys, edge crease etc.
Here are some examples:
This works by having a **layers** property on bmesh data sequences to access the custom data layers which can then be
used to access the actual data on each vert/edge/face/loop.
Here are some examples ...
.. code-block:: python
@@ -135,27 +139,27 @@ Here are some examples:
Keeping a Correct State
-----------------------
When modeling in Blender there are certain assumptions made about the state of the mesh:
When modeling in blender there are certain assumptions made about the state of the mesh.
- Hidden geometry isn't selected.
- When an edge is selected, its vertices are selected too.
- When a face is selected, its edges and vertices are selected.
- Duplicate edges / faces don't exist.
- Faces have at least three vertices.
* hidden geometry isn't selected.
* when an edge is selected, its vertices are selected too.
* when a face is selected, its edges and vertices are selected.
* duplicate edges / faces don't exist.
* faces have at least 3 vertices.
To give developers flexibility these conventions are not enforced,
yet tools must leave the mesh in a valid state or else other tools may behave incorrectly.
however tools must leave the mesh in a valid state else other tools may behave incorrectly.
Any errors that arise from not following these conventions is considered a bug in the script,
not a bug in Blender.
not a bug in blender.
Selection / Flushing
^^^^^^^^^^^^^^^^^^^^
As mentioned above, it is possible to create an invalid selection state
(by selecting a state and then deselecting one of its vertices for example),
mostly the best way to solve this is to flush the selection
after performing a series of edits. This validates the selection state.
(by selecting a state and then de-selecting one of its vertices's for example), mostly the best way to solve this is to
flush the selection after performing a series of edits. this validates the selection state.
Module Functions

View File

@@ -3,84 +3,94 @@
Reference API Usage
*******************
Blender has many interlinking data types which have an auto-generated reference API which often has the information
Blender has many interlinking data types which have an auto-generated reference api which often has the information
you need to write a script, but can be difficult to use.
This document is designed to help you understand how to use the reference API.
This document is designed to help you understand how to use the reference api.
Reference API Scope
===================
The reference API covers :mod:`bpy.types`, which stores types accessed via :mod:`bpy.context` -- *the user context*
or :mod:`bpy.data` -- *blend-file data*.
The reference API covers :mod:`bpy.types`, which stores types accessed via :mod:`bpy.context` - *The user context*
or :mod:`bpy.data` - *Blend file data*.
Other modules such as :mod:`bmesh` and :mod:`aud` are not using Blender's data API
Other modules such as :mod:`bmesh` and :mod:`aud` are not using Blenders data API
so this document doesn't apply to those modules.
Data Access
===========
The most common case for using the reference API is to find out how to access data in the blend-file.
Before going any further its best to be aware of ID data-blocks in Blender since you will often find properties
The most common case for using the reference API is to find out how to access data in the blend file.
Before going any further its best to be aware of ID Data-Blocks in Blender since you will often find properties
relative to them.
ID Data
-------
ID data-blocks are used in Blender as top-level data containers.
From the user interface this isn't so obvious, but when developing you need to know about ID data-blocks.
ID data types include Scene, Group, Object, Mesh, Workspace, World, Armature, Image and Texture.
For a full list see the subclasses of :class:`bpy.types.ID`.
ID Data-Blocks are used in Blender as top-level data containers.
Here are some characteristics ID data-blocks share:
From the user interface this isn't so obvious, but when developing you need to know about ID Data-Blocks.
- IDs are blend-file data, so loading a new blend-file reloads an entire new set of data-blocks.
- IDs can be accessed in Python from ``bpy.data.*``.
ID data types include Scene, Group, Object, Mesh, Screen, World, Armature, Image and Texture.
for a full list see the sub-classes of :class:`bpy.types.ID`
Here are some characteristics ID Data-Blocks share.
- ID's are blend file data, so loading a new blend file reloads an entire new set of Data-Blocks.
- ID's can be accessed in Python from ``bpy.data.*``
- Each data-block has a unique ``.name`` attribute, displayed in the interface.
- Animation data is stored in IDs ``.animation_data``.
- IDs are the only data types that can be linked between blend-files.
- IDs can be added/copied and removed via Python.
- IDs have their own garbage-collection system which frees unused IDs when saving.
- When a data-block has a reference to some external data, this is typically an ID data-block.
- Animation data is stored in ID's ``.animation_data``.
- ID's are the only data types that can be linked between blend files.
- ID's can be added/copied and removed via Python.
- ID's have their own garbage-collection system which frees unused ID's when saving.
- When a data-block has a reference to some external data, this is typically an ID Data-Block.
Simple Data Access
------------------
In this simple case a Python script is used to adjust the object's location.
Start by collecting the information where the data is located.
Lets start with a simple case, say you want a python script to adjust the object's location.
First find this setting in the interface ``Properties editor -> Object -> Transform -> Location``.
From the button context menu select *Online Python Reference*, this will link you to:
:class:`bpy.types.Object.location`.
Being an API reference, this link often gives little more information then the tooltip, though some of the pages
Start by finding this setting in the interface ``Properties Window -> Object -> Transform -> Location``
From the button you can right click and select **Online Python Reference**, this will link you to:
:class:`bpy.types.Object.location`
Being an API reference, this link often gives little more information then the tool-tip, though some of the pages
include examples (normally at the top of the page).
But you now know that you have to use ``.location`` and that its an array of three floats.
So the next step is to find out where to access objects, go down to the bottom of the page to the references section,
for objects there are many references, but one of the most common places to access objects is via the context.
It's easy to be overwhelmed at this point since there ``Object`` get referenced in so many places:
modifiers, functions, textures and constraints.
At this point you may say *Now what?* - you know that you have to use ``.location`` and that its an array of 3 floats
but you're still left wondering how to access this in a script.
So the next step is to find out where to access objects, go down to the bottom of the page to the **References**
section, for objects there are many references, but one of the most common places to access objects is via the context.
It's easy to be overwhelmed at this point since there ``Object`` get referenced in so many places - modifiers,
functions, textures and constraints.
But if you want to access any data the user has selected
you typically only need to check the :mod:`bpy.context` references.
Even then, in this case there are quite a few though
if you read over these you'll notice that most are mode specific.
If you happen to be writing a tool that only runs in Weight Paint Mode,
then using ``weight_paint_object`` would be appropriate.
However, to access an item the user last selected, look for the ``active`` members,
Having access to a single active member the user selects is a convention in Blender:
e.g. ``active_bone``, ``active_pose_bone``, ``active_node``, etc. and in this case you can use ``active_object``.
Even then, in this case there are quite a few though if you read over these - most are mode specific.
If you happen to be writing a tool that only runs in weight paint mode, then using ``weight_paint_object``
would be appropriate.
However to access an item the user last selected, look for the ``active`` members,
Having access to a single active member the user selects is a convention in Blender: eg. ``active_bone``,
``active_pose_bone``, ``active_node`` ... and in this case we can use - ``active_object``.
So now you have enough information to find the location of the active object.
So now we have enough information to find the location of the active object.
.. code-block:: python
bpy.context.active_object.location
You can type this into the Python console to see the result.
You can type this into the python console to see the result.
The other common place to access objects in the reference is :class:`bpy.types.BlendData.objects`.
.. note::
@@ -90,7 +100,7 @@ The other common place to access objects in the reference is :class:`bpy.types.B
so the documentation points there.
With :mod:`bpy.data.objects`, this is a collection of objects so you need to access one of its members:
With :mod:`bpy.data.objects`, this is a collection of objects so you need to access one of its members.
.. code-block:: python
@@ -107,34 +117,37 @@ Here are some more complex examples:
.. code-block:: python
# Access the number of samples for the Cycles render engine.
bpy.context.scene.cycles.samples
# access a render layers samples
bpy.context.scene.render.layers["RenderLayer"].samples
# Access to the current weight paint brush size.
# access to the current weight paint brush size
bpy.context.tool_settings.weight_paint.brush.size
# Check if the window is full-screen.
# check if the window is fullscreen
bpy.context.window.screen.show_fullscreen
As you can see there are times when you want to access data which is nested
in a way that causes you to go through a few indirections.
The properties are arranged to match how data is stored internally (in Blender's C code) which is often logical
but not always quite what you would expect from using Blender.
So this takes some time to learn, it helps you understand how data fits together in Blender
which is important to know when writing scripts.
When starting out scripting you will often run into the problem
where you're not sure how to access the data you want.
There are a few ways to do this:
The properties are arranged to match how data is stored internally (in blenders C code) which is often logical but
not always quite what you would expect from using Blender.
So this takes some time to learn, it helps you understand how data fits together in Blender which is important
to know when writing scripts.
When starting out scripting you will often run into the problem where you're not sure how to access the data you want.
There are a few ways to do this.
- Use the Python console's auto-complete to inspect properties.
*This can be hit-and-miss but has the advantage
that you can easily see the values of properties and assign them to interactively see the results.*
- Copy the data path from the user interface.
*Explained further in* :ref:`Copy Data Path <info_data_path_copy>`.
- Copy the Data-Path from the user interface.
*Explained further in :ref:`Copy Data Path <info_data_path_copy>`*
- Using the documentation to follow references.
*Explained further in* :ref:`Indirect Data Access <info_data_path_indirect>`.
*Explained further in :ref:`Indirect Data Access <info_data_path_indirect>`*
.. _info_data_path_copy:
@@ -142,36 +155,42 @@ There are a few ways to do this:
Copy Data Path
--------------
Blender can compute the Python string to a property which is shown in the tooltip,
on the line below ``Python: ...``. This saves having to open the API references to find where data is accessed from.
In the context menu is a copy data-path tool which gives the path from an :class:`bpy.types.ID` data-block,
Blender can compute the Python string to a property which is shown in the tool-tip, on the line below ``Python: ...``,
This saves having to use the API reference to click back up the references to find where data is accessed from.
There is a user-interface feature to copy the data-path which gives the path from an :class:`bpy.types.ID` data-block,
to its property.
To see how this works you'll get the path to the Subdivision Surface modifiers *Levels* setting.
Start with the default scene and select the Modifiers tab, then add a Subdivision Surface modifier to the cube.
Now hover your mouse over the button labeled *Levels Viewport*,
The tooltip includes :class:`bpy.types.SubsurfModifier.levels` but you want the path from the object to this property.
To see how this works we'll get the path to the Subdivision-Surface modifiers subdivision setting.
Start with the default scene and select the **Modifiers** tab, then add a **Subdivision-Surface** modifier to the cube.
Now hover your mouse over the button labeled **View**, The tool-tip includes :class:`bpy.types.SubsurfModifier.levels`
but we want the path from the object to this property.
Note that the text copied won't include the ``bpy.data.collection["name"].`` component since its assumed that
you won't be doing collection look-ups on every access and typically you'll want to use the context rather
then access each :class:`bpy.types.ID` instance by name.
Type in the ID path into a Python console :mod:`bpy.context.active_object`.
Include the trailing dot and don't execute the code, yet.
Now in the button's context menu select *Copy Data Path*, then paste the result into the console:
Type in the ID path into a Python console :mod:`bpy.context.active_object`.
Include the trailing dot and don't hit "enter", yet.
Now right-click on the button and select **Copy Data Path**, then paste the result into the console.
So now you should have the answer:
.. code-block:: python
bpy.context.active_object.modifiers["Subsurf"].levels
Press :kbd:`Return` and you'll get the current value of 1. Now try changing the value to 2:
Hit "enter" and you'll get the current value of 1. Now try changing the value to 2:
.. code-block:: python
bpy.context.active_object.modifiers["Subsurf"].levels = 2
bpy.context.active_object.modifiers["Subsurf"].levels = 2
You can see the value update in the Subdivision Surface modifier's UI as well as the cube.
You can see the value update in the Subdivision-Surface modifier's UI as well as the cube.
.. _info_data_path_indirect:
@@ -179,45 +198,51 @@ You can see the value update in the Subdivision Surface modifier's UI as well as
Indirect Data Access
--------------------
This more advanced example shows the steps to access the active sculpt brushes texture.
For example, if you want to access the texture of a brush via Python to adjust its ``contrast``.
For this example we'll go over something more involved, showing the steps to access the active sculpt brushes texture.
#. Start in the default scene and enable Sculpt Mode from the 3D Viewport header.
#. From the Sidebar expand the Brush Settings panel's *Texture* subpanel and add a new texture.
*Notice the texture data-block menu itself doesn't have very useful links (you can check the tooltips).*
#. The contrast setting isn't exposed in the Sidebar, so view the texture in the properties editor:
Lets say we want to access the texture of a brush via Python, to adjust its ``contrast`` for example.
- In the properties editor select the Texture tab.
- Select brush texture.
- Expand the *Colors* panel to locate the *Contrast* number field.
#. Open the context menu of the contrast field and select *Online Python Reference*.
This takes you to ``bpy.types.Texture.contrast``. Now you can see that ``contrast`` is a property of texture.
#. To find out how to access the texture from the brush check on the references at the bottom of the page.
Sometimes there are many references, and it may take some guesswork to find the right one,
but in this case it's ``Brush.texture``.
- Start in the default scene and enable 'Sculpt' mode from the 3D-View header.
- From the toolbar expand the **Texture** panel and add a new texture.
*Notice the texture button its self doesn't have very useful links (you can check the tooltips).*
- The contrast setting isn't exposed in the sculpt toolbar, so view the texture in the properties panel...
#. Now you know that the texture can be accessed from ``bpy.data.brushes["BrushName"].texture``
but normally you *won't* want to access the brush by name, instead you want to access the active brush.
So the next step is to check on where brushes are accessed from via the references.
In this case there it is simply ``bpy.context.brush``.
- In the properties button select the Texture context.
- Select the Brush icon to show the brush texture.
- Expand the *Colors* panel to locate the *Contrast* button.
- Right click on the contrast button and select **Online Python Reference**
This takes you to ``bpy.types.Texture.contrast``
- Now we can see that ``contrast`` is a property of texture,
so next we'll check on how to access the texture from the brush.
- Check on the **References** at the bottom of the page, sometimes there are many references, and it may take
some guess work to find the right one, but in this case its obviously ``Brush.texture``.
Now you can use the Python console to form the nested properties needed to access brush textures contrast:
*Context -> Brush -> Texture -> Contrast*.
*Now we know that the texture can be accessed from* ``bpy.data.brushes["BrushName"].texture``
*but normally you won't want to access the brush by name, so we'll see now to access the active brush instead.*
- So the next step is to check on where brushes are accessed from via the **References**.
In this case there is simply ``bpy.context.brush`` which is all we need.
Since the attribute for each is given along the way you can compose the data path in the Python console:
Now you can use the Python console to form the nested properties needed to access brush textures contrast,
logically we now know.
*Context -> Brush -> Texture -> Contrast*
Since the attribute for each is given along the way we can compose the data path in the python console:
.. code-block:: python
bpy.context.brush.texture.contrast
There can be multiple ways to access the same data, which you choose often depends on the task.
An alternate path to access the same setting is:
An alternate path to access the same setting is...
.. code-block:: python
bpy.context.sculpt.brush.texture.contrast
Or access the brush directly:
Or access the brush directly...
.. code-block:: python
@@ -226,24 +251,27 @@ Or access the brush directly:
If you are writing a user tool normally you want to use the :mod:`bpy.context` since the user normally expects
the tool to operate on what they have selected.
For automation you are more likely to use :mod:`bpy.data` since you want to be able to access specific data and
manipulate it, no matter what the user currently has the view set at.
For automation you are more likely to use :mod:`bpy.data` since you want to be able to access specific data and manipulate
it, no matter what the user currently has the view set at.
Operators
=========
Most hotkeys and buttons in Blender call an operator which is also exposed to Python via :mod:`bpy.ops`.
Most key-strokes and buttons in Blender call an operator which is also exposed to python via :mod:`bpy.ops`,
To see the Python equivalent hover your mouse over the button and see the tooltip,
e.g ``Python: bpy.ops.render.render()``,
If there is no tooltip or the ``Python:`` line is missing then this button is not using an operator
and can't be accessed from Python.
To see the Python equivalent hover your mouse over the button and see the tool-tip,
eg ``Python: bpy.ops.render.render()``,
If there is no tool-tip or the ``Python:`` line is missing then this button is not using an operator and
can't be accessed from Python.
If you want to use this in a script you can press :kbd:`Ctrl-C` while your mouse is over the button
to copy it to the clipboard.
You can also use button's context menu and view the *Online Python Reference*, this mainly shows arguments and
their defaults, however, operators written in Python show their file and line number which may be useful if you
If you want to use this in a script you can press :kbd:`Control-C` while your mouse is over the button to copy it to the
clipboard.
You can also right click on the button and view the **Online Python Reference**, this mainly shows arguments and
their defaults however operators written in Python show their file and line number which may be useful if you
are interested to check on the source code.
.. note::
@@ -252,18 +280,21 @@ are interested to check on the source code.
for more on this see :ref:`using operators <using_operators>`.
Info Editor
-----------
Info View
---------
Blender records operators you run and displays them in the Info editor.
Select the Scripting workspace that comes default with Blender to see its output.
You can perform some actions and see them show up -- delete a vertex for example.
Blender records operators you run and displays them in the **Info** space.
This is located above the file-menu which can be dragged down to display its contents.
Each entry can be selected, then copied :kbd:`Ctrl-C`, usually to paste in the text editor or Python console.
Select the **Script** screen that comes default with Blender to see its output.
You can perform some actions and see them show up - delete a vertex for example.
Each entry can be selected (Right-Mouse-Button),
then copied :kbd:`Control-C`, usually to paste in the text editor or python console.
.. note::
Not all operators get registered for display,
zooming the view for example isn't so useful to repeat so its excluded from the output.
To display *every* operator that runs see :ref:`Show All Operators <info_show_all_operators>`.
To display *every* operator that runs see :ref:`Show All Operators <info_show_all_operators>`

View File

@@ -3,34 +3,38 @@
Best Practice
*************
When writing your own scripts Python is great for new developers to pick up and become productive,
but you can also pick up bad practices or at least write scripts that are not easy for others to understand.
When writing your own scripts python is great for new developers to pick up and become productive,
but you can also pick up odd habits or at least write scripts that are not easy for others to understand.
For your own work this is of course fine,
but if you want to collaborate with others or have your work included with Blender there are practices we encourage.
but if you want to collaborate with others or have your work included with blender there are practices we encourage.
Style Conventions
=================
For Blender Python development we have chosen to follow Python suggested style guide to avoid mixing styles
among our own scripts and make it easier to use Python scripts from other projects.
Using our style guide for your own scripts makes it easier if you eventually want to contribute them to Blender.
For Blender/Python development we have chosen to follow python suggested style guide to avoid mixing styles
amongst our own scripts and make it easier to use python scripts from other projects.
This style guide is known as `pep8 <https://www.python.org/dev/peps/pep-0008/>`__
and here is a brief listing of pep8 criteria:
Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
- Camel caps for class names: MyClass
- All lower case underscore separated module names: my_module
- Indentation of 4 spaces (no tabs)
- Spaces around operators: ``1 + 1``, not ``1+1``
- Only use explicit imports (no wildcard importing ``*``)
- Don't use multiple statements on a single line: ``if val: body``, separate onto two lines instead.
This style guide is known as pep8 and can be found `here <https://www.python.org/dev/peps/pep-0008/>`_
As well as pep8 we have additional conventions used for Blender Python scripts:
A brief listing of pep8 criteria.
- camel caps for class names: MyClass
- all lower case underscore separated module names: my_module
- indentation of 4 spaces (no tabs)
- spaces around operators. ``1 + 1``, not ``1+1``
- only use explicit imports, (no importing ``*``)
- don't use single line: ``if val: body``, separate onto 2 lines instead.
As well as pep8 we have other conventions used for blender python scripts.
- Use single quotes for enums, and double quotes for strings.
Both are of course strings, but in our internal API enums are unique items from a limited set, e.g:
Both are of course strings, but in our internal API enums are unique items from a limited set. eg.
.. code-block:: python
@@ -38,14 +42,14 @@ As well as pep8 we have additional conventions used for Blender Python scripts:
bpy.context.scene.render.filepath = "//render_out"
- pep8 also defines that lines should not exceed 79 characters,
we have decided that this is too restrictive so it is optional per script.
we felt this is too restrictive so this is optional per script.
Periodically we run checks for pep8 compliance on Blender scripts,
for scripts to be included in this check add this line as a comment at the top of the script:
Periodically we run checks for pep8 compliance on blender scripts,
for scripts to be included in this check add this line as a comment at the top of the script.
``# <pep8 compliant>``
To enable line length checks use this instead:
To enable line length checks use this instead.
``# <pep8-80 compliant>``
@@ -55,79 +59,85 @@ User Interface Layout
Some notes to keep in mind when writing UI layouts:
UI code is quite simple. Layout declarations are there to easily create a decent layout.
The general rule here is: If you need more code for the layout declaration,
than for the actual properties, then you are doing it wrong.
- UI code is quite simple. Layout declarations are there to easily create a decent layout.
General rule here: If you need more code for the layout declaration,
then for the actual properties, you do it wrong.
.. rubric:: Example layouts:
Example layouts:
``layout()``
The basic layout is a simple top-to-bottom layout.
- layout()
.. code-block:: python
The basic layout is a simple Top -> Bottom layout.
layout.prop()
layout.prop()
.. code-block:: python
``layout.row()``
Use ``row()``, when you want more than one property in a single line.
layout.prop()
layout.prop()
.. code-block:: python
- layout.row()
row = layout.row()
row.prop()
row.prop()
Use row(), when you want more than 1 property in one line.
``layout.column()``
Use ``column()``, when you want your properties in a column.
.. code-block:: python
.. code-block:: python
row = layout.row()
row.prop()
row.prop()
col = layout.column()
col.prop()
col.prop()
- layout.column()
``layout.split()``
This can be used to create more complex layouts.
For example, you can split the layout and create two ``column()`` layouts next to each other.
Do not use split, when you simply want two properties in a row. Use ``row()`` instead.
Use column(), when you want your properties in a column.
.. code-block:: python
.. code-block:: python
split = layout.split()
col = layout.column()
col.prop()
col.prop()
col = split.column()
col.prop()
col.prop()
- layout.split()
col = split.column()
col.prop()
col.prop()
This can be used to create more complex layouts.
For example you can split the layout and create two column() layouts next to each other.
Don't use split, when you simply want two properties in a row. Use row() for that.
.. code-block:: python
.. rubric:: Declaration names:
split = layout.split()
col = split.column()
col.prop()
col.prop()
col = split.column()
col.prop()
col.prop()
Declaration names:
Try to only use these variable names for layout declarations:
:row: for a ``row()`` layout
:col: for a ``column()`` layout
:split: for a ``split()`` layout
:flow: for a ``column_flow()`` layout
:sub: for a sub layout (a column inside a column for example)
- row for a row() layout
- col for a column() layout
- split for a split() layout
- flow for a column_flow() layout
- sub for a sub layout (a column inside a column for example)
Script Efficiency
=================
List Manipulation (General Python Tips)
---------------------------------------
Searching for List Items
Searching for list items
^^^^^^^^^^^^^^^^^^^^^^^^
In Python there are some handy list functions that save you having to search through the list.
Even though you are not looping on the list data **Python is**,
Even though you are not looping on the list data **python is**,
so you need to be aware of functions that will slow down your script by searching the whole list.
.. code-block:: python
@@ -140,21 +150,23 @@ so you need to be aware of functions that will slow down your script by searchin
Modifying Lists
^^^^^^^^^^^^^^^
In Python you can add and remove from a list, this is slower when the list length is modified,
In python we can add and remove from a list, this is slower when the list length is modified,
especially at the start of the list, since all the data after the index of
modification needs to be moved up or down one place.
modification needs to be moved up or down 1 place.
The fastest way to add onto the end of the list is to use
``my_list.append(list_item)`` or ``my_list.extend(some_list)`` and
to remove an item is ``my_list.pop()`` or ``del my_list[-1]``.
The most simple way to add onto the end of the list is to use
``my_list.append(list_item)`` or ``my_list.extend(some_list)`` and the fastest way to
remove an item is ``my_list.pop()`` or ``del my_list[-1]``.
To use an index you can use ``my_list.insert(index, list_item)`` or ``list.pop(index)``
for list removal, but these are slower.
Sometimes it's faster (but less memory efficient) to just rebuild the list.
For example if you want to remove all triangular polygons in a list.
Rather than:
Sometimes its faster (but more memory hungry) to just rebuild the list.
Say you want to remove all triangular polygons in a list.
Rather than...
.. code-block:: python
@@ -167,7 +179,7 @@ Rather than:
polygons.pop(p_idx) # remove the triangle
It's faster to build a new list with list comprehension:
It's faster to build a new list with list comprehension.
.. code-block:: python
@@ -177,14 +189,14 @@ It's faster to build a new list with list comprehension:
Adding List Items
^^^^^^^^^^^^^^^^^
If you have a list that you want to add onto another list, rather than:
If you have a list that you want to add onto another list, rather than...
.. code-block:: python
for l in some_list:
my_list.append(l)
Use:
Use...
.. code-block:: python
@@ -193,7 +205,9 @@ Use:
Note that insert can be used when needed,
but it is slower than append especially when inserting at the start of a long list.
This example shows a very suboptimal way of making a reversed list:
This example shows a very sub-optimal way of making a reversed list.
.. code-block:: python
@@ -205,6 +219,7 @@ This example shows a very suboptimal way of making a reversed list:
Python provides more convenient ways to reverse a list using the slice method,
but you may want to time this before relying on it too much:
.. code-block:: python
some_reversed_list = some_list[::-1]
@@ -213,10 +228,12 @@ but you may want to time this before relying on it too much:
Removing List Items
^^^^^^^^^^^^^^^^^^^
Use ``my_list.pop(index)`` rather than ``my_list.remove(list_item)``.
Use ``my_list.pop(index)`` rather than ``my_list.remove(list_item)``
This requires you to have the index of the list item but is faster since ``remove()`` will search the list.
Here is an example of how to remove items in one loop,
removing the last items first, which is faster (as explained above):
Here is an example of how to remove items in 1 loop,
removing the last items first, which is faster (as explained above).
.. code-block:: python
@@ -230,7 +247,7 @@ removing the last items first, which is faster (as explained above):
This example shows a fast way of removing items,
for use in cases where you can alter the list order without breaking the scripts functionality.
This works by swapping two list items, so the item you remove is always last:
This works by swapping 2 list items, so the item you remove is always last.
.. code-block:: python
@@ -243,59 +260,64 @@ This works by swapping two list items, so the item you remove is always last:
my_list.pop()
When removing many items in a large list this can provide a good speed-up.
When removing many items in a large list this can provide a good speedup.
Avoid Copying Lists
^^^^^^^^^^^^^^^^^^^
When passing a list or dictionary to a function,
When passing a list/dictionary to a function,
it is faster to have the function modify the list rather than returning
a new list so Python doesn't have to duplicate the list in memory.
a new list so python doesn't have to duplicate the list in memory.
Functions that modify a list in-place are more efficient than functions that create new lists.
This is generally slower so only use for functions when it makes sense not to modify the list in place:
This is generally slower so only use for functions when it makes sense not to modify the list in place.
>>> my_list = some_list_func(my_list)
This is generally faster since there is no re-assignment and no list duplication:
This is generally faster since there is no re-assignment and no list duplication.
>>> some_list_func(vec)
Also note that, passing a sliced list makes a copy of the list in Python memory:
Also note that passing a sliced list makes a copy of the list in python memory.
>>> foobar(my_list[:])
If my_list was a large array containing 10,000's of items, a copy could use a lot of extra memory.
If my_list was a large array containing 10000's of items, a copy could use a lot of extra memory.
Writing Strings to a File (Python General)
------------------------------------------
Here are three ways of joining multiple strings into one string for writing.
This also applies to any area of your code that involves a lot of string joining:
String concatenation
This is the slowest option, do **not** use if you can avoid it, especially when writing data in a loop.
>>> file.write(str1 + " " + str2 + " " + str3 + "\n")
String formatting
Use this when you are writing string data from floats and ints.
>>> file.write("%s %s %s\n" % (str1, str2, str3))
String joining
Use to join a list of strings (the list may be temporary). In the following example, the strings are joined with
a space " " in between, other examples are "" or ", ".
>>> file.write(" ".join((str1, str2, str3, "\n")))
Here are 3 ways of joining multiple strings into one string for writing.
This also applies to any area of your code that involves a lot of string joining.
Join is fastest on many strings, string formatting is quite fast too (better for converting data types).
String concatenation is the slowest.
``String addition`` -
this is the slowest option, *don't use if you can help it, especially when writing data in a loop*.
>>> file.write(str1 + " " + str2 + " " + str3 + "\n")
``String formatting`` -
use this when you are writing string data from floats and ints.
>>> file.write("%s %s %s\n" % (str1, str2, str3))
``String join() function``
use to join a list of strings (the list may be temporary). In the following example, the strings are joined with a space " " in between, other examples are "" or ", ".
>>> file.write(" ".join([str1, str2, str3, "\n"]))
Join is fastest on many strings,
`string formatting <https://wiki.blender.org/index.php/Dev:Source/Modeling/BMesh/Design>`__
is quite fast too (better for converting data types). String arithmetic is slowest.
Parsing Strings (Import/Exporting)
@@ -311,35 +333,36 @@ Parsing Numbers
^^^^^^^^^^^^^^^
Use ``float(string)`` rather than ``eval(string)``, if you know the value will be an int then ``int(string)``,
``float()`` will work for an int too but it is faster to read ints with ``int()``.
float() will work for an int too but it is faster to read ints with int().
Checking String Start/End
^^^^^^^^^^^^^^^^^^^^^^^^^
If you are checking the start of a string for a keyword, rather than:
If you are checking the start of a string for a keyword, rather than...
>>> if line[0:5] == "vert ": ...
Use:
use...
>>> if line.startswith("vert "):
Using ``startswith()`` is slightly faster (around 5%) and also avoids a possible error
with the slice length not matching the string length.
Using ``startswith()`` is slightly faster (approx 5%) and also avoids a possible
error with the slice length not matching the string length.
``my_string.endswith("foo_bar")`` can be used for line endings too.
my_string.endswith("foo_bar") can be used for line endings too.
If you are unsure whether the text is upper or lower case, use the ``lower()`` or ``upper()`` string function:
If you are unsure whether the text is upper or lower case, use the ``lower()`` or ``upper()`` string function.
>>> if line.lower().startswith("vert ")
Error Handling
--------------
Use try/except Sparingly
------------------------
The **try** statement is useful to save time writing error checking code.
However, **try** is significantly slower than an **if** since an exception has to be set each time,
However **try** is significantly slower than an **if** since an exception has to be set each time,
so avoid using **try** in areas of your code that execute in a loop and runs many times.
There are cases where using **try** is faster than checking whether the condition will raise an error,
@@ -359,7 +382,7 @@ In cases where you know you are checking for the same value which is referenced
Time Your Code
--------------
While developing a script it is good to time it to be aware of any changes in performance, this can be done simply:
While developing a script it is good to time it to be aware of any changes in performance, this can be done simply.
.. code-block:: python

View File

@@ -4,7 +4,7 @@ Gotchas
*******
This document attempts to help you work with the Blender API in areas
that can be troublesome and avoid practices that are known to cause instability.
that can be troublesome and avoid practices that are known to give instability.
.. _using_operators:
@@ -12,13 +12,13 @@ that can be troublesome and avoid practices that are known to cause instability.
Using Operators
===============
Blender's operators are tools for users to access, that can access with Python too which is very useful.
Still operators have limitations that can make them cumbersome to script.
Blender's operators are tools for users to access, that Python can access them too is very useful
nevertheless operators have limitations that can make them cumbersome to script.
The main limits are:
Main limits are...
- Can't pass data such as objects, meshes or materials to operate on (operators use the context instead).
- The return value from calling an operator is the success (if it finished or was canceled),
- Can't pass data such as objects, meshes or materials to operate on (operators use the context instead)
- The return value from calling an operator gives the success (if it finished or was canceled),
in some cases it would be more logical from an API perspective to return the result of the operation.
- Operators poll function can fail where an API function would raise an exception giving details on exactly why.
@@ -34,23 +34,26 @@ When calling an operator gives an error like this:
Which raises the question as to what the correct context might be?
Typically operators check for the active area type, a selection or active object they can operate on,
but some operators are more strict when they run.
In most cases you can figure out what context an operator needs
by examining how it's used in Blender and thinking about what it does.
but some operators are more picky about when they run.
In most cases you can figure out what context an operator needs
simply be seeing how it's used in Blender and thinking about what it does.
Unfortunately if you're still stuck - the only way to **really** know
what's going on is to read the source code for the poll function and see what its checking.
If you're still stuck, unfortunately, the only way to eventually know what is causing the error is
to read the source code for the poll function and see what it is checking.
For Python operators it's not so hard to find the source
since it's included with Blender and the source file and line is included in the operator reference docs.
since it's included with Blender and the source file/line is included in the operator reference docs.
Downloading and searching the C code isn't so simple,
especially if you're not familiar with the C language but by searching the operator name or description
you should be able to find the poll function with no knowledge of C.
especially if you're not familiar with the C language but by searching the
operator name or description you should be able to find the poll function with no knowledge of C.
.. note::
Blender does have the functionality for poll functions to describe why they fail,
but its currently not used much, if you're interested to help improve the API
feel free to add calls to ``CTX_wm_operator_poll_msg_set`` where its not obvious why poll fails, e.g:
but its currently not used much, if you're interested to help improve our API
feel free to add calls to ``CTX_wm_operator_poll_msg_set`` where its not obvious why poll fails.
>>> bpy.ops.gpencil.draw()
RuntimeError: Operator bpy.ops.gpencil.draw.poll() Failed to find Grease Pencil data to draw into
@@ -60,7 +63,7 @@ The operator still doesn't work!
--------------------------------
Certain operators in Blender are only intended for use in a specific context,
some operators for example are only called from the properties editor where they check the current material,
some operators for example are only called from the properties window where they check the current material,
modifier or constraint.
Examples of this are:
@@ -71,8 +74,8 @@ Examples of this are:
- :mod:`bpy.ops.buttons.file_browse`
Another possibility is that you are the first person to attempt to use this operator
in a script and some modifications need to be made to the operator to run in a different context.
If the operator should logically be able to run but fails when accessed from a script
in a script and some modifications need to be made to the operator to run in a different context,
if the operator should logically be able to run but fails when accessed from a script
it should be reported to the bug tracker.
@@ -82,20 +85,22 @@ Stale Data
No updates after setting values
-------------------------------
Sometimes you want to modify values from Python and immediately access the updated values, e.g:
Sometimes you want to modify values from Python and immediately access the updated values, eg:
Once changing the objects :class:`bpy.types.Object.location`
you may want to access its transformation right after from :class:`bpy.types.Object.matrix_world`,
but this doesn't work as you might expect.
Consider the calculations that might contribute to the object's final transformation, this includes:
Consider the calculations that might go into working out the object's final transformation, this includes:
- Animation function curves.
- Drivers and their Python expressions.
- Constraints
- Parent objects and all of their F-curves, constraints, etc.
- animation function curves.
- drivers and their Python expressions.
- constraints
- parent objects and all of their f-curves, constraints etc.
To avoid expensive recalculations every time a property is modified,
Blender defers the evaluation until the results are needed.
Blender defers making the actual calculations until they are needed.
However, while the script runs you may want to access the updated values.
In this case you need to call :class:`bpy.types.ViewLayer.update` after modifying values, for example:
@@ -105,41 +110,44 @@ In this case you need to call :class:`bpy.types.ViewLayer.update` after modifyin
bpy.context.view_layer.update()
Now all dependent data (child objects, modifiers, drivers, etc.)
Now all dependent data (child objects, modifiers, drivers... etc)
has been recalculated and is available to the script within active view layer.
Can I redraw during script execution?
-------------------------------------
Can I redraw during the script?
-------------------------------
The official answer to this is no, or... *"You don't want to do that"*.
To give some background on the topic:
To give some background on the topic...
While a script executes Blender waits for it to finish and is effectively locked until its done,
while in this state Blender won't redraw or respond to user input.
Normally this is not such a problem because scripts distributed with Blender
tend not to run for an extended period of time,
nevertheless scripts *can* take a long time to complete and it would be nice to see progress in the viewport.
nevertheless scripts *can* take ages to execute and its nice to see what's going on in the view port.
When tools lock Blender in a loop redraw are highly discouraged
since they conflict with Blender's ability to run multiple operators
Tools that lock Blender in a loop and redraw are highly discouraged
since they conflict with Blenders ability to run multiple operators
at once and update different parts of the interface as the tool runs.
So the solution here is to write a **modal** operator, which is an operator that defines a ``modal()`` function,
See the modal operator template in the text editor.
So the solution here is to write a **modal** operator, that is - an operator which defines a modal() function,
See the modal operator template in the text editor.
Modal operators execute on user input or setup their own timers to run frequently,
they can handle the events or pass through to be handled by the keymap or other modal operators.
Examples of a modal operators are Transform, Painting, Fly Navigation and File Select.
Transform, Painting, Fly-Mode and File-Select are example of a modal operators.
Writing modal operators takes more effort than a simple ``for`` loop
that contains draw calls but is more flexible and integrates better with Blender's design.
that happens to redraw but is more flexible and integrates better with Blenders design.
.. rubric:: Ok, Ok! I still want to draw from Python
**Ok, Ok! I still want to draw from Python**
If you insist -- yes it's possible, but scripts that use this hack will not be considered
for inclusion in Blender and any issue with using it will not be considered a bug,
there is also no guaranteed compatibility in future releases.
If you insist - yes its possible, but scripts that use this hack won't be considered
for inclusion in Blender and any issues with using it won't be considered bugs,
this is also not guaranteed to work in future releases.
.. code-block:: python
@@ -149,18 +157,18 @@ there is also no guaranteed compatibility in future releases.
Modes and Mesh Access
=====================
When working with mesh data you may run into the problem where a script fails to run as expected in Edit-Mode.
This is caused by Edit-Mode having its own data which is only written back to the mesh when exiting Edit-Mode.
When working with mesh data you may run into the problem where a script fails to run as expected in edit-mode.
This is caused by edit-mode having its own data which is only written back to the mesh when exiting edit-mode.
A common example is that exporters may access a mesh through ``obj.data`` (a :class:`bpy.types.Mesh`)
when the user is in Edit-Mode, where the mesh data is available but out of sync with the edit mesh.
but the user is in edit-mode, where the mesh data is available but out of sync with the edit mesh.
In this situation you can...
- Exit Edit-Mode before running the tool.
- Exit edit-mode before running the tool.
- Explicitly update the mesh by calling :class:`bmesh.types.BMesh.to_mesh`.
- Modify the script to support working on the edit-mode data directly, see: :mod:`bmesh.from_edit_mesh`.
- Report the context as incorrect and only allow the script to run outside Edit-Mode.
- Report the context as incorrect and only allow the script to run outside edit-mode.
.. _info_gotcha_mesh_faces:
@@ -168,24 +176,24 @@ In this situation you can...
N-Gons and Tessellation
=======================
Since 2.63 n-gons are supported, this adds some complexity
Since 2.63 NGons are supported, this adds some complexity
since in some cases you need to access triangles still (some exporters for example).
There are now three ways to access faces:
There are now 3 ways to access faces:
- :class:`bpy.types.MeshPolygon` --
this is the data structure which now stores faces in Object-Mode
- :class:`bpy.types.MeshPolygon` -
this is the data structure which now stores faces in object mode
(access as ``mesh.polygons`` rather than ``mesh.faces``).
- :class:`bpy.types.MeshLoopTriangle` --
- :class:`bpy.types.MeshLoopTriangle` -
the result of tessellating polygons into triangles
(access as ``mesh.loop_triangles``).
- :class:`bmesh.types.BMFace` --
the polygons as used in Edit-Mode.
- :class:`bmesh.types.BMFace` -
the polygons as used in editmode.
For the purpose of the following documentation,
these will be referred to as polygons, loop triangles and BMesh-faces respectively.
these will be referred to as polygons, loop triangles and bmesh-faces respectively.
Faces with five or more sides will be referred to as ``ngons``.
5+ sided faces will be referred to as ``ngons``.
Support Overview
@@ -208,58 +216,58 @@ Support Overview
- Unusable *(read-only)*.
- Best
* - Export/Output
- Good *(n-gon support)*
- Good *(When n-gons cannot be used)*
- Good *(n-gons, extra memory overhead)*
- Good *(ngon support)*
- Good *(When ngons can't be used)*
- Good *(ngons, extra memory overhead)*
.. note::
Using the :mod:`bmesh` API is completely separate API from :mod:`bpy`,
typically you would use one or the other based on the level of editing needed,
typically you would would use one or the other based on the level of editing needed,
not simply for a different way to access faces.
Creating
--------
All three data types can be used for face creation:
All 3 datatypes can be used for face creation.
- Polygons are the most efficient way to create faces but the data structure is *very* rigid and inflexible,
- polygons are the most efficient way to create faces but the data structure is _very_ rigid and inflexible,
you must have all your vertices and faces ready and create them all at once.
This is further complicated by the fact that each polygon does not store its own vertices,
This is further complicated by the fact that each polygon does not store its own verts,
rather they reference an index and size in :class:`bpy.types.Mesh.loops` which are a fixed array too.
- BMesh-faces are most likely the easiest way to create faces in new scripts,
since faces can be added one by one and the API has features intended for mesh manipulation.
- bmesh-faces are most likely the easiest way for new scripts to create faces,
since faces can be added one by one and the api has features intended for mesh manipulation.
While :class:`bmesh.types.BMesh` uses more memory it can be managed by only operating on one mesh at a time.
Editing
-------
Editing is where the three data types vary most.
Editing is where the 3 data types vary most.
- Polygons are very limited for editing,
changing materials and options like smooth works but for anything else
they are too inflexible and are only intended for storage.
- Tessfaces should not be used for editing geometry because doing so will cause existing n-gons to be tessellated.
- BMesh-faces are by far the best way to manipulate geometry.
- Tessfaces should not be used for editing geometry because doing so will cause existing ngons to be tessellated.
- BMesh-Faces are by far the best way to manipulate geometry.
Exporting
---------
All three data types can be used for exporting,
the choice mostly depends on whether the target format supports n-gons or not.
All 3 data types can be used for exporting,
the choice mostly depends on whether the target format supports ngons or not.
- Polygons are the most direct and efficient way to export providing they convert into the output format easily enough.
- Tessfaces work well for exporting to formats which don't support n-gons,
- Polygons are the most direct & efficient way to export providing they convert into the output format easily enough.
- Tessfaces work well for exporting to formats which don't support ngons,
in fact this is the only place where their use is encouraged.
- BMesh-Faces can work for exporting too but may not be necessary if polygons can be used
since using BMesh gives some overhead because its not the native storage format in Object-Mode.
since using bmesh gives some overhead because its not the native storage format in object mode.
Edit Bones, Pose Bones, Bone... Bones
=====================================
EditBones, PoseBones, Bone... Bones
===================================
Armature Bones in Blender have three distinct data structures that contain them.
If you are accessing the bones through one of them, you may not have access to the properties you really need.
@@ -272,41 +280,43 @@ If you are accessing the bones through one of them, you may not have access to t
Edit Bones
----------
``bpy.context.object.data.edit_bones`` contains an edit bones;
to access them you must set the armature mode to Edit-Mode first (edit bones do not exist in Object or Pose-Mode).
``bpy.context.object.data.edit_bones`` contains a editbones;
to access them you must set the armature mode to edit mode first (editbones do not exist in object or pose mode).
Use these to create new bones, set their head/tail or roll, change their parenting relationships to other bones, etc.
Example using :class:`bpy.types.EditBone` in armature Edit-Mode
which is only possible in Edit-Mode:
Example using :class:`bpy.types.EditBone` in armature editmode:
This is only possible in edit mode.
>>> bpy.context.object.data.edit_bones["Bone"].head = Vector((1.0, 2.0, 3.0))
This will be empty outside of Edit-Mode:
This will be empty outside of editmode.
>>> mybones = bpy.context.selected_editable_bones
Returns an edit bone only in Edit-Mode:
Returns an editbone only in edit mode.
>>> bpy.context.active_bone
Bones (Object-Mode)
Bones (Object Mode)
-------------------
``bpy.context.object.data.bones`` contains bones.
These *live* in Object-Mode, and have various properties you can change,
These *live* in object mode, and have various properties you can change,
note that the head and tail properties are read-only.
Example using :class:`bpy.types.Bone` in Object or Pose-Mode
returning a bone (not an edit bone) outside of Edit-Mode:
Example using :class:`bpy.types.Bone` in object or pose mode:
Returns a bone (not an editbone) outside of edit mode
>>> bpy.context.active_bone
This works, as with Blender the setting can be edited in any mode:
This works, as with blender the setting can be edited in any mode
>>> bpy.context.object.data.bones["Bone"].use_deform = True
Accessible but read-only:
Accessible but read-only
>>> tail = myobj.data.bones["Bone"].tail
@@ -316,42 +326,42 @@ Pose Bones
``bpy.context.object.pose.bones`` contains pose bones.
This is where animation data resides, i.e. animatable transformations
are applied to pose bones, as are constraints and IK-settings.
are applied to pose bones, as are constraints and ik-settings.
Examples using :class:`bpy.types.PoseBone` in Object or Pose-Mode:
Examples using :class:`bpy.types.PoseBone` in object or pose mode:
.. code-block:: python
# Gets the name of the first constraint (if it exists)
bpy.context.object.pose.bones["Bone"].constraints[0].name
# Gets the last selected pose bone (Pose-Mode only)
# Gets the last selected pose bone (pose mode only)
bpy.context.active_pose_bone
.. note::
Notice the pose is accessed from the object rather than the object data,
this is why Blender can have two or more objects sharing the same armature in different poses.
this is why blender can have 2 or more objects sharing the same armature in different poses.
.. note::
Strictly speaking pose bones are not bones, they are just the state of the armature,
Strictly speaking PoseBone's are not bones, they are just the state of the armature,
stored in the :class:`bpy.types.Object` rather than the :class:`bpy.types.Armature`,
yet the real bones are accessible from the pose bones via :class:`bpy.types.PoseBone.bone`.
the real bones are however accessible from the pose bones - :class:`bpy.types.PoseBone.bone`
Armature Mode Switching
-----------------------
While writing scripts that deal with armatures you may find you have to switch between modes,
when doing so take care when switching out of Edit-Mode not to keep references
to the edit bones or their head/tail vectors.
Further access to these will crash Blender so its important the script
when doing so take care when switching out of edit-mode not to keep references
to the edit-bones or their head/tail vectors.
Further access to these will crash blender so its important the script
clearly separates sections of the code which operate in different modes.
This is mainly an issue with Edit-Mode since pose data can be manipulated without having to be in Pose-Mode,
yet for operator access you may still need to enter Pose-Mode.
This is mainly an issue with editmode since pose data can be manipulated without having to be in pose mode,
however for operator access you may still need to enter pose mode.
Data Names
@@ -362,7 +372,8 @@ Naming Limitations
------------------
A common mistake is to assume newly created data is given the requested name.
This can cause bugs when you add data (normally imported) then reference it later by name:
This can cause bugs when you add some data (normally imported) then reference it later by name.
.. code-block:: python
@@ -372,7 +383,7 @@ This can cause bugs when you add data (normally imported) then reference it late
bpy.data.meshes[meshid]
Or with name assignment:
Or with name assignment...
.. code-block:: python
@@ -386,12 +397,12 @@ Data names may not match the assigned values if they exceed the maximum length,
Its better practice not to reference objects by names at all,
once created you can store the data in a list, dictionary, on a class, etc;
once created you can store the data in a list, dictionary, on a class etc,
there is rarely a reason to have to keep searching for the same data by name.
If you do need to use name references, its best to use a dictionary to maintain
a mapping between the names of the imported assets and the newly created data,
this way you don't run this risk of referencing existing data from the blend-file, or worse modifying it.
this way you don't run this risk of referencing existing data from the blend file, or worse modifying it.
.. code-block:: python
@@ -410,14 +421,17 @@ this way you don't run this risk of referencing existing data from the blend-fil
Library Collisions
------------------
Blender keeps data names unique (:class:`bpy.types.ID.name`) so you can't name two objects,
meshes, scenes, etc., the same by accident.
However, when linking in library data from another blend-file naming collisions can occur,
Blender keeps data names unique - :class:`bpy.types.ID.name` so you can't name two objects,
meshes, scenes etc the same thing by accident.
However when linking in library data from another blend file naming collisions can occur,
so its best to avoid referencing data by name at all.
This can be tricky at times and not even Blender handles this correctly in some case
(when selecting the modifier object for e.g. you can't select between multiple objects with the same name),
but its still good to try avoiding these problems in this area.
This can be tricky at times and not even blender handles this correctly in some case
(when selecting the modifier object for eg you can't select between multiple objects with the same name),
but its still good to try avoid problems in this area.
If you need to select between local and library data, there is a feature in ``bpy.data`` members to allow for this.
.. code-block:: python
@@ -440,17 +454,18 @@ If you need to select between local and library data, there is a feature in ``bp
Relative File Paths
===================
Blender's relative file paths are not compatible with standard Python modules such as ``sys`` and ``os``.
Built-in Python functions don't understand Blender's ``//`` prefix which denotes the blend-file path.
Blenders relative file paths are not compatible with standard Python modules such as ``sys`` and ``os``.
A common case where you would run into this problem is when exporting a material with associated image paths:
Built in Python functions don't understand blenders ``//`` prefix which denotes the blend file path.
A common case where you would run into this problem is when exporting a material with associated image paths.
>>> bpy.path.abspath(image.filepath)
When using Blender data from linked libraries there is an unfortunate complication
since the path will be relative to the library rather than the open blend-file.
When the data block may be from an external blend-file pass the library argument from the :class:`bpy.types.ID`.
When using blender data from linked libraries there is an unfortunate complication
since the path will be relative to the library rather than the open blend file.
When the data block may be from an external blend file pass the library argument from the :class:`bpy.types.ID`.
>>> bpy.path.abspath(image.filepath, library=image.library)
@@ -463,15 +478,19 @@ Unicode Problems
Python supports many different encodings so there is nothing stopping you from
writing a script in ``latin1`` or ``iso-8859-15``.
See `PEP 263 <https://www.python.org/dev/peps/pep-0263/>`__.
However, this complicates matters for Blender's Python API because ``.blend`` files don't have an explicit encoding.
To avoid the problem for Python integration and script authors we have decided all strings in blend-files
See `pep-0263 <https://www.python.org/dev/peps/pep-0263/>`_
However this complicates matters for Blender's Python API because ``.blend`` files don't have an explicit encoding.
To avoid the problem for Python integration and script authors we have decided all strings in blend files
**must** be ``UTF-8``, ``ASCII`` compatible.
This means assigning strings with different encodings to an object names for instance will raise an error.
Paths are an exception to this rule since the existence of non-UTF-8 paths on user's file system cannot be ignored.
This means seemingly harmless expressions can raise errors, e.g:
Paths are an exception to this rule since we cannot ignore the existence of non ``UTF-8`` paths on users file-system.
This means seemingly harmless expressions can raise errors, eg.
>>> print(bpy.data.filepath)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 10-21: ordinal not in range(128)
@@ -482,7 +501,7 @@ This means seemingly harmless expressions can raise errors, e.g:
TypeError: bpy_struct: item.attr= val: Object.name expected a string type, not str
Here are two ways around file-system encoding issues:
Here are 2 ways around filesystem encoding issues:
>>> print(repr(bpy.data.filepath))
@@ -493,11 +512,11 @@ Here are two ways around file-system encoding issues:
Unicode encoding/decoding is a big topic with comprehensive Python documentation,
to keep it short about encoding problems -- here are some suggestions:
to avoid getting stuck too deep in encoding problems - here are some suggestions:
- Always use UTF-8 encoding or convert to UTF-8 where the input is unknown.
- Avoid manipulating file paths as strings directly, use ``os.path`` functions instead.
- Use ``os.fsencode()`` or ``os.fsdecode()`` instead of built-in string decoding functions when operating on paths.
- Always use utf-8 encoding or convert to utf-8 where the input is unknown.
- Avoid manipulating filepaths as strings directly, use ``os.path`` functions instead.
- Use ``os.fsencode()`` / ``os.fsdecode()`` instead of built in string decoding functions when operating on paths.
- To print paths or to include them in the user interface use ``repr(path)`` first
or ``"%r" % path`` with string formatting.
@@ -509,11 +528,11 @@ to keep it short about encoding problems -- here are some suggestions:
some importers do this.
Strange Errors when Using the 'Threading' Module
================================================
Strange errors using 'threading' module
=======================================
Python threading with Blender only works properly when the threads finish up before the script does,
for example by using ``threading.join()``.
Python threading with Blender only works properly when the threads finish up before the script does.
By using ``threading.join()`` for example.
Here is an example of threading supported by Blender:
@@ -552,8 +571,8 @@ Here is an example of threading supported by Blender:
t.join()
This an example of a timer which runs many times a second
and moves the default cube continuously while Blender runs **(Unsupported)**.
This an example of a timer which runs many times a second and moves
the default cube continuously while Blender runs **(Unsupported)**.
.. code-block:: python
@@ -573,33 +592,33 @@ and moves the default cube continuously while Blender runs **(Unsupported)**.
Use cases like the one above which leave the thread running once the script finishes
may seem to work for a while but end up causing random crashes or errors in Blender's own drawing code.
So far, no work has been done to make Blender's Python integration thread safe,
so until it's properly supported, it's best not make use of this.
So far, no work has gone into making Blender's Python integration thread safe,
so until its properly supported, best not make use of this.
.. note::
Python threads only allow concurrency and won't speed up your scripts on multiprocessor systems,
the ``subprocess`` and ``multiprocess`` modules can be used with Blender to make use of multiple CPUs too.
Pythons threads only allow co-currency and won't speed up your scripts on multi-processor systems,
the ``subprocess`` and ``multiprocess`` modules can be used with Blender and make use of multiple CPU's too.
Help! My script crashes Blender
===============================
:abbr:`TL;DR (Too long; didn't read.)` Do not keep direct references to Blender data (of any kind)
when modifying the container of that data, and/or when some undo/redo may happen
(e.g. during modal operators execution...).
**TL;DR:** Do not keep direct references to Blender data (of any kind) when modifying the container
of that data, and/or when some undo/redo may happen (e.g. during modal operators execution...).
Instead, use indices (or other data always stored by value in Python, like string keys...),
that allow you to get access to the desired data.
Ideally it would be impossible to crash Blender from Python,
however, there are some problems with the API where it can be made to crash.
Ideally it would be impossible to crash Blender from Python
however there are some problems with the API where it can be made to crash.
Strictly speaking this is a bug in the API but fixing it would mean adding memory verification
on every access since most crashes are caused by the Python objects referencing Blender's memory directly,
on every access since most crashes are caused by the Python objects referencing Blenders memory directly,
whenever the memory is freed or re-allocated, further Python access to it can crash the script.
But fixing this would make the scripts run very slow,
or writing a very different kind of API which doesn't reference the memory directly.
Here are some general hints to avoid running into these problems:
Here are some general hints to avoid running into these problems.
- Be aware of memory limits,
especially when working with large lists since Blender can crash simply by running out of memory.
@@ -612,16 +631,16 @@ Here are some general hints to avoid running into these problems:
- Modules or classes that remain active while Blender is used,
should not hold references to data the user may remove, instead,
fetch data from the context each time the script is activated.
- Crashes may not happen every time, they may happen more on some configurations or operating systems.
- Be careful with recursive patterns, those are very efficient at hiding the issues described here.
- See last subsection about `Unfortunate Corner Cases`_ for some known breaking exceptions.
- Crashes may not happen every time, they may happen more on some configurations/operating-systems.
- Be wary of recursive patterns, those are very efficient at hiding the issues described here.
- See last sub-section about `Unfortunate Corner Cases`_ for some known breaking exceptions.
.. note::
To find the line of your script that crashes you can use the ``faulthandler`` module.
See the `Faulthandler docs <https://docs.python.org/dev/library/faulthandler.html>`__.
See the `faulthandler docs <https://docs.python.org/dev/library/faulthandler.html>`_.
While the crash may be in Blender's C/C++ code,
While the crash may be in Blenders C/C++ code,
this can help a lot to track down the area of the script that causes the crash.
.. note::
@@ -635,7 +654,7 @@ Here are some general hints to avoid running into these problems:
in any possible way.
.. rubric:: Do not:
**Dont:**
.. code-block:: python
@@ -654,7 +673,7 @@ Here are some general hints to avoid running into these problems:
first_item.name = "foobar"
.. rubric:: Do:
**Do:**
.. code-block:: python
@@ -677,31 +696,33 @@ Here are some general hints to avoid running into these problems:
Undo/Redo
---------
Undo invalidates all :class:`bpy.types.ID` instances (Object, Scene, Mesh, Light, etc.).
Undo invalidates all :class:`bpy.types.ID` instances (Object, Scene, Mesh, Lamp... etc).
This example shows how you can tell undo changes the memory locations:
This example shows how you can tell undo changes the memory locations.
>>> hash(bpy.context.object)
-9223372036849950810
>>> hash(bpy.context.object)
-9223372036849950810
Move the active object, then undo:
# ... move the active object, then undo
>>> hash(bpy.context.object)
-9223372036849951740
As suggested above, simply not holding references to data when Blender is used
interactively by the user is the only way to make sure that the script doesn't become unstable.
interactively by the user is the only way to ensure the script doesn't become unstable.
Undo & Library Data
^^^^^^^^^^^^^^^^^^^
One of the advantages with Blender's library linking system that undo
One of the advantages with Blenders library linking system that undo
can skip checking changes in library data since it is assumed to be static.
Tools in Blender are not allowed to modify library data.
But Python does not enforce this restriction.
Python however does not enforce this restriction.
This can be useful in some cases, using a script to adjust material values for example.
But its also possible to use a script to make library data point to newly created local data,
@@ -712,13 +733,13 @@ So it's best to consider modifying library data an advanced usage of the API
and only to use it when you know what you're doing.
Edit-Mode / Memory Access
Edit Mode / Memory Access
-------------------------
Switching mode ``bpy.ops.object.mode_set(mode='EDIT')`` or ``bpy.ops.object.mode_set(mode='OBJECT')``
Switching edit-mode ``bpy.ops.object.mode_set(mode='EDIT')`` / ``bpy.ops.object.mode_set(mode='OBJECT')``
will re-allocate objects data,
any references to a meshes vertices/polygons/UVs, armatures bones,
curves points, etc. cannot be accessed after switching mode.
any references to a meshes vertices/polygons/uvs, armatures bones,
curves points etc cannot be accessed after switching edit-mode.
Only the reference to the data its self can be re-accessed, the following example will crash.
@@ -733,7 +754,7 @@ Only the reference to the data its self can be re-accessed, the following exampl
print(polygons)
So after switching mode you need to re-access any object data variables,
So after switching edit-mode you need to re-access any object data variables,
the following example shows how to avoid the crash above.
.. code-block:: python
@@ -749,7 +770,7 @@ the following example shows how to avoid the crash above.
These kinds of problems can happen for any functions which re-allocate
the object data but are most common when switching mode.
the object data but are most common when switching edit-mode.
Array Re-Allocation
@@ -770,20 +791,21 @@ internally the array which stores this data is re-allocated.
This can be avoided by re-assigning the point variables after adding the new one or by storing
indices to the points rather than the points themselves.
The best way is to sidestep the problem altogether by adding all the points to the curve at once.
This means you don't have to worry about array re-allocation and it's faster too
since re-allocating the entire array for every added point is inefficient.
The best way is to sidestep the problem altogether add all the points to the curve at once.
This means you don't have to worry about array re-allocation and its faster too
since reallocating the entire array for every point added is inefficient.
Removing Data
-------------
**Any** data that you remove shouldn't be modified or accessed afterwards,
this includes: F-curves, drivers, render layers, timeline markers, modifiers, constraints
along with objects, scenes, collections, bones, etc.
this includes f-curves, drivers, render layers, timeline markers, modifiers, constraints
along with objects, scenes, collections, bones.. etc.
The ``remove()`` API calls will invalidate the data they free to prevent common mistakes.
The following example shows how this precaution works:
The ``remove()`` api calls will invalidate the data they free to prevent common mistakes.
The following example shows how this precaution works.
.. code-block:: python
@@ -796,7 +818,7 @@ The following example shows how this precaution works:
But take care because this is limited to scripts accessing the variable which is removed,
the next example will still crash:
the next example will still crash.
.. code-block:: python
@@ -813,8 +835,8 @@ Besides all expected cases listed above, there are a few others that should not
an issue but, due to internal implementation details, currently are:
- ``Object.hide_viewport``, ``Object.hide_select`` and ``Object.hide_render``:
Setting any of those Booleans will trigger a rebuild of Collection caches,
thus breaking any current iteration over ``Collection.all_objects``.
Setting any of those booleans will trigger a rebuild of Collection caches, hence breaking
any current iteration over ``Collection.all_objects``.
sys.exit
@@ -826,5 +848,5 @@ as if Blender is crashing since ``sys.exit()`` will close Blender immediately.
For example, the ``argparse`` module will print an error and exit if the arguments are invalid.
An dirty way of troubleshooting this is to set ``sys.exit = None`` and see what line of Python code is quitting,
An ugly way of troubleshooting this is to set ``sys.exit = None`` and see what line of Python code is quitting,
you could of course replace ``sys.exit`` with your own function but manipulating Python in this way is bad practice.

View File

@@ -1,3 +1,4 @@
.. _info_overview:
*******************
@@ -5,24 +6,24 @@ Python API Overview
*******************
The purpose of this document is to explain how Python and Blender fit together,
covering some of the functionality that may not be obvious from reading the API references
and example scripts.
covering some of the functionality that may not be obvious from reading the API
references and example scripts.
Python in Blender
=================
Blender has an embedded Python interpreter which is loaded when Blender is started
and stays active while Blender is running. This interpreter runs scripts to draw the user interface
and is used for some of Blender's internal tools as well.
Blender has an embedded Python interpreter which is loaded when Blender is started and stays
active while Blender is running. This interpreter runs scripts to draw the user interface
and is used for some of Blenders internal tools as well.
Blender's embedded interpreter provides a typical Python environment, so code from tutorials
on how to write Python scripts can also be run with Blender's interpreter. Blender provides its
on how to write Python scripts can also be run with Blenders interpreter. Blender provides its
Python modules, such as :mod:`bpy` and :mod:`mathutils`, to the embedded interpreter so they can
be imported into a script and give access to Blender's data, classes, and functions.
Scripts that deal with Blender data will need to import the modules to work.
be imported into a script and give access to Blender's data, classes, and functions. Scripts that
deal with Blender data will need to import the modules to work.
Here is a simple example which moves a vertex attached to an object named "Cube":
Here is a simple example which moves a vertex attached to an object named **Cube**:
.. code-block:: python
@@ -30,7 +31,7 @@ Here is a simple example which moves a vertex attached to an object named "Cube"
bpy.data.objects["Cube"].data.vertices[0].co.x += 1.0
This modifies Blender's internal data directly.
When you run this in the interactive console you will see the 3D Viewport update.
When you run this in the interactive console you will see the 3D viewport update.
The Default Environment
@@ -40,7 +41,7 @@ When developing your own scripts it may help to understand how Blender sets up i
Many Python scripts come bundled with Blender and can be used as a reference
because they use the same API that script authors write tools in.
Typical usage for scripts include: user interface, import/export,
scene manipulation, automation, defining your own tool set and customization.
scene manipulation, automation, defining your own toolset and customization.
On startup Blender scans the ``scripts/startup/`` directory for Python modules and imports them.
The exact location of this directory depends on your installation.
@@ -53,8 +54,8 @@ Script Loading
This may seem obvious, but it is important to note the difference between
executing a script directly and importing a script as a module.
Extending Blender by executing a script directly means the classes that the script defines
remain available inside Blender after the script finishes execution.
Extending Blender by executing a script directly means the classes that the script
defines remain available inside Blender after the script finishes execution.
Using scripts this way makes future access to their classes
(to unregister them for example) more difficult compared to importing the scripts as modules.
When a script is imported as a module, its class instances will remain
@@ -62,11 +63,12 @@ inside the module and can be accessed later on by importing that module again.
For this reason it is preferable to avoid directly executing scripts that extend Blender by registering classes.
Here are some ways to run scripts directly in Blender:
- Loaded in the text editor and press *Run Script*.
Here are some ways to run scripts directly in Blender.
- Loaded in the text editor and press **Run Script**.
- Typed or pasted into the interactive console.
- Execute a Python file from the command line with Blender, e.g:
- Execute a Python file from the command line with Blender, eg:
.. code-block:: sh
@@ -75,22 +77,24 @@ Here are some ways to run scripts directly in Blender:
To run as modules:
- The obvious way, ``import some_module`` command from the text editor or interactive console.
- Open as a text data-block and check the *Register* option, this will load with the blend-file.
- Copy into one of the directories ``scripts/startup``, where they will be automatically imported on startup.
- Define as an add-on, enabling the add-on will load it as a Python module.
- The obvious way, ``import some_module`` command from the text window or interactive console.
- Open as a text block and tick "Register" option, this will load with the blend file.
- copy into one of the directories ``scripts/startup``, where they will be automatically imported on startup.
- define as an add-on, enabling the add-on will load it as a Python module.
Add-ons
-------
Some of Blender's functionality is best kept optional,
alongside scripts loaded at startup there are add-ons which are kept in their own directory ``scripts/addons``,
They are only loaded on startup if selected from the user preferences.
Some of Blenders functionality is best kept optional,
alongside scripts loaded at startup we have add-ons which are kept in their own directory ``scripts/addons``,
and only load on startup if selected from the user preferences.
The only difference between add-ons and built-in Python modules is that add-ons must contain a ``bl_info``
variable which Blender uses to read metadata such as name, author, category and URL.
The User Preferences add-on listing uses **bl_info** to display information about each add-on.
The only difference between add-ons and built-in Python modules is that add-ons must contain a ``bl_info`` variable
which Blender uses to read metadata such as name, author, category and project link.
The User Preferences add-on listing uses ``bl_info`` to display information about each add-on.
`See Add-ons <https://wiki.blender.org/index.php/Dev:Py/Scripts/Guidelines/Addons>`__
for details on the ``bl_info`` dictionary.
@@ -101,7 +105,7 @@ Integration through Classes
Running Python scripts in the text editor is useful for testing but you'll
want to extend Blender to make tools accessible like other built-in functionality.
The Blender Python API allows integration for:
The Blender Python api allows integration for:
- :class:`bpy.types.Panel`
- :class:`bpy.types.Menu`
@@ -110,12 +114,13 @@ The Blender Python API allows integration for:
- :class:`bpy.types.KeyingSet`
- :class:`bpy.types.RenderEngine`
This is intentionally limited. Currently, for more advanced features such as mesh modifiers,
object types, or shader nodes, C/C++ must be used.
For Python integration Blender defines methods which are common to all types.
This works by creating a Python subclass of a Blender class which contains variables and functions
specified by the parent class which are predefined to interface with Blender.
specified by the parent class which are pre-defined to interface with Blender.
For example:
@@ -132,20 +137,22 @@ For example:
bpy.utils.register_class(SimpleOperator)
First note that it defines a subclass as a member of :mod:`bpy.types`,
First note that we subclass a member of :mod:`bpy.types`,
this is common for all classes which can be integrated with Blender and
is used to distinguish an Operator from a Panel when registering.
used so we know if this is an Operator and not a Panel when registering.
Both class properties start with a ``bl_`` prefix.
This is a convention used to distinguish Blender properties from those you add yourself.
Next see the execute function, which takes an instance of the operator and the current context.
A common prefix is not used for functions.
Lastly the register function is called, this takes the class and loads it into Blender. See `Class Registration`_.
Regarding inheritance, Blender doesn't impose restrictions on the kinds of class inheritance used,
the registration checks will use attributes and functions defined in parent classes.
Class mix-in example:
class mix-in example:
.. code-block:: python
@@ -166,8 +173,8 @@ While ``__init__()`` and ``__del__()`` will be called if defined,
the class instances lifetime only spans the execution.
So a panel for example will have a new instance for every redraw,
for this reason there is rarely a cause to store variables in the panel instance.
Instead, persistent variables should be stored in Blender's data
so that the state can be restored when Blender is restarted.
Instead, persistent variables should be stored in Blenders
ata so that the state can be restored when Blender is restarted.
.. note::
@@ -175,14 +182,15 @@ so that the state can be restored when Blender is restarted.
So once the class is registered with Blender, instancing the class and calling the functions is left up to Blender.
In fact you cannot instance these classes from the script as you would expect with most Python API's.
To run operators you can call them through the operator API, e.g:
To run operators you can call them through the operator api, eg:
.. code-block:: python
import bpy
bpy.ops.object.simple_operator()
User interface classes are given a context in which to draw, buttons, window, file header, toolbar, etc.,
User interface classes are given a context in which to draw, buttons window, file header, toolbar etc,
then they are drawn when that area is displayed so they are never called by Python scripts directly.
@@ -197,7 +205,7 @@ Module Registration
Blender modules loaded at startup require ``register()`` and ``unregister()`` functions.
These are the *only* functions that Blender calls from your code, which is otherwise a regular Python module.
A simple Blender Python module can look like this:
A simple Blender/Python module can look like this:
.. code-block:: python
@@ -217,15 +225,16 @@ A simple Blender Python module can look like this:
These functions usually appear at the bottom of the script containing class registration sometimes adding menu items.
You can also use them for internal purposes setting up data for your own tools but take care
since register won't re-run when a new blend-file is loaded.
since register won't re-run when a new blend file is loaded.
The register/unregister calls are used so it's possible to toggle add-ons and reload scripts while Blender runs.
If the register calls were placed in the body of the script, registration would be called on import,
meaning there would be no distinction between importing a module or loading its classes into Blender.
This becomes problematic when a script imports classes from another module
making it difficult to manage which classes are being loaded and when.
The last two lines are only for testing:
The last 2 lines are only for testing:
.. code-block:: python
@@ -242,14 +251,9 @@ Class Registration
Registering a class with Blender results in the class definition being loaded into Blender,
where it becomes available alongside existing functionality.
Once this class is loaded you can access it from :mod:`bpy.types`,
using the ``bl_idname`` rather than the classes original name.
.. note::
There are some exceptions to this for class names which aren't guarantee to be unique.
In this case use: :func:`bpy.types.Struct.bl_rna_get_subclass`.
using the bl_idname rather than the classes original name.
When loading a class, Blender performs sanity checks making sure all required properties and functions are found,
that properties have the correct type, and that functions have the right number of arguments.
@@ -261,23 +265,23 @@ Using the function arguments ``def execute(self, context, spam)``, will raise an
``ValueError: expected Operator, SimpleOperator class "execute" function to have 2 args, found 3``
Using ``bl_idname = 1`` will raise:
Using ``bl_idname = 1`` will raise.
``TypeError: validating class error: Operator.bl_idname expected a string type, not int``
Inter-Class Dependencies
^^^^^^^^^^^^^^^^^^^^^^^^
Inter Classes Dependencies
^^^^^^^^^^^^^^^^^^^^^^^^^^
When customizing Blender you may want to group your own settings together,
after all, they will likely have to co-exist with other scripts.
To group these properties classes need to be defined,
for groups within groups or collections within groups
you can't avoid having to deal with the order of registration/unregistration.
you can find yourself having to deal with order of registration/unregistration.
Custom properties groups are themselves classes which need to be registered.
For example, if you want to store material settings for a custom engine:
Say you want to store material settings for a custom engine.
.. code-block:: python
@@ -301,7 +305,7 @@ For example, if you want to store material settings for a custom engine:
.. note::
The class **must be** registered before being used in a property, failing to do so will raise an error:
*The class must be registered before being used in a property, failing to do so will raise an error:*
``ValueError: bpy_struct "Material" registration error: my_custom_props could not register``
@@ -331,17 +335,17 @@ For example, if you want to store material settings for a custom engine:
if __name__ == "__main__":
register()
.. important::
.. note::
The lower most class needs to be registered first and that ``unregister()`` is a mirror of ``register()``.
*The lower most class needs to be registered first and that unregister() is a mirror of register()*
Manipulating Classes
^^^^^^^^^^^^^^^^^^^^
Properties can be added and removed as Blender runs,
normally done on register or unregister but for some special cases
it may be useful to modify types as the script runs.
normally happens on register or unregister but for some
special cases it may be useful to modify types as the script runs.
For example:
@@ -352,7 +356,7 @@ For example:
# remove
del bpy.types.Object.my_float
This works just as well for ``PropertyGroup`` subclasses you define yourself.
This works just as well for PropertyGroup subclasses you define yourself.
.. code-block:: python
@@ -360,7 +364,7 @@ This works just as well for ``PropertyGroup`` subclasses you define yourself.
pass
MyPropGroup.my_float: bpy.props.FloatProperty()
This is equivalent to:
...this is equivalent to:
.. code-block:: python
@@ -368,11 +372,11 @@ This is equivalent to:
my_float: bpy.props.FloatProperty()
Dynamic Class Definition (Advanced)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dynamic Defined-Classes (Advanced)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In some cases the specifier for data may not be in Blender, for example a external render engines shader definitions,
and it may be useful to define them as types and remove them on the fly.
In some cases the specifier for data may not be in Blender, renderman shader definitions
for example, and it may be useful to define them as types and remove them on the fly.
.. code-block:: python

View File

@@ -1,16 +1,19 @@
.. _info_quickstart:
**********
Quickstart
**********
***********************
Quickstart Introduction
***********************
This :abbr:`API (Application Programming Interface)` is generally stable
but some areas are still being extended and improved.
Preface
=======
.. rubric:: Blender Python API features:
This API is generally stable but some areas are still being added and improved.
The Blender/Python API can do the following:
- Edit any data the user interface can (Scenes, Meshes, Particles etc.).
- Modify user preferences, keymaps and themes.
- Modify user preferences, key-maps and themes.
- Run tools with own settings.
- Create user interface elements such as menus, headers and panels.
- Create new tools.
@@ -18,10 +21,10 @@ but some areas are still being extended and improved.
- Create new rendering engines that integrate with Blender.
- Subscribe to changes to data and it's properties.
- Define new settings in existing Blender data.
- Draw in the 3D Viewport using Python.
- Draw in the 3D view using Python.
.. rubric:: (Still) missing features:
The Blender/Python API **can't** (yet)...
- Create new space types.
- Assign custom properties to every type.
@@ -30,21 +33,22 @@ but some areas are still being extended and improved.
Before Starting
===============
This document its intended to familiarize you with Blender Python API
but not to fully cover each topic.
This document isn't intended to fully cover each topic.
Rather, its purpose is to familiarize you with Blender Python API.
A quick list of helpful things to know before starting:
- Blender uses Python 3.x; some online documentation still assumes version 2.x.
- Blender uses Python 3.x; some online documentation still assumes 2.x.
- The interactive console is great for testing one-liners.
It also has autocompletion so you can inspect the API quickly.
- Button tooltips show Python attributes and operator names.
- The context menu of buttons directly links to this API documentation.
- More operator examples can be found in the text editor's template menu.
- Button tool tips show Python attributes and operator names.
- Right clicking on buttons and menu items directly links to API documentation.
- For more examples, the text menu has a templates section where some example operators can be found.
- To examine further scripts distributed with Blender, see:
- ``scripts/startup/bl_ui`` for the user interface.
- ``scripts/startup/bl_operators`` for operators.
| ``scripts/startup/bl_ui`` for the user interface,
| ``scripts/startup/bl_operators`` for operators.
Exact location depends on platform, see:
:ref:`directory layout docs <blender_manual:blender-directory-layout>`.
@@ -55,14 +59,19 @@ Running Scripts
The two most common ways to execute Python scripts are using the built-in
text editor or entering commands in the Python console.
Both the *Text Editor* and *Python Console* are space types you can select from the header.
Both the *Text Editor* and *Python Console* are space types you can select from the view header.
Rather than manually configuring your spaces for Python development,
you can use the *Scripting* workspace accessible from the Topbar tabs.
you may prefer to use the *Scripting* screen, included default with Blender,
accessible from the top headers screen selector.
From the text editor you can open ``.py`` files or paste then from the clipboard, then test using *Run Script*.
The Python Console is typically used for typing in snippets and for testing to get immediate feedback,
but can also have entire scripts pasted into it.
Scripts can also run from the command line with Blender but to learn scripting in Blender this isn't essential.
Scripts can also run from the command line with Blender but to learn Blender/Python this isn't essential.
Key Concepts
@@ -71,13 +80,14 @@ Key Concepts
Data Access
-----------
Accessing Data-Blocks
^^^^^^^^^^^^^^^^^^^^^
Accessing DataBlocks
^^^^^^^^^^^^^^^^^^^^
You can access Blender's data with the Python API in the same way as the animation system or user interface;
this implies that any setting that can be changed via a button can also be changed with Python.
Accessing data from the currently loaded blend-file is done with the module :mod:`bpy.data`.
It gives access to library data, for example:
Python accesses Blender's data in the same way as the animation system and user interface;
this implies that any setting that can be changed via a button can also be changed from Python.
Accessing data from the currently loaded blend file is done with the module :mod:`bpy.data`.
This gives access to library data. For example:
>>> bpy.data.objects
<bpy_collection[3], BlendDataObjects>
@@ -89,11 +99,12 @@ It gives access to library data, for example:
<bpy_collection[1], BlendDataMaterials>
Accessing Collections
^^^^^^^^^^^^^^^^^^^^^
About Collections
^^^^^^^^^^^^^^^^^
You will notice that an index as well as a string can be used to access members of the collection.
Unlike Python dictionaries, both methods are available;
You'll notice that an index as well as a string can be used to access members of the collection.
Unlike Python's dictionaries, both methods are acceptable;
however, the index of a member may change while running Blender.
>>> list(bpy.data.objects)
@@ -109,7 +120,7 @@ however, the index of a member may change while running Blender.
Accessing Attributes
^^^^^^^^^^^^^^^^^^^^
Once you have a data-block, such as a material, object, collection, etc.,
Once you have a data block, such as a material, object, collections etc.,
its attributes can be accessed much like you would change a setting using the graphical interface.
In fact, the tooltip for each button also displays the Python attribute
which can help in finding what settings to change in a script.
@@ -124,8 +135,8 @@ which can help in finding what settings to change in a script.
bpy.data.materials['MyMaterial']
For testing what data to access it's useful to use the Python Console, which is its own space type.
This supports auto-complete, giving you a fast way to explore the data in your file.
For testing what data to access it's useful to use the "Console", which is its own space type.
This supports auto-complete, giving you a fast way to dig into different data in your file.
Example of a data path that can be quickly found via the console:
@@ -138,8 +149,8 @@ Example of a data path that can be quickly found via the console:
Data Creation/Removal
^^^^^^^^^^^^^^^^^^^^^
When you are familiar with other Python APIs you may be surprised that
new data-blocks in the bpy API cannot be created by calling the class:
Those of you familiar with other Python API's may be surprised that
new data-blocks in the bpy API can't be created by calling the class:
>>> bpy.types.Mesh()
Traceback (most recent call last):
@@ -148,10 +159,10 @@ new data-blocks in the bpy API cannot be created by calling the class:
This is an intentional part of the API design.
The Blender Python API can't create Blender data that exists outside the main Blender database
(accessed through :mod:`bpy.data`), because this data is managed by Blender (save, load, undo, append, etc).
The Blender/Python API can't create Blender data that exists outside the main Blender database
(accessed through :mod:`bpy.data`), because this data is managed by Blender (save/load/undo/append... etc).
Data is added and removed via methods on the collections in :mod:`bpy.data`, e.g:
Data is added and removed via methods on the collections in :mod:`bpy.data`, eg:
>>> mesh = bpy.data.meshes.new(name="MyMesh")
>>> print(mesh)
@@ -163,12 +174,14 @@ Data is added and removed via methods on the collections in :mod:`bpy.data`, e.g
Custom Properties
^^^^^^^^^^^^^^^^^
Python can access properties on any data-block that has an ID
(data that can be linked in and accessed from :mod:`bpy.data`).
When assigning a property, you can pick your own names,
these will be created when needed or overwritten if they already exist.
Python can access properties on any datablock that has an ID
(data that can be linked in and accessed from :mod:`bpy.data`.
When assigning a property, you can make up your own names,
these will be created when needed or overwritten if they exist.
This data is saved with the blend-file and copied with objects, for example:
This data is saved with the blend file and copied with objects.
Example:
.. code-block:: python
@@ -188,10 +201,10 @@ This data is saved with the blend-file and copied with objects, for example:
del collection["MySettings"]
Note that these properties can only be assigned basic Python types:
Note that these properties can only be assigned basic Python types.
- int, float, string
- array of ints or floats
- array of ints/floats
- dictionary (only string keys are supported, values must be basic types too)
These properties are valid outside of Python. They can be animated by curves or used in driver paths.
@@ -205,16 +218,18 @@ it's more common to operate on the user's selection.
The context is always available from ``bpy.context`` and can be used to get the active object, scene,
tool settings along with many other attributes.
Some common use cases are:
Common-use cases:
>>> bpy.context.object
>>> bpy.context.selected_objects
>>> bpy.context.visible_bones
Note that the context is read-only, which means that these values cannot be modified directly.
But they can be changed by running API functions or by using the data API.
Note that the context is read-only.
These values cannot be modified directly,
though they may be changed by running API functions or by using the data API.
So ``bpy.context.active_object = obj`` will raise an error.
But ``bpy.context.view_layer.objects.active = obj`` works as expected.
The context attributes change depending on where they are accessed.
@@ -242,7 +257,7 @@ Examples:
.. tip::
The :ref:`Operator Cheat Sheet <blender_manual:bpy.ops.wm.operator_cheat_sheet>`
The :ref:`Operator Cheat Sheet <blender_manual:bpy.ops.wm.operator_cheat_sheet>`.
gives a list of all operators and their default values in Python syntax, along with the generated docs.
This is a good way to get an overview of all Blender's operators.
@@ -250,8 +265,8 @@ Examples:
Operator Poll()
^^^^^^^^^^^^^^^
Many operators have a "poll" function which checks if the cursor
is in a valid area or if the object is in the correct mode (Edit Mode, Weight Paint Mode, etc).
Many operators have a "poll" function which may check that the cursor
is in a valid area or that the object is in the correct mode (Edit Mode, Weight Paint etc).
When an operator's poll function fails within Python, an exception is raised.
For example, calling ``bpy.ops.view3d.render_border()`` from the console raises the following error:
@@ -260,10 +275,10 @@ For example, calling ``bpy.ops.view3d.render_border()`` from the console raises
RuntimeError: Operator bpy.ops.view3d.render_border.poll() failed, context is incorrect
In this case the context must be the 3D Viewport with an active camera.
In this case the context must be the 3d view with an active camera.
To avoid using try-except clauses wherever operators are called, you can call the operators
own ``poll()`` function to check if it can run the operator in the current context.
To avoid using try/except clauses wherever operators are called you can call the operators
own ``poll()`` function to check if it can run in the current context.
.. code-block:: python
@@ -276,10 +291,11 @@ Integration
Python scripts can integrate with Blender in the following ways:
- By defining a render engine.
- By defining a rendering engine.
- By defining operators.
- By defining menus, headers and panels.
- By inserting new buttons into existing menus, headers and panels.
- By inserting new buttons into existing menus, headers and panels
In Python, this is done by defining a class, which is a subclass of an existing type.
@@ -290,52 +306,56 @@ Example Operator
.. literalinclude:: __/__/__/release/scripts/templates_py/operator_simple.py
Once this script runs, ``SimpleOperator`` is registered with Blender
and can be called from Operator Search or added to the toolbar.
and can be called from the operator search popup or added to the toolbar.
To run the script:
#. Start Blender and switch to the Scripting workspace.
#. Click the *New* button in the text editor to create a new text data-block.
#. Copy the code from above and paste it into the text editor.
#. Click on the *Run Script* button.
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it.
#. Start Blender
#. Press :kbd:`Ctrl-Right` twice to change to the Scripting layout.
#. Click the button labeled ``New`` and the confirmation pop up in order to create a new text block.
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame).
#. Click on the button **Run Script**.
#. Move your cursor into the 3D Viewport,
open the :ref:`Operator Search menu <blender_manual:bpy.ops.wm.search_menu>`,
open the :ref:`operator search menu <blender_manual:bpy.ops.wm.search_menu>`,
and type "Simple".
#. Click on the "Simple Operator" item found in search.
.. seealso::
The class members with the ``bl_`` prefix are documented in the API reference :class:`bpy.types.Operator`.
.. seealso:: The class members with the ``bl_`` prefix are documented in the API
reference :class:`bpy.types.Operator`
.. note::
The output from the ``main`` function is sent to the terminal;
in order to see this, be sure to :ref:`use the terminal <use_the_terminal>`.
Example Panel
-------------
Panels are registered as a class, like an operator.
Panels register themselves as a class, like an operator.
Notice the extra ``bl_`` variables used to set the context they display in.
.. literalinclude:: __/__/__/release/scripts/templates_py/ui_panel_simple.py
To run the script:
#. Start Blender and switch to the Scripting workspace.
#. Click the *New* button in the text editor to create a new text data-block.
#. Copy the code from above and paste it into the text editor.
#. Click on the *Run Script* button.
#. Highlight the above code then press :kbd:`Ctrl-C` to copy it.
#. Start Blender.
#. Click on the tab for the *Scripting* workspace.
#. Click the button labeled ``New`` to create a new text block.
#. Press :kbd:`Ctrl-V` to paste the code into the text panel (the upper left frame).
#. Click on the button **Run Script**.
To view the results:
#. Select the default cube.
#. Select the the default cube.
#. Click on the Object properties icon in the buttons panel (far right; appears as a tiny cube).
#. Scroll down to see a panel named "Hello World Panel".
#. Changing the object name also updates *Hello World Panel's* name: field.
#. Scroll down to see a panel named **Hello World Panel**.
#. Changing the object name also updates **Hello World Panel's** Name: field.
Note the row distribution and the label and properties that are defined through the code.
Note the row distribution and the label and properties that are available through the code.
.. seealso:: :class:`bpy.types.Panel`
@@ -344,7 +364,8 @@ Types
=====
Blender defines a number of Python types but also uses Python native types.
Blender's Python API can be split up into three categories.
Blender's Python API can be split up into 3 categories.
Native Types
@@ -353,7 +374,7 @@ Native Types
In simple cases returning a number or a string as a custom type would be cumbersome,
so these are accessed as normal Python types.
- Blender float, int, boolean -> float, int, boolean
- Blender float/int/boolean -> float/int/boolean
- Blender enumerator -> string
>>> C.object.rotation_mode = 'AXIS_ANGLE'
@@ -372,10 +393,11 @@ so these are accessed as normal Python types.
Internal Types
--------------
:class:`bpy.types.bpy_struct` is used for Blender data-blocks and collections.
Also for data that contains its own attributes: collections, meshes, bones, scenes, etc.
Used for Blender data-blocks and collections: :class:`bpy.types.bpy_struct`
There are two main types that wrap Blender's data, one for data-blocks
For data that contains its own attributes collections/meshes/bones/scenes... etc.
There are 2 main types that wrap Blenders data, one for data-blocks
(known internally as ``bpy_struct``), another for properties.
>>> bpy.context.object
@@ -384,13 +406,14 @@ There are two main types that wrap Blender's data, one for data-blocks
>>> C.scene.objects
bpy.data.scenes['Scene'].objects
Note that these types reference Blender's data so modifying them is visible immediately.
Note that these types reference Blender's data so modifying them is immediately visible.
Mathutils Types
---------------
Accessible from :mod:`mathutils` are vectors, quaternions, Euler angles, matrix and color types.
Used for vectors, quaternion, eulers, matrix and color types, accessible from :mod:`mathutils`
Some attributes such as :class:`bpy.types.Object.location`,
:class:`bpy.types.PoseBone.rotation_euler` and :class:`bpy.types.Scene.cursor_location`
can be accessed as special math types which can be used together and manipulated in various useful ways.
@@ -399,13 +422,14 @@ Example of a matrix, vector multiplication:
.. code-block:: python
bpy.context.object.matrix_world @ bpy.context.object.data.verts[0].co
bpy.context.object.matrix_world * bpy.context.object.data.verts[0].co
.. note::
mathutils types keep a reference to Blender's internal data so changes can
be applied back.
Example:
.. code-block:: python
@@ -425,11 +449,13 @@ Example of a matrix, vector multiplication:
Animation
=========
There are two ways to add keyframes through Python.
There are 2 ways to add keyframes through Python.
The first is through key properties directly, which is like inserting a keyframe from the button as a user.
The first is through key properties directly, which is similar to inserting a keyframe from the button as a user.
You can also manually create the curves and keyframe data, then set the path to the property.
Here are examples of both methods. Both insert a keyframe on the active object's Z axis.
Here are examples of both methods.
Both examples insert a keyframe on the active object's Z axis.
Simple example:
@@ -441,7 +467,7 @@ Simple example:
obj.location[2] = 1.0
obj.keyframe_insert(data_path="location", frame=20.0, index=2)
Using low-level functions:
Using Low-Level Functions:
.. code-block:: python

View File

@@ -4,22 +4,23 @@ Tips and Tricks
***************
Here are various suggestions that you might find useful when writing scripts.
Some of these are just Python features that you may not have thought to use with Blender,
others are Blender-specific.
Some of these are just Python features that scripters may not have thought to use with Blender,
others are Blender specific.
.. _use_the_terminal:
Use the Terminal
Use The Terminal
================
When writing Python scripts, it's useful to have a terminal open,
this is not the built-in Python console but a terminal application which is used to start Blender.
The three main use cases for the terminal are:
There are 3 main uses for the terminal, these are:
- You can see the output of ``print()`` as your script runs, which is useful to view debug info.
- The error traceback is printed in full to the terminal which won't always generate an report message in
- The error trace-back is printed in full to the terminal which won't always generate an error popup in
Blender's user interface (depending on how the script is executed).
- If the script runs for too long or you accidentally enter an infinite loop,
:kbd:`Ctrl-C` in the terminal (:kbd:`Ctrl-Break` on Windows) will quit the script early.
@@ -27,25 +28,26 @@ The three main use cases for the terminal are:
.. note::
For Linux and macOS users this means starting the terminal first, then running Blender from within it.
On Windows the terminal can be enabled from the Help menu.
On Windows the terminal can be enabled from the help menu.
Interface Tricks
================
Access Operator Commands
------------------------
You may have noticed that the tooltip for menu items and buttons includes the ``bpy.ops.[...]`` command
You may have noticed that the tooltip for menu items and buttons includes the ``bpy.ops.[...])`` command
to run that button, a handy (hidden) feature is that you can press :kbd:`Ctrl-C` over
any menu item or button to copy this command into the clipboard.
any menu item/button to copy this command into the clipboard.
Access Data Path
----------------
To find the path from an :class:`ID` data-block to its setting isn't always so simple since it may be nested away.
To get this quickly open the context menu of the setting and select *Copy Data Path*,
To find the path from an :class:`ID` datablock to its setting isn't always so simple since it may be nested away.
To get this quickly you can right click on the setting and select select **Copy Data Path**,
if this can't be generated, only the property name is copied.
.. note::
@@ -60,10 +62,11 @@ if this can't be generated, only the property name is copied.
Show All Operators
==================
While Blender logs operators in the Info editor,
this only reports operators with the ``REGISTER`` option enabled so as not to flood the *Info* view
While Blender logs operators in the Info space,
this only reports operators with the ``REGISTER`` option enabeld so as not to flood the *Info* view
with calls to ``bpy.ops.view3d.smoothview`` and ``bpy.ops.view3d.zoom``.
Yet for testing it can be useful to see **every** operator called in a terminal,
However, for testing it can be useful to see **every** operator called in a terminal,
do this by enabling the debug option either by passing the ``--debug-wm`` argument when starting Blender
or by setting :mod:`bpy.app.debug_wm` to ``True`` while Blender is running.
@@ -71,18 +74,20 @@ or by setting :mod:`bpy.app.debug_wm` to ``True`` while Blender is running.
Use an External Editor
======================
Blender's text editor is fine for small changes and writing tests but its not full featured,
Blenders text editor is fine for small changes and writing tests but its not full featured,
for larger projects you'll probably want to use a standalone editor or Python IDE.
Editing a text file externally and having the same text open in Blender does work
but isn't that optimal so here are two ways you can use an external file from Blender.
Using the following examples you'll still need text data-block in Blender to execute,
Editing a text file externally and having the same text open in Blender does work but isn't that optimal
so here are 2 ways you can easily use an external file from Blender.
Using the following examples you'll still need textblock in Blender to execute,
but reference an external file rather than including it directly.
Executing External Scripts
--------------------------
This is the equivalent to running the script directly, referencing a scripts path from a two line code block.
This is the equivalent to running the script directly, referencing a scripts path from a 2 line text-block.
.. code-block:: python
@@ -90,7 +95,7 @@ This is the equivalent to running the script directly, referencing a scripts pat
exec(compile(open(filename).read(), filename, 'exec'))
You might want to reference a script relative to the blend-file.
You might want to reference a script relative to the blend file.
.. code-block:: python
@@ -123,10 +128,9 @@ has to call a function in the module, in this case ``main()`` but it can be any
an advantage with this is you can pass arguments to the function from this
small script which is often useful for testing different settings quickly.
The other issue with this is the script has to be in Python's module search path.
While this is not best practice -- for testing purposes you can extend the search path,
this following example adds the current blend-files directory to the search path
and then loads the script as a module.
The other issue with this is the script has to be in Pythons module search path.
While this is not best practice - for testing you can extend the search path,
this example adds the current blend files directory to the search path, then loads the script as a module.
.. code-block:: python
@@ -144,40 +148,42 @@ and then loads the script as a module.
myscript.main()
Use Blender without it's User Interface
=======================================
Don't Use Blender!
==================
While developing your own scripts Blenders interface can get in the way,
manually reloading, running the scripts, opening file import etc. adds overhead.
While developing your own scripts Blender's interface can get in the way,
manually reloading, running the scripts, opening file import, etc. adds overhead.
For scripts that are not interactive it can end up being more efficient not to use
Blender's interface at all and instead execute the script on the command line.
Blenders interface at all and instead execute the script on the command line.
.. code-block:: sh
blender --background --python myscript.py
You might want to run this with a blend-file so the script has some data to operate on.
You might want to run this with a blend file so the script has some data to operate on.
.. code-block:: sh
blender myscene.blend --background --python myscript.py
.. note::
Depending on your setup you might have to enter the full path to the Blender executable.
Once the script is running properly in background mode, you'll want to check the output of the script,
this depends completely on the task at hand, however, here are some suggestions:
this depends completely on the task at hand however here are some suggestions.
- Render the output to an image, use an image viewer and keep writing over the same image each time.
- Save a new blend-file, or export the file using one of Blender's exporters.
- If the results can be displayed as text then print them or write them to a file.
- render the output to an image, use an image viewer and keep writing over the same image each time.
- save a new blend file, or export the file using one of Blenders exporters.
- if the results can be displayed as text - print them or write them to a file.
While this can take a little time to setup, it can be well worth the effort
to reduce the time it takes to test changes. You can even have
to reduce the time it takes to test changes - you can even have
Blender running the script every few seconds with a viewer updating the results,
so no need to leave your text editor to see changes.
@@ -194,7 +200,7 @@ but to quickly setup your own custom pipeline or writing one-off scripts this ca
Examples include:
- Run Gimp in batch mode to execute custom scripts for advanced image processing.
- Run The Gimp in batch mode to execute custom scripts for advanced image processing.
- Write out 3D models to use external mesh manipulation tools and read back in the results.
- Convert files into recognizable formats before reading.
@@ -203,16 +209,15 @@ Bundled Python & Extensions
===========================
The Blender releases distributed from blender.org include a complete Python installation on all platforms,
this has the disadvantage that any extensions you have installed on your system's Python environment
will not be found by Blender.
this has the disadvantage that any extensions you have installed in your systems Python won't be found by Blender.
There are two ways to work around this:
There are 2 ways around this:
- Remove Blender Python subdirectory, Blender will then fallback on the system's Python and use that instead.
- Remove Blender Python sub-directory, Blender will then fallback on the systems Python and use that instead.
Depending on your platform,
you may need to explicitly reference the location of your Python installation using
the ``PYTHONPATH`` environment variable, e.g:
you may need to explicitly reference the location of your Python installation using the
``PYTHONPATH`` environment variable, eg:
.. code-block:: sh
@@ -221,21 +226,21 @@ There are two ways to work around this:
.. warning::
The Python (major, minor) version must match the one that Blender comes with.
Therefor you can't use Python 3.6 with Blender built to use Python 3.7.
Therefor can't use Python 3.6 with Blender built to use Python 3.7.
- Copy or link the extensions into Blender's Python subdirectory so Blender can access them,
you can also copy the entire Python installation into Blender's subdirectory,
- Copy or link the extensions into Blender's Python sub-directory so Blender can access them,
you could also copy the entire Python installation into Blenders sub-directory,
replacing the one Blender comes with.
This works as long as the Python versions match and the paths are created in the same relative locations.
Doing this has the advantage that you can redistribute this bundle to others with Blender
including any extensions you rely on.
Insert a Python Interpreter into your Script
============================================
Drop Into a Python Interpreter in Your Script
=============================================
In the middle of a script you may want to inspect variables,
run functions and inspect the flow.
In the middle of a script you may want to inspect some variables,
run some function and generally dig about to see what's going on.
.. code-block:: python
@@ -243,7 +248,7 @@ run functions and inspect the flow.
code.interact(local=locals())
If you want to access both global and local variables run this:
If you want to access both global and local variables do this...
.. code-block:: python
@@ -261,7 +266,7 @@ The next example is an equivalent single line version of the script above which
``code.interact`` can be added at any line in the script
and will pause the script to launch an interactive interpreter in the terminal,
and will pause the script an launch an interactive interpreter in the terminal,
when you're done you can quit the interpreter and the script will continue execution.
@@ -274,14 +279,13 @@ The IPython prompt has auto-complete and some useful features that the standard
IPython.embed()
Admittedly this highlights the lack of any Python debugging support built into Blender,
but its still a handy thing to know.
Admittedly this highlights the lack of any Python debugging support built into Blender, but its still handy to know.
Advanced
========
Blender as a Module
Blender as a module
-------------------
From a Python perspective it's nicer to have everything as an extension
@@ -289,22 +293,26 @@ which lets the Python script combine many components.
Advantages include:
- You can use external editors or IDEs with Blender's Python API and execute scripts within the IDE
- you can use external editors/IDE's with Blenders Python API and execute scripts within the IDE
(step over code, inspect variables as the script runs).
- Editors or IDEs can auto-complete Blender modules and variables.
- Existing scripts can import Blender APIs without having to be run inside of Blender.
- editors/IDE's can auto complete Blender modules & variables.
- existing scripts can import Blender API's without having to run inside Blender.
This is marked advanced because to run Blender as a Python module requires a special build option.
For instructions on building see
`Building Blender as a Python module <https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule>`__.
`Building Blender as a Python module <https://wiki.blender.org/wiki/Building_Blender/Other/BlenderAsPyModule>`_
Python Safety (Build Option)
----------------------------
Since it's possible to access data which has been removed (see :doc:`Gotchas <info_gotcha>`),
can make it hard to track down the cause of crashes.
Since it's possible to access data which has been removed (see Gotcha's),
this can be hard to track down the cause of crashes.
To raise Python exceptions on accessing freed data (rather than crashing),
enable the CMake build option ``WITH_PYTHON_SAFETY``.
This enables data tracking which makes data access about two times slower
This enables data tracking which makes data access about 2x slower
which is why the option isn't enabled in release builds.

View File

@@ -83,8 +83,6 @@ import inspect
import shutil
import logging
from textwrap import indent
from platform import platform
PLATFORM = platform().split('-')[0].lower() # 'linux', 'darwin', 'windows'
@@ -359,7 +357,7 @@ INFO_DOCS = (
("info_tips_and_tricks.rst",
"Tips and Tricks: Hints to help you while writing scripts for Blender"),
("info_gotcha.rst",
"Gotcha's: some of the problems you may encounter when writing scripts"),
"Gotcha's: some of the problems you may come up against when writing scripts"),
("change_log.rst", "List of changes since last Blender release"),
)
@@ -405,21 +403,32 @@ MODULE_GROUPING = {
# -------------------------------BLENDER----------------------------------------
blender_version_strings = [str(v) for v in bpy.app.version]
is_release = bpy.app.version_cycle in {"rc", "release"}
# converting bytes to strings, due to T30154
BLENDER_REVISION = str(bpy.app.build_hash, 'utf_8')
# '2.83.0 Beta' or '2.83.0' or '2.83.1'
BLENDER_VERSION_DOTS = bpy.app.version_string
if is_release:
# '2.62a'
BLENDER_VERSION_DOTS = ".".join(blender_version_strings[:2]) + bpy.app.version_char
else:
# '2.62.1'
BLENDER_VERSION_DOTS = ".".join(blender_version_strings)
if BLENDER_REVISION != "Unknown":
# SHA1 Git hash
# '2.62a SHA1' (release) or '2.62.1 SHA1' (non-release)
BLENDER_VERSION_HASH = BLENDER_REVISION
else:
# Fallback: Should not be used
BLENDER_VERSION_HASH = "Hash Unknown"
# '2_83'
BLENDER_VERSION_PATH = "%d_%d" % (bpy.app.version[0], bpy.app.version[1])
if is_release:
# '2_62a_release'
BLENDER_VERSION_PATH = "%s%s_release" % ("_".join(blender_version_strings[:2]), bpy.app.version_char)
else:
# '2_62_1'
BLENDER_VERSION_PATH = "_".join(blender_version_strings)
# --------------------------DOWNLOADABLE FILES----------------------------------
@@ -440,30 +449,25 @@ if ARGS.sphinx_build:
if ARGS.log:
SPHINX_BUILD_LOG = os.path.join(ARGS.output_dir, ".sphinx-build.log")
SPHINX_BUILD = [
"sphinx-build",
"-w", SPHINX_BUILD_LOG,
SPHINX_IN, SPHINX_OUT,
]
SPHINX_BUILD = ["sphinx-build",
"-w", SPHINX_BUILD_LOG,
SPHINX_IN, SPHINX_OUT]
# pdf build
if ARGS.sphinx_build_pdf:
SPHINX_OUT_PDF = os.path.join(ARGS.output_dir, "sphinx-out_pdf")
SPHINX_BUILD_PDF = [
"sphinx-build",
"-b", "latex",
SPHINX_IN, SPHINX_OUT_PDF,
]
SPHINX_BUILD_PDF = ["sphinx-build",
"-b", "latex",
SPHINX_IN, SPHINX_OUT_PDF]
SPHINX_MAKE_PDF = ["make", "-C", SPHINX_OUT_PDF]
SPHINX_MAKE_PDF_STDOUT = None
if ARGS.log:
SPHINX_BUILD_PDF_LOG = os.path.join(ARGS.output_dir, ".sphinx-build_pdf.log")
SPHINX_BUILD_PDF = [
"sphinx-build", "-b", "latex",
"-w", SPHINX_BUILD_PDF_LOG,
SPHINX_IN, SPHINX_OUT_PDF,
]
SPHINX_BUILD_PDF = ["sphinx-build", "-b", "latex",
"-w", SPHINX_BUILD_PDF_LOG,
SPHINX_IN, SPHINX_OUT_PDF]
sphinx_make_pdf_log = os.path.join(ARGS.output_dir, ".latex_make.log")
SPHINX_MAKE_PDF_STDOUT = open(sphinx_make_pdf_log, "w", encoding="utf-8")
@@ -488,11 +492,6 @@ if _BPY_PROP_COLLECTION_FAKE:
else:
_BPY_PROP_COLLECTION_ID = "collection"
if _BPY_STRUCT_FAKE:
bpy_struct = bpy.types.bpy_struct
else:
bpy_struct = None
def escape_rst(text):
""" Escape plain text which may contain characters used by RST.
@@ -513,7 +512,7 @@ def is_struct_seq(value):
def undocumented_message(module_name, type_name, identifier):
return "Undocumented, consider `contributing <https://developer.blender.org/T51061>`__."
return "Undocumented `contribute <https://developer.blender.org/T51061>`"
def range_str(val):
@@ -695,13 +694,11 @@ def py_descr2sphinx(ident, fw, descr, module_name, type_name, identifier):
doc = undocumented_message(module_name, type_name, identifier)
if type(descr) == GetSetDescriptorType:
fw(ident + ".. attribute:: %s\n" % identifier)
fw(ident + " :noindex:\n\n")
fw(ident + ".. attribute:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, doc, False)
fw("\n")
elif type(descr) == MemberDescriptorType: # same as above but use 'data'
fw(ident + ".. data:: %s\n" % identifier)
fw(ident + " :noindex:\n\n")
fw(ident + ".. data:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, doc, False)
fw("\n")
elif type(descr) in {MethodDescriptorType, ClassMethodDescriptorType}:
@@ -741,14 +738,11 @@ def pyprop2sphinx(ident, fw, identifier, py_prop):
'''
# readonly properties use "data" directive, variables use "attribute" directive
if py_prop.fset is None:
fw(ident + ".. data:: %s\n" % identifier)
fw(ident + " :noindex:\n\n")
fw(ident + ".. data:: %s\n\n" % identifier)
else:
fw(ident + ".. attribute:: %s\n" % identifier)
fw(ident + " :noindex:\n\n")
fw(ident + ".. attribute:: %s\n\n" % identifier)
write_indented_lines(ident + " ", fw, py_prop.__doc__)
if py_prop.fset is None:
fw("\n")
fw(ident + " (readonly)\n\n")
else:
fw("\n")
@@ -914,8 +908,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
elif issubclass(value_type, (bool, int, float, str, tuple)):
# constant, not much fun we can do here except to list it.
# TODO, figure out some way to document these!
fw(".. data:: %s\n" % attribute)
fw(" :noindex:\n\n")
fw(".. data:: %s\n\n" % attribute)
write_indented_lines(" ", fw, "constant value %s" % repr(value), False)
fw("\n")
else:
@@ -1033,7 +1026,6 @@ context_type_map = {
"gpencil": ("GreasePencil", False),
"gpencil_data": ("GreasePencil", False),
"gpencil_data_owner": ("ID", False),
"hair": ("Hair", False),
"image_paint_object": ("Object", False),
"lattice": ("Lattice", False),
"light": ("Light", False),
@@ -1050,7 +1042,6 @@ context_type_map = {
"particle_settings": ("ParticleSettings", False),
"particle_system": ("ParticleSystem", False),
"particle_system_editable": ("ParticleSystem", False),
"pointcloud": ("PointCloud", False),
"pose_bone": ("PoseBone", False),
"pose_object": ("Object", False),
"scene": ("Scene", False),
@@ -1125,8 +1116,7 @@ def pycontext2sphinx(basepath):
type_descr = prop.get_type_description(
class_fmt=":class:`bpy.types.%s`", collection_id=_BPY_PROP_COLLECTION_ID)
fw(".. data:: %s\n" % prop.identifier)
fw(" :noindex:\n\n")
fw(".. data:: %s\n\n" % prop.identifier)
if prop.description:
fw(" %s\n\n" % prop.description)
@@ -1171,8 +1161,7 @@ def pycontext2sphinx(basepath):
i = 0
while char_array[i] is not None:
member = ctypes.string_at(char_array[i]).decode(encoding="ascii")
fw(".. data:: %s\n" % member)
fw(" :noindex:\n\n")
fw(".. data:: %s\n\n" % member)
member_type, is_seq = context_type_map[member]
fw(" :type: %s :class:`bpy.types.%s`\n\n" % ("sequence of " if is_seq else "", member_type))
unique.add(member)
@@ -1205,15 +1194,12 @@ def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
break
if ok:
return "".join([
"* ``%s``\n"
"%s.\n" % (
identifier,
# Account for multi-line enum descriptions, allowing this to be a block of text.
indent(", ".join(escape_rst(val) for val in (name, description) if val) or "Undocumented", " "),
)
for identifier, name, description in prop.enum_items
])
return "".join(["* ``%s`` %s.\n" %
(identifier,
", ".join(escape_rst(val) for val in (name, description) if val),
)
for identifier, name, description in prop.enum_items
])
else:
return ""
@@ -1280,7 +1266,7 @@ def pyrna2sphinx(basepath):
fw(ident + ":%s%s:\n\n" % (id_name, identifier))
if prop.name or prop.description:
fw(indent(", ".join(val for val in (prop.name, prop.description) if val), ident + " ") + "\n\n")
fw(ident + " " + ", ".join(val for val in (prop.name, prop.description) if val) + "\n\n")
# special exception, can't use generic code here for enums
if enum_text:
@@ -1319,7 +1305,7 @@ def pyrna2sphinx(basepath):
fw(title_string(title, "="))
fw(".. module:: %s.%s\n\n" % (struct_module_name, struct_id))
fw(".. module:: %s\n\n" % struct_module_name)
# docs first?, ok
write_example_ref("", fw, "%s.%s" % (struct_module_name, struct_id))
@@ -1378,11 +1364,9 @@ def pyrna2sphinx(basepath):
type_descr = prop.get_type_description(class_fmt=":class:`%s`", collection_id=_BPY_PROP_COLLECTION_ID)
# readonly properties use "data" directive, variables properties use "attribute" directive
if 'readonly' in type_descr:
fw(" .. data:: %s\n" % prop.identifier)
fw(" :noindex:\n\n")
fw(" .. data:: %s\n\n" % prop.identifier)
else:
fw(" .. attribute:: %s\n" % prop.identifier)
fw(" :noindex:\n\n")
fw(" .. attribute:: %s\n\n" % prop.identifier)
if prop.description:
fw(" %s\n\n" % prop.description)
@@ -1459,7 +1443,7 @@ def pyrna2sphinx(basepath):
if _BPY_STRUCT_FAKE:
descr_items = [
(key, descr) for key, descr in sorted(bpy_struct.__dict__.items())
(key, descr) for key, descr in sorted(bpy.types.Struct.__bases__[0].__dict__.items())
if not key.startswith("__")
]
@@ -1475,6 +1459,9 @@ def pyrna2sphinx(basepath):
for identifier, py_prop in base.get_py_properties():
lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
for identifier, py_prop in base.get_py_properties():
lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
if lines:
fw(".. rubric:: Inherited Properties\n\n")
@@ -1498,8 +1485,6 @@ def pyrna2sphinx(basepath):
lines.append(" * :class:`%s.%s`\n" % (base.identifier, func.identifier))
for identifier, py_func in base.get_py_functions():
lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
for identifier, py_func in base.get_py_c_functions():
lines.append(" * :class:`%s.%s`\n" % (base.identifier, identifier))
if lines:
fw(".. rubric:: Inherited Functions\n\n")
@@ -1552,7 +1537,7 @@ def pyrna2sphinx(basepath):
fw(title_string(class_name, "="))
fw(".. module:: %s.%s\n" % (class_module_name, class_name))
fw(".. module:: %s\n" % class_module_name)
fw("\n")
if use_subclasses:
@@ -1587,7 +1572,7 @@ def pyrna2sphinx(basepath):
# write fake classes
if _BPY_STRUCT_FAKE:
class_value = bpy_struct
class_value = bpy.types.Struct.__bases__[0]
fake_bpy_type(
"bpy.types", class_value, _BPY_STRUCT_FAKE,
"built-in base class for all classes in bpy.types.", use_subclasses=True,
@@ -1726,8 +1711,8 @@ class PatchedPythonDomain(PythonDomain):
# end workaround
fw("def setup(app):\n")
fw(" app.add_css_file('css/theme_overrides.css')\n")
fw(" app.add_domain(PatchedPythonDomain, override=True)\n\n")
fw(" app.add_stylesheet('css/theme_overrides.css')\n")
fw(" app.override_domain(PatchedPythonDomain)\n\n")
file.close()

View File

@@ -36,10 +36,16 @@ fi
blender_srcdir=$(dirname -- $0)/../..
blender_version_header="$blender_srcdir/source/blender/blenkernel/BKE_blender_version.h"
blender_version=$(grep "BLENDER_VERSION\s" "$blender_version_header" | awk '{print $3}')
blender_version_char=$(grep "BLENDER_VERSION_CHAR\s" "$blender_version_header" | awk '{print $3}')
blender_version_cycle=$(grep "BLENDER_VERSION_CYCLE\s" "$blender_version_header" | awk '{print $3}')
blender_subversion=$(grep "BLENDER_SUBVERSION\s" "$blender_version_header" | awk '{print $3}')
unset blender_version_header
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)
if [ "$blender_version_cycle" = "release" ] ; then
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)$blender_version_char"_release"
else
BLENDER_VERSION=$(expr $blender_version / 100)_$(expr $blender_version % 100)_$blender_subversion
fi
SSH_UPLOAD_FULL=$SSH_UPLOAD/"blender_python_api_"$BLENDER_VERSION

View File

@@ -118,19 +118,21 @@ def main():
# III) Get Blender version info.
getver_file = os.path.join(tmp_dir, "blendver.txt")
getver_script = (r"""import sys, bpy
with open(sys.argv[-1], 'w') as f:
is_release = bpy.app.version_cycle in {'rc', 'release'}
is_beta = bpy.app.version_cycle in {'beta'}
branch = bpy.app.build_branch.split()[0].decode()
f.write('%d\n' % is_release)
f.write('%d\n' % is_beta)
f.write('%s\n' % branch)
f.write('%d.%d\n' % (bpy.app.version[0], bpy.app.version[1]))
f.write('%d.%d\n' % (bpy.app.version[0], bpy.app.version[1])
if (is_release or is_beta) else '%s\n' % branch)
f.write('%d_%d' % (bpy.app.version[0], bpy.app.version[1]))
""")
getver_script = (
"import sys, bpy\n"
"with open(sys.argv[-1], 'w') as f:\n"
" is_release = bpy.app.version_cycle in {'rc', 'release'}\n"
" is_beta = bpy.app.version_cycle in {'beta'}\n"
" branch = bpy.app.build_branch.split()[0].decode()\n"
" f.write('%d\\n' % is_release)\n"
" f.write('%d\\n' % is_beta)\n"
" f.write('%s\\n' % branch)\n"
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char))\n"
" f.write('%d.%d%s\\n' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
" if (is_release or is_beta) else '%s\\n' % branch)\n"
" f.write('%d_%d%s_release' % (bpy.app.version[0], bpy.app.version[1], bpy.app.version_char)\n"
" if is_release else '%d_%d_%d' % bpy.app.version)\n"
)
get_ver_cmd = (args.blender, "--background", "-noaudio", "--factory-startup", "--python-exit-code", "1",
"--python-expr", getver_script, "--", getver_file)
subprocess.run(get_ver_cmd)

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