text:
Correct way of subtracting a plane from a bigger plane
I have a pretty general question. I have encountered this problem several times now (I'm a beginner, by the way). In the case I had two diferent planes (just edges, not faces yet) in the same XZ coordinates and wanted to create a face for the bigger element, but leaving the smallest one blank, as it was a hole on the biggest one, how would you proceed? Which is the easiest or fastest way to do it? I'm adding some screenshots. Thank you on advance!

Edit: Situation with knife project.

Probably easiest to use Knife Project, but you'll need to Fill the large plane first and move the octagon forward slightly in the Y direction. Then go to front view (numpad 1). With the large plane selected go into Edit mode, CTRL-click the octagon then Mesh > Knife Project and delete the new face from your large plane. There's a quick Blender Secrets video here

@JohnEason No no, it's one mesh in Edit Mode and he starts with only edges, no faces... I wouldn't use Knife Project then.

Ah mea culpa. I was thinking it was two objects (although you could seperate it into two... :^). In that case your answer is the best.

Thank you, guys, and sorry for my late reply! I tried both options, and they are what I was looking for. I have a couple of questions, though: in Gordon's option, is there a way to get rid of the diagonals that are left? Deleting or dissolving them, delete part of the mesh. I guess they won't bother me, anyway. John's option is cool and almost exactly what I was looking for. I didn't know this tool.  The problem is that the projection on the bigger plane is in a different Y position. Is that normal? Is there a way to create an exact projection? Thank you!

@Rant Well, no matter which version you use, creating faces between edges or using Knife Project, you will never get rid of all diagonal edges. If you only problem that they are not aligned with the axes, you could of course split the edges of the square and connect the inner circle only horizontally and vertically instead of diagonal. But nevertheless there will stay edges, because a hole cannot be surrounded by a single polygon without connection from the inner border to the outer border.

Thank you, Gordon. What I meant is that the resulting circle of using knife project is not completely aligned with the original circle (which I slightly moved in the Y axis, as @JohnEason suggested). I wonder why is that, because that tool seemed really interesting for making an object to be "casted", as a shadow, on another one. Anyway, what you said about a hole not being able to be surrounded by a polygon without connection was really useful, because it seems pretty basic, but I still didn't know that. So thank you. Anyway, my whole question came because I always try to work under the...

...Under the premise that I shouldn't have any internal faces in my whole proyect. So, right now I am making a PSX model, and I need a circular button on the surface. If I just extrude the circunference I created and create a face for the extrusion, I still have a face in the bottom of the button, which is part of the surface plane. Now I don't know if that is "acceptable" or if I should delete that part of the surface. That's the origin of my question. I don't know if I made myself explained :/ Anyway, I will edit my question with a screentshot of the problem with knife project. Thank you!

Your objects need to be viewed "head on" (i.e: numpad 1, 3, or 7) when you use knife project or the cut will be offset as you've found. This is the Blender manual entry. With regard to your other question about leaving invisible faces, it's a good idea to delete them, partly to keep the number of faces as low as possible, and partly because they can cause distortion and shading issues particularly when using a mirror modifier.

I see! Thank you very much. That will be very useful, indeed!

I'd say the simplest way is this, when you're in Edit Mode with Edge Select like in your top screenshot:

Select the top edge of the square and the two top edges of the circle. Press F to fill them.

Now do the same for the bottom three edges.

Repeat this for the left three edges and again for the right three edges. You don't need to select the new diagonal lines for that.

Of course you could do this by creating two faces instead of one, but I think the four faces version above gives better, cleaner geometry:

Select the top and side edges and press F to fill them.

Then select the bottom edges and press F again.


text:
Sample Keyframe & Smooth Keys in b4.1.1 Missing?
Hi so following video tutorial and can't seem to find in the "Graph Editor" under key tab "Sample keyframes" & "Smooth Keys" seems to have been moved? If anybody knows the workaround that would be great also tried google search found nothing.

There's no link to the tutorial in your post

Yes I did not put a link because I am not focusing on the tutorial just referencing it as the reason why I was looking for this function in b4.1.1, I actually pause the video and noticed the short cut keys which are "shift+alt+O" (Sample Keyframe) and "alt+O" for (Smooth Keys) That were located in the "Graph Editor" under key tab Option list, and That actually worked just wish I knew where these options were relocated to.

Still useful to have the link or even better a screenshot because honestly I don't know what exact feature you mean. This can also increase your chances of getting good answers :) But you already found a solution? Perhaps you can post it as answer so we can close this question.

Blender's frequent changes can be quite problematic, as they require continuous learning. I also encountered this issue and couldn't find a solution other than using the shortcuts. Does anyone know where these functions have been relocated?

Smooth keys is now here: key->smooth->...

Sample Keyframes in Blender 4.22  is called "Bake Keyframes"

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Trouble creating even outward bevel on top edge of cylinder
Please bear with me, I am new to this software and 3D in general.
I currently have a shape consisting of a cylinder and a sphere embedded in the top of the cylinder:

I am looking to create a curve that extends from the bottom half of the sphere and gently curves outward until reaching the cylinder's full width. I have drawn an example of what I want in MS Paint (it's a bit shaky but it's clear where it needs to be):
I have been playing around with the bevel tool, and while increasing the amount of segments does smooth out the curve, there is always a defined edge where the bevel stops:
I am looking to somehow get rid of this edge and create a smooth, even shape that slowly curves outward to the full width of the cylinder. I have been unable to find any solutions to this problem on both Google and this website.
I have seen similar posts where the solution was to apply the scale; I have already done that with both shapes.

Welcome to BSE,
Here is what I would suggest:
(Optional):
In Object mode, select both your cylinder and your sphere (Shift+Left Click).
Use CTRL+J to join your meshes into a single object.
Although not required, you might find this makes your model easier to work on.
Select your cylinder and press Tab to enter Edit Mode

Use CTRL+R to add a loop-cut to the cylinder:

Rotate your view and select the top face:
Make sure you are in Face Select mode. The shortcut is 3 on the Number row of your keyboard (not the Number pad):

Use S to scale the face down. After press S you can also use the Numpad to enter a specific scale (i.e 0.5):

Now we want to bevel the edge loop in the center of the cylinder. First we need select it. The easiest way to do this is by using Alt-Select:

Make sure you are in Edge Select mode. The shortcut is 2 on the Number row of your keyboard (not the Number pad):

Hold Alt and Left-Click on one of the edges in the loop that we want to bevel:

You can now bevel as before, and hopefully get the result you are looking for.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Get indices of vertices of triangulated faces in python
I'm writing a python script to export triangulated meshes from Blender to an openGL application I am working on. I'm using text files, and I want to export my geometry data in the form of vertices, vertices attributes (normals, uv) and indices as in any openGL application.
For the vertices and normals, I am using this code:
myFloat = lambda x: '''{0: 0.4f}'''.format( x )
mesh_file = open(target_path+".map", "w")
    mesh_file.write("\n")
    for vert in mesh.data.vertices:
        mesh_file.write('*VERTEX ')
        for i in (0,1,2):
            mesh_file.write(myFloat(vert.co[i])+' ')
        mesh_file.write("\n")
    for vert in mesh.data.vertices:
        mesh_file.write('*NORMAL ')
        for i in (0,1,2):
            mesh_file.write(myFloat(vert.normal.co[i])+' ')
        mesh_file.write("\n")

How do I get the indices?

also read through http://blender.stackexchange.com/questions/2776/how-to-read-vertices-of-quad-faces-using-python-api?rq=1 , will work for your purpose if all faces are tris, else you can think of a way to place a check on the vertex count per face.

I waited before posting this in case a better answer came up.  Since no one posted anything, here is something.
I found the following code on http://davidejones.com.  It is definitely not 100% alright so far as OpenGL goes, but it does run so far as Blender is concerned. It may help you get started until someone who knows what they are doing shows up.
The problem I see right away, when I look at the output, is that this code is printing out all of the redundant normals and UV coords but not those of the vertices.  Since the stride of the different attributes does not match, you can't make a VBO from this code.
import bpy

obj = bpy.data.objects['Cube']
mesh = obj.data

normals = []
indices = []
for face in mesh.polygons:
    indices.append(face.vertices[0])
    indices.append(face.vertices[1])
    indices.append(face.vertices[2])
    for i in range(len(face.vertices)):
        v = mesh.vertices[face.vertices[i]]
        normals.append([v.normal[0],v.normal[1],v.normal[2]])

verts = []
for vert in mesh.vertices:
    verts.append(vert.co.xyz)

uvs = []
for uv_layer in mesh.uv_layers:
    for x in range(len(uv_layer.data)):
        uvs.append(uv_layer.data[x].uv)

print(indices)
print(verts)
print(uvs)
print(normals)

There is also the following code which I found at a Blender scripting website.
http://blenderscripting.blogspot.ca/2011/05/blender-25-python-printing-vertex.html
I ran this script through Blender and the console output looks sensible.  The indices match the previous code example.
import bpy

current_obj = bpy.context.active_object

print("="*40) # printing marker
for face in current_obj.data.polygons:
    verts_in_face = face.vertices[:]
    print("face index", face.index)
    print("normal", face.normal)
    for vert in verts_in_face:
        print("vert", vert, " vert co", current_obj.data.vertices[vert].co)

Here is some code that is based on an OpenGL/C object exporter.
if bpy.context.selected_objects:
    for obj in bpy.context.selected_objects:
        bpy.context.scene.objects.active = obj
        bpy.ops.object.mode_set(mode='OBJECT')
    #============================================================
    directoryPath    = "//" + ProjectName + "/_MODEL_FOLDERS_/"
    path = bpy.path.abspath(directoryPath)
    #------------------------------------
    if os.path.exists(path + obj.name) == False:
        os.mkdir(path + obj.name)
    #============================================================
    #----THE_OPEN_GL_EXPORTER_DOES_IT'S_THING
    #============================================================
    msh = obj.to_mesh(bpy.context.scene,False,'PREVIEW') #-------THE_'False'_IS_THE_APPLY_MODIFIERS_FLAG

    print(obj)
    print(msh)
    print(obj.name)
    print('\n')
    #============================================================
    lvdic = {} # -------------local dictionary
    lfl = [] # ---------------local faces index list
    lvl = [] # ---------------local vertex list
    lnl = [] # ---------------local normal list
    luvl = [] # --------------local uv list
    lvcnt = 0 # --------------local vertices count
    isSmooth = False
    hasUV = True    # true by default, it will be verified below

    print("Building for: %s\n"%obj.name)
    #============================================================
    if (len(msh.tessface_uv_textures) > 0):
        if (msh.tessface_uv_textures.active is None):
            hasUV=False
    else:
        hasUV = False
    #-------------------
    if (hasUV):
        activeUV = msh.tessface_uv_textures.active.data
    #============================================================
    obj_names.append(clearName(obj.name))
    obj_cnt+=1
    print('objectCount =', obj_cnt)
    print('\n')
    #============================================================
    for i,f in enumerate(msh.tessfaces):
        isSmooth = f.use_smooth
        tmpfaces = []
        for j,v in enumerate(f.vertices):
            vec = msh.vertices[v].co
            vec = r3d(vec)

            if (isSmooth):  # use vertex normal
                nor = msh.vertices[v].normal
            else:           # use face normal
                nor = f.normal

            nor = r3d(nor)

            if (hasUV):
                co = activeUV[i].uv[j]
                co = r2d(co)
            else:
                co = (0.0, 0.0)

            key = vec, nor, co
            vinx = lvdic.get(key)

            if (vinx is None): # vertex not found
                lvdic[key] = lvcnt
                lvl.append(vec)
                lnl.append(nor)
                luvl.append(co)
                tmpfaces.append(lvcnt)
                lvcnt+=1
            else:
                inx = lvdic[key]
                tmpfaces.append(inx)

        if (len(tmpfaces)==3):
            lfl.append(tmpfaces)
        else:
            lfl.append([tmpfaces[0], tmpfaces[1], tmpfaces[2]])
            lfl.append([tmpfaces[0], tmpfaces[2], tmpfaces[3]])

    bpy.data.meshes.remove(msh)
    #===============================================================
    #update global lists and dictionaries
    vtx.append(lvdic)
    faces.append(lfl)
    vl.append(lvl)
    nl.append(lnl)
    uvl.append(luvl)
    obj_mtx.append(obj.matrix_local)

    #===============================================================
    #============---WRITE_INDICES========
    #===============================================================
    numberOfFaces = len(lfl)
    numberOfIndices = numberOfFaces * 3
    #-----------------------------------
    filename = obj.name + '_INDICES' + '.cpp'
    file = open(path + obj.name + '/' + filename, "w", newline="\n")
    #--------------------
    file.write("GLuint ")
    file.write(obj.name)
    file.write("_INDICES[] = \n{\n")
    file.write("    //numberOfIndices = %d\n" %numberOfIndices)
    file.write("\n")
    #-------------------------------------------------------------------
    for faceCount in range(numberOfFaces):#---------print the index list
        file.write("%d" %lfl[faceCount][0])
        file.write(", ")
        file.write("%d" %lfl[faceCount][1])
        file.write(", ")
        file.write("%d" %lfl[faceCount][2])
        file.write(", ")
        file.write("\n")
    #---------------------------------------
    file.write("}; \n")
    file.close()
    #=========================================================================
    #============---WRITE_VERTICES========
    #=========================================================================
    numberOfVerts    = len(lvl)
    print(numberOfVerts)
    numberOfVertices = numberOfVerts
    #-----------------------------------
    filename = obj.name + '.cpp'
    file = open(path  + obj.name + '/' + filename, "w", newline="\n")
    #---------------------
    file.write("GLfloat ")
    file.write(obj.name)
    file.write("[] = \n{\n")
    file.write("    //numberOfVertices = %d\n" %numberOfVertices)
    file.write("\n")
    #-------------------------------------------------------------------
    for vertCount in range(numberOfVertices):#---------print the vertex list
        file.write("\t%f " %lvl[vertCount][0])
        file.write(", ")
        file.write("\t%f " %lvl[vertCount][1])
        file.write(", ")
        file.write("\t%f " %lvl[vertCount][2])
        file.write(", ")
        file.write("\t%f " %lnl[vertCount][0])
        file.write(", ")
        file.write("\t%f " %lnl[vertCount][1])
        file.write(", ")
        file.write("\t%f " %lnl[vertCount][2])
        file.write(", ")
        file.write("\t%f " %luvl[vertCount][0])
        file.write(", ")
        file.write("\t%f " %luvl[vertCount][1])
        file.write(", ")
        file.write("\n")

    #--------------------------------------
    file.write("}; \n")
    file.close()

The functional component is exactly the same except that I've added a function call that deletes the created data after it's used so the mesh data blocks don't fill up with nuisance data... the output has been reformatted to suit my needs so you are likely going to want to do the same since this tends to be specific to the final OpenGL render code setup.
The original code can be found at the following site and may be located using the following keywords.
http://ksolek.fm.interia.pl/Blender/
Keywords:  Blender OpenGL / C header exporter Krzysztof Soďż˝ek Bruce Merry Campbell Barton Stanford PLY

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
How to access custom properties from python
How can I access a custom property of an object from python, the suggestion Blender gives me if I pass the mouse over the custom properties named "prop",
bpy.data.objects["Cube"].["prop"]

get me this output in the console
>>> bpy.data.objects["Cube"].["prop"]
  File "<blender_console>", line 1
    bpy.data.objects["Cube"].["prop"]
                             ^
SyntaxError: invalid syntax

You just need to remove the dot, so the correct invocation is:
bpy.data.objects["Cube"]["prop"]

Python's subscription syntax doesn't use dot character.
Note: In Python terminology this is known as getitem rather then getattr access.

It is possible to store datablocks in "custom properties".  I just did an experiment:
m = bpy.data.movieclips.load("bigbuckbunny.mp4")
bpy.context.scene["cliche free video"] = m

You can see it in the Scene tab of the Properties panel at the bottom.  It appears to be preserved across a save/load cycle.
I'm not sure how many different datablocks support custom properties, but you might find one that is a better match than Scene (like an Object, or a Material).
I think you could even store an array of movieclips in there.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
How to do motion track with the camera movement
The camera still keep rotating ,moving  and I want to put the 3D model in the scene.If all track points keep in the camera view its ok to track but confused me is the track points only can keep a while then disabled with the camera movement.
So the setting floor actually only keep a while not always there.
If the 3D models keep movement with the camera its hard to keep it.
I dont know how to do this kind of track.
For example ,the camear move from bottom to top of the building ,the 3D model need up with the camera
sample file
sample clip


text:
How to fix those stretches ? / UV unwrapping

How to fix those stretches ?
There's a blend file as well if needed

This is because you got n-gons that are "intersecting" with itself.
The easiest fix for that is to triangulate the faces that are causing problems.

Select the faces that are ngons and press

ctrl + t

or search for Triangulate Faces


text:
How to make a through hole using inward extrusion in Blender 2.8?
I am trying to make a through hole using inward extrusion.
I enterd into edit mode, then I drawed an outline of my hole using knife tool.
then I turn into wireframe shading, rotate my view an select snap to faces and then extrude the hole outline inward

so the hole is created successfully, but I still have a face at the hole bottom.
I can select this face separately

But If I try to delete it, I siply delete this face (I can't select it anymore after deleteting), but I do not see through hole, so the basic cube face is still here.
So how to remove the hole bottom?

it is possible that this "swiss cheese modifier" might be helpful to look at, though it's a script.

You can use the faces of a mesh to dig a hole in the same mesh, using the ctrlF > Intersect (Boolean) tool. Just push the face a bit further down. Then in the Operator box choose Difference and Solver > Fast.

Or use a second mesh:

Thanks, mate, solved it! Pictures too!? y'sh'dna <3


text:
Very undetailed normal map, blurry? High poly to low poly mesh help
I am in the process of baking a normalmap from a high poly mesh down to a low poly mesh. I am getting a very blurry looking normalmap with bad results. Is there something I am doing wrong? The image for the normal is 1024^2, non alpha, 32bit checked. Using 1m ray distance. Any help on getting a detailed, accurate bake would be great! Thanks

It looks like you have a rather large margin (default is 16px - too big in my opinion). Try reducing it to as low as 1 and see if that helps. You can change it in the output section of the bake settings.

I think that solved a lot of the problem on the normal map blurriness. It still is not entirely accurate, and there are artifacts.


text:
Loop through planes and do a center loop cut script
I am trying to write a simple script which should loop through the selected objects (all simple square planes) and do a loop cut operation in order to split the plane in half.
EDIT: What I have runs, but now only cuts the active object:
EDITED IN A SIMPLER VERSION:
import bpy

bpy.ops.object.mode_set(mode = 'OBJECT')

# If there ARE objects selected then act on all objects
if bpy.context.selected_objects != []:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            print(">>>>", obj.name)
            bpy.ops.object.mode_set(mode = 'EDIT')

            obj = bpy.context.active_object

            def view3d_find( return_area = False ):
                # returns first 3d view, normally we get from context
                for area in bpy.context.window.screen.areas:
                    if area.type == 'VIEW_3D':
                        v3d = area.spaces[0]
                        rv3d = v3d.region_3d
                        for region in area.regions:
                            if region.type == 'WINDOW':
                                if return_area: return region, rv3d, v3d, area
                                return region, rv3d, v3d
                return None, None

            region, rv3d, v3d, area = view3d_find(True)

            override = {
                'scene'  : bpy.context.scene,
                'region' : region,
                'area'   : area,
                'space'  : v3d
            }

            bpy.ops.mesh.loopcut_slide(
                override,
                MESH_OT_loopcut = {
                    "number_cuts"           : 1,
                    "smoothness"            : 0,
                    "falloff"               : 'SMOOTH',  # Was 'INVERSE_SQUARE' that does not exist
                    "edge_index"            : 1,
                    "object_index"          : 0,
                    "mesh_select_mode_init" : (True, False, False)
                }
            )

Seems the problem stems from the active object being the only thing taking the loop cuts. Help on where I've gone wrong would be great! Thanks!

All selected objects will be put into edit mode. Can set the active object with context.view_layer.objects.active = obj  or  add teh object to the overrirde, since all are in edit mode. Somewhat related https://blender.stackexchange.com/questions/102207/subdividing-cubes-at-different-intervals/102239?r=SearchResults&s=1|29.7080#102239

I'm not sure I understand how to implement this code snippet, nothing changes when adding that in the loop body.

bpy.context.view_layer.objects.active = obj is what I needed! Note the prefix bpy.* is the only thing missing. Can you add an answer batFINGER


text:
How can you use color ramp to affect emissive shader
Is it possible to affect the emissive shader with the color ramp at all? I would like to do something like this (image below):

if you plug the ColorRamp into the Emission node it will affect it, but maybe give more details of what you want to do

how do you want to effect the emissive shader?

made an edit to show what i mean

You could use the supplied Gradient node, mapped appropriately..

Here, just using the Generated texture space on a plain mesh circle.. (it could be a sphere, if you want it to be) The Mapping node rotates the gradient to the right orientation, the Color Ramp converts the input 0-1 value to a range of colors.

(With a bit of Glare added in the compositor to simulate the reference)

That can be done using the geometry input node and doing that you'll have to tune the Z value depending on the object geometry:

The node math is done this way, as in this example Z is going from -1 to +1. So dividing by 2 obtains something between -0.5 and +0.5 and add 0.5 obtains something between 0 and 1 which is what we want for the colorramp.
You can also use a UV map (to avoid geometric calculation). For instance make the UV map with 'project from view (bounds)', so that you can:

thank you that's exactly what i needed. I don't fully understand why the math node is used in this way but if it works it works ¯_(ツ)_/¯

I've added some explanation about the math.


text:
Adding jitter to a constrained camera
I am trying to add some camera jitter to my scene. The camera is parented to an empty and constrained to follow a circular path. I tried using the graph editor to add a noise modifier on the Z axis, but that didn't do anything. Is there another procedural way to add the jitter. I even tried to get the target cube to to move up and down. Still no luck.

Here is my example scene.

keyframe location on frame 1 for your camera

delete x and y location in graph editor:

select z location and add noise modifier

change settings to your preferences:

enjoy!

of course you can also add jitter to x and y location if you want to!

I followed your steps, and looked at the Blend file you posted, but I can't duplicate it. Here is my updated file. What am I doing wrong?

Never mind. I was adding rotation not location. When I changed to location everything worked.

A lot would find your answer useful @Chris.

@Edgel3D : thank you. But it is no rocket science

Hi @Chris.  The comment was placed and the answer upvoted because it's often the basic stuff and 'simple tricks' that can count for those who aren't all that savvy.  i.e. it's useful. Camera shake to name just one.

I appreciated your comment and I understand that and mine wasn’t meant to be negative…☺


text:
Black spots on UV mapped objects
First off I am very new to 3D modeling. So please forgive any glaring mistakes.
I am trying to create a scene that simulates satellite imagery using Blender render. When I render any thing but the simplest mesh object like a cube I get black chunks all over the object. However if I move the camera close to the object those spots disappear. The only difference between the cameras is location and focal length. What am I doing wrong. Any help would be greatly appreciated.
Here is my .blend file if it will help. Example
(150km) Camera Render of a UV Sphere

(50m) Camera Render of a UV Sphere

One suggestion would be to adjust your camera clipping settings. I'd be happy to take a closer look if you can post your file :)

I made sure the clipping end was set to 600km. Here is a link to the .blend file link

It's stranger than just black spots: if the world colour is changed to a brighter horizon value, the spherical hull seems to reveal the dashed pattern underneath. It would appear that a camera that distant, with the field of view corresponding to minuscule angles, is causing some errors, but I'm not sure as I'm not too familiar with the inner workings of the original blender internal renderer

How do I reproduce your error? I don't see the black spots, I tried moving the camera close and far, and it looks fine.

Perhaps it is my computer, but when ever I place the camera more than 10 or so kilometers above the target the render looks like the first image.

When I move the camera 10 km above the target, the whole scene is clipped since it's far away. Can you upload a version where the black spots will show as is? This will verify if it's just your computer, or could be the blender version number to.

The clipping on the camera is set to 600km. On the clipping on the view is set to 1km, but the black spots only show up in the render.

Do you mean 10m? At 10km, I just see a white dot (the surface the sphere is on), at 10m, I get a view similar to the one you have above, no black spots on either. Hmm, are you getting black spots using cycles render as well?

When ever I render a scene with the camera named 'Sat' is when I see the problem. The other closer camera is called 'Camera'. I probable should have chosen better names. Also I do not see the same problems using the cycles render only the blender render.

Ah okay, the Sat camera most likely has some weird setting, it's easier to just delete it and create a new camera. I found your Sat camera. So I just compared it's values with the default camera. The focal length of sat was set at 13 meters vs 3.8mm in the default camera. I think the largest focal length lens in real life is way smaller, so maybe thats why it got all screwy. Anyway, if you change the focal lens size to 3.8mm or some other realistic size, you should be good! You will also need to move the camera closer to the object.

Adding the answer for completeness!
From the above comments, I compared the "Sat" camera object with a "good camera". The focal length of sat was set at 13 meters vs 3.8mm in the default camera. I think the largest focal length lens in real life is way smaller, so maybe that's why it got all screwy. Anyway, if you change the focal lens size to 3.8mm or some other realistic size, you should be good! You will also need to move the camera closer to the object.

That is indeed what I ended up doing. I think I was just making everything more complicated than it need to be. Since I am not simulating the curvature of the earth or the atmosphere between camera and target it is a lot simpler to shrink the focal length of the camera and move it closer.


text:
Hair partially disappearing in render after combing
I got a weird problem. Patches of hair on a rug for a bathroom scene are disappering in my render, but only if I entered particle edit Mode and combed the hair before.
So, I start out setting up my hair system, when I hit render without entering the particle edit Mode I get a nice render just like its supposed to look. All the hair is also howing in the viewport before and after this render.
I enter particle edit mode, just make a single tiny stroke with the comb, exit into object mode again. All the hair is still showing in the viewport at this point, I can also so see my "comb-job" in the viewport.
When I now hit render though, whole patches of hair just disappear from the render. Its also not like that the areas I combed before disappear and the ones I left untouched are still showing, there seems to be no connection between where I comb and what disappears.
After this render finishes the hair (same hair as in render result) is also missing in the viewport.
My emitter is just a plane, rotation and scale all applied, with a subsurf modifier. Use modifier stack is enabled.
I´m aware that particles won´t render when you´re still in particle edit mode, I always changed back to object mode before rendering.
Does anyone have an idea whats causing this and how to fix it?
Thanks in advance

Can you post an image of your particle settings?

Sure, added it to my first post.

Nobody got any ideas?

You have $300000$ individual hairs right now. I suspect that your issue stems from that very high number of edited particles. To fix this, use Particle Children. Set your Emission number to something lower, like $3000$ or $1000$. Then, enable Interpolated children:

You can set the Render parameter so that the total number of children is equal to $300000$, (i.e. $3000\cdot 100=300000$).
You can now use Particle Edit to comb your particles. They should take up less memory now, and hopefully render correctly.

I´ll try what you suggestet tomorrow.
But i dont think this is the culprit, besides the rug I have another 5 towels in my scene, each with with a million hairs. All 4 render without any problems. I even deactivated them for the test renders in the screenshots your seeing to to make sure "too many particles" couldnt be the case.

did you ever fix this.  This is happening to me too now.  Renders fine until I use particle edit mode.  Just a few hundred leaves in my case.

This behavior is most likely a bug, and isn't intended. What I've answered is a suggested best practice to get around it, but it would perhaps be a good idea to report a bug.

Thanks scott, seems really odd because I have other objects in the scene that are using particle edit and they appear to work perfectly, so it can't be a render setting thats wrong etc.  Stumped.  Thanks anyway.


text:
I am having issues with the donuts icing clipping through the donut on blender

there are strange dark lines appearing in the whole of my donut i think it might be something to do with my icing clipping with the donut. I am not quite sure what is causing the problem as I am new to blender.
The lines I am talking about are those strange black lines around the whole of my donut, This wasn't happening on blender gurus donut and i think i am doing something wrong. heres the blend file.

Welcome to BSE. It's difficult to tell what the problem is from this single screenshot. Would you mind editing your question and adding a link to your .blend file? https://blender.meta.stackexchange.com/questions/658/including-a-blend-file

OK I will sorry to be confusing.

No problem at all! I've added an answer that I hope will be of some use.

Welcome to BSE,
I downloaded and opened your .blend file. Without making any changes, I am not seeing the problem you are describing:

I have not watched the donut tutorial, and even if I had I wouldn't know where in the tutorial you have reached.
I do however have some advice you might find useful.
Firstly, you might find it easier to apply some colors to your donut/icing while you are working on them. This will make it easier to tell which object is which. Later in the tutorial you will make proper materials for the final render; this is just temporary.
There are two ways to do this:
Random colors
In the Viewport Shading drop-down menu, change the Color from Material to Random:

Specific colors

Select your Icing object
Open the Materials panel and add a new material to the Icing object

Scroll down and expand the Viewport Display section. Select a color for your Icing in the Viewport.

Repeat these steps with the donut. Your Viewport should now look something like this:

Please note that these colors will not affect your render. They will only be shown in Solid Shading mode in the Viewport.
This make it easier to see which object is which while working on them.
I've noticed that some of the edges on your donut are Marked Sharp:
These edges should not be sharp (a donut has no sharp edges!).

To remove the sharp edges:

Select the donut and press Tab to enter Edit mode
Press A to select all vertices
Press CTRL+E and use the Clear Sharp option

Although I am not seeing your problem when I open your .blend file, I would guess this problem is due to parts of your donut clipping through the icing.
For example, the verts I have highlighted here:

You could correct this by add some additional thickness to the solidy modifier on the Icing object:

You might also want to adjust your icing mesh in certain places so it is attached to the donut. For example, this part of the icing looks a bit odd:

(From the bottom):

Thank you so much for the help i didn't realise my icing was looking so weird in the middle thanks for all the tips as well.

Don't mention it :) Would you mind accepting my answer to make it easier for others to find it?

Done sorry for taking a while


text:
The camera goes beyond the track i have it following
I am new to blender and just messing around with the camera and I have noticed that when i play the animation it follows the path and then when it gets to the end it just keeps going in a straight line and I don't know what to do.

You can bake the motion of the camera to keyframes, and then you will have greater control over stopping it

What would you like it to do instead?

I wanted it to stop at the end of the track Samuel.

select your path and under "path animation" select "clamp":

Thanks Chris that was really helpful.

You are welcome


text:
Strange problem with light through glass
After having worked with vray for a long time, I recently started Blender and I am having trouble with glass and lights. As you can see the light sources show as spheres through some of the glass, which is obviously not desirable. Stranger thing is through other glass they look correct. Both glasses have same material. I don`t understand what might be the reason.

Does replacing the Maximum node with a simple value change anything?

I would suspect if seen through different windows at different angles that the reason for the different behaviour is found in the windows... have they different thicknesses? Have some of them no thickness at all and are just simple faces?

The reason why you see the light sources so big is that their radius is set to 35 cm and Transmission visibility is enabled. This means, through transmissive material you will see the light as sphere with a radius of 35 cm. The same would happen from inside the cabin because Glossy visibility is enabled and the glass has a glossy surface. Of course you could turn that off as well, the problem will be this also removes reflective highlights on glossy surfaces.

@joachim I tried a simple value; thencutting off light path and maximum and clamping maximum with no effect

@GordonBrinkmann I checked the windows, they have same characteristics; adding images

What I can't see in the screenshots is the Outliner: are the side windows maybe hidden in the 3D Viewport and only visible in the real rendering? Apart from that, the lighting in both images looks quite different so I wonder what other settings are changed between viewport and render. And what render engine are you actually using, Cycles or Eevee or Vray which you mention in the question?

Anyway, since the desired effect is not to see the lights you have to disable the Transmission visibility. Although you might not like it, as long as it's enabled it is the "correct" way that you see the light as spheres.

I will check now all that is different between viewport and render and the scenes (outliner). Disabling transmission doesn`t have any effect though; I am attaching both views from inside; this time outside lights look as spheres, inside ones are OK

All renders and render preview are Cycles

Of course renders from inside will show outside lights as spheres - because you see them through the glass window, a transmissive object. The lights are set to be visible for Transmission. Have you disabled it for all lights?

I think I misread before; yes, you are right; when I disable Transmission, it's all OK (apart from the fact that the bulb doesn't look as if it is on).
You are also right about the reason between the front and side windows; different settings in the Outliner.
When I change the math node value to Power instead of Maximum it works with Glossy and Transmission enabled (but I don't have reflections on the glass from the lights). I think although it's a bit difficult to comprehend, I should work on the light path node a lot more. Many thanks for your help!

I am not technical enough at all to understand this. But from a real perspective, looking at a light through a window doesn't really affect the look of the light source. So why do you guys think that behavior is correct in this scenario?

It seems to me that it has something to do with how Cycles handles ray tracing. With v-ray this was not a problem.

I finally found a more or less acceptable solution. I duplicate the point light (at the same exact location). I put first one into a translucent container (like a bulb or a lamp shade) and reduce its radius to fit inside the container; adjust power and color accordingly, just how I want it to look (through glass and directly). Second light can be any size or color, as I disable its ray visibility through properties tab (except 'diffuse' and 'volume'). So geometrically only the first light is seen, but the second (not visible) light is the one that illuminates.


text:
Move Faces along individual normals
I need a way to move multiple selected faces along their individual normals. When you google for this you´ll come along this solution.
This solution is working exactly the way I would need to but only on non-connected faces. As soon as the selected faces share an edge those faces will move along a single normal that seems to be the average or median of them.
I´ve seen Alt+S (Shrink/Fatten tool) being suggested but it doesnt work like intended. The normals of the moved faces will get skewed leading to a horrible looking result.
I´ve also tried every imaginable combination of Pivot points and Transform Orientations using g double z, or alt+s, extruding and Alt+e for extruding along normals.
Here´s a screenshot of what kind of result I expect on a dummy model, all of the inner walls are moved 0.1 along their respective normals from me by hand. Easy in this case because of few faces and all normals being parallel to the world.

Is there a way to do what I need?
Thanks

You could inset faces using the I key and keep the inset on the original edge. extrude as far as you want then remove doubles.

I´ve fiddled around with this but couldnt come up with anything usefull. Could you specify which Pivot Point and Transform Orientation you suggest during inner extruding and extruding?
I´ve uploaded my dummy file for anyone to try out their luck. There´s a vertex group with all the faces that need to be scale/moved/extruded.
File
Thanks

There's no easy way to do all this in one click  (unless you wanna setup a hook and constraint system for every side of exterior walls that will allow you that kind of specific control)

Not sure I get what you mean but... maybe you could try using Alt+E and select Region (Vertex Normals) to extrude along the face normals and then dissolve unwanted edges.

I know there is a way to do it. Might have been a bug because I cant repeat it. In Edit Mesh mode: I set (Pivot Point=Individual Origins) & (Orientation=Normal). Hit 'G' then 'Z'. My screen filled up with 854 blue lines (the number of faces in my mesh) and it was working. Can I do it again? NO and I'm upset about it. ;( I literally tried to do it again 15 seconds later and I couldn't. Some how, the first time, Blender saw each face as an individual selections.

I'm trying to solve this problem with Python If you do the faces iteratively one by one it should work.


text:
How to light a scene when you have a sun lamp?
I'm trying to light the interior of a room, but the outside is being lit by a sun lamp. It seems like everything inside the room is not lighting up due to the sun lamp. How do I fix this?

If i understand correctly your interior is too dark?

Yes, I will post a picture.

and what exactly are you trying to achieve? In the picture it looks like the interior is light enough. Do you want it even brighter? Or do you want the outside to be dark?

I want to make the interior brighter.

then set the stregth of the sun lamp to higher value

Yes, but that would affect the outside environment. I just want to make the interior brighter.

Let us continue this discussion in chat.

is this for Cycles? I am not sure how your glass shader is set up for the dome but I would set it up this way https://blender.stackexchange.com/questions/107018/which-glass-shader-is-physically-correct


text:
Animation has yellow tint
1My animation has a yellow tint to it after I made it an AVI JPEG file.
What the video looks like.

What the frame actually looks like.
I made this animation by outputing the frames into a JPEG file, then I put the images into an image strip where I export it as an AVI JPEG. I viewed the final animation using the Movie and TV tool that Windows uses.
I am rendering using Cycles.

If you need any more details please contact me.
Nevermind, I fixed it. It was just the movie player that tinted it.

OK. What information do I still need?


text:
Adding Modifier (Mirrored)
I'm trying to add the Mirror modifier to a cube. I'm in Object Mode, I click add Modifier. When I click apply, the modifier disappears.
In Edit mode I can't add the modifier at all.
Am I doing something wrong?

You don't need to hit apply. Apply bakes in the modifier. It is already working dynamically before you hit apply.

But the mirrored "cube" doesn't appear, even though the modifier is set to visible and everything else too

The Modifier will Mirror across the objects Origin. In your case it looks like you should UnCheck X and Check Y

You mirror in the X direction (along the X axis). From your screenshot, the center of your object is in the middle of the 'left' side, which means that the original and generated (mirrored) points overlap.
Selecting the Y axis as mirror axis probably does what you want.
If you already applied the mirror modifier, you might also want to 'remove doubles' to get rid of superfluous vertices (which can give strange effects with e.g. subdivision or bevel modifiers)


text:
How to get glare on “Quick Smoke” (Fire & Smoke explosion)
FYI this is a duplicate of a message that i sent about a month ago, but i had no response and im desperate for an answer, so instead of people shutting down my question, please, i just need some help here.
I have this question that relates to Blenders Quick Smoke tool. Recently I have been rendering CGI explosions and smoke assets to be keyed in later on a short film, but I have this small problem that I think would make the explosion look a ton better, but I just cant quite figure out how to do it. Now as we may also know using composting, you can have a glare node on specific light sources to make the scene a lot more realistic, but Im trying to figure out how to do it with explosions. As seen below I rendered out this fairly simple explosion but I would really like it to have a glare to the flame parts of it.

Thanks if anyone has any ideas, also a quick side question as well, is there a way to hide the emitter (The sphere in the middle) [Cycles]. Thanks

Don't post duplicates please, think of ways to improve your question (e.g. Document the things you've tried in the month briefly.

Okay well yes, i have kind of given up on this, and there's no other ways that i can improve my question, all i need is an answer instead of people trying to shut down my question.


text:
Blender 2.73 textures in solid view mode
When I was using blender 2.73, I realized that the option of "textured solid" is missing from the right pullout menu, when in previous versions it was put under "display".

I am aware that I could just change the view mode to textured. However, I am using the game engine, and I want one scene to have textures, while another I need to be in solid view mode. So is there any way in Blender 2.73 to have a "textured solid" mode without completely changing to textured mode?

Texture Solid is in the 'Shading panel', which is below the 'Display' panel:

My shading menu doesn't have this. It only has a drop-down menu, and shadeless and backface culling options.

I have updated the image with one from Blender Internal instead of Cycles as I guess you are probably using that. If there is something else different it is because you are not using the latest version of blender (2.74).

I'm using the blender game engine. Sorry for not mentioning that!


text:
Align Object to Vector using python
I am trying to rotate an object using python, inline with a vector which gives me the direction I want (based on the difference between the last two coordinates of the curve I generated). I therefore have a vector which I'd like to align this object but not the XYZ angles. The options to specify rotation (XYZ Euler...) all seem to require some sort of angle definition. I've started playing with numpy with I'm not experienced enough to find the answer.
Would you be able to advise what would be the best way to align an object to a vector and (if necessary) how I could convert the vector coordinates in XYZ_Euler angles I could apply to the object?
for instance, Vector=[1,1,1] and I would like to rotate the object along this vector.
Thanks for your help

update
Thanks guys, DirectionVector.to_track_quat('X', 'Z') did the trick very nicely!
#define direction
Vector=(1,1,1)
DirectionVector = mathutils.Vector(Vector)
#apply rotation
bpy.context.object.rotation_mode = 'QUATERNION'
bpy.context.object.rotation_quaternion = DirectionVector.to_track_quat('Z','Y')

Try this:
DirectionVector.to_track_quat('X', 'Z').to_euler()
mathutils.Vector.to_track_quat in the docs

Thanks. I don't know how to include linebreaks in this mini-markdown format so, see my comment below...

For me, for pointing a camera, what I needed was camera.rotation_euler = direction_vec.to_track_quat('-Z', 'Y').to_euler()

This example uses Vector.rotation_difference or Vector.to_track_quat
import bpy
from mathutils import Matrix, Vector, Euler

obj = bpy.context.active_object
vec = Vector((1.0, 1.0, 1.0))

# object axis to align with vector vec
axis = Vector((1.0, 0.0, 0.0))

# rotation difference
q = axis.rotation_difference(vec)
# or
# track quaternion
q = vec.to_track_quat('X', 'Z')

loc, rot, scale = obj.matrix_world.decompose()

mat_scale = Matrix()
for i in range(3):
    mat_scale[i][i] = scale[i]

obj.matrix_world = (
    Matrix.Translation(loc) *
    q.to_matrix().to_4x4() *
    mat_scale)

Hi Jerryno, could you please have a look at my question found here https://blender.stackexchange.com/questions/79344/move-bone-tail-to-a-certain-location batFINGER suggested that this answer could help me solve what I'm trying to do. I'd appreciate it if you could advise me please.

Yes thanks for that final hint. Super simple in my case.
[At first I had my up and nrml switched.]
up = Vector((0, 0, 1))
rot = up.rotation_difference(nrml).to_euler()
print("normal:", nrml, "rotation:", rot)
bpy.ops.mesh.primitive_circle_add(vertices=36, radius=siz, fill_type='NGON', location=cntr, rotation=rot)

May it bring further clarity to others.

IMO need to bring further clarity to this answer.

Hmmm it's just a simplification in another context. How to get the Euler Rotation for items that need that. nrml is of course a Normal or angle you are aligning to typically in this case it came from a polygon (aka face) via p.normal as does the cntr from p.center. I was experiencing odd behavior and then tried switching the nrml and up in the line with rotation_difference and then it all started working so again just a hint to other that if your experiencing weird behavior try that. If you need more clarity maybe be more specific but it's again not worth our time, but could be useful.


text:
Moving object removes fluid while using the FLIP Fluid add on
I have a ball that moves through an inverted obstacle (it has the shape of the letter 'P'). When the ball moves through the liquid, it doesn't seem to move and push the liquid, but it appears to remove it. As a result, when the liquid comes to rest, the amount of liquid is obviously way less.

The balls movement is done using keyframes on its position. The liquid is there from the start of the scene using a Fluid object. So part of my inverted object is filled with liquid. There are no inflows or outflows in the scene.
Is there a setting I have turned the wrong way or is there another reason why this behaviour is happening?
My current settings are
Blender frame rate: 24
FLIP Fluid frame rate: 24
Resolution: 200
Min and max substeps: 1 and 24
Enable Adaptive Time Stepping for Objects: on
Fluid settings: all default
Ball object settings - Export Animated Mesh: on

I have run the simulation with a min substeps amount of 6, but that didn't change anything.

Please show your inflow and outflow settings.

Please show your normals for an obstacle.  What do you mean inverted?  Blender can annotate frames with a frame number with a few clicks.  Although the reader might guess the order of your images ... its not really educational to guess.

@atomicbezierslinger, I've improved the image. With inverted I mean the obstacles basically becomes a domain for the fluid. So the obstacle becomes hollow and everything outside becomes solid. Just making sure, did you see I'm using the FLIP Fluid add on for this simulation?

What is the effect you want? Realistic or Special Effect. You may try a much smaller sphere to compare results. You can have a smaller sphere follow a path with the [follow path constraint]. I have used the older fluid sim. I would avoid this unusual idea to have to solid pass through another solid. I think the more typical case is to have a solid pass through fluid. Hopefully others can comment. Please try such a scenario and see if the results are more aligned to your expectation

@Bassie-c, There is a bug in the current FLIP Fluids addon version (v1.0.7) that can cause regular obstacles not to interact properly with the liquid if there is an inverted obstacle present in the scene. This issue has been recently fixed and we will be releasing a version update (v1.0.8) that includes this fix within the next few days. This version will be available on the Blender Market as well as our GitHub project page. Apologies for this issue and the inconvenience.

@RLGUY, Wow, awesome, a reaction by the developer of the plug-in! Thanks for your answer. No problem that there's a bug. I'm looking forward to the release of the update!
(Btw, I think you should have put your reaction as an answer to my question, because than I could mark this question as solved :) )

+1. Such a great question. I was curious and browsed your profile @Bassie-c, and noticed you followed my Materials Modeling stack exchange proposal but did not commit to it. Would you mind committing to it now, as we are quite desperate to reach 100 committers with 200 reputation? We already met all the other requirements! https://area51.stackexchange.com/proposals/122958/materials-modeling?referrer=MTRlZjUyNGY3MGY4ZWY5ZWZkZGVlNmY0NzY5ZjEzN2NjMjNlZTIwMjU0MWU0MDRjNjM2YjIxZmUxNGVhMWZlMHGM23pUo7y5cQ0jl0rBbYtJLWEPnIuIsvgjQSnSfyMm0

This issue still here. Blender version 4.3. FlipFluid version 1.0.8 but the volume of liquid decreases slightly inside the moving obstacle.

This issue is caused a bug in FLIP Fluids addon versions 1.0.7 or lower that can result in regular obstacles not interacting properly with the liquid if there is an inverted obstacle present in the scene. This issue has been fixed and this fix is included in FLIP Fluids version 1.0.8 or later. This version is available on the Blender Market, in our Free Trial, and on our GitHub project page.


text:
Lighting requires extreme values (Blender 2.8)
I recently started learning Blender and been following one of Blenderguru's tutorials on lighting (found here) but for some reason my lights, using the exact same scene, requires extreme values to give off any noticeable light. His light is around 50w but for me I need around 500w to achieve a similar effect. I tried applying the scale of everything in the scene but it didn't make a difference. I also checked to see the units were set up correctly (metric/meter) which they were as far as I can tell.
It feels like the range of the light is very short because if I move the light really close it does get much brighter. Maybe there's some falloff setting I need to adjust? .. Happy for any advice on what might be wrong!

And this is my settings:

The file I'm using is shared by Blenderguru with a link in the description of the video. Here's the file I used:
https://www.dropbox.com/s/lqspxls3yte73f8/Mafia4%20%281%29.blend?dl=0
Also here's how my image looks with False Color activated:

Compared to BlenderGuru's image:

Could something like this be impacted by hardware or software related outside of blender? Like a scene should render the exact same end result on two different computers given all settings are equal right?!

It might be the Filmic-RGB color setting, he uses it very often. Do you have it installed?

I have it set to: sRGB/Filmic

There is nothing extreme about the values. You should not worry about them. Those are only numbers. It doesn't matter if it's 1 or 1000000. The proportions matter more - if you have sunlight in the scene it should not be dimmer than light from a light bulb and so on.
If it is more convenient for you to work with some specific units you can adjust the exposure to match them in the Color Management settings:

or under Film settings:


text:
No lights rendered in Eevee
I'm very new to Blender and tried Blender 2.8.
My currently problem is that Eevee does not render the lights I placed in the scene as shown below:

The final render of Eevee:

The weird thing is that it works with Cycles:

In Eevee I enabled the options "Ambient Occlusion" and "Bloom".
Would be nice If someone could help me to render with Eevee :)
Edit:
Platform: Ubuntu 18.04.2 LTS
GPU: NVIDIA GTX 1060 6GB
CPU: Intel i5 760
Solved by restarting blender (after computer was in standby)

It's working, make sure you have the latest 2.80.


text:
Lags in pose mode
When I try to pose my character in pose mode,Blender gets very slow and lags very badly.The subsurf modifier is displayed in the viewport,but my character is very simple.Is it normal if I get this lag?

no it's not normal, maybe share your file or at least a part of it: https://blend-exchange.giantcowfilms.com/

ok i will upload it

Sadly, this is a bug/issue with blender >2.8. Since the introduction of OpenSubdiv, the subdivision surface and multires modifiers use a different implementation that, while being GPU capable, runs on the CPU (and there's no way to change it for now), and are very slow even on the high-end machines.
I really don't know about blender's internals. But it looks to me as if blender was re-computing the subsurf modifier every frame instead of working with the subdivided mesh. The order of modifiers does not matter either. If you apply the subdivision modifier, you will get back smooth posing, but then you loose the ability to go back to the low-poly mesh if you need to tweak the topology.
I think this is the official issue link: https://developer.blender.org/T58191


text:
How can I get the grid (under the asset) show when importing through the asset browser?
When I drag a collection instance from the asset browser I don't see the grid that moves together with the asset (I don`t know what it is called). So I can not snap the collection to the surface. It just moves to some point in space below the scene floor.
I thought this might be because they are not objects but collections; but I watched a tutorial (see images) the grid was there; so that shouldn`t be the reason.


text:
Why can`t I see my object through refractive surface (Cycles)
I am probably missing something very simple. The hdri background can be seen through the water (a simple refractive material), but the object can`t. This is the same for world materials both with or without volumetrics.

I assume that you have EEVEE enabled.
In EEVEE to make refraction work you should:

Turn on Screen Space Reflection and Refraction in World settings:

Turn on Raytrace Refraction in each refractive material:

Sorry for the confusion; it`s all Cycles.

Are you sure? It doesn't look like cycles.

Yes, I am sure :)

have you tried different IOR?

Normally that shouldn't be necessary if it's really accurate; but, yes when I decrease ior it gets a little more transparent (obviously) for the background; but the object still is 0 visible.


text:
Cannot move camera in viewport, nor move reference jpeg images
I'm struggling with an issue, my camera and reference images won't budge when I try and move them, the arrows won't select/move the items, it just creates a dashed line box selection. When I change the values numerically the items move, but this is largely not an option I can teach with. Other computers on our network don't give me the same issue, only a specific desktop in my classroom. I have tried uninstalling and reinstalling, trying the new beta build too, but the problem persists. I have also tried deleting all Blender related files on the c drive where it is installed. Any advice greatly appreciated.

Thanks.

Can you add an image of Blender's full window to your question. Might give us a clue as to what's going on! In Blender, Window > Save Screenshot then https://meta.stackexchange.com/questions/75491/how-to-upload-an-image-to-a-post

Hi John
It's giving me this error when I try and insert it...
'Failed to upload image; an error occurred on the server'

That's unfortunate. There's another questioner reporting the same upload error so it looks like a system problem. Does this happen with a completely new Blend file or one saved from one of your other computers? You could also upload a Blend file that is showing the problem: https://blend-exchange.com/help

Thanks for replying John, I've uploaded the file, it happens on both old and new.

Well it's no consolation to you, but I can move both camera and reference image by dragging with the mouse or gizmo without problem here. Have you tried that file on other computers without loading the UI? - Press 'N' in the file selector when loading into Blender and uncheck 'Load UI'.

I couldn't reproduce the issue with the empty image object and one of the camera. However, the scene's active camera is hidden: hidden objects can't be selected and manipulated in the viewport. If that's the one you were having problems with, try to un-hide it first by checking ON its eye icon in the outliner.

Thanks all, I'll try your advice when I get back on the machine after half-term, much appreciated.


text:
Efficient method for putting colormaps into color ramp?
Does anyone have an efficient method for importing color maps into a color ramp?
At the moment I have to get the hex codes for each step in a colorramp.

Anyone know a better idea?

https://blender.stackexchange.com/questions/211601/can-i-use-a-image-texture-node-as-a-colorramp-node

@DuarteFarrajotaRamos I don't think he wants to use a color palette as a ColorRamp here, but wants to convert a color palette into a ColorRamp. The answers should therefore be different.

https://blog.michelanders.nl/2016/12/colorramppicker-new-blender-add-on.html

@TheJeran Take a closer look at my answer. With this solution you don't need to know HEX values or enter them manually somewhere.

Run script to add ColorRamp to specify material
Hex version
import bpy, math

material_name = "Material"  # choose your material_name here

color = [
(0xE76254, 1),  # red = 231, green = 98, blue = 84, alpha = 1, allow lower case
(0xEF8A47, 1),
(0xF7AA58, 1),
(0xFFD06F, 1),
(0xFFE6B7, 1),
(0xAADCE0, 1),
(0x72BCD5, 1),
(0x528FAD, 1),
(0x376795, 1),
(0x1E466E, 1),
]

def to_blender_color(c):    # gamma correction
    c = min(max(0, c), 255) / 255
    return c / 12.92 if c < 0.04045 else math.pow((c + 0.055) / 1.055, 2.4)

blend_color = [(
    to_blender_color(c[0] >> 16),
    to_blender_color(c[0] >> 8 & 0xff),
    to_blender_color(c[0] & 0xff),
    c[1]) for c in color]
color_count = len(color)

for e in blend_color:
    print(e)

mat     = bpy.data.materials[material_name] # choose material name here
tree    = mat.node_tree
nodes   = tree.nodes
node    = nodes.new(type='ShaderNodeValToRGB') # add color ramp node

ramp    = node.color_ramp
el      = ramp.elements

dis     = 1 / (color_count - 1)
x       = dis
for r in range(color_count - 2):
    el.new(x)
    x += dis

for i, e in enumerate(el):
    e.color = blend_color[i]

Dec Version
import bpy, math

material_name = "Material"  # choose your material_name here

color = [
(231, 98, 84, 1),
(247, 170, 88  1),
(..., 1),
]

def to_blender_color(c):    # gamma correction
    c = min(max(0, c), 255) / 255
    return c / 12.92 if c < 0.04045 else math.pow((c + 0.055) / 1.055, 2.4)

blend_color = [(
    to_blender_color(c[0]),
    to_blender_color(c[1]),
    to_blender_color(c[2]),
    c[3]) for c in color]
color_count = len(color)

for e in blend_color:
    print(e)

mat     = bpy.data.materials[material_name] # choose material name here
tree    = mat.node_tree
nodes   = tree.nodes
node    = nodes.new(type='ShaderNodeValToRGB') # add color ramp node

ramp    = node.color_ramp
el      = ramp.elements

dis     = 1 / (color_count - 1)
x       = dis
for r in range(color_count - 2):
    el.new(x)
    x += dis

for i, e in enumerate(el):
    e.color = blend_color[i]

Of course you have the possibility to use an image as color reference.
But if you really want to transfer your color values directly into a ColorRamp without knowing their HEX values, a small Python script will help you.

It simply references an image (previously imported into Blender) by name, determines the color values of the pixels at certain positions and transfers them to a ColorRamp.
All you need for this example is that the color gradient runs horizontally and that you know the number of your colors and enter them into the script.
Furthermore, you have to enter the name of the previously imported image, as well as the name of your material.
In detail the following happens here:

First the dimensions of the image are determined.

Then a reference to the specified material is created and a new node of the type ColorRamp is created there.

In the loop, using the number of color values you specified, the pixel for reading the color is determined.
These color values are then transferred directly to the new positions of the ColorRamp created at the same time.

import bpy
from bpy import data as D

imageFile = "colorramp.png"
materialName = "Material"
colorCount = 10

# Get the reference to the specified image
img = D.images[imageFile]

# Determine height and width of the image
width = img.size[0]
height = img.size[1]

# Get the reference to the specified material
material = bpy.data.materials[materialName]

# Get the node collection of the material
nodes = material.node_tree.nodes

# Create a color ramp node
color_ramp = material.node_tree.nodes.new("ShaderNodeValToRGB")

# Get a reference to the colorRamp node
cr=D.materials[materialName].node_tree.nodes["ColorRamp"].color_ramp

# Set interpolation between color stops to "CONSTANT"
cr.interpolation = "CONSTANT"

# Convert sRGB to linear RGB
def sRGB2linear(s):
    if s <= 0.0404482362771082:
        lin = s / 12.92
    else:
        lin = ((s + 0.055) / 1.055) ** 2.4
    return lin

# Iterate through the colors
for x in range(colorCount):
    # Define the position of the pixel we want to read out
    target = [round(x * (width / colorCount) + width / colorCount/2), round(height / 2)]
    # Determine the index of the pixel to be read out (#RGBA)
    index = (target[1] * width + target[0]) * 4
    if (x > 0 and x < colorCount -1):
        # Add a new position to the ColorRamp
        cr.elements.new(position = 1 / (colorCount - 1) * x)

    # Read the color at the given index and set the color in the ColorRamp
    cr.elements[x].color=(
        sRGB2linear(img.pixels[index]), # R
        sRGB2linear(img.pixels[index + 1]), #G
        sRGB2linear(img.pixels[index + 2]), #B
        1, #A
    )

UPDATE: Added conversion from sRGB to linear.

This looks pretty interesting. I will let you know how it works for me when I try it. Will probably be in two weeks when I return to that task.

@TheJeran I assume that it even fits perfectly for you ;-) You asked for a better and more efficient method, and it doesn't really get much easier than determining the color values automatically.

Finally tested this today. Works brilliantly. Very nice my dude.

@TheJeran ...Thanks for testing! I'm just wondering why you then got happy with an answer where you have to enter the values again by hand. ;-)

I created an addon to use the colormaps from Matplotlib

You can get it here
https://github.com/TheJeran/Blender-Colormaps/

Hi thanks for the answer. This is not a regular forum, according to site rules links to answers are not answers if the link goes missing your answer becomes an empty shell without content. Answers should be substantial and stand on their own without relying on external data like links, videos or images. Instead of having users go through external links could you post your addon as a code snippet here so we don't risk it getting lost. A short description of how it works would be welcome.


text:
Problem when I export my my character to unity
I started to learn Blender this week to make a game in Unity.
I made this bed that can walk, crouch and jump thanks to this video: https://www.youtube.com/watch?v=imbIsNAvUpM&t=302s&ab_channel=Polyfjord

But when I export it to Unity I have that:

I tried to export it in .fbx and in .blend the result is the same.
And for both I got those messages in the console:

Can someone tell me what is wrong and how to fix it please?

I've never used Unity but a quick Google brought up this (long) thread in a Unity forum which appears to fix the tangents issue for the poster there. No idea about the other errors though. We'd need to see the Blend file to look for any issues in it. https://blend-exchange.com/

If you want to create a game asset in Blender the best if you use only one armature which is the parent of one mesh. You can't use Belnder's curves in Unity, you have to convert it to mesh, thats why they don't have normals. I'm not sure, but the self-intersetting problem may be come from that the armatures are children of a mesh object.

Thanks @JohnEason , I will try what is in your link, I upload the blend file.

To add to @FFeller's comment, I don't believe that Blender's modifiers work in Unity either. So anything with a skin modifier on it like the legs won't work.

You need to apply scalle to model in blender and everithing will be ok. tap ctrl A and apply scale.
Here you find more information about exporting to unity https://www.youtube.com/watch?v=5UZ-niuRWz8.

That will not help in this case because it only applies to simple meshes and doesn't address animation problems.


text:
How to record this drawing effect?

I think this effect can be done with Blender grease-pencil.
I understand 3D tracking camera and object.
But how to record the drawing process in Blender?

Your question is alredy pritty good. You can even improve on it to edit your question in a way that it fullfills the last criteria of a good question https://blender.stackexchange.com/help/how-to-ask . And accept answers that solved your question.

After using the greas pencil to create your drawing, you can use the build modifier to animate the draw-in along the stroke.

Yes, the grease pencil objects are fully 3D, so you have to create the drawing, track the camera, render on a transparent background (a sequence of PNG images) and composite them onto your live footage.

You can also create a 3D mesh and use it as surface, to guide your strokes, enabling "surfaces" as stroke placement.


text:
Change start time of camera following a path?
I made a path and have my camera following the path (Shift + A: Curve->Path) based on a youtube tutorial and this question: Camera angle should follow path angle.
However the camera starts following the path at the very beginning of my animation and instead I want the camera to be stationary for the first part and then start following the path in the middle (time-wise) of my animation.  How can I achieve this?
I tried looking in the dope sheet and I see NubsPath and Evaluation Time but I don't really see how to adjust the start time.

Instead of hitting the Animate Path button, you can also set up keyframes on the Offset.
Select your camera, and go into the constraint options. Zero is the curve starting point, so go to the frame you want to start the animation at and click the keyframe button (or  RMB  or I depending on what version of Blender you are using).
Then, depending on the length and direction of your curve, you can set the end keyframe. This may be a negative or positive value depending on how the curve is set.


text:
Use "Add 3D Function Surface" addon via python
I would like to know if there is any way to use the "Add 3d Function Surface" addon via the python interface.
I have an equation that describes a surface in the three-dimensional space that I can use to make a mesh object as described in this answer. What I would like to know is if there is any way to do such a thing via the python interface.
As an example, I would like to be able to do something like:
def mysurface(u, v):
   return numpy.array([u*v, u-v, math.pow(u, 2)])

add_mesh_from_surface_equation(func = mysurface, urange = [0, 10], vrange = [0, 10], ustep = 0.01, vstep = 0.01)

Is it possible to do something like this?

The question you linked to creates a surface described by equations, yet your example code is making a surface based off a numpy array. Which are you trying to do?  If you have actual equations, it should be very simple to call the functions used by the add3d surface function.

As far as I understood from the question that I linked (and from using that addon) it is capable of making a 3D mesh out of a function that parametrizes a surface with a map from R^2 to R^3, i.e., (u, v) -> (x, y, z). You then specify some range and step and the mesh is built. mysurface(u, v) was intended to be that kind of function, mapping 2 values in 3. I just added numpy.array to make it clear it was a vector I meant, but please don't take it literally since I have no idea on how to actually do it! ;)

All of blender's plugins are python scripts, so I looked up the script and was going through it's code when I realized that was a really bad idea.  If you grab the bottom of the top menu bar and pull down it gives you a list of all the commands blender has recently executed. Add a couple surfaces, and voila, it looks like these commands should be a good start to what you want:
bpy.ops.mesh.primitive_z_function_surface(div_x=20, div_y=17)
bpy.ops.mesh.primitive_xyz_function_surface(x_eq="cos(v)*(1+cos(u))*sin(v/3)", z_eq="sin(v)*(1.3+cos(u))*sin(v/8)")

They can be used in a script (blender's user interface uses python, so everything that shows up in the command list is valid python), just don't forget to import bpy.


text:
Transparent blue plastic material which emits light
Hi I am creating a Doctor who Sonic screwdriver model in Blender and am having difficulties creating the material for the blue light on the end.  Preferably I'd like one material which emits light and one which doesn't.
Reference pic for without light:

Honestly I don't really like the pics on Google of it emitting light
Here's a video in which you can see it with the light on
https://www.youtube.com/watch?v=KgSgplNgpmw#t=58
Any help is much appreciated!

I would use two objects (or separated parts of the same object), the emitting object being separate from the cover.
As far as the materials go, it depends on how much you want to fake it to increase render times/decrease noise.
Realistic
A realistic setup is probably the simplest, with just a simple emission shader for the emission object and a glass shader for the cover.
I've used clipping border (⎇ AltB) to give you a cut away view of the objects:

The main thing to note is that the cover is not solid, it is hollow (this can be done with a quick solidify modifier). The reason this is important as it has a large impact on the way light is refracted through the cover.
With some simple compositing to simulate the way a camera will behave when exposed to a bright light source (bloom), a nice glow can be achieved:

The downside to this is that it will produce a lot of noise. This image was rendered with 1000 samples, but as you can see it still needs some more:

Fast/less noisy
This is more complicated, but should help rendertimes by reducing the amount of noise at the cost of physical accuracy.
There are probably several ways to optimize such a setup, but here's one of them:
The main point here is that a point lamp is used to do the actual illumination  instead of the emission mesh.
The point lamp is also not refracted, it's light is allowed straight through the cover, but absorbed where the cover mesh is thicker (kind of faking those nice caustics from the "realistic" example)
To make sure the volumetrics don't cause too much of a slowdown, make sure volume sampling is set to Equiangular and that Homogeneous is enabled on the cover material:

Rendered in 200 samples:

As you can see, there is still a little noise, mostly caused by the mesh light which is emitting light that gets refracted/reflected by the cover. I couldn't immediately think of a solution which would make the mesh light only illuminate the inside of the cover, and not refract outwards.
The only reason the mesh light isn't making as much noise as in the "realistic" render is that it is dimmer than in the realistic version. This isn't very noticeable though, since the lamp provides plenty of light.

I think I'll have to go with the less realistic as I'm using hdri lighting which seams to increase my render times significantly.  How did you create your lens? looks much better than my simple half sphere.  This is my first project in blender, by the way, so I'm really new to all this... thanks so much for the help with everything!

@Kittenmittons I just extruded random face loops until it looked detailed.. I'll upload the .blends for you to play with :)

hehe, it's ok I managed to get something similar :)  My display seems to be a bit different...I don't have the equiangular and homogenous settings under settings in the materials pane ???

http://gyazo.com/92c844149d3a6b4463751c3e6a8a2e7a < screenshot of my materials pane

@Kittenmittons Looks like you are using 2.71. Try updating to 2.72 :)

Yes using two materials is the right choice. in cycles render, very simple setup.
Just a simple glass shader, colored blue, and an emission, yellow-white.
adjust the roughness and lighting for tweaks.


text:
How can I get the camera's projection matrix?
As asked.
I need a way to get the projection matrix of the active camera, via python.
EDIT: I think this question is different from the one asked here, because getting a matrix is different from setting the matrix.
Although, since this question was so quickly marked a duplicate, I guess the answer is the same.

Yes. Getting is indeed not the same as setting, but AFAIK neither is possible through the python api.

Your other question convinced me that getting is not the same as setting.. Voted to re-open.

Thanks. When re-opened, I'll be able to provide an answer for this question (I basically just ported a chunk of C code that creates the perspective matrix, and that seems to produce desired results).

With some helpful references from Campbell (ideasman42), I was able to find the relevant Blender C code that creates the perspective matrix (from properties that were actually available via bpy), and I managed to port it to Python:
def view_plane(camd, winx, winy, xasp, yasp):
    #/* fields rendering */
    ycor = yasp / xasp
    use_fields = False
    if (use_fields):
      ycor *= 2

    def BKE_camera_sensor_size(p_sensor_fit, sensor_x, sensor_y):
        #/* sensor size used to fit to. for auto, sensor_x is both x and y. */
        if (p_sensor_fit == 'VERTICAL'):
            return sensor_y;

        return sensor_x;

    if (camd.type == 'ORTHO'):
      #/* orthographic camera */
      #/* scale == 1.0 means exact 1 to 1 mapping */
      pixsize = camd.ortho_scale
    else:
      #/* perspective camera */
      sensor_size = BKE_camera_sensor_size(camd.sensor_fit, camd.sensor_width, camd.sensor_height)
      pixsize = (sensor_size * camd.clip_start) / camd.lens

    #/* determine sensor fit */
    def BKE_camera_sensor_fit(p_sensor_fit, sizex, sizey):
        if (p_sensor_fit == 'AUTO'):
            if (sizex >= sizey):
                return 'HORIZONTAL'
            else:
                return 'VERTICAL'

        return p_sensor_fit

    sensor_fit = BKE_camera_sensor_fit(camd.sensor_fit, xasp * winx, yasp * winy)

    if (sensor_fit == 'HORIZONTAL'):
      viewfac = winx
    else:
      viewfac = ycor * winy

    pixsize /= viewfac

    #/* extra zoom factor */
    pixsize *= 1 #params->zoom

    #/* compute view plane:
    # * fully centered, zbuffer fills in jittered between -.5 and +.5 */
    xmin = -0.5 * winx
    ymin = -0.5 * ycor * winy
    xmax =  0.5 * winx
    ymax =  0.5 * ycor * winy

    #/* lens shift and offset */
    dx = camd.shift_x * viewfac # + winx * params->offsetx
    dy = camd.shift_y * viewfac # + winy * params->offsety

    xmin += dx
    ymin += dy
    xmax += dx
    ymax += dy

    #/* fields offset */
    #if (params->field_second):
    #    if (params->field_odd):
    #        ymin -= 0.5 * ycor
    #        ymax -= 0.5 * ycor
    #    else:
    #        ymin += 0.5 * ycor
    #        ymax += 0.5 * ycor

    #/* the window matrix is used for clipping, and not changed during OSA steps */
    #/* using an offset of +0.5 here would give clip errors on edges */
    xmin *= pixsize
    xmax *= pixsize
    ymin *= pixsize
    ymax *= pixsize

    return xmin, xmax, ymin, ymax

def projection_matrix(camd):
    r = bpy.context.scene.render
    left, right, bottom, top = view_plane(camd, r.resolution_x, r.resolution_y, 1, 1)

    farClip, nearClip = camd.clip_end, camd.clip_start

    Xdelta = right - left
    Ydelta = top - bottom
    Zdelta = farClip - nearClip

    mat = [[0]*4 for i in range(4)]

    mat[0][0] = nearClip * 2 / Xdelta
    mat[1][1] = nearClip * 2 / Ydelta
    mat[2][0] = (right + left) / Xdelta #/* note: negate Z  */
    mat[2][1] = (top + bottom) / Ydelta
    mat[2][2] = -(farClip + nearClip) / Zdelta
    mat[2][3] = -1
    mat[3][2] = (-2 * nearClip * farClip) / Zdelta

    return sum([c for c in mat], [])

This call: projection_matrix(camera.data) will return the perspective projection matrix of the given camera object.
I don't know what the "fields" data is supposed to be, so I've set use_fields to False, and I didn't port the "fields offset" block (which you can see commented out, in view_plane function). Regardless, the resulting projection matrix seems correct, so I guess it's not all that important (for most people).

There is actually a better method than rolling your own code, as shown here:
    modelview_matrix = camera.matrix_world.inverted()
    projection_matrix = camera.calc_matrix_camera(
            render.resolution_x,
            render.resolution_y,
            render.pixel_aspect_x,
            render.pixel_aspect_y,
            )

Doesn't the first line calculate the world->view matrix?

I've personally used this code and it does appear to work as expected: https://github.com/kurocha/tagged-format/blob/283d9bb1c917684724ad5d7e92f3609e33c155bc/exporters/Blender/io_tagged_format.py#L176-L193

in 2.8 the calc_matrix_camera now requires depsgraph argument, which is on;y available in context, but not from cli.

Why do you think they changed public method? Can you use bpy.context?

Yes to be clear depsgraph = bpy.context.evaluated_depsgraph_get(), but apparently not available when running from the cli (background mode)

Starting from the answer of ioquatix (Thanks), I elaborated a more complete and self-contained solution.
The following function takes a camera, a point, and a render, and computes the 2d homogeneous coordinates.
An example of conversion to Pixel coordinates follows in the main code.
2.79
# Small code and example to Project a 3D point into 2D pixel coordinates.
# Fabrizio Nunnari <fab.nunnari@gmail.com>
#
# Related links:
# - https://blender.stackexchange.com/questions/16472/how-can-i-get-the-cameras-projection-matrix

import bpy

from mathutils import Vector

def project_3d_point(camera: bpy.types.Object,
                     p: Vector,
                     render: bpy.types.RenderSettings = bpy.context.scene.render) -> Vector:
    """
    Given a camera and its projection matrix M;
    given p, a 3d point to project:

    Compute P’ = M * P
    P’= (x’, y’, z’, w')

    Ignore z'
    Normalize in:
    x’’ = x’ / w’
    y’’ = y’ / w’

    x’’ is the screen coordinate in normalised range -1 (left) +1 (right)
    y’’ is the screen coordinate in  normalised range -1 (bottom) +1 (top)

    :param camera: The camera for which we want the projection
    :param p: The 3D point to project
    :param render: The render settings associated to the scene.
    :return: The 2D projected point in normalized range [-1, 1] (left to right, bottom to top)
    """

    if camera.type != 'CAMERA':
        raise Exception("Object {} is not a camera.".format(camera.name))

    if len(p) != 3:
        raise Exception("Vector {} is not three-dimensional".format(p))

    # Get the two components to calculate M
    modelview_matrix = camera.matrix_world.inverted()
    projection_matrix = camera.calc_matrix_camera(
        render.resolution_x,
        render.resolution_y,
        render.pixel_aspect_x,
        render.pixel_aspect_y,
    )

    # print(projection_matrix * modelview_matrix)

    # Compute P’ = M * P
    p1 = projection_matrix * modelview_matrix * Vector((p.x, p.y, p.z, 1))

    # Normalize in: x’’ = x’ / w’, y’’ = y’ / w’
    p2 = Vector(((p1.x/p1.w, p1.y/p1.w)))

    return p2

#
# Test

camera = bpy.data.objects['Camera']  # or bpy.context.active_object
render = bpy.context.scene.render

P = Vector((-0.002170146, 0.409979939, 0.162410125))

print("Projecting point {} for camera '{:s}' into resolution {:d}x{:d}..."
      .format(P, camera.name, render.resolution_x, render.resolution_y))

proj_p = project_3d_point(camera=camera, p=P, render=render)
print("Projected point (homogeneous coords): {}.".format(proj_p))

proj_p_pixels = Vector(((render.resolution_x-1) * (proj_p.x + 1) / 2, (render.resolution_y - 1) * (proj_p.y - 1) / (-2)))
print("Projected point (pixel coords): {}.".format(proj_p_pixels))

print("Done.")

2.8
import bpy

from mathutils import Vector

def project_3d_point(camera: bpy.types.Object,
                     p: Vector,
                     render: bpy.types.RenderSettings = bpy.context.scene.render) -> Vector:
    """
    Given a camera and its projection matrix M;
    given p, a 3d point to project:

    Compute P’ = M * P
    P’= (x’, y’, z’, w')

    Ignore z'
    Normalize in:
    x’’ = x’ / w’
    y’’ = y’ / w’

    x’’ is the screen coordinate in normalised range -1 (left) +1 (right)
    y’’ is the screen coordinate in  normalised range -1 (bottom) +1 (top)

    :param camera: The camera for which we want the projection
    :param p: The 3D point to project
    :param render: The render settings associated to the scene.
    :return: The 2D projected point in normalized range [-1, 1] (left to right, bottom to top)
    """

    if camera.type != 'CAMERA':
        raise Exception("Object {} is not a camera.".format(camera.name))

    if len(p) != 3:
        raise Exception("Vector {} is not three-dimensional".format(p))

    # Get the two components to calculate M
    modelview_matrix = camera.matrix_world.inverted()
    projection_matrix = camera.calc_matrix_camera(
        bpy.data.scenes["Scene"].view_layers["View Layer"].depsgraph,
        x = render.resolution_x,
        y = render.resolution_y,
        scale_x = render.pixel_aspect_x,
        scale_y = render.pixel_aspect_y,
    )

    # print(projection_matrix * modelview_matrix)

    # Compute P’ = M * P
    p1 = projection_matrix @ modelview_matrix @ Vector((p.x, p.y, p.z, 1))

    # Normalize in: x’’ = x’ / w’, y’’ = y’ / w’
    p2 = Vector(((p1.x/p1.w, p1.y/p1.w)))

    return p2

camera = bpy.data.objects['Camera']  # or bpy.context.active_object
render = bpy.context.scene.render

P = Vector((-0.002170146, 0.409979939, 0.162410125))

print("Projecting point {} for camera '{:s}' into resolution {:d}x{:d}..."
      .format(P, camera.name, render.resolution_x, render.resolution_y))

proj_p = project_3d_point(camera=camera, p=P, render=render)
print("Projected point (homogeneous coords): {}.".format(proj_p))

proj_p_pixels = Vector(((render.resolution_x-1) * (proj_p.x + 1) / 2, (render.resolution_y - 1) * (proj_p.y - 1) / (-2)))
print("Projected point (pixel coords): {}.".format(proj_p_pixels))

print("Done.")

The Y coordinate returned from project_3d_point is correct w.r.t. the usual image convention, i.e. upper-left pixel is (0,0), but is inconsistent with the Y coordinate shown in Blender on a rendered image when inspecting pixels in the image view. This is because in a rendered image (0,0) is the bottom-left pixel.

Regarding QwiglyDee's problem with depsgraph, I was able to retrieve it with the following expression: bpy.data.scenes["Scene"].view_layers["View Layer"].depsgraph You may need to adjust if you have different scene or view layer names. Also, it appears matrix * matrix no longer works; now it looks like it's matrix @ matrix.


text:
Rotating wheel with rigid body dynamics
In my scene I have a wheel shaped cylinder with rigid body dynamics attached to it. I also have a floor with passive rigid body dynamics. Now what I want to achieve is to have the wheel spinning while it falls down to the plane, to then get grip and roll off the plane. I already tried these three scenarios.

Rotating the wheel using an animation. In this scenario the animation doesn't play anymore once the dynamics kicks in. Checking the "Animated" option in the rigid body settings eliminates the gravity effect.
Using a shape key to rotate the wheel. This doesn't work either because the shape keys deform the object in the transition.
Using bones but this gives the exact same result as using animation.

I'm sure there is a ways so I am curious to hear your suggestions.
UPDATE:
Animating the "Animated" checkbox works partly. So the "How can I add motion to an object" does not work as I tried it already earlier. Rotation is lost eventually and I need it to work like a motor.

Related: http://blender.stackexchange.com/q/2518/599 and http://blender.stackexchange.com/q/21710/599

In the rigid body world there is a rigid body constraint 'motor', this is assigned between two rigid bodies.
What you need is:

The original wheel - active rigid body
An object to push on (a simple cube) - passive rigid body - constrained to the original wheel (hidden inside for example)
An empty - rigid body motor constraint: angular motor - also constrained to the original wheel

Now the wheel is motorised and will drive itself across the ground plane.
Hope this helps!

Thanks! That's exactly what I was looking for. Works like a charm.

thanks then how do i connect


text:
heightmap from textures and hight poly mesh to apply to low polly mesh?
i want the height map from the textures but I also want the heightmap from the high poly mesh so I can apply it to a low poly mesh. I want both in one heightmap but I don't know how to. please help

If I understand what you want correctly, you could bake a normal map based on the difference between the low-poly mesh and the high-poly one, and then use it in combination with your other hightmap.

@gandalf3 I think he want's a displacement map. He has a high-poly mesh with a displacement map and wants to bake the high-poly+displacement to a low-poly mesh.

The basics:

Apply your texture as a normal map to your highpoly mesh.
Unwrap the lowpoly mesh and add an image to it (to bake to).
Select the highpoly, add the lowpoly to the selection (important to do this last). Bake normals.

With images:

Highpoly + lowpoly meshes

Test render of highpoly + texture

a voronoi texture applied as normal map

Bake setup and result.

And also, to add to all of that.
(i) You can use the technique above to bake a height map as well.
(ii) You can also heavily subdivide a mesh using the multires modifier and then apply the texture to a displace modifier.  This will help for baking height maps as well as normal maps.
You will have to twiddle those bias and distance settings for baking selected to active.  They are very difficult to configure on curved surfaces.
EDIT: I almost forgot about the following setup.  It's for baking a height map using Cycles.  It was posted on BlenderArtists.org a while back.  Currently it only works for planer projection, not curved meshes, but when the situation is appropriate, it generates flawless height maps.
http://blenderartists.org/forum/showthread.php?273033-Sculpting-with-UVs-and-displacements/

okay. so this worked but it can only be an "open mesh" (I think that's the term used) so like. a cube wont work but a plane will. could you show me how to do this on a "closed mesh" please?

Interesting, I just showed up here because I wanted to explain this to someone else and there is fairly new comment from you that I was not notified of.  Good timing.  I'll get back to you on this.

There is no Cycles baking of true displacement yet for curved 3D objects, not officially.  I've been doing a black and white bake with no Margin overdraw to accomplish this.  Save out this mask and load it in again and apply it to a plane.  Now setup an orthographic camera so that it perfectly captures only this plane.  Now build geometry using the UV islands shown on the plane as a guide and finish this with a camera render as shown above.  Now apply this rendered depth map to your mesh as a Displace texture using the UV setting in the modifier.

See my question here for further details on how to do this.  http://blender.stackexchange.com/questions/14074/is-there-a-way-to-convert-a-meshs-uvs-into-a-seond-mesh-using-a-script


text:
Change color of texture with vertex paint
I have a texture that is grey scale and another with alpha. I used the second images alpha to make parts of the first image transparent. Is there anyway i can affect the color of the grey scale image to use the various colors i have on the vertex painted mesh?

Could you please reformulate your question?


text:
Render Settings for 32 Cores
I have an old server with an Intel Xeon CPU with 32 cores. What are the best render settings to use these many cores so that it renders fast?

Rendering scales linearly with number of cores. So render setting for X cores is the same as for 1 core.

I would change the tiles size to 8 x 8.


text:
Can't change to smooth shading
I am building a car engine and I want to set it to smooth shading. But for some reason it does not work.
Has anyone an idea how to fix that?

Here you can download the .blend file.

You have an edge split modifier which is causing the faces to look like they are not smooth shaded, but they are.
The edge split modifier is splitting the surface into individual faces so it is no longer a single surface that can be smoothed.
Increase the edge split angle on the modifier to reduce this effect.

Ohhhh, yes how could I forget about the split angle. It was too small. Thanks!

@Codey If this answer helped you, you can mark it as 'accepted' by clicking the tick icon to the left of the answer.

Sorry, I forget about that ;)


text:
Bevel modifier not working properly
I have an object on which I want to apply a bevel modifier. After applying, no matter how high I increase the Width, the bevel stays the same.
About the object:

I've imported a .svg and then converted it to 'Mesh from Curve'
In Edit Mode: Select all Faces → Mesh → Faces → Beautify Fill
Select all Faces → Mesh → Delete → Limited Dissolve
Then I extruded the Object and now I want to create a bevel

You can get the .blend file here.
What I want to achieve is this:

Anyone an Idea?

You can also directly apply a depth and extrude parameter to the Curve object. This keeps the curve object editable. And it gives cleaner result:

The 'Clamp Overlap' option is enabled on the modifier. Un-check this to have a bigger bevel.
I would then suggest immediately setting the bevel back to 0 as the current value will be very large.
Use Shift while dragging on the bevel width value to increase the value slowly.

Yes, that did it, but I the bevels are now really crazy. https://www.mediafire.com/?odjqx9m52bb2f9f I think the bevel modifier is a bit confused by the many vertices. You have an idea how to fix this?

You can try turning on the 'angle limit' option and this may help, but this may just be a limit of the modifier when trying to do a bevel that large.

@BlenderShark The Clamp overlap option makes sure bevels don't extrude through each other (as in your screenshot). Try leaving it enabled and selecting specific edges to be beveled (with bevel weight or vertex groups).

The best result I could come up with was from using two bevel modifiers, with vertex groups to limit them to the outer or inner edges. Along with some small geometry changes this prevents the bevel being applied to edges spanning the flat surfaces or sides that was causing artifacts.

I also shaded smooth and added an edge split modifier. The modified file is available here.


text:
how to report missing files in a list, usable in python script?
Is there any simple way to get all missing .blend libraries, in a python list, set, tuple or dictionary?
The operator bpy.ops.file.report_missing_files() only prints this list in the console. If I put it in a variable, the only thing I have is a set: {'FINISHED'} !! To illustrate:
missing_libs = bpy.ops.file.report_missing_files()
# missing libraries are printed in the console at this point, one line a file
print(missing_libs)
# prints {'FINISHED'} in the console

Ideally, I want to be able to do, for example:
nb_missing_libs = len(missing_libs) # get the number of missing libraries
for mlib in missing_libs:
    if ".blend" in mlib:
        # Do something with mlib

Is there a fast and easy way ?

You could try a variation of the following code:
import bpy
import os

def list_missing_blend_libs():
    return [bpy.path.abspath(lib.filepath) for lib in bpy.data.libraries
            if not os.path.exists(bpy.path.abspath(lib.filepath))]

Using bpy.path.abspath, it only lists absolute path of missing libraries in bpy.data.libraries.