Any simple way to apply a color index (to achieve things like 256 color range) across an entire render? I am wanting to make some animations that have a reduced color range (similar to 80s/90s CGI.)

I know of ways to reduce that for still imagery such as in photoshop, but I know of no ways to do this within Blender. The only color options change the color from 8 to 16 bit.

Is there a compositor node to do this, or would I have to batch edit every frame separately than compile later into a movie file? Or is there another program better suited for this like Final Cut Pro?

I assume from your question that you're just seeking to emulate a certain look, and you're not seeking to actually output that data into a file format with reduced range. In other words, it shall look like it was an image with reduced bit depth, but in fact it's a normal 8 bit jpeg or png that you're outputting.
If that's the case, that look could somewhat be emulated using node groups. I've put together a little demo with a Suzanne head and a random image (Agent327 header from the Blender.org homepage), which run through a custom node group:

Please keep in mind that the node group does not do any sophisticated range mapping. There is no analysation of surrounding pixel data to produce an image which is as close as possible to the original. It really just tries to add the - usually unwanted - fake posterization.
To do this, the image needs to be split up into its individual channels, as we want to work on the mathematical values there:

You'll see two things in this tree:

using separateRGB and combineRGB nodes, I split the channels into its individual components, and then run each through a custom node group
There is a Power function involved (Gamma). What I'm doing here is mangling the Display Referred pixel values instead of the scene linear ones. The mapping to target values looks more natural this way. You can mute both gamma nodes to see the difference when testing with the photo. This also means for you that you need to take care what you feed the node group with, as it expects the input to be within a 0.0 - 1.0 range

The channel node group itself looks like this:

The user outside of the node group sets a number of colors per channel. But the range the group works on starts at 0, so a 0 - 7 range = 8 colors. That's why I subtract 1 at the beginning of the tree.
Then comes the actual trick. The values are multiplied by the number of colors. So now, the channel values range from 0.0 to 7.0. But usually they are something like 3.76622. Now, that value is going through the Round node. There, 3.76622 becomes 4.0, while 3.422 becomes 3.0. By that, the channel values are spread apart, the smooth interpolations disappear, posterization happens. The result is divided again by the number of colors, to get back to 0 - 1 range.
Result:
Input:

Output (with 8 colors):


How to attach an animated object to a rig? I have an animated emergency light that should stick to the head of a little robot. Is this possible without rigging it? The robot is rigged with bones.

Yes it's possible

Select the lamp
Shift+Select the armature
Enter into Pose mode (Ctrl+Tab)
Select the bone you want to attach the lamp to
Ctrl+P and select 'Bone relative'


Fixing normals without getting in edit mode I'm modeling a complex object,i did the high and low poly versions of this object and now i'm going to bake the normal maps ,but i've got a problem. I Split this object in a couple pieces,then i joined them together. I did for the lowpoly version, some normals got inverted, so i went to Edit mode>Control+N and it got fixed. The high poly version got those inverted normals aswell when i joined the pieces, however when i try to Edit mode>Control+N it crashes the whole PC because it has to many quads. I have a quite good PC for modelling (Core I5 3470/ GTX 760 / 12GB RAM)

I was wondering if there any way to fix the normals without getting into edit mode. Can you guys please help me? Thank you in advance

As far as I think that @bertmoog could be right I will try to answer your question and propose Add-on called Flippist from Alexey Khlystov.

Download Add-on from link above and install/enable it as usual.
Select one (or multiple) object.
Hit Spacebar, then type Flippist.
You can change settings by pressing F6 or in Tool Shelf.


How do I add a specific number of loop cuts? I know you can add a loop cut using Ctrl+R, but I want to know how to specify how many to add, i.e. add 15 loop cuts to a plane. I know you can manually use the scroll wheel to get this number, however this can be quite tedious.

Related: Increase number of Loop Cuts - Apple Magic Mouse

You can do this simply by typing the desired number (1 then 5) after pressing Ctrl+R and before left-clicking to complete the operation.


Why is Blender 2.8.1 constantly crashing when I select CUDA and Blender is not even in rendered view? I am a beginner to Blender. It has been working perfectly fine until yesterday when it suddenly started crashing when I select CUDA for rendering. I have even tried being in solid view so that is not even rendering shading/textures and it still crashes! I have repaired the software and reinstalled it all together. Could the blend-file possibly be corrupt?
I have a Razer Blade Stealth with an Intel Core i7-7500U CPU @ 2.70GHz with an external GPU NVIDIA GeForce GTX 1080 with 8.0 GB. The memory on my computer itself is 16gb.
I am mostly confused on how it was working well the other day and now it will not even let me select any CUDA selections.
P.S. This is for using Cycles (which was previously working). It does this even with the default factory settings.

If you open the default blender file and it crashes on Cycles, you know it's probably not a corrupt blend file unless you saved user defaults with some setup that it doesn't like. Blender 2.82a is out with bug fixes and new features so I highly recommend getting that instead of using 2.81. Using this new version should also reset you default blend file in case you saved user defaults with corrupt settings.

Even a simple shutdown and reboot of your machine can help. You can also try unplugging unnecessary peripherals and re-seating the connections of any peripherals that are questionable (you mentioned you're using an external GPU).

If that doesn't work then getting the most recent everything (software driver updates, firmware updates, system software updates, and 3d software updates as mentioned before) could help. Best wishes!


Arrow Flow Animation I really need a water flow animation exactly like this.
I'm already using follow path, curve and array modifier but the result not as expectation.

Here's the exact sample I wanted:

My result the array is not following the curve path:

Array + Curve modifiers should make it work:

In Edit mode make sure that the curve direction is good, if not press W > Switch Direction.
Put the origin of the curve at its beginning point.
Put the arrow object at the same point.
Give your arrow an Array modifier with as many Count as you want and choose the Offset (distance between the arrows).
Give your arrow a Curve modifier, choose the Curve as Object, and choose the right Deformation Axis.
Move the arrow along the X or Y axis, depending on the orientation of the curve on the scene.


How to create an arch (vault) that is curved inside? I've been struggling for several weeks' time to get this right. I have ideas, but nothing that is efficient to get the same look. I tried using half-spheres and cuts from spheres to do it, but I just can't get it to contour correctly without going the only way I know: vertex-by-vertex placement for the shape. I tried other ways (like "stealing" the edges and extruding them), but then I can't bevel them correctly to make them curved). I can manage the profile, but not the arch. Here's what I'm trying to do:

Any help is super appreciated!

EDIT:

This is the idea. Extrusion was a possibility, but something that was simple that would fit the window profile is what I was aiming for. My attempts to get them fit the profile didn't look good because beveling wouldn't work if multiple faces were extruded from the vertices of the window profile. So, manually placing two triangles and connecting them with vertices was how I managed to go about it, but it was tedious to do. Obviously I now know how to do it efficiently thanks to the answer provided below.

A Gothic vault is usually the intersection of Gothic arch prisms. For the basic shape:

Starting with a quarter of a circle, Z up, X accross, snap set to Vertex' and'Active'

Duplicate the vertex on X=0, drop it in Z, to give something to snap to
Under a mirror modifier in X with 'Merge' and 'Clip' checked, select all the vertices on the arc with the desired peak vertex active, and GX snap the half-arches together.

Discard excess vertices, and E extrude in Y

Create an empty at the origin, in this case, rotated in Z by 45 degrees
Assign an Array modifier ('Merge' and 'First and Last' checked) to the extrusion, Object Offset, with the empty as target.
Here, I used the shipped 'TinyCad' add-on to create the vertices shown active, at the intersection of perimeter edges.
K with Z cut through, from the new vertex to the center.

Select the external faces to be retained, CtrlI invert the selection, and X delete unwanted faces.
Here, I've also K with C to constrain to horizontal in a top view, cut the circumferential edges
If you want to bevel the peaks and troughs, select the edge-loops before applying the modifiers to a copy of the object, and bevel after applying.

The result.

Obviously there may be other actions you want to take while under the modifiers, to tweak / decorate / create suitable topology for columns, etc.


Random bright pixels are being rendered i get these weird pixels when rendering an image here is an exanple i whipped up.

not sure of the cause i'm fairly new

Those are refered to as fireflies - search for "reducing fireflies" for ideas of how to reduce/remove them. They look like the result of Caustics - the light reflected or refracted from (usually curved) surfaces. You can disable Caustics in the Render settings Light Paths panel - disable Reflective Caustics and Refractive Caustics and see if that helps. Alternatively, significantly increase your number of samples - but bear in mind you need a lot of samples to render good quality caustics.


Generate Particles with Random colors (continuously or from a set) I am trying to do rocks and I want them to have a random base color from within the colors that look "rocky". The only method I know of is to duplicate the base objects over and over and give each a different color in the node editor, then group them all and use them as the group input for the particles. This is slow, inefficient to change, duplicates a lot of data, and comes out with a uniform distribution of the colors. Is there a way to have give particles a random color from a set or range?

I'm going to keep this short and simple. Do everything Duane Dibbley did but use an Object Info node instead of a Particle Info node. Connect the random output directly to the color ramp, no math node needed.

Pro Tip: Make sure that if you are using a color ramp set to constant that you don't put any colors at position 1 (all the way to the right). They won't end up being used.


How to inset a face? I am trying to set up a Minecraft rig mouth that will have more controls and will be rounded, but I am having issues trying to figure out what this guy did here. First, he did what looked like a loop cut and slide, but instead of drawing a line it selected all the edges it passed through. He then cut to a new clip where the mouth was already set up like this.

The video is in 3 times speed but if you download a youtube plugin you can slow it down to 0.25 speed of the video and then if you do the spacebar trick you can slow it down so it shows 1 frame at a time and it is really slow. Here is the link if you want or need to see the video.

All I am asking is how can I create those 8 basic segments.

You could use the Inset tool (I):

  This tool takes the currently selected faces and creates an inset of
  them, with adjustable thickness and depth. The tool is modal, such
  that when you activate it, you may adjust the thickness with your
  mouse position. You may also adjust the depth of the inset during the
  modal operation by holding Ctrl.

Select the faces to inset:

Press I to inset:


Why is my Normal map not working? Only Bump seems to be showing the concavity I'm looking for (not with the same map, I use an inverted version of the B&W spec map you see in the nodes setup).
But the moment I switch to Normal (the nodes setup below), not only the concavity won't show, but the glossiness is gone!.
This Bump is not too shabby, but Normal is supposed to be better. Plus not knowing why is not working is killing me!
Should you want to inspect a simple blend file  I made, by all means!

Thanks in advance guys!

JDL

As the others have said change your normal map image from "Color" to "Non-Color Data". Also your normal map should be hooked up to the diffuse through the normal dot AND the normal dot on the glossy shader.


How to populate UIlist with certain collections? I'm trying to understand how to populate an UIList with certain collections based on their name. I am trying to extend this very useful answer by @batFINGER In addition, I would like to be able to show a button/operator alongside each collection shown in the same row, if that's possible. Based on this answer collections can be iterated and returned using a BoolProperty:

import bpy

def traverse_tree(t):
    yield t
    for child in t.children:
        yield from traverse_tree(child)

coll = bpy.context.scene.collection

for c in traverse_tree(coll):
    if c.col_prop.tag:
        print(c.name)

class CollectionPropertyArchive(bpy.types.PropertyGroup):
    tag: BoolProperty(default=False)

def register():
    bpy.utils.register_class(CollectionPropertyArchive)
    bpy.types.Collection.col_prop = bpy.props.PointerProperty(
            type = CollectionPropertyArchive)

def unregister():

    bpy.utils.unregister_class(CollectionPropertyArchive)

Q: How to populate an UIlist with certain collections?

Go get the UIList for materials for 2.8x from Create an interface which is similar to the material list box

Set the type of the PointerProperty to bpy.types.Collection in order to store a pointer to the collection per item added to the PropertyGroup. No matter if the user adds new objects, changes the name of the collection or anything else, it always returns the reference added to the list:

class CUSTOM_objectCollection(PropertyGroup):
    #name: StringProperty() -> Instantiated by default
    coll_ptr: PointerProperty(
        name="Collection",
        type=bpy.types.Collection)

Edit the draw_item method to display the items properly (you can use a label too):

def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
    split = layout.split(factor=0.3)
    split.label(text="Index: %d" % (index))
    split.prop(item.coll_ptr, "name", text="", emboss=False, icon="COLLECTION_NEW")

The last tiny bit you have to implement is a new operator to append the collections to your UIList. To get the idea I modified CUSTOM_OT_actionsoperator to add the active collection to the list. Just add a new item and assign the collection object to the coll_ptr variable declared before:

if self.action == 'ADD':
    act_coll = context.view_layer.active_layer_collection.collection
    if act_coll.name in [c[1].name for c in scn.custom.items()]:
        info = '"%s" already in the list' % (act_coll.name)
    else:
        item = scn.custom.add()
        item.coll_ptr = act_coll
        item.name = item.coll_ptr.name
        scn.custom_index = (len(scn.custom)-1)
        info = '%s added to list' % (item.name)

    self.report({'INFO'}, info)

Once a few items have been added to the list, you can use the console to make sure all is working. You can easily print the names of the collections, the objects per collection or whatever...

>>> for coll in C.scene.custom:
...     print (coll.coll_ptr.name)
...
Collection
Collection 2

>>> for coll in C.scene.custom:
...     for ob in coll.coll_ptr.objects:
...         print (ob)
...
<bpy_struct, Object("Cube")>
<bpy_struct, Object("Light")>
<bpy_struct, Object("Camera")>

To set the selected collection of the list as active collection in the Outliner, you can use a callback for custom_index property see: https://docs.blender.org/api/current/bpy.props.html#update-example

Note: You don't need that extra bool, just add the collection to the list when adding a new one to the scene.


Animating Material Nodes in the Game Engine Is there a way to access object properties or any other properties from the material node editor?
Can a value assigned in Material Node editor be changed using python while the game is running?

The easiest solution is to use Object Color. This can be accessed both by python and by the node editor, and gives you access to three per-object values.

In UPBGE you can access object color using the ObjectData node:

In normal BGE you have to create a shadeless white material with object color enabled. Remember to make the diffuse color white, otherwise the color is multiplied (by default) by 0.8!

Slightly unclear from the image is that there are two materials: the shadeless object color one, and the node one.


How to add custom function to pre-existing buttons in Blender 2.8? I am trying to make it so that pressing the "Play Animation" button would set my custom boolean variable to true and pressing the "Cancel Animation" button after would set the same boolean variable to false.

How would I go about linking my custom function to a pre-existing button so that it is called when the button is pressed?

Why reinvent the wheel?

If you press play the pause button is shown and vice versa.  Turn on developer extras and view source and will find

if not screen.is_animation_playing:

to draw the pause button. screen is the context screen.

Hence your boolean property could be replaced by or driven with bpy.types.Screen.is_animation_playing

Notice it belongs to screen not scene as it can be set on a per screen basis.


Why can't I move vertices? I'm a absolute beginner to Blender and I don't know how to move the vertices. I only have a one-click mouse. I tried to see others comment but no use. The B key doesn't work for my computer.

When you have selected a vertex, press G to move it.
But in your case I'm not sure you going to come far with a 1-click-mouse.
In addition it's a good idea to read the blender documentation or watch some tutorials about blender on YouTube to get an idea of what you are doing.


Animation will not render in 2.83 or 2.9 despite set keyframes being set in viewport and pose mode Here's the link to my file (don't worry about the textures): https://drive.google.com/file/d/1PyYTDLBEUdPtc7opcM9FJ6vaLi8TXXWD/view?usp=sharing
The rig isn't totally mine, it's a modified version of RoyalSkiesLLC's rig that I adapted for my own use. The problem is that in any version newer than 2.82 the rendered animation will only show whatever pose I had on my viewport timeline throughout the render. For example if I had my timeline set to frame 1 the whole rendered animation from frames 1-30 will only show my pose from frame 1. I have no idea what to make of it, I spent a long time customizing the rig, but I would have to go back to 2.82 to use it. For mor current versions (which I would like to use) may have to construct my own from scratch or through rigify or blenrig, but that would lead to even more tweaking and customization not to mention my inability to customize generated rigs to my liking. I would appreciate any help, thanks!

Turns out, disabling the wiggle bone add-on did the trick, it was all my fault.


Gizmo UI looks too small In Blender my Gizmo looks like this:

But everyone else's seems to be like this:

I don't know what I messed up. I went over Preferences > Themes but only found settings fo Gizmo colors. How can I make my Gizmo big and easy to read like the image shown?

Under User Preferences > 3D Viewport > Display you can control the 3D Viewport Axis gizmo display type.

Three options are available: Interactive Navigation (the default), Simple, or Off.


Problem with positioning object relatively to another object I would like to position one object B so its left surface get in contact with the right surface of object A.
I have defined object A with dimension for X: 10 and set it to position (0,0,0) :

I have defined then defined object B with dimension for X: 140 and set to position ((dimension A + dimension B)/2, 0,45), so (75,0,45) :

However as you can see in second screenshot, the respective left and right surfaces are not in line (concerning the X position) (I increased Object B Y position to make the problem more evident).

I also had a look on using some building constraints by specifying that the B left surface should be in the same plan than the A right surface but didn't find it.

I finally found what causes this problem.
The object origin was not right for both objects.
https://docs.blender.org/manual/en/dev/editors/3dview/object/origin.html

For each object :
Panel:  Tool Shelf ‣ Tools ‣ Edit ‣ Set Origin
Menu:   Object ‣ Transform
Hotkey: Shift-Ctrl-Alt-C
-> Origin to Geometry

However I am still curious if there is a smarter way to specifies that 2 faces should be on the same plan.


Object not zeroing out to the center of the grid I am having an issue where an object is not zeroing out to the center of the grid. it is not parented to anything and its pivot point is where it is pictured in the image...

Appreciate any help!

With moving object to center and freezing location, the pivot moves up to where it thinks 0,0,0 is...

Blend file for download:

You have set delta location in the Delta Transform rollout which is now adding transforms to the current location.

Reset it back to 0 for all the options and origin point will be moving to 0 once location applied. This can be done either manually or via Ctrl+A menu > Location To Deltas after you snapped selection to cursor (which should be in the desired location already, center in this case).


BlenRig 5 - turn off Hand IK parenting working with Blenrig 5, trying to animate a scene with a table. Would love to have the character grab the table, but the hand ik's are parented to the torso, and I'm not seeing a good way to switch that off.

In the arms tab under the extra properties in the addon, I'm seeing a free option for the arm pole targets, which has the functionality I'm talking about... I just can't find it for the hands themselves.

Is there a good way to deal with this, or does Blenrig not support this? Any thoughts?

On the Blenrig body picker, where it says arm_L and arm_R just change the hinge to 1.


What is the difference between Set Render Border and Set Render Border Camera Only? In version 2.79b, and when in the 3D Editor area, two shortcuts call view3d.render_border with a parameter camera_only:

ctrlB sets the parameter to False
shiftB sets the parameter to True

The later shortcut is actually assigned to two functions in the user preferences:

so, for the purpose of this question, I've disabled temporarily "Zoom to Border", to allow "Set Render Border" to be called. The configuration is:

My understanding:

Those two Set Render Border shortcuts allow to define a rectangle in the one of the 3D view (not necessarily Camera view).
The result is visible in the rendered image (F12) and/or in the 3D view but only when in shading mode "rendered"

In practical, when using any of them:

In the 3D view, only the rectangle is shaded in "rendered" mode, the rest is shaded in "solid" mode.
In the rendered output, only the rectangle is rendered, the rest is empty.

My question: What is the difference between the two shortcuts? Or is shiftB (camera_only = True) an unintentional leftover?

SHIFT + B lets you select a portion that you wish to see in the final render image or in the camera view.

CTRL + B lets you select  a portion you wish to see in the render view mode. to then delete the border is CTLR + ALT + B

while CTLR + B works also in camera mode, SHIFT + B if is not in the camera view mode acts as a zoom tool.

CTLR + B does not affect the camera view or the final render. unless you are already in camera view


Remove a verticle in a tricky place I didn't know how to describe my problem in the title, so I'll try to do it here. Below I have a project. I needed to take a small piece from the middle of the object, and I couldn't get sculping to work, so I just used knife tool and excruded after I had created what I wanted.

Now, when I'm finally rendering, I'm getting unwanted things on the render result, caused by these extra verticles. Is it possible to remove them? I tried making the holes new objects, but that didn't really work.

Oh and, with 'verticle', I'm refering to the line that connects the hole into the rest of the object.

http://www.filedropper.com/blend1 (a link to the blendfile)

The top and bottom vertices are missaligned.

Select all the top vertices and tyoe these letters:

 s ,  z ,  0  "Numpad zero". Not at the same time.

This will aling all these vertices in the Z axis.

Repeat these steps at the bottom vertices.

See the image below:


Insert Edge Loop without modifying underlying weights? New to Blender here!
Just a quick one: I'm wondering if it's possible to insert an edge loop on a mesh that already has weights painted without modifying the underlying weights. What I've discovered is that inserting an edge would change the weights corresponding to the newly inserted edge. Is it possible to have the edge exist without having the weights modified? Thanks.

If you want them untouched, lock all vertex groups before inserting the edgeloop.
In any case the new edge loop will receive its weights from the nearby vertices (but you can remove them, if needed).


Does anyone know how to fix random tracking errors in Blender? I am using this as a last resort, since I have been reading forums and trying over and over again, and have watched just about every YouTube tutorial. Blender is giving me such random results on my tracking that it appears to just be absolutely broken.

I printed and used some good tracking sheets. I mean, from where I was before with tape, the tracks, visually anyhow, look very clean. When I scrub through, it pretty much stays within 1 or 2 visible pixels.

So at first when I solved, i was getting about 1.7 average error, which i have, with much frustration, been trying to improve upon. But I can stay at the same settings that I got the 1.7, and it swings wildly up to 200 average error, to erroring out saying it cannot reconstruct. Literally without changing a thing, or, changing and going back to the previous setting. Won't ever go back to the 1.7.

I have stabilization off, set at 1920x1080 60fps, video frames rendered to an image sequence as EXR, have tried a lot of different ways here, and I still just get absolute randomness. Video made is from a Pixel 4XL, and I hear "reviewers" talk about how awful the videos from the phone are, but man it seems pretty solid visually to me, so I will try using my SLR full frame camera and see if all these issues just go away, or if i still get complete randomness from Blender. Anyone else seen these wild swings in results and know of general ideas of why Blender reacts this way?

Thanks for the input. I do not find the answer helpful, however I do appreciate you took the time. A solid track visually means it is following the same point, even down to a pixel or two. I have used tracking a while not, and in Blender 2.7x I was pretty good at getting the results I needed.

I recorded the video again, only with an SLR full frame sensor and 17MM lens, not on a tripod. I literally didn't have to keep adjusting the tracking points as it was able to follow the tracks with ease, even though VISUALLY it looked the same as the other video at the zoomed level. There is clearly much more detail in the videos than Blender leads you to believe in the rendered preview of the video.

However, while i do not expect an actual answer to my question on Blender being broken, my follow on video that I had success with still suffered the same random wild throws in camera solve. I was getting 80.72 average on everything (16 points), even though it tracked phenomenally, no matter what settings I changed. Then, all of a sudden, when I changed the settings back to what I had started with (auto keyframe, refine k1 k2), which is what I expected would work in the first place, the camera solve jumped from the constant 80 to a solid .32 after just pressing solve camera over and over out of frustration. Out of the blue, really did nothing but kept trying to push solve camera, and wham. Nailed it at .32. So, again, i am not sure how to report bugs, but I will look into it.

Blender's trackers and 3D reconstruction are quite robust and advanced, but it is hard to pin down what is happening without access to the video you are trying to track. "Solid visually to me" can mean anything or nothing at all.

Solid reconstruction is only possible with accurate camera tracking.

Common mistakes are:

-Trying to track blurry or distorted video, or video where the tracked elements move to far from frame to frame, for that you need to enlarge the search box.

-Expecting 3d information out of shots where the camera is stationary (where the video was taken from a fixed place and the camera just pans and tilt without any displacement). For those shots you can use "Tripod" Solve, but know that there is no way to get 3d information out of such shots. It is considered 2D tracking as you will only get the camera movement but no real 3d reconstruction.

There is a very detailed post on this site that you should read to troubleshoot your problems.

How can I get better results when doing camera motion tracking?..


How can I achieve box projection with blend for procedural 2D textures using only nodes and without using UV map? How can I achieve exactly that mapping, without UV and with only nodes?

This is the closest that I achived.
And it is not bad, but blending doesn't work. And it is very hard to come to a solution how to implement it in a performance efficient way.
Whole node set up.

"Blend" is a 0-1 range value, with 0 corresponding to nearly no blend and 1 corresponding to a pretty loose blend.
Not appropriate for anything feeding displacement, as normal depends on displacement; if you need box mapped displacement, bake a UV mapped texture.
Can't really make out your nodes to see how similar that is to what you have.


Rendering issue (JPEG artifact on characters mouth/non-transparent background) how do I fix this? I am rendering a Roblox character in Blender to make a GFX. I seem to be continuously running into this issue, no matter how many times I re-render the image. How do I fix this?

are you using a jpeg as the mouth's texture, or as render output?

Anyway, jpeg is a really harsh lossy picture format. There is always a quite noticeable loss with it.

I recommend you read the Blender Manual's page about the Supported Graphics Formats. Starting by this very simple yet quite true Hint:

  If you are not interested in technical details, a good rule of thumb for selecting output formats for your project is:

  Use OpenEXR
  if you intend to do compositing or color grading on these images.
  Use PNG
  if you intend on-screen output or encoding into multiple video formats.
  Use JPEG
  for on-screen output where file size is a concern and quality loss is acceptable.

  All these formats support compression which can be important when rendering out animations.

TL;DR : don't use jpeg if you care about quality.


How to make moving fog I tried the mist effect and the smoke simulation but didn't like the results. What I want to achieve is a static fog like the fog in this picture.

Steady but also moving slowly on the surface of lake.

Crate an object that will act as domain and assign it some volume scattering as detailed on this answer

Then use some texture to make the fog less homogeneous, and animate the mapping for it.


rigging problem connecting two bones at the tail how can I connect the tail of a bone to another tail of a bone?

This may sound like a bit of a cop-out, but you don't have to.

If you want those heads to stay in the same position, use a Copy Location Constraint, instead.


Strange artifacts on cycles render Do you have any idea what is causing these artifacts on my cycles render?

I'm using a sun light source to illuminate the scene.
128 samples.

I've pasted a screenshot of the material that the artifacts are happening on

I solved the problem by raising the samples count to 400


How do I change the default location Blender opens when I want to install an add-on from file? In case a picture can help to clarify, I am specifically hoping to find a way to alter this location, which seems to default (on Windows) to the current user's Documents/ subfolder:

Ohh I see. So to change this, you may want to go to the File tab in the USER PREFERENCES. To change the location Blender defaults to installing add-ons from, you need to change the location of the render cache. This can be done by clicking on the Render Cache file preferences in the file tab, and choosing a location in your computer or on an external drive. This should solve your problem.


How to create two edges out of an edge? I'm having trouble modeling a somewhat simple shape. What I currently have is this:

And what I'm trying to get is this:

What would be a way to do this? I can't just extrude the bottom faces, because I want them to stay connected to the main body of what I'm modeling. I'd like to do this without any ngons or hacky tricks, it seems like something that should be fairly easy to do.

There can be many ways to model this; if original shape should be preserved, the steps may be as follows.

Select bottom edge which you'd like to make 2 from. Press Alt+D to extend vertices.

Select 2 resulting Ngons, press Ctrl+T to triangulate them, and then Alt+J to get rid of tris and convert them to quads.

Add loopcut to refine model, dissolve resulting and not needed edges.


Does the compositor have a node that will let me switch between images containing alpha channels? Maybe I am missing it but I can't find a compositor node that simply lets me switch between 2 images including the alpha channel based on a factor.

Here's a simplified setup description:

I have a background image and two overlay title images, titleA and titleB, that have alpha channels.  I want to be able to overlay either titleA or titleB over the background according to a factor.  I.e. when the factor is 0 I want titleA overlayed, when the factor is 1 I want titleB overlayed.

It is easy enough to use the Mix node to switch the non-alpha channels.  But I can't get it to switch the alpha channel.  It seems to be able to give me only either the alpha from titleA or titleB or some combo of the two.  Alpha Over doesn't seem to do this either.

Here's the simplest version of the setup I've tried.  I'm using a Value node to change the factor between 0 and 1.  Here it is with 0:

Here it is with the factor 1:

Note that the alpha channel from titleA is being used instead of from titleB.

This is the crux of the problem.  The Mix node outputs the alpha channel of only one of the inputs here.  It doesn't switch them like the image.

Also, note that in my real project I have a cascade of titles that I sequence using a Time node and Math(Greater Than) nodes.

I do have a workaround for this where I create a parallel set of Mix nodes just for the alpha channels.  That works.  But as I need to do a much more elaborate version of this with time curves, etc., I don't really want to have to maintain duplicate networks for alpha channels.

Here's what I came up with: Stripping the Alpha channel only to recombine it later using mix nodes. Changing the Value node does the switch:

If you group the nodes it becomes simpler to combine multiple instances;


Why does my displacement look inverted in Eevee? I downloaded a BRICK texture pack, which came with a diffuse image and several maps.
(This is all in eevee).
After experimenting a little, I decided to use the diffuse and displacement maps. I applied them onto a cylinder, starting with the diffuse image. It looked ok, sorta like this:

Then I proceeded to apply the displacement map, which gave me this:

I was satisfied with the look, but then I noticed this:

The texture on a certain PART (around 30% of the curved face) of the cylinder seems to have been "inverted" in the image above. All the bricks in this section clearly seem to "go into" the screen, rather than "come out" of it.
Here is my question: What is causing the issue, and how would I go about fixing it?
Also, if it is of any help, I noticed two jarring "lines" enclosing the inverted part of the cylinder (kinda like two boundaries), which, interestingly, had no shadows, meaning they aren't affected by the displacement map. One of the "lines" looked like this, (with the inverted part on the left, and the ok part to the right):

The other line is not in this shot. It's located a little to the side, and looks exactly the same.
P.S.: the file -

This is happening because you are using a Vector Displacement Node. For traditional displacement, connect the texture to the height input of a regular Displacement Node and/or the height input of a Bump Node. You can use either one, or both, however, for EEVEE, I find the Bump Node arrangement on its own to be sufficient 99% of the time.


getting started: no module called bpy outside of Blender After sudo apt-get install blender on Ubuntu 12.10, I have Blender version 2.63

However, I can not import the relevant scripting Library

Python 3.2.3 (default, Sep 25 2013, 19:36:10)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import bpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named bpy
>>> import Blender
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Blender

Later on, I would like to use numPy and Blender to create some figures for 3D printing, as a friend has suggested.

bpy is only available when a script is being run from the Python interpreter in Blender. You can't access it from an external interpreter. The bpy module itself is located in the Python environment supplied with Blender (if you download the zip-file, rather than the installer).

To use the bpy module, open the script in Blender's Script Editor.


Draping 2D image over point cloud or mesh I'm new to blender and could not find this in help files. Can blender be used to drape a 2D image onto a 3D point cloud or mesh? If yes, can someone point me to a tutorial on that?

To drape an image over a 3d mesh is easy.
First bring you image into blender, I'd use the import image as plane add on. Next, as gandalf3 said, use a shrink wrap modifier to drop it over the mesh. by doing that you can avoid any distortion that would occur when using the cloth simulator.


How can many faces be mapped to a texture? A tree model with leaves looks like (created by sapling addon):

Using unwrap and reset shows orientation issues like a leaves stem pointing to the outside instead of the branch.

Before UV reset the UV-map shows this pattern, some leave pairs are upright and some are rotated by 90°.

How should all the UV islands be rotated to match the images orientation? Is there a method that is less time consuming than manual select and transform?

I tried almost all options from Mesh / Select / Similar to unwrap at least the upright and rotated pairs of faces separately.

My advice is to switch your leave settings from Hexoganol to Rectangular. This will make single planes without cuts (extra edges) with 1 origin and it will unwrap as a single plane (like resetting the uv map). It is then easier to make adjustments for the direction of the leaves and will effect all the leaves in the same way (from the root). I don't know of any other workflow's for this situation.


I have a project with multiple video files that I want to pack for a render farm how should I do this? I have a project with over a dozen video files in it.  Now I know how to pack regular images into the into the .blend file, but it seems not to want to work so well with video.

How would I go about preparing this project for upload to sheep-it render farm so that I can get the end result in something less than the 42 DAYS it will take my machine to complete it?

The video files are all in their own folder and they are inserted into the node system as a regular image file would be.

This is the first time I have attempted to do something of this nature, so explicit instructions would be appreciated.

Blender doesn't pack videos nor image sequences. If you want that to be possible in the future, you can upvote this rightclickselect proposal I made. But know that it has little chance to happen.

However, Sheep it supports .zip files and linked datablocks. So I'm pretty confident videos should work this way.
Zacharias Reinhardt explains how to use linked assets with Sheep it in this tutorial (link goes to the appropriate timecode).


Require Blender to update N or T panel I create a auto setup matcap texture addon and i'd like to know if it should be possible to "require" blender to update N panel.
Got a template_preview and it should be great that it refresh automaticaly.
If it really not possible, is it possible to get the texture list box or did i have to create my own texture list ?

Use Region.tag_redraw on the corresponding region. The region type of the T-Panel is 'TOOLS' and the type of the N-Panel is 'UI'.

I.e.

for region in context.area.regions:
    if region.type == "UI":
        region.tag_redraw()


Change Startup File to Default I was using Blender, and i accidentally changed the start up file. I was wondering if i could change it back to the original starup when you first download Blender?

Blender stores its configuration and startup files in a directory specific to the user. This differs depending on the operating system.

For example, on Linux this would be something along the lines of :

/home/rich/.config/blender/2.76/config

On Windows it would be something similar to :

c:\Users\rich\AppData\Roaming\Blender Foundation\Blender\2.76\config

Obviously the user ID ('rich') and the Blender version (2.76) would be different depending on your setup.

When you save the startup file, Blender saves the file in the configuration directory mentioned above. If there is no startup file when Blender starts then you'll get the 'factory default' startup file (ie, the default cube). If, however, blender finds a file named 'startup.blend' in the config directory then that will be loaded as the default state.

Therefore, to reset back to the 'factory default' startup file you simply need to locate the config directory and remove the 'startup.blend' file.

For example, on my (Linux) environment I have the following files in the 'config' directory :

(/home/rich/.config/blender/2.76/config)
-rw-rw-r-- 1 rich rich    308 Dec 14 12:45 bookmarks.txt
-rw-rw-r-- 1 rich rich    441 Jan 18 10:41 recent-files.txt
-rw-rw-r-- 1 rich rich 371104 Jan 25 11:39 startup.blend
-rw-rw-r-- 1 rich rich 116252 Sep  8  2016 userpref.blend

Removing the 'startup.blend' will reset blender back to the default startup file.


Missing texture in cycles, it renders Pink Pink texture like in render view (Cycles).   Im trying to render a wall in Cycles, using Displacement, Bumps and Reflection. Im using self-made pictures from colored image using CrazyBump 1.22. Theese are in order: DISP, OCC, SPEC. I have 2 pictures, one in Node Editor to see inside and second which shows how my render looks like.

The color texture in your material is missing. That would be the one plugged into the color slot on your diffuse shader. Click on the file logo on the texture that goes into there and re-find your image. If this doesn't work, save your work, close, and reopen your file. IF this doesn't work, append all your objects into a new file.


Move one object and second object on the circle path will stay in nearest distance to first object I want to do this:
I have got one object (Empty.001) and I want to move this object only on circle path. I have got second object (Empty) and I can move this second object without limitation.
I want to set this: move with second object (Empty) and first object (Empty.001) will move automatically on the circle and distance between objects will be lowest (second object will be on the nearest point on circle from first object).

Circle path
You can give your object Copy Location constraint with Empty as a Target and Limit Distance constraint from another Empty with Distance as the radius of you circle. Copy Location tries to move the object to the location of your empty but Limit Distance wont let it. Now you can move another empty as you wish and the object tries to get it but will stay with the circle. Also Limit Distance Clamp Region needs to be On Surface.
You don't need the circle. Just your object and two empties.

Square/Rectangle path
To make to object follow a square or a rectangle you still need your object and two empties. First you have to Copy Location of the empty you want to follow. Next give your object a Limit Distance constraint with Clamp Region Outside a Distance that is greater then the farthest point of your rectangle. Last give your object a Limit Location constraint with minimum Minimum x and y and Maximum x and y that give you the size of your rectangle¨.


Why does Blender inflate file size in comparison to STL? I created a new scene and deleted everything in it (the lamp, the camera, and the cube). When I save this file, its size is 438 KB.

I then import an .stl file, the .stl file is 7,754 KB.

When I save the scene, the resulting file grows from 438 KB to 10,365 KB. That's a difference of 9,927 KB, much larger than the .stl file, which is an increase of 28%.

Why is the .stl mesh file size so bloated when saved in a Blender scene?

Blender stores a lot more mesh information than an STL file.
An STL file is a basic «geometry only» file format suitable for 3D printing and fabrication processes, it saves little else beyond the geometry itself. There is no color, UV coordinates, normals or anything else saved in the file.

A blender file has  much more complex geometry system suited for a lot more than just fabrication processes.
It stores not only geometry, but also UV Coordinates, vertex colors, normal information, mesh selection state, vertex groups, among others, it also stores the geometry itself in a much more versatile format allowing complex geometries beyond triangles, like quad faces and NGons.

Besides that there may be other complexities involved like inefficiencies of the file format/application, file compression, or data caching.

Under the menu File > User Preferences > File > Save & Load you will find a Compress File option, which if ticked should have Blender store information in a much more compact way.


How to create this square bevel/curved effect Just wondering if anyone can advise the best way to achieve this curved effect at the end of a cube.

I tried this tutorial
https://www.youtube.com/watch?v=Y8u66AuY9cA however, what I found was that the faces of the cube then get curved this is not what I am looking for. I tried the bevel effect and again this does not happen to get the desired results.

Will this be a case of adding loop and editing until it looks somewhat like it should, or is there an easier what to get the result I am looking for ?

It looks like the intersection of a cube and a sphere. You can get it easily with a boolean modifier :


How could a single Python script run when Blender is started? I would like to have a few globally available functions which should not not depend on a .blend file.
Is there a place (A setup.py, __init__.py or something like that) where I could put a few lines of code?

As documented in the manual, you can save your script in the scripts/startup/ directory with a .py extension and it will be automatically imported on startup.


Storing preferences without having properties in every scene? I did applink for 3dCoat app. I set Export directory manually. At present, i should set the directory in every blend scene. But i would like to set the directory path only one time and store it aways in cache. Is it possible to do?

My code:

            exchangedir = StringProperty(
            name="FilePath",
            subtype="DIR_PATH"
        )
.....

row.prop(simple3Dcoat, "exchangedir", text="ExchangeDir")

It would be cool to store "exchangedir" string in cache. So that it will be always the same for all blend files. Thank you!

This sounds like you would want to have a user-preference for the addon,
Blender supports this through bpy.types.AddonPreferences

This way, the addon can have settings that are saved with the user defaults.

API docs include example usage.


Swap two curves in the Graph Editor There is another question on this forum with the same title but the answer given and accepted has nothing to do with what I am asking here. What I ask is this:

Suppose I have a cube rotating by X and Y. Now I need to transfer all keyframes in X to Y and vice-versa or, in other words, swap X and Y rotation animations.

Is that possible from the graph editor or by any other mean?

Quite simply swap the array_index property, which designates which component of an array property (eg location.x or location[0], has array_index == 0), of the two fcurves.

Example below using the python console, location as an example, change to rotation_euler for Euler rotation.

>>> action = D.actions['CubeAction']
>>> fx = action.fcurves.find('location', index=0) # location.x
>>> fy = action.fcurves.find('location', index=1) # location.y
>>> fx.array_index, fy.array_index = fy.array_index, fx.array_index


Rendering Sound In Video Sequencer How do you render sound with your video in the video sequencer? I already placed a sound strip with the video strip but how do you render the sound with the video?

Good question Austin,

---the below answer is if you want to render a file which has audio embeded, not for if you are having trouble playing back an audio file in the Video Sequence Editor---

Once you have audio in the video sequence editor, you're halfway there.

So you need to change your render output settings in the render tab

Change it to a video format (I normally pick h264)

Then change the wrapper format to Quicktime MOV, and the codec to h264  or PNG if you need lossless quality.

Below that, change the audio codec from none to AAC or MP3 (they're the ones I have had most luck with)

And then hit render and it should be in the final render output file (a .mov)


I have to run a for loop in blender, but screen is not being updated import bpy

 from time import sleep
 x = 1
 for x in range(10):
...     print("Done")
...     sleep(1)

If run this script, the blender hangs for a while and restores again with 10 Messages 'Done'

But what I need is it should print the string 'Done' one by one. but it hangs for a while and prints all the 10 strings named Done altogether at once.

Same thing happens with bpy.ops.transform.translate()()

This is how scripts are intended to be run in Blender. You should not attempt to update the interface while running a script - that can cause problems with other processes in Blender.

If you need some functionality that runs in Blender while the rest of Blender is functioning at the same time you should make a modal operator. There are a few examples included with Blender that you can reach from the Text Editor's header menu Templates - > Python -> Operator Modal... :


How can I snap edges to grid lines? I am very new to Blender and I'm having some trouble with grid snapping.
I have absolute grid snapping enabled. If I select an edge or edge loop and attempt to snap to grid, it snaps in the correct increments, but not exactly to the grid lines. However if I select a singe vertex it snaps to the grid lines perfectly. What am I missing?

Any help is greatly appreciated, thanks!

Scott.

Snap > Increment with ✓ Absolute Grid Snap seems to work fine.
To have more precision

switch to Ortho view (View > Perspective/Orthographic, Numpad 5)
use a top/side/view (View > Viewpoint > Top,  ~ )


merging bended solid tubes organically being a complete noob in blender, I wisely chose a quite complex object as my first project ;-)
 - the objects should have precise dimensions (which I managed more or less)
 - the tubes should have a certain thicknes (solidify modifier?)
 - and above all, the merging should come out as "organically" as possible
the aim should be an "adapter" where poles might be connected crosswise.
I hope I made it adequately clear...and if you tell me "boy, forget it! too demanding for an absolute beginner.", then it´s also fine with me :-D
thanks for any hint

You can construct it out of primitives making sure the forms to be connected have the same amount of edges, use solidify(ctrl+f->Solidify) to add thickness and insert edge ring(ctrl+r) to subdivide the primitives and delete unnecessary geometry, then you can select the edge segments and bridge them(w->Bridge Edge Loops). You can choose Blend Surface as surface interpolation and add some cuts for the bridge to have smoother shape. You would have to fill the holes using fill(f) and various other tools. F2 add-on will be very useful - just enable it in add-ons tab of user preferences(ctrl+alt+u).


Straight knife cut in perspective view? Here are the methods I use to make a straight cut

switch the view from perspective to orthographic
just make a cut then straighten it with s+x+0
shift+7 to align face to view then make a cut
use bisect tool then change the angle
vertex connect pressing J key and then straighten it

There are many other methods too but nothing is as fast as knife cut.

Is there any workaround to make straight cut in perspective view ?

I know we can snap knife tool to vertex & midpoint but it doesn't help in many cases.

Thank-you and sorry for my bad English.

press "c" on the keyboard, then you can make 90 and 45 degree cuts, combine width ortographic view


How to bevel something on only some faces? I want to bevel on the side edge(red arrow) but not up at the top part(blue arrow)

Its sort of unavoidable.  You'll need to transition from the single edge (above) to the split/beveled edge (below) somehow.
If you want the bevel to only be on the vertical part, you can add an edge loop (highlighted) just below the current knee joint, and then select the edge below the edge loop and just bevel that. Then the 'fan' that transitions from no-bevel to bevel will be on the vertical edge.


Simple fluid sim issues, 2.91 I must be missing some basic understanding in the workflow of a fluid sim.  If I create a collision object, an flow object (inflow) and a bounding domain object, I would expect I could bake and see water in the animation.  This is not always the case.  I run thru some simple water simulations that work but sometimes when I do similar I get no fluid after baking.  What is the secret sauce I seem to miss?  If I do a Quick Fluid I get a similar Domain and Inflow object that work.  Do you see any problem with this simple fluid sim setup and why I get no fluid after I bake All and run the timeline?
Domain Object

Collision Object

Inflow Object

Your inflow may be too small compared to your domain Resolution.
Also, you should always 'Apply Scale' and also ensure your normals are pointing in the correct direction after re-sizing your meshes (negative scaling can result in Normals pointing in the wrong direction).
Check normals and try making your Inflow larger and don't forget to Apply Scale. Then free and re-bake the simulation.


Removing an object from specific lighting I have got a problem with my lighting. The overall lighting for the scene is what I want it to be, however there is a specific object (my logo) that I would like to be light in a different fashion to make it look more metallic/shiny.

The way the lighting is set up for the rest of the scene, means that the logo is getting hit by the light almost directly from the front, this causes it to look less 3D and much less metallic.

I'm looking for a way to prevent the object from being hit by the main scene lighting, so that it can have it's own individual light.

The lone object with it's personal lighting:

The scene with the object no longer having personal lighting:

I'd like the logo to look like it does in the first picture.

Thank you

Method 1: The most simple or common way would be to use multiple files instead of one. 1 file with the background, one with the logo. Render out each animation as image sequence. Then perhaps in a third file load the two image sequences and render out the combined result.

Method 2: If you're using Blender Internal Render, another way would be to limit lighting for your materials to a specific lamp group:

Method 3: You could put your special object and its special lighting to a different layer as everything else. Then set the render layer not to render the layer for the special object. Create a new render layer and set it to only render the layer for the special object. Enable Compositing, and use nodes for compositing. Add another render layer node. Set it to the render layer for your special object. Combine the two render layer color outputs with a color mix node. Make sure you're rendering with transparency and that the color mix node is set to use the transparency of the second input. (This method is basically method one, but all-in-one)


Stop objects from being selected I have some reference meshes in some scenes, That are holding the shape for what I'm molding. The issue though is I keep accidentally selecting them, and it is driving me crazy :), So how can I stop these objects from being selected.

Select the object in the outliner and click the white arrow

Note that they can still be selected from the outliner, but view-port operations will ignore them.


Keep particles from fluid simulation in render? When I bake a mantaflow fluid simulation, Blender displays it as colored particles before the mesh is baked. Is there a way to keep these particles without baking a mesh and have them in the final render?

You can sort of do that, using the viewport render:

1) Disable all overlays and set the view mode to rendered:

2) In the domain's material settings panel, set the Blend Mode to Alpha blend and make sure Show Backface is checked:

3) Change the domain's material to Transparent BSDF:

4) If you don't want to see the viewport's background, check the transparent option in the render tab, Film panel:

5) In the viewport, go to the View menu, and make a viewport render:

And here's the result:

You can use this in compositing if you need it to see it in your full feature render. Though I can't think of a way to make it look not overlayed on top or bellow.


How to ungroup a group instance I've created a group consisting of a few objects, then created a few instances of that group. I now want to "ungroup" one of the instances, de-linking all of that instance's objects from the parent group, leaving them at their current location, and creating a bunch of objects that can be edited individually.

Is this possible?
How do you do it?

Press ShiftCtrlA to Make duplicates real.

Originally from this comment


Is there a way to animate a material differently for object that has it? I want these blossoms to turn pink one after another Can i get the second blossom's colour to change after  the first one's without having to create a new material?

If you just want to stagger when the blossoms start changing colors, you can use a node set up like this one:

The value node is keyframed to 0 at frame 1 and 2 at the frame when you want them to have finished changing colors.
This is what that would look like over 60 frames @ 15fps.
The random input generates a number between 0 and 1. That is our offset for when the object's color starts changing. The color ramp takes an input between 0 and 1 (if the input is greater than 1, then it is treated as 1) and outputs a color based on that. If you didn't stagger the color changes, then you could just animate the color ramp input from 0 to 1. The subtract node is used so that the random number from the object info node delays when the animated value (which is animated from 0 to 2, so that even if the random value is 1, at the end of the animation, its input to the color ramp is 1) reaches 1, which is the final color on the color ramp.
Also, I would recommend going into the dope sheet, selecting the key frames for the material, and setting the interpolation to linear.
That said, I'm not sure how to ensure that the blossoms change colors only one at a time without using multiple materials.


Fragments / light splotches in gpu render but not cpu render So I’m trying to render this glass full of liquid, it renders fine on CPU render but on GPU render I get wired fragments/splotches in the shadows. I already tried reloading the kernels and all that but, nothing has worked

Cpu Amd ryzen 7 2700x
Gpu rx 5700
blender: 2.82a / 2.81 (tried both)

GPU render did work on a different computer which was some old 700 GPU

Two things;

1: It actually looks like the GPU is rendering more realistically. I think the reduction in quality would be /not/ having those artifacts (though this is debatable)

2: If you're rendering with Cycles, check to see if you have "Supported" or "Experimental" selected for the feature set. This setting will certainly cause rendering differences;


Drawing a line using Python script I would like to draw a simple line using Python script code.
I would like to draw the line from (0,0,0) to (0,0,1)

My philosophy (from what I've seen on the net) is:

Draw a mesh plane (center at (0,0,0))
Select and delete 3 of the 4 vertices (Edit Mode)
Snap (move) the remaining vertex to the center of the plane (original placement point)
 - snap cursor to center
 - select and snap remaining vertex to cursor (now at the center)
Extrude the current vertex to (0,0,1)

I come from a CAD world, so this seems complicated for a simple object like a line, but I'm willing to adapt.

My general task is to draw "stick figures" using lines (between named points).
Being able to "name" the points would be a plus, so I can draw new lines
starting from those named points when needed.

some good reference: adding geometry

note that you must be in editmode (EDIT: to go to edit mode, create a mesh, select it with right-click, and then hit "tab"), and remove doubles after run the script:

import bpy, bmesh

obj = bpy.context.object
me = obj.data
bm = bmesh.from_edit_mesh(me)

v1 = bm.verts.new((2.0, 2.0, 2.0))
v2 = bm.verts.new((-2.0, 2.0, 2.0))
v3 = bm.verts.new((-2.0, -2.0, 2.0))

bm.edges.new((v1, v2))
bm.edges.new((v2, v3))

bmesh.update_edit_mesh(obj.data)

if you have the point list, may be you can apply some loops


How to find evenly spaced coordinates/point cloud of an object? I'd like to convert a mesh object into a point cloud. I started using the vertices:

coordinates = []
for x in range(len(obj.data.vertices)):
    v = obj.matrix_world * obj.data.vertices[x].co
    coordinates.append(v)

Plotting the coordinates I get a point cloud as expected:

However, depending on the mesh, there are huge irregular gaps between the points. Is there a way to "interpolate" between the coordinates to get a regular pointcloud?

I found this proposal but couldn't make use of it.

A solution is to set particles on the object and to use GRID instead of (default) random in the settings
(Note that also works on Volume, if the case, to fill with points)

Use No for physics to get fixed particles.

To further get the coordinates of those particles use:

gridVectors = [p.location for p in bpy.data.objects['Cube'].particle_systems[0].particles]

that if u need to further use coords in script

Also note that the grid acts a bit weird sometimes, more like the remesh tools, so the particles may or may not be on the faces, but rather at a distance, not quite controllable.

In the pic, I added particles to these meshes with settings as shown.


Why OBJ export writes face normals instead of vertex normals I am confused by the content of OBJ Blender exports. When I export a (default) cube object (8 vertices, 6 faces) to OBJ and then inspect the OBJ file, the "vn" entries obviously correspond to face normals and not to vertex normals. That is clear from the values and the fact that there are only 6 "vn" entries. Every "f" entry then points to the very same normal for each vertex in that line. Should not there be exactly 8 "vn" entries (since for the cube model there will be exactly 8 distinct vertex normals) which represent vertex (not face) normals as specified by Wavefront OBJ format? Furthermore, should not each "f" entry point to a different normal for each vertex?

I used Blender versions 2.79 and 2.80, both act the same. While exporting the OBJ file, only "Write Normals" option is checked. Here is the content of the generated OBJ:

# Blender v2.80 (sub 37) OBJ File: ''
# www.blender.org
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 1.000000 -1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 1.000000
vn 0.0000 1.0000 0.0000
vn 0.0000 0.0000 1.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
f 1//1 5//1 7//1 3//1
f 4//2 3//2 7//2 8//2
f 8//3 7//3 5//3 6//3
f 6//4 2//4 4//4 8//4
f 2//5 1//5 3//5 4//5
f 6//6 5//6 1//6 2//6

They are vertex normals. But because your cube is flat shaded, there are only 6 unique vector directions. In the obj file there are no duplicates. If you smooth shade your cube, you'll get 8 vn entries.

You can see that first face is made from vertices 1,5,7,3 and that they have normal vectors 1,1,1,1 (in same order)


why is my rigid body object not falling correctly? I have a model of a cup that I want to fall on the ground. The issue is that once it hits the ground it doesn't rotate or anything so only the rim of the cup is making contact with my passive object. video
Here's the blender file

The cup object has been scaled down a lot, apply the scale:


Soft Body hooking stretches instead of moving I'm trying to animate a soft body in Blender by using hooking, but it doesn't work right. The following is what I do:

I create a mesh - in this case it is an elongated object, like a thread/yarn - and assign its ends to vertex groups. I create a vertex group for both ends too.
I assign the Soft Body physics modifier to my thread, and make settings on it, see screenshot below. Note that the Soft Body Goal is set to the vertex group of both ends of the thread.
Then I go into edit mode, select the vertex groups of either ends individually, and then assign a new hook to them with Ctrl+H.
Then I give some keyframed translation/rotation/whatever to my hook, and I expect that the soft body I made should follow it "as a whole", moving and stretching accordingly and preferably realistically.

However, instead of this, what happens is that the hook pulls the vertices of its hosting vertex group, and stretches the faces connected to it, but the rest of the object doesn't react.

In the Modifiers tab I tried various settings, like specifying both the hooking Object and the Vertex Group, and hitting the Apply button; or not hitting the apply button, just leaving it like that; or not specifying the Vertex Group. None of these work.

Could you please point out what I'm doing wrong?

These previous posts didn't help (I could only post here one):

Rig a rope spanning two objects

The order of the Softbody and Hook modifiers in the Modifier stack is important. For the soft body physics to take account of the hooked vertices it must be positioned below the hook modifiers in the stack. Performing the steps in the sequence in your question (create mesh, add Soft Body, set Vertex Group, add hooks) adds each modifier at the end of the stack so that the Soft Body will be first, followed by the hooks. ie,

Note the Soft Body above the hooks.

This will produce the following results (note that I've added Skin and Subdivision Surface modifiers to make it more visible) :

The modifiers are applied in 'top-down' sequence and so for the Soft Body to take account of the hooks it must occur after the hooks have been applied. Simply use the arrows (at the top-right of each modifier panel) to move the Soft Body to below the hooks and all should be well. ie,

This can then produce the following result :

Note that the only difference between these two results is the order of the modifiers in the stack.

Blend file included


Matching physics properties for multiple objects I have about a thousand cubes in my scene that all require the same physics settings. Is there a way to do this without having to change each mesh separately?

I wish I had added the physics first then duplicated but still it would be helpful if there was a way to add settings to multiple meshes at once.

Select all the objects you want to apply the physics to, then click on the object that already has the correct settings whilst holding down Shift.

Then navigate to the physics tab and click Copy from Active.


Move one pose bone to the location of another in the same armature Could someone help me get out of the starting blocks I suspect I'm making this harder than it needs to be.

with python

Lets say in pose mode I have bone A at location (0.00,0.00,2.00) world space equivalent local space is (0.00,0.00,0.00)
I want to move it to the same location as bone B in the same local space.  Lets say bone B is at (0.00,1.00,0.00) world space local space is (0.00,0.00,0.00)

I've been going around in circles with various matrix calculations and Just can't get my head around it just yet.
The local space for bone A in this example should end up as (0.00,-2.00,-1.00)

I found this in relation to a different question which has a great answer and explains how the matrices are set up clearly but I can't seem to apply it to my situation.
How to convert coordinates from vertex to world-space?

thanks!

Mark

Many thanks @batFINGER that got me heading in the correct direction, I now need to spend a few hours understanding why it works :) I modified the code from the example you linked to.

I've updated with extra comments and modified the code after I did some research to get my head around it, happy to take feed back I've misinterpreted anything

does not seem to need any additional calculations if it's a child of another bone but would be interested I'f I missed something there.

Mark

In my example from my question

bone y+1 is located at (0,1,0) in pose space but the local location
is (0,0,0) as that is where the bone is in edit mode.
bone z+2 is located at (0,0,2) in pose space but it's local location
is (0,0,0) as that is where the bone is in edit mode.
the armature object is at (0,0,0) world space

The translation (where the bone actually is in pose space) is stored in the first 3 rows of the 4th column of the 4x4 matrix reading down X,Y Z the other numbers define rotation and scale which I'm not looking at here.

so for y+1 the default matrix is
(1.0000, 0.0000,  0.0000, 0.0000)
(0.0000, 0.0000, -1.0000, 1.0000)
(0.0000, 1.0000,  0.0000, 0.0000)
(0.0000, 0.0000,  0.0000, 1.0000)

for z+2 the default matrix is
(1.0000, 0.0000,  0.0000, 0.0000)
(0.0000, 0.0000, -1.0000, 0.0000)
(0.0000, 1.0000,  0.0000, 2.0000)
(0.0000, 0.0000,  0.0000, 1.0000)

the armature world matrix is
(1.0000, 0.0000, 0.0000, 0.0000)
(0.0000, 1.0000, 0.0000, 0.0000)
(0.0000, 0.0000, 1.0000, 0.0000)
(0.0000, 0.0000, 0.0000, 1.0000)

The armature world matrix is important if you want to translate locations between world and local space as if it's not (0,0,0) then it needs to be added as an offset (and removed as an offset (inverted) as required.)

import bpy

#assume armature is active and has 2 bones in it called
# "y+1" and "z+2" at different locations
armature = bpy.context.active_object
y1_bone = armature.pose.bones["y+1"]
z2_bone = armature.pose.bones["z+2"]

#y1 is the bone we want to use as the target,
#multiplying 2 matrices is a dot multiplication i.e. each column gets multiplied with each row then added together
#it's not simple scalar with one value with just multiply the whole matrix so the below will produce a matrix
#that will add the armature world location to the y1 location

#if you want to place or align stuff outside the armature in world space then the following two pieces of code will
#take the armature world space offset into account but it's over kill for just moving about in the same local space

#this gets the world space
y1_world_matrix = armature.matrix_world * y1_bone.matrix

#this copies the default and calculates the local space
matrix = armature.matrix_world.inverted() * y1_world_matrix

#the above two would make more sense if say you were trying to place an
#empty in world space at the pose bones location.
z2_bone.matrix.translation = matrix.translation

#if it's just in local space you can remove the armature offset calculations
#above and just assign the translation
#of the target bone to the bone you want to move
#e.g. the below and the local space coordinates will update accordingly.

z2_bone.matrix.translation = y1_bone.matrix.translation


what are blender specialties? I want to become, and am in the process, of specializing my skills as a character modeller. What I want to know is, what software should I use to maximize my efficiency as a character modeller? Price is not a problem. I know Zbrush focuses specifically on sculpting, which I will undoubtedly need as a character modeller, and 3D coat is useful for retopology, but my main question is what would I use Blender for? I have been using it for 4 months now, and I know that it can do just about anything if you know how to navigate it and understand what blender offers, but what are its strong points?

As stated, Zbrush is good for sculpting, 3D coat is good for retopology, but how about blender? What does blender specialize in? Is it animation, rigging, texturing? What the bananas does it specialize in? I'm always going to keep blender, its community, but from one aspiring character modeller to another some advice would be fantastic.

thanks again!
Chris

Blender is a jack-of-all-trades, and a master of nothing. It is an all-around universal tool. You can model, make materials and textures, do animation/rigging/skinning, sculpt, make simulations, and pretty much everything any other piece of software can do. You can even make games and edit videos in it. And it's free and comparatively lightweight.

It is a huge benefit, but it is also a disadvantage. Blender is universal, but it excels at nothing. Modeling? 3DS MAX has a bit more to offer and it is more integrate-able with other pieces of software. Character animation? Most big studios use Maya for that. Sculpting? ZBrush is second to none thanks to some mumbo-jubmo making it able to wrangle millions or even billions of tris even on weak machines. Texture painting? Substance Painter or 3D Coat. Simulations? It's hard to compete with Houdini. Landscape modeling? Compared to Blender, Eon-software's Vue is a "make a stunning showreel in one click" type of software. Video editing? I cannot take an editor seriously if it cannot even add subtitles without dropping rendering speed to unacceptable levels. Game making? Why bother with a raw strange game engine if Unity, Unreal and Godot are free now and they have so many out-of-the-box things (not to mention that they will get rid of it in the upcoming 2.8)?

IMHO, the strong point of Blender, aside from price, cross-platformness and light weight, is its customizability. Not every program allows to adjust the interface so flexibly. You can make it fit your needs in any way you like. If you know programming, you can do even more! The problem is, most professionals don't have time to tinker, they need things available to them easily and immediately. Blender cannot offer that yet.

Some related read here and here


How do I scrub the sequencer playhead more than just 1 frame at a time How do I scrub the sequencer playhead more than just 1 frame at a time (in 2.7 it was shift+up or down arrows)

I can't find anything for it in keymaps.

You can revert back to Blender 2.7X keymap in the Preferences

Edit: Sorry I didn't see the part about more than one frame at a time. My bad!

If you wish to stick with the current keymap though, you can add another keybind for that.

Head back over to the Preferences tab, go to the Keymap option, and scroll down until you find the Frames dropdown menu.

At the bottom of that menu, click Add New. That will add a none shortcut, so open it up, and enter screen.frame_offset into the text entry on the left side. A Delta property will then be added, and change that to however frames you want to jump by. Then, just assign what keys you want to bind it to.

Repeat the process for the shortcut you want to jump forward/backward. Negative delta for moving back, positive for forwards.


How to add an image texture to a single face? I'm expecting to see the face selected for adding it into a vertex group later on and the image texture mapped to the front face in order to map the image onto a road sign.
I've tried assigning the texture via material_index and I get the selected face but the image is not mapped properly. I guess something has been changed as of 2.8+, What am I missing here?
import bpy, bmesh, os

bpy.ops.mesh.primitive_cube_add()
bpy.ops.object.mode_set(mode = 'OBJECT')
bpy.ops.transform.resize(use_proportional_edit=True, value=(1.5, 0.005, 2))
bpy.context.object.location = (0, 0, 4)
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True, properties=True)
bpy.context.object.name = "sign1"

bpy.ops.object.mode_set(mode = 'EDIT')
ob = bpy.context.object

mat = bpy.data.materials.new(name="matsign")
mat.use_nodes = True
bsdf = mat.node_tree.nodes["Principled BSDF"]
texImage = mat.node_tree.nodes.new('ShaderNodeTexImage')
texImage.image = bpy.data.images.load("S:\\roadsigns\\124_67.png")

if ob.data.materials:
    ob.data.materials[0] = mat
else:
    ob.data.materials.append(mat)

bm = bmesh.from_edit_mesh(ob.data)

bm.select_mode = {'FACE'}
bpy.ops.mesh.select_all(action='DESELECT')
bm.faces.ensure_lookup_table()
bm.faces[3].select_set(True)       # front face selected
bm.faces[3].material_index = ob.data.materials["matsign"].pass_index    # why can't I see it?

The image node must be connected
You create an image node but don't connect it to anything. A node needs to ultimately flow into the output node to have an effect. You need to connect the image node's Color socket to the Principled node's Base Color socket. You can do that with (I also moved the node so its easier to see)
bsdf = mat.node_tree.nodes["Principled BSDF"]
texImage = mat.node_tree.nodes.new('ShaderNodeTexImage')
texImage.image = bpy.data.images.load("S:\\roadsigns\\124_67.png")
texImage.location = -300, 120
mat.node_tree.links.new(bsdf.inputs['Base Color'], texImage.outputs['Color'])

Your shader will now look like

The poly's material_index is an index into the object's material slots
You have
bm.faces[3].material_index = ob.data.materials["matsign"].pass_index

The pass_index has nothing to do with this and this only works by coincidence because it's 0 by default.
The material_index is an index into the objects' material slots. So since here
if ob.data.materials:
    ob.data.materials[0] = mat
else:
    ob.data.materials.append(mat)

you are ensuring the material is in the 0th slot, all polys with material_index 0 will use that material.
And since 0 is the default value for material_index, all polys will use that material without you having to do anything.


Cloth simulation moves mesh away I cannot find any information on this issue, but it's simple. I have a mesh, I add a Cloth simulation modifier to it, and it moves the mesh below the grid.

Why is it doing this annoying behaviour? The transforms are applied and mesh has no tris, no double vertices, nothing!

Why is it doing this?

If the timeline isn't on Frame 1, the simulation will move the mesh to where it would be after that many frames.

Move the frame selector back to the first frame and it will work as you expect.


Donut tutorial : Unexpected lighting behavior I am following the Blender Guru donut tutorial and I've ran into an issue. My camera view is diagonal and I have to put two brick walls into the scene. One of them is lighted correctly, but the second one, no matter how I add it, seems to be lighted the wrong way.

What am I doing wrong? The .zip with the project (.blend file and textures)

It looks as though your wall is looking the wrong way. Have you tried rotating it by 180 degrees?
For future reference, read up on the topic "normals"
Edit:
Ok, I got it now, sorry for the false lead earlier:
You plugged the texture for the brick wall relief directly into the normal port of your shader.
You need to put a "Bump"-Node (Add-> Vector -> Bump) in between, like so:


Remove vertex while using knife tool? When using the knife tool, if I accidentally click in the wrong spot, is there a way to remove the last placed vertex instead of cancelling the whole operation and starting over?

The knife tool has no undo support.
While it is possible to have undo history in a modal operator tool, at this time the knife tool does not. Nor is adding undo functionality planned.

However after confirming the knife tool cut, there are other modeling tools that can help you get around a misplaced vertex.

X > Dissolve Vertices, that will delete the selected vertex, or vertices and fill the surrounding geometry.
V if you accidentally snapped the vertex to a vertex already on the model, then you can rip the vertex and for a new one.
AltM > At Last or At First Merging, if you placed a vertex but wanted it to connect to a vertex already on the model, you can select the two vertices and merge them at the location of the "Good" vertex.
GG or ShiftV vertex slide, will let you slide the selected vertex along an edge.

Another tool that adds edges is Vertex Connect, it works by adding edges in a straight line between selected vertices.


noise when using fire simulation so when I created the scene without the fire I got a clean image with no noise (using 256 samples),but when I added the smoke simulation and rendered a frame it became really noisy around the fire and especially on the grass.I tried everything and still can't remove the fireflies/noise from the scene.This makes me think that the animation will look even worse.What can I do to fix this?

First off:

Smoke (Volume Shader) makes the scene very noisy as Cycles needs to calculate the light go through the smoke which is made up of tiny particles which light has to scatter through, thus making it very noisy (samples define the amount of times it is calculated). I find that when dealing with large objects with volume shaders, such as smoke a minimum of 500 samples should be used (unless it's a test render).

Secondly:

The animation will not look worse as it essentially does the same process as rendering a single frame apart from doing this for the amount of frames the scene has. Therefore if the render time for a single image is 1 minute, an animation (in the same scene with same settings) with 100 frames will take approximately 100 minutes.

The Fix

First, as stated before increase samples. Next adjust the light settings. This Blender Guru article explains it pretty well. Also I would watch this video by Zacharia Reinhardt.


Which kind of UVs are being used? I wanted to formulate a question, but I didn't really know what I'm actually dealing with.

Blender displays the file in such a way that I don't really know what I should call it.

My UVs look like this:

I have uploaded the Blend file here.

As it is perhaps already plain to see, the different subobjects have an equal distance (I think 0 pixels) when viewed in the UV pane.

When I load the obj in any software, the textures are displayed correctly.

Does my model use UDIMs?

Any information is really appreciated.

They are normal UV's, although a UDIM style layout has been used. UDIM support in blender is being worked on and should be included in the 2.80 release.

UDIM support will allow a single material to use multiple image textures, all sharing a single UV layout.

The model you have uses multiple materials, each assigned to a different part of the mesh. Each material uses the same UV layout with a different image texture. In the end the result is the same.

This is possible from the way UVs work, the position of a vertex in the UV layout is an X,Y position on the image as a percentage, that is a range from zero to one, so 0.0 is one side of the image, 0.5 is the middle and 1.0 is the other side. This helps by allowing us to use different resolution textures with the same UV layout. Unless set to clip, an image texture will repeat continuously, so a UV position of 1.5 resolves to the same image location as 0.5. In this case it is only used for clarity, you will get the same result by placing each section directly on top of each other.

The main difference with UDIM is that it repeats on larger numbers, were UVs go from zero to one, a UDIM layout can be zero to ten, with each whole number corresponding to a different image, so 1.5 will be the middle of the second image, 3.5 the middle of the fourth and 10.5 should wrap back to the same place as 0.5 on the first image.

For reference ptex is another approach to this from Disney, it allows a different texture resolution to be used for each polygon, technically it is considered a different texture for each face and doesn't use UVs, all thee textures are then combined into one texture file. There has been some work done to add ptex to blender but it has never been completed.


How to make hair dynamics work with surface deform modifier and cloth simulation to make a blanket with tassles? I'm trying to 'drop' a blanket with tassels onto a sofa using cloth simulation and am having trouble making the tassels behave realistically. I am using the surface deform modifier to deform the blanket using a simple subdivided plane, and am then applying the cloth simulation to that plane.
I have used a hair particle system to add fringes to the blanket, and have turned on hair dynamics. However, when I play the simulation, the blanket deforms fine but the fringes don't behave very dynamically. Either all the fringes stay in exactly the same orientation, or several of them end up facing upwards and in both cases they don't deform along their length at all, behaving more like solid rods than tassels.
Blend file can be found here

For anyone struggling with this problem, I successfully modeled the blanket with tassels by instancing the braided tassels onto the hair particle system using the particle instance modifier with the settings outlined here: Getting instanced particles to follow paths of hairs in particle system with hair dynamics
Edit: For the sake of completeness, it is worth noting that the issue here in this question is about the fact that the blanket has normals that point in the wrong direction. To flip them press Alt+N in Edit mode. After that, the tassel object needs to be rotated by 180° (X-axis: -90° → 90°) so that it sticks out and not in the blanket. To make the tassel bent along the hair particle a Particle Instance modifier is needed (see linked question above).


Un-Subdivide - Remove loops on one axis Whilst trying to make some geometry I have inadvertently introduced a number of edge loops that have effected my model causing the stripey effect shown in the screenshot. Is there any way of un-subdividing on the z axis only to remove the loops? I would like to keep the zig-zag at the top of the bag and not introduce any tris if possible.

Method 1:
First you would want to separate the zig-zag part from the bag, select the edge using Alt-Click that you want to cut like in the picture.

Then you can press V and move your mouse upward to rip the edge loop off.

Then you can select the vertical edge loops using Alt-Click in a pattern: select 3, not select 1 (It doesn't have to be 3 and 1 but I found it to work quite well). Unfortunately, I couldn't think off an automatic way to do this, so you may have to do this manually.

After you select all the edge loops, click X and select Dissolve edges.

This is the final outcome

Method 2: This is faster but it may changes the mesh a little.
Use Vertex>Smooth vertices and change the settings until you are satisfy with the result.


Can I manually adjust a Plane Track? I use 4 points to create a plane track.
It works for half of the clip but at a point the movements are difficult to track and the plane starts to wobble.
I would like to manually correct the plane movement, on a frame by frame basis, a bit like it works for masking.
Unfortunately, anytime I move a corner of the plane, on a specific frame, it readjust the position of the plane for the whole clip.

Is there a way to take manual control over the plane track ?

In Blender 2.9+ there is an option for Auto Keyframing plane track corners.
If you press N while in the tracking scene and open the Track tab, there is a dropdown for the Plane Track which allows you to set Auto Keyframes for plane track corners.
You can make manual adjustments without having to export the trackers to empties and hook them.


Create painted wood with grain I need a material that looks like painted wood in Blender 2.83.
I have attached an image that shows the colour and grain. Any ideas with Shader Editor would be grtefully accepted.
Cheers

I usually start with a Wave Texture set to ring. Since the door is made from many parts, it should be uv unwrapped to reflect that, or copies of the material made per board so the grains can be different. The position of the ring, and scale, is set using the mapping node, and the output fed to a color ramp, which feeds roughness in the principled BSDF. The original ring output can also be used to control a second noise texture to add the lines.


Why does smoke render as transparent in the OpenGL render? In the viewport, smoke looks fine:

However, when I render it with the OpenGL render:

It looks white because of the background; it's really transparent.

What causes this?

I would consider that a bug.

It appears that when the smoke flow object is set to Fire or Fire+Smoke it renders transparent with opengl render.

The fire simulator uses it's own material settings to preview in the 3dview - not the material settings that we configure. It would appear that this preview material works in the 3dview but not the opengl render.


Using mathutils outside of Blender I have installed mathutils 2.81.2 in my Python 3.8.5 install to use outside of Blender. However, nothing seems to work. E.g. I cannot create a unit matrix m = mathutils.Matrix() and find its components by subscripting it m[0][0]. I get TypeError: 'Matrix' object is not subscriptable.
Printing it simply returns the default <mathutils.Matrix object at ...>.
And trying to multiply two matrices using @ or a matrix with a vector gives a TypeError: unsupported operand type(s) for @: 'Matrix' and 'Matrix'.
Isn't mathutils supposed to work outside of Blender? After all, I can install it fine using pip.
By the way, I have also tried the same on Python 3.7.4 (which was the version used in Blender 2.81). I get the same problems there.

It is working for me. I think you have problem with installation.


How to set edge bevel weights from a python script I need to set weights for some edges from a python script. I have tried looping through object.data.edges and setting bevel_weight values but I can't get it right. It only works if I have first edited some edge's bevel weight by hand from the 3d-view's transform window. But I would like to get it work from my script without any manual hacking.

Steps to reproduce:

Start Blender with default cube and switch to Scripting view.

Try to set weights for all edges:

for edge in C.object.data.edges:
    edge.bevel_weight = 1.0

Verify that values changed:

for edge in C.object.data.edges:
    edge.bevel_weight

Switch into edit mode in 3d-view and open up transform window by pressing n. Select edges to see that the change did not work (bevel weights are all zero). Switch back to object mode and read values again in scripting console to see that they were reset to zero:

for edge in C.object.data.edges:
    edge.bevel_weight

Go back to edit mode and change some edge bevel weight straight from the transform window by hand. Go back to object mode and change values again from the scripting console:

for edge in C.object.data.edges:
    edge.bevel_weight = 1.0

This time it works, bevel weights are 1.0 when you go back to edit mode and look from the transform window.

Any ideas? My final need is to apply a bevel modifier to only some set of edges and that's why I'm trying to mark them by using weights. Using vertex group for bevel modifier does not work in my situation, since I need to specify edges, not vertices, which to bevel.

I'm using Blender v2.71.

There is no custom data layer for edge bevel weights by default. You need to explicitly enable it (this is done automatically if you use the Edge Bevel Weight modal operator in the UI):

ob = bpy.context.object
me = ob.data
me.use_customdata_edge_bevel = True

Furthermore, the mesh needs to be in Object Mode when you apply a bevel weight:

if ob.is_editmode:
    bpy.ops.object.mode_set(mode='OBJECT')
me.edges[0].bevel_weight = 0.7

If you want to avoid mode switching, you may use the bmesh module instead (bm.edges.layers.bevel_weight).


How to place columns in a circle? My goal

I want to create a radial array of columns like in this screenshot:

Tutorial that I am following

Blender 2.8 Array Modifier Rotate video on YouTube.

My steps

I've create a single column object:

I've create a plain axis:

Added «Array» modifier to the column:

Set «Relative Offset» to (0, 0, 0):

But when I set «Object Offset» around the plain axis, I get this:

What I do wrong? I can not understand what I missed.

Apply scale. Press Ctrl+A. Apply scale

Now select the empty and rotate


Parameterize Mesh or object imported from blender file? I know how to link to an object or mesh inside of another blend file so that I can re-use parts or materials in other blend files.
However, is there a way to create a parameterized family of parts, based on a single mesh?
For example, suppose I have a series of boxes that all have the same type of ornate decorations on them.  I would like to create these decorations once, because that is a complex process.  However, the boxes will come in all different sizes and colors in my final scenes.  How can create a "Default" box with the necessary basic mesh, and then scale or more certain vertices based on a parameter after I've imported that mesh into another blend file?
So my workflow would look like this:

Create base model mesh.  Define a parameter, i.e. "L", which is the length.  Set to a default value.  Save this file as my blend library file.
In another blend file (let's call it my scene file), link to the mesh created in step (1).  Parameter is somehow imported as well.
Set the "L" parameter in the scene file, which affects only the selected instance of that mesh.  If I link the same mesh into another file, or in the same file again, each instance has its own independent parameters.

I'm trying to do something like what was asked in this question and this question, but neither answer is really what I'm looking for.  The first one doesn't have an accepted or upvoted answer, so not sure that's the right thing to do.  The second suggests using nodes, which is great for textures but not for mesh.
I was wondering that there might be some way to use drivers to do this, but not sure.  I don't know if drivers get imported along with an associated object or mesh from another blend file.

This is what Library Overrides are for :
Create your base object, add a custom property. Don't forget to check Is Library Overridable in the property settings. Use a driver to drive, for instance the scale of your object.

Save your blend file. Go into your work file, and link the cube object. (File > Link > Yourfile.blend > Object > Yourobject)
Select your object, then go to Object > Relations > Make Library Override > Accept the dialog.
This will create another instance of your base object, which is in fact an override. (Piercing arrow and chain icon)

Select the library override, and go to the object properties. Notice your custom prop is not greyed out anymore. You can tweak it as you wish. If you Duplicate your object, you will be able to specify different overrides for this property as well as others. An override property will by default be in a light blue color.

If you want to override the object's material, set the mode to to Object and then you can change it as you wish :


Align view to axis during modal operator? How can I align the view (e.g. Numpad7 for Top view) in a modal operator such as knife?

When I try pressing the numpad keys during a knife operation, nothing happens. This can be quite annoying when you want to move the view around to see other parts of the mesh, but having to start all over again if you want to be aligned to a view.

The View, Select and Mesh menus are hidden as well.

Is this possible?

Short answer: Nope. Sorry.

Explanation: As you correctly state, such functions are modal operators, which are a type of operator. You cannot run two operators at once. Technically, such functions as Numpad7 are operators: the operator, in this case, is bpy.ops.view3d.viewnumpad(type='TOP'). Even if you could see the View, Object, and Select menus, you wouldn't be able to do anything.

The problem's not the shortcut. It's the concept.

It would be nice for an operator to be able to be designated as AMODAL or DUAL or something like that, for an operator that does something like manipulate the view or snap the cursor to the center (another thing you can't do) so that it could be run during a modal operator's RUNNING state. Maybe one of the developers could implement this, but as of 2.68.0 r58537 it's not present.