Code Monkey home page Code Monkey logo

Comments (7)

mikedh avatar mikedh commented on May 28, 2024

Hey Shawn, I haven't actually tested booleans on windows, but the interface is using distutils.spawn.find_executable('blender'). I think that if you add blender to your windows PATH (control panel -> system -> advanced settings -> environment variables) it should be able to find it, you can check to see if trimesh.interfaces.blender.exist is True. If 'blender' from a cmd finds it it seems like distutils probably can too.

I'm not sure if the windows version has the same command line options. I'll try verify it works then add it to the appveyor Windows tests at some point.

from trimesh.

yw5aj avatar yw5aj commented on May 28, 2024

Thank you Mike for the quick reply!

I did try to add C:\Program Files\Blender Foundation\Blender to the path and in cmd if I do where blender it showed up; but still, when I try to do boolean, it says:

  File "<ipython-input-5-3a440a9b7264>", line 1, in <module>
    cmesh = trimesh.boolean.union([tmesh, amesh], 'blender')

  File "C:\Anaconda3\envs\py34\lib\site-packages\trimesh\boolean.py", line 36, in union
    result = _engines[engine](meshes, operation='union')

  File "C:\Anaconda3\envs\py34\lib\site-packages\trimesh\interfaces\blender.py", line 14, in boolean
    raise ValueError('No blender available!')

ValueError: No blender available!

I'll dig into the code base a bit later.

Thanks again!

Shawn

from trimesh.

mikedh avatar mikedh commented on May 28, 2024

Hey Shawn- amongst other things, I added some additional search paths in 954c9f0, and boolean ops work for me in windows with it.

Best,
Mike

from trimesh.

yw5aj avatar yw5aj commented on May 28, 2024

Hi Mike,

Thank you for your response!

I tried it, and initially it was still not working. I then checked my _search_path in trimesh.interfaces.blender, and it shows

ipdb> _search_path
'C:\\Anaconda3\\envs\\py34\\Library\\bin;C:\\Anaconda3\\envs\\py34\\Library\\bin;C:\\Anaconda3\\envs\\py34;C:\\Anaconda3\\envs\\py34\\Library\\mingw-w64\\bin;C:\\Anaconda3\\envs\\py34\\Library\\usr\\bin;C:\\Anaconda3\\envs\\py34\\Library\\bin;C:\\Anaconda3\\envs\\py34\\Scripts;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\SIMULIA\\Commands;C:\\Program Files\\Microsoft MPI\\Bin\\;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\Git\\cmd;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files\\MATLAB\\R2016b\\bin;C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\;C:\\Program Files\\MATLAB\\MATLAB Compiler Runtime\\v82\\runtime\\win64;C:\\SIMULIA\\Abaqus\\Commands;C:\\Program Files\\MATLAB\\R2013b\\bin;C:\\WINDOWS\\system32\\config\\systemprofile\\.dnx\\bin;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Anaconda3;C:\\Anaconda3\\Scripts;C:\\Anaconda3\\Library\\bin;C:\\cygwin64\\bin;C:\\cygwin64\\lib;C:\\Users\\shwang\\AppData\\Local\\atom\\bin;C:\\Program Files\\Blender Foundation\\BlenderC:\\Program Files\\Blender Foundation\\Blender;C:\\Program Files (x86)\\Blender Foundation\\Blender;'

Notice that it has:

;C:\\Program Files\\Blender Foundation\\BlenderC:\\Program Files\\Blender Foundation\\Blender;

So when appending the search path, it is missing a ';'.

A quick and dirty fix that I did is to change https://github.com/mikedh/trimesh/blob/master/trimesh/interfaces/blender.py#L11

to

    _search_path += ';C:\Program Files\Blender Foundation\Blender;'

This might be dirty... I'd be interested in knowing a neater way :)

By the way - in

union: a + (other meshes), **kwargs for a Trimesh
it seems that it is possible to make the output a Trimesh object by passing some kwargs. Could you briefly elaborate on how to do that?

Thanks!

Shawn

from trimesh.

mikedh avatar mikedh commented on May 28, 2024

Ah my bad, thanks for the find! I fixed the search path issue in 423cca9 and added blender to the windows appveyor tests in 8d11d81, which should yell at me if it breaks again.

from trimesh.

mikedh avatar mikedh commented on May 28, 2024

Oh as to the returning a Trimesh object, if you use the mesh.union(other) member function instead of trimesh.boolean.union you'll get a Trimesh object (function in base).

from trimesh.

yw5aj avatar yw5aj commented on May 28, 2024

@mikedh Great! Thank you so much. And thanks for having the split-and-join method - it is nice and clean! :)

from trimesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.