Closed shkodykoshka closed 2 years ago
Already done, and supports other importer addons besides this one.
Where would I put those 2 files?
How about /usr/local/share/man
and /usr/local/bin
, if you really want some kind of formal installation process. Or just access them out of the source directory, which is what I do.
I am sorry, could you explain how to access them out of the source directory? I see that the file has Python code inside, but what program should I use to run it?
You see how it has a shebang line at the start? So you just type the name of the file, and it will run. E.g.
/path/to/import_to_blender «file-to-import» «output-blend-file»
It’s a shell script which automatically launches Blender and loads a Python script into it. The man page gives examples of how to invoke it. You can even give it the name of a compressed archive, and it will extract and import the contents.
Sorry to bother you again, I have the import_to_blender file in the same directory as the file I want to open, but when attempting to launch it using Command Prompt I get the error that it doesn't recognize it as a program. I added a .cmd extension in hopes that it would work, it says that an external program, unar, is needed. It also writes the first few lines of the man page, and then closes itself.
Yup, it needs unar
to do the archive extracting.
Normally the shell should be picked up automatically from the shebang line, you don’t need file extensions for executables on Linux-compatible systems.
I am on Windows, would the same things apply?
I thought that was already Linux-compatible.
Or if that doesn’t work, try Cygwin.
Or, you know, use a proper Linux system.
I installed Debian, unar, and all of its dependencies. I navigated to my directory but I get the error -bash: import_to_blender: command not found
How would I launch it through unar?
It will use unar
automatically as necessary. You just run the script as in the example I gave (more examples in the man page).
I am using the Windows Linux Subsystem to run Debian, which is probably not ideal, and don't have a gui, so how would I install Blender plugins?
Same as on any platform, I guess: use Blender’s “Install” button.
I was able to try to run the script, however I encountered a couple problems:
On Linux the script only imports some of the files, and on others Blender has problems. I am able to manually import the files on Windows, but the script is not able to import them. (I am using Kubuntu, is there a certain distro that I should use for this script?)
On Windows, the script starts running and then gives a couple errors from Blender-GIS-225 addon, and also says that python file is invalid.
What should I do to resolve these problems?
It is possible to write a script that will import several .obj files, or other normal Blender files. I added some code to the "init.py", and I think it is close to working, however I have very little experience with Blender.
My Blender script to import them:
And the code I added into the init file:
I also added the class into classesToRegister. But I am getting error, linked below. If it for some reason doesn't load, message is:
ERROR (wm.operator): C:\blender-git\blender\source\blender\windowmanager\intern\wm_event_system.c:1371 wm_operator_invoke: invalid operator call 'IMPORT_MESH_OT_xna'
Any help would be greatly appreciated.![error](https://user-images.githubusercontent.com/71207101/120882530-5611cd80-c58d-11eb-80ad-0070dd533b6d.png)