1{
2 stdenv,
3 lib,
4 beautifulsoup4,
5 blender,
6 boxx,
7 buildPythonPackage,
8 fetchFromGitHub,
9 fetchPypi,
10 minexr,
11 opencv-python,
12 requests,
13 runCommand,
14 zcs,
15}:
16
17buildPythonPackage rec {
18 pname = "bpycv";
19 version = "0.4.0";
20 format = "setuptools";
21
22 src = fetchPypi {
23 inherit pname version;
24 hash = "sha256-qqNGemDB0aagCXjrECuh6kLksf+KujPejpnXVqFG8GY=";
25 };
26
27 propagatedBuildInputs = [
28 beautifulsoup4
29 minexr
30 zcs
31 requests
32 opencv-python
33 boxx
34 ];
35
36 # pythonImportsCheck = [ "bpycv" ]; # this import depends on bpy that is only available inside blender
37 doCheck = false;
38
39 passthru.tests = {
40 render =
41 runCommand "bpycv-render-test"
42 {
43 BPY_EXAMPLE_DATA = fetchFromGitHub {
44 owner = "DIYer22";
45 repo = "bpycv_example_data";
46 hash = "sha256-dGb6KvbXTGTu5f4AqhA+i4AwTqBoR5SdXk0vsMEcD3Q=";
47 rev = "6ce0e65c107d572011394da16ffdf851e988dbb4";
48 };
49 }
50 ''
51 ${blender.withPackages (ps: [ ps.bpycv ])}/bin/blender-wrapped -b -P ${./bpycv-test.py}
52 '';
53 };
54
55 meta = with lib; {
56 description = "Computer vision utils for Blender";
57 homepage = "https://github.com/DIYer22/bpycv";
58 license = licenses.mit;
59 maintainers = [ maintainers.lucasew ];
60 broken = stdenv.hostPlatform.isAarch64;
61 inherit (blender.meta) platforms;
62 };
63}