Use texture painting to determine transparent areas I want my "floor" plane to be transparent but with painted texture on it, but can't seem to fix the problem I have. I hope it makes sense, I have attached a photo for reference:

EDIT:
What I did so far (thanks @cegaton), I may be missing something

Here's an examples using the painted texture to control the mix between diffuse and transparent shaders on a plane. Areas painted in white will be opaque, black will be transparent.

If you are getting the opposite effect switch the transparent and diffuse nodes. Or add a Color>Invert node between the texture and the Fac input fot the Mix Shader node so that the black areas are opaque and white becomes transparent.

Note that this texture painting controls the transparency only. The texture for the difuse shader has to be a different texture (or image), plugged to the color socket of the shader.

If you are going to paint directly on the 3D viewport make sure that you select the correct paint slot.


Snap all vertices to grid when translating (not center of selection) I have a simple 3D model where all vertices are on the grid.
The model origin and 3D cursor are both on the grid at 0,0,0.
I have Absolute Grid Snap turned on.

When I box select and translate it only snaps the center of the selection to the grid.
I want all points to snap to the grid regardless of where the centre is.
It would suffice if only one point snaps to the grid as all other points will follow.

This isn't an issue where the center of my box selection happens to fall exactly on the grid already, but where the center of my box selection is not on the grid, any movement causes all selected vertices to immediately jump off the grid. This is quite frustrating.

I have changed the Pivot Point to individual origins but as stated in Blender this only effects rotation/scaling, not translation.

How can I translate based on a vertex of a selection or even the outside bounds of the selection, instead of translating based on the center of the selection?

I should mention I'm using 2.8, but this problem also existed in 2.79b.

You can move the Origin of the object, which is currently your "center of object", to the grid.
In Edit Mode, select a vertex on the grid, then press Shift S and Snap to Selected.
Then in Object Mode, go to the Tools Tab of the Tools Editor, Set Origin, and Origin to Cursor.
I'm in 2.79 - hope you can find the commands in 2.8.


How to change a mesh into light Are there any way to change a mesh completely into light? If then are there a way to give it multiple colors.
Any render engine will work
thanks

Not sure this is exactly what you mean but you if you want a shader only approach, try something like this. Lights in Cycles are just Emission objects anyway.


What's this camera viewport/clipping visualization for and how do I get rid of it? In Wireframe and Solid view modes, there's this "cone" of visibility that extends out from one of the cameras and clips all the objects in the scene:

It does not move at all when I switch cameras or move the camera. I've tried clearing the camera border but it had no effect.
It doesn't appear in Material Preview or Rendered modes.
How did this show up, and how can I make it go away?

This might be because you accidentally used the shortcut Alt+B (Viewport clipping?) while trying to define the camera border.
The solution it that case is to press Alt+B once again in 3D viewport mode.


My Cube is falling through my Plan I changed the speed of my animation in the scene propertys/rigid body world from 1.000 to 10.000 and now my cube is falling through the plane even I set the plane on passive and the cube on active with collision enabled. What am I doing wrong?
Thx in advance!

select your rock
tap CTRL-A -> scale
then it works.
explanation: whenever you do something with physics, always(!) apply scale and rotation, else it won't work or works weird.


Scaling from the center of the object? I'm trying to scale from the center. The entire circle is selected but it's scaling from the white edge that was option clicked. Is there a setting for this? How can I keep my selections centered?

Cheers!

Change Pivot point to "bounding box center"


Move text between two Objects (even if i will change objects positions) I New here

I want to Move text between two objects, for example, I want to do animation in a certain second.

An object moves from the location of a particular object to the location of another object regardless of the current location of the object to which it should arrive.

For example I have two cubes in the file (below Moshe and David), and text (hereinafter "Zvika").

I want from 10 to 11 seconds The text "Zvika" will leave the cube Moshe, and will reach the cube David, even if I then arrange the dice in another order.

You can use Animation Nodes for this. A simple linear interpolation between the two position using the Animate Vector node. The Delay node is used to set the frame at which the animation will start.


Very noisy render with emission+glossy shader I'm trying to learn some basic modeling in blender, working on a long concrete hallway. there are supposed to be fluorescent lights on the ceiling of said hallway, and i made those out of emission+glossy shaders in the mesh itself. but this is resulting in an extremely noisy render, even at 1000+ samples.
I've tried changing clamp, filter glossy, caustics, nothing seems to be effective. might just be my pc, not sure.
here's the .blend file: https://mega.nz/#!LUdUGIaB!QFpdxi3DafcFbm5hpdU-qgo8K-LmMP5TZKD1lagCrK0
pc specs:
OS: windows 10 pro 64-bit
CPU: AMD Athlon II x4 640
Motherboard: MSI 870-G45
RAM:8GB
GPU: MSI NVIDIA GeForce GTX 650
render @ 128 samples:

it might just be too dark i dunno

this is a very complex topic and would be to much for a single post answer. but i am trying to give you a rough understanding about what you have to change:

In the virtual space, everything is about faking. not about recreating the real world. this means that it only has to look real from the field of view, but everything else does not matter.

This means: remove everything that does not matter. you do not need a complete interior, remove the all walls that are not visible to the eye. this way every sample that would bounce against the wall, now flies into infinity and does not produce more bounces (that would slow down your render).

also: do NEVER (if possible) light your scene whit mesh light. mesh light is way slower and produces much noise. again, just fake it! in the most cases nobody will notice that you only put a single spotlight there (make sure that multiple importance is activated in the lights material settings). the bigger the light source, the less noise.

also some technical stuff. set the render settings as followed:
sampling: set "clamp direct" and "inderect" to 9.
light paths: "filter glossy" to 0.5-2 (higher values mean less noise but more blury pictures).


How to make light of lighthouse? I tried to do it with volume scatter but result was ugly and strange. Today I found the solution: I make mesh and add emission shader to volume but after sompositing this light disappears. I want try to make animation with rotating light.
Is there any way to make cool light?

My blend file
https://drive.google.com/open?id=0B_-tV3odolwlaC14SG9WVzUyRlk

The light is being lost at the point where you multiply in the Ambient Occlusion as that pass doesn't include the 'light' since it's purely emissive. One solution would be to activate the Emission pass in the Render Layer properties and then Add it in as shown (Emit connected to an Add Color node) :


Missing Objects after Rendering What did I do wrong, that Blender do not renders all objects?
I can see everything in the 3D rendering viewport, but when I render my scene, the closest objects are missing. In the camera settings I toggled clipping back and forward, but it doesn't matter.
Does somebody have a clue?

Found the solution. Had to select objects and in Edit mode > W > Clear all restrict render.


How can I model Gothic style windows? I'm trying to model some Gothic type architecture for a game. I'm more of a organic guy, so I have no idea how to go about modelling these shapes(reference image included). I'm more interested in 1,2,4 and 5.

For now I'm just messing around with bezier curves with little avail. I also want it to have as clean geometry as possible.  Are there some add-ons which can help me with this?

Expanding my comment above:

The "tracing" method is something like this:

1) Find an image at quite high resolution, like this:

I got this stock image from here.

2) If your image has noise or other unwanted drawings, you need to clean it up a bit. To do this:

Save the image to your computer and open in your favourite image editor (mine is Gimp).
Try to select just the window frame (I used Gimp's fuzzy selection).
Invert the selection (selects everything except the current selection, and deselects the current selection).
Delete all.
Invert the selection again (you'll get the window frame selected again).
Fill the selection with full black colour.
Copy the image.

You end with something like this:

Edit: I just noticed that I "lost" some geometry, in the example... I guess my fuzzy selection was too aggressive :D, but the rest of the example works anyway, Sorry.

3) Open Inkscape and paste the copied cleaned image, now you need to "trace" it:

select the imported image and activate trace tools (path > trace bitmap).
You'll need to find your best settings, try until satisfied, I used these:

4) Trace will create a new vector object: Save it (only it) as .svg
(you can copy it, open a blank file in Inkscape, paste then save).

5) Open blender, delete all (empty scene)

6) File > import > .svg

7) The imported object could be very small, select it in the outliner, and then scale it up enough (I scaled it up about 40 times)

8) What you have now is a curve object, and you can convert it to mesh:
- duplicate the curve object (backup)
- select only one curve object in object mode, press Alt+C and select "mesh from curve".

9) Now you have a 2d mesh from your 2d image! You can extrude it, perhaps before clean the 2d mesh a bit...

10) Looking closely the mesh object is far from perfect: you can refine this or, instead, go back to your first try (create from scratch using beziers), but now you know another trick ;).

If you choose to refine the 2D mesh (before extruding, beveling it etc.) you'll probably want to use snap tools, with reference shapes. Or else, I would probably choose the bezier-from-scratch method, it can seem slower, and it is, but you get perfect shapes. Refining traced objects is a pain, imho, and should be last resort when modelling methods can be used...

HTH, Marco


OpenGL render doesnt render with the Panoramic Fisheye Lens? I made a animation with a Panoramic Lens (Fisheye Equidistant) but i need to render it with the OpenGL render for preview purposes....
But how can i activate that type of camera? or is it impossible?
Thanks in regards.

Sadly this feature is not supported. Here is a snippet from the Wiki:

  Cycles supports Equirectangular and Fisheye panoramic cameras. Note that these can't be displayed with OpenGL rendering in the viewport; they will only work for rendering.

Here is a link to the Blender wiki page on Cameras > >


Rotate an object around an axis using python script I try to rotate and translate objects and then insert a keyframe by calling the function below:

def set_keyframe(frame_no, x, y, rotation_z, object_id):

    # change frame
    bpy.context.scene.frame_current = frame_no

    # select the object
    currentObject = bpy.data.objects[object_id]
    currentObject.select = True

    # translate and insert keyframe
    currentObject.location.x = x
    currentObject.location.y = y
    currentObject.keyframe_insert('location')

I could manage to translate the object, however I couldn't find out how to perform the rotation operation. I am just trying to rotate around z axis. I tried to do it using the object's matrix_world in order to simultaneously translate and rotate the object, as suggested here and here. However, I couldn't manage it. Any help, which may not necessarily use the matrix_world, would be appreciated!

P.S. my objects are scaled.

If you don't want to manipulate matrix_world you have to check the rotation_mode of the object first and set the corresponding value accordingly.

import bpy
import math
import mathutils

obj = bpy.context.active_object
eul = mathutils.Euler((0.0, math.radians(45.0), 0.0), 'XYZ')

if obj.rotation_mode == "QUATERNION":
    obj.rotation_quaternion = eul.to_quaternion()
elif obj.rotation_mode == "AXIS_ANGLE":
    q = eul.to_quaternion()
    obj.rotation_axis_angle[0]  = q.angle
    obj.rotation_axis_angle[1:] = q.axis
else:
    obj.rotation_euler = eul if eul.order == obj.rotation_mode else(
        eul.to_quaternion().to_euler(obj.rotation_mode))


Detect if characters are selected in text editor Further to my previous question (print number and index of selected lines in text editor), i'd like to know if it's possible to detect if characters are selected in text editor.

The selection spans from line current_line_index beginning at current_character to select_line ending at select_end_character.

If these coincide, there is no character selected.

So given you know the line and column of your character you can check yourself.

However current_character and select_end_character are byte offsets.
Python uses unicode points. So unless you are using pure ASCII you need to convert the char position to byte offset.

See https://en.wikipedia.org/wiki/UTF-8

The conversion is a bit cumbersome. Something like

from itertools import islice

txt_line = "\u03A0\u2764\u2600\u2602This is a Test"
col = 9
print(txt_line)

ubounds = [0x80, 0x800, 0x10000, 0x110000]
offset = 0

#char is actually an immutable newly created string...
for char in islice(txt_line, 0, col):
    code_point = ord(char)
    for size, ub in enumerate(ubounds):
        if code_point < ub:
            offset += size + 1
            break

print(
    "byte at %d: %d - char: %d" % (
        offset,
        bytes(txt_line, 'utf-8')[offset],
        ord(txt_line[col])
    )
)


How can I flatten a cube on the Z axis and make the sides protrude outwards? I am wondering how to make a cube squish like a sphere on the Z axis. It will be an animated cube, so it needs to squish like a real sphere.

You can quickly achieve this with a Simple Deform modifier set to Stretch and using a negative Deform factor.


Turn off all menus for a screenshot I need to take screenshots from my working area often and don't know how to get rid of all these menus and buttons. I don't want to render, because then I'll need to set up the camera and so on, and also I don't need a quality pic for my purposes.
Is there a way?

There are different ways to accomplish your goal, depending on your specific needs.

Viewport Render

The viewport can be rendered through View > Viewport Render Image.

Screenshot of the active area

A screenshot of the active area can be created using the following steps:

Hide the gizmos

Open the operator search F3 and search for Save Screenshot.
Run the Save Screenshot operator (bpy.ops.screen.screenshot()).
Uncheck the Full Screen property (this will only include the active area) and save the image.

Fullscreen mode & third-party software

The following steps enabled the fullscreen mode and allow you to take a screenshot with a third-party tool:

Hide the gizmos

Switch to fullscreen mode through View > Area > Toggles Fullscreen Area (Ctrl+Alt+Space).
Use a third-party tool to create the screenshot
In order to leave the fullscreen mode move the mouse cursor to the upper right corner and click on the icon . Alternatively you can also press the shortcut again Ctrl+Alt+Space


Expand / Collapse all hierarchy in Outliner How do I twirl down everything in a hierarchy in the Outliner? For example, on armatures it's sometimes tiresome having to click on the twirl down-arrow on every single bone if you want an overview of the armature in the Outliner. Is there a quicker way to do this?

Starting point.

This is what I would like to achieve without having to manually click on the twirl down-arrow on every single bone.

Please note: This is just an example armature and maybe not the best example. Sometimes there's armatures with over 100 bones, and I'm more specially talking about those cases where it actually gets very tiresome twirling down everything.

Simply click on expand arrow with Shift key.
It will expand/collapse everything under it. So if you need ...

expand all (under collection) - click on Collection
expand only specific bone chain - click on Armature

Example with and without Shift key:

Or use "+" / "-" key (with cursor in Outliner Editor) to open / close one level.

More details in Blender Manual.


How to fix render darken after texturing in blender cycles? I'm an 11 year-old who has close to zero experience with blender and was recommended to try it by a friend. I had rendered an image without texture and it was very well lit. But, after I textured it in blender cycles it became very dark.

Before Texturing In Blender Cycles

After Texturing In Blender Cycles

An expanded answer of @cegaton and @PCmath.

In cycles lighting can be one of the most important aspects of a render, it can make a dull image into a full vibrant master piece.

Here's a quick render with only three objects: A floor, Suzanne, and finally a camera. I added no lights to this scene.

Here's the exact same scene with a light, i used the light "Sun".

Without lights the scene can look dull. To add a light press the tab on your bottom left labeled "Add" click expand lights, and select your desired light. Experiment and find out what's best for your scene.


Blender Internal Rendering half of the image Ok, i am really noob with Blender internal and this never happened to me on Cycles so... help.
The problem is that Blender is only rendering the half of the Image that i want to render:

And yes, i have mist enabled, but it doesn't affect enabling/disabling it.

Fixed it, it looks that when i used Cycles to render the office I used volumetric lights, that means a giant cube covering the render. The solution? deleting the mesh that has the volumetric material.


How to create sci-fi panels using modifiers? I want to create sci-fi panels using modifiers so i can keep the original mesh.

Mark the sharp edges where you want to apply the separation, then add an Edge Split modifier, a Solidify and a Bevel modifiers.


Blender crashes from replacing mesh data via script I'm working on a script that will generate a mesh based on handles (empties) in the 3D interface. So when the user drags a handle it replaces the mesh data, but leaves the object intact. Here's part of the script:
try:
    obj = bpy.data.objects[name]
    old_mesh = obj.data

    # add  new mesh
    mesh = bpy.data.meshes.new(name)
    obj.data = mesh

    # remove old mesh
    removeMeshFromMemory(old_mesh)

except KeyError:
    # Create Object and link to scene
    mesh = bpy.data.meshes.new(name)
    obj = bpy.data.objects.new(name, mesh)
    scene = bpy.context.scene
    scene.collection.objects.link(obj)

mesh.from_pydata(verts, [], faces)

And the contents of the remove mesh function is here:
def removeMeshFromMemory(mesh):
    passedName = mesh.name
    print("removeMeshFromMemory:[%s]." % passedName)
    # Extra test because this can crash Blender if not done correctly.
    result = False
    #mesh = bpy.data.meshes.get(passedName)
    if mesh != None:
        if mesh.users == 0:
            try:
                mesh.user_clear()
                can_continue = True
            except:
                can_continue = False

            if can_continue == True:
                try:
                    bpy.data.meshes.remove(mesh)
                    result = True
                    print("removeMeshFromMemory: MESH [" + passedName + "] removed from memory.")
                except:
                    result = False
                    print("removeMeshFromMemory: FAILED to remove [" + passedName + "] from memory.")
            else:
                # Unable to clear users, something is holding a reference to it.
                # Can't risk removing. Favor leaving it in memory instead of risking a crash.
                print("removeMeshFromMemory: Unable to clear users for MESH, something is holding a reference to it.")
                result = False
        else:
            print ("removeMeshFromMemory: Unable to remove MESH because it still has [" + str(mesh.users) + "] users.")
    else:
        # We could not fetch it, it does not exist in memory, essentially removed.
        print("We could not fetch MESH [%s], it does not exist in memory, essentially removed." % passedName)
        result = True
    return result

When dragging the handle slowly for several seconds (replacing mesh 50+ times), Blender eventually crashes. It gives the following error:
Blender(61663,0x11de3cdc0) malloc: Incorrect checksum for freed object 0x7fc42fd82600: probably modified after being freed.
Corrupt value: 0xa80000026e
Blender(61663,0x11de3cdc0) malloc: *** set a breakpoint in malloc_error_break to debug

Is there a better way to replace the mesh data that's more efficient and won't cause crashes like this?

You can just use the operator orphans_purge to make sure orphan meshes get freed. I don't think the impact on performance would be noticeable unless you have a huge scene.
obj = bpy.data.objects.get(name)
mesh = bpy.data.meshes.new(name)
if obj:
    obj.data = mesh
    bpy.ops.outliner.orphans_purge()
else:
    obj = bpy.data.objects.new(name, mesh)
    bpy.context.scene.collection.objects.link(obj)

mesh.from_pydata(verts, [], faces)

Also, a few tips :

Avoid Try/Except when using dictionaries, prefer using get(key, default)
Prefer foo is not None to foo != None
Prefer if bar: to if bar == True:

In simple blender scripts you shouldn't have to use Try/Except unless you specifically know which kind of exception your code is going to throw, and even then you should be able to not use it in most cases.


How to interpret output position values of Geometry node I have a simple sphere with a material. And I want to know how understand information the Geometry node gives. I printed this information through OSL shader. Can somebody please explain to me why the position output is roughly (10 10 10), while the object world location is (0 0 30)?

shader Inspector(float input=0,output color debug=0)
{
  debug = input;
  printf("\n");
  printf("%f" , debug );
}

You're turning a vector into a float. So float=(v[0]+v[1]+v[2])/3.

this will give the correct result:

shader Inspector(float xcomp=0, float ycomp=0, float zcomp=0, output color debug=0)
{
  debug = (xcomp+ycomp+zcomp)/3;
  printf("\n");
  printf("%f,%f,%f >> %f" , xcomp, ycomp, zcomp, debug);
}

Use the SeparateXYZ and connect each components to the script.


blender trackpad behaviour on windows as on a mac I switched from a macbook to a windows laptop.
All I can do with the trackpad is zoom in and out.
Is there anyway to get the same behaviour as on a mac?

Zoom in/out: CtrlAlt + LMB and move on the touchpad.

Move the view: ShiftAlt + LMB and move on the touchpad.

Rotate the view: Alt + LMB and move on the touchpad.

For all that you need to check this option:


How can I add a new vertex in blender 2.8? When I click ⎈ Ctrl+ LMB to add a vertex, nothing happens.

How can I add a vertex in 2.8?

For now I merged mesh vertices at the center and extruded from that.

However I am not sure if this would cause any problems.

It's ctrl+ RMB now. You could always create a face and delete the other three vertices.


Add-ons preferences won't show up as shown in the screenshot below, sins I installed some add-ons I opened blender and I found that the add-ons preferences won't show up, I tried to reset preferences to factory, and I  reboot my PC and I even reinstalled it and the issue remains unsolved.
what can cause this problem? and what solutions you propose?
thank you
blender version 2.90.1

I deleted the user installed addons in this direcrtory
%USERPROFILE%\AppData\Roaming\Blender Foundation\Blender\2.90\scripts\

which is not touched by the installer and yeah it worked
problem solved thanks to @batFINGER


How to get nodes from one .blend file into another? I have two .blend files, and I want to get nodes from one into the other .blend file.

You could give a cube the material with a node setup, then open both blend files and copy/paste (CtrlC / CtrlV) the cube between documents.


Composite two renders into one image I am looking to produce an image like this:

Where there are two objects, with one object casting a shadow on the second object. The catch is that I do not want to create this by rendering two objects together in the same scene. I want to create this by combining separate images of each object, rendered separately.
Basically, I want to take this image:

And combine it with this image:

To get this:

Any ideas how to do this? To reiterate, I want to get this result through compositing or other post-processing means, not by rendering the images together. So far, I’ve messed around with the compositor a lot with various render passes, but haven’t figured it out. If you have an idea or method of how to do this, I would love to hear it!
zip file with renders and blend file: https://drive.google.com/file/d/1xR1FEJ3vdHYK5oZvHU1jwf8EZqUBtntq/view?usp=sharing
Thanks,

In this specific case you can fake it.
Since small monkey doesn't cast a shade in the shadow of big monkey ... you can just Z-Combine these two renders.
To fake the shadow casted by the big monkey on surface of the small one you can use Mix node > Multiply the Diffuse Indirection pass. It gives you an illusion - it is correct, but it is not, you are just lucky this pass looks like the casted shadow :)

But this will fail in other cases.
You can't get exactly the same result with totally separated files since the geometry of first one affects light bouncing on second one. So both renders needs to know about geometry of others. Some of those data can be saved in EXR (like Depth to be reused in Z-Combine node, or save Normal pass to try relight render), but there will be always parts totally impossible to composite in natural look.
So ... you would have to share object data info across those renders. Like by using Scenes (as suggested by HISEROD in comment) or View Layers ... or something similar that let you render thing separately, but already affected by shadows, indirect light, reflection etc. of other elements used in final composite.
Even with deep-compositing (used in other softwares) you can't mix everything, for the same reason. This deep-data just handles pixels in space in better way for combining, so these data contains also only pixels visible by camera, so back part of big monkey is not there to cast proper shadow with side light onto small monkey.


How can I paint a mesh using projections of real photographs? We have a series of real (not rendered, taken using canon cameras) photographs, arranged roughly in a sphere around a real world object.  We have used various Structure from Motion techniques to figure out precise camera pose parameters (position, quaternion, focal length) for each shot, and using that information, we successfully "scanned" this object into a mesh.  For instance, I've had a great deal of luck taking the camera information into Blender with the mesh, creating a virtual camera for each of the real world cameras, and rendering depth maps that lineup perfectly with the original photographs.

We're now interested in attempting to texture the mesh using the original photographs.  Conceptually this is simple; I position the cameras in Blender around the mesh just like I did for depth maps, and turn them into projectors (think old school slide projectors), projecting the photograph from the real world camera each represents back out onto the mesh.

The target output of this is a UV-mapped texture+mesh I can take out of Blender and into another environment, such as a game.

Can Blender do something like this?

I'm very new to Blender.  I'm aware of both (http://wiki.blender.org/index.php/Doc:2.6/Manual/Textures/Painting/Projection) and (http://wiki.blender.org/index.php/Doc:2.4/Manual/Textures/Painting/Projection), but at first glance this appears to be an artist driven approach rather than a mechanical one.  The end result is something we can hopefully automate in python, since there are many images.

You might be able to use some of the techniques from this tutorial on camera mapping.

Namely, you may want to try using "Project from View" to project selected mesh faces' UV coordinates based on the current camera view. I've never tried using it via scripting, though.


How to prevent unused cameras from playing their animations? I have a scene with multiple cameras. Each camera is following their respective paths. This was done so that I could have one scene but render out two entirely different animations. Now if I choose the camera that I want to render an animation from, how do I prevent the other animation from playing at the same time? I know that I can hide what is rendered in the Outliner but is it best practice to have both animations playing at the same time when rendering?

A camera itself doesn't play an animation, only the active camera determines what is visible in the rendered animation.

You could ignore the other (inactive) camera it wouldn't be visible in the rendering if it disturbs in the viewport.

Besides simply switching it to invisible in the outliner (as you already described) you could move each camera with its path to another layer. M layer# (0-9)

Assuming all scene data is on layer 1

Layer 1 Scene objects
Layer 2 Camera1 and Path1
Layer 3 Camera2 and Path2

Another possibility would be create different scenes but this would be harder to maintain.


How to activate new mode in Blender 2.8 that displays viewport objects with different colors? I've been watching tutorial videos of the new Blender 2.8 and see it has something that that lets you display each object in your viewport with a different color to make it easier to distinguish them.  I'm trying to figure out how to activate this, but all my searches just turn up tutorials for assigning materials.

Anyone know how to do this?


Why after transforming an object with the matrix_world of another object the reference and target object have different transformation matrices? I'm quite confused on how the matrix_world is applyed to an object.

Why the transformed object has a different transformation matrix of the reference one?
Why the parented objects do not apparently have a transformation matrix? (getting their transformation gives an error)

Here is more in detail my problem:
I'am reconstructing cerebral regions from multiple brains in a separate software (TrakEM2) and using blender (2.79) to manually align all brains togheter to a common reference space. For this I create a central plane between 3 reference points for each brain, parent all objects to that plane and align it to the reference space.
The problem is that I continually edit these brains in TrkEM2, adding details or new parts, and when importing new objects or edited ones, I need to transform them as the previoulsy imported object of the same brain. For this I use the matrix_world of one of the previously imported object as reference (anyone is good but I need to un-parent it).

the imported object goes to the right place (after an additional rotation) but the transformation matrix is different from the one I have applyed to that object. This is wierd to me, and partially a problem beacause I must remeber that these secondarily imported object should not be used as reference objects.
I tried to use the plane that I create when importing as reference, but for some reason the imported object are than shifted from where they should land (rotation ok..)

I attach a script that illustrate the firstissue, an .obj is imported, shifted and than re-imported using the first copy as a reference. As you can see, the origin and rotaion of the two copies are different, as is the printed transformation matrix.
Can anybody explain, give suggestions or send me to some documentation (for linear algebra ignorant?)
import bpy
import os

WORKING_DIR = "G:\Progetto QA\RR PSD Gephryn\Export\Obj\import"
file_name = "RRGEF1_An_LV-pi_1226.obj"
file_loc = os.path.join(WORKING_DIR, file_name)

#import object
imported_object = bpy.ops.import_scene.obj(filepath=file_loc)
obj_object = bpy.context.selected_objects[0]
bpy.context.scene.objects.active = obj_object

#Transform the object to correct default TrakEM2 orientation and scale
bpy.ops.transform.resize(value=(-0.001, 0.001, -0.001), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

#Translate the imported object
bpy.ops.transform.translate(value=(2.45409, 1.31843, 2.94766), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

#get the transformation matrix of the transformed object
M=bpy.context.object.matrix_world
print ("reference:",M)
bpy.ops.object.select_all(action='DESELECT')

#import object
imported_object = bpy.ops.import_scene.obj(filepath=file_loc)

#select imported object and apply the transformation matrix
obj_object2 = bpy.context.selected_objects[0]
bpy.context.scene.objects.active = obj_object2
me = obj_object2.data
me.transform(M)
me.update()

#Correct the transformation of the imported object
bpy.ops.transform.rotate(value=1.5708, axis=(-1, -0, -0), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

M2=bpy.context.object.matrix_world

print ("target:",M2)

Here the updated code after following batFINGER suggestions
import bpy
import os
from mathutils import Matrix,Euler

WORKING_DIR = "G:\Progetto QA\RR PSD Gephryn\Export\Obj"
file_name = "RRGEF1_An_LV-pi_1226.obj"
file_loc = os.path.join(WORKING_DIR, file_name)

#import object
imported_object = bpy.ops.import_scene.obj(filepath=file_loc,axis_forward='Z', axis_up='-Y')
obj_object = bpy.context.selected_objects[0]
bpy.context.scene.objects.active = obj_object

obj_object.scale=(0.001,0.001,0.001)

#Translate the imported object
bpy.ops.transform.translate(value=(2.45409, 1.31843, 2.94766), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

#get the transformation matrix of the transformed object
M=bpy.context.object.matrix_world

bpy.ops.object.select_all(action='DESELECT')

#re-import object
imported_object = bpy.ops.import_scene.obj(filepath=file_loc,axis_forward='Z', axis_up='-Y')

#Transform with matrix multiplication
obj_object2 = bpy.context.selected_objects[0]
obj_object2.matrix_world = M * obj_object2.matrix_world

# Adjust the transformation
obj_object2.rotation_euler=Euler((-1.5708,0,0),'XYZ')

M2=bpy.context.object.matrix_world

print ("reference:",M)
print ("target:",M2)


How to remove edge creases? I've creased some edges (applying different values to them) using the Shift+E shortcut. Now I want to remove some of them/all of them. How to do it? I've selected the whole mesh and tried using the edges specials menu (Ctrl+E), but there are only options for clearing the seams, sharpness and freestyle  (Clear Seam, Clear Sharp, Clear Freestyle Edge). How to 'clear' the creases?

You may remove the edge creases by selecting the whole mesh or only the desired edges,  and then opening the properties panel with N
Then change the mean crease to 0

Another way is to press ⇧ Shift+E and enter a negative value (-1 for instance).
Documentation is here


Blender is not using CUDA, aulthough it is configured to do so I'm using Pop!_OS 17.10 (based on Ubuntu 17.10) on a Dell XPS 15 9560 and Blender 2.79b. CUDA is installed, the Nvidia GPU (GeForce GTX 1050) activated and Blender is recognising both:

But when I hit render, it's rendering on the CPU:

This is my second Pop!_OS installation because I messed up the previous one. But before, Blender was rendering on the GPU as expected. Am I missing something here? How can I make this work again?

on your render settings, make sure you have the rendering device set to GPU and not CPU, selecting CUDA on user preferences only enables the option to render with a GPU but you still need to change it on the render settings


Problem creating black tinted glass material I was wondering how I can create the black shiny glass material of the container in the following video.

Here is the video:
https://www.youtube.com/watch?v=GjWxxcND894

Thank you for your time!

Doesn't look like glass. Use a glossy shader.


Is it possible to use characters of Manuel Bastioni Lab with the rigify rig? I sometimes tried it. I used the existing rig of the character as MetaRig or I deleted it and  created a new on. It was no problem to create the rigify rig an the buttons but it was unpossible to skin this rig. When I tried to make the rigify rig parent of the character with automatic weights, I get the message: "Bone Heat Weighting failed...."

There is an addon by DanielEngler to do just that.
Link to download:
https://github.com/danielenger/Meta-Rig-for-MLAB
More explanations on BlenderArtist if it's not obvious enough for you (it wasn't for me).


How to fix radius on particular spot using subdivision modifier I'm trying to fix a spot on the mesh which has too much of a curve when I extrude downwards in the mesh.
So my first attempt was to add more loop cuts which fixed the radius but then it ruined the shape of the circle in the middle creating pinching. I also tried with edge crease. At first didn't select all the edge lines it did make a nice radius but it left artefacts on the edges. Only when I selected more edges it fixed up the artefacts but then I lost the shape of the radius and ended up as a rectangle. So whats the right way to approach this modelling technique?


Blender 2.8x - Particle Color based on actual color of emitter Looking for a way to set the color of each particle to the exact color from where it was emitted.

Trying to make a 2d image plane dissolve effect.

Checked this thread but its not doing what I am trying to achieve:
Particle Color based on where the particle is emitted?

I'd like to get something like this:

Thanks to @Lumpengnom at https://blenderartists.org/
I found the solution!

Important steps are:

1.) Add a texture coordinate node, connect UV to vector and enable the "from Instance" check-mark.

2.) Use Cycles renderer, also for preview!, otherwhise you will not so the right result which is very irritating.

Here is a quick video tutorial:
https://youtu.be/8W1J8hYjK9g


3d Printing Problems I have some problems when I try to 3d print my project, so I'll be as specific as possible.

I first created this mask, and applied a solidify modifier to it:

The first time I exported as .stl, but it showed up blank in the 3d printing software, Cura. I then applied the solidify modifier, yet it still was blank when imported.

I then tried to export as .obj, which worked fine. I could see it in Cura. I began the 3d printing, using an ultimaker2, yet it did not seem to be working. It started the printing but ended up just moving the material around.

One thing to note is that when looking at the Layers in Cura, it seems that even with the solidify modifier, it looks infinitely thin, only showing some thickness. Why would this be? Could it be a problem with the export options, or with my mask itself?

Here is the project file if anyone could look at it: https://drive.google.com/file/d/0ByCsi4JV6Yv1WXBfSkJlTnd1SUU/view?usp=sharing

The usual culprits for this sort of thing are as follows:

Too small (scale) : most 3d slicing software has their units set up so that blender should export .stl's at .1 scale.  Otherwise, the object may be waaaay to big. or waaay too small. Try playing with the export scale and the object scale and see if you have any luck.

Too thin : the parallel problem to the scale issue is that if it is too thin, the object will not slice properly.  There is a minimum thickness the printer is capable of, and the slicer will exclude things that are too thin.
Inverted normals : if the normals are not set the right way, the slicer will not be able to detect the solidity of the object.
Non-Manifold :  Your object must be closed, or the slicer will not be able to detect the solidity of the object.

Due to your description, it sounds like one of the last three.


how do I change lookdevreflections hi guys, is there any possibilities to change these mirror ball reflections to my interior scene reflections. as you can see this doesn't looks very good... thanks

You have to check these squares in to allow screen space reflections:


The trivial problem of weight painting and x symmetry I used rigging to build a skeleton, and I turned on x mirror and x symmetry to weight the leg symmetrically.
However, if a weight value is assigned to other bones except for the two bones, the operation will not work.
Is there any way to make this completely symmetrical?

There are 2 different kinds of symmetry in weight paint:
n. 1 is for "center" bones, where every stroke on the left part of the mesh will be copied on the right side (in the same vertex group).
n. 2 is for couples of bones .L and .R, where a stroke on the .L vertex group will result in a similar mirrored stroke ond the corresponding .R vertex group.
Theese 2 options are not intended to be used together, you have to enable and disable them according to the selected bone/vertex group.


Realistic Rusty Chain I was doing this tutorial. I think the UV unwrapping in the tutorial is not done well. I think the UV map should look like this

But these top and bottom views show that I have done something wrong. Either in my UV unwrapping or in my node map.

The top view shows much more "rust" than the bottom view. This is why I think I have done something wrong with this "rust" image texture.

Here is my node map

How to make a realistic rusty chain link ? What should I do better ?

Seams are visible around the link at the lines corresponding to the UV seams :

To correct that, you can paint (texture paint) this part using the clone brush, preferably using a strength of 1 (if not you will have more blurry painting).

To clone paint, Ctrl+LMB at the position you want to clone, then paint along the seam :

Note that will change your texture. So make a copy of it before you do that.

For adding more rusty parts, you can use the same principle, both in order to have more rust at the places you want and also to correct the seams :

The same part, before and after (no need to be an artist to do that !):

Edit : to have more rust in a more easy way (but that will not correct the seam problem) you can move the UV map parts to the center. In this particular case, that will not have any impact for the other texture :


How create a desert like this in Blender? Is it possible to create this desert in Blender?

For youre purpose you could use the Landscape add-on (Preferences -> Add-ons -> Categories/Add mesh -> ANT Landscape) or the Ocean generator in Blender. The Ocean modifier might work the best because you want such sharp dune cresps and a desert is very similar to an ocean cause it is influenced by wind just like oceans. Add a plane to the scene and add the ocean modifier. Play around with the settings until you are satisfied. Use the "Choppine" slider to sharpen the cresps and the scale to adjust the height of the dunes. Leave the Resolution at a value around 10. You don't want to much detail in that scene. Now you have got the basic shape of the desert.

The secret to make it looks very realistic is the texturing. I don't know how far you are in that but you will definitely need a so called "bump map" for the shape of the small grooves on the dune slope.


Should I restart my character mesh? I've been working on my first character mesh that I am taking seriously and want to be high quality.

I plan to use it in Unreal Engine 4 and I think it looks okay (Definitely needs to be improved though), but I don't feel confident about the topology and I think there are way more tris than necessary. Without a subdivide it's at 18k tris and with subdivide it's at 77k tris.

I'm not sure if it is reasonable or not, but I really don't feel that good about it and I feel like maybe restarting from scratch might be a good move and try to fix the things I did wrong on this mesh.

I'm wondering if someone with experience with making character meshes designed for video games can give me any advice on if I should just restart from scratch or work with what I already have and how to improve on it technically in terms of topology and tri count, and also if possible aesthetically on how to make it look more realistic.

Also should I mostly be modeling in edit mode or sculpting? I feel like modeling can get me better shapes if I'm trying to have a low tri count and in order to sculpt I need a high tri count for it to even work as it should.

I hope I'm not asking too many questions. Any advice is appreciated. Here is a screenshot:

It's a good Idea to restart the character and try to optimize the edge flow
Use retopology to fix the problems with the mesh (here is a very good tutorial for setting up retopology:https://www.youtube.com/watch?v=2hEHtKH55Us
Use the decimate-modifier and look if it gives you the results you want


How do I make a puzzle piece mesh solid? I created a rough puzzle piece in blender so I can export a .fbx and then import into Unity to create a virtual reality puzzle but when I import it into unity there are pieces of the mesh missing but in blender everything is solid.
After I create my mesh what is the best way to make the entire mesh solid so that when I import it there aren't missing pieces. I've tried flipping the normals and smart UV unwrapping but it doesn't help much.

I selected one of the parts that were missing and chose Normals > Recalculate Outside and then chose Shade Flat and everything cleared up.
I will look into culling though I'll be making several puzzle pieces and the quickest solution is desired.


How can I set the camera parameters for 3d motion tracking footage? I am trying to 3d motion track a scene from my Sony HDR-HC7e Camcorder.
I know that he has a 1/2.9" ClearVid CMOS sensor in it but how do I get the horizontal sensor Size? and should I youse the 1440 * 1080 footage that comes from the camcorder to track and resize it after the rack and render or should I directly resize it?
It was filmed with a 5.4 mm focal length. I know that for sure.
The footage also appears to have a pixel aspect ratio of 1.33 what do I have to do with this?
I have transformed the Interlaced footage with a small AVSynth plus script.  I had the idea to get all the parameters from the camera through a grid shot and some software analysis but the Meshroom Camera Calibration node doesn't detect the gird and Matlab's camera calibration software is too expensive.
The shot that I am trying to track as well as some calibration shots, can be found here.
I also want to compute the K1 and K2 distortion parameters and Optical center with Nuke. Do I have to use the 14401080 footage or a 19201080 resized version for that?
The grid in the calib_raw shot has a cell size of 2020mm and the nuke_calib_raw shot has a cell size of 18.518.5mm
All info about the Sony HDR-HC7e comes from this manual.
I was also wondering what the sensor size for stills captured in 3 by 4 is because I was doing some photogrammetry In just used the 1/2.9 inch converted to mm. And for the K distortion coefficients and optical center I would just take grid image taken in the same mode an send it rough nuke. Or? Software use there is Meshroom.

There is no need to un-squeeze the anamorphic pixels as an extra step (specially if you have already de-interlaced it, so you are dealing with a degraded original to begin with), just enter the aspect ratio in the Track > Camera > Pixel Aspect section.

For the sensor width enter the value you know and set the lens to 5.4mm
You can try to find the radial distortion coefficients (k1, k2) using the annotation tool. The procedure is outlined in this post:
How to determine lens undistortion values for motion tracking?
But Blender will optimize those settings in the solve if you set the refine settings to Focal Length, Optical Center, K1, K2.

At the time of solving and refining blender usually gets those parameters quite accurately.

You should aim for an error average of less than 1/3 of a pixel (0.3)
For accurate tracking and solving, please read the very detailed post on motion tracking:
How can I get better results when doing camera motion tracking?


Trying to bake mesh results in "Circular reference in texture stack" I'm trying to bake my object to have a single texture so that I can export it, but I always get a "Circular reference in texture stack" error at the top.

Sometimes it will change to a random image in the UV editor and overwrite parts of my textures, resulting in my object getting warped. I'm using Blender Render.

Is there something I'm missing here? What could be the cause of such an issue?

I've attached my .blend file with all of the textures used to generate it, if that helps any

Thanks!

For anyone experiencing the same problem: most likely you are trying to bake to a texture already used by material, even if you see different texture in the UV/Image Editor. Make sure to select all faces in the UV editor and then create (Image > New Image) or select the target texture for baking.


Particle System Resolution How can i set particle system resolution more 50?

Paticle system must be:
emit - volume and grid

Please help!

The resolution has a hard limit of 250 (when the number is entered manually). If you really need more you could emit from vertices of subdivided plane (W in Edit Mode) and add an array modifier.

When you don't want to apply the array modifier you should tick the use modifier stack option in the particle settings:


Can't open my animation file After animating a specific scene and rending all 100 frames in Cycles via the "Render animation" feature I can play back my animation with the "play rendered animation" button but the file I chose it to be named after can't play. The file exists just the way (I think) it is supposed to exist, with the name showing up and then blender adding the amount of frames the animation ranges from at the end of the file name. When I try to open that .mp4 file I get this message ("Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file.").

I really don't want to render that animation again which is why I am asking this: Can I fix the file in some way or access the individually rendered images so that I can manually piece them together?

Try installing a proper media player software like VLC, MPC-HC, MPC-BE or Potplayer

Also for future reference it is always advised to render animations to image sequences, never directly to video file formats


Tiller ploughing land. The tiller should leave marks on the sand materiel and while ploughing sand particles should emit from the tines of the tiller I was able to create sand, however am unable to draw lines on it.I want to animate a tiller working on sand leaving lines on sand. Plse help with video

Use Dynamic Paint to produce a Displacement.


Can't edit particle fluid or boid physics settings through python I'm getting an error when I try to edit particle fluid physics through python. Using Blender 2.79.
Here's some test code that fails when run from the Blender text editor (or from the script runner addon).
import bpy

bpy.ops.mesh.primitive_plane_add()
emitter = bpy.context.object

mod = emitter.modifiers.new("ParticleSystem", type = 'PARTICLE_SYSTEM')
stngs = mod.particle_system.settings

stngs.physics_type = 'FLUID'
stngs.fluid.solver = 'CLASSICAL'    #This line results in the error
stngs.fluid.fluid_radius = 0.05     #So does this one if I skip the one above

The error is: AttributeError: 'NoneType' object has no attribute 'solver', and if I print stngs.fluid before the offending line, it indeed prints None. The same thing happens for boid physics.
Strangely, if I type the lines one at a time into the Blender python console, stngs.fluid is not None, and everything works as desired.
I thought there might be a race condition with some process that makes stngs.fluid not None, but time.sleep(10) before the offending line didn't help.
I've also tried updating the scene with bpy.context.scene.update(), which also didn't work. Is there something analogous to the scene that I could update?
Edit: Solved
Updating the scene actually does make the test script work. Thanks to J. Bakker for pointing this out. In the main script I'm working on, the emitter object wasn't linked to the scene at the time of the scene update, so it didn't work.
So, to edit fluid- or boid-specific settings for particle system physics via python, you need to make sure the emitter is linked and then update the scene after switching the physics type to 'FLUID' or 'BOID'. Interestingly, settings for other physics types can be edited before the emitter object is linked to a scene, which I suppose has something to do with the .fluid and .boid properties being type None by default, and therefore not having the other properties at all. I'm not sure why setting the physics type doesn't change .fluid or .boid without a scene update. If anyone has insights, I'm curious!

Thanks for the clear question. I just added the bpy.types.Scene.update call and in Blender 2.79a it works.

import bpy

bpy.ops.mesh.primitive_plane_add()
emitter = bpy.context.object

mod = emitter.modifiers.new("ParticleSystem", type = 'PARTICLE_SYSTEM')
stngs = mod.particle_system.settings

stngs.physics_type = 'FLUID'
bpy.context.scene.update()
stngs.fluid.solver = 'CLASSICAL'    #This line results in the error
stngs.fluid.fluid_radius = 0.05     #So does this one if I skip the one above

Sleep

sleep will never work in Blender as blender will halt mostlyduring the running of a script. Blender will just wait until the script has finished completely and then run the internal variant of bpy.types.Scene.update.


BGE: How to change camera's focal length? Is it possible to change camera's focal length
within the game?

What im looking for is that "Bow zoom in"
Or "warping".

These two lines are all you need to change the active camera's focal length.

cam = bge.logic.getCurrentScene().active_camera
cam.lens = 90.0 #or whatever value you want

bge.logic.getCurrentScene().active_camera gets the active camera in the current scene.
Then cam.lens is accessing the lens attribute of the camera defined in line one.

Read through the docs about the game camera, and you will see other properties you can get or set.

Do note that because field of view and focal length are related you can not set both lens and fov at once. Which ever value you set last will be the value that is used, and the other will be calculated for it.


How can inner parts of a mesh be selected? This model of a head has inner geometry for oral and orbital cavity in order to texture the face I would like to hide these parts of the mesh before unwrapping.

How could I select the cavities ?

Select using Limit Selection to Visible and Hide

One possible way to achieve this goal is to enable Limit Selection to Visible, select the outer surface, Invert Selection, then Hide it. This method could be particularly useful if your model has lots of cavities you want to hide.

For example, this mesh has an inner cavity with a pink ball in it:

To hide the model's outer shell, do this:

Select the object, then enter Edit mode with TAB
Enable Limit Selection to Visible in the 3D Viewport Header so that only faces visible to the camera can be selected:

Toggle into Quad View with CTRLALTQ

Switch to using the Circle Select tool (C), then increase the size of the selection circle by scrolling up with the scroll wheel (MMB) until you can select most of your model with 1 click
Now using the four windows of the Quad View, select all the outside faces, being careful not to select anything in the cavities:

Continue selecting until all outer faces are selected.
Note:

Since there is no "Back View", you will have to rotate in the User defined window to select those
Once you have used the Circle Select tool to select in one window, you must stop using the tool while in that window before you can begin to use it in another window. To stop using it, click the LMB (Left Mouse Button) in the window you began using it in

Rotate the mesh in the User defined window (upper right window) to see if you've successfully selected all the outer mesh. Keep selecting until it's all selected.
Note:

Sometimes you have to zoom in and look closely in order for the Circle Selection tool to actually select the geometry
If you accidentally select something you don't want selected, you can deselect it with the MMB (Middel Mouse Button/Scroll Wheel) while still using the Circle Selection tool

Once all the outer mesh is selected, Hide the selected faces by pressing H

If you find you have accidentally hidden parts of the mesh you do not want to hide, then Unhide with ALTH, edit your selection, then Hide again. Repeat as necessary:

Once you've made sure all your cavities are properly selected, Unhide the outer mesh, then Invert Selection with CTRLI, then Hide

Now all the cavities are hidden.


bevel Modifier causing troubles I attached a picture illustrating my problem. For some reason, there is a random indent when I use the bevel modifier, and I have no idea why it is there.

There's a face that has 2 cuts across, while the neighboring face has none.
1. Make sure there isn't a hole in your mesh at that point by moving any of the 2 left vertices right next to the hole.
2. I would strongly suggest to add 2 loop cuts to the left of the object as well.

One of those is causing your indent. (Unless I looked at the wrong portion of your screenshot, marking the problematic area somehow might help)


Editing armature in edit mode mess up pose mode As the title says when I change the imported motion capture armature, and than I edit it in the Edit mode to fit to the model (eg. moving the arms), it mess up the original animation: twist the arms.
I made parenting to the arm bones.

You should not edit the bones in edit mode after animating them, do that only if you want to modify the rest pose.
If you want to pose the bones than use Pose mode. Editing bones after posing will break the pose because you have modified the original rest pose and the transformation matrices of all the bones would evaluate a wrong pose. because poses are relative to the Rest_Pose.

you need to setup your rest pose while in edit mode (or in pose mode and use  Apply Pose as Restpose) and then proceed to posing the character, without modifying the rest pose.


Rotate a sphere diagonally (both around x and y axis) I'm trying to make a sphere roll diagonally but the sphere rotates oddly. I assume this is because it is rotating relative to the sphere's axis rather than the world's.

Is there a way to get a sphere to rotate evenly along two axis? If you can't, is it possible to use an empty and rotate it based on that?

Edit: This is what it does with the correct rotations on the y- and x-axis.

http://minus.com/i/iUqJl0iHl3y6

This is because you seem to want to rotate around a custom axis, rather than two axes at once.

One way to do this:

Align one of the object's local axes to the axis you wish to rotate around. If you don't want to rotate your actual mesh, see Set rotation values without applying them.

In this screenshot I've rotate a sphere so that it's local Z is aligned around the axis I wish to roll it along:

Add an empty and animate it spinning around the axis you aligned (so in this case I've animated it rotating 360° around the Z)
Add a copy rotation constraint to the sphere and select the empty as the target (note that you can press E while hovering over the object selection drop down to select an object in the 3D view). Then disable the axes you don't want to be copied and set the rotation to be "pasted" in the sphere's local space:

Animate the location of the sphere and you are good to go. Note that the sphere has no rotation keyframes, the rotation is done on the empty and copied with the constraint.

To explain what is happening when you rotate around two axes at once, hopefully this gif can make it clearer:

It's hard to explain :P

The gray Suzanne represents your sphere. Note that it rotates 360° around the Z and 360&deg around the X. Rotating around these axes will not make it rotate around a imaginary diagonal like you seem to expecting.


How to assign already created material with node editor? I created the bottle in the "Blender Render" and I created the glossy look material and applied the color in the "Cycles Render" but I am not able to apply that material on the bottle so that it changes its color. Also, after applying the color I want to make bottle a bit transparent. Please suggest what am I missing.

Advance thanks for those who help me! :-)

Two things you need to do to make this work.

Change to Render Mode.
Learn how to add a HDRI image to your enviroment
so that your material have something to reflect.


How can I get more saturated colors when I render? How can I get more saturated colors when I render? An image comparison is worth about a thousand words.

Take this raw render as an example:

But then when I tweak it in photoshop I  can get this:

See how dull the render is? (looks really bad right on top of the edited one)

What do I have to do to get the render to look more like the edited image?

I have heard all the common knowledge about never using colors that are too saturated or have a pure value in materials or lights, but when I keep my values too low I end up with dull images (as seen above). For reference the two lamps in that image have a saturation of 0.2, and a value of 1. Their strength is 400, and 500 for the green one.

Here is the blend, so you can dissect all my settings.

I have read How to get accurate colors with Filmic Blender, but that question is different. I'm not asking why my renders look dull compared to a non filmic color transform, but rather what should I do to make my render look vibrant "out of the box."

Is there some sweet spot with the Exposure and Gamma controls in the Color Management section that will yield more vibrant colors? Or are renders always expected to need some tweaking?
Or should I simply use more saturated colors in my lights?

Watch your albedos. It doesn't matter if you use pure primaries or highly saturated colours; Filmic will desaturate as things get too intense. High albedo will race those values through the roof quickly, leading to desaturation. As Cegaton wisely said, the old adages are pure rubbish based on a lack of understanding regarding view transforms; feel free to use as heavily saturated colours as you want when designing your looks for textures.
You can't have an object that is highly saturated and highly intense. It is simply impossible. Colour is a byproduct of the ratios of the three lights, which means that as the intensity increases, the room for those ratios become more and more limited. Find the sweet spot keeping your colour within the exposure range.
There is an intimate relationship between the apparent saturation and the contrast. Try to be delicate with contrast adjustments that focus on the saturation you desire. For a fulcrum based contrast tweak around middle grey, divide your render by 0.18, use the power function of the CDL, then multiply by 0.18 on the other side. This will adjust contrast based around the middle grey point as a fulcrum.


Text on round surface (mug) I want to write a simple text on a mug, but can't figure out how, I tried using a lattice and shrink wrapping but it was all jumbled up. That was that only method I found... so i'm guessing it should be something very obvious(?)

EDIT: So the text follows the surface nicely with the curve modifier, and I found out what I messed up with lattice modifier too (thanks to JakeD), however there is a small gap between the mug and the text and it is casting a shadow.
If I move it any closer the mug will hide it here and there.

I kinda wanted to avoid it and only use materials for it, but I guess they way I should do it is to put a transparent texture which contains text I assume? (or something like that)

Just use a curve deform modifier:

Make sure that the origin of the curve is at the same position as that of the object you are wanting to deform...this will make it go much more smoothly.


Properly export blender scene with materials format to three.js scene Completely beginner in blender and 3d graphics in general here.

My goal is to export a blender scene with models and materials (including textures) and import back in three.js scene.

According to here it seems I should use use the KhronosGroup glTF exporter for Blender (the json exporter for Blender seems to be removed). If I got it correctly the only materials that can be exported in glTF format are glTF Metallic Roughness and glTF Specular Glossiness (all the other materials are ignored during export).
Thus here is the question: if the Blender scene use other materials like Principled BSDF or other ones, how should I convert them to use the Metallic Roughness or Specular Glossiness to get a result like the originals?

I've tried to do it manually, connecting for example diffuse or normal textures to the respective input in the Metallic Roughness but I got poor results.

Any guideline on how to do this correctly would be appreciated (or any resource which explain how to do it).

As of October 2018, glTF 2.0 supports three material types: metal/rough PBR, spec/gloss PBR, and unlit/shadeless.

We are working on adding support for the Principled BSDF node to the Khronos Group Blender exporter. That work is in progress, and happening in a new repository (https://github.com/KhronosGroup/glTF-Blender-IO) which includes both an importer and an exporter. I'd recommend trying that for now. Note that some inputs to the Principled BSDF node (like anisotropy) are not currently part of glTF's metal/rough PBR definition, and will be ignored.

Other material types may be more or less difficult to convert into one of the supported glTF materials.


Blender Mapping Strand/Particle in v2.76 I was watching a tutorial and it came to mapping texture onto particle system. And under texture/Mapping/Cordinates: choose the Strand/Particle setting. But Blender 2.76 dosen't have that option. Is it somewhere else? Please help. Thanks

It is located in the textures panel under mapping>coordinates>strand/particle


How do I combine two node trees? I have a node tree that gives me a background with a colour of my choice instead of the default black.

I also have a node tree that controls mist in my scene.

No problem with either of these. They both work as I wish. My question is how do I combine two node trees? In other words, in my example, how do I have a coloured 'sky' and mist?

If I have nodeTrees that I would like to share between Files or anywhere -> I group all the nodes I need - give it a proper name and insert the grouped-Tree anywhere else from shift-A menu...or append it in some other file.


How to get a single input property of a node to draw in the UI panel directly in the panel? I saw this example, but I'm not going to draw the whole XYZ (In my case), I just want to take the input properties individually, but I don't understand how

nodes = context.object.active_material.node_tree.nodes
map = nodes.get('Mapping')
if map:
    layout.prop(map.inputs[1],'default_value[0]',text='Position X')

UILayout.prop index argument

Use the index property for single array elements.

layout.prop(map.inputs[1], "default_value", text="Position X", index=0)

Would point out that this is used in my answer https://blender.stackexchange.com/a/139620/15543 to link posted in your question?

FWIW. For pep8 formatting put a space after a comma in arguments list.

It is recommended in blender to use double quotes for strings, and single quotes for enums.


why image is not transparent I have added the png transparent image with the setting and its not showing transparent black background is seen. I have the base color aluminum and i want to add that logo of png on to it. The image is black letter with transparent background why its showing in white letters and black background. May i know where im going wrong any suggestion or help.

To have a transparent background you need a transparent shader.

To overlay the image on top the color used on a shader

Using the same principle you just need to add the color to the existing underlaying material, using the alpha channel to mix it.

(remember to assign the material to that part of the mesh ).


How to get translucency in parts of skin material? Alright, Ive watched more complex skin material tutorials for 2.8 but want to know the simplest way to go about this given my skin setup - Ive painted the base material and normals for my skin material in Substance painter and apply them to my model by feeding them into the respective slots in a Principled BDSF.
What I need now is translucency in certain parts of the mesh where human skin is normally translucent, like the ears (here is a successful example):

This requires some sort of painting to delineate where light should shine through and where it shouldn't - so far in my material setup Ive tried a mix shader between the principled BDSF and a Translucent node, as well as checking the 'Subsurface Translucency' box.
I just need to know what kind of map/how I might paint a translucency map and how I can plug it into my material setup to achieve this selective skin translucency?

To achieve the effect you are going for, there are 2 ways to do this, depending on what rendering engine you are using.  I will show you both ways to do it.
Using cycles:
to get translucency in certain parts of your mesh,  all you simply need to do, is turn up your subsurface value in the shader editor.  (see picture below)

after this, the light will shine through only in parts the mesh that are thin enough.  to adjust how much light you want shining through based on how thick/thin your mesh is, you can edit the "subsurface radius" values directly underneath the "subsurface" value on the "principled BSDF" node. (see image below)

After that, it's pretty much done.  You can adjust the other settings to your liking.
Using Eevee:
When using EV to achieve this result.  you do pretty much all the same things that you would do as if you were using cycles (read the above text first if you haven't already) except for one thing.  Make sure you have the desired object selected, then go to the materials tab, and enable: "subsurface translucency".  (see image below)

Once this is done, it should work.  adjust other settings as needed.
And there you have it.  I hope this helped!  :)


Can I influence the bone envelopes? I was hoping I could get some help here.
Is there any way to influence the bone envelopes?

My Problem:
I have an Armature and the Armature is set in stone and can't be changed.
I have also an Avatar that is rigged to this Armature.

Now, I want to make a cloth item for said avatar. The problem is, automatic weights are too inaccurate for the given armature. And the bone envelopes are too big to help here. I found the settings for the envelopes but it seems they only influence them as a whole.
E.G. if I shrink the "distance" it shrinks the influence as a whole.

Maybe someone has an idea how to influence the distance in an x or y axis only ?
Pointers would be greatly appreciated!

You can't modify the bone envelope's scale at individual axis, separately.

A bone's envelope distance is stored as a single attribute envelope_distance, without any way to modify it for a single axis. This is unlike b-bone scale which is stored separately in bbone_x and bbone_z, thus can be scaled separately.

Your only choice here is through weight painting, already elaborated in the other answers posted before mine.


How to distort effects with equirectangular projection I have a 360-degree panorama(rendered in Blender) and want to composite a glare effect onto it.  The problem is that once it is viewed in a 360 photo view the effect seems distorted due to projection distortion.  Is there any way to compensate for this?

Example:

This is a 360° equirectangular panorama of a simple scene of a sphere with a glare effect

If you then map it onto a sphere, then render that sphere, it looks like this

Because the sphere is the same color as the background is it impossible to see, but if I map bright to red and dark to green to make it easier to see against the background and increase the contrast, I get something like this

You can see that the effect pinches the glare effect towards the poles.

That blend file can be downloaded here

Lens flare depends on the orientation of the lens you are looking through in relation to the light source so it cannot be rendered into a panoramic image that is then viewed as if the orientation of the camera would be changing.

It would have to be an effect generated while viewing the image. So the answer seems to be:

No. There is no way to compensate for this at the stage where you are making the panoramic image.

It should be done at the stage where the image is viewed.


How do I remove weight from weight painting? I am trying to remove some weight. I left click to add it, but I cannot figure out how to remove it.

From the Manual on  blend mode:

Subtract: In this blend mode the specified weight is subtracted from the vertex weights. The strength determines which fraction of the weight gets removed per stroke. However the brush will not paint weight values below 0.0.

Lighten: In this blend mode the specified weight value is interpreted as the target weight very similar to the Mix Blend mode. But only weights below the target weight are affected. Weights above the target weight remain unchanged.

Blur: tries to smooth out the weighting of adjacent vertices. In this mode the Weight Value is ignored. The strength defines how effectively the blur is applied.


What is the differece between Make Library Override and Add Library Override? Blender 2.81 came with Library Override. We have Make Library Override in the Object menu. And we have Add Library Override in the Outliner.

What is the differece between Make Library Override and Add Library Override? Is this same functionality with accidentally two differente names? Or is there a difference in the behaviour?

For example, the entry in the Object menu is greyed out, the one in the outliner not. For a reason?

According to the manual the operator from the outliner ID Data > Add Library (bpy.ops.outliner.id_operation(type='OVERRIDE_LIBRARY)) is for overriding a single data block.

  Single Data-Block Override

  You can override a single data-block from two places:

  The Outliner (it’s in the context menu of IDs), in which case all local usages of that linked ID will be remapped to the new local override.

  [...]

On the other hand Object > Relation > Make Library Override (bpy.ops.object.make_override_library()) iterates through the hierarchy of objects and collections based on the selection, overriding everything linked.

  Make Library Override Operator

  This one operates in the 3D View, over linked objects or local empties instantiating a linked collection (typically, a linked character). It is very similar to the Make Proxy operator, and is found in the same sub-menu Object ‣ Relations ‣ Make Library Overrides….

  Unlike the method described above, it will go through the whole hierarchy of collections and objects, and override all those needed to allow posing/animation of a character.

  Note

  Proper Collections Layout Matters

  For this operator to work properly, it is crucial that all the collections needed by the character are children of the root (linked and instantiated) one. Otherwise, some won’t be automatically overridden, and manual work will be needed to fix the override.


Fresnel and blend option not showing in transparency panel I'm creating a material for which I need to edit fresnel and blend options in the transparency panel and I don't have it.
What am I missing (blender v2.79) ?


Global disabling of shadows in Cycles I am using daily builds of 2.79 version and can't find Shadows checkbox that has been here some versions ago:

Ways of doing it on per-object basis are not acceptable, need single-click solution like in BI or older Cycles.

EDIT:
Forget about picture above, I've mixed up it with BI settings.
In Blender Internal it looks like this:

That Cycles checkbox only disables transparent shadows, hence it's location next to the transparent depth controls. It has no affect on regular shadows from material without the transparent BSDF, and even materials with the Transparent BSDF will still cast shadows with it disabled. Just without taking transparency into account.

There is no global control to disable shadows, you need to disable shadow-ray visibility on all objects. If you need to do it for a lot of objects, the following bit of Python will switch off the checkbox for all selected objects:

import bpy

for obj in bpy.context.selected_objects:
    bpy.context.scene.objects.active = obj
    bpy.context.object.cycles_visibility.shadow = False


Is it possible to change the IOR inside a volume? For instance, is it possible to simulate effects such as heat haze or other kinds of mirages which are caused by air with differing/changing refractive indexes?

Plugging a procedural texture into the IOR input gets pretty close, but the IOR is only being changed at the object's surface (this is to be expected, since the refraction node is plugged into the surface output).

For example, with this scene:

Connecting only the volume scatter node proves that the gradient sphere is in the center of the cube:

If you connect the refraction node, you might expect to see some distortion in the center where the gradient texture is. However, since the gradient is completely inside the cube, there is no evidence of the gradient on the surface, and the IOR is not changed.

Plugging the refraction node into the volume output does not seem to be supported yet; the output is completely transparent.

Is it possible to change the IOR of the inside of an object in cycles like this?
If not, is there any way to simulate these kinds of atmospheric effects in cycles?

I would share the .blend, but pasteall is acting up atm..

Related: Is it possible to render other materials besides volumes using a procidural texture to define "density"?

I'm working on a project faking the atmospheric disturbances that bother anyone using a telescope.  This is the sort of distortion that adaptive optics systems compensate for.  It is not much different from heat haze.

I accomplished this with a plane placed between the camera and a "far away" starry image on another plane.  I gave the plane a Refraction shader (using Cycles), a small IOR maybe 1.02 or something like that, and a Noise or Wave texture and a Bump node to supply a normal vector to the shader.  I animated this by adding a linear increasing value to the x coordinate of the vector given to the texture. The normal vectors have to be kept close to the usual perpendicular direction - just small wobbles.  At least for my setup.

There are actually four of these wobbled-normal planes.  Two have normals up, and the other two have normals down.  Not sure that's necessary, but I figured it would help make things messier.  The texture animations and texture scales are all different, with all roughly a tenth of a wavelength to one wavelength spanning the view.

The bottom layer is an astronomical image - but for a hot desert scene, it could be distant mountains roads and buildings. (There's another layer just above it for another special effect unrelated to this question.)

I have not tried modulating the IOR value of the Refraction node. If the IOR were to vary spatially or with time, the effect would be similar to varying the amount of wobble of the normal vectors.  Either way, I expect rendering to go much faster than any attempt to do volume interactions of any kind.

In my case, the wobbling-normal planes are sized to be larger than the camera's field of view.  In case only part of the scene needs the effect, a mask image could be used to switch between the wobbling-normal Refraction shader, and a plain Transparent one.


How to resample a video clip? I have 30fps, 1440dpi car Dashcam footage but desired action is far away. Would like to resample to 720 or 360dpi 30fps, w/o loss of pixels & only use part of resulting video (crop?) that contains action.
Searched resample & zoom but couldn't understand if any applied to my situation.

Load your video clip into VSE (I'm using an image here, but it is the same for videos)

Set the resolution to your output requirements.

Add an Effects Strip -> Transform

Change the Scale parameters and recenter with the Position X/Y

Render output resampled.

I spent sometime trying the Clip options in the Transform strip but they did not work when changing the output resolution.


Why blender throws an exception when saving a copy of image? I'm developing blender exporter for CryEngine - CryBlend.

I need to convert an image to tiff and then pass it to cryengine resource compiled. The thing is it works while saving image with blender python console:

tiffImage= bpy.data.images[1].copy()
tiffImage.filepath_raw = 'new_path.tif'
tiffImage.file_format = 'TIFF'
tiffImage.save()

but the same code placed in plugin throws an exception at save()

"RuntimeError: Error: Image "my image" does not have any image data."

What's more, while debugging that code with pydev (in plugin) then it works as expected.
I'm totally puzzled with it.

here is the complete code. export.py:1196

def __export_library_images(self, parent_element):
    library_images = self.__doc.createElement("library_images")
    parent_element.appendChild(library_images)

    for image in self.__get_texture_images_for_selected_objects():
        tiffFilePath = self.__convert_to_tiff_and_save(image)
        image_path = get_relative_path(tiffFilePath)

        image_element = self.__doc.createElement("image")
        image_element.setAttribute("id", "%s" % image.name)
        image_element.setAttribute("name", "%s" % image.name)
        init_from = self.__doc.createElement("init_from")
        path_node = self.__doc.createTextNode("%s" % image_path)
        init_from.appendChild(path_node)
        image_element.appendChild(init_from)
        library_images.appendChild(image_element)

def __convert_to_tiff_and_save(self, image):
    if image.file_format is not 'TIFF':
        tiffFilePath = os.path.splitext(image.filepath)[0] + ".tif"
        cbPrint(tiffFilePath, 'debug')

        if self.__config.run_rc_and_do_materials:
            try:
                tiffImage = image.copy()
                tiffImage.filepath_raw = tiffFilePath
                tiffImage.file_format = 'TIFF'
                tiffImage.save()
            finally:
                # remove tmp image from blend file database
                bpy.data.images.remove(tiffImage)
    else:
        tiffFilePath = image.filepath

    return tiffFilePath

You can use save_render() to save to whatever format you want, no need to duplicate an image datablock first.

In my experience, save_render() is the only reliable way to export from one format to another. I tried the .filepath_raw / .file_format way as well, but it turned out to not actually write the data in the expected format (it used the source format with target format's extension).

Note that save_render() does not render anything, it is called ..._render because it uses the render settings of the current scene.

import bpy

img = bpy.data.images[0] # pick an image datablock
filepath = r"C:\tmp\_exported_image.tif" # specify outout filepath here

# Store current render settings
settings = bpy.context.scene.render.image_settings
format = settings.file_format
mode = settings.color_mode
depth = settings.color_depth

# Change render settings to our target format
settings.file_format = 'TIFF'
settings.color_mode = 'RGBA'
settings.color_depth = '8'

# Save image to TIF, this does NOT render anything!
# It only means that the save command will use the current scene's render settings.
img.save_render(filepath)

# Restore previous render settings
settings.file_format = format
settings.color_mode = mode
settings.color_depth = depth


How to make autokey be location only In the keyframe menu, I've set it as location keying.

This works but only if I press I to set a keyframe.

If I turn on the autokey it keys for locrotscale.

This function has been changed over latest versions, in 2.92 you have to activate this preference also:


How to mirror shape keys I have shape keys that deform one part of the mesh and want to do the same on the right.

Left side of the mesh deformed, shape key active

Right side of the mesh, not deformed

Can I mirror deform_belly_b.L into deform_belly_b.R so that it does the exact same thing on the right side?

Yes you can do this.
Select deform_belly_b.L And set it to 1 (make sure rest of the shapekeys are at o).
Then press the arrow key below the '-' button , and select duplicate from mix.
Now select the new generated shapekey again press the down arrow key and select Mirror shape key.


OS X 10.11.4 Intel Iris Pro - OpenCL Build Fails with GPU Rendering I was under the impression that GPU's that supports OpenCL 1.2 should work with Cycles on OS X. (LuxRender using OpenCL works fine).

Still, I get a party-pooping error that renders (pun intended) Cycles useless on my system.
This happens for GPU rendering, not when using the CPU.

Any ideas around when this will get fixed?

My HW:

MacBook Pro 2015

2.2GHz Intel i7

16GB 1600GHz DDR3 RAM

Intel Iris Pro 1536 MB

I would really like to use Cycles, but for now this seems impossible.

No, AMD are not the only system GPGPUs that support Cycles OpenCL Rendering.

https://wiki.blender.org/index.php/OpenCL

But you are not alone. In OS X 10.11.4 with Iris Pro 6100 on the Macbook Pro 13" the kernel fails. The OpenCL support by Apple for the iGPU is OpenCL 1.2. It should work, but fails.

That onus is on Blender.


Compositor: Uncontrollable glare and noise artifacts In the compositor, I often have an uncontrollable glare I don't know how to get rid of. Usually, tweaking the threshold fixes the problem, but not with those noisy artifacts. Here is my basic setting:

And here is my artifacts:

I have noticed that the material provoking this is often (maybe always?) some kind of metal. How do you use metal and glare without have this kind of glitch?
Thanks for your time!

Well, I spent this morning investigating (another time) this issue and finally found out!
To make glass more interesting I need base color > 1, with some color. I know this is not physically correct, but it looks nice. However it also produces this artifact.
A lot of time wasted on this... but now I know. Thanks Allen and susu for your input!


Why does adding a subsurf modifier cause this large flat face to deform? I'm very new to blender so this might be an easy fix, but I have a little problem with the model of my guitar. Here's what I'm working with right now:

But when I add the subdivision surface modifier, the tops go crazy, the big flat faces are not completely flat any more, and there's something wrong with the top and bottom of that carved out part... I would also like to make the edge of that less sharp but I haven't found a good way yet.

For reference, here's a picture of the guitar I'm trying to recreate:

What would you suggest to improve my model? Thanks for the help!

Thanks everyone! I now know that i should stick to four points as much as possible and I fixed it! I tried to make a grid on the huge faces and I got rid of as many triangles as possible and I'm very happy with the result :)

Now onto the rest of the guitar!


Plane won't show in camera/render Big hill behind tree won't show in camera/render view.

The problem might be in the camera end clipping distance value. Try to increase it if low.


triangulate mesh in python Is there a simple way of triangulating all faces in a mesh in the python API? I am already aware of that you can do it in blender by selecting an object in edit mode and pressing ctrl+T, but I need to do so in a python script.

Thank you in advance!

You could use the bmesh.ops.triangulate
See TextEditor > Templates > Python > Bmesh simple edit mode for some of the boilerplate.
For any mesh in object mode.
# This example assumes we have a mesh in object mode.

import bpy
import bmesh

def triangulate_object(obj):
    me = obj.data
    # Get a BMesh representation
    bm = bmesh.new()
    bm.from_mesh(me)

    bmesh.ops.triangulate(bm, faces=bm.faces[:])
    # V2.79 : bmesh.ops.triangulate(bm, faces=bm.faces[:], quad_method=0, ngon_method=0)

    # Finish up, write the bmesh back to the mesh
    bm.to_mesh(me)
    bm.free()

# Get the active object (could be any mesh object)
triangulate_object(bpy.context.active_object)

For any mesh in edit mode.
# This example assumes we have a mesh object in edit-mode

import bpy
import bmesh

def triangulate_edit_object(obj):
    me = obj.data
    # Get a BMesh representation
    bm = bmesh.from_edit_mesh(me)

    bmesh.ops.triangulate(bm, faces=bm.faces[:])
    # V2.79 : bmesh.ops.triangulate(bm, faces=bm.faces[:], quad_method=0, ngon_method=0)

    # Show the updates in the viewport
    # and recalculate n-gon tessellation.
    bmesh.update_edit_mesh(me, True)

# Get the edit mesh
triangulate_edit_object(bpy.context.edit_object)


Blender 2.8 edge length I'm new to blender and I want to use it as 3D printing software. I'm using 2.8 so I'll get used to new interface, but I don't know how to change edge length to a specific value. I know how to change whole object dimensions like cube, I'm using metric system and I can see edge length when selected, but how do I change it?

I found this addon and updated to 2.8. I think this is what you're wanting.

Addon located here


Exporting the animation of an object to a text file with custom code I've seen a lot of discussion on how to animate an object from a text file, and I'm attempting to do the opposite of that.

To clarify, I want a program that goes frame by frame and writes the location of an object to the file, line by line.
(line one has the X,Y,Z of the object on frame 1, line two has the X,Y,Z of the object on frame 2, etc...)

The problem that I am having is that when I run the code it writes down the location of the object 5 times, all from the same frame. (It writes down a bunch of [5.0 0.0 0.0]'s). So I believe that this is a problem with the line that changes the frame not being updated correctly when I run the code.

I should state that I'm coming from basic java knowledge and have almost no idea how python works. I'm using a for loop and I want the frame to be bumped up one every time it goes through a cycle. I know how to do this in java, but not in python.

Hope I explained this correctly, thanks for the help!

My code:

obj = "Cube"
filename = "file"
filepath = 'FILEPATH'
combinedpath = os.path.join(filepath + filename + ".txt")
SAVEFILE = open(combinedpath,'a')

for i in range (0, 5):

    #frame set line (is this the problem?)
    bpy.data.scenes["Scene"].frame_current = i

    #location grabbers
    locnab0 = bpy.data.objects[obj].location[0]
    locnab1 = bpy.data.objects[obj].location[1]
    locnab2 = bpy.data.objects[obj].location[2]

    #location converters
    ink0 = str(locnab0)
    ink1 = str(locnab1)
    ink2 = str(locnab2)

    #write to file
    SAVEFILE.write("\n" + ink0 + " " + ink1 + " " + ink2)

SAVEFILE.close()

I am trying to do something similar, and the trick for me was to use this to advance the playhead...

bpy.context.scene.frame_set(i)

The below gave me the current frame over and over. Even though it did advance the animation in the viewport...

bpy.data.scenes["Scene"].frame_current = i


How to preset Blender shaders and textures? In Blender, versions 2.79 and before default to the diffuse shader. In versions 2.80+, they default to Principled BSDF.

Even though this is a nice shader, is there a way that I can actually preset the shader Blender presets to when opening?

Same for textures: Is there a way that when I open Blender, I can have a preset texture?

This is actually quite easy to do:

You can set up the .blend file that Blender default opens.

If I wanted to set up default shaders, I would simply go to the shaders tab, and select the shader I want to be the preset.
Same goes for the textures: go to the textures tab, and select the default Blender texture I would want to be the preset.

Now comes the magical part:

1) Save the .blend as (default.blend) or whatever.

2) Press CTRL+U to give you the "save startup file?" menu, and select it, or for the python-lovers' sake:
bpy.ops.wm.save_homefile().

3) Re-open Blender, and discover the new changes you have made.

This is how to preset default settings in Blender (not modifiers or unset simulators), and I hope it helps all that read this post!


How to increase the amount of times one can use REDO option? Can the number of redos be increased? My limit is like 5 and I need at least 100 because I am new to this and mess up ALL THE TIME. I tried ... [EDIT] [PREFERENCES] [INPUT] but can't seem to find how to solve this. Anybody know?

Don't you mean by any chance UNDO steps?

They can be increased here:
Edit > Preferences > System > Undo steps

The maximum is 256, but that should be enough in most cases.


Baked and applied normals reflect light at an angle I hooked Alpha to the object to remove the displacement effect so you can see clearly.

I use planes to create shaders and bake the diffuse and normals to separate files.

The reflections on the table seem to be projected at a weird angle but appears to be correct on the plane (shown in picture 1).
In the wood node group (last picture), I have the factorial output from the wave texture hooked to the bump height. I'm not sure if that's correct but it makes no difference.
Here's what youtube tought me so far:

Camera is facing down on plane
Camera is in orthographic mode and I used orthographic scale to fit the plane
Rendering engine is cycles and set to 3K samples (3072)
Normal render result is saved as OpenEXR Full float (32bit)

Found it. I had to add a normal map between the wood displacement EXR and the normals.
Simply because I didn't know this was the way to allow blender to interpret image to normals as described here

Actually, the person who deleted his answer to my question deserves all the credit. So thanks :)


Blender acting weird and crashing when GPU-rendering I've been using Blender actively for a few years, but after i got my new 1080 it's been acting pretty weird.

When i start rendering in cycles "panels" starts turning or flickering black, and other windows on my computer who uses the GPU starts acting weird aswell. After a short while of rendering blender usually stops working, no freezing or anything, it just crashes and opens this window

This is how blender looks before crashing;

The GPU is new, and is not overclocked or anything like that.

I've been googling around, and i can't seem to find anyone with the same problem, and therefore no solution or hints to what might be the problem.

Also, as a disclaimer, all drivers are up to date, and I've tried different harddrives and power supplies. I am rendering on the supported feature set, and the problem applies for earlier versions of blender aswell.

CPU rendering works fine. The GPU is a gigabyte 1080 WINDFORCE OC 8gb

I found the solution to the problem; GeForce Experience (or more specifically Shadowplay) seems to be the reason behind all this. Disabled it and everything seems to work good


Python script to add additional faces to an existing mesh Apologies if some of my terminology is off - I'll happily update the answer if anyone points incorrect terms out to me!

I'm using Blender 2.76

I've created a mesh; which I would like to 'close' by adding in additional faces (or surfaces; or polygons ... not sure what to call them!)

Blender file:
https://drive.google.com/open?id=0B_1YtzapYF0LX09DNFhoMHJPaUU

The faces parallel to the x are also open; but as those are curved; I'm just trying to full along the y axis for now.

I got the below data out of the console:

>>> mysurf.type
'MESH'

>>> mysurf.data.polygons.data
bpy.data.meshes['Mesh']

Yellow box is the face I want to add. And there are many of these running down the y axis.

I've constructed the mesh pragmatically; so I know the co-ordinates of the vertexes I want to connect with a face; so perhaps there is a simple command to add it in?

I would not say "simple".  With an understanding of how you constructed the mesh in question it would probably be possible to algorithmically generate the vertex indices for the new faces.

Without the algorithm all I can supply to you is the basic code of how to add faces to an existing mesh:

Here is an extract from http://web.purplefrog.com/~thoth/blender/python-cookbook/add-to-mesh.html that illustrates several idioms for modifying a mesh using bmesh.  You are chiefly interested in the bm.faces.new( vertex_index_array ) technique.

import bpy
import bmesh

def mission1(scn):

    obj = scn.objects.active
    if bpy.context.mode == 'EDIT_MESH':
        bm = bmesh.from_edit_mesh(obj.data)
    else:
        bm = bmesh.new()
        bm.from_object(obj, scn)

    v2 = bm.verts.new( [0,7,0] )

    bm.verts.ensure_lookup_table()

    v1 = bm.verts[3]

    e1 = bm.edges.new( [v1, v2] )

    f1 = bm.faces.new( [v1, v2, bm.verts[7]])

    if bpy.context.mode == 'EDIT_MESH':
        bmesh.update_edit_mesh(obj.data)
    else:
        bm.to_mesh(obj.data)

    obj.data.update()

mission1(bpy.context.scene)

If you are willing to try without python, consider using Bridge Edge Loops:  How can I automatically create edges according to the number of vertices?


Why Can't I Parent Armatures? In every tutorial I've looked at, it says that to parent an armature to another one, I select them in the order I want them to be parented and then hit CTRL+P or right-click and select "Parent", "Bone" then  not "keep offset".
But when I try to do this, nothing happens.

Does anyone know why this is?
(In Edit Mode:)

You're in pose mode. Parenting must be done in edit mode.