Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to execute Blender: Start on OSX #5

Closed
simsod opened this issue Nov 29, 2018 · 9 comments
Closed

Unable to execute Blender: Start on OSX #5

simsod opened this issue Nov 29, 2018 · 9 comments
Labels
bug Something isn't working

Comments

@simsod
Copy link

simsod commented Nov 29, 2018

Unable to open on OSX

added this to resolve the issue in blender_executable.ts

on OSX blender is packaged in a .app folder-structure which the file-selector on osx recognises as an application. but when starting from commandline, the actual binary should be executed from the folder Contents/MacOS/ inside the blender.app (folder).

Another solution would be to use the 'open' command on osx.

L#4 import * as os from 'os';`
...
L#147     (askUser_BlenderPath)
if (os.platform() === 'darwin') {
     filepath = filepath + '/Contents/MacOS/blender';
}

heh, I started a forked a while back with some tweaks to the overall layout of the vscode plugin, but now I see you´ve implemented a similar solution in the new update :)

@JacquesLucke
Copy link
Owner

Yeah, the code back then was much uglier than now because I just started learning typescript. Should be better now. :)

Thanks for the provided fix. Is it not possible to select the actual binary when you are asked to select the executable?

Will blender always be packaged like that or is this path different for different people?

Can command line arguments be passed to "open" that are forwarded to the application? I'm not sure how well that works in the task system of vs code. Would be nice if you could try that. I guess if it works, using "open" is the preferable solution because it makes less assumptions about the system.

@JacquesLucke
Copy link
Owner

Or we could check if the selected file ends with .app, and if yes, /Contents/MacOS/blender can be added to the path.

Looks like this path is always the same: https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html#//apple_ref/doc/uid/10000123i-CH101-SW1

@simsod
Copy link
Author

simsod commented Nov 29, 2018

in Finder you can right click and do "Show package contents", but that is not available in the open-dialog from vscode atleast.

AFAIK blender is always packaged in a .app when released to OSX, and the path is always blender.app/Contents/MacOS/blender

not sure how it is launched when compiling/debugging the blender sourcecode itself though, I havent dived that far into blender :)

since osx 10.6 you can pass arguments to the 'open' command using --args but I don´t think that is used very widely.

I recently helped solve a bug with machin3tools (for 2.8) regarding osx compatibility (he got the path wrong when reading keymaps inside his plugin) he used this code to solve the issue:

keymappath = os.path.join(bpy.utils.preset_paths(subdir='keyconfig')[0],'blender_27x.py')
inside blender that code returns the blender.app/Content/Resources/.... folder.

yeah your comment from 44secs ago seems like a good solution

@JacquesLucke
Copy link
Owner

https://wiki.blender.org/wiki/Building_Blender/Mac

The last screenshot there indicates that Blender is packaged in the same way when Blender is build from source code.

@JacquesLucke JacquesLucke added the bug Something isn't working label Nov 29, 2018
@JacquesLucke
Copy link
Owner

Can you check if the provided fix works, please?

@simsod
Copy link
Author

simsod commented Nov 29, 2018

Works like a charm!

btw, do you really need the ms-vscode.cpptools as an extension dependency?
Its only used for some use-cases which you barely "support" right now right?

@JacquesLucke
Copy link
Owner

Thanks.

No, I don't really need it right now... Added it before I was sure which features I will support for now.
Does it cause trouble for you?

@simsod
Copy link
Author

simsod commented Nov 29, 2018

nah, well, since its a dependency you have to install it in order to activate the blender-vscode plugin
Which seems unnecessary if you aren´t doing any cpp development but I guess it´s fine :)

@JacquesLucke
Copy link
Owner

True, I'll probably add this dependency back soon anyway, so not sure if I should remove it now.
Will decide before I publish the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants