Can I use template_preview in operator dialog? I have the following in an Operator but it causes an "Error: EXCEPTION_ACCESS_VIOLATION" with no further details.  I think (more of a guess) that the template_preview is trying to lookup/find in the region and that is returning null.  Other than adding debug code to the .c code is there a way to find out?

class BigPreview(Operator):
    bl_idname = "myaddon.big_preview"
    bl_label = "Big Preview"

    def execute(self, context):
        print("Running big preview")
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        print("Invoke big preview")
        return wm.invoke_props_dialog(self, width=600, height=600)

    def draw(self, context):
        layout = self.layout
        layout.template_preview( context.material, show_buttons=False, preview_id="corona.big_preview")

I asked re context.material and where you are running this from as the following works for me.

Well to some extent, in that the popup height is not taken up entirely by the preview at times.

Dragging the resize widget ("=" above the Ok) will crash if the check method returns True (enables popup redraw) & throws the error "context object has no attribute "material"" ... or crash blender.

Hence I went for context.object.active_material. (or somehow other than context.material)

If you find the height not right, can add the col.scale_y = 3 to give area to drag resize, then press again to see resize... trying to resize "live" in a popup appears very dodgy (speed wise) on my system.

import bpy
from bpy.types import Operator
class BigPreview(Operator):
    bl_idname = "myaddon.big_preview"
    bl_label = "Big Preview"

    def execute(self, context):
        print("Running big preview")
        return {'FINISHED'}

    def check(self, context):
        return False

    def invoke(self, context, event):
        wm = context.window_manager
        print("Invoke big preview")
        return wm.invoke_props_dialog(self, width=600, height=400)

    def draw(self, context):
        layout = self.layout
        mat = context.object.active_material
        col = layout.column()
        #col.scale_y = 2
        col.template_preview( mat, show_buttons=False, preview_id="corona.bigpreview")

def draw_button(self, context):
    self.layout.operator("myaddon.big_preview")

bpy.types.MATERIAL_PT_preview.append(draw_button)

bpy.utils.register_class(BigPreview)


A strange bias for Vertex Weight Edit Modifier I would like to modify my vertex weight using a texture.
To do so, I found out here that I can use the Vertex Weight Modifiers for this job.
However, I am facing a problem that there is a strange bias in the vertex weights. Please help me remove it.

As you can see in the left of the picture below, I painted the uv white in the middle and black as around it. What I expected to happen was that the white will assign a vertex weigh of 1 and the black a 0. That also means that I expected to see a weight painting with red in the middle and blue in the margin.

However, what came out is the weight painting in the right. I am not sure what value green and yellowish green implies but I am quite sure that none of them are 0 nor 1.

As a summary, my requirements are

I would like to edit the vertex weight via texture
I would like to assign weight 1 for white and 0 for black

while

White and black would NOT be 1 and 0

I am not quite sure(I would have to go under several more trials) but I think I solved it.

It can be achived by Switching the Fall off type to Custom Curve and let the Curve always be 1.
As for Default weight, set it to 0.

EDIT:

I managed to get this right so I would like to share the techniques to edit your VERTEX WEIGHT with TEXTURES.

First, I would explain how to do this and later explain how this technique can be helpful. We will be using the Vertex Weight Edit modifier.

Note that I am not sure whether this is what the developers expected to happen. In other words, this might be a manuever of a bug and may be changed in the future version of blender. As, you might have noticed, this modifier is one of the most ignored modifiers. But as for certain, this worked fine on my Blender 2.79 (Hash: 5bd8ac9).

Let's start with a very simple plane.

Divide it up to any number, say 10*10. The number of division is directly connected to the resolution.

Next, make a new vertex group. Please make sure the weight is set to 0. I named this group, texture_weight.

The next step is unwrap it to make a UV map and a texture. I named the UV map : weight_uv, the texture : weight_tex.

As you can see in the picture below, I painted a white circle with 1.0 strength.

Then, add the Vertex Weight Edit modifier.
This modifier is placed at the first column, 3rd from the bottom.

Before explaining the settings in detail, take an overview of them in the image below.

So, let's examine the settings in detail.

1. Vertex Group

I think it's rather obvious what we need to do here. Set the vertex group (named texture_weight).

2. Fall off type

I don't understand why, but it seems that all vertecies in the texture_weight will be effected by the curves y-value when x = 0.

Let me be more precise.

When the variables are as follows;

Col : the intensity of the color (assigned to a vertex by the texture),
OrW : the original weight of the vertex group (you can set them when assigning)
Glo : the Global influence, which you can change at the panel,
Y_0 : the y-value of the curve when x = 0,

the final outcome weight is (OrW + (1-OrW)*Col) * Glo * Y_0.

This formula may seem complicated but the meaning is rather simple. (See the drawing below)

3. Applying UV and Texture

Make sure 4 of the settings are appropriate.

Texture Mask : Set the texture you want to apply. (weight_tex)
Texturte Coordiantes : Set it to UV.
Use Channel : Set it to whatever you want. This will influence whether the Col (in the formula) mean "intensity" or something else. I will stick to the Intensity.
UV Map : Set the UV you want to apply. (weight_uv)

And if you (or me) haven't skipped anything, that will give you this wonderful screenshot.

Usage of this technique

I am rather confident that most of you have wondered why;

this is useful and
these screenshots show some spaces above the plane.

Well, take a look at these:
https://imgur.com/a/9BTMP (I cannot insert the images because I will reach the limit)

As you can see, I actually reshaped my plane so that it can be easily be modified with the texture. I used a combination of Mask modifier and Solidify modifier. (setting the vertex group of the Solidify enables you to manipulate the height)

So, what? Is this technique something different from using Displacement Modifiers?

The answer is absolutely yes.

First, this makes an Solid object while, Displacement Modifiers can only make distorted planes.

Second, thanks to the Mask modifier this erases unwanted vertecies, while Displacement leaves them untouched.

I'll leave a sample file. Hope this will help you in some ways.


Armature not moving with mesh https://mega.nz/file/2lQGjD6T#YIr1GouvxZlPXPB_FL1qWfF1fShevNgNnRCrYO5wIC4
i tried everything but ive been trying to parent the mesh to the armature but nothing works
(the file was made in 2.79 and i tried this both in 2.8 because this is for a game)
(this has weights)
if anybody can help i would love it

Check that the armature modifier is active on your mesh.
check that the armature name is correct, check that there are vertex groups that match your bone names and check that the bones in your rig are set to deform.  Or it may be because your armature in object mode is moved off center and rotated.


Motion Tracking - Link track to empty and move camera instead of empty I have some footage that I've added a single tracking point to and linked it to an empty. This successfully moves that empty in my scene in relation to the tracker and I can add objects into the scene and parent them to those empties and they stay in position. However, some of the objects I'm adding are in motion and have particle trails, and the trails do not behave correctly since the objects are moving around based on the movement of the empty, as well as their own keyframe animations. Is there a way to invert the "track to" constraint on the empty so that the translation of that empty is inverted and applied to the camera so that the camera is translating, and the empty is "pinned" to its initial position?

I did something similar to this to avoid having to do full camera solving and achieved it by converting the track into an f-curve and then using the scale tool to invert the track (scaling by -1 in the y-direction) for each of the channels. This produced an empty that moved in the opposite direction to the original footage which I could then track the camera to. This can be achieved as follows :

Create a new Empty to act as the target and add a 'Track To' constraint. Uncheck the 'Active Clip' checkbox and select the relevant the Movie Clip containing the track. Set the Object, Track, and Camera. This should result in the Empty following the chosen point in the footage.

Click the 'Constraint to F-Curve' button in the Constraint panel. This will remove the constraint and convert it into an F-Curve on the empty so we can then manipulate the F-Curves.

Select the Empty and open a Graph Editor window and make sure the mode is set to 'F-Curve. You should see F-Curves for its X, Y, and Z locations.

Press 'A' until none of the graphs are selected (each press will toggle all or none). Right-Click on the 'X Location' curve to select a point on it. Press 'L' to select all linked points (ie, the whole curve). Press 'S', 'Y', '-1', Enter to scale it by a factor of -1 in the Y direction only. Repeat for the 'Y' and 'Z' curves. This will reverse the direction of motion for the empty in each direction.

Select the camera and add a constraint to Track To the empty and the camera should now mimic the motion in the original footage (rather than its inverse).

If you need to adjust the point at which the camera is pointing you can use the F-Curve editor to select one of the curves again and move the entire curve up or down (right-click curve, press 'L' to select the whole curve, 'G' then 'Y') to adjust the position.


Go Back to Default 2D Animation Window When I start Blender and select 2D animation, I get the window of the white canvas against a dark grey background.  When I accidentally scroll, the whole thing shifts and I go into 3D mode and I seem unable to get that canvas back with the white against the dark grey.

The only solution I currently am able to do is close the window and reopen a new default 2d animation work space, but I think there must be a better way than that.

Thanks.

Yes, there is an easy way.

The view you get initially is through the camera in a white background. The dark grey is the passepartout of the camera.

One way it to click the camera icon:

or the shortcut Numpad 0 to enter the camera view.


Is it possible to perform operations individually to faces? I would like to know if it is possible to perform operations (extrude and scale mainly) to individual faces as opposed to groups of faces.

Currently when I select these faces...

And extrude, I get this:

I would like to know how to get this:

Setting the pivot point to Individual Origins doesn't work either for contiguous selections of faces.

I often need to do this kind of extrude+scale to lots of faces at a time, so it is simply not efficient (bordering on impossible) to do them one at a time as I did for the example.

You can press ⎇ AltE> Individual faces to do this:

There is also a button in the tool shelf under Tools > Mesh Tools > Add:


Can anyone explain why my normals have a mind of their own I've tried flipping them, recalculating them and remaking the faces but i cant understand why the mesh still appears hollow, any ideas would be much appreciated

Normals could have nothing to do with this: I think it's just a viewport visualization issue, due to the extremely wide clip you set in this file:

that's a huge clip interval you set! from 1 mm to 10000 km!

see what happens setting it on a smaller scale, like from 1 mm to 1 km!

...your mesh is interpreted as it should... isn't it?

Explain why this happens is outside of my knowledge, but I can suggest to leave clipping limit around "reasonable" limits, depending on the scene you are trying to visualize.


Array - clock face issue I am following the concept of using the array modifier on an object, using an Empty axis, to create 12 points on a clock face.
I have failed to get to the point of turning the axis to create each new object copy.
The issue is that as soon as I select the Empty as the Object Offset, I get exponential creation of cube objects with huge dimensions.
I thought I had set everything correctly on my object.
The cube object dimensions are .002m x .040m y .001m z
This is .11615 up the Y axis.
The Empty is at the 0 origin point
The Array modifier on the cube has a Fixed Count of 12 with Relative Offsets ticked and set to 0
As soon as I tick the Object Offset with the Empty object, I get the huge object dimensions created (eg the X dimension is 1999999878979204987924730871808 m!!!!!)
I have attached images of the object, empty, and result of Object Offset.
Also, I have saved a version of my issue, without the Object Offset ticked, at https://www.dropbox.com/s/b961mhcttzhbzfq/stack.blend?dl=0
I realise I will be missing something simple but have not spotted this in videos I have seen online.

You need to go to the cube and enter Ctrl + A and hit scale to apply the scale of the object, this is to avoid the size issue. However this does not completely solve the issue because when you rotate the empty by a whopping -800 degrees on the Z axis it is off centered and the rotation is not right as seen below.

To fix this, remove the empty as the object offset of the cube, and put the cursor with Shift + S in the center of the selected cube. Then create a new empty and make it a child of the empty at the center of the scene by clicking the new empty and Shift selecting the empty in the center then hitting Ctrl + P > Object.

Afterwards make the Object Offset in the array the new empty at the center of the object. Now you can rotate the center empty by 30.1 degrees (360 degrees / 12 pieces, the added 0.1 makes it more centered somehow).
EDIT: 30.0939 is the precise rotation seems like.
The final result should look like this with no weird rotations.


Old school material shader (ambient, diffuse, specular) I recently migrated to the new blender and can't find the old way to use material by choosing the ambient, diffuse and specular color (example image of what I'm looking for).
Is there a way to get it back?
I tested to import a wavefront file and export it directly, it change the colors inside the .mtl

Its not the same, but there are similar parameters in the new eevee renderer.
Using the Specular shader you can tweak diffuse + specular color.

Via world properties -> color you can tweak the ambient color

Also accesible in shader editor:


is there any way to make annotations snap to a mesh? Is there any way I could use the grease pencil snap to the face of a model/plane?
For example:

but then if I change the perspective the annotation is floating where it shouldn't

It would be much more useful if it could snap to faces, Is there any way I could do this?

Open the Tool Shelf in the 3D View.

Go to the Grease Pencil rider and under Stroke Placement select Surface.

Edit : For blender 2.8 it is in the popover menu.


How do I perform multiple extrusions around a spiral? I managed to select the same edges on most of the objects using select>select similar by face angles. Is it possible now to extrude all of them straight outwards from themselves?

[

You could use an array modifier to make a millipede, that way you don't have to mold all of the legs individually, but just once.

starting with a spiral (I used the AddCurve:Extra Objects add-on)

then create the base object:

Add an array modifier, set the fit type to Fit Curve and select the spiral as the curve object:

Add a Curve modifier and select the spiral as the object.

Select a few opposing faces on your face object and do Extrude Individual.
To shape the legs.

When you exit edit mode you should get something similar to this.

You could also add a new object to be used as the head

and select it to be used as the end of the array (maybe you could use a tail object as well, I don't know anything about entomology..)

The beauty of working with modifiers is that you can go back and edit the main object and reedit as much as you want and all of the instances on the array will be modifies as well. If you edit the spiral curve then all of the array will follow.

Adding an empty and using it as object offset on the Array modifier will allow you to scale it so the back of it is larger than the front.


Knife tool perpendicular cut While working in maya for a long time, i'm slowly start to explore blender and adore it tools, but when i start using knife tool i couldn't find an option that been used all the time in work, and it's making 90 degrees cuts without switching into ortho views or align view to the face or an edge T_T. There are couple of old threads about it, and it's really bugging me why this simple and very handy option still not implemented? Is there an addon for it?
update: i have added a gif for a better representation of what i'm looking for

[![enter image description here][2]][2]

There is a way to do this in blender. Its not as good as the one on maya (as much as I hate to say it...) but it works
Now this is on a mac so the shortcut is different
So here is a picture of the very bottom of your screen when you use the knife tool:

In the middle you should see something that says midpoint snap. This snaps your cursor to the middle of the nearest edge. The shortcut will be to the right side of the text. For me, it is the symbol ^/^ (which is control on mac) When you use it, it will only connect to the middles of edges, so it is basically 90 degree tool. Once you do this, use an edge slide (press g twice while an edge is selected) and move it to your desired location
Hope this helps.


Selection Behavior and Limit Selection to Visible Is this a bug or am I doing something wrong? Is there something I can test?

I am following the Blender 2.6 Manual with 2.68 Blender on Mac 10.6.8. Here I try to give life to the Gingerbread Man. However, the things that are explained under "Selection Behavior and Limit Selection to Visible" are understandable, but when I try to erase stacked vertices like described,

  You must have the Limit Selection to Visible button unselected to continue this
  tutorial.

  Now press B to activate Box Select/Border Select mode. The cursor will
  change to a couple of orthogonal grey lines. Move the cursor above the
  top left corner of the cube, press and hold LMB, then
  drag the mouse down and to the right so that the grey box encompasses
  all the leftmost vertices. Now release the LMB. The
  sequence of Box selecting a group of vertices.

  The pop-up menu of the Delete (X) action.

  Press X, and from the popup menu select Vertices to erase the selected
  vertices.

I only erase vertices, and I see in the front and the vertices below are not erased. Doing this by hand and following the tutorial, next time I am not able to able to extrude arms of the Gingerbread man, because again every extrusion I try is only applied on the interior vertex (I changed the view to show the problem).

Now with highlighted box:

See the discussion below in the comments:

As the tutorial explicitly states, you should have Limit Selection to visible unselected. Once it is unselected, you will be able to see (if in perspective view), select and delete the back parts of your mesh.

If using the default theme, a selected button should have a dark background  and an unselected button should have a light one .


How can I make an indented cube without using a boolean operation? As the title says, how can I make this shape without resorting to a Boolean operation?

This is obviously a very simple example, but I find myself needing to do something like this relatively often when modelling.

Despite using Blender for a couple of years, and considering myself an intermediate to possibly advanced user, I still know of no easy way to make this kind of indentation in an object.

Obviously, if you are looking to make an indentation in the middle of the surface, you can simply select a face and extrude down. As you will know, this does not work at the edge of the surface.

I can create this shape using loop cuts, deleting the faces and then using snap to edge to extrude the edges down to the same level (and then filling in the faces), but it feels cumbersome and a lot of work for what feels like it should be very simple.

The F2 addon is quite useful for operations like this.

Make sure it is enabled in user preferences, then...

Delete the faces where you want the indentation.
Select an outer corner vertex and press F to create a face.
Repeat 2 for the other corner vertex.
Select the upper (or lower) edge.
Press F twice to fill in the remaining faces.


Accessing volume checkbox of a camera in the Stereoscopy section Is there a way to check/uncheck the volume checkbox in the stereoscopy tab in the settings of a camera via the Blender Python API?

Update:

    bpy.context.space_data.show_stereo_3d_cameras = False
    bpy.context.space_data.show_stereo_3d_convergence_plane = False
    bpy.context.space_data.show_stereo_3d_volume = True

I saw in the console that these are the properties I want to change. But I can´t find a way to change them using the Blender API because the properties are read-only according to the documentation. Anyone an idea on how to change them?

You can cycle through the areas of the bpy.context.screen untill you find an area with the type VIEW_3D.

import bpy

areas = bpy.context.screen.areas

for area in areas:
    if area.type == "VIEW_3D":
        area.spaces[0].show_stereo_3d_cameras           = False
        area.spaces[0].show_stereo_3d_convergence_plane = False
        area.spaces[0].show_stereo_3d_volume            = True
        area.spaces[0].stereo_3d_volume_alpha           = 0.5


Mirror modifier making verticies overlap I had a little problem with the mirror because i had he mesh and the mirror mesh were on the wrong side i switched them by applying the mirror and deleting the vertices then i added the modifer again and this happened

Did you check the "clipping" option in the modifier's box?

You also could look into increasing the merge distance.


How do I import a fbx file into blender from command line? I would like to import a fbx file (3Ds Max scene file) and save the project from the command line, how can I do this?

You simply need one operator to import the FBX, and another operator to export the blendfile. Replace the filepath variables with the actual paths you want to use.

# Import FBX
bpy.ops.import_scene.fbx( filepath = yourFBXfilePath )

# Export blend file
bpy.ops.wm.save_mainfile( filepath = yourBlendFilePath )


Blender and 3dsmax Scale conversion At my work we use 3dsMax and are trying to transition to using Blender. One thing we've run into is that when we import a Blender model as an fbx, the scale is 100 times the size in 3dsMax, but the dimensions are correct. 3dsMax Local Scale is 100 times larger than it should be but the dimensions of the object are correct. In Blender the opposite is true. Where the Scale is 100 times smaller.01 and the dimensions are correct. I can apply the transform in Blender or the Xform in 3dsMax to correct the scale, but we want to prevent it from happening in the first place.

Other potentially info is that in 3dsmax our system units are in Centimeters. 3dsMax's "Local Scales should say 100.0 instead of 10000.0 and Blender's Scale should say 1.000.

I understand it is not optimal to be working between programs, but we need to be able to work between both fluidly so we can transition to Blender completely.

Thank you.

Many import/export options include a scale to use when importing/exporting.

When exporting to fbx from blender set the scale to 0.01

When importing into blender go the opposite way, set it to 100.0

Another option is to change the units scale in blender to change the sizes shown in blender. If you set this and save the startup scene, it will be set that way each time you start blender.


How bake cycles material to PBR texture in 2.80? I should pass this model on Unity. I think the only way is to bake the material.
I can not proceed because of the “metallic”. The glossy bake is always white. Why? Where am I wrong?

Thanks in advance

Baking in Blender
Baking in Blender means baking the lighting information to texture maps, not the properties of the Principled shaders like roughness. You can bake AO and normals, but as far as I know, currently Blender Cycles only bakes normals from geometry and combining bump maps into a normal map or a few normal maps into one will not work correctly.
Buzzwords do not mean much
Buzzwords like 'PBR texture' or 'PBR baking' do not change the fact that this is nothing more than a process of making texture maps for a material. 'PBR' may only indicate that the values in the texture maps are scene referred(realistic reflectance values), that's all.
Baking textures created in material node tree as emission
So I believe your goal should simply be to make textures for your material in Unity.
You can experiment and see preview of the material in Blender using Principled BSDF. It will be easier if you work with only one Principled BSDF node and combine/edit the needed textures for it's properties. Whatever textures you combine or edit in the node tree of the material can be connected to an emission shader and baked out as emission:

You would just take the output of the last node just before it goes into some property of Principled BSDF shader(like for example Roughness) and connect it to an Emission shader and bake it. This is how you would make a single texture out of everything that you combine together in the node tree for that property.
You probably do not want the values to go through any color management transforms, so you can turn color management off during this process:

Baking ambient occlusion might also be useful, but it depends on how you want to set up the shaders in Unity. It can be made into a separate map, or mixed  into other maps depending on the situation.
Bump maps can simply be mixed together(added, multiplied, overlayed or mixed any other way that produces a desired height map).
Nothing normal about normals
If you needed to combine a few normal maps on top of each other, that is a lot more complicated than it may seem - see this answer for more info.


How to set the 3D-View clip with an API command? In a project I noticed a part of my 3D object is clipped. It is easy to correct that in the properties panel (N), View, Clip, End.

I copied the underlying Python command via the scripting Info window:

bpy.context.space_data.clip_end = 50000

but when I run this command via the console it gives me an error telling me that this attribute (clip_end) doesn't exist. In the API documentation, I find this in the section on bpy.types.SpaceView3D, but I can't get it working although my feeling is this should be very easy. So how do I access this property?

The hassle is the context.space_data (generally aka context.area.spaces.active) pertains to the console area, which is in context when you are in the console, rather than a 3d view.

Here is some console code, to find a 3D view in the current (context) screen.

>>> C.space_data.type
'CONSOLE'

>>> for a in C.screen.areas:
...     if a.type == 'VIEW_3D':
...         break
...
>>> a
bpy.data.screens['Scripting']...Area

>>> a.spaces.active.type
'VIEW_3D'

>>> a.spaces.active.clip_end = 500


Seams are visible after texturing using UV unwrapping I'm a newbie to Blender. When I texture my model using unwrapping, the change in texture at the seams is clearly visible. Is there any way to overcome this?

Use texture paint mode to paint your Mesh from scratch after UV unwrapping for complete control and burden.  You may not feel like a [newbie] after that experience.


Hair Direction in Cycles ParticleSystem I am trying to get hair to come from one side of my plane but it is being emitted from both.

The object origin of the cylinder is used as the emission point. In your .blend,  the origin of the cylinder is in its center, so each particle instance of the cylinder is exactly half on the top and half on the bottom.
To set the origin to one end:

Select the cylinder and enter edit mode (Tab)

Select one end of it and press ShiftS> Cursor to selected:

Exit edit mode (Tab) and press CtrlShiftAltC> Origin to 3D cursor:


Material saving issue during "Seperate by Material" During my workflow I am joining meshes together and then using "Separate by Material" and vice-versa. During this process, sometimes the materials are not saved. I posted about it in this thread:
Material names missing

I now uploaded a Blender file to Blend-Exchange to show the issue.

Here are the steps to reproduce what is happening:

Open the Blender file
Notice Mesh1 and Mesh2 have material slots and materials
Join Mesh1 with Mesh2
Go into edit mode, and select everything in the joined mesh and do
"Separate by Material"
Save the blender file
Re-open the Blender file and notice the material slots are there,
but the Materials are now "missing", as shown in the linked question

So why might this be happening?

This was a known bug in 2.77a.
https://developer.blender.org/T49228

I now installed Blender 2.78a and the issue is resolved by using the new version of Blender. The material is now saved and loaded correctly.


How to achieve softer and more realistic lighting from a chandelier? I created a crystal chandelier and wanted to use it to light up my scene, but I'm not getting the results I wanted. I want to achieve a more reflective and softer lightning. Now you can see the silhouettes of my lamps right through the chandelier. I am using small parts in the chandelier with emission materials on them. Has anyone got any tips or tricks for softer realistic lightning?

Given the vagueness of the question I'll ramble a vague answer:

Reproducing light sources in blender (or in any photographic device) is a bit problematic: in order to get the level of brightness that we associate with them perceptually the emitters get so bright that they are just white with no detail.

Or if we want to get the detail on them there is not enough light on the scene

(more on the subject on this question)

The shadows produced by the glass can be less dense if you increase the samples and the number of bounces for transparency and transmission (note that your rendering time will increase dramatically)

Another trick if you don't want to render for such a long time is to have the glass be completely transparent to the light (maybe less realistic but will cut your rendering time)

Yet another option is to add an object that will light the scene but its invisible to the camera and reflections:

(to deal with noise read: How to avoid noisy renders in Cycles? and blender guru's article on how to reduce fireflies)


Save/Export image from compositing tab in Blender 2.81 Any way to save the pre-rendered picture as JPG/PNG from the compositor?

One way is to connect the Viewer Node.
Then just open your Image Editor, select Viewer Node and save the image.

You can save to any format you need .jpg/.EXR are all supported.

Note:
If the Viewer node doesn't show any image, just toggle one of your nodes off/on.
Viewer/Composite nodes refresh only when there's a change in the compositor.


Animating the process of creating a 3d scene I have a few completed renders and I would like to quickly show how they were made via a quick animation. Have you ever seen a behind-the-scenes look at movie's vfx where first you'll see a frame of the raw footage, then a rough 3d model will slide onto the screen, then a smoother model with basic color slides on top of that, then a textured model, then a final render with proper lighting and such? I would like to recreate that but I'm unsure of how to go about it.

(this gif is a good example of what I mean)
https://digitalsynopsis.com/wp-content/uploads/2015/04/movies-before-after-green-screen-cgi-hobbit.gif

After setting up the animation in blender, render out the final video. Then do an opengl render of the 3d scene, this will render the 3d viewport version of the animation. You can adjust the display and object properties to adjust how the scene looks.

Once you have the two videos, add them to the Video Sequence Editor, then you can cut the strips so that each is visible at different times. You can add a wipe effect to switch between each video or you can use animated masks for more elaborate transitions.


Why doesn't emmisive material render in my camera? I'm trying to create a simple sky for a scene.  Right now I'm modelling it as a gradient texture applied to the inside of a sphere.  I made the shader emissive so that it does not cast a shadow and contributes ambient light to the scene.

Unfortunately, it does not show up when seen through the camera or in the final render.  How do I get my emissive shader to be seen?

First thing that comes to mind is that it might be camera clipping (basically that your 'render distance' is too short).


How can I use photoshop files as brushes? I have some .psd files and I want to use them as brushes for sculpting, but I can not find an way to import them. I've already tried to add the brushes using append, but don't get how to use them.
Q: Is there any way to use brushes from a .psd file?

So according to your comment you can import a psd, you can also convert your file to .jpg or .png, then open the N  panel, create a new texture, and in the Properties panel > Texture, load the image. Don't forget to enable Dyntopo if you mesh is low-poly. Also, choose the Mapping mode you want:


How to hide light object keeping the Light effect? I use EEVEE preview my animation scene.I want to animate in this state.
The LightShape displayed in the scene affected my observation of the animation.
I want hide these light shapes.but The scene lost its light effect.....

You can disable light objects visibility from the Overlays popover.


Why is it grainy in this part? I have no idea why is it grainy on the left side. But on the right side it is ok. I added additional lights on the left side but the problem is still there. Any tips? I am struggling about lighting the rooms.

Artifatcs are caused by overlapping faces.

On the right side you have this situation (correct):

while on the left side (overlapped/dubled geometry):

You can clearly see the problem also in Solid view display mode.

As faces shares the same location, camera rays can't tell which one is visible from camera, so shows a bit of one and a bit of the other.

You have to create a gap between faces


How to sort objects from a collection using python? So I'm trying to animate a rubiks cube via a python script using the scripting capabilities given with Blender.

My current cube looks like this:

It consists of 27 separate objects (cubelets) that are organized in a collection like this:

Initially the locations of the individual cubelets were not applied and so I could select all cubelets of a given side by sorting the objects of the collection by the corresponding location and reversing the resulting list if necessary:

def cubeletsBySide(cube, side):
    dimensionsBySide = {'U': 2, 'D': 2, 'F': 1, 'B': 1, 'R': 0, 'L': 0}
    revertBySide = {'U': True, 'D': False, 'F': True, 'B': False, 'R': False, 'L': True}
    dimension = dimensionsBySide[side]
    return sorted(
        list(cube.all_objects.values()),
        key=lambda c: c.location[dimension],
        reverse=revertBySide[side])[:9]

After some initial trouble with animating the cube I found a tutorial that helped me in animating a cube by hand. However it seems the right thing to do to apply the locations and set the origins of the individual cubelets to the same common point (the 3D cursor in this case).

While this works when animating the cube manually I can now no longer use the location to reliably sort cubelets. I pondered the idea of attaching custom properties to these objects, but that would imply that I also need to update this data whenever rotating some cubelets. To my mind there is a certain beauty in not needing to keep track of redundant data here and just selecting the desired objects at will. I also looked trough other object properties in the hope that I could find something to sort the cubelets by but had no luck with that.

Simply stated: I desire some sort of property or mechanism to compare objects in a given world location independently of their origins so that I can find the required cubelets independently of previously executed rotations.

For completion here's the code I currently use to rotate a side of the cube that makes use of the cubeletsBySide function:

def rotateSide(cube, side, angle):
    axisBySide = {'U': 'Z', 'D': 'Z', 'F': 'Y', 'B': 'Y', 'R': 'X', 'L': 'X'}
    override = bpy.context.copy()
    override['selected_objects'] = cubeletsBySide(cube, side)
    bpy.ops.transform.rotate(override, value=angle, orient_axis=axisBySide[side])

I'd be grateful for any pointers on this .

Alright so what worked for me is this:

For every cubelet the cubelet.data.vertices are all in the same grid cell so to speak. That means it's not important which one of them I take to compare against other cubelets. If it was I could still iterate them and find a min/max/average to my desire.

So using cubelet.data.vertices[0].co works for selecting initial, unrotated cubelets, but it breaks once a cubelet is rotated. This makes sense as the rotation is part of the cubelet.matrix_world rather than the individual vertices being updated.

I've added an exampleVector function encapsulate finding an arbitrary example vector for a cubelet for comparison:

def exampleVector(cubelet):
    return cubelet.matrix_world @ cubelet.data.vertices[0].co

With this my cubeletsBySide function now looks like this:

def cubeletsBySide(cube, side):
    dimensionsBySide = {'U': 2, 'D': 2, 'F': 1, 'B': 1, 'R': 0, 'L': 0}
    revertBySide = {'U': True, 'D': False,
                    'F': True, 'B': False, 'R': False, 'L': True}
    dimension = dimensionsBySide[side]
    return sorted(
        list(cube.all_objects.values()),
        key=lambda c: exampleVector(c)[dimension],
        reverse=revertBySide[side])[:9]

Together with the rest of my code I can now perform the superflip again, which I use to verify that both side selection and rotations are working correctly:

superflip = ["R", "L", "U", "U", "F", "U'", "D", "F", "F", "R", "R", "B", "B", "L", "U", "U", "F'", "B'", "U", "R", "R", "D", "F", "F", "U", "R", "R", "U"]

currentCube = newCube('cube', (0, 0, 0))
shuffle(currentCube, superflip)


I can't find the Master Jaw vertex group using the Rigify addon Pretty self-explanatory. I am using the built-in addon, Rigify to rig one of my characters. The rig isn't perfect so I need to go in and change some weights. I clicked on some of the bones to see what their name is, and I clicked on one that was called, "Jaw Master." For some reason, when I go to the vertex groups on my mesh for some reason I don't see a group of the same name. I saw one that was just called "Jaw" but when I moved the master jaw around it didn't do anything. So I am assuming that's the wrong group.

Rigify is a quite complicated rig, in which a lot of bones are "control" or "machinary" bones, so they don't deform the mesh (they don't have the "deform" option activated, so no associated vertex group is created when parenting).

All and the only bones who deform the mesh are stored into a generally hidden bone layer, and have the "DEF" suffix on their names.

So, probably the vertex group you're looking for is called "DEF-jaw".

Of course, after generating the rig, if you know what you are doing you can modify all of theese properties.


Why NLA animations are limited to 6 when exporting to FBX? I'm getting this problem when trying to export from blender to any other program in Fbx format using NLA stacks for animation, when exported it only seems to save 6 out of 12 animations

Don't know if it helps to find the problem, but 4 out of 6 of those unexportable animations were clones at first and later modified.

FBX export settings used.

I found out what was wrong if anyone else got the same problems, all exporting NLA strips are controlled in Nonlinear animation tab:

Found it in the documentation:
https://docs.blender.org/manual/en/latest/editors/nla/strips.html


how do I animate particle key properties? Most properties can be animated by right clicking and selecting 'insert keyframe' but the keyed particle key properties (properties such as 'Time:' and 'Duration:') don't give that option when right-clicked. Right clicking the box containing the list of particle keys does give the option, but adding a keyframe for that doesn't seem to do anything. Is there any way to alter these particle key properties?

Blender lets us animate "almost" any value that we can adjust, there are some values that do not support being animated. These either don't make sense to animate or might cause issues if they are animated. Thse values will not have any keyframe options when right clicking on them, if you press I with the mouse over them you will get a warning message at the top of the window telling you it cannot be animated.

The number of particles, start and end of the particle emission are some of the values that we cannot animate. You will find others, like initial orientation and velocity, as well as physics type.

Some other values like render resolution and start/end frame also cannot be animated.


Color individual faces after modifier It is possible to color individual faces of a model by going to edit mode and assigning different textures to each face.

I'm using a low poly model to which I apply a subdivision modifier and subsequently a decimate modifier. When I go to edit mode I only see the faces of the original mesh. This does not map well with the final result and therefore I'm not able to color it appropriately. How could I color individual faces without applying the modifiers.

Once you use a Generate Modifier (decimate counts as well) you don't have much control over the mesh anymore. Since modifiers are by nature dynamic, you can't change individual faces, since they might not exist in another frame.
Usually you would use vertex paint in a situation like this, but that's also not easy.
One method to cheat I can think of right now is: Use a texture, unwrap your model and make the decimate modifier respect the seams. It's fiddly, but you might get this working.


Manual bevelling works, but not the one limited by a Vertex Group I try to bevel all the edges visible on the following picture. I select an edge and press Ctrl + G and then choose Assign to Active Group (which is named 2mmBevel). As can be seen on the picture I limit Bevel to this Vertex Group.

The problem is that it doesn't work. It did work that way for those edges that can be seen bevelled. Sometimes it worked for single edges. Sometimes I had to select several edges and assign them to Active Group together, they refused to get bevelled separately.
Anyway for this particular selected edge - once I add it to the Active Group - all other bevels disappear, like this:

The strange thing is, that when I try to bevel this edge manually it works:

What is the problem here? How can I bevel the remaining edges?

Actually, it work. May be you not assign the vertices correctly.

You should choose "Assign to New Group" from the Panel.

You can press "select" to make sure that you assign the vertices correctly.

You can assign this three vertices to bevel the remaining edges.

Disabling "Clamp Overlap" also can fix the problem for the questioner


How do I use array and curve modifiers, without bending? I want the bricks to align to each other while keeping somewhat of their shape. Even when I add more edge loops they start z-fighting.

Here are the sequence of steps I followed for getting the arrayed objects to follow the curve without distortion in Blender 2.82a:

I began by adding a Bezier circle object to the scene. Then I added a polygon cube to the scene. Both remain at World Space 0,0,0 (and this may actually be significant).
In Edit Mode for the Cube, I scale it along the Y axis.
In Object Mode, with the cube still selected, I create an Array Modifier. I choose Constant Offset and enter a value for spacing between the cube instances which looks good (in my case, 0.22). I do not apply the Array Modifier.
Still in Object Mode, with the cube still selected, I create a Curve modifier. I point it to the Bezier Circle as a target. I enter Y for the Deformation axis, which is the depth axis in my scene. I do not apply the Curve modifier.

Below is my result, and as you can see, there is no distortion between the edges of cubes. I do not know how you are getting distortion. I tried changing the order of my modifiers as a test, and it did not produce your results.


Is the add landscape button really just a pre-made Mt. McKinely? In the add mesh menu, If you click on the button labeled Landscape, It will add a relatively cool looking mesh.

However, once I put my favorite color on it, This mesh seems pretty useless.

It actually looks kinda like Mt. McKinely

The only possible use I can see is if I wanted to go into sculpt mode and modify it further, Then it could have some use as a base mesh to save you some time instead of sculpting from a plane. Is there actually any practical reason to use this button? or is this feature just another pre-made mesh like Suzanne and teapot?

You can change the settings for the ANT landscape creation by moving the random seed:

By the way ANT refers to Another Noise Tool


Generate a repeating mesh pattern without extra geometry - twisted cable/guitar string Is there a way to fake a large number of turns of windings? Example: the strings of a guitar, if you gotta model the winding details, how do you fake the windings, so as to reduce the vertices?(because creating them with an array and a curve modifier boosted them up to a 70K vertex count)  I've tried bump mapping and normal mapping but, they don't seem to work well.

Looking to create an effect similar to this :

Assuming Cycles, how about something like this :

This is simply a cylinder with a procedural texture based on a Wave Texture and a Radial Gradient Texture.

The Object coordinate is split into it's X,Y,Z coordinates and just the Z is used to feed into the Wave Texture X coordinate. Without any offset this would simply result in rings along the length of the mesh. Adjust the Scale of the Wave Texture to get the desired pitch. Adding in the output of the Radial texture skews the rings and this can be adjusted (using the Multiply node) to join each ring to the next to produce a continuous winding.

To double up the strands you can include maths nodes so that the 'dip' in the wave becomes a second strand - by subtracting 0.5 and then using Absolute to make the negative section positive.

Adjusting the pitch produces the following :

Use a metallic material and this might be reasonably close to your needs.

One limitation of this is that the 'turns' must be aligned with the texture space - in this case the Z axis of the Object coordinates - so the mesh must be aligned with the axis and cannot be curved. However, this limitation can be overcome by simply UV unwrapping the mesh and ensuring that the faces are all alligned and oriented correctly in UV space and this allows the mesh to take on any form while still maintaining the twists.

One way to achieve this is to create a curve or a path along the desired route of the 'string' and set the Curve Bevel settings to give it thickness.

Convert it into a Mesh (Alt-C).

Go into Edit mode and select all faces (A) and select Mesh/UV Unwrap.../Follow Active Quads to unwrap the mesh. Open a UV/Image window and scale and align the unwrapped 'island' so that the narrow edge is just the same size as the UV image space as shown below.

With the UV Map scaled and positioned as shown, the Y coordinate can be used in place of the Radial Gradient in the previous material. The X coordinate will represent the length along the 'string'. This produces the following material and result :

Adjusting the Multiply nodes and the Wave Texture Scale will adjust the pitch and twistiness of the string.


Blender 2.8 3D viewer export with texture When I export .fbx files and view them in the Windows 10 3d Viewer, they dont have the textures on them. How can I preview my .fbx files with textures in the Windows 10 3d Viewer?

My .fbx files work in unity as usual, because I import them without textures and add the textures in unity.
With 2.79 I would my object as .fbx and the UV map as an image and in the Windows 10 3d Viewer my object had the texture on it. There was some function like apply texture.
When exporting from 2.8 (with the same steps) the 3D viewer does not show any texture on my models.

Make sure you save your texture into the folder where your fbx file is.

In the image I am in UV Editing


OBJ imported into Nifskope has no texture I'm a bit of a noob when it comes to Blender, so bear with me here if this question doesn't include all pertinent information at first.

I'm working with an existing mesh for Fallout3. The mesh has three (3) nodes, one of which I want to modify slightly. Using Nifskope 1.1.3, I exported the node to an OBJ file, then opened that OBJ file in Blender 2.71. In Blender, I trimmed away vertices until I had what I wanted, then I exported the object as an OBJ file.

Back in Nifskope again, I imported the OBJ file as a new NiTriShape. So far, all has worked as expected. However, the imported node will not show the texture applied to it, despite showing the correct texture path/file in both Nifskope AND Blender.

Obviously, I'm doing something wrong here - probably in Blender before the export - but I haven't had any success finding out what so far.

Any tips in the right direction are greatly appreciated.

EDIT: I've tried pointing to other DDS textures, in case the problem was my custom texture. Same thing - just a flat gray with no texture applied. I also tried adding a BSShaderPPLighting node (incl. BSShaderTexture) to the NiTriShape, and pointing that to various textures as well. Same issue. I'm starting to think the problem is with the UV mapping in Blender, but I could be wrong.

Not sure what the issue was exactly, but apparently it was with my export. After downgrading to Blender 2.49 and installing the Blender NIF scripts, I was able to export the mesh directly as a NIF (instead of OBJ, then NIF) and now the textures work properly.

By having both versions of Blender installed, I can work in 2.71 with its much-improved interface, then open the *.blend file in 2.49 to export it as a NIF.


How to animate two objects going apart from eachother I want to make a futuristic sliding door.So I have a framing and two parts inside.I want to know how to animate the two parts moving in oposite positions so the door opens.

You need to keyframe your objects. In the timeline go to frame 0 and set your objects so as the door is shut, then select each object, press I > Location. This defines the start of the animation. To get the door to open, in the timeline set the current frame to 50 (if you want your door to open in 2 seconds) and repeat the first process excepted this time you must set the door open before adding the keyframes. Play the animation: the door opens.


Beginner’s help - How to make a disk with perfect semicircular edges I have failed for the last two hours in making a disk with perfect semicircular edges like this image

I was trying to make a very short cylinder and then Bevel upper and lower faces, but that produces an edge with a different curvature than a semicircular edge.

You could think of the discs  as a doughnuts with their tops and bottoms filled in..

Alt - select the midway loops of a torus, created by with the appropriate major and minor radii
V - drag rip the edges and hover-L select the inner faces
X delete them, Reselect the boundary loops
F fill the top and bottom


I animated curve with hook modifiers. How can i export the animated curve? I animated curve with hook modifiers. I created hook at each bezier point of a curve and keyframe animated location, rotation and scale of those hooks.

Now i need to export this animated curve out of blender.

Unfortunately i don't see a way how to do it.

I spend 2 weeks animating many many curves in given scene only to find out that i don't know how to export them. It never occurred to me it may be not trivial task to export resulting animation.

I attach scene with my animated curve in it. Please help me if know a way.

Here is the scene: https://drive.google.com/file/d/1r8lP5_ExmW1PKlGmXTx8g79-7mmjgcbl/view?usp=sharing

Unfortunately this does not bode well for you. The problem seems three fold:

As far as I know there are currently no addons or exporters that can export Bezier Curves out of Blender. Most exchange formats I know support mesh data only anyway, they don't even have a concept of Bezier Curve, so to the best of my knowledge, non of the provided exporter addons can even write Bezier Curve data directly without explicit conversion to mesh first.
Exporting animations is hard, few file formats support animation data because it is hard to standardize, the exceptions I know here are Collada and FBX, and perhaps some other "cache based" formats like Alembic and similar.
Even those file formats that do support animations are frequently very limited in the type of data that can be exported. Mostly rigging and armature methods are supported, and even those often encounter issues and incompatibilities. Deformation based animations, morphing, shape keys, modifiers, and/or generated data like simulations, physics, fluids, etc, including hooks, are most likely not part of the small subset of animation techniques that can be exported.

So what options do you have? Not many.

Converting (a copy) of your animated bezier curve into a mesh and exporting that instead may alleviate some of the issues, but I can't see it going very far beyond conversion, you still need to export a deformation animation and that can be troublesome.
Exporting as an SVG file There is one third party addon SVG Export Script that exports the viewport as an SVG file. There is this one particular setting called Bezier Overlay that allows exporting Bezier Curve objects as SVG paths directly.
It is obviously limited to 2D curves (because SVG is an illustration image format) and it probably doesn't support deformation animations anyway. I believe it can export animations as a sequence of independent SVG files but nothing more.
Exporting hook animation only Depending on where you are exporting to (which you never state), what you intend to do with said animation, and the capabilities of the destination software, you may be able to get away with exporting only the hook positions, and rebuild your curve elsewhere from that info.


Blender VSE Waveforms not showing after changing file directories I decided to organize my file directory, but when I went back to my project both the video and audio were not working
The fix was to update the source location on both

Now I'm having an issue where I can't get the waveforms to show
And I also don't know if it's using the correct proxy data since I don't know which file exactly is the proxy file when I go to use the "custom proxy file" option

To show an example of what I did:
The file path used to b d:/videos/project/video.mp4
Now the file path is d:/VideoEditing/projects/video.mp4

I made a new .blend project and the waveforms showed up there
I don't want to start a new project however since I've already cut out things from both video and audio on my current .blend project

Sigh

I jst had to reload my .blend

In other words:
Save and close, then re-open the project
(with the new file directory changes
so that they match where your files a newly located at)


Blender failing to open saves using cycles render. (OpenGL 3.3 or higher error) I have been trying to get back into blender but most of my saves aren't opening. I get the "Blender - unsupported Graphics card. the graphics card needs OpenGL 3.3..." If i save the file as Eevee they open fine. I have updated all my drivers with clean installs. I have tried disabling the graphics card in the system settings and I am still running into the same issue.

Hardware: Intel 6700k and 2x 980 ti's
Software: Blender 2.8 through Steam

So there is a bug with SLI. If you go into the Nvidia control panel and manually select 1 GPU for openGL it resolves the error.


How do I add a background image as a camera lens? I'm tyring to render some images references for a comic book I am making. After posing my models and props, I will be trying to find the best angle and then I will render an image.

In order for me to create the page, I will be loading a panel template as a reference. This is basically a bunch of rectangles that give me a reference where my comic book panels on the page will be.

I will adjust my render dimensions (this changes camera view dimensions too) to have a comic book page height and width. I want to load the panel template as a background image (which has the same height and width) so that it is locked to the camera view.

This way, when I press the key Zero, I see what my camera sees. If I then select the checkbox Lock Camera To View, I can rotate around an object while seeing what the camera sees.

What I want to know is how do I get the panel template image locked to the camera view.

This will give me the ability to find the best angle and zoom for my scene while adjusting it for the appropriate panel in the template.

How do I do this?

Thanks to the answer, here is snapshot of what I was trying to achieve:

You can do this by adding a Background Image. To do this, go into the 3D Viewport and press the N key to open the panel on the right hand side. Scroll down to the very bottom, and you should see an option Background Images. Go ahead and enable it.

Now add an image and change the view from All Views to Camera.

Now in the camera view you will have a background image that transforms with the camera.


Blender 2.7 Basic Vertex question Unless my memory completely fails me, I used to be able to do CTRL+R to create a vertex along an edge.

Now, I get the Loop, Slide functionality.

I know I can create the other vertices and delete the ones I don't need but it would be very helpful to add a vertex on occasion.

Did something change during a recent version change or am I remembering incorrectly.

I realize that we need to keep 4 sided polygons as much as possible but sometimes it can be very useful to do that by inserting vertices.

Can anyone help?  I did a lot of Bing searches but the earliest responses I saw were around 2011 and they were suggesting the same thing that I remembered.

Any help greatly appreciated.

Natarthos

If I understand you're meaning correctly, you want to add vertices only on a specific edge, and not to add an entire loop.

To do that, select the edge, then subdivide using the button on the Tools Panel, or the shortcut W --> Subdivide. You can then edit the number of subdivisions through the Last Operator Panel (bottom of the Tools Panel), or the F6 menu.


Reuse same UV map for duplicate objects I have following object:

All 4 hand of windmill are duplicates of each other, only rotated. I already UV mapped 1 hand and now I'd like to use same UV map and textures on other hands. When I try to unwrap other hands, I don't get the same UV map and I can't reuse same texture. The result of trying can be seen on 2nd hand. Is it possible to reuse textures and UV maps?

Blender supports linked duplicates where new linked object has all data linked to the original object. More info in Blender Manual.


Blender 2.8 Beta: OpenGL 3.3 Error? Before I start, YES, I have done my own research - I know how annoying a repeat question is. Yet each answer is so specific to others...

When I tried the beta 2.8 64 bit, it says "Blender requires a driver with at least OpenGL 3.3 support. The program will now close."

The question: I know that it is true that 2.8 requires OpenGL 3.3. But does my PC not have it, doesn't support it, or do I have it and blender won't detect it? I'm not sure what info to include or what to look for, so here's my PC's specs:

Windows 10 (64 bit)
Core -        Intel Core i5-2400 CPU @ 3.10GHz
RAM -         8GB (7.89GB usable)
System type - 64-bit Operating System, x64-based processor

Thanks!

EDIT:
Graphics properties:

Update your graphics card drivers, if Blender works, your graphics card supports required OpenGL version if not, it doesn't.

In this particular case a quick Google search reveals that Intel HD Graphics 2000 Adapter supports only OpenGL 3.1. This means the graphics card will not be suitable for running Blender 2.80.

The good news is that pretty much any new graphics card will most likely support required OpenGL version and you will not struggle finding a wide choice of suitable graphics cards in a very wide variety of prices. Even cheap graphics cards are capable of running Blender 2.80. However, if you are planing to use EEVEE, you will probably want a more expensive one.


How can I model a tap shape? I am facing an issue modeling this shape. Any clue?

This is as far as I could get:

My finished model looks like this. Of course topology may be different- it's your decision how you set the edge flows. Here's the .blend for you to study:

It's too broad modeling task to describe every step, that's why I used a screencast keys in my .gifs. Begin with extruding the cube horizontaly, then subdivide it using edge loops (Ctrl+R). Add a circle (with 8 vertices) and bridge the extruded cube's end with it (W-->LoopTools-->Bridge). Your base mesh is ready. Rest is a matter of using blender modeling tools to tweak some vertices as pictured below.


How do I get flat texture projection on a object without distortion? I tried using Window Texture coordinate, but it changes scale if I zoom in or out. The Camera Texture coordinate works in with orthographic camera but gets distorted if I use perspective camera.

I want the texture to have a fixed scale and not be distorted like on orthographic mode.

Use the Texture Coordinates of your Camera

Add a texture coordinate node and choose the camera output. If all coordinates had the same depth values, then the texture won't be distorted. You can simply reduce the length of the coordinates so that their z value equals 1 by dividing the coordinate by their z value.
Use a Vector Math node for the division and you have scale and ratio invariant view coordinates.

You will notice, that the texture still changes when altering its scale. This is because the Z coordinate is 1 and it's beeing scaled. If you don't want that, then multiply the Z coordinate with 0 with a vector math multiplication node (set X and Y to 1 though, because we don't want to change them).

The setups above will still zoom in and zoom out. They don't change when the camera is moved, but change when the cameras focal length decrease or increases.
However, since we have the relation of the camera coordinates and the window coordinates we can counteract this by multiplying the coordinates with the quotion of a single dimension of window / camera.
The following node setup will produce axis-equal window coordinates independently of camera position, rotation, or focal length.

It works perfectly in cycles, but causes some artifacts in EEVEE in the center due to zero division.


How to use antialiasing with bgl drawn elements? When using a draw_handler to draw bgl elements to a screen as with GL_POLYGON or GL_LINE_LOOP, are there any bgl flags which can be enabled to invoke antialiasing or will this always require a much more complicated solution?

I'm aware of GL_POLYGON_SMOOTH, GL_POLYGON_SMOOTH_HINT, GL_LINE_SMOOTH, and GL_LINE_SMOOTH_HINT but enabling them before or after using GL_POLYGON or GL_LINE_LOOP doesn't have any affect. Has anyone personally accomplished antialiasing using bgl in Blender Python? If so, could you please show me how?

import bpy,bgl,blf

def draw_callback_px(self, context):

    #Can anything go here to invoke antialiasing?
    bgl.glEnable(bgl.GL_POLYGON_SMOOTH)
    bgl.glEnable(bgl.GL_POLYGON_SMOOTH_HINT)

    bgl.glBegin(bgl.GL_POLYGON)

    #Should flags go here?
    for x, y in self.mouse_path:
        bgl.glVertex2i(x, y)

    #How about here?
    bgl.glEnd()

#How about an antialiasing function involving
#multi-sampling, bgl texture (or some other)
#functions etc.. Anyone know how to do this?

class ModalDrawOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    def modal(self, context, event):
        context.area.tag_redraw()

        if event.type == 'MOUSEMOVE':
            self.mouse_path.append((event.mouse_region_x, event.mouse_region_y))

        if event.type in ['LEFTMOUSE','RIGHTMOUSE','ESC']:
            context.space_data.draw_handler_remove(self._handle, 'WINDOW')
            return {'FINISHED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.mouse_path = []

        args = (self, context)
        self._handle = context.space_data.draw_handler_add(
        draw_callback_px, args, 'WINDOW', 'POST_PIXEL')

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

bpy.utils.register_class(ModalDrawOperator)
bpy.ops.object.modal_operator('INVOKE_DEFAULT')

Turns out any kind of smoothing you want to use with GL_POLYGON_SMOOTH, GL_LINE_SMOOTH etc. (antialiasing simple shapes) requires GL_BLEND also be enabled.

I discovered that if you're using GL_POLYGON with GL_POLYGON_SMOOTH enabled, you get weird breaks in your mesh shapes. For this reason it's best to leave GL_POLYGON_SMOOTH off, then surround the shape created with GL_POLYGON with a line from GL_POLYGON_LOOP and then enable GL_LINE_SMOOTH. This gives the appearance of antialiasing around the shape without the weird breaks (demo in code below).

import bpy,bgl

def draw_callback_px(self, context):

    #Set color to white.
    bgl.glColor4f(1, 1, 1, 1)

    #Using polygon smoothing alone creates
    #lines through shape... better to leave
    #off and just smooth outer line.
    #bgl.glEnable(bgl.GL_POLYGON_SMOOTH)

    #GL_BLEND must be enabled for any
    #smoothing to work.
    bgl.glEnable(bgl.GL_BLEND)
    bgl.glEnable(bgl.GL_LINE_SMOOTH)

    #Can't just stack GL_POLYGON
    #and GL_LINE_LOOP
    bgl.glBegin(bgl.GL_POLYGON)
    for x, y in self.mouse_path:
        bgl.glVertex2f(x, y)
    bgl.glEnd()

    bgl.glBegin(bgl.GL_LINE_LOOP)
    for x, y in self.mouse_path:
        bgl.glVertex2f(x, y)
    bgl.glEnd()

    bgl.glDisable(bgl.GL_BLEND)
    bgl.glDisable(bgl.GL_LINE_SMOOTH)
    #bgl.glDisable(bgl.GL_POLYGON_SMOOTH)

class ModalDrawOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    def modal(self, context, event):
        context.area.tag_redraw()

        if event.type == 'LEFTMOUSE':
            self.mouse_path.append(
            (event.mouse_region_x, event.mouse_region_y))

        if event.type in ['RIGHTMOUSE','ESC']:
            context.space_data.draw_handler_remove(self._handle, 'WINDOW')
            return {'FINISHED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.mouse_path = []

        args = (self, context)
        self._handle = context.space_data.draw_handler_add(
        draw_callback_px, args, 'WINDOW', 'POST_PIXEL')

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

bpy.utils.register_class(ModalDrawOperator)
bpy.ops.object.modal_operator('INVOKE_DEFAULT')


Is there a way to render one layer So I'm creating a room flooding video I've taken a picture of my room and and created a scene that has obstacles where my bed is and the walls are ect. What I want to do is render the fluid simulation against a transparent background so I can composite it on to the picture. The problem is I can't figure out how to make all the obstacles invisible and only have the fluid running through the scene and hitting the obstacles without the hdr making the fluid over exposed.

Yes, there is. In the properties panel ( to the right ) hit the button in the top bar next to the render setting (next to the camera) which looks like two pages. This is called the Scene settings. Under layer, you can choose which layer to render. Hope that helps :).

Edit: There is one more thing you can try. In the top right where it shows the different objects in the scene, you can’t hit the camera so they won’t be visible in the render. I’m not sure if this will preserve lighting though.


Engines fire animation for mobile app created in Unity Folks.
I need some help with creating fire animation and using it for airplane engines in Unity (like an afterburner effect).

Should I use Cycles for better materials since I already have a pretty nice one? What kind of file format should I use for rendering? If it's .png images and I remove the pure black background that I have I loose all colors of the fire...sad but I don't know why :D. Is it possible to import the whole blender file and edit it there? Also, I have no idea how to make it light for mobile game. And last but not so important - could you give me some hint on how to make the animation repeatable?

There is no way (as far as I know) to bring a Blender particle system into Unity. If you want to use your Blender fire, render out transparent png sequences from all the sides that will be seen in game. Then use planes with with the images in Unity. However, given your knowledge of Unity and Blender, I would recommend you import Unity's free ParticleSystem pack and go from there.


Use the view from other cameras in the scene as VideoTexture in Cycles I have a scene with monitors that display video from cameras in the same scene (or other scenes, but all of them are linked i.e., same objects in the scene). The cameras shown on the monitors do not view the monitors, so no looping should occur.

I found https://www.youtube.com/watch?v=mPFhX_ogL2Y that shows how to get the effect in the Game Engine.

I would like to do this in cycles.

Essentially I would like a material input node that corresponds to the output of the composition of a particular scene. The incoming image should honor the render settings of the particular scene and any compositing applied to it.

The Render Layer node does not appear to honor the resolution or compositing settings of the scene it comes from, and is not available to apply as a texture in the material node editor (that I can find).

I understand that this could be done by rendering the animation from the various cameras, then applying that video as textures to the monitors, then rendering the camera of the monitors. That's super tedious if your making changes to the whole scene, and I don't want to do that.

Can do it in compositor, using an UV pass to distort the images and some ID masks to mix the render layers from different scenes... you can lower the samples for the scenes that will be seen in monitors, and will have faster renders.

Here's a simple test I just did, never tried something like this before so there may be some mistakes and things to improve. I unwrapped the tv screens and assigned materials with different IDs to use as masks.

https://www.dropbox.com/s/nepv0ukolw9r0od/MONITORS.blend?dl=1

edit: had to use the unwrapping to correct aspect ratio of images a bit

and more info:

you use different scenes for each camera
in main scene you activate UV pass and Material Index pass

UV pass allow you to distort an image to match the geometry
ID material pass allows to isolate different monitor screens
but you need to unwrap the tv screens and use different materials for each

in compositor you have a render layer for each scene
use UV pass from main scene to distort the other render layers
and use ID materials to set the alpha for the other render layers
then mix the layers, could even use compositor blur or depth of field

but easier is to just look at the blend... I guess it can be done in other ways, ID masks for alpha is not that good; also multiview was meant to support multiple custom cameras at some point -I think- that would allow to have just one scene to feed the compositor

And a more conventional setup works too... you can use the File Output node in compositor to export the other scenes, and load those Image Sequences as textures in cycles, all you need to do is set offset to -1 in texture nodes... there's a 1 frame lag though, and the first frame won't have any textures -and I had a couple of crashes-

https://www.dropbox.com/s/j83imtyszl6xvik/MONITORS_SEC.blend?dl=1


How do I know the parent of my selected object? I downloaded a car model and selected the steering wheel. I want to rename it now. Unfortunately, it is attached to some parent objects so I cannot find it in the hierarchy (see at screenshot). Is there a method how I find it without checking every object manually ?

Kind regards

You can read this information in the properties panel, Relations tab.


Convert 360 degree images into mesh I created several microstructures and took electron microscope pictures at a 45 degree tilt at all 360 degrees around the structure. I want to convert these images into a single 3d model of the structure but both ReMake and VisualFSM can't seem to do it (I think the contrast is too low). Is there a way to manually (or automatically) create a 3d model from these pictures??

Sometimes Blender is not the tool. As stated in the comments there are external tools dedicated to processing the described (detailed) input into the desired output. When these tools produce a file format that Blender can read, that's how you get the data into Blender.

This is not an endorsement of 3rd party software

Software like Agisoft Photoscan offers a python interface to let you sidestep the ui for automation purposes - but it's out of the realm of Blender support to discuss that unless there is a concrete question about interactivity between the two programs or APIs.


Object in different scene gets renamed without any warning I'm using Blender for creating game assets. "Empty" objects are used as placeholders for various things related to game logic like sockets, ports, etc. "Empty" is always child of mesh to which belongs.

Empty objects are named as "SocketFront", "SocketBack" etc. Suffices like ".001" are fine.

What is not fine is when I add new socket and name it "SocketFront", other object in different scene named "SocketFront" gets renamed to "SocketFront.001", without any WARNING! These "accidental" renames are big problem, because game stores these names in data files and suddenly cannot find "SocketFront" on that model it used to be.

Is there any way to prevent Blender behaving in such way?
I'd be okay with:

Changing the name of current object automatically (ideal)
Showing warning to me that such object already exists
Automatically naming all child objects with parent object name as prefix

No, this is how blender operates and also one of it's design flaws and known limitations. The software is not very forgiving, you either need to know what you are doing or learn by mistakes - it doesn't warn the user much, every button is basically a nuclear missile launcher (though recently a prompt to quit was added).

What you can do as a workaround is to have a watcher running on background (effectively slowing your blender) to notify you when a name is changed:

Execute a python function whenever the user interacts with the program

You can alter that script to check anything you want (even all the scenes for changes), as it is now it prints name changes of one hadrcoded object into the system console.


Can I export game from blender to unreal? Can I export my game made in blender from blender to unreal without any change?

There is no way to do that, no

You can Export the Scenes as FBX and import them, though. No game logic will be transfered.


Reselect faces that was already selected? How can I reselect faces that is already selected? I need to get selected faces, do something else, and then reselect those faces again. I tried this ,but it doesn't work.

import bpy

OBJ = bpy.context.edit_object
DATA = OBJ.data
FACES = DATA.polygons

#Get selected faces
FACES = [f for f in FACES if f.select]

#Deselect to see if selection works.
bpy.ops.mesh.select_all(action='DESELECT')

#Select faces again
for S_FACES in FACES:
    S_FACES.select = True

For this you can use bmesh:

import bpy
import bmesh

OBJ = bpy.context.edit_object
DATA = OBJ.data
BM = bmesh.from_edit_mesh(DATA)

#Get selected faces
FACES = [f for f in BM.faces if f.select]

#Deselect to see if selection works.
bpy.ops.mesh.select_all(action='DESELECT')

#Select faces again
for S_FACES in FACES:
    S_FACES.select = True

#updates viewport
bmesh.update_edit_mesh(DATA, True)

Hope this helps :)


How to do a lightcast only Layer in Cycles? I try to render a layer that only includes the light as if it was cast onto an object.

But it seams it is not possible to make a material that is invisible for the camera but bounces light from a certain light sources.

To put is simple I want to render a layer that only includes Emssionshader bounces from certain Lights.

best regards,
Wasabi

edit: I hope this makes it more clear what I want.

.blend for picture above

edit2:
And I already know how to do a Shadow/AO Layer but the light is difficult to distinguish as every pixel I render and is not Black is light. So i only want the Spotlight light but no world bounces or light that is 2-3 bounces "old".

edit3:
I faked the effect I am looking for with the asset I am working on.
This is maybe a better example than above.

I'm quite sure to not have fully understood your question, so before giving you some suggestions I would like to punctualize one aspect (as I have seen you are interested in compositing layers):

No transparency is involved in this scene, dark grey color of the plane/cube in shadow comes first of all from interaction of the plane/cube (diffuse white) with the world background light (which is colored dark grey). All the visible surfaces will produce a white alpha channel area.

You can remove the world influence on the scene by lowering the Background strenght to 0 or even completely remove the shader.

You can set the Max number of bounces of light allowed for each light source in the Lamp panel in the Object Data tab.

You could also tweak the "global" light path bounces, but you'll not have the precise control that the "per lamp" option allows.

By seeing your third edits I would suggest the following (more general) instructions:

Switch all lights off (Background too), except the light source you would like to isolate. All the light present in the scene is it contribution
Set the amount of bounces allowed for the light source (per lamp, or
globally if you are using an emission shader as a per object option
is not currently (2.75a) available)


Glass material not rendering as expected in Cycles The glass material in one of my scenes is not rendering as expected. It is a simple shadowless glass material I have used countless times. In an attempt to track down the reason, I created a duplicate of an existing scene (GlassCorrect.blend) in which the shader is working and deleted every object except for an eyeball with a glass shell, lights and a camera. Then I created a duplicate of my problem scene (GlassIncorrect.blend), deleted all objects and the world, and appended the objects and world from the first scene. The glass is rendering without any transparency, just reflecting the world around it. Please help me figure out what is going wrong.

Thank you.

GlassCorrect.blend
GlassIncorrect.blend

In this particular case you will need to check Shadows under Light Pass tab.


How to merge around 300+ duplicate materials? I just made a scene with a city made of mostly identical skyscrapers. I did that by copying and pasting. Then I joined all of them with Ctrl+J, but now I can't undo the join and I have got around 300+ glass and wall materials in one obj. My question is how do I merge them into 1 glass and 1 wall material so I can change all windows and all walls at once? Selecting them all is not an option. I have 1000+ windows in my scene and now in one obj.

Short version: I mucked up and now I need to clean up 300+ materials. How can I do that? Maybe an add-on?

edit: I tried deleting all but the first glass and wall. i had one skyscraper left that had colors.

edit2: my materials are in alternating order. like glass, wall, glass, wall, glass, wall.... i think you get the idea.

I have only tested this on Blender 2.82
This solution only works if you are trying to get rid of duplicates like mat.001, mat.002 … (etc.)
You should save your work before running the script in case it doesn't produce the results you want
Copy/Paste the code into the Text Editor and run the script
Once it has finished running, all of the duplicate materials (mat.001, mat.002 …) will be replaced with a single material which will be named mat.
import bpy

def replace_material(bad_mat, good_mat):
    bad_mat.user_remap(good_mat)
    bpy.data.materials.remove(bad_mat)

def get_duplicate_materials(og_material):

    common_name = og_material.name

    if common_name[-3:].isnumeric():
        common_name = common_name[:-4]

    duplicate_materials = []

    for material in bpy.data.materials:
        if material is not og_material:
            name = material.name
            if name[-3:].isnumeric() and name[-4] == ".":
                name = name[:-4]

            if name == common_name:
                duplicate_materials.append(material)

    text = "{} duplicate materials found"
    print(text.format(len(duplicate_materials)))

    return duplicate_materials

def remove_all_duplicate_materials():
    i = 0
    while i < len(bpy.data.materials):

        og_material = bpy.data.materials[i]

        print("og material: " + og_material.name)

        # get duplicate materials
        duplicate_materials = get_duplicate_materials(og_material)

        # replace all duplicates
        for duplicate_material in duplicate_materials:
            replace_material(duplicate_material, og_material)

        # adjust name to no trailing numbers
        if og_material.name[-3:].isnumeric() and og_material.name[-4] == ".":
            og_material.name = og_material.name[:-4]

        i = i+1

remove_all_duplicate_materials()

```


Instancing + modifier speed I understand that, when possible, objects should be instanced from a master object for optimal speed in both rendering and memory consumption.

Does this hold true for the Mirror modifier as well? If I have a mesh that is symmetrical on an axis, do I gain any statistically relevant speed (interface FPS or pre-render calculations) by using a Mirror modifier instead of the full mesh?

This is especially relevant when using subsurf modifiers over level 3 or 4, for example...

No, as far as I know there are no optimizations in place for constructive modifiers like mirror or array.
You do get some benefits in terms of workflow since you only need to do "Half the editing" and you may also get a benefit in file size, since only one half of the mesh is stored on disk.

Other than that I don't think there are performance benefits from those modifiers since depending on the settings the meshes they generate may not even be totally identical.


How to bake to vertex colors in blender cycles? The long way I do this is:

have cycles render selected
setup the materials of a mesh
create it's UV coordinates
create a new image and assign it to the mesh
bake
change from cycles to blender render
if in cycles you were using nodes for materials setup, disable it
setup the material as shadeless
go to the textures of the object and set the baked texture
go to object data->vertex colors and add a new one if there wasn't
go to bake options change bake mode to texture and bake to vertex color and finally bake it

This takes a lot of time to do and the final vertex colors bake will always have some vertex that are colored incorrectly because the UV projection was not perfect. Is there any way to bake in cycles directly to vertex colors?

There is a seperate addon to bake images to vertex color.

bake to image
use addon to bake image to vertex color

https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/UV/Bake_Texture_to_Vertex_Colors


Elliptical Movement of a Ball on a Narrow Edge I'm working on an animation where a ping bong ball rolls around the edge of a paddle then goes up the handle. I've been trying to create this animation with manual keyframes, but it's been tricky getting the ball not to glitch into the paddle. I was wondering if there is a way to simulate this rolling motion along the edge of the paddle and then bake the simulation. When I created the ball as an active rigid body, and the paddle as a passive one, then the ball simply falls off the paddle.

Use the Shrinkwrap constraint to automatically move your ball down to the surface of the moving paddle.

Note that the Shrinkwrap constrain includes a 'Distance' property and this can be used to control the distance from the paddle. This will be fine if the target mesh is concave and fairly rounded but can cause the ball to intersect with the mesh for convex or sharp edges.

To address this we can create an additional mesh based on the original one but 'expanded' so the surface is at a specific distance from the original surface.

Duplicate the mesh and add a Solidify modifier. Set the Depth to the radius of the ball - but negative so that the solidify is outside ratehr than inside the mesh. This will produce rather 'square' results so to round the edges add a Bebel modifier prior to solidify. Adjust the bevel on the generated mesh closely match the radius of the ball.

NOTE : Using Solidify in this way will result in geometry of the 'expanded' mesh that exactly coincides with the original mesh. This can cause problems with rendering so it's a good idea to move the faces slightly so as to offset them. To achieve this you can simply amend the Solidify 'offset' by a small amount - eg, -0.98 rather than the default of -1.00.

Optionally add a Subsurf modifier to round any remaining edges.

Finally, use the 'expanded' mesh as the target for the Shrinkwrap constraint on the ball. Parent the 'expanded' mesh to the original so that it moves in unison with it (select the 'expanded' mesh, hold Shift and select the orignal mesh, Ctrl+P, Set Parent to Object).

Now place the ball over the paddle and set up the Shrinkwrap constraint using Project mode in the -Z direction, setting the Target to the 'expanded' mesh. Moving the paddle under the ball should result in the ball following the surface of the paddle.

For added realism you can animate the location and/or rotation (if using Local axis space) of the ball in order to change the position on the paddle and move the paddle (in real life the paddle would need to be moved towards the ball to 'force' it uphill). If animating the rotation of the ball to make it appear to roll on the surface then set the Axis Space to World Space so that the rotation of the ball does not affect the location of the shrinkwrap projection.

Blend file included


Will Blender support design and dimensioning machine drawings? I am starting a search for software that can support mechanical design.  The CAD programs I have looked at tend to have arcane command language interfaces that make the job of design as much a programming exercise as a creativity tool.

My question is: "Will Blender support design and dimensioning machine drawings?"

If so, where do I go to learn more?

While blender is more adapted to creative modeling than technical or precision modeling you can create mechanical models and use them to create good looking blueprints.

In this youtube tutorial, the measrueit addon (included with 2.78 or can be manually installed on older versions) is used to create the measurement lines. The lines and annotations don't show in a normal render, but the addon provides a way to create a render with measurements.

Freestyle can also be used to create outlines for blueprints. This blendertuts tutorial explains how to define solid and dashed linestyles to get a hidden edge blueprint result. It is also possible to get more of a hand sketched result.

The CGCookie archives also has an old tutorial that manually creates text objects and lines to get the following blueprint.


blender 2.8: why do I need to scale 10x on STL export? I am developing a 3d model for a 3D print:

The unit system is metric, and the length is set to millimeters. In order to get the size right, I need to do the STL export scale of 10x:

which shows a "correct" model during Prusa slicing:

Why do I need to do 10x STL Export scaling?

I also applied the scale transformation:

Did you apply the scale transformation after adjusting the scale ?

ctrl+ A --> Apply scale

then try it


Limit length of a bendy bone? I am rigging some hair with Bendy Bones with the method found in this tutorial: https://www.youtube.com/watch?v=BsJ3Grq_3GM

I can control the hair by moving/rotating the tail bone. However, this allows me to stretch it. I would like to limit the length of the bendy bone so that it can still move and rotate, but never stretch the hair past its original length.

I can use Limit Distance constraint on the tail to stop it from stretching too far, but that does not take into account length caused by rotation of the head, and doesn't stop the length from getting compressed.

Here is the constraints setup, that will solve the issue. I used naming convention from the tutorial, so constraints visible on the image are added to the tail bone.


is there a way i can control which parts of the render have the glow? im trying to replicate something similar to below where near the exhaust the flames are extremely bright and towards the end of the flame it fades out. i got the glow to be amped up but i have no idea how i can go about controlling where the glow is coming from.

Use the threshold value.

Pixels that are brighter than the threshold will get the glow.

Values lower than those set by the threshold will not be affected.

Read: Any way to control light halos in the compositor based on emission level?


Is there a way to offset the default grid? I would like to offset the way the default grid is displayed.

Currently the thicker grid lines start at 0,0,0 and are spaced 1 blender unit apart.

I am not looking to alter the spacing, I would just like to know if I can change the thicker lines to start at .5 blender units away, either on all axis or just specific ones, say just x & y.

The effect of this assuming the offset is applied to all axis, should be a 1x1x1 thicker grid line cube with 0,0,0 at the center.

N key to open the Properties Display. Change scale to half Blender units. If you want add sub-division of 10 for example for the sub-units. Subdivisions are visible in orthographic mode.


How to create an oblique circle of points with Python? I created a program that define some vertices and faces and generate a cylinder in the Blender scene:

import bpy
import math
import mathutils

points = 10
step = ((math.pi* 2) / points)
x = 0
y = 0
current = 0
radius = 0.1
vertices = []
edges = []
faces = []
n_points = 5
n_step = 0
n_dist = 0

for iterator in range(0,n_points):
    for count in range(0,points):

        x = math.sin(current) * radius
        y = math.cos(current) * radius

        vertices.append((0+n_step,x,y))

        print("(",x,",",y,")")
        current += step

    for count in range(0,points):
        if(iterator >= 1):
            if(count != points-1):
                faces.append((count + iterator*points - points, count + iterator*points+1 - points,  count + iterator*points + 1, count + iterator*points))
            else:
                faces.append((count + iterator*points - points, count + iterator*points - (points-1)-points, count + iterator*points - (points-1),count + iterator*points))

    n_step += 0.1

object_mesh = bpy.data.meshes.new("object_mesh")
object_mesh.from_pydata(vertices, edges, faces)
object_object = bpy.data.objects.new("object", object_mesh)
scene = bpy.context.scene
scene.objects.link(object_object)

Following this philosophy I would like to generate a structure that is not just a cylinder but it's a bit more complex and it's shown in the following figure:

Each of the line in the figure is a circle of points points and they are connected exactly the same way I connected the points in the cylinder with my code. Generating the four sides shouldn't be a big problem but I can't understand how I can generate the oblique circles.
Just to make an example if this code create the upper part of the figure I am achieving, replacing the line vertices.append((0+n_step,x,y)) with vertices.append((0+n_step,x-0.5,y-0.5)) can generate the down part.
With some inversions, I think I can generate the side parts but how can I manage the four oblique circles?
Notice that I have to generate the circles in order if I want to add the faces as I am doing now. Of course I am opened to alternatives.

The following code creates the "oblique circle" that you need in the plane x=z, which, actually, is not a circle but an ellipse (the intersection of two cylinders):

for count in range(0,points):

    x = math.sin(current) * radius
    y = math.cos(current) * radius
    z = math.sin(current) * radius

    vertices.append((x, y, z))


The Density of Particle System is inverted between viewport and render I am following the Donut tutorial by BlenderGuru. I have setup my particle system by weight painting the donut. The Density is set to the correct vertex group, not inverted, and the image looks great. However as soon as I try to render, and only in the render, the density of the particles inverts. It's all good in the viewport as shown in the images.
The image on the left is the rendered image and that on the right is what I see in the viewport.

How do I get them to match up. Thanks for the help.
Here is the other information in case it's useful:

If you look at the "Density" entry, on the far right, there is an open diamond shape, and the <-> is orange.  This means that you have set a keyframe on density.

You need to clear the keyframe.  If you have a playback window, go to it and select all of the keyframes with the a key.  Then hit the x key and select "delete keyframes"

You can tell that this worked because the diamond and orange will disappear:


Custom layout disappears 2.77a So I move stuff around to my liking.
Change the theme to my preferred look.
I Go to User Preferences>File> uncheck:(Load UI).
Hit [Save user preferences]
Hit the + next to default and rename my own layout.
Close and reopen, the theme stays but the layout is back to default and my own custom layout is deleted from the list.

BUG or I am doing something wrong?

Once you setup the user interface to your liking, pres CtrlU to save as startup file.

Then enable Load UI in the system preferences, and press Save User Settings, so that every time you open blender, it will use your modified UI.


Checking if a vertex belongs to a vertex group in python I'm trying to check whether or not a vertex belongs to a particular group, I've seen a couple methods, I'm wondering why the following does not move any vertices.

for v in ob.data.vertices:
  if v.groups.find("Group") >= 0:
     v.co[0]=5 + offset

Just to be clear, There is a vertex group with the given name with vertices assigned, but nothing is moved.  Am I using the find method wrong?  Or totally misunderstanding what it's supposed to do?

What you basically want is something like this:

import bpy
ob = bpy.data.objects["Cube"]
gi = ob.vertex_groups["Group"].index # get group index
for v in ob.data.vertices:
  for g in v.groups:
    if g.group == gi: # compare with index in VertexGroupElement
      v.co[0] = 5

v.groups is a collection of VertexGroupElements. VertexGroupElement contains group (as index) and weight (as float [0,1]).

find can not find anything, because v.groups does not contain any keys.


Dyntopo destroying mesh when scultping Sculpting all day no problem, symmetrized the mesh, everything was still fine, then all of the sudden dyntopo caused deformation and with continual clicks complete destruction of the mesh.

I tried playing with the normals and merging vertices by distance and still had the problem.

Dyntopo dynamically changes your mesh topology as you sculpt. It looks like you have collapsed the mesh detail in the chest area, maybe while zoomed out.

The settings that control how your mesh is altered are the detail size, the refine method and the detailing type.

The detail size determines how long any mesh edge should be.
The detailing type determines what measurement to use.

Relative detail is based on screen pixels, as you zoom in and out the size of the edges changes.
Constant detail is based on blender units, keeping the same size as you zoom in and out.
Brush detail is based on the size of your brush, resizing the brush changes the detail size.

The refine method determines what action to take.

Subdivide edges will only add new edges to achieve the detail you want.
Collapse edges will only remove excess edges that are not needed for the detail level you are after.
Subdivide Collapse will dynamically add or remove edges.

Note that each detail type uses a different type of measurement, changing this can lead to different levels of detail, with only constant detail offering an eyedropper to set the value to match an area of your mesh.

While you are unfamiliar with dyntopo, I would recommend keeping the refine method to subdivide unless you specifically want to reduce the detail. By using subdivide collapse it is too easy to remove detail while you are zoomed out for an overall appraisal.


How to view subdivision lines in 3d perspective grid? I have just installed blender 2.71 and was playing with the grid settings in the display panel. No matter how far I zoom in or out, I am unable to see the subdivision lines in perspective mode. How can I view them?

This image from a tutorial on katsbits.com, you can see the subdivisions in the grid floor. Notice he is in perspective mode.

To get major/minor grids in perspective mode like the image in my original post, simply change the lines setting from the default 16 to something larger (like 100). Basically you are only seeing the minor lines in default view. By adding more lines you will see the major grid appear.

Thanks to everyone for your help.