Comments (4)
Repeat the code for several times. There is about a 5% chance that an object cannot be displayed. The Z coordinate is - nan m
: )
sorry, youtube blocked the codes and URL I sent, I dunno >.<
from blender_plus_python.
https://github.com/sexfio/blender/blob/main/test.py
from blender_plus_python.
Thanks for sharing your code!
So the issue seems to be in the order of operations in your code.
On line 52
from your example, you are removing the cube before you use the location reference
you got on line 51
https://github.com/sexfio/blender/blob/main/test.py
Basically, there is a good chance that the reference to the location vector object will be invalid.
Notice that I delete the object after using it in my example
https://gist.github.com/CGArtPython/cb53598625fd6dd3f9d1b0f2b49aecb8
This also can be solved by making a copy of the location vector.
You would need to import
import copy
and then
do this
location = copy.copy(cube.location)
So your code would look like this
for cube in cubes:
location = copy.copy(cube.location)
bpy.data.objects.remove(cube)
bpy.ops.mesh.primitive_monkey_add(location=location)
from blender_plus_python.
thank you very much, I made a mistake :)
from blender_plus_python.
Related Issues (6)
- Do you know why the left side of the monkey's left eye is always black after running this code? Didn't I replace the color of 500 faces? HOT 2
- The sequence_editor_stitched_together_clips_done.py does not work from command-line HOT 2
- Emmisive vs Emissive Color
- adding "AgX - " to startup files for "Very High Contrast"
- typos in subdivided_triangulated_cube_part_1_start.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blender_plus_python.