Cycles render appears not to render on GPU Lately I bought a Radeon GPU to speed up my rendering proces, but I didn't notice a significand decrease in rendering time. I checken my processes and my GPU only used about 2% of its capacity, while my Intel used about 75%. Which is strange because i turned off the use of my Intel in my preferences. I tried rendering a different scene; same results. I all the latest drivers and stuff; still no change.
I already set my tiling to 256 x 256, so that can't be it.
The equipment i use:

Blender 2.90
Radeon (TM) RX 480 Graphics
Intel(R) Core(TM) i5-6400 CPU @ 2.70GHz

So my question is, is blender using my GPU at all? And if so, is there any way i can make blender use more of my GPU?
My GPU stats while rendering a heavy scene.

My CPU stats while rendering a heavy scene.

You may want to check settings: Edit->Preferences->System->CyclesRenderDevice
Since I run on NVIDIA mine are different but you graphic card needs to be check marked in one of the tabs.

Furthermore, check out recent guides for speed improvement. Most important tip is the tiling. For GPUs it should be larger than for CPU.


Join function creating unwanted edge loop? I'm trying to follow along with a CG Masters tutorial, but I'm getting some unexpected results! The goal is to restore the topology with a series of join commands, but instead of affecting only the selected area, it creates a loop around the entire object! I've attached before and after pictures to clarify. Does anyone know why this is happening?

What you see is what I would call unexpected behaviour of the Vertex Connect Path tool, this is the tool that has a J shortcut.

The expected behaviour is to add an edge between selected vertices, existing faces are cut through in the process. In your example the missing face between the selected vertices causes this to take the long way around the entire object, effectively cutting an edge loop around the whole model.

To get the result you expect, the space in the middle needs to have a face.

In the tutorial, at that stage, the hole is filled in with an n-gon before using J to cut it into quads.


Subdivision Surface on curved mesh I'm trying to delete those ugly lines visible in the cylindrical shape of the lens. What is causing them is the added edge loops I made for the protruding detail with the switch. The problem is that if I delete those edges, it'll look even worse because of the n-gons. Any ideas?

I think your problem is how you place edge loops in your mesh over the curved surface.

Since it is a cylindrical surface edge loops cant be placed by simple subdivision, because that will yield a flat planar surface breaking the curvature of your otherwise cylindrical body.

When placing edge loops you need to make sure they are equidistant from the mesh center or use Subdivide Smooth for a curvature approximation.


Attach objects to every face of one model I'm trying to place roof tiles to subsurfed plane. So, I made tile model and roof mockup.

Now I want to place tile model to every square of roof mockup model like this,

but i have no idea What to do. What should i do?

Both Particles and Dupliframes have brought me more headaches than happiness so thought I would share another approach. It might not exactly be an answer to your question but it might be helpful.

Take one tile you have modeled and add two array modifiers to create horizontal & vertical tiling. Add a lattice modifier in Object mode and adjust it's shape to enclose the roof. In Edit mode you can reshape the lattice to create the drooping shape in the roof.

While not suitable for hyper-realism it is a relatively easy & effective.


Compositor blur is patchy? In Blender 2.71, I am trying to use the Blur compositing node to make some blue emitting lines have a glow around them.

Here is the render without the blur:

This is what I am getting:

This is what I want (blur done in GIMP):

So what is going on? It honestly looks like the Blur isn't sampling every pixel of the rendered image and is skipping large chunks. Is there any way to fix this?

Oddly, the cycles autorendered image does it correctly. Just not when I click the Render or Animate buttons.

Edit:
Here is the Blur Node I am using:

I'm actually using 3 of them, combining them with Add nodes. The three nodes have, for their X and Y, 10, 15, and 20.

I've tried all the other types of blurs beside Gaussian that are available in the drop-down. I've tried clicking all the check-boxes in the node. I've tried reducing the Image Size. Every attempt has had some form of patchy blur.

I did discover that if I increase the image resolution to 4 times that of normal HDV resolution, I can almost make the patchiness go away, at the expense of taking a very long time to render.

I found the solution! It was the Anti-Alias setting on the ID-Mask node that was causing the problem. Apparently it was causing the render of those thin lines to be patchy, resulting in a patchy blur. Once I turned off the Anti-Alias, everything was fine!


How to execute my operator (wikibooks.org 2020)? I am trying to learn python for blender,
following this and many other things online.
https://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Advanced_Tutorials/Python_Scripting/Addon_Anatomy
I open the scripting editor, copy and paste the "complete script"
And run the script.
The script dont give me any error,
but i cant find it in the search menu operator.
What am i missing?

The code works just as it is supposed to work. You just need to enable Operator Search to use it. You need to select Edit -> Preferences. Under Interface check Developer Extras checkbox.

Now you can find Operator Search from Edit drop down menu.

Search Add Tetrahedron

Errors
You can select Window -> Toggle System Console to see the errors your code gives.


Luxcore noisy render When I try to render something with Luxcore it get really noisy.

I read that Luxcore was working as a camera so if the image is too dark you need to add more light in the scene or it gets noisy.

I tried but instead of having RGB noise I have white and grey noise. Why?

I read that Luxcore was working as a camera so if the image is too dark you need to add more light in the scene or it gets noisy.

This is not correct. The brightness of the image does not matter.

To reduce noise, you have these options:

Render more samples
Use the denoiser (in the render settings, "LuxCore Denoiser" panel)
Optimize your scene so you get less noise with the same amount of samples, or more samples in the same amount of render time (this requires knowledge about the settings in your scene, so I can not help with this without the .blend file)


Set material density [kg/m³] instead of mass [kg] Is there any way or plugin which allows enter material density in [kg/m³] instead of direct enter real mass [kg] how it is now in Blender. Blender knows the exact size of the object, so it is possible to calculate volume [m³] and then evaluate weight [kg] based on material density. I personally don't understand why there is just weight [kg] by default. With material density, there could be also possible to preselect common material like wood, steel, iron, plastic, glass, etc. It will allow us to make more realistic physics animation in a much shorter time. Do it now with many objects on the scenes is horrible.

I found the solution, it is directly in blender itself.
Horizontal menu bar > Object > Rigid Body > Calculate Mass
As you can see here on the screenshot:

https://blender.stackexchange.com/a/137448/99511
Bad thing is that you need to do it every time you change the side of the object. It is not updated automatically.


What is the 3rd option in an enum property for? If I look here I see the following:

https://www.blender.org/api/blender_python_api_2_66_4/bpy.props.html#get-set-example

# Enum property.
# Note: the getter/setter callback must use integer identifiers!
test_items = [
    ("RED", "Red", "", 1),
    ("GREEN", "Red", "", 2),
    ("BLUE", "Red", "", 3),
    ("YELLOW", "Red", "", 4),
    ]

What is the "" field for?

From the documentation you linked:

  items (sequence of string tuples or a function) – sequence of enum items formatted: [(identifier, name, description, icon, number),
  ...] where the identifier is used for python access and other values
  are used for the interface.

The third item is therefore the description, which is used for the interface.


Blender 2.79 finds modules, but 2.80 does not I'm new to blender, but not Python. I've been handed a blend script and asked to run it. There are a couple imports and I don't really understand where that code lives. In the Blender IDE and can look at these modules, but I don't know where the actual source code is. Is it in the blend file?

The reason I'm asking is because I can run the code in Blender 2.79 and blender finds the modules, but when I try to run the same code in Blender 2.80 it complains that it can't find the module.

I've seen post about appending to sys.path like this:

directory = os.path.dirname(bpy.data.filepath)
if not directory in sys.path:
    sys.path.append(directory)

and this script already does that so I don't think it's the problem.

Why can Blender 2.79 find my modules, but Blender 2.80 can't? And where is the actual source code for the modules?

Apparently there was an API change and should have Googled harder. The answer is here Blender 2.8 can no longer import module from Textblock


Array not following curve shape I have modeled a section of a wall. That section can be arrayed so that it looks like one seamless wall. I have an array modifier on the wall. I also have am uneven terrain. I have a curve that guides the wall. I have shrinkwrapped the curve so that it sits on the terrain. I expect the the wall to be on the terrain. Instead the wall is hovering in the air although the curve is doing what I expect it to do.

The wall is not following the terrain because the curve has an unapplied modifier on it. You need to apply the shrinkwrap modifier to it. After you apply it the wall will follow the path like you expect.


Brush looks blocky/low resolution when painting textures (Pic included) I'm sure this is something silly I'm doing wrong here but I can't find a solution at all. My texture is 2048x2048 and I'm trying to paint details on it.

When I draw the brush looks blocky/pixelated though. The stroke looks like it has a low resolution. The smaller the radius the worse it looks and painting side to side looks better than when painting up and down.

Here is a picture:

If someone could try to help me out here, that would be great.

in texture paint mode go to your left panel and go to options and deselect occlude in project paint


Driver on material not updating Sorry for the noise... My previous question was answered, and I've fixed what I was doing wrong; but only so far as to allow me to phrase a new question, as my original problem still exists. :/

I am trying to apply a driver to the Y Location of a mapping node in a material definition:

Note that I have previously keyframed this Y value successfully, but now I want to use a driver so that I can drive this from a complex animation that's on a different object. I have deleted all its keyframes.

The driver tracks the value of a shape key:

However, when I scrub through the timeline, the value of the driver (in the bottom field of the driver panel) doesn't update. Instead, it shows the key shape's value for the frame that was current when the project loaded. I can prove this by saving it with the playhead in various places.

If I apply the same shape key to a driver that affects, say, an object's X scale, it works fine, updating as I scrub.

In my simple mind, I'm directing a single floating point value to a single floating point value, so I don't know why it's not working. Maybe I'm wrong?

The scripted expression simply maps the key shape's range (0.0 to 0.8) onto the range for Y Location that I was using when I keyframed it (-14.0 to 0.0).

Is there something I'm missing?

Unfortunately, not all drivers are created equal - especially when it comes to driving values in a material.... some drivers simply don't trigger their updates to propagate correctly on change of value while others do (a bug, I presume).
I've found that the most reliable source for drivers seems to be the object Custom Properties and you can use that to simultaneously drive both the material Mapping value and the shape key value - rather than using the Key to drive the material. This way you only need to adjust the Custom Property and both values (the material and the shape key) will change - rather than changing the Shape Key.
First, create the custom property by selecting Object in the Properties side panel, scrolling down to Custom Properties and clicking 'Add'.

Edit the property as desired (since you want it to drive a shape key you probably want it to have Min/Max set to the default 0.0 and 1.0) and give it a suitable name (I've left mine as 'prop').
Go to the Material and add the driver as normal (right-click the Location in the Mapping node and select Add Single Driver). Do the same with the Shape Key value.
Go to the Graph editor and select Drivers. Locate your drivers and set the type to Averaged Value, the default variable ('var') to Single Property, set it to your object and enter the Path as '["prop"]' (where 'prop' is the name of the property you created). Click Update Dependencies for good measure. Do this for both of your drivers.

Now you should find that changing the Custom Property on the object should update both values. Custom Properties can be keyframed just like anything else.
One advantage of using Custom Properties is that you can put all of your 'controls' in one place - rather than having to hunt out the different panels for, say, Shape Keys, etc.
NOTE: If the driver only needs to use a value from a property or channel - rather than perform a calculation - then using Averaged Value means that you don't need to enable 'Scripting' in the Blender User Preferences. However, if you do need to use Scripted Values then you'll need to enable scripting by enabling Auto Execution in the File tab of the User Preferences.


How to assign separate material to separate mesh i have the base mesh and with the bool tool addon i have some difference, slice operation and it created separate mesh. When i try to give different material to the mesh. it gives the material complete model. if i delete the material from particular mesh it delete complete material from all the mesh. I dont want to apply all the boolean operation. How to give material to separate mesh.
Demo file

Video
This is what i did so far
https://imgur.com/a/t1RpCvR

Actually your objects are linked-duplications, it doesn't look like because you gave them different booleans. So any modification on one of them (material or mesh) will be replicated on the other. If you want to keep their mesh linked but want to have separate materials, choose Object instead of Data in the Material panel:

If you want to completely separate them, go in the Object menu > Relations > Make Single User > Object & Data.


Custom properties on an action, any place for UI visibility? I'm writing an importer/exporter for a game, and animations are identified by an ID number associated with a set of position/rotation keyframes. In the original 3DS Max exporter, they are controlled by a custom location/rotation controller, which handles the data.

It seemed like the natural mapping to Blender would be separate actions. I can add a custom integer property to bpy.types.Action easily to store the value, but there doesn't seem to be any kind of property sheet/panel for actions exposed in the UI (that I can find - for example the dope sheet/action editor has the property panel empty), so I'm not sure where to add UI elements to allow users to edit this property.

Is there something I have missed, or where can I put the UI? Otherwise, I could just require users to encode the ID into the action name, but that seems.. inelegant, at best, and prone to mistakes.

Can also add a custom property panel to the Action Editor, much the same way as it is added to other parts of the UI.  Import the rna_prop_ui.PropertyPanel class and set the path from context to "object.animation_data.action" and the type to bpy.types.Action.

The default bl_label if not defined otherwise is "Custom Properties".

import bpy

from bpy.types import Panel
from rna_prop_ui import PropertyPanel

class ACTION_PT_custom_props(PropertyPanel, Panel):
    bl_label = "Action Properties"
    bl_idname = "ACTION_PT_custom_props"
    bl_space_type = 'DOPESHEET_EDITOR'
    bl_region_type = 'UI'
    # required for PropertyPanel
    #COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}
    _context_path = "object.animation_data.action"
    _property_type = bpy.types.Action

    @classmethod
    def poll(self, context):
        obj = getattr(context, "object", None)
        ad = getattr(obj, "animation_data", None)
        action = getattr(ad, "action", None)
        return action is not None

def register():
    bpy.utils.register_class(ACTION_PT_custom_props)

def unregister():
    bpy.utils.unregister_class(ACTION_PT_custom_props)

if __name__ == "__main__":  # only for live edit.
    register()


bpy.ops.wm.addon_expand(module="module_name") works in console, but not in add-on My add-on shows the User Preferences view, selects the "Add-ons" tab and search for a specific add-on.

I'm trying to expand that add-on, but it doesn't work consistently. I get this error:

AttributeError: 'NoneType' object has no attribute 'bl_info'

It works in console, though.

The code in question is this, where xxx is the name of the .py file or the add-on folder.

class XxxOperator(bpy.types.Operator):

    bl_idname = "xxx.configure"
    bl_label = "Show Plugin"

    def execute(self, context):
            bpy.context.user_preferences.active_section = 'ADDONS'
            window = bpy.ops.screen.userpref_show('INVOKE_DEFAULT')
            bpy.data.window_managers["WinMan"].addon_search = "xxx"
            bpy.ops.wm.addon_expand(module = "xxx")
            return {'FINISHED'}

It's an option in the menu. The init file (I'll omit the bl_info and the imports):

class XxxMenu(bpy.types.Menu):
bl_idname = "OBJECT_MT_XxxMenu"
bl_label = "Xxx"

def draw(self, context):
    layout = self.layout
    layout.operator("xxx.submit", text="Submit")
    layout.operator("xxx.configure", text="Show Plugin")

def add_to_menu(self, context):
    self.layout.menu("OBJECT_MT_XxxMenu", icon = "PLUGIN");

def register():
    bpy.utils.register_module(__name__)
    bpy.types.INFO_MT_render.append(add_to_menu)

def unregister():
    bpy.utils.unregister_module(__name__)
    bpy.types.INFO_MT_render.remove(add_to_menu)

if __name__ == "__main__":
    register()

Whether an addon is displayed expanded or not in the User Preferences is stored in the bl_info dictionary, in the property called show_expanded.

addon_utils manages a cache of addons. It uses the global addons_fake_modules. It can be used to determine and change the expand state:

import bpy
import addon_utils

# Get a module reference by name
mod = addon_utils.addons_fake_modules.get("space_view3d_3d_navigation")

# If found, expand it
if mod is not None:
    mod.bl_info['show_expanded'] = True

    # Find User Preferences area and redraw it
    for window in bpy.context.window_manager.windows:
        for area in window.screen.areas:
            if area.type == 'USER_PREFERENCES':
                area.tag_redraw()

Note that running this code as part of an addon is tricky, see e.g.:

http://wiki.blender.org/index.php/Extensions:2.6/Py/API_Changes#Restricted_Context
https://blender.stackexchange.com/a/18134/1363


Can I map blender with a MIDI controller? Can I use a MIDI controller to map blender's interface so that it becomes faster?

I tried with some MIDI translator, but I'd like to not have to use external software.

Does "external software" include Blender add-ons? There are a few for MIDI in and out event detection. i.e. "Add MIDI" http://www.jpfep.net/pages/addmidi/ ;

I don't think you can map MIDI controllers without add-ons or at least a python script.


Select which GPUs to use for rendering I was wondering whether you can choose a pair of gpus to render in a three gpu machine. Maybe a checkbox-like option in which you designate which graphics cards to use. All that Blender is allowing is either using all three cards or just one.

Yes, when you have more than 1 GPU blender options are all the GPUs at once and then each single individual GPU.

This feature is on the dev's todo list for longer than 2 years.

You can check it here: https://developer.blender.org/T37717

Dec 8 2013, Brecht wrote:

  It's on my todo list to improve graphics card configuration for 2.70, to allow you to select individual cards and enable/disable them. This is not considered a bug at the moment however.


Material Instances Using Same Node Set Up I’ve set up my material using all these nodes, which also has an image texture Node,
I’d like this material to be applied on other objects as well. but to be able to change
the image texture on the object(s).

So rather than clicking on the Plus icon, which will add new material and I have to redo the nodes up again.I click on the Icon NEW MATERIAL (indicated in Teal colour), so I can duplicate the existing material Node set up and assign it on another object(s).

So I add a sphere to my scene. Now when I try to change the image texture on the sphere, It also affects the rectangle as well. So what ever I add in the image texture node
its affecting both objects. So how can I have the materiel node set up, but to be able t control each objects image texture separately?

I had the impression that by making a duplicate of the materials it becomes an entity of its own, so you can affect the object you choose without altering the appearance of the other one since it’s a new instance, and has a different name, e.i: Material Start, Material Star.001, they’re both named different to target each object differently.

Thank you.

It's true that making duplicate material, the new material is a new entity. But what you may miss is since you have multiple materials in an object, the object may still use the same material as the sphere. Try this:

Select the object with multiple materials.
Enter edit mode, select faces that you want (or I assume you want to select everything)
The materials section now will have Assign, Select, and Deselect.
While the faces are selected, select the material you want from the materials list, then press Assign button.

  I click on the Icon NEW MATERIAL (indicated in Teal colour), so I can
  duplicate the existing material Node set up and assign it on another
  object(s).

You don't have to do this to be able to assign it for another object. You can just select other object, then click the material icon next to the name field, then choose the previous material with the node set up.
Note that Blender doesn't save unused material (indicated by 0 in front of the material name when you click materials list), means the next time you open the file, they won't be there, so instead you can just make sure the material is used by an object to not disappear later when you open your file.
OR you can also preserve unused material by clicking the shield icon (fake user button) next to the duplicate button, so it is saved even though no object is actually using it.


Model is multiple colors and renders with artifacts A couple days ago I decided to try Blender.

Why on screen do some faces have a different color and some "scratches"? How do I make all of the 3d model one color?
And after rendering I have some artifacts (see screenshot). What is the reason of this?

There are many different reasons, a few fixes:

In edit mode, Press A until everything has been selected. Press Ctrl+N, This re-calculates normals and corrects them.
Press T Inside the 3D view, and on the left you should see a button that says "Remove Doubles", click that and it could possibly fix your problem.


How do I keep my cylinder from being filled? I am making a wall holder for my AC oil. For some reason when I bring it into my print program (Flashpoint) it doesn't see the inner cylinder/hollow.

I suspect your normals are inverted on the inner faces. In Edit mode, press A to select all, then Ctrl-N and re-export.


camera clipping settings not extending far enough Blender 2.8. MAC
I created a straight cyc wall and I'm rotating doing about a 35degree camera rotation around an object.  No matter how big I make the camera clipping end point the wall clips on the ends.  Currently it's set to 10000 but there's no change with any number bigger than 250.  I can see the correct wall end in viewport but not in camera view and not in renders.  I place a monkey head on the edge of where it clips.

Welcome to Blender Stack Exchange!
There's actually 2 different clip distance settings. One is for the viewport, but the camera also has its own separate clip distance, which is probably set too low.
With the camera selected, you can find this in the camera tab of the properties panel.


Why does the 3D view have trouble with clip start <=0.01 Earlier I've answered a question where the issue was that in edit mode, the 3D view fully or partially renders the mesh as if limit selection to visible was not ticked, when the 3D view clip start is set to 0.01 or lower, (or apparently when the 3D view clip end is set to 100000 or higher and view is set to Ortho - but I'm more interested in the first scenario).
If someone here knows, I'd really love to know why this is happening. The default values are 0.1 and 1000. So you'd expect not to run into such an issue when changing the values to 0.01 and 100 for example. By default 1 Blender unit equals 1 meter, this means that if you want to keep this default but work on an object that is the size of something that you can hold in your hand, then you'll run into this issue. Designing objects that are the size of your palm is not a very rare thing to do.
Furthermore, this issue does not happen when the 3D view is set to camera. Doesn't that prove that it should be able to work as expected in user view as well? Or is there even a way to get rid of this issue when working with a view clip start of 0.01 in Edit Mode? It should also be noted that sculpt mode is not affected either.

From my purely theoretical and limited technical knowledge on the matter real time rendered scenes (like in OpenGL or DirectX) use a Z depth buffer to determine the distance to camera of any object or vertex on screen.

That Z buffer is basically a black and white image of the screen, where for every pixel there can be a a value from 0 to 255 (black to white) for distance information. This image is then used to determine what is visible and what is not and build the viewport image. (There may be other wizardry involved for increased precision like double precision or using other color channels for more possible depth values, by my technical knowledge is limited here)

If the clipping distances (Start and End)are too far apart these 255 (or whatever) shades of grey are not gonna cut it and will not be enough for all the possible depth differences on screen, so artifacts and errors start appearing on screen, like the so called Z-Fighting on co-planar or coinciding faces, or these seemingly ghost-like edges and see-through faces in your mesh.

Now in theory changing clipping values but keeping them in sync should have no ill effects, but there are probably other variables like your graphics card capabilities, drivers, etc.

I would also like to know more about this, so if Blender developer, programmer or someone with more technical knowledge care correct me or enlighten us, I would be very grateful.


Why doesn't render animation work? I made a rather simple animation using video sequence editor (mostly blinking between two images), but for some reason I cannot render it. When I clicked render animation, all I see in the render result window is the blank "image" and nothing happens. I made the animation in blender 2.8 and I though maybe there is a problem in blender 2.8, but it didn't work (the same file) in blender 2.79 either. This was the second try of the same animation, first rendered fine, but crashed so I had to start over. This is what I get:
I can render image and get the first image of the video.

Here is the title and ID for a youtube video that explains step by step how to render an animation.  He is excellent at explaining things and would do it better than I.  Hope it helps.
Title:  How to Render Animations in Blender
ID: dd5RT8rEPqU
Here's the link:  RenderingVideo


Possible to stop Subdivision Surface modifier from deforming my mesh? I use a subdivision surface modifier which makes my character look great.

I have to apply this modifier and this is where problem begins. It looks good before I apply it. I have no idea why, but after applying it, if I animate my character then when bones bend my character has holes in it.

Before applying:

After applying:

I have checked almost every modifier/option/feature that could help me but nothing did. I did see someone had similar problems with this in past and couldnt resolve it.

My blend file:

More detail is needed as of why you have to apply the SubSurf modifier to provide a more complete solution. To illustrate the problem you're ramming into, just move the SubSurf modifier up one level in the Stack:

Before:

After:

why does this happen?

Remember, applying modifiers has to be in order of their influence on the mesh! In your case that means you'd have to apply the Skin modifier first, then the Armature modifier, then the SubSurf. If you just click on Apply for any modifier in Blender which is not at the top of the stack, internally it is reordered to the top of the stack before it is applied.

All modifiers in Blender work sequentially, one after the other. In your case, your Mesh is Skinned first, then you deform that rough tube mesh using the Armature, then the Subsurf smooths the polygons of the result. Changing the order changes the solution. When you were parenting the Mesh to the Armature, the SubSurf wasn't there yet, so no weights could have been stored for it. That's why the weird deformation happens.

possible solution

set the Armature to Rest Position
Unparent your mesh from the Armature using Alt + P
Remove all existing Vertex Groups from the Mesh. This is done in the Mesh data tab, by clicking on the down arrow to spawn the menu, and choosing Delete All Groups

Apply the Skin Modifier
Apply the SubSurf Modifier
Re-Parent the Mesh to the Armature using Automatic Weights

The parenting and weighting will be more difficult than before, because there is more vertices to be considered in the equation. You'll see some glitches at the shoulder area when following this procedure too. That's because you were not modelling the mesh in T-Pose, so the weighting has too many possible candidates for the bone in that area.


How can I navigate my scene FPS style similar to how Unity does? I am aware of ShiftF fly, but it's extremely cumbersome having to use the scroll wheel to change the velocity of flight and moving the mouse from the center to spin.

Is there a way to move the viewport camera (not the scene camera) like Unity lets you right click and fly around with WASD and moving the mouse?

The latest version of Blender has Walk Mode, You can access it by pressing Shift~ (the tilde/backtick key above Tab) or View > Navigation > Walk Navigation. If you want to use Fly Mode (which used to be the default), you can switch between them in User Preferences > Input.

Under 2.8+ you can access both from the 3D View header menu View > Navigate > Walk or Fly:

It's WASD just like in FPS-games, Q and R to move up/down. G or Tab enable gravity and collision, and V to jump in gravity mode. Space teleports you to the surface you are pointed at. You can even change the key-bindings to enable FPS Walk (the official name) on MMB down, and confirm on MMB up to always rotate (or rather: look) in FPS-style - or even hold MMB down and use WASD!


Once camera angle is locked into place with location rotation, how do I delete? I'm editing a video and I locked my camera angles in with "locroc" but now I want to delete a few of the angles and I'm not sure how. I tried the undo button but it won't go back enough times to erase the ones I want to get rid of. How can I delete them?

You can do it by selecting the camera then pressing these buttons:


why when I rotate a point in a curve all the points is rotating? I am making something with a curve and everything is good but suddenly when I rotate a point all the points rotate with it. How can I make them rotate separately?
here is before rotation

and here is after rotation

When you are editing curves, selecting the point of the curve also selects the two control handles that define the curve going into and out of the control point. Rotating this selection moves all three and may not give the result you want.

Another property of the curves control point is Tilt, you can see this value under Transform in the properties sidebar N. When using a flat extrusion shape this can 'twist' the extrusion sideways without altering the curve shape.

You need to be cautious with it's use as a large tilt value compared to the next points can give a visible crease.


Missing Material Issue; Pink Color in Render Mode I made a simple image in Inkscape to go into the background of the shot to make it look as though the robot was in space. However, when I go to add it through the materials tab, it shows up as pink whilst rendering. I looked into the problem and tried to troubleshoot on my own by using the File >>> External Data >>> Find Missing File and it still did not want to show up. I have attached the file extensions and the Blender UI while I am editing for anyone who needs it.

Thanks to anyone who can help. I am sure this is a simple fix that a beginner like me cannot figure out.

Make sure the image is not corrupt before adding it into Blender. If this happens, re-download or re-export the image.


How do I connect these faces? How do I add a curve connecting the two faces? I’m attempting to model a wing, so this would be the “elbow”, so it can’t be perfectly smooth, but I literally just started blender and the tools are extremely overwhelming. And I suppose, for future reference, I should ask: what kind of tool should I use for the membrane? Can I lock things to a parent point so it doesn’t create gaps when I finally animate it?
cube.006 is the upper one, while "cube" is the lower one.
please explain it to me like I'm stupid this has taken ALL of my brainpower I'm pretty sure I'm losing my mind.

If both cylinders have the same amount of vertices on their head faces, you can

select both objects

CTRL-J -> Join

tab -> edit mode

select edge loop of both faces

Edge -> Bridge edge loops

result:


Store viewport display color and toggle shading type I need to toggle between material and object color in the viewport shading, when I toggle on, the viewport shading should change to object and all the selected objects should show the same custom viewport display color value and when is toggle off the mode, it should return again to the previous state and each of the objects with their own viewport display color they had before the toggling.
What I have so far is far from working but I think the general idea is in the code. Somehow it changes the color of the object but give me some errors and I can't revert the previous viewport display color that each object had. Hopt all this makes sense.
import bpy
from bpy.types import Panel, Operator

bl_info = {
    "name": "Toggle Viewport Color",
    "author": "USERNAME",
    "version": (0, 0, 1),
    "blender": (2, 92, 0),
    "location": "View3D > N Panel > Toggle viewport color",
    "description": "",
    "doc_url": "",
    "tracker_url": "",
    "category": "3D View"
}

class Toggle_Viewport_Color_OT(Operator):
    """Toggle viewport color for selected objects"""
    bl_idname = "objects.toggle_viewport"
    bl_label = "Toggle viewport color"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        objs = context.selected_objects

        old_col = bpy.context.object.color = (1, 1, 1, 1)
        new_col = bpy.context.object.color = (0.5, 0, 0, 1)

        for o in sel_objs:
            for area in bpy.context.screen.areas:
                if area.type == 'VIEW_3D':
                    for space in area.spaces:
                        if space.type == 'VIEW_3D':
                            space.shading.color_type = 'OBJECT'
            new_col

        for o in hid_objs:
            for area in bpy.context.screen.areas:
                if area.type == 'VIEW_3D':
                    for space in area.spaces:
                        if space.type == 'VIEW_3D':
                            space.shading.color_type = 'MATERIAL'
            old_col

        return {'FINISHED'}

class Toggle_Viewport_PT(Panel):
    bl_label = "Toggle viewport"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = 'Toggle viewport'

    def draw (self, context):
        layout = self.layout

        col = layout.column()
        col.operator("objects.toggle_viewport")

classes = (
            Toggle_Viewport_Color_OT,
            Toggle_Viewport_PT,
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)

if __name__ == "__main__":
    register()

That's not that easy as you might think and there are a few concepts involved.

For one, you would have to find a reliable way to store the actual object pointer or at least the name of the object and its corresponding viewport color for all selected objects. I would recommend register a CollectionProperty per scene and set its type to a prevously declared PropertyGroup to hold an object and its original color per item:
class CUSTOM_PG_objectColors(bpy.types.PropertyGroup):
    # name: bpy.props.StringProperty()
    obj_color: bpy.props.FloatVectorProperty(size=4)

bpy.types.Scene.custom_color_coll = bpy.props.CollectionProperty(
    name="Custom Object Collection",
    type=CUSTOM_PG_objectColors)

Even better would be using a PointerProperty for the actual objects, further reading:

Is it possible to use bpy.props.PointerProperty to store a pointer to an object?
Populate a list with custom property dictionary data
How can I store and retrieve a custom list in a blend file?

Next, in case your custom color is already assigned to Material.diffuse_color, you would have compare the color components due to limitations of floating point values before adding the object and its color to the list:
# Get the collection
obj_coll = context.scene.custom_color_coll

# Add the name of the object and its material to the list
for obj in context.selected_objects:
    mat = obj.active_material

    # Compare the colors per component before adding the item to the list
    self.color_match(mat.diffuse_color, self.color)
        item = obj_coll.add()
        item.name = obj.name
        item.obj_color = mat.diffuse_color
        # ... and set your custom color
        mat.diffuse_color = self.color

Further reading:

How to compare colour values in Blender using Python?
Code to toggle viewport display material alpha

And finally, notice that you do not need to iterate through the Screen.areas in order to set View3DShading.color_type since the operator is already part of the properties panel in 3D View. Consider adding a check if there is no material assigned to the object.
import bpy
from mathutils import Vector

class CUSTOM_PG_objectColors(bpy.types.PropertyGroup):
    # name: bpy.props.StringProperty()
    obj_color: bpy.props.FloatVectorProperty(size=4)

class CUSTOM_OT_displayColors(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "view3d.custom_display_colors"
    bl_label = "Custom Display Colors"

    action : bpy.props.EnumProperty(
        items=(
            ('SET', "Set custom Display Colors", ""),
            ('RESET', "Reset Display Colors", "")))

    color : bpy.props.FloatVectorProperty(
        size=4, default=(1.0, 1.0, 0.0, 1.0))

    @classmethod
    def poll(cls, context):
        return len(context.selected_objects)

    def color_match(self, col1, col2, tol=0.001):
        def vector(col):
            # sanitize range (-2, 3, 5) = (0, 1, 1)
            return Vector([max(0, min(1, c)) for c in col])

        d = vector(col1) - vector(col2)
        return d.length <= tol

    def execute(self, context):
        # Get a reference to the list composition
        obj_coll = context.scene.custom_color_coll

        if self.action == 'SET':

            # Add the name of the object and its material to the list
            for obj in context.selected_objects:
                mat = obj.active_material

                if not self.color_match(mat.diffuse_color, self.color):
                    item = obj_coll.add()
                    item.name = obj.name
                    item.obj_color = mat.diffuse_color
                    # ... and set your custom color
                    mat.diffuse_color = self.color

            # Set Shading to 'TEXTURE'
            context.area.spaces.active.shading.color_type = 'TEXTURE'

        else:
            # Iterate through the custom list and reset the color
            for item in obj_coll:
                obj = context.scene.objects.get(item.name)
                if obj:
                    obj.active_material.diffuse_color = item.obj_color

            # Clear the list
            obj_coll.clear()

            # Set Shading to 'OBJECT'
            #context.area.spaces.active.shading.color_type = 'OBJECT'

        return {'FINISHED'}

class CUSTOM_PT_viewportToggles(bpy.types.Panel):
    bl_label = "Toggle viewport"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = 'Toggle viewport'

    def draw (self, context):
        layout = self.layout

        layout.operator(
            CUSTOM_OT_displayColors.bl_idname,
            text="Set custom Viewport Colors").action = 'SET'
        layout.operator(
            CUSTOM_OT_displayColors.bl_idname,
            text="Reset Viewport Colors").action = 'RESET'

        layout.prop(context.scene, "custom_display_bool")

def register():
    bpy.utils.register_class(CUSTOM_PG_objectColors)
    bpy.utils.register_class(CUSTOM_PT_viewportToggles)
    bpy.utils.register_class(CUSTOM_OT_displayColors)

    bpy.types.Scene.custom_color_coll = bpy.props.CollectionProperty(
        name="Custom Object Collection",
        type=CUSTOM_PG_objectColors)

def unregister():
    bpy.utils.unregister_class(CUSTOM_OT_displayColors)
    bpy.utils.unregister_class(CUSTOM_PT_viewportToggles)
    bpy.utils.unregister_class(CUSTOM_PG_objectColors)

if __name__ == "__main__":
    register()

Also a toggle usually means a BoolProperty. As the name suggests it's typically used to store a simple state rather than assigning values to other properties like the viewport color. You can trick it using its update function though:
def update_func(scene, context):
    if scene.custom_display_bool:
        bpy.ops.view3d.custom_display_colors(action='SET')
    else:
        bpy.ops.view3d.custom_display_colors(action='RESET')
...

bpy.types.Scene.custom_display_bool = bpy.props.BoolProperty(
    name="Display Toggle", update=update_func)

Related:

How to pass multiple operator properties via UI layout?
How can I add a checkbox in the tools UI?


Copying detail from one side of an object to another? If I had a cube like object with 6 main faces:

and I added some detail to one side:

How can I copy what's on that one face to the 5 other faces? I know I can mirror to have a copy on the opposite side, but what about the other 4 faces?

While taking screenshots for the question, I managed to figure out how to make it work for uniform/regular shapes. I'm still interested anyone who has an answer for how to do this when the faces are not in regular locations.

This method only works for objects derived from uniform/regular shapes:

First select all vertices you want copied:

Then Shift+D to duplicate, P -> Separate by selection to separate new that part.

Go back into object mode, select the new part and rotate 90 degrees (if its a cube) to the face you want it on.

Duplicate rotate the new object to other positions you want it on.

Select the original object, go into edit mode and delete the faces that are now occupied by the new objects

Back in object mode, select everything and press Ctrl+J to join them back into one object.

Now press A to select all, W -> Remove Doubles to remove the duplicated vertices and join new faces back together with the original object

And you are done!


Bone effecting part of mesh it has 0 influence on? though its my second time modeling, its my first time weight painting + working with mesh aspects particularly close to one another.

seen above the right arm bone has absolutely no influence to the belt-tail part of the mesh

however when the arm is moved in the pose menu it moves with it! any thoughts on how to fix this?

yes, on the object property panel (to your right) go to the tab where it shows a icon,triangle of vertices. Look for the Vertex group panel there.
You´ll see a list of "weight groups" you need to locate the one that is named exactly like the bone is afecting your tail. Once you find it, you´ll see your arm turns on with color (in your image is red) and then go to the T panel on your viewport (press T) and on the tool select SUBSTRACT brush. Place the settings to : 1 in weight. 1 in strenght. Now, paint the TAIL.

This will substract instantly every weight influence the tail is having from any other bone.

Once you´re done, switch back to DRAW in your tool palette.

Thank you for your consideration to vote me as the answer by clicking to the left :the icon with a check mark and upvote this answer.

BFCT_Schiller


What are the Cycles specific Viewport Display settings in the material tab good for? The material tab contains a Viewport display panel. Here you can set the color to display a mesh in green in solid mode for example.
But there is also a Setting sub panel. And its content does simply nothing in the viewport.
Is this panel for Cycles in the wrong place? Because with Eevee these settings are in the Settings tab.

If your 3D Viewport Shading mode is set to "Material Preview", then these settings become relevant. For example, if you have a glass material and set the Blend mode to "Opaque", it is not transparent (just like in the render settings for Eevee).
You can change Eevee settings there, without switching render engines.


Environment texture for background does not show up in node editor I've added a environment texture as my background as well as lighting for a house. It works fine. At one point I could edit the environment texture as well as adjusting hue or brightness in the node editor. But now I couldn't figure out how to bring it back. The node editor only shows the last selected object. And I can't select "world" in the outliner either. Any idea?

You can select world materials in the Node editor by pressing the world icon in the header:

The cube icon will switch back to showing object materials.


How to reduce the output video size? How can I make video output smaller, or what would be a better codec to use? Currently 31 seconds of video is 127MB and at that rate, videos longer than a few minutes would be impractical because I'd have such large files. I used AVI JPEG because it seems to open in more video players, not sure if anything special is needed on client's PC to display videos made in the other formats.

AVI is both large and not the most common format. It is generally played natively only on Windows, although other software packages can also open it (such as VLC). As such, it is not a good choice.

The format you are looking for is MP4 with the H.264 codec. It is the most common format and codec that plays on almost everything. It also has a relatively small file size.

As an additional tip, you should watch this tutorial on the best practice for rendering animations (you should render the individual frames as PNG images first, then encode the frames into a video file).


Addon preferences don't show consistently Background
I have some add-on preferences in the modular tree add-on I have been contributing to.
Problem
They show up fine on my macbook with blender 2.77, but they appear to be missing on windows and linux computers using the same blender version. Any ideas as to why?
Extra Info
I have personally tested it on a windows 7 box: there are no errors and all the functionality works fine (so the add-on prefs are registering correctly). It is just impossible to change the add-on prefs without a knowledge of scripting because it doesn't show up in blender's UI.
Github repo:
https://github.com/MaximeHerpin/modular_tree
Blender Artists thread:
https://blenderartists.org/forum/showthread.php?405377-Addon-Modular-Tree&p=3101211#post3101211
What it should look like (the rest don't show anything past the "Internet: Docs  Report  Remove" line):

When you install the add-on from the zip provided by GitHub, Blender unpacks the zip's contents, a folder called modular_tree-master, into Blender's local add-on storage folder (the exact location varies between operating systems). The main point is that the add-on folder is no longer modular_tree, that's also the problem.

There's an assumption in this section of the code.

class TreeAddonPrefs(AddonPreferences):
    bl_idname = "modular_tree"

Hardcoding bl_idname like that assumes that the folder name (or "package name") is still  "modular_tree".

There are many solutions, some more convoluted than others..

0. Renaming the content of the zip.

(don't do this, only included for completeness).

You can rename the folder inside the zip to simply modular_tree (using something like 7zip) before installing, it will display the add-on preferences correctly. But doing that is kind of a hassle, most of your users will need to do it if they aren't getting your add-on as a GIT project.  you should be fixing it in one place for everyone.

1. "Monkey Patching" the __package__ name

One way to force the package name is:

# somewhere at the start of your __init__
if __name__ != "modular_tree":
    sys.modules["modular_tree"] = sys.modules[__name__]

then you can do

class TreeAddonPrefs(AddonPreferences):
    bl_idname = __package__

2. using basename and dirname of __file__

# somewhere at the top of your __init__.py
from os.path import basename, dirname

then

class TreeAddonPrefs(AddonPreferences):
    bl_idname = basename(dirname(__file__))  # directory name containing this file

The result is that it doesn't matter what the zip was called / or the eventual folder.


3D view is completely warped! I've been using blender for a while now, and this has never happened to me before. I was designing an ad in Blender 2.73a for a game that I made. However, when I went into camera view, everything looked bigger then in the final render. Why is this happening and how can I fix this?

P.S. I've been using blender for about a year, but I still don't know all the buttons, so please no jargon!

This actually isn't to hard to fix.

You are zoomed in (very far) when looking in the camera view. if you zoom out, Middle Mouse ↕  you will see the proper bounds for the active camera.


Physics simulation won't run until the last frame of the timeline I am making a rigid body physics simulation. It started out ending at 250 frames, but I later changed it to 400 frames.

The problem occurs when the whole animation stops at the 251st frame. Is there a certain setting for this or do I have to restart all over again?

The rigid body simulation does have it's own start and end.

In the 'Rigid Body World' settings you can change the simulation start and end.


Is there a way to pull data from bpy.ops without putting the model into Edit Mode I want to pull data from a bpy.ops command, something like
for x in bpy.data.objects:
    if x.name in bpy.context.view_layer.objects.keys():
        bpy.context.view_layer.objects.active = x
        bpy.ops.mesh.select_non_manifold((extend=True, use_wire=True, use_boundary=True)

and follow it up with commands like
a = bpy.data.objects['obj'].data.total_edge_sel

to grab non-manifold edge data (other other data gatherable if the model were in edit mode) without throwing the model into edit mode. Currently I'm getting out of context errors (the model is in Object Mode. I understand why the error, but...)
Is something like this it possible without flashing 200+ mesh objects into edit mode to get the data?
EDIT:
Thanks for the info batFINGER, the report is starting to take shape!
'Model Name: 00000000DE66'
'Model Armature: 00000000DE66_Skeleton'
'Armature Bone Count: 377'
'Number of Bones Without Vertex Groups: 28'
'Armature Scene Rotation Mode: XYZ'
'Armature Rotation: (90.0, 0.0, 0.0)'
'Number of Bones Layers: 1'
'Number of Mesh Objects in Model: 9'
'Number of Vertices in Model: [10188, 178, 264, 1598, 226, 92, 1740, 396, 226]'
'Number of Vertex Groups in Model: 349'
"Number of Vertex Groups That Don't have Bones: None"
'Number of Vertices Influenced By More Than 3 Bones: 1175'
'Number of Vertices Not Weight Painted: 0'
'Number of Materials: 8'

'Model Name: Sesshomaru'
'Model Armature: Sesshomaru_arm'
'Armature Bone Count: 204'
'Number of Bones Without Vertex Groups: 44'
'Armature Scene Rotation Mode: XYZ'
'Armature Rotation: (0.0, 0.0, 0.0)'
'Number of Bones Layers: 3'
'Number of Mesh Objects in Model: 1'
'Number of Vertices in Model: [9599]'
'Number of Vertex Groups in Model: 162'
"Number of Vertex Groups That Don't have Bones: 2"
'Number of Vertices Influenced By More Than 3 Bones: 2905'
'Number of Vertices Not Weight Painted: 0'
'Number of Materials: 30'
```

Edit multiple objects.
AFAIK it is impossible to use bpy.ops.mesh outside of edit mode. It would be possible to emulate the select non manifold operator in object mode, however since all objects can be placed into edit mode at once, and the operator called once, it feels unnecessary to bother

As of blender 2.8 it is possible to edit a number of mesh objects at once.  So instead of "flashing" each object, select all the objects to edit, call the operator once, then output the meshes total_edge_sel count, or update all edit meshes by either toggling out of edit mode or calling Object.update_from_editmode() and read the selected edges, and count the edges selected, to get both the total and which edges are selected.
import bpy

context = bpy.context
scene = context.scene

# select and put all in edit mode
for o in scene.objects:
    o.select_set(o.type == 'MESH')
# make sure active object is included
context.view_layer.objects.active = context.selected_objects[0]
context.tool_settings.mesh_select_mode = (True, True, True)
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_non_manifold()

for o in context.objects_in_mode_unique_data:
    print(o.name, o.data.name, o.data.total_edge_sel)

Test run on 4 objects in image, two cubes, a plane and suzanne.
Cube Cube 0
Plane Plane 4
Suzanne Suzanne 42

Note the second cube shares same mesh as first (linked data), hence only one with unique data shown.


Python access to Skin Modifier data - again I am trying to access skin modifier vertices data. An older solution does not work in my Blender 2.75 / 2.76:

print('has skin=', bool(context.active_object.modifiers['Skin']))
data = context.active_object.data
print(data)
vert = data.skin_vertices
print('skin_vertices=', vert)
v0d = data.skin_vertices[0]
print('skin_vertices[0]=', v0d)
v0d_data = v0d.data
print('skin_vertices_data=', v0d_data)
print('--------loop--------')
for v in v0d_data:
    print('skin_vertex=', v)

That returns:

has skin= True
bpy_struct, Mesh("Skin")
skin_vertices= bpy_collection[1], Mesh.skin_vertices
skin_vertices[0]= bpy_struct, MeshSkinVertexLayer("")
skin_vertices_data= bpy_collection[4], MeshSkinVertexLayer.data
--------loop--------

According to python api skin_vertices return MeshSkinVertexLayer not MeshSkinVertex, what we see in print data.

Bmesh also has a some skin data BMesh.verts.layers.skin, but it doesn't return any useful data.

Is there any way to access skin data?

The original question you link to mentions this in the first line, but doesn't make a point to clarify why the Object/Edit mode switch is important.

Non BMesh

When using obj.data.skin_vertices[0].data, the Skin Modifier data will show the correct current values only when the object is put back in Object Mode. The same is also true for checking other information of the mesh, like vertex.select.

BMesh

It may be possible to get this skin information while still in Edit Mode using bm = bmesh.from_edit_mesh(obj.data) but I have not been able to find an obvious way. If it is possible someone will no doubt offer a suggestion.


How do I show a "model" in a movie just like it is actually in the movie? I go this set up to show, I put A Movie in, then went to nodes, added the movie, scale set to render size, and rendered layer is connected to  Alpha over connected to composite .. the model is barely showing up .... I had to add emission to the material to the model to get it to do that, but it is not even very realistic looking.

I did not have your movie, so I substituted a brick image. I was able to achieve this result:

As you can see, it is not transparent at all, and nor is the brick background weird. I used this RenderLayer node setup:

Note the values in the Alpha Over node, which I changed to 0 and 1. The 0.527 for the Fac: value would have made your model transparent. The Premul: value could have led to the background distortions. Also note that I checked Transparent in the Properties panel > Render tab > Film dropdown. The modified Film dropdown should look like this:

Here is a modified .blend file. You will have to substitute your video back in to the RenderLayer node setup, though.


"Invalid clnors in this fan" warning I have this jointed arm model in this blender file.

First of all I am joining "left_arm" and "left_arm_ring_in_part" with ctrl+j after selecting both of them.

After that, I am selecting my new joined object "left_arm" ,switching edit mode and click on "remove doubles" button it gives "Invalid clnors in this fan!" warning twice after removing doubles. It doesn't seem problematic now but sometimes it gives that error almost 200 times repeatedly (e.g. while using "3D add-on" on this left arm for make manifold operation).

Does anybody know how to solve that ? Thnks in advance.

The problem is due to custom normals. "clnors" means "Custom Loops Normals".

The meshes have custom normals which means that their normals have been set (instead of auto calculated). When you join several meshes and/or remove doubles this custom setup cannot be maintained.

On each mesh you should do the following (before of after joining them):

Use the "clear custom normals" button (in the geometry data panel)
Remove doubles
Set smooth
Uncheck 'auto smooth'


Can I reuse a character to multiple characters in one scene with the link feature in Blender 2.8? What I want to do is look like the image above.

In fact, I posted the same question about Blender 2.79

In the meantime, i have heard static override of the 2.8 version.
Therefore, I thought the above operation would be possible.

But today I tried one collection multiple linking & make proxy in Blender 2.8 and it failed.

I tried to create a separate proxy for the linked objects, but all the objects are controlled by the last proxy I've created.

What did I miss?

Dan's method: failure

I tested Dan's method.
(Operation in the following order: link → make proxy → link → make proxy)
However, the result is that the last-generated proxy controls all linked objects.

This seems to be a limitation of Blender at the moment. You can't link in multiple copies of the same rig for independent animations.

The workaround is to create copies of the original blender file and link in the copies.


Missing Mist and Z in render layers I'm Really Confused, There is no Z and Mist under Render layers, I tried clicking what I could and still no clue why they are not there. I'm trying to put mist in the Simulation.

Enable mist and Z for the view layer.

For older versions of blender (2.79 or previous)

On the Scene tab(yellow circle), make sure that Z and Mist are checked(red circle).
Also, make sure that the render layer in the Scene tab matches the render layer in the node editor (green circle).
Z is now called Depth.


Move object to mouse position using python? From top view(orthographic), I'd like to be able to click in the 3D view and move an object to where I clicked. I know I have to do this in a modal operator, what I  need to know is how do I convert the mouse position coordinates into xy coordinates in the 3D view?

Can do this using bpy.extras.region_2d_to_location_3d
Here is a sample script using the Modal Draw Template script. As well as drawing a line, it moves the context object to the mouse cursor.  The depth is set to (0, 0, 0)
import bpy
import bgl
import blf
import gpu
from gpu_extras.batch import batch_for_shader
from bpy_extras.view3d_utils import region_2d_to_location_3d

def draw_callback_px(self, context):
    print("mouse points", len(self.mouse_path))

    font_id = 0  # XXX, need to find out how best to get this.

    # draw some text
    blf.position(font_id, 15, 30, 0)
    blf.size(font_id, 20, 72)
    blf.draw(font_id, "Hello Word " + str(len(self.mouse_path)))

    # 50% alpha, 2 pixel width line
    shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
    bgl.glEnable(bgl.GL_BLEND)
    bgl.glLineWidth(2)
    batch = batch_for_shader(shader, 'LINE_STRIP', {"pos": self.mouse_path})
    shader.bind()
    shader.uniform_float("color", (0.0, 0.0, 0.0, 0.5))
    batch.draw(shader)

    # restore opengl defaults
    bgl.glLineWidth(1)
    bgl.glDisable(bgl.GL_BLEND)

class ModalDrawOperator(bpy.types.Operator):
    """Draw a line with the mouse"""
    bl_idname = "view3d.modal_operator"
    bl_label = "Simple Modal View3D Operator"

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

        if event.type == 'MOUSEMOVE':
            x, y = event.mouse_region_x, event.mouse_region_y
            self.mouse_path.append((x, y))
            obj = context.object
            if obj:
                loc = region_2d_to_location_3d(context.region, context.space_data.region_3d, (x, y), (0, 0, 0))
                obj.location = loc

        elif event.type == 'LEFTMOUSE':
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'FINISHED'}

        elif event.type in {'RIGHTMOUSE', 'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        if context.area.type == 'VIEW_3D':
            # the arguments we pass the the callback
            args = (self, context)
            # Add the region OpenGL drawing callback
            # draw in view space with 'POST_VIEW' and 'PRE_VIEW'
            self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_PIXEL')

            self.mouse_path = []

            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "View3D not found, cannot run operator")
            return {'CANCELLED'}

def register():
    bpy.utils.register_class(ModalDrawOperator)

def unregister():
    bpy.utils.unregister_class(ModalDrawOperator)

if __name__ == "__main__":
    register()


How to unlink mesh from an empty? I have a mesh I downloaded that had a couple empties attached to it and I dont really like it being there. How would I remove the empty but keep the positioning and scale of the mesh its linked to?

Select your object and press altP (Clear Parent) > Clear And Keep Transformation


Speed up bpy object creation with "for loop" so i'm fairly new to blender scripting and could need some advice with this:

To put it simply, I want to create a cube made up of smaller cubes (100x100x100) with this script:

N=100;
for i in range(0,N,3):
   for j in range(0,N,3):
      for k in range(0,N,3):
          bpy.ops.mesh.primitive_cube_add(enter_editmode=True, location=(i,j,k))

which works well with smaller N. But takes horribly long with larger N. In the code above there are over 9000 objects to be created so I can assume there is a lot of memory to be allocated which slows things down.

However, I there a way to create such objects much faster? Is there a fundamental problem with my approach that I've not seen yet?

I also experience this "slow" behavior in other scripting modellers like OpensScad and hoped maybe blender does this a little better.

Tips and advice very much appreciated! Thanks!

Using array modifier

Using array modifiers will speed up the processing because it will lower the overall io between Blender and Python and also lower bpy.ops usage:

Create a base cube object.

Create and apply three array modifiers on it.

The code is commented below, but if not clear enough, please ask in the comments.

import bpy
import bmesh

def apply_modifier( obj, count, vector ):
    # Add an array modifier with its wanted parameters
    m = obj.modifiers.new( name = "Array", type = 'ARRAY' )
    m.use_relative_offset = False
    m.use_constant_offset = True
    m.constant_offset_displace = vector
    m.count = count
    # Apply it
    bpy.ops.object.modifier_apply( modifier = m.name )

def create_base_cube( context, name, size ):
    # Create an object
    mesh = bpy.data.meshes.new( name )
    obj = bpy.data.objects.new( name, mesh )

    # Add a cube
    bm = bmesh.new()
    bm.from_mesh( mesh )
    bmesh.ops.create_cube( bm, size = size, calc_uvs = False )
    bm.to_mesh( mesh )
    bm.free()

    # Link the object to the scene and set it active
    context.scene.collection.objects.link( obj )
    context.view_layer.objects.active = obj

    return obj

name = "CubeMap"
size = 2

obj = create_base_cube( bpy.context, name, size )

N=100;
interval = 3

apply_modifier( obj, N, (interval, 0, 0) )
apply_modifier( obj, N, (0, interval, 0) )
apply_modifier( obj, N, (0, 0, interval) )

Using dupliverts (proposed by Jackdaw in the comments)

An alternative is to use dupliverts, which seems to be faster and allows to define any patterns (not only cubic).

The principle is to create an object with vertices at the positions you want, then make it parent to a cube and use dupliverts as instancing method.

import bpy
import bmesh
from itertools import product

def create_base_cube( context, name, size ):
    # Create an object
    mesh = bpy.data.meshes.new( name )
    obj = bpy.data.objects.new( name, mesh )

    # Add a cube
    bm = bmesh.new()
    bm.from_mesh( mesh )
    bmesh.ops.create_cube( bm, size = size, calc_uvs = False )
    bm.to_mesh( mesh )
    bm.free()

    # Link the object to the scene and set it active
    context.scene.collection.objects.link( obj )
    context.view_layer.objects.active = obj

    return obj

def make_result_object( context, name, cube, vertices ):
    mesh = bpy.data.meshes.new( name )
    obj = bpy.data.objects.new( name, mesh )

    # Associate the vertices
    obj.data.from_pydata( vertices, [], [] )

    # Link the object to the scene and set it active
    context.scene.collection.objects.link( obj )
    context.view_layer.objects.active = obj

    # Make the object parent of the cube
    cube.parent = obj
    # Make the object dupliverts
    obj.instance_type = 'VERTS'

    return obj

name = "CubeMap"
size = 2

cube = create_base_cube( bpy.context, name, size )

N=3*100
interval = 3

vertices = [(x, y, z) for x, y, z in product( range(0,N,interval), range(0,N,interval), range(0,N,interval) )]

result = make_result_object( bpy.context, "result", cube, vertices )


(Game Engine) How to restrict character movement to linear paths I'm making a Pac-Man clone to familiarize myself with the game engine and I can't figure out how to limit the area the player/enemies can move in without introducing other problems. If I use a navigation mesh they kind of slide around clumsily instead of moving in straight lines parallel to the the x/y axis like in the original Pac-Man.

I've made a simple mesh (highlighted in orange) that shows the paths the characters should travel over.

Is there any way I can restrict their movement so they're always located at some point on this path or am I better off just using a ton of logic bricks to handle each turn at each corner individually?

Have you tried incrementing motion? You might try using a setup like the one in the image below to increment the motion of the characters (Although you can set the frequency extremely low) and then adding a non-rendering collision mesh ahead of the character that rotates them when they're about to hit a wall.

Just set the motion value to the number of blender units per grid space on your map, an that should do it!

Hopefully this helps! Just a quick aside, if the motion winds up being too fast, try halfing the value for motion. That'll slow it down while still preserving the grid-based motion.


What does Open Shading Language ( OSL ) mean? I was wondering what does Open Shading Language mean? I've heard people talk about OSL this and OSL that, and I just thought that it was something they said to sound smart.

I wonder if anyone actually knows what this is or does?

Open Shading Language is a programming language designed for writing shaders.

From the OSL page:

  Open Shading Language (OSL) is a small but rich language for
  programmable shading in advanced renderers and other applications,
  ideal for describing materials, lights, displacement, and pattern
  generation.

A Script node was added in blender 2.65 that allows users to use OSL shaders in Cycles.


How can I make any mesh be filled with smoke? I tried putting volume scatter and other nodes into the volume output in the node tree of a monkey but it creates a cube of volume around that monkey, how can I make it so it's like a monkey shaped cloud. Using Blender 2.83

If you're using Eevee, volumetrics nodes won't work as they work for Cycles, they will be shaped into cubes.
Since 2.91, though, you can create a volume empty (shiftA > Volume > Empty), and give it a Mesh to Volume modifier, with your object (here, your monkey) as Target. It will create a smoke that follows the shape of the Target:

Make your Suzane invisible. You can give your empty a material, by default it will be a Principled Volume plugged into the Volume socket of the Material Output. You can change the color or density of the volume:

Also, play with the parameters of the Render > Volumetrics panel, as it affects the quality of the volume:


MP4 Publishing does not have Audio in Blender v2.79.6 Video editing for MP4 does not work with audio anymore with v2.79.6. I got only an mp4 without an audio.

It seems it is working after I test it first with MP3 format. I'm using a WAV file for the video. initially it did not work. But after testing with MP3 input to MP3 output, WAV input to MP3 Output work on the mp4. so its fine now.


How to animate rotation of duplivert shape I have a rectangular shape parented to a circle set to duplivert, with rotation checked. It took a little bit of fiddling to get the rotation to work the way I wanted. At first the rectangles didn't rotate, or did so oddly, until I created a face for the  circle, and then deleted that face again.

Now I want to rotate the rectangles so the top ends fan outwards. I've moved forward a few frames and tried to set that up, but this time I can't get the rotation to work the same way. It's like it will do it on 2 axes, but not the third. I have tried every combination of Tracking Axes under Relation Extras with no luck.

Is there a way to get this to work with dupliverts?

You could use Dupliverts as an arranging tool, as you have already, working all at the origin, with the original plane's normal facing down its own local Y axis, (you may have to rotate it in Edit mode) as shown:

Then, to set up a basic rig:

With the circle selected, CtrlShiftA .. 'Make Duplicates Real'. Check 'Parent' The planes are now all instances, and can be transformed independently, but are all children of the circle.
Delete the original plane, and replace it with an empty at the origin.
Select a memorable plane-instance, and assign a Locked Track constraint to it. 'Target': the empty.'To':-Y. 'Lock': X
Select all the other planes, with the constrained one still active, and in the header  Object > Constraints menu, hit 'Copy constraints to selected' Now all the planes should be constrained to look at the empty.
CtrlP parent the empty to the circle
To tidy up, in the properties region of the 3D view, lock all the transforms of the empty, except Z location.
To tidy up further, select all the planes, and in an Outliner window, Alt-uncheck the selection arrow on one of them.

Now none of the planes should be directly selectable, the empty should only be able to move up and down in its local Z, (with the planes following), and the whole group can be moved or rotated by its parent circle.


Reducing the number of vertices I am trying to reduce the number of vertices by the tutorial and when I press f6 like the video says nothing happens and the bar does not appear?
CGC Classic: Female Character Modeling Pt. 2 - Major Face Loops (Blender 2.6) , in this tutorial at 17:50minutes, a guy created a circle mesh and then by pressing F6 he decreased the number of vertices, however in my case F6 does not show anything at all.

instead readd you circle and then go the left panel (press  T  button) and then you can decrease the number of vertices of your circle


Object radiance value buffer The "wiki" states that an objects radiance value is written out into the render float buffer.  Where in the source code is this buffer and how do I access it (variable name?)

Never mind. Found it.  It's in the path_radiance_accum function


OBJ format: can you export faces with indexes relative to the last "o Something" (object)? When I export a model with multiple objects, the face indexes of the second object, for example, won't start with 1, because they are "global", which means you have to keep track of every (v, vn, vt) occurrency. I want blender to export .obj and have faces indexes starting at 1 each time, even if it's necessary to duplicate some vertex. Is it possible?
PS.: I know I could export them separately, but that's not practical.

I do not understand the question. Can you specify why it is impractical for your specific case. Where and how do you plan to import the data?

Obj files will need a unique face index as different objects are separated by obj groups referring to the vertices which are included in each object. Otherwise the file would result in something different when importing somewhere else. If you want to alter the way the wavefront obj format is imported or handle the data externally in a specific way you could always parse the file for obj groups using python and sort it the way you would like for your specific application. Alternatively you could also export all objects separately using python, obviously depending on the constraints you have making it impractical for your specific case.


How do I import XYZ AND a fourth parameter that adds color to my objects? I am a biologist, and I have generated spheres in Blender at designated XYZ coordinates, and now I want to add color to each of those spheres. The spheres represent cells in a living organism, and I want to add color to indicate the differences between those cells.

I generated a CSV file that has 60 rows and four columns: X, Y, Z, and Q. The XYZ coordinates were imported into blender to generate 60 different spheres at each of the XYZ coordinates using a Python script. However, now I would like to add color to each of those spheres in a manner that is dependent on the Q value.

Shown here are the 60 different spheres located at their respective XYZ coordinates in Blender. The spheres are all colored gray.

This is an image of the lookup table that I want to apply. In other words, spheres with low Q values should be dark blue while spheres with large Q values should be red.

The operator I've used to generate the spheres in Blender is:

bpy.ops.mesh.primitive_uv_sphere_add(segments=32, ring_count=16, radius=0.5, calc_uvs=True, enter_editmode=False, align=("WORLD"), location=(' + xyz + '), rotation=(0,0,0))

Create a material that applies your color ramp depending on the vertex color. That way we dont need to create a separate material for each sphere and can easily manipulate the color ramp in one material and all spheres will change accordingly.

Create the spheres and set the color of all there vertices to your Q-Value

import bpy
import random

mat = bpy.data.materials['Material'] # The name of the Material you created
# create sphere
bpy.ops.mesh.primitive_uv_sphere_add(segments=32, ring_count=16, radius=1, calc_uvs=True, enter_editmode=False, align='WORLD', location=(0, 0, 0), rotation=(0, 0, 0))

obj = bpy.context.active_object
# apply material
obj.data.materials.append(mat)

mesh = obj.data

# create vertex color map
mesh.vertex_colors.new()

color_layer = mesh.vertex_colors["Col"]

# color all vertecys
q = random.random() # your Value here
color = [q,q,q,1]
i = 0
for poly in mesh.polygons:
    for idx in poly.loop_indices:
        rgb = color
        color_layer.data[i].color = rgb
        i += 1

Set your viewport mode to shaded, to actually see the color that's applied by the shader.

If you want to be realy fancy you could export your data as an OBJ file (they are very similar to CSV) with vertex colors. That way you wouldn't even depend on Blender.

GIF of whole process

Run script

Create Shader


How to model/apply a rhomboid pattern on a cylinder? (Sword hilt modeling) I'm modelling a Vibrosword from Star Wars and I can't figure out how to model the rhomboidal incisions on the hilt.

Any help will be greatly appreciated :)

Subdivide your cylinder vertically the number of desired times with a Loopcut.

Select all faces and use the Poke operator to turn them into rhombus.

Using the Select Similar operator (Shift+G by default) select all horizontal edges and erase them with the Dissolve option, making sure you keep the ones defining the cylinder top and bottom edges.

Repeat the process for the vertical edges by Select Similar then Dissolve.
Done!


How to set the newly added material to an object as "active" (or selected) material I add a new material created by this little example :

ob = bpy.context.active_object
mat = bpy.data.materials.new(name="Example Material")
ob.data.materials.append(mat)

I noticed that the material is added but not active, as in the normal practice of adding blender materials bpy.ops.object.material_slot_add ()
I was wondering how to do this simple step, I tried with ob.active_material = mat, but is wrong:

Edit:

This is what I get, it creates confusion and does not set the active slot correctly:

I would like to get this:

Note that the newly created slot is selected by default (which is what I would like to get)

To select the last appended material (which corresponds to a material slot in the UI), you can set active material index:

import bpy

ob = bpy.context.active_object
mat = bpy.data.materials.new(name="Example Material")
ob.data.materials.append(mat)

# As appended the new material slot index is len - 1
ob.active_material_index = len(ob.material_slots) - 1


Depth Pass to Point-cloud (with AN) How can I translate Depth pass stored in EXR into a colorised point-cloud?
(similar to seen in visualisations of deep-data / deep-compositing)
Result seen by Camera should be without distortions = each pixel of original image should be represented by a face or plane instance in 3D space with a correspond dimension  and orientated to a moving camera to match original image.
I'm looking for a technique that will works for image sequence with moving Camera in 3D space.

I found these two links related to my Question, but they are over my skills to reuse with AN.
Cycles generates distorted depth
Calculating 3D world co-ordinates using depth map and camera intrinsics
Source
Here is my blend used to generate Color and Depth pass into OpenEXR. It is a still image, but what I'm asking for should be working also for an image sequence.

If something like this can be achieved with Geometry Nodes it is welcomed as well. Thank you for your time :)

It is possible to deform a mesh grid with Depth Map or Point Position Map to create the scene geometry with the help of the Animation Nodes + Extra Nodes as well as the Shader Nodes.

Method for Depth Map with AN+EN:

Render the Color Map and Depth Map (must with OpenEXR) with OpenEXR format,

We need to create two grids, one grid (Mesh Grid) is scaled according to the aspect ratio of the depth map. The second to evaluate texture from the Texture Input node (In Texture Properties, set the mapping to clip or extend), and this is a square grid (2x2) because the texture is displayed with square aspect ratio in the world origin. So, I created them a group node so that we can cache them:

Then added resolution input for extra control:

This how these grids look (green for geometry, white for texture)

Now, the Mesh Grid points scaled texture aspect ratio but we have scaled these points using the camera distance factor and depth scale (from Texture Input node), that will give correct X, Y coordinates (as shown by @WhatAMesh in his answer).

The Z coordinate will be the negative of the depth map to deform toward the camera,

Now the points of Mesh Grid are deformed correctly. Now, to align them correctly with respect to the camera, we have to transfer them according to the camera,

Then combine points (from Step 3) with the Edge Indices and Polygon Indices to get a deformed Mesh Grid. I also added the UV map to the mesh Grid, so that we can use it for the camera projection of the color map.

The Mesh Grid is perfectly matching with the actual scene geometry.

Complete Node-Tree,

For the color map, use the UV Project modifier and set the scale according to the aspect ratio. Then in shader nodes use UVs to assign the color map to the Mesh Grid,

Blend File:

Method for Point Position Map with AN+EN:
This is very simple as compared to the Depth Map Method and faster.

To render the point position map of a scene: In Shader Nodes, the Geometry node has a position pass that contains location (X, Y, Z) info for each point/pixel of the geometry. So, use this shader-node setup, and override the material of the whole scene to get the point position pass. Then render this as an OpenEXR image,

Now, we need pixels info of point position that we can't get with the Texture Input node because these values can be negative. So, use the Expression node to get info for dimensions and pixels from the texture. Then, we create Mesh Grid but with swap X, Y divisions to get the correct order for edge indices and polygon indices for pixels or location(X, Y, Z) of points from the pixels. The pixels from the Expression node in a single list so we have to use the Slice List to get R, G, B values or X, Y, Z:

Edit - Low-Resolution Grid:
We can generate a low-resolution mesh grid by resampling the high-resolution grid with the help of KDTree nodes. The Find Nearest Point node outputs the indices with that, we will get the points/vectors of the high-resolution mesh grid (in this case vectors from pixels) that is near to the low-resolution mesh grid points. Here is the group node,

Now, we have to replace the Mesh Grid with this group node and set the cache to One Time which is important for performance,

For the color map, do Step-5 of the Depth Map Method.

Blend File:
Blend File For Low-Resolution Grid:

Method for Point Position Map with Shader Nodes:

First, render the Point Position Map as mentioned in Step-1 of Method for Depth Map with AN+EN

Change the render engine to Cycles and feature set Experimental. Add a square plane in the world center

Then subdivide it for few times, and add the Subdivision modifier with Adaptive Subdivision option is enabled,

In the Shader Nodes, Options > Settings > Displacement to Displacement Only. Then use the Point Position map (In Image Input node, set the mapping to clip or extend) as a vector displacement as shown below, (In Render View)

Blend File:


add texture to colored object I want to apply this partly transparent png texture to one surface of the cube without losing the red color. How do I do that?

When I click on face texture the texture is visible on the surface but the rest of the object becomes black:

This is what I have done ...

1 Create a cube.
2 Copy a face of the cube you want to have your transparent graphics on.
3 Move the face a little outward so that it does not share the same 3d space with the original face.
4 Create 2 material, a red one and a transparent one.
5 Remember to turn off cast shadow for the Transparent material.
6 Apply the red material to the cube.
7 Apply the transparent material to the copied face.

Attached is the file I have created for your reference.


Where is build version info in 2.90, if not on the Splash Screen? Earlier, I used to click on the Blender icon > Splash screen to get build info, build times, hash etc.
It is not on the splash screen anymore. It only shows major version.
Where can I find the info ?

It is in the App (icon) menu > About Blender.


Manipulating UVs does not show in viewport with texture applied I'm probably just missing something but I've been struggling with this for well over and hour now. Here's the deal:

I've created a basic material, imported and image, and applied it to my model. I've also gone and quickly unwrapped it. See here:

Now when I scale the UVs like below, there is no change in how the texture is applied to the object. I tried creating a texture coordinate node and plugging the UV into the vector of the image node but no luck. What am I missing?

Go in the Properties editor > Object Data > UV maps. You've created a second UV map and that's the one that is selected for rendering, so select the other one.


Bone heat weighting error still present I have made a rig for a model, however the main torso piece does not attach to the rig due to this error. I have sought out various solutions but none seem to work. Does anyone know the issue? My Blender Project

The bone heat is failing because of three reasons: there are lots of doubles, the mesh is not a single piece and there is overlapping geometry.

Each of theese facts cannot work with the automatic weights feature.

And automatic weighting is not what you want in this kind of characters, because it would distribute the weight between different bones also in parts of the clothes that should be rigid and metallic, deforming them.

So, the way to go is definitely hand weighting: first of all give an appropriate name to the bones, then in edit mode select a spare part, select its appropriate bone/vertex group and click assign.


GPU Python module: why drawed pixels are shifted in the result image? I'm using Python gpu module to render some simple rectangles in a 2D image.

The script retrieves current render settings:

def render_size( scene ):
    render = scene.render
    percent = render.resolution_percentage * 0.01
    dim_x = render.resolution_x * percent
    dim_y = render.resolution_y * percent
    return round(dim_x), round(dim_y)

Then calculates triangles based on some coordinates data and uses the following to make an offscreen rendering and get the result as pixel buffer:

def render_offscreen( dim_x, dim_y, vertices, indices, color = (0, 0.5, 0.5, 1.0) ):

    offscreen = gpu.types.GPUOffScreen( dim_x, dim_y )

    with offscreen.bind():

        shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
        batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)

        shader.bind()

        shader.uniform_float("color", color)
        batch.draw(shader)

        buffer = bgl.Buffer(bgl.GL_BYTE, dim_x * dim_y * 4)
        bgl.glReadBuffer(bgl.GL_BACK)
        bgl.glReadPixels(0, 0, dim_x, dim_y, bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)

    offscreen.free()

    return buffer

Last, it transfers the buffer into an image:

def buffer_to_image( dim_x, dim_y, image_name, buffer ):

    if not image_name in bpy.data.images:
        bpy.data.images.new(image_name, dim_x, dim_y)

    image = bpy.data.images[image_name]
    image.scale(dim_x, dim_y)
    image.pixels = [v / 255 for v in buffer]

    return image

The problem is coordinates are shifted in the result. What should be here (1821, 981) is (1881, 1002), and that seems to be around 3.x% of the input values (I mean, this shift seems to be proportional along the axis):

What am I missing?

The complete code is here:

I was lucky enough to be drived to the solution by dr.sybren, hypersomniac and mano_wii!!

The solution is to setup the projection matrix appropriately to translate wanted coordinates in pixels (in my case 1920x1080) to normalized coordinated between -1 and 1.

So before running the batch, we need to reduce the scale by half the dimensions and translate the projection by -1 in x and y:

projection_matrix = Matrix.Diagonal( (2.0 / dim_x, 2.0 / dim_y, 1.0) )
projection_matrix = Matrix.Translation( (-1.0, -1.0, 0.0) ) @ projection_matrix.to_4x4()
gpu.matrix.load_projection_matrix(projection_matrix)

The complete code part is:

def render_offscreen( dim_x, dim_y, vertices, indices, color = (0, 0.5, 0.5, 1.0) ):

    offscreen = gpu.types.GPUOffScreen( dim_x, dim_y )

    with offscreen.bind():

        with gpu.matrix.push_pop():
            projection_matrix = Matrix.Diagonal( (2.0 / dim_x, 2.0 / dim_y, 1.0) )
            projection_matrix = Matrix.Translation( (-1.0, -1.0, 0.0) ) @ projection_matrix.to_4x4()

            gpu.matrix.load_projection_matrix(projection_matrix)

            shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
            batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)

            shader.bind()
            shader.uniform_float("color", color)
            batch.draw(shader)

            buffer = bgl.Buffer(bgl.GL_BYTE, dim_x * dim_y * 4)
            bgl.glReadBuffer(bgl.GL_BACK)

            bgl.glReadPixels(0, 0, dim_x, dim_y, bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer)

    offscreen.free()

    return buffer


Rigging and auto weight painting not working I have no doubles, my normals are outward, rig is lined up, but the rig isn't actually deforming the model at all and auto weight painting isn't doing anything.

Can someone take a look at my file and tell me what I need to fix? https://drive.google.com/file/d/1w2nGJB_rLT6Ca2_q-DRxv-BcD1DFXZae/view?usp=sharing

I'm incredibly frustrated with this right now and don't know how to fix it.

I took a look at your character.

It appears you've parented the metarig to your character which creates an infinitate loop. blender stops that from happening to avoid crashes. The solution is very simple:

Unparent your character mesh and try again. Here are some pictures to help you.

Loop in Parents is the error you get. Looking at your outliner, you can see the metarig is a child of the character mesh. Click and drag it un clear the rig of its parent.

Again, selecting the character mesh first and then the rig second in object mode. Press Ctrl+P and parent with automatic weights.

Now the rig works perfectly. Easy mistake to make, easy solution to fix it.

I would also note that the hierarchy is a bit strange. I would parent the thigh bones to the pelvis .L and .R NOT the spine bone but it depends what you want.

Here is your edited file in case you need to compare.
https://www.dropbox.com/s/gzliftzf727jzpa/SpidSunSh_edit.blend?dl=0

I hope that helps.


Fire simulation in 2.82 I made animation in 2.79 & I opened it in 2.82 to render. All effects work (dynamic paint, ocean, particles, soft body), but fire doesn't work. It doesn't even appear in preview window. Also, all fire settings were reset. I found answer how display fire, for this need to change Type of Domain to Replay. But Bake button disappeared.

How to bake fire simulation on Replay? Other types Modular & Final don't display anything even after baking. Or what to do so that fire is displayed & rendered in 2.82 Cycles (and preferably with settings from 2.79)?

With blender 2.82 a new fluid simulation engine was introduced called Mantaflow. So that is the reason your old simulations are not working, you can try using a older blender version.


Noodles gets disappeared after joining the two different nodes We've installed the animation nodes recently in Blender 2.83.2 in Windows 7 platform. We would like to learn the animation nodes. We installed the animation nodes from here.
When we try to join two nodes it isn't showing the attachment, but showing the preview while making a attachment, and even the change gets updated when a change is made in the node-1, but we couldn't able to see the noodle(i.e., the attachment between the nodes) between the nodes.
But in the reference we would like to learn, it is displaying..
Do we need to make any settings or any thing to be enabled in order to view the noodles appear between the nodes?
Please help..!! Thanks in advance.!!
These are the screen shots below for clear understanding of the problem:

Just created two nodes. Screen shot before making any attachments.

While making an attachment(Showing the preview..)

After making the attachment..

When made any changes to the values in the node1, the attached node getting affected.
(But no noodle is being displayed between the two nodes).

I'm 99% that is a bug. Here is how to report it:

In the main menu on the top left click on help, then choose report a bug. It will send you to a page belonging to the developer section of blender.org. You do need a Blender account to file a bug report, but like all the other Blenderstuff: it's free.
Follow the instructions, they are very straight forward.
And you're done. Congratulations, you helped the Blender community.


Textures and materials to show up while playing animation in 3d viewport I am trying to get my textures and materials to show up in the 3d viewport while playing the animation of my scene. The textures and materials are showing in my 3d viewport. However, when i play the animation the objects do not move until i stop the animation.

Right now i have my method to display objects in the 3d view set to rendered. If i have it set to anything else, the textures and materials go away and i only see the blank objects, but they will move with the animation.

How can i get the objects to properly animate in the 3d viewport with textures and materials applied?

Clarification:

I press alt+A to run the animation. The animation plays, but none of my objects move like they are supposed to. Then i press alt+A and the objects jump to the location they are supposed to be at the frame where the animation stopped. I want the animations to move like they are supposed to while the animation is playing. I can stop through the animation using the timeline by pressing left or right arrow and the objects move. But i want this to work while playing the animation.

Thanks

When using the viewport in render view mode, sluggish animation and freezing are not uncommon when you try to play your animation. Try setting the viewport render mode to "material" or "textured" and you should be able to play animations smoothly with your textures/materials visible and animated.

This has one caveat however, the Blender Internal render engine does not support procedural texure in material view mode, and will display the object incorrectly.


Blender Mesh: Which UV Unwrapping Approach i am currently at the stage of UV Unwrapping my House model. I am very new to UV Unwrapping and am wondering how I should approach it with this model. The model in the foreground is the House in individual pieces as i initially modeled it. The one in the background is a model where all those pieces are joined into one mesh.

What i need right now is basically one Texture for every floor. I know that UV Unwrapping needs seams where you would unwrap the model into it's 2d form, but that doesn't seem very straight forward to me with this model.

Does someone have a tip ? Or maybe I need to provide additional information about the model ?

Normally I wouldn't use it, because I mostly do organic modeling, but I'm thinking for what you are doing, Smart UV Project might work very well. It's under the UV Mapping menu (press U in Edit Mode to bring it up). It tries to automatically unwrap your mesh without you creating any seams first. One nice thing about it is that even if you ignore all the settings and just press OK, the settings menu remains active afterwards, so you can keep tweaking the values in the fields and see updated changes to the UV map. This is great because some of those settings would be hard to understand exactly what they do based only on their descriptions.


How to load a render from cloud-servis into compositor with passes? I have a cloud rendered png image and I cannot find a way to load that rendered image into compositor as render layers. Of course i can import image with image node but, I cannot use passes like depth, AO, Mist etc. Also I cannot see that image as backdrop image. I have shared a screenshot in which you can see that image node doesn't have that many output pins.
How do I import my cloud rendered image in compositor to use all passes?

You have to render into OpenEXR  Multilayer (.EXR) output format to keep passes in saved file.
(PNG can't store these layers / passes.)

To see Backdrop you have to connect Viewer node.
(with Node Wrangler addon enabled, press Ctrl+Shift)


Animating tracing lines Cristóbal Vila has made some amazing videos. I believe I read somewhere that he uses modo for this, but that is beyond the scope of my question. At the start of his "Ishafan" video he animates tracing a "circular", flat pattern and after that he traces the lines of a vault. I am curious about the following:

Is there a good, non-"do this a couple hundred times" way to do the 2D tracing?
Is there a way to (almost) automatically make the "moving fronts" light up more than the rest of the 2D tracing, like in the video?
Is there a good way to do the 3D tracing, without having to use a boolean modifier with a bunch of moving objects to gradually reveal the lines?

I hope these questions are not too generic, (like: how to model, light and animate a running medieval army or something)? Is using python maybe the best option? I would love to hear your opinions on this.

3) You might get along with curves and bevel. Not sure if you can get nice corners as in the video though.