How to get (just) color data from my model in blender to an image for later editing? I'm having a little problem here. I've made a model with a pretty complicated node (procedural) setup and some PBR shaders.
Now, I want to get just the color data from my model to an image so I cam make modifications later. I want to use that color in a simple setup with only diffuse and glossy shaders. I don't want to bake shadows and light, only the color.
I know my workflow is somewhat impractical, but it would really make my life easier if I 'll get an answer.

Hah, I found out. Its actually very simple. Just bake the texture with this settings:


How to quickly mark hard edges? I'm learning the workflow between zBrush and Blender and lose all of the hard edge marks when transferring from zBrush to Blender, how can I either preserve the hard edges or remark them in Blender quickly?

For example:

I created a model in Blender with both hard and smooth edges.
I applied a edge split modifier and exported as an .obj to zbrush
I applied crease and weld points in zbrush (to transfer the hard edges from Blender)
I edited the model in zBrush and exported the file as an .obj to Blender.
I opened the file in Blender, the entire model is hard edge because zBrush only works with hard shading. All of the edge marks are lost when imported into Blender again.

I was wondering is there any way to quickly add the marked hard edges back to the new model without manually selecting all of them?

Could I possibly transfer the marked edges from the original Blender model to the new model through a script? Is there some way to separate the model similar to Blender's edge split in zBrush then combine it in Blender (similar to zbrush's weld points)?

If the new topology has the same number of edges you can copy them with the Data Transfer modifier.

Move both models so they overlap
Add the Data Transfer Modifier: Modifiers >> add modifier (to new object without edge marks) >> choose Data Transfer >> [x] Edge Data, enable sharp and nearest edge.


Blender 2.80 Beta wierd vewport behavior I have a model about 83mm wide that I am working on, I can't zoom in too close to it because the viewport chops part of the model even though I am not zoomed all the way into it. Does anyone by chance know why it is doing this and is there a setting I can change to fix it?

Thanks

This Issue is Clipping related, at a certain distance surfaces can't get drawn. Imagine the camera as a "plane" that you're moving into the Object. Whats infront, gets shown, whats behind is occluded.

To fix this issue it is recommended to change the units you use in Blender. You can find them in the Properties Editor -> Scene -> Units :

By default this value should be at "1.000"
 - Change it to "0.1"
You will notice no change, except a change in the "numeric" size of your model.

After this, you scale up your model by a factor of 10, the model is "bigger" but still has the desired measurements and has no visibility issues.


Smooth gauge needle animation I recently started learning Blender and I need some hints about animation. In the Game Engine, I want to display a gauge with a needle (think classical speedometer) which is set by values coming in over the network.

It's supposed to look very smooth. Therefore, when moving the needle, I would like to rotate it with a bezier-like movement to the new value. This means I need an animation that I can parametrize with (rotation_start, rotation_end) values from a Python script and then playback (like playAction() on objects).

I have tried doing this with Actions/Drivers, but was unsuccessful.

What is the best way to solve this?

Assumption:

The speedometer does not move or rotate. It stays at the same place in scene.

Design:

Animate an invisible object (axis) that turns according to the input values.

Parent a visible indicator (needle) to the axis. Enable slow parent (Properties editor / object tab / Relation Extras panel) with an offset > 0.

Effect:

while the axis immediately shows the received value the needle will smoothly go for that pose.


how to specify if a button is in false mode in script so i just need to know if and how to do this. example one: (all of this will be in blender game engine)

import bge

def main():

cont = bge.logic.getCurrentController()
own = cont.owner

right = cont.sensors ["right"]
left = cont.sensors ["left"]
gas = cont.sensors ["gas"]

if gas.negative:
    if left.negative:
        if right.negative:
            own ["rotation"] += 0.1
else:
    own ["rotation"] = 0

so i just need to know how to say "if im not pressing w, do this" INSTEAD of doing this "if im pressing w do this" normally you do if w.positive:
     blah blah blah...

please help and thanks in advance

Just put not in the if.

from bge import logic
def main():
    cont = logic.getCurrentController()
    own = cont.owner

    right = cont.sensors ["right"]
    left = cont.sensors ["left"]
    gas = cont.sensors ["gas"]

    if not gas.positive:
        if not left.positive:
            if not right.positive:
                own ["rotation"] += 0.1
    else:
        own ["rotation"] = 0


Minecraft model transparency glitch in cycles I am working on a minecraft animation where I need to import custom minecraft models.  I did this using Techne and a .tcn to a .obj converter (not sure if this affects anything).  I then Imported the .obj and added a texture. The Alpha layer is transparent in material mode but not in rendered mode. Also it is transparent from one side in material mode but opaque from the other.

P.S. It is a 0 pixel deep model at this point.

This is in rendered mode:

This is Material mode:

All you need for a transparent material in cycles is a Transparent node, a Mix node, and some base shader (Diffuse node).

These are the only needed nodes.

The Image Texture node sends the color of the image only to the Diffuse shader, that is very important (more on that in a bit).
The alpha of the image is used as a mask in the Fac socket of the Mix Shader node. That Fac "mixes" the two Shader input sockets, biased on the value in the alpha channel of the image (alpha channel shown below). The Fac socket is expecting a range between 0 and 1, and that is exactly what the alpha channel is. Anywhere that is black (a value of zero) the top socket is used, so transparent; like wise anywhere that is white in the alpha channel (a value of one) the bottom socket is shown, the diffuse node and thus the color in the image.

The Transparent node adds the transparent component to the material. The color of the Transparent node controls how transparent the transparency will be. White (a value of one) is completely transparent, conversely black (a value of zero)  will not be transparent at all, it will render solid black.
This is why you can not plug the image texture in to the transparent node.
Anywhere the image is not pure white will not render transparent if the image is plugged into the transparent node.

This is the alpha (on the left) of image in image texture node in the picture above; and (on the right) the output of the nodes pictured above.

Advanced nodes

Here is a slightly more complicated cycles material. All I'm doing is adding in a glossy component to my material.
Do note though, that even with the extra nodes, it does not change the simple transparency setup.


How to use Blender Filmic in After Effects? Getting Blender’s filmic into After Effects with EXR. When importing the config.ocio file from the Blender’s color management file into OpenColorIO in After effects I get config failed sanitycheck. The role “xyz” is in conflict with a colorspace of the same name.
Does anyone know a solution to this? I cannot get linear to Filmic sRGB without it accepting the confic.ocio file.

Video tutorial explaining how to do it.

To get it to work in After Effects you need to make a copy of Blender's config.ocio file. Open it up in text editor and add a line of code.

Find this in your text editor:

CIE XYZ color space
XYZ: XYZ

Delete that and add what is below.

# CIE XYZ color space #XYZ: XYZ
# XYZ: XYZ

# Need a general default
default: Linear

Save the text file and you are done. Brendan Bolles fixed it the creator of the openColorIO plugin for After Effects.

Video tutorial explaining how to do it.


Accessing another script in the same directory using python Is there a way I can have a main script that can access other scripts in the same directory to run them at the correct time?

Nevermind, I found what I was looking for.
I just had to type 'import filename' without *.py and reload my main script in blender.


How to loop over the API for creating a generative code? i'd like to experiment with code generation with the blender API, but i first need to understand how i could loop over the API within my code

for example bpy.context.object have tons of properties, we can naturally see those properties within the console autocomplete or within the Otuliner Data Api

let's take a modifier for example. (here above)
we can clearly see from the outlined or console that this 'Array' modifier have many properties (or functions)

i'd like to know how i can print each property module followed by the value assigned.
something like so:

import bpy

obj = bpy.data.objects['my_object']
mod = obj.modifiers['Array']

print('Properties of Array modifier:')

for modules,value in mod:

   print(f"property {module} : {value}"

i already saw this kind of solution used before, but it seemed to only work with bpy and bpy.utils

import pkgutil
import bpy
import email

package = bpy.utils
prefix = package.__name__ + "."
for importer, modname, ispkg in pkgutil.iter_modules(package.__path__, prefix):
    print("Found submodule %s (is a package: %s)" % (modname, ispkg))

You can take advantage of the dir() method in python to access "public" attributes of any object. You can use it for each modifier in the selected object :

import bpy

obj = bpy.context.object

for mod in obj.modifiers:
    print(mod.name, 'Modifier')
    for attr in dir(mod)[4::]:  # We skip the first 4 attributes which are internal
        print('  ', attr, ' --> ', getattr(mod, attr))

Exemple with an object with an 'Array' and a 'Curve' modifier :


Is there a way to check a blend file's integrity, and/or see a crash log? I have a Blend file (my Yoda model) that I started back in 2005, when Blender was probably still in 2.3 or 2.4 territory.  I've slowly updated him over the last 11 years, implementing new features, refining and what not.  But it seems that more and more often when I'm editing the mesh or just doing random things, Blender crashes, and I'm wondering if it may be that some random feature I've used along the way, or old modifier or some little bit of data that is corrupting the file, or if it's just Blender being Blender (or really, software being software).

So, my questions are:
a.  Is there a crash log that I don't know about that I could try to see why I'm crashing?
b.  Is there a blend file integrity checker?

As far as I know there is no blend "file auditing" tools, but I may be wrong.

There are however debugging options in Blender. You can launch blender using command line options to activate it's debugging tools and see if any useful output can help you pinpoint your problem. You can see all debug options at the Blender Manual

If you are on Windows you should probably also set up a batch script or a specific shortcut to automatically launch Blender with the correct arguments without having to write them manually each time.

A batch script is also useful to prevent the command prompt from closing automatically in the event of a crash, so that you can actually see what happened and read the output history. It could go something like:

start C:\Windows\System32\cmd.exe /k path\to\Blender.exe --debug-memory

Replace "debug-memory" with whatever you need like "debug-all".

If you model is not too complex (rigged, or animated or with physics) and you don't risk loosing important data you may also force flush a cleanup of settings by exporting it to a non-blender format (like OBJ, or FBX, or 3Ds) so that it is stripped of any settings, preferences or additional Blender specific data that may have gotten corrupt throughout the versions.

Remove any modifiers that you may easily add again later and export only a pure raw base mesh of your Yoda model, and then re-import it in a brand new fresh blend file, so that any settings or outdated information is left behind, and only the clean mesh data is kept, then manually recreate any modifier stack you had.

Your file may also be of use to the developers if the crashes can be reliably reproduced so they can fix any bugs that cause them, although now is probably not a good time with the start of 2.8 development just around the corner big changes are expected, and backwards compatibility won't be a priority.


In Blender 2.7 or 2.8 how can you slice off parts of a 2D grease pencil drawing and move it to its own layer? Basically, I am trying to create something like this https://youtu.be/nEM_oY-RZjg. I have downloaded that file and noticed that each body part is on a separate layer. The issue is when I draw a face I never would draw a body part, create a new layer and then draw another body part. so I would like to draw my entire character first then slice it in blender to make sure the eyes, nose, mouth are on its separate layers so I can then add a parent bone and make a rig out of it. How can I do that?

If I use the 2d monkey from 2.8 as an example I would like to slice off that on its own layer so I can add bones to it to make a 2d eye rig. Unless there is a better way.

Begin editing the GP strokes. In 2.80 you select the GP objects and go into edit mode, while in 2.79 you need to select Edit Strokes in the mode menu.
Select the curve points that you want to move to another layer.
Press M and either choose an existing layer or New Layer.


Addon script not working I am newbie to Blender scripting, but I am trying to make very simple Addon with the help of the YT tutorial that looks like this but it is giving me error that something is wrong, tho there is no error message in the console window.
The script should appear as a menu item inside OBJECT -> APPLY, and should just apply all the active modifiers in all selected objects. the script of the Addon looks like this:
bl_info = {
    "name": "Apply Modifiers In Selected",
    "author": "Anonymous",
    "version": (1, 0),
    "blender": (2, 90, 1),
    "location": "View3D > Object > Apply > Modifiers In Selected",
    "description": "Applies all the modifier in selected objects",
    "warning": "",
    "doc_url": "",
    "category": "Object Apply",
}

import bpy
from bpy.types import (
    AddonPreferences,
    Operator,
    Panel,
    PropertyGroup,
)

class OBJECT_OT_applymodifiersinselected(Operator):
    bl_label = "Apply Modifiers In Selected"
    bl_idname = "object.apply.modifiersinselected"
    bl_description = "Applies all the modifier in selected objects"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {'REGISTER', 'UNDO'}

    def execute (self, context):

        for ob in bpy.context.selected_objects:
            bpy.context.view_layer.objects.active = ob
            for name in [m.name for m in ob.modifiers]:
                modifier = ob.modifiers[name]
                if modifier.show_viewport:
                    bpy.ops.object.modifier_apply( modifier = name )

        return {'FINISHED'}

def menu_func (self, context):
    self.layout.operator(OBJECT_OT_applymodifiersinselected.bl_idname)

def register():
    bpy.utils.register_class(OBJECT_OT_applymodifiersinselected)
    bpy.types.VIEW3D_MT_object_apply.append(menu_func)

def unregister():
    bpy.utils.unregister_class(OBJECT_OT_applymodifiersinselected)
    bpy.types.VIEW3D_MT_object_apply.remove(menu_func)

if __name__ == "__main__":
    register()

Can anyone, please, tell me what is wrong with the code?

The bl_idname is not allowed to contain more than one dot. The error message is:
Traceback (most recent call last):
  File "\Text", line 52, in <module>
  File "\Text", line 44, in register
RuntimeError: Error: Registering operator class: 'OBJECT_OT_applymodifiersinselected', invalid bl_idname 'object.apply.modifiersinselected', must contain 1 '.' character

This message can be seen when starting Blender from the terminal on Linux, macOS and Windows. On Windows you can also use Window > Toggle System Console.
In order to fix this pick a different bl_idname, for example:
 bl_idname = "object.apply_modifiers_in_selected"


Possible Bug - My material color won't change This is in Material Preview shading mode. As you can see the colors chosen in the nodes do not correspond the one showing in the viewport for the sphere. Same thing for the Object Properties/Viewport Display. If I apply a 2 nodes material then it’s ok. But there is something with these set of nodes that won’t pass the color chosen in the nodes to the object. It did belong to a more complex set of nodes. This one is a simplified iteration (for troubleshooting).

This is in Solid shading mode:

Can someone pls inspect the .blend file?
badmaterial.blend (833.8 KB)

Thanks guys!

You must have deleted something from the original node network.

Your color ramp is not driven by any coordinate based texture so you will only get a solid color (assuming the same color at every point on the sphere). Since your ramp is a gradient of grey and you are mixing it 50% with black, you end up with a middle grey solid diffuse color! No surprise there!

To see the effect of the ramp, simply add a texture that's based on some sort of coordinates for example a Musgrave Texture, a Noise Texture or a Voronoi Texture would do. So would an Image Texture...


Setting the Context Window Screen Layout Explicitly in BPY In 2.7 you could set the active screen layout with, e. g. for "UV Editing":

bpy.context.window.screen=bpy.data.screens['UV Editing']

This no longer seems to have any effect in 2.81.

Some new means to make it kick in?

Incidentally, does 2.8+ support a shortcut to switch it explicity? I had defined my own operator in a startup script just to do so, which used the line above.

The current workspace can be changed to the UV Editing workspace through:

bpy.context.window.workspace = bpy.data.workspaces['UV Editing']

This assumes that a workspace named UV Editing exists. In order to check for the case where it doesn't exist, use bpy.data.workspaces.get('UV Editing') instead and verify that the returned value is not None.

The current area type can be changed through bpy.context.area.type. In order to change to the UV editor you can use:

area = bpy.context.area
area.type = 'IMAGE_EDITOR'
area.ui_type = 'UV'

Although it's not documented in the manual you can also just assign the ui_type and it will automatically change the type as well.

bpy.context.area.ui_type = 'UV'

If you want to change a different area than the current one, you can iterate through bpy.context.screen.areas.


How to disable Background layer rendering? I’ve done tracking of the footage, and I’ve setup the tracking scene.
As you probably know, once you setup the tracking scene, Blender automatically creates two “Render Layers” nodes in the compositor. One node is for the “Foreground” layer, as shown in attached screenshot, and the other is for the “Background” layer.
Also, Blender creates two collections in the outliner: foreground and background. Background consists only of “shadow catcher” plane.

The problem is, Blender is rendering separately those two layers / collections, which doubles my rendering time, and since I have very simple scene, that is in fact just a waste of time for me. I want to do all the rendering in a single pass.
I’ve tried deleting the background “render layers” node, and deleting the “background” collection, but still, when I try to render the scene, it always renders both foreground and background, although the background literally doesn’t exist anymore in my file. At least, I’m not aware of it.
I’m sure I’m missing some simple solution.
Help!

Have you tried going into the Render Properties > Film and ticked the box which says Transparent?
This will make the background of the render transparent so all you can see if the objects that you've added/created


Switching from Mac to PC - Questions regarding GPU-rendering I just switched from Mac (macOS) to PC (Windows 10). Since Macs can't render with GPU, I'm new to the concept of being able to render with Cycles using a GPU. However, I have a couple of questions:

Should I render with the CPU or GPU?
Are there any downsides with rendering with the GPU?
Which one of CUDA, OptiX, and OpenCL should I choose for GPU-rendering?
What size should the tiles be when rendering with the GPU?

I haven't owned a PC in my whole life, so this is all very new for me.
My specs:

CPU: AMD Ryzen 9 4900HS
GPU: NVIDIA GeForce RTX 2060 with Max-Q Design
RAM: 32 GB

(1) Should I render with the CPU or GPU?

If you have a powerful GPU with enough memory to handle the scene, it is preferable to use the GPU or a combination of CPU and GPU. The NVIDIA GeForce RTX 2060 is a high-end GPU, at the time of writing, which will significantly improve render performance compared to CPU only.

(2) Are there any downsides with rendering with the GPU?

When using a GPU that doesn't have enough memory to fit the scene one of two things can happen. For AMD graphics cards (OpenCL) Blender wouldn't be able to render the scene. When using Nvidia graphics cards (CUDA or Optix) Blender can swap data between GPU and RAM as needed, but this requires more time. Whether or not this is faster than just rendering on the CPU will depend on the particular hardware used.
Certain optimizations aren't supported on the GPUs, for instance equiangular sampling for lights. CPUs may have an advantage for those scenes and it makes sense not to combine CPU + GPU rendering in this case because there may be visible differences between tiles rendered on the CPU and GPU.

(3) Which one of CUDA, OptiX, and OpenCL should I choose for GPU-rendering?

The available choices depend on the Blender version, manufacturer of the graphics card(s) and whether it meets the minimum requirements for GPU rendering.
Blender 2.83
CUDA: Nvidia graphics cards with compute capability of 3.0 or higher.
OptiX: Nvidia RTX graphics cards only.
OpenCL: AMD graphics cards with the GCN second generation micro-architecture or later.

Blender 2.90
CUDA: Nvidia graphics cards with compute capability of 3.0 or higher (requirement for Blender 2.83).
OptiX: All Nvidia GPUs with a compute capability of 5.0 or higher. This requirement is lower than in Blender 2.83 (see release notes of Blender 2.90).
OpenCL: AMD graphics cards with the GCN second generation micro-architecture or later (requirement for Blender 2.83).

Note that you can only select one of the options and thus cannot use both Nvidia and AMD GPUs for rendering.
Since you're using a Nvidia RTX graphics card you can either select CUDA or OptiX. OptiX leverages the special RTX hardware ray tracing functionality of the GPU which can increase the performance, however it does not have feature parity with CUDA. The following features are missing for OptiX according to Blender's manual:

Baking
Branched Path Tracing
Ambient Occlusion and Bevel shader nodes
Combined CPU + GPU rendering

(4) What size should the tiles be when rendering with the GPU?

A slightly bigger tile size seems to be the general recommendation, e.g. $256 \times 256$ px. However, which particular tile size is ideal for your hardware should be evaluated instead of relying on measurements found on the internet that use a different hardware, since they may not be representative. You can determine good settings by picking a demo scene and measuring the required render time for different tile sizes. There's also an add-on called Auto Tile Size, which is included in Blender by default, that can help you select a consistent tile size across the render.


How can I see absolute coordinates? Is there a way to see the absolute coordinates of a vertex?
I'm using a math formula in Excel to define points.

You can see both global and local coordinates for selected elements from the 3D View > Tool Shelf > Transform Panel.

There you will find a button to toggle Between global and local.

Have in mind that this may not take into account mesh deformations caused by modifiers or armatures.

To take those into account you may end up having to convert to mesh or applying all modifiers.


How to merge two crossing faces into one? I have made this simple shape from two planes, it has no volume.

As you can see there are two faces that are overlapping in the center creating that weird square, which is not a face and cannot be deleted or dealt with.

So the question is, how can I remove that thing in the middle and make sure I'm dealing with just one face?(I've tried pressing F to combine two faces but nothing happens).

For such task there are Mesh > Faces > Intersect (Boolean) and Intersect (Knife) tools in Edit Mode, but for your example they are not working as supposed to. Also with two separated shapes from your example Boolean Modifier (Union) isn't working as well. I can't say why, as I'm not using Booleans at all.

As a workaround you can make it using Knife Project tool.

Select one of your shape/face in Edit Mode then use P > Selection.

In Object Mode, select one object, then with Shift select second one and go to Edit Mode.
In the Tool Shelf choose Knife Project.
Repeat steps 2 and 3 but now select objects in different order.
Join both objects Ctrl+J.
In Edit Mode select all then W > Remove Doubles and use X > Limited Dissolve.

  Note: Consider using quad topology as this will save you some problems
  later on. Working with ngons could be problematic.


applying texture to multiple faces to fit the image I am trying to apply same image texture to multiple faces

I want to make the active rectangles show the same window image which I have in full size

The above is the UV editor image.

What I want is to make all cell cover the whole image.

I tried all unwrapping method (cube / sphere ..) but it didn't help.

Is there any convenient way to do?

As cegaton commented in your question the easiest way is to select all the faces, unwrap, and click on UV reset

but I'll try to explain it on how to do it and another useful thing when doing UV Mapping.

your uv map looks something like this:

The orange squares on the UV map represent the faces, as you can see here the faces don't cover the whole image and for that we will need to do UV Reset, just do U and click on "Reset"

Now that we reset the UV you can see that all the faces cover the entire image which is what we want, yay!

Now let's say that you only want a 3rd of the window, for that we need to do UV Map editing, just as objects in edit mode on the viewport we can select vertices, edges, and faces, for this we'll select the vertices we want to move and locate them on where we want

hope it helps


How to re-link files which have paths that have become invalid (can't be found)? I have a Blender project with planes with image textures on them, but the images aren't being loaded. I'm pretty sure I have the images as well, but the person who uploaded all this apparently didn't keep the original folder structure. Where can I see (or edit) the file location for the images?

Note that I'm a new user.

To re-link missing files, open file menu, then choose External Data -> Find Missing Files, and select the folder where the image textures are located. File names have to be the same as they are in the blend file.

The files are found based on matching names, the folder is searched recursively, so you can for example point it at the base of your project path, to perform a more extensive search.


Don't have a num pad, How would I go about changing the view? A lot of the shortcuts in blender uses the number pad, Where in blender can I change for example the point of view without using the shortcut.

Go to File-->User Preferences-->Input (or use a Ctrl+Alt+U shortcut) and check the Emulate Numpad box. You can now use the normal 1,2,3,4,5,6,7,8,9,0 buttons at the top of your keyboard to change camera views instead of the numpad.

Check out this answer also: How to reset the angle of rotated view without a numpad? It shows how to change the view without using any shortcuts.


How to widen the bevel width? I want to have the bevel more wider than it could be, but the geometry limits the bevel to a limit, when exceeding the limit the faces intersects with each,like follow

The red arrow points to its limits, when I want to bevel more, faces got intersected

How can I make the points meet each other at a far position so the bevel can can be wider?

The top face is an n-gon (it's defined by more than 4 vertices) and problems with beveling n-gons are to be expected. You can move the n-gon inside, by selecting that face and insetting it. As you move it toward the middle, you will experience a different issue, where the edges are going to intersect, so at some point you stop insetting (click to accept), and then scale the face down to further decrease it. Now there's plenty of room using quad topology for the bevel.


Modifier Properties don't show up for a collection I have a collection and inside there there are several objects. I want to add a modifier to all the objects in the collection, but I couldn't find the modifier properties when I select the collection. How do I get the modifier properties to show up?

In another object that's separate from the collection, the modifier properties are shown:

There is no way to make the Modifiers Properties Panel show up when you have a Collection selected.
While an object like a cube, curve and such (objects like cameras and lights can't have modifiers either) can have a modifier that affects its mesh data or other data like UVs, Collections are only a placeholder with functionality (like an empty, but without origin).
They them self do not contain data that could be affected by modifiers.
The idea of using a collection to apply modifiers to all its children, is itself not bad, and I believe used in other software, but in Blender you need to add a modifier to one of the child objects and then copy the modifier to all other children in the collection/selection.
Solution:

Add the modifier(s) to one object.
Select all objects you want to get the same modifier(s). If they are all children of a collection, you can RMB to Select Objects in the Collection and all its children will be selected.
Make sure the object with the modifiers is the last selected/active one (visible by having a brighter outline in the 3D View).
Press Ctrl+C and choose Copy Modifiers, as shown below:

Now all the selected objects have the same modifiers.
Happy Blending


Python script fail, look in the console for now I don´t understand why I get this error message:

  Python script fail, look in the console for now

I only put this piece of code in the scripting window:

import bge
bge.render.drawLine([0,0,0],[10,10,10],[255,40,0])

Is supposed I get error information from the console? Because I dind´t get it.

You will need to open the system console, which is found by going to the Window menu at the top and choosing Toggle System Console. Do note that closing the console via the X button at the top right will close Blender as well, so if you want to close the console use the Toggle System Console menu option again.

EDIT: I just tried the code you have and it works fine. I think your issue is how you are trying to execute the code. To execute this code in the BGE you will need to have an object that has a sensor (such as an always sensor with true level triggering enabled) connected to a python controller with your script selected.

Then play your game and you will see your line. Simply running the script via the text editor will cause it to fail.


Can I animate a mesh using raw vertex coordinates per frame? I'm interested in creating an animation in Blender that involves an intricate and roughly-scientifically-accurate animation, that appears to be beyond the ability of Blender to perform easily and accurately. This animation will be mixed with other animations in the same scene that will be done using standard keyframing/rigging.

As a result, I'd like to write a program that generates mesh data for each frame and outputs it in some format (likely X,Y,Z, and a few texture parameters for cycles, perhaps U/V for a UV map). Is there a way to easily import this bulk mesh data into Blender so that I can obtain an animated object, without importing a separate mesh per frame?

I would suggest writing to an Alembic file. Blender has nice support for it, and it's a quite compact file format that's fast to read. It also supports things like changes in mesh topology, vertex colours, and point clouds.


A slightly messy mesh in blender 2.81 beta I'm following the famous tutorial of the donut and the coffee cup from Blender Guru. I just noticed that some vertices of my object are slightly out of place.
I don't know how that happened but I guess it happened after creating the edge loops. Could someone tell me how to correct the position of the vertices exactly so that they are aligned with the rest of the others?

On the other hand I have noticed that in a part of the cup there is a strange flattening. Anyone know why that is?

In second case, try: Edit mode, vertex, A, alt+m -> Merge by distace
Merge should work. Take a closer look for double vertex.
In first case:
Option one, If the vertex was displaced only by z coordinate, I would just simply copy/pasted it from correct vertex. Or use this tutorial: https://www.youtube.com/watch?v=TnTFl51GGdw
Final thought: you can just select the mirror vertex and copy it's coordinates to the vertex you need to correct.
So I would just select the vertex in the correct spot on other side of the handle/x-coordinate, press N to bring out the side panel, go to item, copy coordinates and paste them into coordinates of corrupted vertex one by one, BUT changing the x coordinate from positive to negative/from negative to positive.


changing the intensity falloff of light sources using Cycles nodes So generally people tend to agree that the intensity of light has a fall-off that is the inverse square of the distance to the light.

Something like:  intensity  = 1.0 / (distance * distance);

I'm fairly certain from what people say that this would be used in OSL/Cycles since it's supposed to be physically based however it's useful to have control over this when a scene is being difficult or even just to give more control when using several fill lights.

I'd like to find a node setup that can help modulate(or replace) the current falloff with something that is a bit more linear.

intensity = 1.0 / distance;

So does anyone have an idea on how to control the intensity falloff using what we have available to us already?

Use the "light falloff" node to control the strength of the emitter.

quadratic

linear

constant


How to model a round chair? I need to model some round chairs like these ones:

I have no idea where to start, or how to do the curves or anything, I'm lost.
So, how would you do it if you had to?

I'll answer regarding the white/orange chair.

The outer spherical shell and the base are easy enough to model. You can start with a sphere and use the Solidify modifier to give it thickness. If you rotate the sphere you can simply cut out part of the sphere to get the opening. The base can be simply modelled by extruding a circle.

The more difficult part is the cushion. I would start by box modelling the approximate shape and position of the cushion and the sculpt it into the final shape and position. You can see the cushion gently hugs the opening of the chair so that would need to be modelled/sculpted into place.


Smoke not appearing when rendering animation It's my first time using blender. I am making relatively simple model of an object that emits two "smokes" with changing color- one from the top and one from the bottom of the object. Therefore, I have two smoke domains at the top and the bottom. The smoke on the top has to go up and the smoke on the bottom has to go down. The smoke on the top has density different from 0 in the first half of the simulation and then its 0 for the second half so that its not visible. The opposite happens for the smoke at the bottom. When I look at the animation in the openGL render active viewport, everything looks as it should be and I see "both smokes". However, when I render the animation I do not see the bottom smoke at all when it is supposed to be visible in the second half of the simulation, but I see the top smoke properly in the first half. Why is that?

I need urgent help!!! Thank you in advance!

I am attaching the .blend file in the link:
https://www.dropbox.com/s/qwtdr0998susm9k/6ri.blend?dl=0

Best,
Nenko

You didn't checked Density on the Influence panel of the Voxel Data texture for you bottom domain.


Loop alembic animation I have an 4 frame animation made in Maya that i need in blender. Alembic wokres fine, but stops after frame 4, since there is no more animation. Is there a way i could loop the alembic file in blender?

Related:

reverse alembic
start alembic at specific frame

Once you imported an Alembic Cache, the object in Blender will have an Alembic Cache Constraint.

Check Override Frame.
In the frame property you can set keyframes. The following expression will loop through frame 1, 2, 3, 4. Directly enter the following in the Frame property:
#(frame - 1) % 4 + 1

The Values used in the Python Expression
#(frame - <starting_frame>) % <animation_duration> + <starting_frame>

frame               the actual frame played
starting_frame      the frame id where the animation begins
animation_duration  the number of frames the animation lasts

To customize the driver to your needs, replace starting_frame and animation_duration with your values:
The animation starts at frame 1 and lasts 4 frames: #(frame - 1) % 4 + 1


Warning! Legacy WGL is unable to select between different OpenGL versions I was using blender 2.76b on a Windows 7 Ultimate, and nothing really weird showed up when I opened blender and the cmd window appeared, before the blender window appeared.

I updated it to 2.77a, and now in the cmd window, it says:

  Warning! Legacy WGL is unable to select between OpenGL versions.

Is this a big issue that I would want to fix, or would it not matter?

If I should fix it, how should I fix it?

System specs:

 Laptop: Samsung Sens R410
 OS: Windows 7 Ultimate, was Windows Vista Home Premium OEM (according to the sticker on the underside)
 CPU: Intel Pentium Merom T2390 Dual Core 1.87 Ghz
 RAM: Installed 5Gb, but can only use 2.75Gb 667 MHz
 GPU: ATI Radeon X1250 with 256Mb memory with a weird driver that has OpenGL  issues. The 3d cursor moves when I drag the arrow to move an object in the 3d viewport. I think this is because I am using Vista drivers, and there are no drivers for windows 7.

I reported this as a bug here, and the answer I got was this:

"Your GPU is too old. You may be able to still use it if you update your drivers."


How to project back rendered depth maps to recover the ground-truth 3D shape using Blender? You can discard the images I have uploaded and can simply use some camera angles of your choice to render depth maps of a 3D shape and then fuse the rendered depth maps to recover the underlying 3D shape
We recently published a paper on 3D shape generation in a computer vision conference (CVPR). My co-author wrote the code (in C++ and using OpenCV) for fusing the depth maps and getting the final 3D shapes from the produced multi-view outputs. The inputs to the code he wrote is 20 depth maps, ground-truth camera angles (posted below) and the distance from the centroid of the shapes to the camera (distance to the shape centroid=1.5 on a sphere). The centroid of shapes are calculated as follow:

First, the centers of faces (triangle) of a mesh centroid of a mesh is calculated. Then the faces areas are computed. The new centroid is the average of the mesh faces' centers, weighted by their area.

Here some people have written algorithms on how to compute the centroids.
Unfortunately my friend is not available to help me on this and I cannot use OpenCV and C++ for this new project that I'm beginning to work on. So any help would be appreciated. My goal is to write some code using Blender's Python  API instead of using my co-author's C++ code to do the same thing. But before I move on, I wonder if Blender has some built-in functions that can generate the final 3D shape given rendered depth maps of that shape, camera angles and the distance to the camera? If not, can anyone give me some ideas on how I should do that and give me a code sample for it?
Here I have uploaded a set of rendered depth maps a headphone's 3D shape that you can use for backward projection (reconstructing the 3D shape). And if you prefer to start with a 3D shape directly, here you can download a 3D shape of a different headphone we used in our work before. You can render depth maps the 3D shape using the camera angles posted below.
FYI, here is my co-author's high-level description on how his approach works:

In the final step, all depth maps are projected back to the 3D space
to create the final rendering. We reconstruct 3D shapes from
multi-view silhouettes and depth maps by first generating a 3D point
cloud from each depth image with its corresponding camera setting (x,
y, z coordinates). The union of these point clouds from all views can
be seen as an initial estimation of the shape.

And here are the camera angles we used for doing the rendering in the first place:
-0.57735  -0.57735  0.57735
0.934172  0.356822  0
0.934172  -0.356822  0
-0.934172  0.356822  0
-0.934172  -0.356822  0
0  0.934172  0.356822
0  0.934172  -0.356822
0.356822  0  -0.934172
-0.356822  0  -0.934172
0  -0.934172  -0.356822
0  -0.934172  0.356822
0.356822  0  0.934172
-0.356822  0  0.934172
0.57735  0.57735  -0.57735
0.57735  0.57735  0.57735
-0.57735  0.57735  -0.57735
-0.57735  0.57735  0.57735
0.57735  -0.57735  -0.57735
0.57735  -0.57735  0.57735
-0.57735  -0.57735  -0.57735

After looking at the following image from your paper, it seems to me as if your image is basically a sprite map, so I propose the following workflow to get you there.

Proposed Workflow:

I'm certain that you could mimic the polyhedron shape in blender to set active planes (viewports) on programatically, and use an UV coordinate mapping per sprite location to get a depth map per the corresponding camera location/angle (position).

Set up a highly subdivided plane for each view, then attach the Displacement Modifier to it, along with a custom UV layout to the sprite sheet that corresponds with the appropriate viewpoint.

I would then add a global driver to attempt to control the displacement modifier strength per projection, and when they get close to each other...

Apply the modifier, Join the objects together, and remove duplicate verts.

Uploaded a Video


Install pip and packages from within Blender OS independently This question relates to installing pip from within Blender without the need to open a terminal outside Blender. This allows for more user friendliness and pip calls from within an add-on (as opposed a terminal outside Blender: How to install Pip for Blender's bundled Python? or https://blenderartists.org/t/how-to-install-python-packages-with-pip-blender-2-8/1142721/4).

External terminal: enable pip in Blender

Navigate a terminal to the folder containing python (e.g. 2.80\python\bin\python.exe)
In terminal: python.exe -m ensurepip

Pip install from within Python

One way to install pip and pip packages in Blender with a terminal / IDE is:

import subprocess
import sys
# enable pip
subprocess.call([sys.executable, "-m", "ensurepip"])
# upgrade pip to latest version
subprocess.call([sys.executable, "-m", "pip", "install", "--upgrade", "pip"])
# install any package
subprocess.call([sys.executable, "-m", "pip", "install", "your package"])

Blender problem

However, when executed in the Blender terminal, we get the error:

found bundled python: D:\*blender path*\blender-2.80.0-git.b46245470f79-windows64\2.80\python
unknown argument, loading as file: -m
Error: Cannot read file 'D:\*blender path*\blender-2.80.0-git.b46245470f79-windows64\-m': No such file or directory
Error: argument has no '.blend' file extension, not using as new file, exiting!
D:\*blender path*\blender-2.80.0-git.b46245470f79-windows64\-m
Saved session recovery to 'C:\Users\*name*\AppData\Local\Temp\quit.blend'

Blender quit

If we execute in the Blender terminal sys.executable, we see why: D:\\*blender-path*\\blender-2.80.0-git.ee0d8426ab6d-windows64\\blender.exe

Normally sys.executable points to a python.exe (on Windows, not tested on Linux yet).

Question

How to install pip and pip packages in Blender, from within Blender in an OS independent way?

System tested

OS: Windows 7 64-bit / Ubuntu 16.04 64-bit
Blender 2.8: ee0d8426ab6d-windows64 (2019-05-03 21:09) / 480a09a92f7f (2019-04-30 23:13)

Not satisfied with this, but a somehow hack-ish way:

import subprocess
import sys
from pathlib import Path  # Object-oriented filesystem paths since Python 3.4
# sys.prefix points on Windows to: 'D:\\*blender path*\\2.80\\python'
# Windows only: subprocess.call([str(Path(sys.prefix) / "bin" / "python.exe"), "-m", "ensurepip"])

# OS independent (Windows: bin\python.exe; Linux: bin/python3.7m)
py_path = Path(sys.prefix) / "bin"
py_exec = next(py_path.glob("python*"))  # first file that starts with "python" in "bin" dir
subprocess.call([str(py_exec), "-m", "ensurepip"])

You should see a blue 0 in your console in Blender.

Edit

If subprocess.call([str(py_exec), "-m", "ensurepip"]) results in a Permission Denied error (console shows 1):

Windows: Close Blender, right-click blender.exe and select Run as administrator. Then run the code again.
Linux (untested): Start Blender with the sudo command and run the code again.

Edit Blender 2.81:

Pip is now enabled by default from 2.81, so no need for this solution anymore: https://developer.blender.org/T71856

Installing a library in Blender with pip now works like this:

import subprocess
import ensurepip
ensurepip.bootstrap()
pybin = bpy.app.binary_path_python
subprocess.check_call([pybin, '-m', 'pip', 'install', 'your_package'])

Edit 2: Added pybin, '-m', otherwise it can install the package in a Python environment which is not Blender's one.

Edit 3: You first have to link pip with Blender (added ensurepip)


BGE Character dynamic I am making a simple game. Setting the Box to dynamic and my armature and character to static , with ghost option activated  so that it won't collide with the dynamic motion box. However , I got myself into a weird situation which had never happen before.When i  play the game , the character was standing on the floor as i wanted . But the character change its shape when i tried to move it . Walking right and left doesn't seem to be a problem but when i press w to walk infront , it flew off to the mid sky and when i press s to move backwards , it went out of shape like the picture below show. Need a solution as fast as possible.

I tried to save the file so i could upload it here to be more specific. But after i save it and open it in another blender window . This is what i get.

After checking my settings , i finally found a solution.
It appears that after animating my character , i didn't turn off the auto-keyframe button which is in the animating layout. Thus , when i move around my character , it automatically set location to the character meshs. Which corrupt with my armature and dynamic.So i deleted my character meshs action editor and it fixed it .
Hope this will help people who will come across this problem like me .
Remember to turn off your auto-keyframe button after you done animation.
Cheers and have a nice day.


Possible to bake texture to new UV map? I have a finished model where the UV maps overlap - lots of wood that isn't detailed to be particular to the model.

I'd like to re-map the texture so that specific details can be added. I'd like to rebuild the UV map into non-overlapping islands, without losing the current texture application, and preferably without manually pulling apart the islands.

Is this possible?

Yes, using texture baking.
The workflows are slightly different depending on the render engine you are using, but here's how to do it in cycles.
A screenshot just to show how things are initially:

Create a new UV map in Properties > Object data, then with it selected, edit or re-unwrap to make the second UV map layed out how you want it:

Create a new image to bake to by pressing ⎇ AltN in the image editor, or by pressing new in header > Image:

Add a texture node to your material(s), set to the image you want to bake to.

Connect the texture you want to bake from with an emission shader and set hte bake type to emit. Then with the new UV map still selected in Object data and the target image's texture node selected in the material node setup(s), press Bake:

After it's baked, remember to save the image. F3 to save it to disk, or header > image > Pack as PNG to pack it into the .blend as a png.


How to model slice shaped circular wedge? I tried with bevel, but I can only do one side of the object. Do you have idea how to make whole object?

You could use your geometrical pattern as background blueprint, then:

Create a circle, extrude inwards (as suggested by the other answers, the Spin or Screw tools might be more convenient ways to create the initial shape):

Only keep a segment and delete its inner faces:

Extrude upwards, don't forget to recalculate the normals:

Give it thickness with the Solidify modifier (enable the Even Thickness option), or altE to Extrude along Normals and enable the Offset Even option in the Operator box:


How to generate temporary operators with dynamic properties? During the development of an add-on I had to generate an operator based on the information in a dictionary. As I didn't find anything on that topic, I thought it might be useful to add my solution for others to use...

This might come in useful, when you have a dictionary of data, a user needs to fill in, before some operator logic is executed, but you don't want to create an operator for every possible dictionary combination.

As operators are not editable after creation, I achieved this by using a CollectionProperty with is hidden to the user. Instead, the temporary operator just shows the elements as single Properties of the type specified in the dictionary. The preset values for the Properties is taken from the dictionary, too.

That way, we can create operators "on the fly", which are created in the function createOperator and discarded, when the next temporary operator is created.

The Property type is handled in the calling operator by adding a type substring (such as 'b_' for boolean) to the name of the Property, which will show up in the GUI. Additional Properties could be added the same way.

WARNING: It might be dangerous to use these operators with Blenders undo functionality. Therefore, I disabled it for these generic operators. Also, the usage of eval is dangerous in terms of security as written here. So make sure, your dictionary does not contain user input or digest the operatorName properly.

I hope this is of use to anyone.

Happy coding, Mr. Anderson!

P.S.: New to the forum, so feedback is VERY appreciated! :)

Just for reference: I took some inspiration from this question on dynamic
operator generation and this old thread at blenderartists on generating dynamic properties in operators. Especially, this trick by sambler helped alot. Generating Blender operators in a function comes from an older Blender Dev entry.

bl_info = {
    'version': (1, 0),
    'blender': (2, 79, 0),
    'author': 'Mr. Anderson',
    'name': 'Temporary Operator Showcase',
    'location': 'blender',
    'description': 'Creates operators when executing another operator, based on the contents of a dictionary.' ,
    'warning': 'This is a test only!',
    'category': 'test',
}

import bpy

custom_dict = {
    'spoon': {'bent': True, 'dynamic': False},
    'smiths': {'amount': 55, 'angry': True},
    'matrix': {'greenness': 0.5, 'speed': 6.5}
}

class PropertyEntry(bpy.types.PropertyGroup):
    name = bpy.props.StringProperty()
    intProp = bpy.props.IntProperty()
    boolProp = bpy.props.BoolProperty()
    stringProp = bpy.props.StringProperty()
    floatProp = bpy.props.FloatProperty()

def registerTempOperator(name):
    # check for previous temporary Operator and unregister it
    try:
        bpy.utils.unregister_class(TempOperator)
    except UnboundLocalError:
        pass
    blender_id_name = 'object.add_' + name

    # create the temporary operator class
    class TempOperator(bpy.types.Operator):
        """Temporary operator"""
        bl_idname = blender_id_name
        bl_label = 'Add a ' + name + ' object.'
        bl_description ='Adds a ' + name + ' object to the scene.'
        bl_options = {'REGISTER'}

        operator_data = bpy.props.CollectionProperty(type=PropertyEntry)
        operator_name = name

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

            # expose all properties in the collection to the user
            for i in range(len(self.operator_data)):
                propname = self.operator_data[i].name[2:]
                # choose the right Property type depending on name identifier
                if self.operator_data[i].name[0] == 'i':
                    layout.prop(self.operator_data[i], 'intProp', text=propname)
                elif self.operator_data[i].name[0] == 'b':
                    layout.prop(self.operator_data[i], 'boolProp', text=propname)
                elif self.operator_data[i].name[0] == 's':
                    layout.prop(self.operator_data[i], 'stringProp', text=propname)
                elif self.operator_data[i].name[0] == 'f':
                    layout.prop(self.operator_data[i], 'floatProp', text=propname)

        def invoke(self, context, event):
            data = custom_dict[self.operator_name]
            for key in data.keys():
                item = self.operator_data.add()
                prefix = ''
                if type(data[key]) is int:
                    item.intProp = data[key]
                    prefix = 'i'
                elif type(data[key]) is bool:
                    item.boolProp = data[key]
                    prefix = 'b'
                elif type(data[key]) is str:
                    item.stringProp = data[key]
                    prefix = 's'
                elif type(data[key]) is float:
                    item.floatProp = data[key]
                    prefix = 'f'

                # add the identifier to specify the data type
                item.name = prefix + '_' + key

            # show operator as popup window
            return context.window_manager.invoke_props_dialog(self)

        def execute(self, context):
            # TODO write the contents of operator_data somewhere here
            # or do something awesome

            print('Data is in here:')
            print(self.operator_data)
            print([i.name for i in self.operator_data])
            return {'FINISHED'}

    # register the temporary class and return the operatorBlId
    bpy.utils.register_class(TempOperator)
    return blender_id_name

def operatorList(self, context):
    items = []
    for item in custom_dict:
        items.append((item,) * 3)
    return items

class CallingOperator(bpy.types.Operator):
    """Operator which calls the temporary operator"""
    bl_idname = 'object.calling_operator'
    bl_label = 'Call operator'
    bl_description ='Call the temporary operators specified in custom_dict'
    bl_options = {'REGISTER'}

    op_list = bpy.props.EnumProperty(items=operatorList)

    def draw(self, context):
        layout = self.layout
        layout.prop(self, 'op_list', expand=True)

    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self)

    def execute(self, context):
        operator_name = registerTempOperator(self.op_list)

        # invoke the other operator, based on its bl_idname
        operator = eval('bpy.ops.' + operator_name + "('INVOKE_DEFAULT')")
        return {'FINISHED'}

# just a basic panel to add the test operator to the 3D toolbar
class TestPanel(bpy.types.Panel):
    """Contains the operator to test."""
    bl_idname = "TOOLS_PT_TEST_TOOLS"
    bl_label = "TEST"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = 'Tools'

    def draw(self, context):
        layout = self.layout
        layout.operator('object.calling_operator')

def register():
    bpy.utils.register_class(PropertyEntry)
    bpy.utils.register_class(CallingOperator)
    bpy.utils.register_class(TestPanel)

def unregister():
    bpy.utils.register_class(PropertyEntry)
    bpy.utils.register_class(CallingOperator)
    bpy.utils.unregister_class(TestPanel)

if __name__ == '__main__':
    register()


Render preview vs Render issue with hair I have added a strip of eyelashes on a small skin strip that is surface deformed (modifier) to each eyelid. I added a shapekey to close the eyes, so the eyelid and the eyelashes move.

Strangely in render preview the lashes move nicely with the lid but when I render it it stays in the place it is without the shapekey. Anyone know why? (Left is render preview, right is rendered). Also I am confused why the hair is so much different than the preview hair, but that might be related to bsplines or so and does not bug me as much as the eyelashes not moving.

Well it took me 6 minutes to figure out both issues, so maybe I should have put some thought into it before asking.

The eyelid mesh had a multires modifier on it because i duplicated it from the main mesh in edit mode and it took its modifiers. The preview was at 0 and the render view was at 1. The binding is related to the amount of vertices so it only works in the mode that it was bound, which was 0. So it showed nicely in render preview but not in render. The strange hair was from a different hair emitter that I forgot to delete and that was hidden in the viewport but not in the render.


Blender 2.8 Beta - Unknown Rectangle when camera is selected I just started trying Blender 2.80 Beta.

I noticed that there's this additional rectangle (image below) that I have no idea where did it come from. I can resize this rectangle but I don't know what is this rectangle for or what is this called. It does not seem to be related to the rendered image boundary, etc. It seems to be different from this yellow rectangle around the camera in 2.8 Beta

Thanks a lot!

That is the Render Border. When rendered shading is active, the render will be constrained to that portion of the screen. You can disable it with CtrlAltB, or you can enable and/or draw a new one with CtrlB.

See Render Border's related check boxes - How do they work? for a more complete overview of its functionality.


How to notice duplicate geometry? In responding to a recent question someone told me that my mesh had a lot of "duplicate geometry". At the time I did not really understand the remark but I think I now begin to understand. I also became aware that for instance the extrude tool creates duplicate geometry.

Question When looking at my mesh how can I see that there is a lot of duplicate geometry and how to clean that up ?

Usually doubles and duplicate geometry are unintentional, but sometimes you might have geometry that is intentionally in close proximity to other geometry so that you can't just do a remove doubles on the entire object.

There's a couple of Low-Tech ways that i'd like to suggest first.

If you press Z, in edit mode, you'll see a transparent / half opaque mesh. Faces that are duplicated in place will often appear darker.
.
Keep in mind that Backfacing Faces will also appear darker, so don't get confused :)
In Object mode, you'll see duplicate edges because they are drawn using the same color as the border of a mesh. Whether or not this is intentional I don't know, but it works well to track down duplicates edges.

In Face selection mode of Edit Mode, look for Dots on edges. Dots indicate the median of a face and should never been visible on edges.

You see this with geometry that you've accidentally extruded without translating the new face.
In vertex selection mode of Edit Mode, look for vertices which don't highlight surrounding edges:


How to not distort pixels? I am working on a low poly model and I would like to texture it with pixelart. The problem is that whenever I aply the textures, most of the pixels get distorted, stretched or compressed. Is there any way that I could get something like this?

Currently I am using this model that I made:
https://skfb.ly/PyuC

The question about blurry textures has been asked countless times before, it has to do with the used texture sampling.
See this answer for more details https://blender.stackexchange.com/a/47643/19307

As for distorted (as in stretched or compressed) textures it all as to do with the way you UVMap your textures.

Fix your UV's so as not to cause distortions, evenly scaled islands and proportionally unwrapped faces will help. If possible use the UV Map > Cube Projection which will cause minimal distortion, or UV Map > Project From view

Alternatively consider using generated texture coordinates where possible instead. This may not work in the viewport or exported models.


Extruding with precision and proportions How can I make these kind of operations and extrusions and make it look smooth, proportional and keeping it low poly?

Any methods to share?

When I'm extruding, then I hold down control and left-click. This method is keeping it proportional. Another method is by using curves - you parent mesh to curve and then you can easily edit wires and such things. I hope this post helped you.


How to render separately multiple objects on the same scene, without using multiple render layers? So I know the beautiful feature in Blender. I can place an object in the separate layer, exclude all other layers (to remove shadows from other objects for example) and render it. The result will be a render of object like no other objects are on the scene:

But it looks like 20 layers is not enough for my scene. What will I do to solve this problem? Since tweak the layers is too boring may be exists some script to render with this scheme automatically?

As far as I understand, you need to, under one scene, render more than 20 object separately, here's one solution :

under the object tab, in the properties panel, assign each of your object a single Pass index, "1" for the first object, "2" for the second, etc...

Once this done, go to Node Editor, select the compositing node tree and choose use node

Under layers tab, activate de the object index pass

connect the IndexOb pass to an Id Mask node. Make sure the pass index in the Id Mask node correspond each time to your pass index's object. Connect the Id Mask node to the fac of a Mix node, & connect the image from the render layer node to the second input image of the mix node, as shown in the image below. Repeat this process for every object you want to render separately (and don't forget to change the ID mas node number to your corresponding object)

You can repeat this process as long as you want, with all you objects, and then assign a different output location to each ones, with the file output node :

EDIT : Actually, this solution isn't perfect, because if other objects are in front of the rendered object, the overlapping part will mask the second...
Another solution, a lot simpler, is simply to uncheck the render button in the Outliner panel, but you'll need to check and uncheck for the corresponding object every time you want to render a single object, and change the folder each time too.


Distorted Cylinder to Regular Cylinder How can the Blender User reshape a Distorted Cylinder to a Regular Cylinder in a minimum number of steps in situ, no adding or deleting of vertices?

Requirement. Move only the vertices currently selected in edit mode.

This is in the context of Shape Keys, therefore  deleting vertices and adding them back is not allowed since it would affect pre existing shape keys.  Assume the connectivity of the starting shape vertex selection in edit mode is topologically equivalent to a cylinder with out caps. The current selection consists only of edge loops in parallel connectivity. In other words the task is possible without adding or deleting any vertices or changing topology.  We just need to change position of vertices.

In the image above the left most yellow mesh is the starting point. The second yellow mesh in edit mode depicts the vertices or vertex group whose members may be moved.  That is a requirement.  Please note 1 or more vertices are NOT selected.

The blue mesh is the goal shape within a constant factor in XYZ dimensions of the edit mode selection, with standard edge loops in circle, other edges parallel to z-axis. In the result, one time user scaling in the XYZ global axis is acceptable. In the result, one time user rotation of (N*90) degrees is acceptable where is N is an integer.

In the image above we see a successful edit.  Cyan Shape show results according to the steps below.  Edit Mode and Object Mode.

Best candidate at the moment. Minimum of artistic maneuvers was one goal. Assume target cylinder in standard z-axis position.

Edit Mode Vertex Position Steps

Loop Tools Addon is enabled.
Edit Mode with valid selection.
Take note of current selection and with virtual/discussion/[vertex group] name BS0 .. Blender Selection 0.
Agree that each edge loop in BS0 has a virtual name EL0N. There are integer K > 1 edge loops. N is an integer whose range is [0,K].  EL0N is connected to EL0(N-1) if N > 0. EL00 is the edge loop whose target Z-coordinate is maximum.   EL0(K-1) is the edge loop whose target Z-coordinate is the minimum.
Agree EL00 is the top in target. EL0(K-1) is the bottom in target.
Select edge loop EL00 of BS0. Scale Z axis to zero.
Loop Tools Circle to achieve Regular Circle in XY Plane. Keystroke WLC.
New Selection of one edge loop virtual name EL01 adjacent to EL00. Scale Z-axis 0. Grab/Translate selection on Z-axis so EL01 is below EL00.  Loop Tools Circle.  These micro steps are to insure predictability in extreme cases with the next step.
[Vertex Slide] EL01 coincident to EL00. Accept the action. Move EL01
on Z-axis back to some reasonable position visually distinct from EL00.
Repeat the step above for all adjacent edge loops.
Explanation.  Each edge loop EL0(N) is corrected by EL0(N-1) in the XY coordinates for N in the range [1, K]
At this point we have a reasonably acceptable cylinder with potentially uneven distance between edge loops.
Select one edge ring spanning all edge loops of BS0.
Loop Tools Relax [Linear Parallel] ... Keystroke WLR.  Parallel edge loops are equally spaced.

In the image above unselected vertices are hidden for ease of explanation.

Can these steps be streamlined?

Perhaps a Script would be preferable to copy points from a fresh cylinder calculation.  Please correct my understanding of the problem in the comments in case I have under specified / over specified requirements.

Low priority Failure category in the context of some current goals

In cheery Winter Mesh colors left to right.

The 01 green mesh shows a Cast [Cylinder] modifier result.
The 02 red mesh shows a To Sphere result.
The 03 green mesh shows a Shrink Wrap Modifier to a cylinder result.
The 04 red mesh shows a Shrink Wrap Modifier to a sphere result.
Note the undesirable curved edge rings in some results.
Proportional Editing
Custom Normals under low priority consideration
[Data Transfer] under low priority consideration

Thanks.

Join as Shapes

If the two object shares the same number of vertex and similar same edges & polygons list, you should be able to convert a "target shape object" to a Shape Key for an other object.

Obiuvsly "good" results are achievable only if they have matching topologies (e.g. a T shape will not easily became a I even even if the vertex count is the same), but your case seems one of them.

First of all you should create a "basis" shape key for wanted object, just for safety.

After that, pick the "target shape" object and then the other object.

In the drop down menu as shown in the picture above you can find the command that will add the selected object's active shapekey (the basis in this case) to the active object.

Raise the Shape Key influence factor in order to see the change of vertices coordinates.


Create height bitmap from mesh I know there are a lot of tutorials out there that tell you how to create a mesh from a height map. E.g. to create some terrain. I wish to know how I can do the reverse. So I have a mesh with a surface going from 0 to 10mm in height for example, and map the 0-10mm range to a grayscale 8bit grayscale bitmap (so 0 to 256). Is this possible with Blender? I do know a way how to convert it to a bitmap by exporting the mesh to *.dae and read the coordinates of the vertices in a script, and create the bitmap myself. But maybe there is an easier way.
The reason I want to do this is the following: A DLP UV light 3D resin printer has an uneven spread of light. There is intensity fall of to the sides. For this one can correct using a mask. But of course, you have to create that mask yourself. So I used a LDR, did some calibration measurements to be able to know what values represents what light intensities.
The box below represents the build area of the printer (X and Y), the Z axis represents relative light intensity (just from 0 to 100%). The plane with the 9 vertices represents the relative light intensity measured. So I have done 9 measurements on the build plate, a the same locations as those of the vertices.

Then the plane was subdivided once (simple) and the additional edges slided to the outer of the plane, so that the catmull clark subdivision leaves the rectangular shape of the plane as is, but does smooth out the rest. This is seen in the image below (slighty different angle than the previous image).

Then the mask for the printer requires it to be inverted. So the least light intensity from the measurement should be 100% white, and the center with the most light should be filtered the most. This is seen in the image below, which is a Z mirror of the subdivided plane.

Now of this smoothed out, inverted plane I wish to make a relative height mask. Where 0 is black (pixel value of 0), and the point touching the wire cube at the top is absolutely white (pixel value of 256). (Pixel values consider 8-bit grayscale image).

If this is for a terrain (I mean the heights are considered from a base plane), you can use a bake to the texture:

This is done using Cycles.

You can see the material nodes settings above:

Input is the location (the location is given from the object's origin, here for simplicity, the object origin is at its baseline)
Only keep the Z value
Divide by the real height of your object (in order to have a resulting value between 0 and 1)
Then put it in a diffuse shader as color
(the texture node have to be present and be the selected node for the bake described below)

To bake:

Go to the render panel and the bake section
Choose diffuse and keep only the "color" option (deselect "direct" and "indirect" as we here want the color only with no environment or other effects)

As indicated in the comments, the previous setting leads to a sharp cutout (visible in the image above: the surrounding is suddenly black).

To avoid that, a possibility is to use another function than just dividing by the object height. What I propose here is to use a sigmoid:

the output is between 0 and 1
the output limits slowly tend to 0 on left and 1 on right

That leads to this kind of result which you can compare to the image above:

In the blend file below, the higher the value for the multiply node is, the more limit rendered values will be sharp.


Image is appearing flat in render but fine in camera view The first picture is how my object is appearing after render.
And the bottom picture is how it should appear.

The top picture is fully rendered using cycles I guess while the bottom one is from solid view. You can use the principled shader with
Metallic: ~0,8
 Roughness : ~0.8
Anisotropic ~0.3
To achieve a similar effect. This is just an estimate you need to play around with it

The top picture looks more plastic like. Probably because you didn't use the Metallic. Also the white background is flattening it. You seem to have no light source but the surrounding and this creates no dramatic shadows like in the bottom picture

At least that'd what I could figure out from what you provided


weights not showing in weight paint mode So I have a mesh that's touching another.
I gave it a bendy bone -- and following this tutorial, I added two bones at the head and the tail of the bone that I used as "custom handler references" -- then parented the bone to the mesh "With automatic weight".

Works great, except the base of the mesh lifts off the mesh it's touching for some movements.

I thought this'd be easy to fix, I'd simply weight-paint it in such a way that the bendy bones don't affect a very small portion of the mesh where the two meshes are connected. That way, it would still bend and flex as I want it to but without breaking connection to the other mesh.

Except when I go into weight paint mode, the mesh is all black.

Right, so I have since figured out that the mesh is all black because the light is behind it.

So let's pull the light in front.

Now, the mesh's no longer black and its texture is shown. BUT still no weights.

I tried and I can paint weights. I just cannot see the weights nor what I draw, which renders its usefulness somewhat ... limited.

I clicked through all viewpoint shading options and none of them seem to be helpful.

Using Blender 2.79b.

As far as options go,

"Show Zero Weights" is set to "None"
"Restrict" is off
Ctrl+A didn't do anything

"Custom Weight Paint Range" is off

EDIT: Minimal Working Example
In weight paint mode with Viewpoint Shading set to solid, this mesh will look all grey instead of showing the weights.

Ok, I think I have this figured out...

If I set the viewpoint shading mode to solid and THEN enter weight pain mode, the weights are being displayed.

However, if I enter weight paint mode first and THEN set the viewpoint shading mode to "solid", everything is shown grey, instead.

So the easiest way to solve this grey stuff is switching to object mode and back into weight paint mode.


Is there a way to export the names (Vertex Group Names) and location of vertices in list format? The background:

Each single vertex has is its own vertex group (single vertex). Why? I need each vertex to have its own name, the only way to name a vertex in Blender is to give it a vertex group which names it. There are 109 vertices on my model, The names I've given them are numerical (0-108), but as you know they could be named anything such as: Vertex 1 or Vert or nbmrr etc.

Is it possible to export each vertex location and its given vertex group name in a list format in txt?

Example:

0 - (x0.5 y-2.4 z3.9)

1 - (x5 y7 z1)

2 - (x17 y2 z-1.9)

The true formatting would need to looks like this:

That code is from a program called BeamNG and the format is called jbeam. The

Open a text editor, click New Text, paste that into the editor :

import bpy
import bmesh

"""
exports all the vertices of the active object in a text file, formated like that :
["n##",x.xxx,y.yyy,z.zzz],
"""

filename="export.txt"

# api shortcuts
ops = bpy.ops
ctx = bpy.context
opo = bpy.ops.object

opo.mode_set(mode='OBJECT', toggle=False)
activeObj = bpy.context.scene.objects.active

opo.mode_set(mode='EDIT', toggle=False)
sel_mode = ctx.tool_settings.mesh_select_mode
ctx.tool_settings.mesh_select_mode = [True, True, True]
mesh = bmesh.from_edit_mesh(activeObj.data)

filepath = bpy.path.abspath("//"+filename)

f=open(filepath,"w+")

for v in mesh.verts:
    print(v.co.x)
    #rounded to 3 digits:
    f.write("[\"n%d\",%03.3f,%03.3f,%03.3f],\n" % (v.index,v.co.x, v.co.y,v.co.z))
    #not rounded:
    #f.write("[\"n%d\",%f,%f,%f],\n" % (v.index,v.co.x, v.co.y,v.co.z))

f.close()

Select your object then press "Run Script" in the text editor.

The script will create a file named "export.txt", in the .blend directory.

By default the scripts rounds the coordinates to 3 digits, like in your sample. If you want more precise values (not rounded), comment line 31 (add a # character) and uncomment line 33 (delete the # character).


UV unwrapped object showing unwanted lines in Substance Painter I would like to paint on my 3D object in Substance Painter and have UV unwrapped it as in Picture 1. However, when exported to Substance Painter, it's showing strange lines. How do I remove them and am I UV unwrapping this correctly? Thanks!

The problem is that there are there are overlapping areas in your UV map.  Thus, when you paint on one area in the texture, it affects the other portions of the UV map that overlap that same point.  You'll probably want to try using a different UV projection for the model.  Try out several options until you get a nice UV map that doesn't overlap.  Just note that some projections are view dependent.  So try going into a view that makes sense (like front view) before unwrapping.  You can also try electing edges in problematic areas and selecting Ctr+e -> Mark Seam so that the UV map disconnects along that edge.  Once you got something that looks pretty good, you can head over to the "Texture Paint" mode to get a basic idea of how good the UV map will work before importing it into Substance Painter.
Hope that helps!


How to decrease the size of an image texture? ok so as you can see in the image above, I have made 3 materials using cycles render (the wood, gravel and metal). No nodes. My wood texture came out great. My gravel texture seems super stretched. The actual image I'm using is much more detailed than bender is making it out to be. Any suggestions? I'm a complete beginner.

You have scaling options under Texture > Mapping


Seam Issues when Posing Model Good to be here. Am just getting used to this lovely app. Guess I have ver. 2.83. I have learned how to rig bones and fix bones, add textures, not to mention a handful of other things related to import/export plugins. I have hit a snag though which my powers of play have yet to fiddle out a nice tune.

Also made a screencapture MP4 so you can see in real-time how when I pose my model, the neck area begins to tear. I am sure there is an easy fix for this. But until now, it has evaded me. Hope it ok to post mega links. Was not sure how to upload/show a video here.
https://mega.nz/file/dRMzFCQb#0qZZ-XO2w9uS92gZZrFFIy7h6FiUTieYP2XqMgGFP6k
EDIT: Thanks to Ben, I was able to merge the head and neck meshes using a careful selection of all verts in at the seams, then punch m, then By Distance. Unfortunately, while there is no more tearing, the model now gets garbled at the seams when I try to pose it.

I am not sure this will help, but make sure in weight paint mode, the side of the neck that is not moving is not blue. If it is blue it will not be affected by the bone so you can then weight paint onto it and make it affected by the bone. I hope this help!


Rig deformation issue, possibly stuck on something? I'm having this issue with my model. Once I applied the rig the left side (models right) seems to be snagging on something yet it's a mirror of the right side. Does anyone know what could be causing this? I noticed by moving the other leg it changes the shape of the deformation as well.

do you use bone envelopes? if yes, then they might be overlapping, they seem sticking to the other ankle. you can set the envelope radius in the bones "deform" tab. if you are using vertexgroups additionally, see if thats causing the issue, by unchecking it. the left foot vertices might belong to a group called like the right ankles bone.


How would you patch this "hole" I'm trying to fill this hole to make a bowl out of this model. I tried patching it the hard way by taking a mesh plane and slowly transforming it to make the shape I need but I'm sure there's a faster way to do it right?

Assuming its perfectly round, set your 3D Cursor to the centre of the bowl, select all the vertices of the bowl, shift-d do duplicate and right-click to dump them in the same place. Set snapping to Vertex, Active and make sure a vertex on the corner of the V cutout is selected last (to make it active)

Set your transform origin to 3D Cursor

Then rotate the new vertices around the 3D Cursor snapping to a verts that puts them in the right place.

Select all and merge by distance.
If your bowl is not exactly as mine you might have some small clean up left to do but this will get the bulk of it done very easily. :)


Is it possible to pause cloth simulation and start at a later frame? Let's assume that a character only moves in the first and last parts of the animation. In the middle part, it sits on a chair so the shape of its clothes should be held (as it doesn't change).

My question is about the last part. How can I start the simulation using the shape in the middle part (Not the shape that I modeled)? It's kinda like pausing the baking process for a specific range of frames.

I read about the Caches List in the manual but in the second bake, the simulation starts with the initial shape of the cloth. It doesn't contine shaping the cloth.

I also tried to "Apply" the cloth modifier. I think this will do what I need in the final part but it will mess with the beginning of the animation.

Delaying and freezing cloth sims -

As far as I'm aware the the cloth's physics can't be delayed or 'paused' directly but there is a workaround.

This example has the cloth lying on an invisible plane to begin with, thereby holding it's fall until the required frame.

It's released by switching the plane instantly down to a location directly below the bed and over a single frame range.

NOTE - The cloth's setting may have to be changed (keyframed) to suit when it's lying on the plane and when on the bed.

The cloth will fall and settle onto the character and bed but will most likely want to keep wriggling.  To avoid this it's visually switched to a 'frozen' copy of itself.

To freeze -

Save the Blend file at that frame firstly and then 'Apply the cloth's physics modifier.  This will give us a frozen duplicate which MUST be cleared of all physics and animation!

Save the project again but as a temporary file.

Reload the previous save and append the temporary.  Copy paste the frozen mesh into the original scene.

You should now have a soft cloth plus an identically shaped hard-mesh version at that particular frame.

At that frame, visually switch over to the hard mesh version in the Outliner. (Keyframe the camera and eye icons so we see the duplicate, not the soft original)

Play and check that the cloth falls, settles and remains stationary.

Save that as the project Blend file.

-================-

When the character sits up, at the frame where that starts, visually switch back to the soft cloth again.

At the frame where the cloth settles again, do as above. Save the project file firstly and at that frame, 'Apply' the mesh and write that out to another temporary file.  Append that back into the 2nd project file, etc etc.

-=================-

This can all be simplified considerably when done in the VSE, however this would be a bigger challenge when the character is to move during the cloth's frozen frames as we have in this example.

The dummy character used here is copyright so including the Blendfile isn't possible, however it's all in the procedure.  A matter of freezing, substitution, and switching their visibility.

Should you feel it necessary to have the Blend file, I can redo it with a cube character.


Subdivision Surface modifier is not visible in rendered shading mode Subdivision Surface modifier is not worked in render view when render is set to 6 and view is set to 0. What is meant by the 'view' and 'render' options here?

You should put more than 0 in the View parameter of your modifier, typically 2. View is for the Object or Rendered mode of the 3D view, Render is for a definitive render when you click the Render button in the Render menu of the Properties (6 is a lot though).


how composite text over image I have a movie (rusty_chain). In this movie i want to add descriptive text on top. How can i do this with compositing?
I know i can do it with video sequencer, just a layer on top of it, but if i try it in compositor (because i want to animate the text), i do not find a node which just basically adds the text on the movie.
sorry, for the stupid question...it's my first try compositing...

You first need to make sure that the backrgound of your render is transparent, render, then plug the text alpha into the alpha socket of the Alpha Over:


Trigger an event of a different object on object collision BGE I created a ghost box with a collision sensor. I have a bunch of 'coins' that will move from their hidden location to their desired location with their actuators.

I would like to somehow connect the box's collision sensor to activate all the coin's actuators, to move them to their new location with the motion actuator.

Is something like this possible with BGE? How would I connect these two?

While you can simply plug a senor from one object into an actuator on another, I find it cleaner to use messages.

Have object one (the ghost) trigger a message. Then on object two (the coin) have a message sensor trigger the motion.

Her are the logic bricks for the sensor object. It is just a collision sensor and a message actuator.

Then on the coin object add a message sensor, to trigger whatever you need.

Note the subject in both message logic bricks has to be the same.

Now if you just want to go the quick and easy way (yet very messy) then just select both the sensor object and the coin and hook up the logic bricks cross object in the logic editor.


Real Time Reflections in the BGE I'm trying to achieve real time reflections in the game engine, possibly using the render to texture module if needed, but am not sure exactly how to go about it. Faking reflections using cube maps, etc, are simple enough, but that doesn't achieve a true reflection.
I want to be able to see a true reflection of my character if he/she moves in front of the mirror.

If you're still confused, take a look at a real mirror. That is what I want to simulate.
Any tips are appreciated.

Tutorials for blender 3d has an excellent tutorial over here

It uses renderToTexture with a mirrored UV map and a camera facing out of the mirror.
One thing to keep in mind is that this requires the scene to be rendered twice: once from the main camera, once from the mirror camera. As such, it can increase processor load quite a lot.


Why move all objects when press 'G' key I definitely chose one object and I don't know why it's all moving together. I want to move one object, and I never set up a parent.

You have accidentally manage to enable Proportional Editing.
Toggle it with "O" key or click this button.


Simple script for pasting node to every material. Can't figure out I have model from Sketchup which have like 700 materials and I need to create/paste specific image texture node in every material for baking one diffuse texture to later create one material.

My script is not working like I think it should. Can You help?

import bpy
object = bpy.context.object
for num in range(1, 700):
object.active_material_index = num
bpy.context.area.type = 'NODE_EDITOR'
bpy.ops.node.clipboard_paste()

I don't know exactly how to copy/paste nodes between materials, but this solution works anyway.

I suggest to have a reference to the image texture node you want to duplicate inside your blend file data. To do this, choose any material that will be used as source (srcmat in my example), and add the image texture node you want to duplicate in its node tree (set the image too). Assign a name to this node (mynode in my example) from the N sidebar.

This lines of codes will create a new texture image node for all the other materials assigned to the object, then assign the texture you set in mynode node and finally link the texture to the color input of the Principled shader node:

import bpy
from mathutils import *

# replace 'srcmat' with the name of your source material
# replace 'mynode' with the name of your image texture node
srcmat = bpy.data.materials['srcmat']
srctxtnodeimg = bpy.data.images[srcmat.node_tree.nodes['mynode'].image.name]

# select your object first
o = bpy.context.active_object

# create the same node on all the other materials
for i in range(len(o.material_slots)):
    o.active_material_index = i
    m = bpy.data.materials[o.active_material_index]

    if m.name != srcmat.name:

      mnodes = m.node_tree.nodes

      newnode = mnodes.new("ShaderNodeTexImage")
      newnode.image = srctxtnodeimg
      newnode.location = Vector((-100, 500))

      princshader = mnodes.get("Principled BSDF")
      m.node_tree.links.new(princshader.inputs[0], newnode.outputs[0])

P.s.: you can add other properties of the source node such as color space, interpolation or projection if you need. Moreover I assume that all your materials (created after import from Sketchup) use the Principled BSDF shader, which is (based on my experience) the default shader used by Blender in any situation (eg if you import a model).


how to bake Sun Position into Sun object animation I am using the "Lighting: Sun Position" add-on that is controlling my Sun light object position, which works and renders correctly on my local host.  However for the Sheep-IT farm I apparently have to "bake" this into the Sun light object position and am working a python script:
sun = bpy.data.objects["Sun"]
for iframe in range(bpy.context.scene.frame_start, bpy.context.scene.frame_end + 1, 1):
    bpy.context.scene.frame_current = iframe
    print( bpy.context.scene.sun_pos_properties.time )
    sun.keyframe_insert( data_path="location", frame=iframe )

However the sun_pos_properties.time is always printing the time (for frame #1), even though it is animated, and the inserted keys are also not changing.  Can some kind brilliant person give me a hint on how to complete this script?

Simpler than I thought:
sun = bpy.data.objects["Sun"]
sun.select_set(True)
bpy.ops.nla.bake( frame_start=1, frame_end=10, bake_types={'OBJECT'} )


BlenderGame: lighting selective object I have problem with lighting of my scene in Blender Game.

I need a lamp that light object on its layer and the objects on the layer ray shadow on all layers. But object on other layers do not ray shadow of the lamp and do not specular of the lamp (only receive shadow from object on layer where the lamp is).

I'm including simplified blend file to show the problem.

https://drive.google.com/file/d/0B2UVoJDM1cz9NlZCUUFiNTRKeDQ/view?usp=sharing

I have there 3 layers:
Layer1 - white objects
Layer 2 - blue
Layer 3 - Red.

Lamp from layer 1 should light only white objects, but the object should cast shadow on all objects (red and blue cube)

Lamp from layer 2 should light only blue cube, but the shadow from the cube should be casted on all objects.

The same for layer 3 with red cube.

Is it possible to handle this? If not, meybe u know any alternative?

It looks like the "this layer only" setting on the Lamp includes "this layer only" at the shadow too (without explicitly setting this checkbox).

You might workaround that by using a second set of lamps that creates the shadows only.


How to model physics in Blender? I'm robotic engineer. I'm using OpenSCAD to model robotic components (gears, pulleys, parts, etc). But I need application to model physics and interaction of the components (for i.e. how will robot move if I will rotate current gear).

So, is it possible to import OpenSCAD models into Blender and model interactions in it?

I have models in STL format (for i.e. gears). I need to make reductor from it and see how it moves (if possible - measure rotation speed and torque).

Blender supports some physics simulation for rigid bodies, soft bodies, cloth and fluids. However these are not aimed at CAD applications, there are no tools to measure things like rotation speed and torque, and there is no guarantee that the simulation results will match the real world to some precision.

I think you need to use specialised CAD/CAM software for this.


Why do is there a gaping hole in camera view but not in viewport shading? viewport:

camera view:

The shape is just a plane with two edges raised up to form a semi-room. Beveled the corners. Classic. I added a solidify modifier to see if being thicker would fix the hole but it didn't. The hole happens in rendering too.
shape of the background without object:

Your clipping distance is too high. Select your camera, press the little camera icon in the bottom right of your screen. Then, reduce Clip start to the lowest value. Right now it is too high in the picture, make it lower than that


Deform geometry along spline in Animation Nodes Is it possible to deform an object along a spline in AN just as it can be done with the curve modifier?

I'm trying to do so with the spline falloff node affecting the vertices of my mesh but I'm getting results I can not understand.

So an example would be, given a cylinder transform its vertices in a way which follows an spline object.

EDIT

@Omar Ahmad solution works perfect if our starting point is a clean object. After solving the original question I'm editing my original question for further knowledge.

If we want to combine a series of deformations and add it to our already answered curve deformation, how would it be done? In the following graph you can see my original state:

This part of the graph deforms in X each element till it reaches a post, is important to state that those elements have already been deformed in Y before reaching this part of the graph.

So given all this deformations how can I add the deformation of the spline to get my elements to deform like this? (note we have access to yellow spline)

First, you normalize the vertices positions into a unity setting. This is easily done by subtracting the lower-left-forward corner position of the bounding box and dividing by the difference between the upper-right-backward corner position and the lower-left-forward corner position of the bounding box as follows:

You will notice that the vertices are now in a cube located at the origin with length, width, and height of unity. Next, we choose an axis to evaluate the spline at, I will choose the x axis, because I want the cylinder to be deformed along that axis. I will then use the values of that chosen axis to evaluate the spline. We scale the tangent and cotangent based on the values of the other two axis (y and z because we chose x), add the result, and add the evaluated location on top of that as follows:

Want to center it? Just subtract 0.5 from the normalize locations:

You can compute the lower-left-forward and upper-right-backward bounding box points manually from a list of points using the following node tree:


Creating a copy of a bpy_prop_collection instance? This may be a basic question but I'm digging through the reference and can't figure it out.

isinstance(bpy.context.scene.objects, bpy.types.bpy_prop_collection)

returns

True

How can I make a full (or partial) copy of the objects currently in bpy.context.scene.objects, as an instance of bpy.types.bpy_prop_collection?

I want to basically take a "snapshot" of the current objects in the scene that won't change if objects are added or deleted later.

But it also needs to be a bpy_prop_collection instance in order to use the foreach_get/set methods.

I think? this answer might have some clues but I can't quite figure out how to apply it.

Save as a library

Possibly the simplest way to do this is to save the required objects to a library

import bpy
scene = bpy.context.scene
dump = [scene]
dump.extend(o for o in scene.objects)

bpy.data.libraries.write(
        "/tmp/scene_dump.blend",
        set(dump),
        fake_user=True,
        compress=True)

then link or append back as req'd (py console code)

>>> with D.libraries.load("/tmp/scene_dump.blend") as (src, dest):
...     src.scenes
...     src.objects
...
['Scene']
['Suzanne', 'Speaker', 'Camera.001']

Have a look at rna_*** modules

In the 2.XX/scripts/modules/ folder you will find some modules prefixed with "rna_".  Check them out for an exhaustive guide on how to navigate blenders rna.

An example of using rna_xml.py to dump the context scene into a file.

import bpy
from rna_xml import rna2xml

scene = bpy.context.scene

scene_dump = "/tmp/scenedump.xml"

with open(scene_dump, "wt") as f:
    rna2xml(fw=f.writelines,
    root_rna=scene,
    root_node="Scene")

A small snippet of the 100+ megabyte file produced

  <objects>
    <Object name="Cube"
            users="1"
            use_fake_user="FALSE"
            tag="FALSE"
            is_library_indirect="FALSE"
            library="NONE"
            override_static="NONE"
            data="Mesh::Cube"
            type="MESH"
            mode="OBJECT"
            layers_local_view="FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE"
            bound_box="-1 -1 -1 -1 -1 1 -1 1 1 -1 1 -1 1 -1 -1 1 -1 1 1 1 1 1 1 -1"
            parent="NONE"
            parent_type="OBJECT"