xyene / cube2sphere Goto Github PK
View Code? Open in Web Editor NEWPython script to map 6 cube (cubemap, skybox) faces into an equirectangular (cylindrical projection, skysphere) map.
License: GNU Affero General Public License v3.0
Python script to map 6 cube (cubemap, skybox) faces into an equirectangular (cylindrical projection, skysphere) map.
License: GNU Affero General Public License v3.0
On my Ubuntu 20 machine, running cube2sphere seems to open up the blender app, and then doesn't do anything..
Strangely, on my other Ubuntu 20 machine, running cube2sphere works fine..
Any ideas on what the problem might be?
add this code to blender_init.py
seem to solve the issue
def enable_gpus(device_type, use_cpus=False):
preferences = bpy.context.preferences
cycles_preferences = preferences.addons["cycles"].preferences
cycles_preferences.refresh_devices()
devices = cycles_preferences.devices
if not devices:
raise RuntimeError("Unsupported device type")
activated_gpus = []
for device in devices:
if device.type == "CPU":
device.use = use_cpus
else:
device.use = True
activated_gpus.append(device.name)
print('activated gpu', device.name)
cycles_preferences.compute_device_type = device_type
bpy.context.scene.cycles.device = "GPU"
return activated_gpus
enable_gpus("CUDA")
Hello Xyene, thank you for providing this awesome tool.
When trying to install (on OSX) using
pip install cube2sphere
I get the following error
Could not find a version that satisfies the requirement cube2sphere (from versions: ) No matching distribution found for cube2sphere
Is this a Python error on my end? Or something that needs to be updated in the project?
I am running Python 5.3.1 with pip 8.1.1
Thanks,
Adam
When I provide Transparent PNG files as the 6 face sources. The output does not keep the transparency, it as a black background.
I tried adding "scene.render.film_transparent = True" to the blender_init.py script but it did not do the trick.
Any suggestions ?
Works perfect! Except the output resolution is always 2048x1024. I checked the projector.blend
file and saw that's the default image size. The settings aren't being transferred to Blender correctly. Manually changing the render resolution to 8192x4096@50% worked for my project.
Blender 2.81a
Python 3.7.4
windows 10
Hello Xyene,
thanks a lot for your script
I am trying to install using pip install cube2sphere but get this
C:\WINDOWS\system32>pip install cube2sphere
Collecting cube2sphere
Using cached cube2sphere-0.1.8.zip (150 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\alejandro\appdata\local\programs\python\python37\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\ALEJAN1\AppData\Local\Temp\pip-install-am3kkxig\cube2sphere\setup.py'"'"'; file='"'"'C:\Users\ALEJAN1\AppData\Local\Temp\pip-install-am3kkxig\cube2sphere\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\ALEJAN1\AppData\Local\Temp\pip-install-am3kkxig\cube2sphere\pip-egg-info'1\AppData\Local\Temp\pip-install-am3kkxig\cube2sphere
cwd: C:\Users\ALEJAN
Complete output (8 lines):
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\ALEJAN1\AppData\Local\Temp\pip-install-am3kkxig\cube2sphere\setup.py", line 4, in 1\AppData\Local\Temp\pip-install-am3kkxig\cube2sphere\ez_setup.py", line 106
import ez_setup
File "C:\Users\ALEJAN
except pkg_resources.VersionConflict, e:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I´m not the most efficient user with coding but will try my best to fix this if there would be a solution
Thanks in advance
When I try to stitch together images I've generated from sphere2cube I just get pink output. I'm using blender 3.4. There was a similar issue listed in sphere2cube that seemed to be fixed when i applied this workaround posted by wk39:
workaround
edit
~/.local/bin/pythonXXX/site-packages/sphere2cube/blender_init.py
(installation directory may differ. you can check by 'pip show sphere2cube')
comment out below line
bpy.data.textures[0].image = bpy.data.images.load("%s" % sys.argv[-6])
add new line
bpy.data.images['test.jpg'].filepath = "%s" % sys.argv[-6]
Anyone find a workaround for cube2sphere as well? Should I just try an older version of blender?
When I run the command cube2sphere
windows just complains there is no command, script, batch file, etc. It installed just fine with pip but apparently didn't register to any globals to use it anywhere. What do I do from here?
I tried both on Windows and Linux now, and both OS's don't recognize "cube2sphere" as a command, and it's not located in default location where pip instals site or dist packages.
The setup appears to be correct unless there is something I'm not seeing:
pip install cube2sphere
Collecting cube2sphere
Downloading https://files.pythonhosted.org/packages/5e/f6/2ce7f7417029b80f69ef40901ad244d80b81ec97f6343b0743fe1cd24312/cube2sphere-0.2.1.tar.gz (150kB)
100% |████████████████████████████████| 153kB 477kB/s
Building wheels for collected packages: cube2sphere
Running setup.py bdist_wheel for cube2sphere ... done
Stored in directory: /home/was/.cache/pip/wheels/91/f9/62/828fd60e067066a7075dd00e57d34f7a41f1ba260763d4f1e5
Successfully built cube2sphere
Installing collected packages: cube2sphere
Successfully installed cube2sphere-0.2.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.