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

Attempting to generate externs for Blender's python module throws an error... #6

Open
ArgosOz opened this issue Dec 7, 2017 · 2 comments

Comments

@ArgosOz
Copy link

ArgosOz commented Dec 7, 2017

Hello...

I run this: python3 Main.py bpy /output/folder

and I get this:

trying to import module: bpy
process module: bpy
process module: bpy.path
:9: (ERROR/3) Unknown interpreted text role "class".
process module: bpy.props
process module: bpy.utils
process module: bpy.utils.units
Error: Not freed memory blocks: 8, total unfreed memory 0.008392 MB

This is the Blender API if you need to see what this is about.

I'm on MacOS.

I built the bpy.so module myself. Here it is if you need it for testing purposes. I couldn't upload here because of the file size, it's 26 MB and zipped. You should put bpy.so into pyextern folder.

And there's this Resources folder, it has to be placed in the pyextern folder's parent directory because bpy.so needs it there. Here it is, Resources.zip I can't upload it here, because it's 19,7 MB.

Thank you very much.

@andyli
Copy link
Owner

andyli commented Jan 22, 2018

Sorry for the late reply.
The problem is that the bpy.utils.units modules contains tests that will be run when the modules are imported. We of course do not want to run them and we are not interested in using the tests, so let's simply skip those modules altogether.
To do so, add some lines to

main.filterModules = function(modname:String):Bool {
return modname != null && moduleNames.exists(function(moduleName){
return
modname == moduleName ||
modname.startsWith(moduleName + ".") &&
(modname.toLowerCase().indexOf("test") == -1) &&
![
"numpy.distutils",
"numpy.f2py.__main__",
"tensorflow.tools.pip_package",
].exists(function(skip) return modname == skip || modname.startsWith(skip + "."));
});
}

@sonygod
Copy link

sonygod commented Jul 31, 2018

@ArgosOz
can you generate blender API externs now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants