htderekliu / blendertoolbox Goto Github PK
View Code? Open in Web Editor NEWSome simple Blender scripts for rendering paper figures
License: Apache License 2.0
Some simple Blender scripts for rendering paper figures
License: Apache License 2.0
Dear HTDerekLiu,
I would like to ask how to use the .py scripts in the folder /demo. For example, I run the script demo_isoline.py in Blender scripting module like this. (I have modified some paths on my computer)
However, there are errors below. I also tried to run these python scripts in some Python IDE, but it still did not work. Is there any experience on how to run these useful strips? Thanks for your help.
System info: Blender 3.2.2 on Windows 10 x64.
Python: Traceback (most recent call last): File "\demo_isoline.py", line 28, in <module> File "D:\OneDrive - HKUST Connect/2_Tools/BlenderToolbox\BlenderToolBox\subdivision.py", line 18, in subdivision bpy.ops.object.modifier_add(type='SUBSURF') File "C:\Portable Program\blender-3.2.2-windows-x64\3.2\scripts\modules\bpy\ops.py", line 115, in __call__ ret = _op_call(self.idname_py(), None, kw) RuntimeError: Operator bpy.ops.object.modifier_add.poll() Context missing active object
Greets, I note that your code can render the shape without any initialization color (texture). So if I want to render a mesh in (.ply) file form that has its own color (texture), which functions could I use or change? Thanks in advance.
Why ```bpy.context.scene.cycles.device = "CPU"''' is need at blenderInit.
It seems that blender is always rendering images with CPU?
I can't find a version of Blender 4.0.0. When using Blender 4.0.2 or 3.6, the rendering process will occupy 100% hard disk and then crash without any error or warning. Mesh of small size like spot.obj can be rendered, but a little bit larger model like armadillo crashes. It seems like it gets stuck at the set shading stage.
How to use my own defined material
Hi,
How to use it? should I install it like addon? I'm asking because I did not installed it.
I have just unziped it entered 'cycles' folder and run with command.
G:\app\BlenderFoundation\Blender2.83\blender.exe --background --python demo_stone.py
here is an end of error message. looks that it doesnt see include.py file...
Thank you,
tj
assign as a type annotation: OBJECT_OT_ahs_convert_curve_to_mesh.is_remove_doubles
assign as a type annotation: OBJECT_OT_ahs_convert_curve_to_mesh.is_uv_pack_islands
Traceback (most recent call last):
File "", line 1, in
File "G:\download\blender\BlenderToolbox-master\cycles\demo_stone.py", line 16, in
from include import *
ModuleNotFoundError: No module named 'include'
Blender quit
Hi Derek,
Thank you for the great library.
Can you please provide an example of how to render an animation if it's possible, like those videos that show interpolation between two shapes, etc?
Keep up the good work.
Best,
Run template_pointCloud.py, we can get a output file 'test.blend'๏ผ but I can not render point cloud in this .blend file. I must run your script to render. Why? This is very inconvenient.
when i used ./demos/demo_edge.py to render edge image on my windows system
get error :
(blender) PS J:\YL\BlenderToolbox> & C:/software/anaconda/envs/blender/python.exe j:/YL/BlenderToolbox/demos/demo_edge.py
cycles rendering with: GPU
PLY Importer: spot: Invalid PLY header.
PLY import of 'spot.ply' took 1.0 ms
Error: PLY Importer: spot: Invalid PLY header.
Traceback (most recent call last):
File "j:\YL\BlenderToolbox\demos\demo_edge.py", line 27, in <module>
mesh = bt.readMesh(meshPath, location, rotation, scale)
File "J:\YL\BlenderToolbox\BlenderToolBox\..\blendertoolbox\readMesh.py", line 25, in readMesh
mesh = readPLY(filePath, location, rotation_euler, scale)
File "J:\YL\BlenderToolbox\BlenderToolBox\..\blendertoolbox\readPLY.py", line 30, in readPLY
bpy.ops.wm.ply_import(filepath=filePath)
File "C:\software\anaconda\envs\blender\lib\site-packages\bpy\4.0\scripts\modules\bpy\ops.py", line 109, in __call__
ret = _op_call(self.idname_py(), kw)
RuntimeError: Error: PLY Importer: spot: Invalid PLY header.
I'm not sure if it's a blendertoolbox problem or a bpy package problem.
Can you help me analyze why? Thank you very much.
Hi @HTDerekLiu,
Thanks for this very useful project.
I'm just reporting a compatibility issue with blender 4.0.2 (the version I've tested). The API may have been updated as I get the following error when reading OBJ:
AttributeError: Calling operator "bpy.ops.import_mesh.ply" error, could not be found
I'ven't (yet) investigated the problem (just rushing some renderings right now;))
Workaround: download and use the Blender LTS version (3.6.7)
Hi Derek,
Thank you for the great library.
Is it possible to provide an example rendering of a vector field on a mesh?
Keep up the good work.
Best,
Dear Derek,
Thanks for the great library.
I was wondering if there is a way to render the depth map using blender, and if so, can you please provide an example if possible?
Thank you in advance!
Dear HTDerekLiu,
I run your default template_pointcloud.py to render a point cloud on my macOS, but I got an error. Can you give me some advice?
(base) lord_liang@zhoujiedeMacBook-Pro BlenderToolbox % /Applications/Blender.app/Contents/MacOS/Blender --background --python template_pointcloud.py
Blender 3.2.0 (hash e05e1e369187 built 2022-06-08 10:34:50)
Read prefs: /Users/lord_liang/Library/Application Support/Blender/3.2/config/userpref.blend
========================================
You are using CPU rendering. Please see the [Notes] section on the GitHub if you want to switch to GPU rendering.
========================================
Successfully imported './meshes/spot_pt.ply' in 0.020 sec
Error: Python: Traceback (most recent call last):
File "/Users/lord_liang/BlenderToolbox/template_pointcloud.py", line 28, in <module>
bt.setMat_pointCloud(mesh, ptColor, ptSize)
File "/Users/lord_liang/BlenderToolbox/BlenderToolBox/setMat_pointCloud.py", line 66, in setMat_pointCloud
IN = tree.nodes['Group Input']
AttributeError: 'NoneType' object has no attribute 'nodes'
Blender quit
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.