FAQ Database Discussion Community


Using Boost.Python to build a shared lib and import it in Blender through Python

python,c++,blender,python-3.4,boost-python
What I currently try to achieve is building a python mapping of my C++ classes through Boost.Python. After this I want to use the resulting shared library in a blender add-on to be able to take advantage of already existing functionality coming from the mapped C++ classes. I can already...

What is this syntax “…” in blender

python,blender
I was looking at the source code of a blender add-on and I saw a new syntax: def elem_name_ensure_class(elem, clss=...): elem_name, elem_class = elem_split_name_class(elem) if clss is not ...: assert(elem_class == clss) return elem_name.decode('utf-8') What is the meaning of ... source: https://github.com/sambler/myblenderaddons/blob/master/io_scene_fbx/import_fbx.py...

Three.js JSONLoader blender model error: property 'length' undefined

json,3d,three.js,undefined,blender
I have been trying out Three.js lately and i used the exporter addon for Blender to test out making models in blender and exporting so i can use them in a three.js program. I included the add-on to blender, and using just the basic cube model of blender, exported it...

Formulating the “close enough to zero” condition

python,blender
Doing calculations with 3D vectors with floating point coordinates. Occasionally, I want to check if a vector is nonzero. However, with floating point numbers, there's always a chance of a rounding error. Please, is there a standard way, in Python, to check if a floating point number is sufficiently close...

Why does the number of vt and v elements in a blender .obj file differ?

c++,opengl,blender
Having followed the instructions of the tutorial https://www.youtube.com/watch?v=yc0b5GcYl3U (How To Unwrap A UV Sphere In Blender) I succeeded in generating a textured sphere within the blender program. Now I want it in my openGL C++ program. To this end I followed the tutorial http://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Load_OBJexported in order to save the sphere...

Exporting morph targets from Blender to Three.js

three.js,blender
This is an example of what I am trying to achieve: http://threejs.org/examples/#webgl_animation_skinning_morph I am exporting a 3D model from Blender (v 2.73) to Three.js (r70), using the exporter from Three.js r69. The model has a skeletal animation, and a number of Shape keys with different facial expressions (eyes open/closed, etc.)....

How to access objects from specific layer in blender game engine

python,game-engine,blender
I want to make a game with progressive level generation. I have some diferent parts of the level on another layer and I spawn them in the first layer using add object in python controller. The problem is when there are multiple objects in the first layer which all have...

Three.js Blender Exports With No Materials

json,three.js,blender
When I export model as a .json file from blender (a model with materials applied) the resulting file has no material applied. In the Three drop down menu, each material is set to NormalBlending, Enable depth writing is checked,and enable depth testing is checked. Again the .josn file has no...

Encode Mesh from text-file

python,text,multidimensional-array,blender,mesh
I want to encode a 3D-Model with this text-syntax-structure to Blender: <p> c(255,84,22) fs(-1) p(-9,-8,27) p(-9,-23,27) p(-7,-24,63) p(-7,-11,63) </p> What's relevant to create the mesh are these: <p> marks a face-container (like in HTMLs) c marks the color p marks the vertex coordinates (min. of 3 in each face-container) </p>...

Something wrong with weighting

blender,mesh,blender-2.67
I have some model, on which I am trying to weight some parts of mesh. On one part something goes wrong - part of textures of mesh is deforms on weight painting. For example, if I use instrument Mix in Weight Paint, some textures goes sticky to some points, which...

faces not appear from some angles in three.js

javascript,three.js,blender
I create very simple models in Blender contains some faces with color materials then export them to Collada format and import into Three.js, the problem is some faces do not appear from some angles of view, i create this model from plane then exclude it to make modeling.

Blender three json export errors

json,three.js,blender
I installed the three.js plugin for blender to export models to json format, i test it with very simple model contains materials of colors without textures but i get errors if i choose materials in options as in attached image, when i do not choose materials option i can export...

Blender Exporting OBJ - material is not exported

textures,blender,.obj
I am new to blender so I don't know how it works properly. Here is my story, I worked on a model and added material to it using the cycles render method. Then I exported the project with these settings To confirm that everything is right, I imported this model...

Three.JS Blender Is Only Exporting A Single Object

three.js,blender
My Model in Blender is comprised of many groups of objects. The Model was exported as a .obj from C4D to Blender. Each group of objects was placed under a Null in Blender. When I export in three.js, only the last selected object in Blender will be exported as a...

blender game engine as simulation tool how to include one time calculations

python,blender
I want to use the blender game engine as a simulation tool for an UAV. I have four points where the UAV should fly to the closest point of the stretched area. Does anyone know how I can include those calculations in a script which runs every few frames. I...

Blend2Java.py Shows Errors While Trying To Export

java,python,blender,vuforia
Trying to export to Vuforia java, I downloaded blend2java from (http://sourceforge.net/projects/blend2java/?source=typ_redirect) So, I create a simple cube. Select Edit Mode and click 'a' to select all points. And then in text editor, I import the export.py file in. But when I run it, it gives me these errors: File "xxx/xxx//xx/export.py"...

Version control of a digital image and the file that produced it

image,git,blender
I'm mostly working on my own with Blender. I create a blend file and use it to render and save an image. Then I fiddle some more, render another image hopefully save the Blender file and then repeat. I try to keep the same version and file names for images...

Blender doesn't like FBX 6100 files

blender,fbx
Blender seems to not want to import a FBX 6100 file. Is there any way I can convert the file, or even better, open it directly from Blender?

Building Blender on Fedora 20, OSL compilation failed

c++,fedora,blender
When trying to build Blender on Fedora 20, I got the following error when running the install_deps.sh script: Linking CXX shared library liboslexec.so [ 81%] Built target oslexec make: *** [all] Error 2 ERROR! OpenShadingLanguage-1.5.11 failed to compile, exiting Does anyone know how to fix this compilation error ?...

Trouble loading simple mesh into OpenGL

c++,visual-studio-2010,opengl,blender,.obj
I need to import a 3D object mesh into my OpenGL code on Visual Studio 2010. I'm relateively new to OpenGL so I've been learning from the following tutorial (Number 7): http://www.opengl-tutorial.org/beginners-tutorials/tutorial-7-model-loading/ Now, the tutorial uses a simple code rather than a library to import ".obj" files Those who've used...

How do I get coordinates from .obj-file in python?

python,matplotlib,blender,.obj
I have this task to convert a 3D-object from a .obj-file (using Blender) into a 2D-picture using matplotlib in python. Converting from 3D to 2D is done using matrices, so thats ok, but I dont know how to get the coordinates from the file. When I print the file's content,...

How can I get shadows in blender game engine?

blender
I'm making a very simple game in blender and for some reason shadows don't work. I tried every kind of light source, including objects with emisions. 'Cast shadow' and 'recieve shadow' check boxes are checked for ol the objects. I tryed all teh methods to dysplay objects. Is there an...

ubuntu python 3.4 no site-packages library [duplicate]

python,ubuntu,python-3.x,module,blender
This question already has an answer here: How do I find the location of my Python site-packages directory? 13 answers I've been trying to import the blender python library into python so I can use it in another python IDE. I followed some steps on the blender wiki page...

Rotate Object around Pivot Point

c#,unity3d,blender,mesh
I am creating gizmos on all the vertices in a mesh, but when I do this, the object is straight up and down, but the gizmos are sideways. As you can see in this image, the character is straight up and down, but the gizmos are rotated 90 degrees, so...

Animated Three.js file not rendering

javascript,three.js,blender
I have made an animation in Blender and I exported it as a Three.js file so that I could display it in my Three.js code. Here is the Javascript code: var loader = new THREE.JSONLoader(); loader.load( "obj/dog5.js", function( geometry ) { mesh = new THREE.Mesh( geometry, new THREE.MeshNormalMaterial() ); mesh.scale.set(...

Is three.js ObjectLoader capable of loading textures?

three.js,textures,blender
three.js version 0.0.70, blender version 2.73a I have a scene exported from blender to three.js json format using new io_three (not io_three_mesh) exporter. I'm able to import the scene into three.js using ObjectLoader: var objectLoader = new THREE.ObjectLoader(); objectLoader.load('assets/models/exportedScene.json', function(imported) { scene.add(imported); }); Unfortunatelly, no texture is applied to an...

Blender Python Material search [closed]

python,list,blender,material
How do I tell a script to compare a string with the names of all materials? This following code does not work: for i in len(bpy.data.materials): if str(color) == bpy.data.materials[i].name: mat = bpy.data.materials[i] mesh.materials.append(mat) break Error: TypeError: 'int' object is not iterable (line 1) Thanks....

SceneKit + Collada + animation

objective-c,animation,blender,scenekit,collada
I am trying to use Apple's SceneKit in order to load a model from Blender in Collada (dae) format, then apply animation on it from another Collada file, just like Apple did in their Banana example. I can do this with their models and animation files, however, if I open...

Can’t Load .fbx from blender to Monogame correctly

c#,blender,monogame
I am using pipeline.exe tool, to convert an .fbx file I made using Blender (using the default Blender 2.73a export settings) to .xnb, and then manually copy and paste it in my content directory (Is this one of the correct ways to convert it properly ?). After watching this video...

Unexpected behavior with the IF function in Blender Game Engine

python,if-statement,game-engine,blender
I am working on a project in BGE and I want to make an object slowly accelerate to its max speed when I press the button. When I press another button it should decelerate and then again slowly accelerate to the top speed in the other direction. Here is the...

Blender fbx import from ascii format

import,ascii,blender,fbx
I have a FBX model which I would like to open in Blender but when I try to import the model it says: ASCII FBX files are not supported. Is there a way to import the model to Blender somehow? I don't have access to any Autodesk software.