Running Blender under Virtualbox I setup a VirtualBox machine under Windows for dev related stuff (python, visual studio etc), everything works except that I cant run  Blender :( it crashes with

 ./blender.exe
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FFD68CC702C
Module  : C:\Windows\system32\VBoxGL.dll

I can see that the gl driver is incompatiple which is fine but I am wondering if there is a way to make it work in some software opengl on Windows guest.

thanks

I have problems running Blender on my Windows 10 notebook. It's an old machine, can't support OpenGL 3.3 (which, as far as I know, is required for running Blender 2.8). I believe you are facing the same issue, VirtualBox can't run OpenGL 3.3, you'll need to run Blender on real hardware - that is, if your PC is at least newer than mine. I would also give you a suggestion, on Win 10 I can't run Blender 2.8, but it runs quite well on my machine when I use Linux - it might be worth a shot.


VSE Voice Over Capability New user evaluating Blender here...

For the Video Editor component of Blender, I fail to locate the ability to record a voice over. Does Blender VSE have the ability to capture audio from a microphone directly to the timeline and save the captured audio as a separate WAV file? Kdenlive, Lightworks, and Davinci Resolve have this ability.

If not, are there plans to add this feature in the future?

I am having trouble finding Linux software with this feature. I can't use DR in Linux due to no H.264 codec support and me having a full AMD system (mobo, CPU, GPU), Lightworks records voice over as MXF file and is very unconventional for editing from what I am used to, and Kdenlive I just do not like not to mention its love of crashing. At this time, I am forced to record narration with Audio Recorder, clean up in Audacity, import the file into Flowblade, and manually sync it with video.

I can tell the VSE in Blender is a sub component as modeling is its main function. It's a bit unconventional to do editing like Lightworks but I can grasp its functionality quicker if I stuck with it. But, there is no reason for me to use it over Flowblade if I have to use the same import/manual sync process for narration. I do like that it is FOSS with no restrictions or licensing vs Lightworks.

No, this feature is not in Blender.

It has been suggested here:
https://blender.community/c/rightclickselect/7cfbbc/
But so far it has only one vote...

However, Shotcut has this feature:
https://www.youtube.com/watch?v=SkLgpx2E6CI


How to make an rod to rotate with another rod both have pivoting point at the origin Being new to Blender I can not figure out a simple animation using the Animation node. The video link is attached with this post for better expalnnation of the problem (https://drive.google.com/file/d/10aujAJhRNYWZe_4z3lPQtQsWOpRGgCPC/view?usp=sharing).
Here my objective is to rotate the red arrow (YZ_Vec) on the YZ plane while the green arrow (Main_Vec) is free to rotate in all directions. The red arrow will follow the rotation of the green arrow while being confined on the YZ plane.To make the red arrow confine on the YZ plane I have applied the limit rotation constraint.
With the help of animation node I have successfully achieved my objective partially, because the red arrow perfectly follows the green arrow during the X rotation but not during the Y rotation.
During the Y rotation the red arrow rotates in opposite of the green arrow. I am expecting the red arrow should moves on the YZ plane during the Y rotation of the green arrow, that would look like the red arrow goes up and down on the YZ plane with the Y rotation of the green arrow.

There's no need for Animation Nodes, here, unless you have reasons. You can used a Locked Track constraint on the red arrow.
Here, an Empty has been parented to the tip of the green arrow, for the red arrow to follow. The red arrow has been given a Locked Track constraint as follows:

.. so it points its own X axis at the Empty, while constrained to the plane whose normal is its own Z. (Apologies for the axes not being the same as yours, you'll just have to swizzle them). The green arrow is free to rotate...

...the red arrow points in the direction of the green arrow's projection onto  the red arrow's XY plane.


Slope of geometry as `fac` input for cycles material I have a terrain with two materials going into a Mix Shader, I want the fac input to be the slope of the terrain. Steep parts should be one color, flat part another.

You can easily blend different shaders based on the angle of an object's face.

You can get the face's angle using the Normal output of the Geometry node. Separate out the axis you need (in my case the Z axis) using a Separate XYZ node. Then I use the ColorRamp node to fine tune the range I want the transition to happen in. Do note a RGB Curves node would work just as well, it is just up to which you prefer.

Here is what those nodes look like rendered.


How to model a plastic food tray? I'm new to blender and would like model a plastic food tray.
Which is the best way to model it ?

Try to model only one half of the object, then enable the Mirror Modifier and check the X and Y boxes under Axis option (remember to have the origin point placed as pictured below). Apply the modifier when you're done with modeling. You may then add the Subsurf and Solidify Modifiers.

You can easily model the curved corners of a tray using the Spin tool. To make the ribs, divide the surface using Loop Cut tool (Ctrl+R). Select one face, press E and then S to scale it a bit.

Now select the next face and press Shift+R to repeat the earlier operation. Do it with all the faces.

Select all faces and extrude them (E)

You may scale them horizontally for better effect. Scale one, click the next one and use the Shift+R shortcut to speed up the process.

Use a Loop Cut tool again to make the edges of the ribs sharper.


Mesh file in Blender I am trying to create a scene in SOFA (Simulation Open Framework ) in which I require to specify  a .msh file(mesh topology)  for a .obj file(model).

Is there any way to generate a .msh file  in blender or a way to convert obj to .msh.

torus.msh

Orbiter Import/Export .MSH Files Addon

The current version of the add-on works only with Blender 2.63 or later with Bmesh (new powerful mesh system with Ngons).

The addon exports and imports geometry, UVs, materials and textures from/into Blender scene.

Installation:

Download the latest Blender build from Graphicall.org
Download the archive from links below

http://gitorious.org/blender-orbiter-io/blender-orbiter-io/archive-tarball/master (.tar.gz),
https://github.com/vlad32768/blender-orbiter-io/zipball/master (.zip)

or you can download Git repository from

git://gitorious.org/blender-orbiter-io/blender-orbiter-io.git
git://github.com/vlad32768/blender-orbiter-io.git

Place io_orbiter_msh.py into Blender's addons directory
Enable module in File->User Preferences->Add-Ons dialog

Notes on .msh import:

You should import meshes from Orbiter installation. The module will autodedect Orbiter directory and load textures from Orbiter installation.
The script doesn't import vertex normals. It seems that Blender often recalculates vertex normals, so it's useless to import them.
If there is one material with different textures in .msh file, the script will create a copy of this material for every texture.
There are no ambient and emissive colors in Blender, so the script doesn't import ambient colors, but calculates emit component
Some models (for example DGIV and DG-XR) have got materials with shiny specular and zero hardness. That doesn't look good in blender.
You can use "Raise small hardness" parameter in file import dialog to set minimal hardness manually

Notes on .msh export

The script exports selected objects. To export the whole scene, select all objects by pressing "a".

1a. Blender has to be in object mode before exporting ( to avoid some Python API issues and, of course, to select mesh objects for export). If not, object mode will be set automatically during export.
Coordinate system: The script does conversion to left handed coordinate system, so there is the proper way to place your model in Blender when you start modeling:

Y axis is the direction of the main thruster's exhaust; -Y is the main thrust direction;
Z axis points UP;
X axis points LEFT.

Materials:

You should use Blender Internal renderer; don't use Cycles if you want to export your model to Blender;
The script exports only the first material of a mesh object;
The script makes Ambient color equal to Diffuse;
Emissive color is equal to Diffuse*emit

Textures

The script exports only the first texture of a material; this texture's type must be "IMAGE".
If you export your model to "file.msh", textures will be saved in "filetex" directory near the .msh file.
"file.msh" should be copied to Orbiter's "Meshes" directory, "filetex" directory
to "Textures" (see TEXTURES section of .msh file)
Blender does not support writing .DDS files. In most cases the script will save .png files (check it).

So you have to convert textures to .dds manually. However, the script writes names with .dds extension in .msh TEXTURES section

(Source: http://www.orbiter-forum.com/showthread.php?t=18661 )


How to have different object info for post-separated objects? The goal is to create an array of planes that display a rotated texture which depends on the object index of each individual plane multiplied by 90 degrees.

Steps of Issue:

Create one large plane mesh and subdivide
Each subdivision is that separated to create a new object
Use the Shader Editor to insert and connect nodes as shown below

The result is that each object has texture that has not been rotated.

First method (answer to the question)

The object index references the object pass which can be used either in the shader editor to pass information to your material relative to each or different groups of objects, or in the compositor with light passes.

But its purpose is not to get automatically incremented each time you create an object.
Thus, you can either manually change their number or use a very simple script to do it automatically.

Open a new workspace of type "Text editor", create a new script with Text > New. Write this (important : You must respect the 4 spaces offset or add a tabulation on the third line else the python interpreter will complain) :

import bpy
for i, obj in enumerate(bpy.context.selected_objects):
    obj.pass_index = i

Then, select all of your plane objects in object mode, and click "Run Script" in the top right corner of your text editor. Voilà !
This method seems to remember the order in which each item of an array has been created so your node network should work.

Important : The mapping node works with radians, so you either have to add a math node set to "To radians" (V2.81+) or type "pi/2" (without the quotation marks and in lower caps) in place of "90"

Second method (exploring the node network)

If what you are trying to achieve is simply to have a plane with regularly places 90° rotated squares, you can achieve that with a single object and a bit of node magic.

Add a "Texture Coordinate" node
Add a "Vector Math" node set to "Absolute", and connect the object output of the Texture Coordinate node to its input
Connect this node to a "Vector Math" node set to "Modulo", and set the second vector to 1,1,1. This will create repeating squares of size 1 in x and y directions.
Connect it to a 'Vector Math' node set to 'Add' and set the second vector to '-0.5,-0.5,-0.5'
Connect it to a 'Mapping' node's 'Vector' input
Add a 'Vector Math' node set to 'Floor' and connect the texture coordinate's object output to its input
Connect it to a 'separate XYZ' node
Add a 'Math' node set to 'add' and connect both the x and y outputs
Connect it to a 'Math' node set to 'Multiply' and write "pi/2" in the second field.
Connect it to the 'Z' input of 'Combine XYZ' and connect it to the rotation input of the mapping node.

Voilà ! Scale your plane way up in edit mode. You now have a repeating pattern along X and Y, which rotates with every new square.
Example with a "Gradient Texture" set to 'Linear' :

No reference to an infamous 4-armed shape intended

Let's go deeper. Let's capitalize on the node flexibility to add a value node which will make the square pattern tweakable.

Add a value node
Connect it to the bottom socket of the "Divide" node
Connect it to bottom socket of the "Modulo" node
Connect it to new "Math" node set to  'Divide' by 2
Connect this to the second field of a "Math" node set to 'Subtract', with the first one set to 0
Finally, connect it to the bottom half of the "Vector Add" node

Result :


How to save shadow catcher image as png? I am brand new to Blender and 3D modeling and I know nothing at all about rendering. I make meshes for game assets that are just exported as objs, but I'd like to let Blender draw shadows for me onto a plane so I can use that image as part of a texture in game. I found out how to make a shadow catcher and I got a shadow, and I found a setting in output properties to save it as png, but I can't figure out how to actually save it. Tutorials skip from output settings to "put the image in Photoshop." Can I save as an image without learning all about rendering/Cycles/Eevee/allthethingsI'mnotreadyfor OR can someone give me a few simple instructions that would let me do it. Otherwise, I'm taking a screen shot of a shadow catcher which I'm sure must be a really dumb way to do it.

You can use cycles to bake the shadow into a texture file. To do so, create a shadow catcher, you can do this by clicking the object properties button after selecting your plane. (It's the orange square) Then once it's a shadow catcher, and you have set up the lights to get the shadow you want, go to render settings, open bake, and select shadow. Now open the material you are using for your shadow catcher and add an image texture node. Press the create new button, choose your resolution and name. Then select it in the node editor. Now just click bake.


How to use a Mesh from one project in another? I've been confused about this one for quite some time now. If I were to create a project of a character by itself, and I created another project with just scenery, how do I put the character into the scenery? I've tried using import, but it won't let me put the full character into the project.

The Import is for other file formats, you're looking for Link Ctrl-Alt-O or Append Shift-F1 both are accessible from the file menu.

While Append creates an independent copy of your appended objects, Link just references them from the original file.

If you char consist of more than a single object, you should group Ctrl-G them, this makes it easier to Append or Link.


Changing node structure during an animation After doing some quick research on animating nodes, all i could find was that you can animate values, but changing the structure was not addressed. I would like to change the order that i composite the layers in since the view changes necessitating this a rearrangement of the node structure. I know i can render select parts of the animation separately and restructure the nodes before doing the next segment, but if i could get it to do that on it's own I could render it all at once while i'm at school or asleep instead of checking in every hour or so to doctor it.

You could create the two node setups you need. (the two versions) and use a Mix node to mix from one setup to the other. You can keyframe the factor to do that automatically.


Adding a "Super Elevation" or Twist to a road I'm trying to figure out how to twist or add a slight rotation to an object at a transition that I can control.

Currently I have half of a road drawn, that's being mirrored, following the array length of a bezier curve, as well as following the curve deformation of said bezier curve.  I want to know if I can add slight twists at certain bends of the road or if it's even possible before I apply the Mirror modifier.

Current sample road looks like so:

Whereas an engineered road would have the road twist to match the curve of the road as seen between these two cross sections (program: Microstation Select Series 2):

A "Normal" Cross Section of a road:

A "Super Elevated" Section of a road:

Once I get the twisting and rotating down, I'm going to tackle trying to make proper intersection, but I want to make sure this is feasible before I go down this route (I'm sure it is but I want the most painless path possible).

EDIT:
The tilt command as suggested by Duarte Farrajota Ramos is close to what I'm looking for but it doesn't solve my problem, but it's something I didn't know about and glad it was brought up.

I don't know if there's some plugin or additional tools out there that will help but to give a better understanding of what I'm shooting for here's a series of images.  I currently have the left side of the road controlled by a percentage line.  That point or line is referencing the center of the road so that if the red line is below 0, it slopes downwards, but if it's above 0, it slopes upwards. (please excuse my atrocious mouse spelling)

I'm sorry for asking something so incredibly specific.  I may just have to do it manually per every section.

I would use an array modifier and a curve modifier on a small portion of the road object. So you model a short piece of road and mirror it and then you add an array modifier to it and create a new bezier curve object. Then you add a curve modifier to your road piece and choose the bezier curve as the curve your curved modifier will use to draw the array on.


Animation will not play Recently, I've been attempting to set up an animation in Blender with the model I've made, but for whatever reason, I cannot get the program to play the animation.

I don't know why this is happening, I set up a starting and ending key frame, but when I press the button for the animation to play, nothing happens.

Because of this problem, I need help on how I can rectify it.

EDIT: After playing around with the model a little bit, I managed set at least a couple of key frames and play an animation.  However, adding key frames is still extremely screwy, with the program deleting key frames for no apparent reason.  I still don't know what I doing wrong with setting up key frames, so I've added a link to my Blend file below.

I tried your file: all fine! Unless I'm missing something, I suspect that you just press ALT-A or press "play" button and nothing happens... because you're starting at frame 60!!

try to start playing from frame 1 and it works...


Shape keys not deforming correctly I was using the shape keys but they are not deforming correctly.
I don't know how to explain this further, I'll show the pics
Eyebrows:

Maybe your problem is the following one:
Your shapkeys are set to Relative. Let's say that you have a cube and that the shapeky #1 will be this one, i.e. vertex going up:

Now, bring back the shapekey #1 value at 0. Create your second shapekey, let's say that for this shapekey the same vertex goes up:

Now keep shapekey #2 value at 1, and move shapekey #1 value up to 1 as well, you'll see that vertex 1 will cumulate shapekey #1 and #2 effects:

I guess this it what happens here, as you've left some shapekeys value at 1, and as you've moved the same vertices in different shapekeys, their movements cumulate.
Maybe disable Relative to switch to Linear (which allows to go from a pose to another), or use bones instead of shapekeys.


How to "widen" a mesh modeling from scratch I am a 3d noob.
The captured image is taken from the back of an existing figure (Daz3d Genesis 3 in low res export) for which I am trying to create clothing. As the faces go upwards, they split in a particular "inserted diamond" way so there are more columns of faces at the top of the mesh than at the bottom. I see the diamond split occur four times in the screen capture. There is probably a correct name for this method, but I don't know it. I know I can insert vertices and bridge edges manually, but is there a shortcut? This could need to be done many times when creating a mesh from scratch. Of course I can't simply copy this mesh, I need to make my own version of it.

Specifically addressing how to take a 'uniform grid' area of mesh and insert a new face loop ending in a single 'diamond' quad:

Select the series of vertices desired 'above' the 'diamond' location using Shift-clicks. Use Ctrl-B to bevel the selected edge loop, resulting in a triangle at the bottom. Then use Ctrl-R to loop cut down the centre of the newly created faces, such that you now have 2 new face loops running down into the 'diamond'.

This is still a "manual" process, and does need to be repeated every time one would want to perform this action, so I'm not sure if this answers the question, as the question doesn't specify how 'automatic' or how much of a short-cut is desired.

To take it further, it would be relatively straightforward to make an addon that performs these steps as a single operator, but I'm unaware if this has been done. It's somewhat subjective whether the default actions are fine- or coarse-grained enough for specific use cases, and when modelling one might very likely want to adjust the results at this fine-grained a level anyway.


bpy.utils.previews error Hoping maybe a Blender dev can help with this. I have addons that load icons using the bpy.utils.previews module, but they give the following error

AttributeError: module 'bpy.utils' has no attribute 'previews'

The previews.py module exists in 2.7x/scripts/modules/bpy/utils. bpy.utils.previews only works for me in 2.78, not in 2.79 or 2.77/earlier.

It seems that the previews module must be explicitly imported to be found:

import bpy.utils.previews

should be placed at the start of the file.


How to Set Transparency to One Specific Color in EEVEE What I want is assign the black color as an alpha or transparent, then the red color as a normal shader. I'm using EEVEE.
My render result:

What I actually want (edited in external app) :

My node:

Oh my actually it's simple, I use wrong shader. It should be principled BSDF, not emission. So what actually to do is:
 - Set black color of color ramp to alpha. Decrease alpha value to zero should work
 - Color output of color ramp must be connected to color of Principled BSDF, and alpha output to alpha input.


Rendering Glass (layers) resulting in strange dark patches (in Final but not Preview) I am working on a school research project and hence I cannot share the blender file (confidentiality BS). I am getting strange lines in the render where there are stacked "glass" tiles. This occurs only in the final render and not in the preview render. I have tried the following but to no avail:

Increasing spacing in between (the tiles are not touching each other)
Increase light rays
Smooth Shade Toggle and Edge Split Toggle
Toggling Caustics
Changed Material from Glass to Principled shader

Blender File: https://drive.google.com/open?id=1OERauRJs8S7BAYAZq7S64UlmmxdvrcSL

Final Render (500 samples)

Preview Render (32 samples)

Final Render (1000 Samples)

Preview Render (1000 samples)

It looks like you have an object hidden in the viewport that is showing up in the render.

Look for a setting in the outliner similar to this and either hide that object in the render or delete it:

Alternatively, you can press Alt+H, and you should see all hidden objects in the viewport. Then you can select and delete/disable anything you need to.

This script will automatically hide all objects in the render that are hidden in the viewport:

import bpy

for obj in bpy.context.scene.objects:
    if obj.hide and not obj.hide_render:
        obj.hide_render = True

Putting this here for reference...

Why does my object not show up?


Why i have 2 type of mesh with tissue addon With the base mesh and tissue mesh 2 different mesh created. I have this setting for tissue addon

Blend File

This is the result

The red and green mark are the mesh created by the addon. How the red mark mesh created. Any suggestion or help to have a seamless shape.

it's looks like the patches are rotated randomly, so select active UV in the rotation settings:


How to make eyelids that close with a shape key? My character is a cartoon so his eyes are larger than normal. I can make the shape key to close the eye but on the way down or up the eyeball penetrates through the eyelid. Is there no way to fix this without making two shape keys?

This is what I mean:

If you made a second shape key to "fix" it, you can use a Blend Key without the need to manipulate multiple keys.

In the shapekey dropdown, next to the min/max setting, deselect "Base" and select the key you want to blend with the current key.

Imagine it like parenting key1 to key2, it will blend the two shapes when you use Key2.

The problem in your case seems to be that the eyelid has very little geometry compared to the eye, so the shape key interpolates it linearly along the edges which intersect the eye.

A fix would be to increase geometry to adjust it to the eye and it should work fine if it has more steps in-between.


Creating bottle using Blender Render for output to Blend4Web All the tutorials I can find use Cycles render for creating bottles. Because Blend4Web does not support Cycles --where can I go now to find learn how to create clear bottle with uv wrapped label BUT using the older Blender Render?

Please see this model
https://www.blend4web.com/apps/webplayer/webplayer.html?load=../../assets/fridge/bottle/bottle.json
The source Blender file is only available in the Pro SDK though. Anyway, feel free to ask questions regarding this model on our forums.


100's of Vertices all with different Y Coordinates need to be moved to same Y coordinate plane All these vertices have different Y coordinates yet when I select them all, I cannot move all of them to the same plane of a Y coordinate. How can I move all of them without tedious work?

To scale all vertices to conform to a certain "plane" in a direction (Y axis), select all the vertices you want to move.

Place the 3D cursor anywhere along the Y plane you want (IE place the cursor's Y position to the position you want your vertices to move to and ignore its Z and X position).

Change the pivot point to 3D cursor

Press s to enable scale mode, then press y to restrict scaling in the Y axis. Scale "down" to as close to 0 as possible, or type 0. All the vertices will snap to the cursor's Y position while maintaining their original X and Z coordinates.


Using three js exporter in a python script EDIT: as of yet I haven't been able to find a concrete example of someone using an addon exporter in a python script, so if any of you have that I would be very grateful!

I have hundreds of files and I'm using a small script to standardize them and convert them to .json files for use in three.js, but I can't get the exporter to work.  It is throwing an error (evidently a different one than ImportError) at bpy.ops.wm.addon_expand(module="three") - when I mouse over the addon in the "export" submenu, it gives me the bpy.ops.export.three(filepath = "export path") operation as how to access it, but it is still throwing errors.  Here's my testing code:

import bpy
import addon_utils

def main():
    cube = bpy.data.objects[1]
    bpy.ops.object.delete()
    # import
    filePath = "import path"
    bpy.ops.import_scene.obj(filepath=filePath)
    tablet = bpy.data.objects[1]
    # find dimensions and scale accordingly
    tabletDimensions = tablet.dimensions
    scale = min(10/tabletDimensions[0],10/tabletDimensions[1],10/tabletDimensions[2])
    # give 3dcursor new coordinates
    bpy.context.scene.cursor_location = (0.0,0.0,0.0)
    # set the origin on the current object to the 3dcursor location
    bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN')
    tablet.scale = (scale,scale,scale)
    print(addon_utils.paths())
    try:
        bpy.ops.wm.addon_expand(module="three")
        bpy.ops.export.three(filepath = "export path")
    except ImportError:
        print("Threejs importer addon not available")

    #bpy.ops.mesh.primitive_uv_sphere_add(size=2,location=(5,5,5))
main()

I'll ignore the part of your code which you seem to have working. MrDoob advised in the readme to use the exporter available from the Three.js github repo. It's tucked away in a directory.

github.com/mrdoob/three.js/tree/master/utils/exporters/blender/addons/io_three

If you are using the one that comes with Blender it may not be up to date. Working under the assumption that you're using the latest and greatest (from the link above), then something like this will export the active object.

bpy.ops.export.three(filepath="/home/zeffii/Desktop/barbaric.json")

If you have specific options to pass then they must be passed as keyword arguments. Use Python Console's auto-complete to get the full list or read the source of the exporter.

>>> bpy.ops.export.three(
three()
bpy.ops.export.three(
    filepath="",
    check_existing=True,
    option_vertices=True,
    option_faces=True,
    option_normals=True,
    (...)
    option_influences=2)

Enabling the add-on via a script is a separate issue from running the operator. If you are really stuck it may just be simpler to store that preference in the startup.blend. If you run the script and Blender hasn't yet loaded the add-ons then you may want to read this how to enable addon via script.

I took the liberty to rewrite/augment your script, I think this does (in an admittedly awkward way) what you wanted.

import os
import bpy
import addon_utils

def clear_scene():
    bpy.ops.object.select_all(action='SELECT')
    bpy.ops.object.delete(use_global=False)

def main(filePath, fileName):
    clear_scene()

    fullPath = os.path.join(filePath, fileName)
    bpy.ops.import_scene.obj(filepath=fullPath)
    obj = bpy.data.objects[0]

    # find dimensions and scale accordingly
    dims = obj.dimensions
    scale = min(10 / dims[0], 10 / dims[1], 10 / dims[2])

    # set cursor to world origin, and set object-origin the same
    bpy.context.scene.cursor_location = (0, 0, 0)
    bpy.context.scene.objects.active = obj
    bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN')
    obj.scale = (scale, scale, scale)

    json_fileName =  fileName[:-3] + '.json'
    finalPath = os.path.join(filePath, json_fileName)
    bpy.ops.export.three(filepath=finalPath)

def ensure_addon():
    try:
        addon_utils.enable("io_three")
        return True
    except:
        print('failed to enable io_three')
        return False

def path_iterator(path_name, ftype):
    for fp in os.listdir(path_name):
        if fp.endswith(ftype):
            yield fp

if ensure_addon():
    filePath = "/home/zeffii/Desktop/Objs"

    for fileName in path_iterator(filePath, '.obj'):
        print(fileName)
        main(filePath, fileName)

To clarify my changes / thoughts.
The obj import doesn't place the object in the active state, just selected. The export feature seems to require the object to be active, and ignores objects that are merely selected. To take care of that, use the reference to the only object in the scene and set it active:

bpy.context.scene.objects.active = obj

The error message, context is incorrect, is in this scenario a poor error message. (if the above is genuinely why the initial code failed.. )


Parenting with automatic weights New to Blender, and 3D in general, I've been trying to rig a character but I always have that automatic weight issue showing up, and I can't really tell where it comes from.
I've tried to parent my character's elements to the meta rig, and to generate an automatic rig. None of these worked out.
See the screenshots to understand what happens: The hands are messed up, the chainmail disappears (made by instancing 2 tori over cylinders) the body goes through the breastplate...
Here are the solutions I've tried so far :

Merging by distance everything
Apply scale and Rotation to the model (note that  the chainmail disappears again if I apply transform, haven't found the reason out yet)
Apply modifiers, most noticeably skinwrap and subdivisions
Set Origin to Geometry to the objects (I may have forgotten some, but I didn't see any improvement anyway)
Joining all the objects into one single mesh (This time, the hands simply refused to move although the shape was preserved)

Here is a link to the file, I hope it's gonna work, first time I use dropbox
https://www.dropbox.com/sh/rok138fb33eye7e/AAD9NT1k-x1nDAu7qRXFTNVUa?dl=0
If someone could take a look at it and tell me how to solve my issue, I'd be eternally grateful :)
EDIT : As a last hope, I've tried to parent each piece of the left hand (from character's view) one by one to the metarig. The issue was reported for the main cylinder of the gauntlet, covering the forearm.
The other parts move, but are messed up in the process.

The meta rig is only used to place the bones in the right place. The mesh is eventually bound to the armature of the generated rig.
Do not apply the modifiers. You want to keep your mesh low-poly for performance and easy modifications.
You have already "parented" the body base mesh to the meta rig and created a pose to match the shape of the armor. Basically moved the hands in this pose. That's the reason why the hands are not in place.
All parts of the body, the armor, and the rig must have the same Rest Pose. This is not the case with your rig.
Corrections:

select the body base mesh ("lowman_shoes") and apply the Armature modifier. This will change the position of the hands in the A pose permanently.
select the metarig and apply All Transformations to the it (Ctrl+A), else the generated rig is placed at the wrong position.
switch to Pose mode and make the current pose the new Rest Pose (menu: Pose > Apply > Apply Pose as Rest Pose
in Edit mode, rotate the shin and thigh bones a tiny, little bit in direction of the knee. This is needed for the IK mechanics so it knows where the knees should bend.

Now everything is in place and you can generate the rig.

In Object mode, go to the Armature Properties and press the Generate Rig button
hide the metarig, the Environment collection, and the Curve guide for the "hair".
select everything else (body and the thousand parts of the armor)
make sure the rig is highlighted in orange (active object, selected last) and make it a parent for the selection (Ctrl+P, With Automatic Weights). This takes a moment or two ...
go to Pose mode and check it out

The weight painting will not be perfect, some parts (bracers) will not move and shoulder plates will deform, etc. This is because your armor has so many parts. In this case, you can duplicate everything, and create a "statue" version. Use this version to generate the Automatic Weights and transfer them back with a Transfer Data modifier.
The fingers might bend in the wrong direction (scale them S/Alt+S). It's because Rigify tries to guess the pivot points and gets confused you have to move around the fingers of the metarig a lot. But you can fix it with some settings. (Just checked it for your model. It looks ok, except for the deformation and the thumb.)


How to make rigid bodies freeze? I'm pretty sure this is a duplicate. I'm just not sure how to describe it to someone else.

Here's what i'm trying to do:
I am creating a simulation with a cube, and a "bullet" going through it to make it fracture. It is a rigid body, but when I play the simulation, it just falls (not through the world, I have a plane that it stands on). I want it to start simulating when the bullet passes through it so it "fracture". Help will be very appreciated, thanks!

If you want the cube to fall to bits on the plane then the plane needs to be a 'passive' object in the rigid body world so that it interacts with other objects.

If you want the cube to shatter in all directions you can turn gravity off but will still find pieces will pass through the plane if the plane is not part of the rigid body world.

Once everything is included in the rigid body world, you will then have to adjust parameters like collision margin and solver steps/iterations to make the pieces fall naturally on the plane and not penetrate it.


How to install "Cycles Minecraft Rig BSS" (Blender 2.9x)? We are trying to install Rymdnisse (Cycles_Minecraft_Rig BSS Edit V6.5.zip) add-on for Blender 2.9. We go to Edit > Preferences > Add-Ons, and install from MacBook Downloads folder.
It says it installs, but we cannot locate the add-on in the Community, Official or Testing lists to select it to make it active.

It's a rig, not an addon. You need to append it into the scene.


Why is that when I open up my file in blender, the reference picture is gone When you are using a reference picture in blender, do you have to keep it? Do the pictures have to stay in your computer? I sometimes delete my reference images, because I'm on my mother's computer and any file I download has to go away. When opening my blender file the pictures are gone. How can I get my reference images to stay in my blender file even if the original file is deleted?

By default, Blender does not save images as part of the .blend file (this applies to background images or textures used as part of the scene).
To make those images part of the file they have to be packed.
If the images are not packed, blender has to re-load them form the hard drive every time you open the file. If unpacked image files get relocated on a different folder or drive, you'll be presented with nothing (for background pictures) or a pink color instead of textures and images used for compositing.
So you have two options:
1. Pack the images to make a self contained .blend file:

After packing you have to re-save your file.
Keep in mind that the file size will increase when saving images.
NOTE: You can't pack image sequences or video files in a blend file.
2. If you don't pack the images,
then they have to be stored on every computer you use to work on the file, using the correct path so that blender can find it.


how to bake texture from multiple overlayed uv Islands to individual uv islands I wanted to ask, how you could quickly bake/transfer the texture from overlaying UV islands to individual UV islands?

the "Selected to Active" option in the baking menu was activated while baking the hair texture to the newly unwrapped mesh with a new assigned texture  but that gave out a white result.

Create a second UV map on your object in Properties > Object Data and unwrap it so it has individual islands (or however you want)

Blender Internal

Add your existing texture to the object and select the appropriate UV map in Properties > Textures > Mapping > Map:

Create a new image in the UV/Image editor by pressing AltN or Header > Image > New

Select the new UV map in Properties > Object Data and then select the new image in the image editor, so that the individual islands UV map is displayed over the new image.

Press Bake in Properties > Render > Bake:

Cycles
To do the same in cycles, you can use attribute nodes:

Add two attribute nodes and enter the names of your UV maps. You can now use the Vector output of these as those UV coordinates.

Create a new image in the image editor and add it to the node setup with a texture node. Plug the mapping you want into that texture node and select it.

With that texture node selected, press Bake in Render settings > Bake.


how to remove reflective shadows I have the below scene in Blender Cycles.

To create volume of the bike's lights I've added two cone meshes.
Here, you can see when I render the scene the cones are creating black shadows on the rays, how can I remove these reflective shadows?

I thought it is happening because the cones are intersected with the rays object, that's why I added boolean modifier to make them intersection free, but that didn't do anything.

Am I missing something in my node setup?
I've attached my blend file as well, please let me know how can I get rid of this?

Increase Transparecy bounces

The more objects you add, the more interfaces the light should bounce off to reach a surfaces. This is true also if your objects let the light pass through, like the volumetric and transparent shaded cones are doing.

The black shadow is due to the low number of Transparent bounces allowed in your scene (compared to the scene complexity from this point of view). Light path are being terminated before reaching any light source, so they render blck.

You should increase at least the Max Transparent bounces filed found in Light Path panel by some units.


Should I wait when Blender isn't responding? By error I placed the angle of the smart uv unwrap to 1 and now Blender is not responding. I guess it calculates the uv. The problem is that I have a lot of unsaved changes on the mesh.

Should I wait it to come back to life or is there no point? Are there any possible solutions to save my unsaved data?

You can wait if you want, but it's probably going to take a long time before it will start responding. If you close it there is a way to recover you data; Blender autosaves your projects every 5 minutes, and you can change it if you want.

When you open Blender, go to 'File', then in the option, click 'Recover Auto save', wait for some time, and Blender will show all the autosaves it has taken according to the date. Click the unsaved projects, and save it when it opens.


How can I create a convincing sea material in Cycles without using the ocean modifier? I'm trying to render a sea scene animation, but using the ocean modifier and huge subdivisions isn't feasible due to the large scale. Luckily it's a calm sea and seen from quite a distance, but there still should be some kind of animated movement or shimmer you can see on a real water surface. Is it possible to do something like this in cycles?

The render shows what I currently have which is just a translucent plane with a seafloor material beneath and a slightly rough reflection of the cloud environment map.

Expanding on Róbert László Páli's answer, this is possible with a Procedural texture and bump mapping.
Texture
For an ocean texture, the procedural textures most likely to be what you want are:

Noise:

Wave:

Voronoi:

Musgrave:

You can also combine and mix these with an RGB mix node.
Displacement
Here are some examples of bump mapping with a Noise texture:
You can affect only certain shaders by using the Bump node. One advantage to the bump node is you can easily adjust the strength of the displacement:

Or you can affect the entire material by plugging the texture output directly into the Displacement input of the Material Output node:

To control the strength with this method, plug the noise texture into an MixRGB node and set it to multiply. The other input becomes the "Strength factor", where white is full displacement (you can set it to a value greater than white to get a larger displacement), and black is no displacement. (likewise, negative values produce an inverted displacement)

Animating
This effect can be animated over time by animating the location of the Texture space. The settings for the Texture space are located in Properties > Object data panel > Texture space:

You can interactivle move the Texture space in the 3D view with ShiftT.
Note that you most likely want to animate along the Z, otherwise it will look like it's a static surface sliding horizontally.
You may also want to set the interpolation type to Linear in the Graph editor by pressing T> Linear to make the texture space move at a constant speed without accelerating and decelerating (the default behavior):

Result:


Why won't Lasso or Box Select select all of the faces in the region? Here's a problem I've been having a lot of with Blender:  I have a mesh, and I want to select all of its faces, so I do a box select like so:

However, this never works right.  It always skips some polys as can be seen here (note the thin black triangles that are not selected):

If I try again it may or may not add a few more polys to the selection.  Sometimes, if I zoom in I can select a few more, but not always.  What am I doing wrong?

There are several ways to select every vertice of the mesh not changing view angle in the scene.

Limit Selection to Visible

Uncheck Limit selection to visible.

If it's checked, it won't be possible to select vertices which aren't pointed to the viewer (like in your case).
If it isn't checked, when selecting either with Box select or with RMB (doesn't matter how) vertices on the other side of the mesh will be added to selection.

Wireframe viewport shading

Use Wireframe shading mode, accessible via shortcut Z while in 3D Viewport.

Selecting connected geometry

  Select parts of a mesh connected to already selected elements.

Use Ctrl+L shortcut for that or from menu Select > Linked.

  You can also select linked data directly under the cursor.

Press L to select linked data and Shift+L to deselect data which is located under cursor.
Read more about selecting linked in the wiki page.


Cycles nodes: is it possible to get distance to nearest edge? I want to create a procedural texture that will be based on the geometry of an object. How can I get distance to the nearest edge for the current pixel of an object in Cycles nodes? I hope it is possible. Without any UV mapping and obviously before splitting each face into triangles.

It's not the exact distance as you would say it, but it can be approximated using Bevel node in combination with Normal output of Texture Coordinate node.

The Bevel shader node can be used for rendering rounded corners. Like bump mapping, this does not modify the actual geometry, only the shading is affected. Slight rounding on edges helps to capture specular highlights that you would also see in the real world.

Bevel essentially gives blurred version of normal vectors depending on geometry, so you just have to measure the difference between them.
Shader node example

Samples controls smoothness
Radius means how farther from the edges will the samples taken
Alternatively use Color Ramp or Map Range node to control the falloff

Example results

As I said it is not precise and can be lead to unexpected results such as:

Edges marked smooth won't affect this
Edge between two faces with little normal change will have a little effect on this
You can't get exact value of a distance as it's done by random sampling, thus you can't do proper math with it(everything is either 0 or some fixed values)
Faces with multiple edges converging will report higher values, due to the nature of the method mentioned above
Render time will increase by 20% on average, as explained in the official doc.


Bone properties Tab does not get updated When I select a bone in Edit Mode, the Bone Properties tab does not get updated.
It shows always the details of a default bone. For example the bone I had selected last in Pose Mode, before switching back to Edit Mode.

I am using Blender 2.8 (Windows)

Is this a Bug, or did I something wrong (some strange settings)

Additionally, I cannot select a bone in Edit Mode by simply clicking on it (as it works in Pose Mode) I have to select it completely by the Circle Selector.

Can somebody help me out

I had the same problem in 2.9. Realized I had accidentally hit W and switched to the circle select tool which made it so I could highlight new bones but the properties tab stayed on the originally selected bone.  Switched back to box select and then I could select as normal. Hope that helps


First material applies but second does not The first pin material I created is able to get assigned to the whole pin. The second stripe material I can't get assigned to anything.

Blend file:

In the edit mode select the mesh with Ctrl+B Box select and then select the material (red) and click on assign material.


Checkerboard Texture Object After UV unwrapping and creating a UV Grid, I should be able to see the object  wrapped up in a checkerboard in texture view, as shown in the pic without nodes . However, I see no change. What am I missing here? According to this tutorial (https://www.youtube.com/watch?v=XiQOHSzyooc) (12:08), I should be able to see it  after the steps aforementioned.

There is no magicaly appearing checker board ;)

The UV/Image Editor has the feature to load images from disk but also to create new ones. And one of the new image templates is a checkerboard, called UV Test-Grid. Your tutorial guy just had one already created.

Click on Image -> New Image and choose UV Test Grid and it should appear!

To also see it in the viewport choose texture as your view options and assign the newly created uv testgrid texture to your object (in the materials tab of your object)

Since thise is a UV Grid, you should have your object UV unwrapped in order to see it. So if the object stays gray you have to unwrap it first. If the texture then looks screwed up you have to properly uv unwrap your object ;) There are many tutorials out there that show you how this is done.

Create new image:

Choose Generated Type "UV Grid":

Assign the new image as texture of your object:

Make sure youe selected Texture in your 3D View:


Video and audio strips of imported file out of sync? I have captured some 1080p video game footage with Open Broadcaster. Now I would like to edit it using the Blender video editor. First of all, if I understand this correctly, I have to set the frame rate with which I want to render the video but I am not sure what to set it to, after all games don't run at constant frame rates.

Secondly I have tried dragging and dropping the clip I want to edit into the video sequence editor. Once I do that the video clip and the audio track that belongs to it show up, however they don't seem to be synced up and the video clip is far too short.

Maybe this information is of any use: the original video is 04:12 minutes long. The audio track displays as being of exactly that length in minutes and 30412 in frames. The video clip is displayed as being two seconds long with 254 frames.

I assume this has something to do with the end frame that can be specified but changing this to something higher has not solved the problem. Any suggestions are welcome!

You need to find out what framerate your footage is at. A video is saved at a constant framerate no matter how fast the game runs. Find out what that is, and in the Properties Window on the Render Tab (the settings on the right which is usually hidden on the Video Editor interface), set the framerate.

Then, in the Video Editor, drag your video in and find the end frame. Set the end frame to the ending frame of your video. (See this topic for help: How can I make my animation play for longer than 250 Frames? )

Also, set the player to A/V Sync (the button is right under the Timeline) so Blender will sync the audio and the video.


Having Trouble Snapping Vertices Between Irregular Shapes I'm using Blender 2.91.
I'm new to Blender. I've been putting significant hours into learning it the last few days. As a learning project, since I have been a carpenter in the past, I'm building a small storage outbuilding from scratch. I've built every board and put them together to create the frame. (Here's a snip of the almost-finished framed building)

Everything was fine until I got up to building the roof trusses. Then, I started to figure out that Blender did not like building shapes with specified sizes into complex, specified angles.
My biggest issue is getting irregular shapes to snap to specific vertices when I wish. I thought I would narrow this down to a simple situation and see if I had some setting wrong in my more complex building blend. I started Blender from scratch, opening it into the default blend with the single cube. Next, I duplicated the cube and and "smooshed" the top of it down, and experimented with snapping the smooshed cube onto the default cube in different places.
What I found is that even though Blender graphically represents the angled faces, and the vertices at the junction of those faces, it really still treats the "smooshed" mesh as if everything were still in right angles.
I'll try to illustrate. In the image, I have attempted to snap vertex 1 to vertex 3. It DID snap, but it has treated it as if vertex 1 is still directly above (on the Z axis of) vertex 2 (yes, I am using the vertex snap setting). (see image below).

I added a plane to illustrate the aligned top edges of the purple and green meshes.
As stated earlier, this is an extremely simple file started from all the default settings (the only thing I changed was the snapping from Increment to Vertex. What am I missing? How can I get vertex 1 to snap to vertex 3 without changing the shape of the green mesh?
I don't mind to upload the file the image is taken from, but I don't see any option for that.
Thanks for any advice.

I'm posting this just so I can post some pictures easily - if it doesn't help, let me know and I'll delete it.
I think what you're looking for is to choose which vertex is the "snap point" on the object you're moving to snap.
To do this make sure to select your whole object (in edit mode), making sure the vertex you want to snap is selected last (the active vertex). Then, from the snap menu, choose "Active":

From here, move the object (G) and place your mouse cursor over the vertex you want to snap to. The object should snap aligning the vertex you left active, with the one you selected with your mouse:


Why does my model reorient itself when I render it? It was facing in Y+ direction, so i turned it to X+ direction so that it fits my scene, but when i render it turns back around it sound stupid but i am not joking!

Here is the File

You have inserted keyframes , the viewport is displaying frame 2922 and you are rendering frame 0.

you can change what frame you want to render in the render settings.

to clear all keyframes select all objects and press Alt+I


Why is my text pixelated? Within my game I have some cubes with text which render fine. In addition to the cubes I want to display some static text, e.g. the current score. The score text has the camera as parent and a copy rotation constraint on the camera.
While this concept works fine in principle, the score text is displayed very pixelated. I already increased the font size to 50 and made the text smaller by scaling it down, but it still doesn't show nicely.
The score text is about 11 Blender units away from the camera. If I move the score text further away, it displays better, but then the text interferes (collides) with the cubes.
What could I do to improve the quality of this text?
Download SSCCE .blend file. Open the SSCCE in Blender 2.70. Hover your mouse over the 3D viewport. Press P to start game engine.

You can fix the resolution through the python API:

import bge

scene = bge.logic.getCurrentScene()
for obj in scene.objects:
    if obj.name == "Text": # text object we want to fix
        obj.resolution = 8.0 # resolution is normaly 1.0 / 72 dpi


how do I get ATI Radeon HD 5800 Series graphics to work with blender? I have an ATI Radeon HD 5800 Series graphics card and all the latest drivers installed, including the latest APU drivers that now come packed with the AMD catalyst software...

I am using Blender 2.76, which is the latest version of blender as of this post.

How do I get Compute to work on my computer?

The only option I get is CPU...

If anyone can help it would be most appreciated, Happy blending guys and girls!

EDIT I thought I'd fixed my issue but if you see the next EDIT after this remark I was mistaken

Okay I fixed my issue... I needed to remove all traces of the old drivers...

Then reinstall them by going to the AMD website and downloading the auto-detect utility and running it.

I read it very carefully and before installing the graphics card drivers, there is a note at the top of the app stating that it don't install chipset drivers so I did that first and was prompted to restart the machine.

I Then relocated the auto-detect utility and proceeded to install the graphics drivers followed by the APU drivers (found on AMD.com) also.

Everything seems to be working nicely now and I have a new option in the user preferences;

I am now rendering a complex scene and see notable improvements in speed!

EDIT:

It seems that support at this stage is only partial for lower grade AMD graphics cards... namely only GCN cards are supported and blender will hang if you change to cycles and change the setting from CPU to GPU Compute in the render tab.

Its rather convoluted and this behaviour should be blocked! I reported it as a bug but the devs are very busy and seem to think its a report and not a bug so we will have to put up with it until they discover it and fix it themselves.

This seems unlikely to happen because they all use powerful computers, so the message here is get better hardware because they don't care about bugs that effect older hardware...

lesson to be learnt... If you don't have the means, you won't discover that till you waste your time after not having any way of knowing it (unless your omniscient).

Lets just hope that they include support for older architecture graphics cards in the future because older graphics cards still have quite a lot of raw processing power and would increase confidence for disgruntled users like me that feel they don't have a voice!


Converting mesh object to lamp shape I have a simple scene here:

I want to convert the scaled torus object to a lamp object. I don't want to use shaders because then it will only emit light from it's surface. I want it to be like an area light emitter if that is possible. Is there any way I can do this?
My question is to convert a mesh object to a lamp object as represented in yellow.

Lamp lightning torus shape

Blending can be changed by Lamp Properties > Size


How do I avoid artifacts when using bevel objects with complex curves? Prompted by my previous question, I am wondering if it is possible to bevel complex curves with bevel objects.

How can I bevel complex curve objects (such as a text object from this question)?

I have tried using a bevel object as suggested by haunt_house to bevel without fattening, but this creates many artifacts:

How can I fix these? (or failing that, is there another technique I could use?)

  The only way I have found is not a fast solution, but so far the only one I can imagine without writing a completely new bevel routine. If you have two beziers at a sharp angle, they don't normally have the same length, so the concept of resolution and even spacing would be in the way of a clean bevel where both sides shave off material.

  Okay, here's the way:

This curve consists of sharp angles. The ones that cause trouble.
Give the curve a bevel of, for example, 0.2 and an offset of -0.2 and adjust resolution of bevel and curve to match your desired end result.
Duplicate the curves.
Change the shapes like shown. Every curve segment you want to retain should continue straight. The newly created bulges will be cut away. I adjusted adjacent handles to be 180° and made them longer. If you want more precision, extrude the curve, so you can be sure to have a straight continuation (or a slightly curved one if the dynamics of the curve demand that). I put opposite curve segments into the same object because I have an even count of segments. The blue object is contributing the horizontal part of the finished mesh while the green object adds the vertical one.
Convert both into meshes. Perform Remove Doubles and maybe Recalculate Normals Outside.
Connect them with a Boolean Modifier set to Intersect because you are only interested in the space both objects occupy. Apply it.


Why is "Copy Data Path" path different from the tooltip's path? Why is it that when I right click on a data field and click "Copy Data Path" and paste, it will paste something like this (example: the "Start Frame" of a VSE strip):

sequence_editor.sequences_all["roomWalls01.001"].frame_start

But the tooltip that can be seen when hovering over the same field shows a longer data path:

bpy.data.scenes["Scene"].sequence_editor.sequences_all["roomWalls01.001"].frame_start

"Copy Data Path" leaves off the first part: bpy.data.scenes["Scene"].

Why does it leave that off? Isn't that part usually necessary when making scripts?

I'm very new to Blender Python scripting but I've tried some scripts and I often end up typing the first part out by hand, which seems like an unnecessary hassle.

I theorize that this has something to do with the fact that many Blender Python scripts start out defining variables like these:

context = bpy.context

scene = context.scene

sequences = scene.sequence_editor.sequences_all

But I don't know how I'm supposed to know what kind of variable like that I will have to define first.

I would just like to know why this is. It seems like it probably makes sense, and I'm just using a bad Python workflow or approach. Any explanations? Thank you.

Copy Data Path

From
https://www.blender.org/api/blender_python_api_2_77_release/bpy.types.bpy_struct.html?highlight=id_data#bpy.types.bpy_struct.id_data

  Note that when keying data paths which contain nested properties this must be done from the ID subclass, in this case the Armature rather than the bone.

Or in the case you pointed out from the scene rather than the strip.

To explain using the console, I have a vid seq called blackfoot, it tells me its id_data is the scene. (The bit you mentioned as "left out")

>>> C.scene.sequence_editor.sequences_all['blackfoot'].id_data
bpy.data.scenes['Scene']

Ok now look at frame_start property

>>> C.scene.sequence_editor.sequences_all['blackfoot'].frame_start
1

>>> C.scene.sequence_editor.sequences_all['blackfoot'].path_resolve('frame_start')
1

>>> C.scene.sequence_editor.sequences_all['blackfoot'].path_from_id('frame_start')
'sequence_editor.sequences_all["blackfoot"].frame_start'

The last one looks familiar, it's what you get when you copy data_path, ie the path from the ID data.

Using

context = bpy.context
scene = context.scene
sequences = scene.sequence_editor.sequences_all

is just IMO good coding practice making the code much more readable

sequences['blackfoot'].frame_start = 1

than

bpy.data.scenes['Scene'].sequence_editor.sequences_all['blackfoot'].frame_start = 1

NB. I also use context = bpy.context in test files, to make pasting them into operator or panel code later simple as context is passed by def to just about all methods.


Parent object to a bone and object becomes offsets! How do I prevent object from moving? I have just spent the better part of my day trying many different examples in an attempt to simply parent an object to a bone without the object moving (aka keep_transform). But no matter what I try it always offsets:

object.parent = armature
object.parent_bone = bone #object now in weird position
object.parent_type = 'BONE'

I also tried this as suggested here:

object.parent = armature
object.parent_bone = bone
bpy.context.active_pose_bone
bpy.ops.object.parent_set(type='BONE', keep_transform=True)

But get error "Error: No active bone"

I notice the object I am parenting to the bone in the armature is always moving to the bone's tail when I need it to be positioned at the head.

Is there anything I can do to programmatically affix the object to the bone's head? Any help her would be most encouraging, I just keep hitting walls with this.

One idea I had was to just offset the object by the head/tail delta, but because blender allows parenting-in-place I figured I should stick to convention.

Thanks.

I have just tested batFINGER's code in Blender 2.79b, there is a bug in the formula.

When you multiply armature's world matrix with pose bone's object space matrix, you actually reached the bone head, not the bone tip, so you need to walk a bone's length to the bone tip, which is the origin of the pose bone.

Pose bone has a 'head' property and a 'tail' property, so we can calculate the bone vector, which equals to bone.tail minus bone.head.

I have verified the code in my project, it works correctly.

Here is the bug fixed version:

import bpy
context = bpy.context
from mathutils import Matrix
scene = context.scene
armature = scene.objects.get("Armature")
cube = scene.objects.get("Cube")

if cube and armature:
    cube.parent = armature
    bone = armature.pose.bones.get("Bone")
    cube.parent_bone = bone.name
    cube.parent_type = 'BONE'
    # keep current location
    cube.matrix_parent_inverse = (armature.matrix_world * Matrix.Translation(bone.tail - bone.head) * bone.matrix).inverted()


Problem with exporting a proxy object (to collada .dae) including texture, material and animation i spent a lot of time on this topic and cannot find any solution.

I linked my already rigged and textured character (as proxy) to a new blender file and created the animation for the proxy armature.
Here my current setup in the outliner

Now i want to export this scene to a collada file. (The "Include Material Textures" Checkbox is enabled.) but:

No textures / materials will be copied to the destination.
The animation doesn't work, because it seems like the "Body" object is not connected to the proxy armature.

Side note: The animation works fine in blender. It breaks only after exporting. I tried to include the "Body" object also as proxy but then i have to reassign the mesh to the armature and my weight-painting breaks.

So my questions are:

How can i export my proxy object to a collada file including textures / materials?
How can i export my proxy object to a collada file including a working animation?

Hopefully anybody has a solution for that... :(

Thanks and regards

Steffen

Ok i solved it by myself. The texture problem can be solved, by copying all necessary files (*Specular.png, *Opacity.png, *Diffuse.png ...) by hand to the same destination like the *.dae will be stored and disable the "Copy"  and enable "Include Material Textures" checkbox in the collada export settings.

The animation only works, if i set the body object to local (so its assignable to the proxy armature). The mesh, materials and textures are still linked, so i'm still able to change them in my origin blend file.


2.8 UI missing all menus, cannot interact with Blender at all I'm on Win10 at work, purged everything Blender related from my PC, all files, cache, settings, registry, everything. Updated Nvidia drivers. Still getting this weird issue on a fresh 2.8 (official) install that 90% of my UI is not there and I cannot interact with the program at all. Any ideas what could possibly cause this? A few days ago this was still working fine :\

Ok so apparently something got messed up with the PYTHONPATH environment variable and Blender wasn't able to properly locate the python modules it needs to run. After fixing the environment variables, Blender is running fine again. Crazy stuff


Save render for compositing Is there a way to save render so you can manipulate it in compositor even after turning off and back on the program. Yes I know I can use image node but it doesn't have cryptomattes.

Just to save your render and all your channels like mist, light passes, cryptomattes etc. to OpenEXR which allows to store all the data you need in order to comp your renders in a next stage or at any given time.
From Wikipedia:

OpenEXR is a high-dynamic range, multi-channel raster file format ... It is notable for supporting multiple channels of potentially different pixel sizes, including 32-bit unsigned integer, 32-bit and 16-bit floating point values, as well as various compression techniques which include lossless and lossy compression algorithms. It also has arbitrary channels and encodes multiple points of view such as left- and right-camera images.

Further reading:

OpenEXR in the Blender Manual
Save all render passes to EXR image?
What image format encodes the fastest, or at least faster? PNG is too slow


Quickest way to create a color gradient texture What is the easiest way to create a color gradient texture in blender?

Original Question:

I want to apply a color gradient texture to an object, but I cannot figure out how to do so. I have read several guides that point to a "gradient texture" texture type when using the cycles render engine, but it just does not exist in my version of blender. I have tried switching back and forth between rendering engines, restarting blender, all sorts of stuff.

I am using Blender 2.74 in manajaro (arch linux based distro).

You can find under the Add >> Texture >> Gradient Texture if you are using the Node Editor:

Or in the Material panel as shown below

Using the node editor is probably easiere because it helps to immediately figure out which node is doing what, the relations between the various components of the shader and quickly navigate the nodetree, while with the menus would be more tricky.

Down below you can see an example of usage of the gradient texture to mix two colors. On the top the node editor and on ther righit side the corrispective menu's view of the same material.


Rendered animation is incomplete So I'm having an issue with the animation I am doing atm. It is as many frames as shown in the image, but for some reason when I am rendering, the animation suddenly stops just before the gap in the animation which is when the camera is moving. I tried it again just in case I pressed esc by accident but it still did the same thing. I tried just moving a random bone in case it needed something moving other than the camera but it didn't work. I've never had this issue before in my previous animations, just for this one. I thought I would try and start it at the point it stopped and continue the rendering but, when I do that it just goes straight back to the beginning of the part I've already rendered.

Am I doing something wrong? Please help! Thanks! :D My Blender version is 2.74

Then when I try to get rid of the beginning part...

you are using a separate timing for the playback ( time line ) and the render ( render tab ) you have two options to render the frames you want :

1- Keep the timing separate and set the render timing in the render tab :

2- Use the same timing for playback and render by disabling the alternative time range and set the time from either the render tab or the time-line


Separate texture in viewport Is there a way to assign a separate texture for specific 3D View?
Like if I have some texture in material node, but want to see UV checker in viewport without changing material itself.

Assigning separate materials to a view port is not possible ( as far I know )

Alternative:
With the Node Wrangler plugin you can press Ctrl + Shift + Click on a node, and it will change it to that specific node. So you can just add an image texture to your node an swap between them.

See: http://gregzaal.github.io/node-wrangler/ ( Emission Viewer )


Duplicating a cloth without rebaking? I'm messing around with physics simulation (it is so frustrating) and I have a question. I have a flag waving around (baked) and I want to duplicate that flag, so I can have different country flags waving around in the same way as each other, but I still haven't figured out how to do that. Is there a way to save the baked simulation as some kind of file and import it to other meshes?

Export the animation as .mdd file (enable export mdd addon in preferences). Choose the right fps and start and end frame of animation.
Now you can delete the cloth modifier from your flag object and delete all caches.
Add a Mesh Cache modifier to your flag and load the .mdd file with your animation.
Add a material slot and change it's link from Data to Object. Your flag copies will share the same mesh but will be able to have different materials.
Duplicate your flags with AltD. The Mesh Cache modifier will be copied to all the flags also.


Subtracting an object and then deleting the object used to subtract within python script I am currently trying to create an object within python in order to subtract from another object. I did this using the GUI with no problem but when I try to use the same code within the script it doesn't seem to work.

import bpy

#Large Cube
bpy.ops.mesh.primitive_cube_add(radius=2, location=(0, 0, 0))

#Small Cube
bpy.ops.mesh.primitive_cube_add(radius=1, location=(0, -1.5, 0))

bpy.ops.object.modifier_add(type='BOOLEAN')
bpy.context.object.modifiers["Boolean"].operation = 'DIFFERENCE'
bpy.context.object.modifiers["Boolean"].object =
bpy.data.objects["Cube.001"]
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Boolean")
bpy.ops.object.delete(use_global=False)

How can I select the Large Cube in order to use the boolean operation and then delete the Small Cube?

Can add modifiers with obj.modifiers.new(name, type).  When a primitive is added it is the context object.  Changing the order made the large_cube context object, otherwise it can be set with context.scene.objects.active = large_cube.

import bpy

context = bpy.context

#Small Cube
bpy.ops.mesh.primitive_cube_add(radius=1, location=(0, -1.5, 0))
small_cube = context.object

#Large Cube
bpy.ops.mesh.primitive_cube_add(radius=2, location=(0, 0, 0))
large_cube = context.object

mod = large_cube.modifiers.new("Boolean", type='BOOLEAN')
mod.operation = 'DIFFERENCE'
mod.object = small_cube

# large cube has context.
bpy.ops.object.modifier_apply(apply_as='DATA', modifier=mod.name)

context.scene.objects.unlink(small_cube)
bpy.data.objects.remove(small_cube)


How many objects touch one chosen object? I am making a simulation using Blender physics. I pour many objects in cube-shaped box. I need amount of objects which touch one particular object. I know one way: at first I return location of each vertex of each object and then for one object I compare its vertices coordinates to possible touching object's vertices. If distance between two vertices is less than constant number (that constant depends on distance between two neighbor vertices of one mesh) this means that this is touch point. Then I count this touch points. But this algorithm needs lot operation ((amount of objects)(amount of vertices on each object)(amount of possible neighbors)) and lot time to be completed. I wonder if there is any script or option in Blender which returns how many other objects touch each object. P.S. Perhaps it is possible if we add collision sensor from Game Engine but I don't need this.

as @stacker said the answere was in How to check if two meshes intersect in python?

this the "new" code in order to answer your question:

note:  the "chosen object" must be the active object.. I mean the last selected object... check:

import bpy
import bmesh

def bmesh_copy_from_object(obj, transform=True, triangulate=True, apply_modifiers=False):
    """
    Returns a transformed, triangulated copy of the mesh
    """

    assert(obj.type == 'MESH')

    if apply_modifiers and obj.modifiers:
        me = obj.to_mesh(bpy.context.scene, True, 'PREVIEW', calc_tessface=False)
        bm = bmesh.new()
        bm.from_mesh(me)
        bpy.data.meshes.remove(me)
    else:
        me = obj.data
        if obj.mode == 'EDIT':
            bm_orig = bmesh.from_edit_mesh(me)
            bm = bm_orig.copy()
        else:
            bm = bmesh.new()
            bm.from_mesh(me)

    # Remove custom data layers to save memory
    for elem in (bm.faces, bm.edges, bm.verts, bm.loops):
        for layers_name in dir(elem.layers):
            if not layers_name.startswith("_"):
                layers = getattr(elem.layers, layers_name)
                for layer_name, layer in layers.items():
                    layers.remove(layer)

    if transform:
        bm.transform(obj.matrix_world)

    if triangulate:
        bmesh.ops.triangulate(bm, faces=bm.faces)

    return bm

def bmesh_check_intersect_objects(obj, obj2):
    """
    Check if any faces intersect with the other object

    returns a boolean
    """
    assert(obj != obj2)

    # Triangulate
    bm = bmesh_copy_from_object(obj, transform=True, triangulate=True)
    bm2 = bmesh_copy_from_object(obj2, transform=True, triangulate=True)

    # If bm has more edges, use bm2 instead for looping over its edges
    # (so we cast less rays from the simpler object to the more complex object)
    if len(bm.edges) > len(bm2.edges):
        bm2, bm = bm, bm2

    # Create a real mesh (lame!)
    scene = bpy.context.scene
    me_tmp = bpy.data.meshes.new(name="~temp~")
    bm2.to_mesh(me_tmp)
    bm2.free()
    obj_tmp = bpy.data.objects.new(name=me_tmp.name, object_data=me_tmp)
    scene.objects.link(obj_tmp)
    scene.update()
    ray_cast = obj_tmp.ray_cast

    intersect = False

    EPS_NORMAL = 0.000001
    EPS_CENTER = 0.01  # should always be bigger

    #for ed in me_tmp.edges:
    for ed in bm.edges:
        v1, v2 = ed.verts

        # setup the edge with an offset
        co_1 = v1.co.copy()
        co_2 = v2.co.copy()
        co_mid = (co_1 + co_2) * 0.5
        no_mid = (v1.normal + v2.normal).normalized() * EPS_NORMAL
        co_1 = co_1.lerp(co_mid, EPS_CENTER) + no_mid
        co_2 = co_2.lerp(co_mid, EPS_CENTER) + no_mid

        co, no, index = ray_cast(co_1, co_2)
        if index != -1:
            intersect = True
            break

    scene.objects.unlink(obj_tmp)
    bpy.data.objects.remove(obj_tmp)
    bpy.data.meshes.remove(me_tmp)

    scene.update()

    return intersect

obj = bpy.context.active_object
contador = 0
for sub_obj in bpy.context.selected_objects:
    if sub_obj == obj:
        print("is the same active object")
    else:
        obj2 = sub_obj
        intersect = bmesh_check_intersect_objects(obj, obj2)
        print("There are%s intersections." % ("" if intersect else " NO"))
        if intersect:
            contador +=1

print("How many objects touch one chosen object?: " + str(contador))


Faces are missing in the textured view I've downloaded a free 3d car model, and everything seems to be fine except one thing: the windows act very weirdly. When in texture view, some of the faces seem like they are missing, while in the non texture view the surface looks solid. The texture is a solid grey square. I'd be very appreciative if someone could help me to fix this. I provided a few screenshots, so it would be easier to understand the issue.

Non textured and textured views

This is how it's rendering in Blender AND on a game engine (very badly)

It was the issue with the normal vectors. I fixed that by flipping normals on the problem faces. Shame on me, I should have figured that out myself. Thank you, I appreciate your assistance.


How can I make a circular object appear perfectly round? How do you make a spherical/ovular object in Blender?

I can make square objects, and I can make a UV sphere. But how would I make an object that appears spherical in render?


Can't use the camera I was following a tutorial on Youtube, everything went Ok until I reached the part where I had to set up my camera. It's just not working with me. Every time I click on Ctrl-Alt + 0 to add a camera the scene flips around and the main cube turns upside down for some reason leaving the other parts floating out. Also if I click on 0, to activate the camera view, it behaves the same way why is that?
https://media2.giphy.com/media/qE5DZycVR9Fir0Ev21/giphy.gif
https://media4.giphy.com/media/f5yWZd6a9qfWWjTOKi/giphy.gif

My guess is that you accidentally set some other object as your active camera (yes, believe it or not this is possible - Ctrl+Alt+Num 0 snaps the active camera to the view, whereas Ctrl+Num 0 re-assigns the active camera to whatever object you have selected - easy to mix up by mistake). To fix it, select your camera, and then make it the active camera again from the View menu or by pressing Ctrl+Num 0. This should make it behave as normal again:


Retopolgy around eye holes The mesh  needs retopologising, but I have the problem of the reotopologised mesh's eye holes not sticking to the edges of the eye holes in the original mesh. How can I fix this?

Thank you.

It looks like there is a small lip to the edge of the eyelid that your retopo is skipping through.  You are probably fine to just continue, retopo is generally for skipping detail like that.  If you want, you could capture that detail with a baked normal map.

If you are intent on modeling the small detail, I would add an edge loop in edit mode (ctrl+r)


How do I merge the body and the legs? So this is my first time modeling a body and I've made the torso and the legs in different objects so I wouldn't mess it up, now I don't know how to merge/connect them to make it a single object and the "Subsurf" modifier doesn't appear on the modifiers tab, I also don't know how parent vertexs work nor how to subordinate other vertexs.
Here's a picture of the objects I'm talking about:

I would try this:
Select your leg on Object mode, change to Edit mode
press "A" to select the whole leg
copy with ctrl+c
unselect clicking everywhere else
turn into object mode again
hide the leg you've just selected before with "H" and select the torso on object mode
change to edit mode and PASTE THE LEG (CTRL+V)
If I'm right, now you have a leg into the vertices group of the torso and now you can link them!


Can't move the viewport after updating from 2.69 to 2.78 I just updated Blender to 2.78, and now I can't move the viewport with Option-Click and drag. I can select objects but I can't move the viewport.

Does anyone know how to solve this?

It's possible that not all of the settings were copied over from your old blender version into 2.78 when you installed it.

As far as I know, the option to move the mouse with Option (or Alt)+Click and Drag isn't enabled by default, but can be enabled by checking the 'Emulate 3 Button Mouse' box under the Input panel of the User Preferences.


How to make a super sonic material in cycles? I am trying to make a shader like the yellow shader below but can’t get it right. I have tried using a mix shader with two diffuse and a fresnel but it ends up way off from the what I’m trying to achieve.

I would use the principled shader. It also looks like some anistropy is being used but you will have to play with that. Mess around with the anistropic sliders and roughness to get the desired look. It almost looks like your image has hair the same color as skin so its giving it that sheen look.

The 2nd shader is so you can control the fresnel (the lighter yellow part).


How to make a volume fade from center in Blender 2.8? I've come across COUNTLESS different tutorials to make this work in older versions of blender. I am attempting to create a rayleigh scattering effect at the edges of planets viewed from space. I have followed youtube tutorials, and even bought that Space VFX class for 60 bucks hoping for an answer. The old way to do it was quite simple as shown below :

Note : the default values the tutorials all use are all roughly 1. i just used this screenshot to show it didnt work, even when values were cranked to extremes. If anyone knows how to work around this or a better method, i would be eternally grateful!

On going from Gradient Texture node to Math node (using Multiply) you have a multiplication factor of 0. Hence the strength of the emission will be 0. Here is a node setup that seems to work


How to run a script when when baking is finished? I need sort of an alarm script that will play a loud sound when baking has finished. How can I get such a  script to run when baking is complete?

Blender currently supports only callbacks for these events:

frame_change_pre, frame_change_post
render_pre, render_post
render_stats
load_pre, load_post
save_pre, save_post

The simplest thing you could do is invoke the appropriate bake operator by a script (the python call is displayed when the mouse pointer is over the back button).

Create a python script e.g.:

bpy.ops.fluid.bake()

and add the code to play a sound from How to play a sound after script finishes?


Eye rig for a creature I'm trying to build this eye rig as seen in this video: https://www.youtube.com/watch?v=T8mgzIgz2Bs&t=392s

Onto a creature that has it's eyes on the side of it's head but not entirely. Because the eyes aren't facing forward or sideways, it's somewhere in between, thus I can't rotate those bones at all on any axis. If I do it on the X axis then it twists it, if I do it on the Y it twists it.

Is there a way to solve this or does this rig only work eyes that are explicitly facing one direction?

Here is how it looks with eyes open:

And this is how it looks with eyes closed:

Your problem might be:

1) Good position of the roots and good orientation of the bones, so that, when they rotate, they do it in the good axis and in the right direction

2) Proper rigging of the eyelids.

Let's rig 2 demi-spheres that could be your eyelids:

Create an object with 2 distinct demi-spheres.
Create 1 armature with 2 bones with their root approximately at the centre of the sphere. Call these bones "eyelid_top" and "eyelid_bottom".
Parent the object to the armature with a ctrl P > Set Parent To > With Empty Groups. Now you've created 2 vertices groups called "eyelid_top", and "eyelid_bottom" but they haven't been assigned to any vertice of the mesh yet.
Select your object and in Edit mode, select the top demi-sphere and assign it the vertex group called "eyelid_top", then assign "eyelid_bottom" to the bottom demi-sphere. Now these meshes should move if you move the bones.
Now to constraint the bones, add them a Limit Rotation constraint on the axis you want, choose Local Space.
You could only constraint the top bone and choose to assign a Copy Rotation constraint to the bottom bone, so that when you rotate the top eyelid it automatically rotates the bottom eyelid. Don't forget to click on the Invert option of the constraint.
In Object mode rotate the whole armature on the Z axis so that it is oriented the way you want, according to the way they should be on your character's face.

Of course your eyelid meshes and bones should be part of the whole mesh and armature of your character, I'm just showing how to do it as if they were apart

Now let's imagine you've created eyes for a human face, they will be directed in the same direction as the head. If you need sideway eyes for another character, they will be directed sideways, and your bones need to be as well.


Is it possible to twist bones while posing on Weight Painting mode? On regular pose mode, I can twist the forearm by changing the rotation value under Transform. But I can't use this method on Weight Painting mode, any value I change in Rotation moves the whole mesh. I can still pose the arm by grabbing the control bone, but I can't do twisting motions, just bending.

Of course you can. Just hit R Y Y.

The Transform values in Properties panel refer to the mesh as it is the active object from those 2 selected while Weight Painting.


Is there a way to limit the number of CPU Cores used for physics baking? Is there a way (in Blender) to limit the number of CPU Cores used for physics baking, like you can with rendering?

There isn't really a straight forward answer for this, it will depend on what simulation you want to bake and what OS you are using.

To use multiple cpus, some parts of blender use openmp and others use pthreads.

For simulations using openMP, setting the OMP_NUM_THREADS environment variable should limit the cpus used.

For simulations using pthreads, adjusting system limits should be able to limit the cpus or cpu time used. The way to do this varies between most operating systems, for linux there are /proc/... settings or the bash builtin ulimit command.

Another approach available on most *nix systems is the nice and renice commands to adjust the cpu priority so that other procs are given cpu time before blender.


Imported OBJ file with transparent texture has black background When I import OBJ file with texture image of transparent png and red background I can see the color of red is correct when in Solid Preview mode.
But once I switch to material or rendered preview mode where I would expect to see the image with red bg all I see is the image with pitch black bg - why?
In fact I am just testing if the OBJ file is OK (it is OBJ I made, generated by the Blender 2.8), cos it does not show texture in UE4 where I want to use it (so now I know the info about the texture is correct and something else is wrong with the UE4, but that is another topic, of course).
PS: I would like to have a solution without using of NODES, if possible.

Edit : So my answer only answers partially to your problem, whoever knows a bit better about Obj and Mtl imports will hopefully give you a better answer.
I don't know how to work without nodes, so I show you the problem and the solution with the nodes:

You want your arrow to show up on your object on a red background, here is the current node organization:

This node organization doesn't allow you to show any background, so it shows only black where there's the alpha transparency. The red you see in Solid mode is actually the color you've picked as Viewport Display color:

To create a red background, you have several solutions, you can plug your Image Texure into a MixRGB, choose a red color in the second socket, and plug the Image Texture alpha output into the factor of the MixRGB:


Toe Bone Doesn't Appear To Be Weighted Properly (But It Is) The proper vertices have been weighted 1.00 to the one bone, they aren't weighted to any other bone. The other toe bone, identical, works just fine. There's only one Armature modifier attached to the character. I've checked, the IK and copy rotation constraint does not affect the bone in this way. And yet they behave like they are 0.5 weighted. I've tried duplicating the bone several times and simultaneously weighting the vertices to each bone to make it move quicker and not even that works.

Here is a link to the file: https://files.fm/u/at43v96p?k=a36b860b

Your vertices are not weighted to toe.L only. If you remove all weights from all other vertex groups, everything will work as expected.


script addon Blender filepath I wrote a little script addon but I can't put operator in panel with filepath to export to folder. The example under, I wan't to replace path with panel.

# EXPORTE EN COLLADA -
class ColladaExport(bpy.types.Operator):
    bl_idname = "object.colladaexport"
    bl_label = "Collada export"

    def execute(self, context):
        path = "D:\Documents\VR\mixedRea\polypheme\models"
        selection = bpy.context.selected_editable_objects
        bpy.ops.object.select_all(action='DESELECT')
        for obj in selection:
            if obj.type == 'MESH':
                obj.select = True
                bpy.ops.wm.collada_export(filepath = path + "/" + obj.name,
                                          check_existing = False,
                                          filter_blender = False,
                                          filter_image = False,
                                          filter_movie = False,
                                          filter_python = False,
                                          filter_font = False,
                                          filter_sound = False,
                                          filter_text = False,
                                          filter_btx = False,
                                          filter_collada = True,
                                          filter_folder = True,
                                          filemode = 8,
                                          selected = True,
                                          active_uv_only = True)
                obj.select = False

        for obj in selection:
            obj.select = True
        return {'FINISHED'}

Thank you
Thank you very much for these indications. I'm going fast with an ant ... I followed your directions. The good text is written correctly with the brother button But the recording in collada in the chosen file does not work. Here is the script:

import bpy
import os

from bpy.props import StringProperty, BoolProperty, EnumProperty
from bpy.types import Operator

class ColladaExport(bpy.types.Operator):
    bl_idname = "object.colladaexport"
    bl_label = "Export collada"
    filter_folder = BoolProperty(default=True) # only folders
    directory = StringProperty(subtype='DIR_PATH')

    def execute(self, context):
        selection = [o for o in context.selected_objects if o.type == 'MESH']
        scene = context.scene
        for ob in context.selected_objects:
            ob.select = False

        for obj in selection:

            scene.objects.active = obj
            obj.select = True
            filepath = os.path.join(self.directory, "%s.dae" % obj.name)

            bpy.ops.wm.collada_export(filepath=filepath, check_existing=False, filter_blender=False, filter_image=False, filter_movie=False, filter_python=False, filter_font=False, filter_sound=False, filter_text=False, filter_btx=False, filter_collada=True, filter_folder=True, filemode=8, selected=True, active_uv_only=True)

            print("collada export", filepath)
            obj.select = False

        for obj in selection:
            obj.select = True
        return {'FINISHED'}

class VrTools(bpy.types.Panel):
    bl_category = "Tools"
    bl_context = "objectmode"
    bl_label = "VR Tools"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'

    def draw(self, context):
        layout = self.layout
        self.layout.prop(context.scene, "directory")
        op = self.layout.operator("object.colladaexport")
        op.directory = context.scene.directory

def register():
    bpy.utils.register_class(ColladaExport)
    bpy.utils.register_class(VrTools)

def unregister():
    bpy.utils.unregister_class(ColladaExport)
    bpy.utils.register_class(VrTools)

if __name__ == "__main__":
    register()

Invoke the filebrowser

If the filebrowser is invoked with only a directory property and no filepath it will only have choice of folder to export to.  Possibly more handy than having a path to set in the UI.

To call the operator from code with a directory use bpy.ops.object.colladaexport(directory="/tmp") and it wont invoke the filebrowser.

import bpy
import os

from bpy.props import StringProperty, BoolProperty, EnumProperty
from bpy.types import Operator

class ColladaExport(bpy.types.Operator):
    bl_idname = "object.colladaexport"
    bl_label = "Multi Collada export"
    filter_folder = BoolProperty(default=True) # only folders
    directory = StringProperty(subtype='DIR_PATH')

    def execute(self, context):

        selection = [o for o in context.selected_objects if o.type == 'MESH']
        scene = context.scene
        for ob in context.selected_objects:
            ob.select = False

        for obj in selection:
            scene.objects.active = obj
            obj.select = True
            filepath = os.path.join(self.directory, "%s.dae" % obj.name)
            '''
            bpy.ops.export_scene.collada(
                    filepath=filepath,
                    use_selection=True,
                    )
            '''
            print("collada export", filepath)
            obj.select = False

        for obj in selection:
            obj.select = True
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        wm.fileselect_add(self)
        return {'RUNNING_MODAL'}

# Only needed if you want to add into a dynamic menu
def menu_func_export(self, context):
    self.layout.operator(ColladaExport.bl_idname, text="Text Export Operator")

def register():
    bpy.utils.register_class(ColladaExport)
    bpy.types.INFO_MT_file_export.append(menu_func_export)

def unregister():
    bpy.utils.unregister_class(ColladaExport)
    bpy.types.INFO_MT_file_export.remove(menu_func_export)

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.colladaexport('INVOKE_DEFAULT')

Note: just found out the collada exporter I have doesn't work, so I commented it out

As a stand alone property

If you wish to define a directory on say the scene object, use the 'DIR_PATH' sub-type of a StringProperty

bpy.types.Scene.directory = StringProperty(subtype='DIR_PATH`)

can display in a draw method via

self.layout.prop(context.scene, "directory")

which will include a browse button in layout to set folder using filebrowser, like that shown for setting the render output folder.

and can use this setting in operator above from draw method with

op = self.layout.operator("object.colladaexport")
op.directory = context.scene.directory

in which case could remove the invoke method in operator above to not invoke the file browser.

Since you are using if for an addon, saving to the addons user preferences would be a good option.  See this answer

EDIT  given the edit to your question, you need to register the scene property.

def register():
    bpy.utils.register_class(ColladaExport)
    bpy.utils.register_class(VrTools)
    bpy.types.Scene.directory = StringProperty(subtype='DIR_PATH')

def unregister():
    bpy.utils.unregister_class(ColladaExport)
    bpy.utils.register_class(VrTools)
    del(bpy.types.Scene.directory)


Render specific meridians/parallels of a sphere I would like to render specific meridians or parallels of an UV Sphere to obtain this kind of plain images.

I have been trying with the Wireframe Modifier but I can't find an easy way to render just the ones I want.

Any clues to do it in an easy way?

Thanks for you help in advance

Start with an UVSphere.

Select the edge loops you want (Equator, Parallels, Meridians)

Press P to separate the selected edges.

Select the newly created object and press AltC to Convert the object to Curves:

Give the curve some bevel or extrusion:


Why does a Wave Texture not follow a rig? I'm rigging a simple character with a stripey texture and rigify rig.

Before rigging, if I move the geo, the texture moves with it, once I parent it to the rig the texture stays still while I move the armature, almost like it's projected.

What am I doing wrong? Is there a fix that doesn't mean UV unwrapping everything as the current setup looks fine for this character. Thanks!

you are using 'Object' as your 'texture coords' but you have no 'object' selected in the field box. You really should be unwrapping and using 'UV' coords instead.


Objects not displaying in render Hi I'm trying to make a river scene but the only thing that is showing up when I render is the object that I'm using as a fluid inflow.
Camera View

Rendered

As you can see in the outliner everything other than the grass in enabled in render but for some reason it does not render.
Can anybody tell me why this is happening?
Blender File

Select object that is not rendered.
Go to Properties Editor > Particle System > Render > Show Emitter


how to rig leg with hydraulic jack im modeling a robot and want to have a hydraulic jack on the back of the leg
how can i rig that?

i found  that if you do a copy location and change the Head/Tail value and then add a track to the other side