text:
Assigning faces to new materials
I am currently learning to work with blender, and i have a problem. By assigning faces to new material it turns transparent and there is nothing i can do. How to solve this problem?

It is usual to say that you assign materials to faces, not faces to materials and actually that is what happens - an index value is assigned to a face and then it matches a material slot that has a material assigned to it. So it is transparent in the viewport but not when rendering, right? Could you post some screenshots?

Lietuvis? gali gal padėt?

Yes, I am lithuanian, but the language of BSE is English, so it would be better if we stick to it so we don't seem rude to other members of this community.

I would check the transparency blend mode settings of the material in the Properties Editor, Material tab:

You don't have these settings visible if you have Cycles selected as the render engine, but EEVEE is used to display stuff in the viewport, so just in case they are not there, just switch the render engine to EEVEE temporarily:

Also check face orientation:
Red would mean that normals are inverted.

@Vygintas I was working on that same sushi tutorial when I ran into this problem. It turns out it's a known issue when using multiple materials with a number of older GeForce, Quadro and other end of life graphics cards even though they seem to meet the minimum requirements.

Blender Known Issue: Drawing error with multi-material object. Faces disappear or showing artifacts with 2 or more material slots applied to same object. When trying to use a second material or more on an object, the faces where it is applied become transparent or in some cases they are distorted as black rectangles that stretch to the origin (this second occurs above all with more complex models than a cube). It happens in Blender 2.81 as well as in Blender 2.82, but in Blender 2.80 there is no such error.

While the bug report lists multiple cards, the list is not exhaustive (I have this issue on my card, the GeForce 9800 GTX+, which is not listed). The core issue is the recentness of the video driver. In the case of NVIDIA GPUs, they have to be able to run NVIDIA drivers greater than v400. The highest driver that I can install on my GeForce 9800 GTX+ is GeForce v342.01.
I can confirm that as listed in the bug report, I can use multiple materials in Blender 2.80 and was able to finish the tutorial without a problem!
I like the colors you chose for your tuna and salmon in the above screenshots!


text:
Transparent elements are different than viewport when saved as .png
I am working on a project where I composed many layers with an transparent background. Now I rendered the whole thing and when I saved it the result looked different than the saved version
(The white background of the second image is alpha but opened with spacebar on mac)

source: Stack Exchange

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

sort: votes


text:
Sun object not moving when Rendering Animation
I've problem Rendering sun rotation animation. Steps to reproduce:

Create the sun object
Set 1st keyframe

Select keyframe
Rotate sun object using the handle
"I" > Select Rotation

Set 10th keyframe (Reproduce same steps found in 2nd point)
Add frame_change_post handler to print sun rotation_euler
Run Render > Render Animation

The result was 11 times (0-10) printed same rotation Euler
<Euler (x=-7.9113, y=0.2392, z=-7.1615), order='XYZ'>  .But when I move from keyframe to keyframe Euler XYZ positions are updated. Why is that so?
Here is a demo plugin created to replicate the issue:
bl_info = {
"name": "Sun animation using lever",
"author": "karlisup",
"version": (1, 0),
"blender": (2, 80, 0),
}
import bpy
from bpy.app.handlers import persistent

@persistent
def sun_handler(scene, depsgraph):
    if "Sun" not in bpy.data.objects:
        create_sun()
    sun = bpy.data.objects["Sun"]
    print(scene.frame_current, sun.rotation_euler)

def create_sun():
    bpy.context.view_layer.active_layer_collection = bpy.context.view_layer.layer_collection
    light_data = bpy.data.lights.new(name="Sun", type='SUN')
    light_data.energy = 30
    light_object = bpy.data.objects.new(name="Sun", object_data=light_data)
    light_object.location = (5, 5, 5)
    bpy.context.collection.objects.link(light_object)
    bpy.context.view_layer.objects.active = light_object

def register():
    bpy.app.handlers.frame_change_post.append(sun_handler)

def unregister():
    bpy.app.handlers.frame_change_post.remove(sun_handler)

if __name__ == "__main__":
    register()

To me, this script is working correctly except that the handler should have 2 arguments: the scene and the depsgraph. To tell it another way, I don't think what is printed is from the function indicated in the question.

Seen your edit. What I meant was not only about the missing arguments but the hypothesis that all works fine (it works fine when I test it) but these missing arguments or something else make so what is printed is your env is not the rotation of the expected object.

Thanks, @lemon for the comment. I updated the code regarding handler parameters. I'll try to clarify my question as this doesn't quite solve my confusion. The problem is with 2 views. In one Euler changes sun rotation coordinates, but whenever Animation is Rendered - it doesn't. I tried to illustrate it here: https://youtu.be/0Q8FsuDrC1k I

You say that I should be somehow extracting rotation of an object from the scene (the context)? Sorry, Blender is new to me :)

"what is printed is your env is not the rotation of the expected object" This totally makes sense. Could you help me to understand how to get a rotation of the object while I am using "Render Animation" as I couldn't find examples in existing atmosphere plugins?

ok... did not understand at first. My hypothesis was wrong.

It seems that during rendering you need to use the depsgraph so that you obtain an evaluated object.
Don't know why this is not useful when just playing the animation.
So add this line:
sun = sun.evaluated_get(depsgraph)

In the complete function:
@persistent
def sun_handler(scene, depsgraph):
    if "Sun" not in bpy.data.objects:
        create_sun()
    sun = bpy.data.objects["Sun"]
    sun = sun.evaluated_get(depsgraph)
    print(scene.frame_current, sun.rotation_euler)

A link to the documentation if needed.
For information, I've asked on blender coders and had an answer by dr.Sybren:

The difference is caused by the render engine using its own dependency
graph, which is not marked as 'active'. As a result, it does not copy
animated values back from evaluated to original objects.

This behavior is confirmed to be intended.

Note that the depsgraph argument for the handler only exists since 2.81.

I tested the demo script and it really worked, awesome! I still got to wrap my head around about "why" and "how" yet. Just let me first test it on the real plugin, just to see if it works there.

Although it introduced another issue that I've to fix, it solved the issue I was tackling for a while. Thank you for your effort! I accepted your answer.

In sequence-view:

click View menu item
click Sequence Render animation

This will correctly export an animation with frame_handler

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


text:
Converting texture files in blender using Python
I want to write a simple script that scans all the textures files in a folder containing .dds format files and then save them as .tga.
I want to know how I can:

open the texture file
get a reference to the opened texture file
save_as (not save) .tga files (Targa)
close the opened texture file

Manually I can do the following to convert the files:

Open Blender, change to UV Editing mode from default
Click on Open image and load the desired texture image (which is .dds)
Click on Image -> save as Image and select Targa format while saving

Essentially I just want the automation of the above mentioned process!
Thank you for help!

Why blender? Did you tried Imagemagick or PythonMagick?

@brockmann Because I am using blender to import a custom 3D file format of a game and then export these models as .fbx  to be used in unreal engine 4.
Since the unreal engine 4 doesn't support the .dds texture files used on these models, I need to convert them as well. And I felt it would be better if i converted textures alongside models in blender.

Ok, can you please share any sample file?

@brockmann I am not sure why you need sample, all I wanted was some help with python code to automate loading an image in uv editor of blender, and then save_as with different file format. (I mean, I tested it manually in blender but i wanted to automate it)
Anyway, here is the sample:
https://drive.google.com/file/d/0B0WMRZkjfBoCeTJQRmx6OEZRQXM/view?usp=sharing

@brockmann I figured it out and posted in answer. Thank you!

Okay, I figured it out.
image = bpy.data.images.load("filepath_to_source")
image.file_format = "TARGA"
image.save_render(<filepath_to_destination>)

I tried using image.save() function before I posted this question, which raised a Runtime Error:

Image does not have any image data

and I thought I was doing something wrong. Using save_render() function seem to have fixed it. I still don't know why save() didn't/doesn't work.

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


text:
Odd Black Patches and Modifiers Not Appearing in Blender Cycles Render but Appear Fine in Viewport
Can anybody tell me why I'm getting a great render in the preview, but terrible black patches and modifiers such as subsurf not appearing on final render? Below are pictures and .blend file. I've tried applying the subsurf but am still getting terrible black spots.
I appreciate the help!

Here is the .blend file:

I've downloaded the blend file, but the textures don't come with it. You might want to go to your blend file and go to File > External Data > Automatically Pack Into .blend and reupload your file.

I'm away from my computer until tomorrow, but all the materials are just procedural with no images and here is the link to the free hdri world environment texture, I was using the 4k one I believe: https://hdrihaven.com/hdri.php?hdri=balcony Let me know if this works and I can upload again tomorrow! Thanks

So I solved it myself, there must have been some type messed up topology that was allowing it to preview fine, but then when I went to actually render, everything went haywire. I ended up re-modeling all the bevels around the initial shape and now it renders out fine!
So I guess make sure to do periodic test renders!!

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


text:
How to make mesh grow to create form
I would like my mesh to grow to form this logo:

I created a curve and made the mesh grow along it. The problem in with the 45º edges. See here better:

Any hints please?
Edit:
I have tried using a Lattice but it is so difficult to model it. Is there a way to extrude a lattice?

Check out the kind of animation I need:

Your idea with the curve isn't bad at all, but for the form of the log you need to alter the geometry as well, I would suggest, create the logo as one mesh, create the shape as simple as possible, in this case just use a plane create the outline, cut the angles with the knife-tool and keep it with only quads, it should be very easy to create this mesh ;-)
When you have the finished mesh, create a few shape-keys, where you just move the vertices back to where they should start. Then insert Keyframes to your timeline, to control the different shape-keys. All the best Marco
For a better understanding here is a quick example of how I would do it.
Here is a little Video https://youtu.be/OW1WdF42yrk on how it would work. And here is a dropboxlink to the example file https://www.dropbox.com/s/aas26i1z0t2e5wa/Logo_folded.blend?dl=0
All the best Marco

Hey @marco, don't think I understood what you mean.

@FaridAbdelnour I created a littel example, so it's clearer what I mean. Just a quick example, without the right size, of your Logo, and you can definately add more steps in between, but it will work as a proof of concept. All the best Marco

Thanks for the hwlp :)

You're welcome, I hope it works for you.

Hi, me again, sorry to bother you, but it is not working exactly as i needed. Have a look at the blend file to see the kind of animation I would like it to do.


text:
Use multiple bl_space_types to place the same toolbar on multiple locations
So I'm not sure if this will be possible at all, but someone might have an idea for a workaround for this problem.
So if I have made a toolbar, e.g. (short version)
class add_item(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'

But I would like to have this toolbar placed in multiple toolbars so it'd become something like this (code below doesn't actually work, just an example of what I'd like):
class add_item(Panel):
    bl_space_type = ['VIEW_3D', 'IMAGE_EDITOR', 'NODE_EDITOR']
    bl_region_type = 'TOOLS'

Would something similar to this be possible to do without duplicating all the code for the toolbar multiple times, just to then change the bl_space_type?

You can do this using a loop to generate dynamically named panels, each with the desired bl_space_type (based on this nice answer):
import bpy

def panelFactory( spaceType ):
    class NewClass( bpy.types.Panel ):
        bl_space_type = spaceType
        bl_region_type = 'TOOLS'
        bl_label       = "add_item_%s" % spaceType

        def draw( self, context ):
            layout = self.layout
            layout.operator( "mesh.primitive_cube_add" )

    NewClass.__name__ = "add_item_%s" % spaceType
    return NewClass

spaceTypes = ['VIEW_3D', 'IMAGE_EDITOR', 'NODE_EDITOR']

for spaceType in spaceTypes:
    panelFactory( spaceType )

def register():
    bpy.utils.register_module(__name__)

def unregister():
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

This code will add the "Add Mesh Cube" operator in a new panel to the "Misc" tab in each of the desired windows (space types).

You can use inheritance to share code between panels while customising parts that are unique to each editor.
class MyBasePanel(bpy.types.Panel):
    """A Panel to show in many places"""
    bl_label = "My Tools Panel"
    bl_region_type = 'TOOLS'

    def mydraw(self, context):
        # do nothing here so each class can add it's own thing'
        pass

    def draw(self, context):
        self.mydraw(context)
        row = self.layout.row()
        row.label(text="Hello world!", icon='WORLD_DATA')

class My3DViewPanel(MyBasePanel):
    bl_space_type = 'VIEW_3D'

class MyNodesPanel(MyBasePanel):
    bl_label = "My Nodes Panel"
    bl_space_type = 'NODE_EDITOR'

class MyImagePanel(MyBasePanel):
    bl_space_type = 'IMAGE_EDITOR'

    def mydraw(self, context):
        row = self.layout.row()
        row.label('For the Image editor')


text:
How to set up a render farm
I got my hands on three identical PC towers, I would like to hook them up into a render farm, but I would like some advice on what opperating system I should use. I know that I need one of them to be a master, when I looked up linux I found that they had a linux server, is that the sort of thing I'd want for the master?

Also see https://cgcookie.com/blender/2013/08/09/setting-up-a-render-farm/ and https://youtu.be/_Oqo383uviw

This seems like more of a general question to me, a canonical answer would be nice tho.

To setup a render farm you need multiple computers that can talk to each other over a network. Then you setup one as a master and the others as slaves that will get their workload from the master.
Blender includes a network render addon that just needs to be enabled in preferences then configured on each machine.
Flamenco is the new network render project being worked on.
For a small farm you can also manually start blender on each machine, giving each a different range of frames to render. With *nix machines this can be done through an ssh connection with blender -b myscene.blend -s 1 -e 10 -a, this can be expanded to a script that can automate sending the command to each machine for you.

thank you, this info will help me later on, but what I need to know now is what is the best operating system to use. I've heard a lot of people use linux, but I have never used linux before, so I don't know anything about it.

The best system to use is the one you are comfortable using, or can easily find help in learning. Also the cost of windows can make *nix more desirable. A *nix machine is usually easier to run remotely using a cli, while with windows you can use vnc or rdc to control the machine remotely.

Thank you again, I think I'll try Linux, I have enough copies of Windows to fall back on. You have been very helpful.

No I haven't setup flamenco yet. The readme lists commands to install pre-built docker setups, which is like a virtual disk image with everything setup. You could try #flamenco on IRC, which is quite so it may be a while till someone else is there to respond. Farms like render.st or lionrender.com lessen the need to setup your own.

We've considerably improved the documentation in the past weeks, it's worth checking out https://flamenco.io/ again.


text:
Weight paint not showing weights for right bone
My shoulder bone is selected but the weights for the head bone is showing like this
No matter what bone I select, it always shows the weight for the head bone. When I paint over it, the effects are reversed like adding subtracts weight and vice versa .The weights of the shoulder are affected. Is it supposed to work that way?

You have weights on the wrong bone, the weights are displayed only for the selected bone.

First, I selected the head bone, painted my weights on, then selected the shoulder bone. Did I switch bones wrong or something like that?

Do you use the same mesh for the head and shoulder bones? Because if it is, then both head and shoulder bones will affect the movements of that mesh


text:
Smooth shading and colored shadows
When I set the shading of a mesh to smooth, the shadows on the mesh are always black when rendered, but I need them to be blue. When I set the shading to flat the color of the shading turns out fine. Is there a way to make smooth shading not black?
The person is set on flat and the scarf is smooth. I'm using Blender Internal.

Blender Internal or Cycles? Also, what version?

Colored shadows can be accomplished by adding a light with the color facing toward the shadowy area https://i.sstatic.net/igJbl.png

I think the most easy method is to set Ambient Color in the World tab.


text:
Snap to face not working
Snap to face isn't working. After enabling it, I selected the face I want to snap to and pressed enter (which I think is supposed to be done) and my snap to bar on the bottom looks like this.
I want to move this vertex

but it ends up like this, even with snap on.

Help?

What version of Blender are you using?

https://youtu.be/WwmdhqhD3aI

When set to median and face as target an objects median (center) will snap to a face.
This example shows how snapping works with different objects and snapping an edge of the same object.

When you use closest as snapping target then objects will snap to the top of the face.

Snapping doesn't work by pressing Enter by itself.
Using Face|Closest|Project individual elements on the surface of others you can achieve the following results but you should press g before pressing Enter.

In Blender 2.8:
In Object Mode
In the Top Center of the 3D view is a Magnet Icon (Snapping) and a selection box for the settings.
Set the Settings to FACE, CLOSEST  and MOVE.
If you need the object to rotate (like to match a curved surface) turn on rotation as well.
This drove me INSANE because I kept snapping the center pivot of my object to the face, not the closest face.
Selecting CLOSEST fixes that.


text:
Create copies of primitives a number of times along a given or random length between two primitives
Thanks for the reply but I’m not sure that the solution offered works as I wanted. I have included a workflow to clarify what can be done easily on Sketchup requiring no calculations. This is what I would like to do in Blender. I’m sure It would be a really good addition to the Array modifier and I’m sure relatively easy to code.

What do you mean by "no calculations"?

Up until now the vast majority of those that I asked about this told me to use math calculations to place prims accordingly. I was just trying to make the point that SketchUp example was a simple drag to a random location. I had seen a Vid of something similar by somebody called Fabio "Advanced Array Modifier" but couldnt track down if it had been implemented - so I knew it could be done.

The script provided was good, so the calculation was done for you.   You got very lucky.

NEW
I rewrote this script today, it is available at: github.com/zeffii/B3D_PrimitiveRepeat
Similar Features but simpler code and UI.
Changes:

now can access operator properties from Tools or F6 (I prefer F6)
has 3 main modes

linear: precise segments between two linked duplicates
deviate: similar to linear but with a randomization seed + amplitude
random: random locations between the two linked duplicates.

has 2 interpolation modes

matrix interpolation (all transforms)
vector interpolation (locations)

adds an empty and parents the generated objects to it. This allows you to quickly delete them using Outliner-Delete Hierarchy with their Empty selected.

OLD
Here's an attempt at such a script. It is intended to inspire you to write your own addons / macros to customize your Blender experience. Not everyone understands why certain functionality is handy.
But it's not exactly the same behaviour as SketchUp (ie you don't need to snap the primitive to the other primitive first)

Select Two objects which use the same mesh. (Objects duplicated using Alt+D share a mesh, and are called "Linked Duplicates")
Trigger the addon:

press Left Bracket / Right Bracket to increase decrease the number of repeated objects
press Ctrl + Up/Down to change the seed value for the random location
Enter or Esc to finish up, or click outside of the 3dview.

The array modifier can repeat an object with additional space.
The array modifier with Fit Length below.

The array modifier can repeat object along a curve.  Curves can be straight lines as well.  Fit Curve below.

The array modifier is dynamic or can be applied for static placement.
Perhaps the array modifier is more powerful than that other feature in that other software.
Particle systems can also repeat geometry.


text:
bpy.ops.wm.addon_expand(module="module_name") works in console, but not in add-on
My add-on shows the User Preferences view, selects the "Add-ons" tab and search for a specific add-on.
I'm trying to expand that add-on, but it doesn't work consistently. I get this error:
AttributeError: 'NoneType' object has no attribute 'bl_info'

It works in console, though.
The code in question is this, where xxx is the name of the .py file or the add-on folder.
class XxxOperator(bpy.types.Operator):

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

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

It's an option in the menu. The init file (I'll omit the bl_info and the imports):
class XxxMenu(bpy.types.Menu):
bl_idname = "OBJECT_MT_XxxMenu"
bl_label = "Xxx"

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

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

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

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

if __name__ == "__main__":
    register()

BSE automatically makes inverted double quotes, even when the plain text of the title uses the right symbols. (just FYI no point editing the title, i tried)

are you getting " AttributeError: 'NoneType' object has no attribute 'bl_info' "

Yes, I get that error. I edited the question, thanks.

Can we get the full script, and in which context it is used (e.g. is it a plain addon? a script to be executed from Text window? etc.)

Sorry, I can't share the full script (that sucks, I know), but I'll add more info in the question.

Whether an addon is displayed expanded or not in the User Preferences is stored in the bl_info dictionary, in the property called show_expanded.
addon_utils manages a cache of addons. It uses the global addons_fake_modules. It can be used to determine and change the expand state:
import bpy
import addon_utils

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

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

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

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

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

from startp/bl_operators/wm.py the WM_OT_addon_expand operator gives a hint how to check if it is expanded or not:
class WM_OT_addon_expand(Operator):
    "Display more information on this addon"
    bl_idname = "wm.addon_expand"
    bl_label = ""
    bl_options = {'INTERNAL'}

    module = StringProperty(
            name="Module",
            description="Module name of the addon to expand",
            )

    def execute(self, context):
        import addon_utils

        module_name = self.module

        # unlikely to fail, module should have already been imported
        try:
            # mod = __import__(module_name)
            mod = addon_utils.addons_fake_modules.get(module_name)
        except:
            import traceback
            traceback.print_exc()
            return {'CANCELLED'}

        info = addon_utils.module_bl_info(mod)
        info["show_expanded"] = not info["show_expanded"]
        return {'FINISHED'}

Thus.. i think something like this, you'll probably want to refine it
import bpy
import addon_utils

module_name = "sverchok"
addon_utils.modules_refresh()

bpy.ops.screen.userpref_show("INVOKE_DEFAULT")
bpy.context.user_preferences.active_section = "ADDONS"
bpy.data.window_managers['WinMan'].addon_search = "sverch"

try:
    mod = addon_utils.addons_fake_modules.get(module_name)
    info = addon_utils.module_bl_info(mod)
    if not info["show_expanded"]:
        info["show_expanded"] = True

except:
    import traceback
    traceback.print_exc()

it's just these lines really:
mod = addon_utils.addons_fake_modules.get(module_name)
info = addon_utils.module_bl_info(mod)
info["show_expanded"] = True  # or False to Collapse

Thanks, but that's exactly what I have, and it doesn't work in my add-on.

When used in console it works, and if it's already expanded, it contracts it again.

But expand/unexpand was always the only problem... the rest of the code always worked fine.
EDIT: sorry, I didn't see your last answer. So the only problem now is to detect if the add-on was already expanded?

The bl_info error disappears if I delete the "addon_expand" line.

Actually, it's possible to detect if an addon is displayed expanded and can be toggled without an operator. See my answer for example code.


text:
Different euler rotation from same Matrice between Blender and Maya
My problem is the following:
I start from the same matrix between Blender and Maya and I want to get the euler rotation in degrees of this matrix. The problem is that I don’t get the same results at all between Blender and Maya, even crossing all possible combinations of rotation order (XYZ, XZY, YXZ, etc).
Very important, I have to keep the code in Maya as it is, the goal is to transpose the code that is on Maya to Blender and get the same result from the same matrix.
So I wanted to know how the euler rotation was calculated from the matrix on Blender and on Maya so that I could adapt on Blender.
Here is the test code:
Maya :
from __future__ import print_function
from maya.cmds import *
from math import asin, sin, cos, pi, acos, atan2, degrees, sqrt
import maya.mel
import pymel.core.datatypes as dt

matTest = dt.Matrix()
matTest.a00 = 0.8486
matTest.a01 = -0.0541
matTest.a02 = 0.5262
matTest.a03 = 0

matTest.a10 = 4.4218
matTest.a11 = -4.7339
matTest.a12 = -7.6182
matTest.a13 = 0

matTest.a20 = -0.2903
matTest.a21 = -0.8792
matTest.a22 = 0.3778
matTest.a23 = 0

matTest.a30 = 0
matTest.a31 = 0
matTest.a32 = 0
matTest.a33 = 1

print(matTest.formated())
transformation_matrix = dt.TransformationMatrix(matTest)
print(transformation_matrix.formated())
transformation_matrix.reorderRotation(dt.TransformationMatrix.kZXY)
print(transformation_matrix.formated())
rotation = transformation_matrix.getRotation()
print(str(degrees(rotation.x)) + ", " + str(degrees(rotation.y)) + ", " + str(degrees(rotation.z)))

Blender:
import bpy
import bpy_extras
import math
import mathutils
from math import degrees, radians, cos, sin

orderRot = 'ZXY'
mFinal = mathutils.Matrix([
[0.8486, -0.0541, 0.5262, 0.0],
[4.4218, -4.7339, -7.6182, 0.0],
[-0.2903, -0.8792, 0.3778, 0.0],
[0.0, 0.0, 0.0, 1.0]
])
print(mFinal)

euler = mFinal.to_3x3().to_euler(orderRot)
print("EULER ROT  : " + str(degrees(euler.x)) + ", " + str(degrees(euler.y)) + ", " +
str(degrees(euler.z)))

#print(mFinal.to_3x3().normalized().to_euler())
#print(mFinal.to_3x3().normalized().to_euler(orderRot))

The result from the maya script and expected is the following :
Euler rotation in degrees : (x= -61.5445699885, y = 142.460065238, z = -173.480241609)
If anyone got any idea ? Thanks !

After a quick check Maya uses Y axis as "Up" so you may have to invert Y and Z in all matrices. My 2 Cents

Already tried to multiply with a matrice to invert Y and Z axis in the initial matrice, but it doesn't work :/

Does Maya use row or column matrix? Simple test make a translation matrix. Is the location in last row or column?

And what is the expectation here?  Decomposing matrix in blender (0, 0, 0) location,  [-37.57330775634702, -26.185184796570315, -50.13446618720194] XYZ Euler rotation (in degrees) and scale (-4.511841297149658, -4.815155982971191, -7.64569091796875) .. what is the expected result?

Thanks you for your answer. The expected result is the result from the code I shared from Maya : (x= -61.5445699885, y = 142.460065238, z = -173.480241609)    The translate in world matrix of an object in Maya is in the last row

@batFINGER I tried to transpose the matrix before getting the euler orientation (and tried in all orientation order possible) but it doesn't return the expected result either :/ I don't know if it was this that you wanted to try when you talked about using row or column matrix ?

Answer is here : link


text:
Moving a rigged jawbone
I weight painted the jawbone along with the lower jaw, but whenever I rotate the jawbone armature, the jaw comes out. What can I do to keep it in the mouth while moving it?

https://blend-exchange.com/b/bD1K1ML6

This needs a lot more detail.  You should consider linking a file so people can see what you're talking about (and why it's happening.)

Try https://pasteall.org/blend/

If we go to weight paint mode and select a vertex that doesn't seem to be moving right, then inspect its deforming weights on the sidebar, we can see why:

This vertex is weighted 1.0 to the jawbone-- but it's also weighted to a bunch of other bones.  Its effective influence from the jawbone is equal to 1/(.009+.214+.734+1).  So it's effectively only weighted half way to the jawbone.
If we select one of the teeth vertices instead, we'll see that those are weighted fully to the jawbone, but not to any other bones, so the teeth are influenced fully by the jawbone.
If you want these to match up, you either have to paint the teeth to match the lips, or the lips to match the teeth.  In respect to all bones, not just one bone.  There are a number of tools you can use to make them match (data transfer, normalize all operation with locked groups, more.)


text:
Imported animation from mixamo to unity causes left hand to act unusual
Edit: I realised after I posted this question that it is on the blender stack exchange and this question is not actually blender related, however, I understand the files I am working with were designed and exported from blender so I feel that this is a relevant location for this question.
Edit: The eagle eyed viewers may realise that the icon shown in the first image indicates that I have added "Animation Rigging" inside of Unity. I added this to try and correct the issue, I can assure you that this is not the cause of the issue.
I am a software developer by trade and have little experience with the 3D modelling, rigging, texturing and animation pipeline.
I am just currently creating a hobby 3d shooter project and have imported a model/animation pack from mixamo in to unity.
Everything seems to have been imported correctly and all bones labelled correctly and in the correct position when in T-Pose in the game.
The problem:
When I start the game with the "Running While Aiming" animation everything works fine, apart from the left hand seems to be inverse in some way, see screenshots below:
This first image is the character in T-Pose showing the hands are correctly modeled.

This next image shows the character when the game is running and the "Running While Aiming" animation is active. As you can see, the left hand is in an unusual position with the "left hand pinky" finger being on the left of the left hand, when in fact the fingers shoulder be the other way round.

I have made no alterations to the model, the armature or animations. I imported everything to get going directly from mixamo as a package. I tried importing as a regular .fbx and as Unity .fbx and it has made no difference.
I would really appreciate some help on this if possible. I am a software developer by trade and am trying to create this hobby project to further my game programming skills.
Thanks in advance for any help or feedback provided.

once I found one solution, when exporting an animation at the beginning should be T pose, 0 frame T pose, 1 frame our animation, 2 or 3 frame our animation, in Unity we start cropping the animation with 2 or 3 frames
^^^^outdated
^^^^outdated
All problems in hierarhi , BaseMainGeneral Object Armature must be == ,
or (if only Mixamo) Object , Hips(natural bones) Mesh or(for example after Blender 3D) Object , Mesh and Empy Name(really important) Armature , Hips

only under these conditions will it be possible to create an avatar from other

Blender+Unity direction Armature and box Mesh , in Blender select Armature (normally import -Y forward), -90 X axis , reset rot Armature and Mesh , select Armature +90 X axis (Armature 90 , Mesh 0) - export (NONONO Transform experimental )
in Unity must be Case , Armature , Hips . box Mesh all good direction
Import in Blender - Leave Bones - Yes
Export - No , end bones to point but the others good , fbx

This seems to happen every so often with Mixamo and Unity.  The answer is: when you import the rig, use "copy from other avatar" instead of "create from this model" and use the avatar for the base character.


text:
How to properly solidify a complex object?
I have this complex 3D object and I would like to fill it in using solidify.
My problem is that ever time I try to solidify the object, it takes odd shapes:

How can I fix this?

Remove the bottom, solidify and create the bottom again. Select the whole bottom and solidify it.

it doesn't appear to work too well....the borders are solidified improperly

Please upload the blend file so that we can have a look. Instructions here.

Check if Normals are correct or for any double vertices


text:
How do I make the rig on the right deform the mesh like the rig on the left?
Can anyone tell me what is causing this problem and how to fix it?

BLEND FILE

You need to take the two meshes into weight paint mode and compare how they are painted.  The one on the right needs adjustments.

From your blend file I see that the rig on the left is using corrective shapekeys to overcome the limits of the weight painting.  You'll need to learn how to do that and then apply the technique to the rig on the right.

In the left rig, unfortunately, the option [X] Deform is activated for almost every bone, even if it is only a control or mechanic bone.
So you need to check the vertex group of the mesh to figure out which bones actually deform the mesh.
As you can see in the screenshot the right arm is deformed by the bones R.arm, R.arm_elbow and R.wrist_target2. But if you look at the rig there is only R.wrist visible and no R.wrist_target2.

After inspecting the bones layers further you will find this R.wrist_target2 bone on bone layer 3. For a better overview you can add it to layer 1 (in Edit mode select the bone and press M, then Shift+click the first layer)
Now it's clear why the hand deforms differently compared to the rig on the right where the Down bone (= wrist bone) is not a control bone but a deformation bone.
If you want to make your rig work the same you need to add another bone at the position of R.wrist_target2 and make it a deformation bone. Then make the Down bone a control bone that rotates the wrist target bone.

As mentioned in the comments, the elbow bone triggers a shapekey (Bend) with help of a driver to keep a blocky elbow shape.


text:
How exactly should the Hand and Foot bones be placed? (Rigify)
I added Armature to a human model with the Rigify plugin. I can easily adjust the positions of the bones. However, I am undecided about the positions and scales of the hand and foot bones. When placing the hand and foot bones on the model, should I be very sensitive to each bone piece ?

Rigify has a Bone Positioning Guide that is a good but too simple introduction to where to place the bones.
The important things for fingers is that

The bone should initially be placed so that its ends are at the centers of the joints. As pointed out in a comment, you may have to experiment with the positions, but using the centers as a starting point will give you the start to developing the experience you need to eventually do perfect placement.
The bone should be oriented so that the axis angles are consistent.  This is accomplished by adjusting the bone roll and adopting a rule for how the x and z axis are used.   A common rule for hands is to always orient the bone so that rotating on the X axis would match the natural rotation of the joint.

By "The bone should be oriented so that the axis angles are inconsistent," did you mean consistent? Shouldn't it be that the axes are always pointing in the same directions relative to the pointing direction of the finger?

Yes, I meant consistent.  Thank you for pointing that out.  I'll fix it now.

In my experience, the center isn't always the best position, but at the end of the day: you can't tell before you either have tried it or have enough experience to be able to predict how your mesh will deform. So focus mainly on the bones orientation and do some tests with the bones head positions. And keep in mind that, at the end of the day, bones only rotate vertices around. It will not be enough to have perfect deformations, you will need some corrective shapekeys as well.

@L0Lock  I agree that the center isn't always best. I don't think you necessarily need corrective shapekeys, but I think that's too much information for someone who is just starting to learn bone placement.  I'll update the first point to indicate it's only a starting point.


text:
Vroid textures messed up. I don't know why
Ok, I'm trying to do some bone work on my VRoid model aka a VRM, but every time I press fix it (with the cat blender plugin) it gives me a monster of a model and I don't know what to do.

We are probably going to need to look at a blend file to figure this one out. (How to add a blend file)

what fille? im still pretty new to blender

the .blend file that has the model in it.


text:
Makehuman facial rig in Blender
I have a Makehuman model fully rigged with the default rig and have imported it into Blender and everything seems to work fine. I have quite a complex pose I'm happy with except the face. My character looks like they're watching grass grow. I want a smile of some sort.
I've tried rotating bones but can't get any sort of decent facial expression.
What bones to move for expressions, a smile for instance? I can't find anything useful online.  What is the mechanism for controlling facial expressions in a Rigified MakeHuman model?
Or can I delete all the face bones and replace them with something more intuitive?

@DuarteFarrajotaRamos There is enough detail to answer this question, but you have to be familiar with MakeHuman's face rig.  The basic problem is that the OP needs to enable a MakeHuman feature to get a face control panel.

You need to enable the MakeHuman Face control panel.  Select the generated rig, go to the rig layers, and SHIFT-Left-Click on Rig layer 2 to enable it.  You then use the control panel to control facial gestures.

@MartyFouts thanks for clarifying, reopened.

In order to control the face in a MakeHuman model that has been rigified, you need to enable the Face control panel.  For unknown reasons, it is hidden by default.
To make the Face control panel visible, select the generated rig, go to the Armature Object Data Properties tab and add Armature Layer 2 to the selected armature layers (Shortcut: Shift Left Click):

(Layers are counted from 0.)


text:
rotate bmesh around bounding box center, not global
how do I rotate the mesh around its center using the bmesh.rotate
import bpy
import bmesh
import mathutils

tech_list = ["TechA"]
for tech in tech_list:
    # these lines create the bmesh with the techA as text
    bpy.data.curves.new(type="FONT", name='label').body = tech
    label = bpy.data.objects.new("label", bpy.data.curves['label'])
    meshed_up = bmesh.new()
    meshed_up.from_mesh(label.to_mesh())

    # this transform_matrix places the mesh in the correct position
    # But still mirrored :(
    transform_matrix = mathutils.Matrix.Rotation(1.5708, 4, 'Z').to_4x4()
    transform_matrix = mathutils.Matrix.Rotation(3.1415, 4, 'X').to_4x4() @ transform_matrix
    # transform_matrix = mathutils.Matrix.Rotation(selet center of mesh, not X-axis)
    meshed_up.transform(transform_matrix)

    # and then we create a mesh for object and link and clean
    label_mesh = bpy.data.meshes.new("label")
    meshed_up.to_mesh(label_mesh)
    meshed_up.free()
    bpy.data.curves.remove(bpy.data.curves['label'])
    label_object = bpy.data.objects.new(tech, label_mesh)
    bpy.context.collection.objects.link(label_object)

# EOF

As you can see, so far all is well but the label is still mirrored, it should now be rotated in place 3.14 radians around its own x-axis, but I don't know how

I would do this using the bmesh rotation operator, rather than computing the transformation matrices, as it seems like easier code to read.  Basically you need the bounding box center, which can be calculated thusly:
from mathutils import Vector
# code up to creating label as an object
center = sum((Vector(b) for b in label.bound_box), Vector())
center /= 8

and instead of the transformations use bmesh.ops.rotate:
from mathutils import Matrix
from math import radians
# code up to where you calculate transforms.
# replace everything up to the call to transform with this:
rotation_Z = Matrix.Rotation(radians(90), 4, 'Z')
bmesh.ops.rotate(meshed_up, cent=center, matrix=rotation_Z, verts=meshed_up.verts)

rotation_X = Matrix.Rotation(radians(180), 4, 'X')
bmesh.ops.rotate(meshed_up, cent=center, matrix=rotation_X, verts=meshed_up.verts)

or, putting it all together:
import bpy
import bmesh
from mathutils import Matrix, Vector
from math import radians

tech_list = ["TechA"]
for tech in tech_list:
    # these lines create the bmesh with the techA as text
    bpy.data.curves.new(type="FONT", name='label').body = tech
    label = bpy.data.objects.new("label", bpy.data.curves['label'])
    center = sum((Vector(b) for b in label.bound_box), Vector())
    center /= 8
    meshed_up = bmesh.new()
    meshed_up.from_mesh(label.to_mesh())

    rotation_Z = Matrix.Rotation(radians(90), 4, 'Z')
    bmesh.ops.rotate(meshed_up, cent=center, matrix=rotation_Z, verts=meshed_up.verts)
    rotation_X = Matrix.Rotation(radians(180), 4, 'X')
    bmesh.ops.rotate(meshed_up, cent=center, matrix=rotation_X, verts=meshed_up.verts)

    # and then we create a mesh for object and link and clean
    label_mesh = bpy.data.meshes.new("label")
    meshed_up.to_mesh(label_mesh)
    meshed_up.free()
    bpy.data.curves.remove(bpy.data.curves['label'])
    label_object = bpy.data.objects.new(tech, label_mesh)
    bpy.context.collection.objects.link(label_object)

By the way, I left the rotation on X in, but it's what's causing your mirroring.  If you remove the two lines with rotation_X in them, you won't have the mirror.
Had you wanted to continue to use the transform matrix, you would need to calculate a new center of rotation.  This just seems clearer to read and easier to follow.
Look at this answer to see how to convert the code to use any arbitrary axis for rotation.


text:
Q: Remove materials using same image? (Python?)
I've ripped a model from within an emulator. It creates an .OBJ that has hundreds of materials using the same image with different names
[Material1(image1.png.001, image1.png.002); Material2(image1.png.001, image.png.004);Material3(image2.png.002);] etc...
Is there a way I can clean all that up without having to manually go through and reassign textures for every face, in blender?

Sounds like a short python script may be needed.

This is some old code; but, If you understand 'C' at all; it may be useful for you.
https://www.blender.org/forum/viewtopic.php?f=5&t=28239

so you are dealing with .obj file ?

either way would be fine, I've tried to create a fix in c++ for the obj, but can't quite get it to work.

Please share the .blend, you don't need to pack the images, just one :)

Kill House C


text:
Render layer confusion
I'm trying to composite a shockwave effect with the blender render engine.
My scene is currently set up with two render layers:
Layer one: Text, two lamps and a camera.
Layer two: shockwave.
I have two issues currently, however I think the first issue may be beyond the scope of this question, I'm not entirely sure if it's something to do with the layer comp.
Issue One: The shockwave colouring seems not to be working from certain frames. Even though nothing is keyframed, everything seems to desaturate from frame 40 to about frame 100.
Issue Two: The final render is rendering the shockwave layer in front of the text when the object is behind the text. If I switch the alpha mix over node's inputs none of the actual shockwave renders, only the text layer.
Download the Blend

Please post your blend or at least screen shots so we can help you further.

added the .blend

Doesn't seem to download for me. Clicking the download button does nothing. I'll try again later.

I've changed it to a dropbox link now, that should work.

Ok, got it. Everything seems to be on one layer. I thought you were compositing 2 layers together?

that's odd, my blend here has the text on layer one and the shockwave on layer two. the render layers "text" is using layer one and "shockwave" is using layer two. the shockwave on layer two is visible at around frame 60

Nope, in my file there is one viewport layer in use and one render layer in use. Also, your shockwave material is using Cycles nodes but your render engine is set to Blender Render. Which engine do you intend to use?

Blender render engine is what I want to use. seems like something has happened to the .blend when I sent it to you. Let me just check and reupload it.

https://www.dropbox.com/s/njqjydj9sgxfkwg/intro.blend?dl=0 is the new blender file.

Ok, that's better.

Ok, there are a number of issues with your file:

Select Layers 1 and 2 in the viewport to have both layers render.

In the Render>Shading panel you should select Transparent instead of Sky for the Alpha setting. This will allow your Text layer to render with an alpha channel instead of black.

Secondly, your Hue/Sat compositing node affecting the Shockwave layer IS keyframed on the Value field. Try muting it to see the difference.

Reverse the inputs on your Alpha Over node to put the shockwave behind.

The shockwave image is very light when viewing in Color+Alpha mode in the UV/Image Editor. If you switch to Color only you can see a stronger effect. Alternatively, you could composite a black background behind everything to see it better.

Changing the shading alpha to Transparent has just given me a full blank image.

What are you looking at when you see the blank image? The Render Result or the Viewer node in the Compositor? Check your individual render layers to see what is rendering for each layer.

I'm looking at Render result.

Could be your composite node is giving a blank image, but the render layers are correct. You can change the view in the Render Result to just see each Render Layer output separately. What does that show?

Also, your text layer was not selected in your original blend, so you may have to select that to get it to render.

Updated answer to be more complete.

I've added the render output that I'm getting to the OP so you can see.

Probably the alpha over node inputs. I've updated the answer again.

Still baffled about the shockwave though. The tutorial I watched used that keyframe for fading the shockwave out at the end. Yet having that keyframe messes up the start of the shockwave even though the frames before that have the same values. removing the keyframe fixes it, but still leaves me confused about how I'm going to actually fade the shockwave out.

You can re-enable the HueSat node, but you have to duplicate the key at frame 188 and move it to frame 1, so that it has a starting value.


text:
changing black uv texture areas to transparent in cycles
So I've been using WoW model viewer to export .obj files into blender. Everything works great up to the point where a UV texture that's created by WoW model viewer has any transparency on it. In the UV map this is shown as a black area, and looks terrible on the model itself.
After looking it up on Google I found an archived post in regards to the alpha is the black area, however I don't understand how this translates and the post itself had images that were broken links, I've still yet to find anything on Google close to this archived post.
Just starting up with Blender I am struggling to find where to resolve this transparency issue, as it's making certain models look terrible.

Are you talking about the model in the 3D view, or rendered. And if rendered cycles or blender internal?

You have to make the following Node set up: Connect 'Mix Shader' node in the 'Material Output', then use as your first shader 'Diffuse' and plug in it your 'Image Texture' node, now connect 'Transparency' Shader as the second shader, and finally to the factor connect your 'Image Texture' once more.

If this don't work try to plug the Diffuse shader on the bottom and transparency in the middle

Seems the correct way is to have the transparency in the top shader input. Thanks for this!

I ended up using the Alpha output from the top Image Texture node for the Mix Shader node Factor input. Also, as @NeilAshleyHickman said, use the top Shader input of Mix Shader node for  the Transparency BSDF node

So, as @NeilAshleyHickman and @gatzkerob answer. Here is the way:

Create material, then select Mix Shader in Surface section
Set the first Shader to Transparent BSDF, and the second to Diffuse BSDF
Click the right dot button in Color and select Image Texture, then select your transparent texture image.
Goto Node Editor window (Shift + F3), and connect the Alpha port of Image Texture to the Fax port of Mix Shader.

(I got a problem setting eyebrow and hair material, then it solved)


text:
Call a Dialog Box upon toggling boolean/checkbox in the UI
I want to make sure that the user acknowledges the selection of a checkbox. What am I missing?
import bpy
from bpy.types import PropertyGroup

def my_boolean_handler(self, context):
    #context.window_manager.invoke_popup(self) # error self should be an operator
    bpy.ops.my_category.custom_confirm_dialog() # prints Info: YES! because executed not invoked

class MySettings(PropertyGroup):
    my_boolean : bpy.props.BoolProperty(
        name = "My Boolean",
        description = "This checkbox triggers a Dialog Box",
        default = False,
        update = my_boolean_handler
    )

class SimpleConfirmOperator(bpy.types.Operator):
    """Really?"""
    bl_idname = "my_category.custom_confirm_dialog"
    bl_label = "Do you really want to do that?"
    bl_options = {'REGISTER', 'INTERNAL'}

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        self.report({'INFO'}, "YES!")
        return {'FINISHED'}

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

class OBJECT_PT_CustomPanel(bpy.types.Panel):
    bl_label = "My Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"

    def draw(self, context):
        settings = context.scene.world.my_settings
        layout = self.layout
        layout.prop(settings, 'my_boolean')

def register():
    bpy.utils.register_class(OBJECT_PT_CustomPanel)
    bpy.utils.register_class(SimpleConfirmOperator)
    bpy.utils.register_class(MySettings)
    bpy.types.World.my_settings = bpy.props.PointerProperty(type=MySettings)

def unregister():
    del bpy.types.World.my_settings
    bpy.utils.unregister_class(SimpleConfirmOperator)
    bpy.utils.unregister_class(OBJECT_PT_CustomPanel)

if __name__ == "__main__":
    register()

I saw 2 StackExchange questions pointing in the right direction, but couldn't get it working with the checkbox.

How to call a confirmation dialog box? (most code example from here)
Call a Dialog Box without 'OK' confirmation button?

The simple answer is in the first Q&A you linked to. Simply modify the 6th line to
bpy.ops.my_category.custom_confirm_dialog("INVOKE_DEFAULT")
However AFAIK calling operators in property callbacks methods is unsupported. It means that it works but it shouldn't. You can see the problem here, the confirmation dialog does get displayed, but since Blender registered that you clicked the mouse on the property, when you release the mouse button it immediately validates the confirmation dialog, making it almost useless.

I would advise using another method, which gets rid of the callback method and uses the operator directly to modify the property value.
You need to set the layout.operator_context beforehand though, so the operator knows to display the confirmation dialog.
import bpy
from bpy.types import PropertyGroup

class MySettings(PropertyGroup):
    my_boolean : bpy.props.BoolProperty(
        name = "My Boolean",
        description = "This checkbox triggers a Dialog Box",
        default = False,
    )

class SimpleConfirmOperator(bpy.types.Operator):
    """Really?"""
    bl_idname = "my_category.custom_confirm_dialog"
    bl_label = "Do you really want to do that?"
    bl_options = {'REGISTER', 'INTERNAL'}

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        context.scene.world.my_settings.my_boolean = not context.scene.world.my_settings.my_boolean
        [a.tag_redraw() for a in context.screen.areas]
        return {'FINISHED'}

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

class OBJECT_PT_CustomPanel(bpy.types.Panel):
    bl_label = "My Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"

    def draw(self, context):
        settings = context.scene.world.my_settings
        layout = self.layout
        layout.prop(settings, 'my_boolean')
        layout.operator_context = "INVOKE_DEFAULT"
        layout.operator("my_category.custom_confirm_dialog", text="Toggle My Boolean")

def register():
    bpy.utils.register_class(OBJECT_PT_CustomPanel)
    bpy.utils.register_class(SimpleConfirmOperator)
    bpy.utils.register_class(MySettings)
    bpy.types.World.my_settings = bpy.props.PointerProperty(type=MySettings)

def unregister():
    del bpy.types.World.my_settings
    bpy.utils.unregister_class(SimpleConfirmOperator)
    bpy.utils.unregister_class(OBJECT_PT_CustomPanel)

if __name__ == "__main__":
    register()

You'll notice the interface doesn't get updated when you confirm the dialog box. You can force a redraw with [a.tag_redraw() for a in context.screen.areas].

So this approach means that I must have an operator (e.g. a submit button at the end of the form) called, because I cannot call it from the boolean directly, right?

I guess so, yes. But you can disguise the operator button with depress argument and change the text argument for instance. See https://docs.blender.org/api/current/bpy.types.UILayout.html#bpy.types.UILayout.operator

Based on your answer I created an edit to the question showing how would it look like if depress is set to True and emboss to False and the operator has been put in line with the checkbox.

@karlisup hey I'm glad you made it work ! It looks good :) However would you mind adding it as an answer rather than an edit to your question ? On this site the first post is reserved for the question, and then the other posts are the answers to this question. It will help other people with the same problem in the future. Cheers

I did the same thing with modal operator, to draw some shape if checkbox on, and removing drawing if off. ("INVOKE_DEFAULT") in update function for bool property is only thing that works for me. I've noticed if you drag-release panel (where pin/unpin icon), it removes unrelease mouse state until new scene.

Here's what I was able to do based on Gorgious answer:

It looks like a boolean but is not. It is a checkbox with an operator that is hidden under the label. For my liking solution is too hacky and it seems that it is not intended for what I want it to be.
Here is the source code:
import bpy
from bpy.types import PropertyGroup

def boop(self, context):
    context.scene.world.my_settings.my_boolean = not context.scene.world.my_settings.my_boolean

class MySettings(PropertyGroup):
    my_boolean : bpy.props.BoolProperty(
        name = "",
        description = "This checkbox triggers a Dialog Box",
        default = False,
    )

class SimpleConfirmOperator(bpy.types.Operator):
    """Really?"""
    bl_idname = "my_category.custom_confirm_dialog"
    bl_label = "Do you really want to do that?"
    bl_options = {'REGISTER', 'INTERNAL'}

    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        context.scene.world.my_settings.my_boolean = not context.scene.world.my_settings.my_boolean
        [a.tag_redraw() for a in context.screen.areas]
        return {'FINISHED'}

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

class OBJECT_PT_CustomPanel(bpy.types.Panel):
    bl_label = "My Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"

    def draw(self, context):
        settings = context.scene.world.my_settings
        layout = self.layout
        row = layout.row(align=True)
        row.prop(settings, 'my_boolean')
        row.operator_context = "INVOKE_DEFAULT"
        row.operator("my_category.custom_confirm_dialog", text="Toggle My Boolean                     ", depress=True, emboss=False)

def register():
    bpy.utils.register_class(OBJECT_PT_CustomPanel)
    bpy.utils.register_class(SimpleConfirmOperator)
    bpy.utils.register_class(MySettings)
    bpy.types.World.my_settings = bpy.props.PointerProperty(type=MySettings)

def unregister():
    del bpy.types.World.my_settings
    bpy.utils.unregister_class(SimpleConfirmOperator)
    bpy.utils.unregister_class(OBJECT_PT_CustomPanel)

if __name__ == "__main__":
    register()

To prevent the user from being able to click on the .prop()'s checkbox graphic, you can add several leading spaces to the operator button's text, then "rewind" the layout cursor by that much space before calling .operator(). The leading spaces will both contribute to the button's click bounds and logically occlude the checkbox graphic. So, if the user clicks on the checkbox graphic, the operator button will receive the mouse click event instead (and show your popup).


text:
How can I change IntProperty default value stored within PropertyGroup?
I am trying to dynamically modify IntProperty default value. Currently, it is stored in bpy.types.Scene.mysettings as PropertyGroup. So far I've succeeded in updating the default value only by assigning a duplicated class that has been updated with new default value and pre-registered using bpy.utils.
Is there any easier way to do this? Is there a way to redeclare single property without reassigning whole class or is the solution really dynamically creating and assigning Classes?
Working example:
import bpy
from bpy.props import PointerProperty
from bpy.types import PropertyGroup, Panel

def update_default_value(self, context):
    settings = context.scene.mysettings
    # Current solution: assigning different PropertyGroup Class to update default val
    bpy.types.Scene.mysettings = PointerProperty(type=UpdatedSettings)

class AAA_PT_Demo(Panel):
    bl_space_type = "VIEW_3D"
    bl_context = "objectmode"
    bl_region_type = "UI"
    bl_label = "My Demo"
    bl_category = "Demo"

    def draw(self, context):
        settings = context.scene.mysettings
        layout = self.layout
        layout.prop(settings, 'myboolean')
        layout.prop(settings, 'myint')

class MySettings(PropertyGroup):
    myboolean : bpy.props.BoolProperty(
        name = "On Check Update Default",
        default = True,
        update = update_default_value
        )

    myint : bpy.props.IntProperty(
        name = "My Int",
        step = 5,
        default = 10,
        )

class UpdatedSettings(PropertyGroup):
    myboolean : bpy.props.BoolProperty(
        name = "On Check Update Default",
        default = True,
        update = update_default_value
        )

    myint : bpy.props.IntProperty(
        name = "My Int",
        step = 5,
        default = 999, # New Default Value
        )

def register():
    bpy.utils.register_class(MySettings)
    bpy.utils.register_class(UpdatedSettings)
    bpy.utils.register_class(AAA_PT_Demo)
    bpy.types.Scene.mysettings = PointerProperty(type=MySettings)

def unregister():
    bpy.utils.unregister_class(MySettings)
    bpy.utils.unregister_class(UpdatedSettings)
    bpy.utils.unregister_class(AAA_PT_Demo)
    del bpy.types.Scene.mysettings

if __name__ == "__main__":
    register()

Useful resources I found on the way:

How to create PropertyGroup (original doc):
How to create and access PropertyGroup (discussion)
Changing default value of IntProperty

I ended up dynamically creating + registering a class and then reassigning it back to the same mysettings property. It works in this POC, but I have to try it in the real addon. Feel free to suggest any other solutions or make edits to this one.
import bpy
from bpy.props import PointerProperty
from bpy.types import PropertyGroup, Panel

myproperties = [
    {
        "type": "bool",
        "name": "mybool",
        "attributes": {
            "name": "On Check Update Default"
        }
    },
    {
        "type": "int",
        "name": "myint",
        "attributes": {
            "name": "My Int",
            "default": 999
        }
    }
]

def update_default_value(self, context):
    dattributes = {}
    for property in myproperties:
        propType = property["type"]
        propName = property["name"]
        if propType == "bool":
            dattributes[propName] = (bpy.props.BoolProperty, property["attributes"])
        elif propType == "int":
            dattributes[propName] = (bpy.props.IntProperty, property["attributes"])

    DynamicClass = type('DynamicClassName', (PropertyGroup,), {'__annotations__': dattributes})
    bpy.utils.register_class(DynamicClass)
    bpy.types.Scene.mysettings = PointerProperty(type=DynamicClass)

class AAA_PT_Demo(Panel):
    bl_space_type = "VIEW_3D"
    bl_context = "objectmode"
    bl_region_type = "UI"
    bl_label = "My Demo"
    bl_category = "Demo"

    def draw(self, context):
        settings = context.scene.mysettings
        layout = self.layout
        layout.prop(settings, 'mybool')
        layout.prop(settings, 'myint')

class MySettings(PropertyGroup):
    mybool : bpy.props.BoolProperty(
        name = "On Check Update Default",
        default = True,
        update = update_default_value
        )

    myint : bpy.props.IntProperty(
        name = "My Int",
        step = 5,
        default = 10,
        )

def register():
    bpy.utils.register_class(MySettings)
    bpy.utils.register_class(AAA_PT_Demo)
    bpy.types.Scene.mysettings = PointerProperty(type=MySettings)

def unregister():
    bpy.utils.unregister_class(MySettings)
    bpy.utils.unregister_class(AAA_PT_Demo)
    bpy.utils.unregister_class(DinamicClass) # yet not sure how to unregister dynamic class
    del bpy.types.Scene.mysettings

if __name__ == "__main__":
    register()

Again, along the way I found some really useful articles:

Blender 2.8 field property declaration and dynamic class creation (Stack Overflow)
Dynamic Blender property creation by Kenton Hamaluik

Use a setter getter
Instead of setting the default of the property, emulate a property with a getter setter that retrieves the custom property when set, else some default we have set.
Internal "get/set" function of property?
As an example have added another intproperty in same prop group as a means to adjust the default value without any re-registering trickery.. which can turn ugly and strip the RNA if it gets out of sync.

Demo gif, changing setting of default is matched by myint till set
While myint has not been set it is given the default value. Once it is set it uses the value set.
import bpy
from bpy.props import PointerProperty
from bpy.types import PropertyGroup, Panel

class AAA_PT_Demo(Panel):
    bl_space_type = "VIEW_3D"
    bl_context = "objectmode"
    bl_region_type = "UI"
    bl_label = "My Demo"
    bl_category = "Demo"

    def draw(self, context):
        settings = context.scene.mysettings
        layout = self.layout
        layout.prop(settings, 'default')
        layout.prop(settings, 'myint')

class MySettings(PropertyGroup):
    def get_myint(self):
        return self.get("myint", self.default)

    def set_myint(self, value):
        self["myint"] = value

    default : bpy.props.IntProperty(
        name = "My Int Default",
        step = 5,
        default = 44
        )
    myint : bpy.props.IntProperty(
        name = "My Int",
        step = 5,
        get=get_myint,
        set=set_myint,
        )

classes = (MySettings,
           AAA_PT_Demo,
           )

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.mysettings = PointerProperty(type=MySettings)

def unregister():
    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)
    del bpy.types.Scene.mysettings

if __name__ == "__main__":
    register()

Other possiblilties are storing the default properties on another "toolsettings" prop group, or instead of using an annotated property def, simply declare a class variable default = 44 in the prop group and grab it from the class.

Unfortunately, this doesn't solve exact issue I am tackling. I need the default to be explicitly set to the property so it can be reset using hover on property + backspace or my operator that resets values to default.

Also, I cannot see how moving default properties to another prop group would work for the same reason mentioned above. To give a better Idea of exact usecase: user selects preset (an update fn is being triggered) and new preset values are to be set as new default values.


text:
How to bake sound to an existing fcurve at key frame in Blender headless mode?
I try to bake a sound to fcurve in headless mode.
I wrote some code which is quite close to.
    import bpy
    # Import the operator
    from bpy.ops import sound

    def switch_blender_area_OLD(area_type):
        areas  = [area for area in bpy.context.window.screen.areas if area.type == area_type]
        bpy.context.area.ui_type = area_type
        print("area_type", area_type)

    def switch_blender_area(area_type):
        # Iterate through the areas of the current screen and set the active area based on its type
        for area in bpy.context.screen.areas:
            if area.type == area_type:
                bpy.context.area = area

    def hex_to_rgb( hex_value ):
        b = (hex_value & 0xFF) / 255.0
        g = ((hex_value >> 8) & 0xFF) / 255.0
        r = ((hex_value >> 16) & 0xFF) / 255.0
        return r, g, b, 1

    def setup_audio_visualisation_color(material_name, color_ramp_name, color_index, hex_color):
        bpy.data.materials[material_name].node_tree.nodes[color_ramp_name].color_ramp.elements[color_index].color = hex_to_rgb(hex_color)

    def reset_audio():
        # Remove all strips from the sequence editor
        for strip in bpy.context.scene.sequence_editor.sequences:
            bpy.context.scene.sequence_editor.sequences.remove(strip)

        # Add a new sound strip using the name of the sound
        bpy.context.scene.sequence_editor.sequences.new_sound(
            name = sound_name,
            filepath = audio_wav_filename,
            relative_path = False,
            frame_start = 1,
            channel = 1
        )

        # Set the end frame of the scene to the final frame of the sound strip
        for strip in bpy.context.scene.sequence_editor.sequences:
            bpy.context.scene.frame_end = strip.frame_final_end
            print(strip.frame_final_end, "frames")

    def setup_audio_visualisation_scene(audio_visualization_host_object_name, audio_visualization_modifier_name, audio_visualization_modifier_input_parametername, audio_wav_filename):
        # Get the host object and select it
        host_object = bpy.data.objects[audio_visualization_host_object_name]
        host_object.select_set(True)

        # Set the current frame to 1
        bpy.context.scene.frame_current = 1

        # Create a new action
        action = bpy.data.actions.new(name="AV")

        # Clear the animation data for the host object
        host_object.animation_data_clear()

        # Create an animation data object for the host object and link it to the action
        host_object.animation_data_create()
        host_object.animation_data.action = action

        # Create a new f-curve for the host object and set the initial value
        fcurve = host_object.animation_data.action.fcurves.new(
            data_path = 'modifiers["' + audio_visualization_modifier_name + '"]["' + audio_visualization_modifier_input_parametername + '"]',
            index = 0
        )
        fcurve.keyframe_points.insert(1, 1.0)

        # Select and activate the f-curve
        fcurve.select = True
        # fcurve.active = True

        # Bake the sound to the f-curve
        ##### bpy.ops.graph.sound_bake(filepath=audio_wav_filename)

        reset_audio()

    setup_audio_visualisation_scene(
        audio_visualization_host_object_name = "Cube",
        audio_visualization_modifier_name = "AV",
        audio_visualization_modifier_input_parametername = "Input_4",
        audio_wav_filename = "C:\\Users\\steph\\Desktop\\test_tone.wav"
        #audio_wav_filename = "C:\\Users\\steph\\Desktop\\demo_mastered.wav"
    )

bpy.ops.graph.sound_bake(filepath=audio_wav_filename) is not possible in headless mode since I need to switch the context aka area.
So I thought about to implement it by myself like this prototype.
class AmplitudeAnalyzer:
    def __init__(self, audio_wav_filename, lowest_frequency=0, highest_frequency=100000, attack_time=0.005, release_time=0.2, threshold=0.1):
        self.audio_wav_filename = audio_wav_filename
        self.lowest_frequency = lowest_frequency
        self.highest_frequency = highest_frequency
        self.attack_time = attack_time
        self.release_time = release_time
        self.threshold = threshold

        self.audio_file = None
        self.audio_data = None
        self.num_channels = None
        self.frame_rate = None
        self.frame_length = None
        self.num_frames = None
        self.amplitudes = None

        # Open the audio file
        with wave.open(self.audio_wav_filename, 'rb') as self.audio_file:
            # Read the audio data from the file
            audio_data = self.audio_file.readframes(self.audio_file.getnframes())

            # Get the number of channels in the audio data
            self.num_channels = self.audio_file.getnchannels()

        # Convert the audio data to a NumPy array
        self.audio_data = np.frombuffer(audio_data, dtype=np.int16)

        # Calculate the frame rate of the audio data
        self.frame_rate = self.audio_file.getframerate()

        # Calculate the length of each frame in seconds
        self.frame_length = 1 / self.frame_rate

        # Calculate the number of frames in the audio data
        self.num_frames = len(self.audio_data) // self.num_channels

        # Initialize an array to hold the amplitudes for each frame
        self.amplitudes = np.zeros(self.num_frames)

    def get_num_frames_to_display(self, scene_frame_rate):
        # Calculate the length of the audio data in seconds
        audio_length_seconds = self.num_frames / self.frame_rate

        # Calculate the number of frames needed to display the complete waveform
        num_frames_to_display = int(audio_length_seconds * scene_frame_rate)

        return num_frames_to_display

    def get_amplitude_at_video_frame(self, video_frame_position):
        # Get the number of frames to display in the scene
        num_frames_to_display = self.get_num_frames_to_display(bpy.context.scene.render.fps)

        # Calculate the length of each frame in seconds
        frame_length = 1 / self.frame_rate

        # Calculate the index of the frame that corresponds to the given video frame position
        frame_index = int(len(self.amplitudes) / num_frames_to_display * video_frame_position)

        if (video_frame_position == 0 or video_frame_position == num_frames_to_display):
            return 0
        else:
            # Check if the frame index is within the bounds of the amplitudes array
            if frame_index >= 0 and frame_index < len(self.amplitudes):
                # If the index is within bounds, return the corresponding amplitude value
                return self.amplitudes[frame_index]
            else:
                # If the index is out of bounds, return zero
                return 0

    def get_frame_data(self, i):
        # Calculate the start and end times for this frame
        frame_start_time = i * self.frame_length
        frame_end_time = frame_start_time + self.frame_length

        # Calculate the attack and release time for this frame in samples
        attack_samples = int(self.attack_time * self.frame_rate)
        release_samples = int(self.release_time * self.frame_rate)

        # Calculate the start and end indices for this frame in the audio data array
        frame_start_index = int(frame_start_time * self.frame_rate)
        frame_end_index = int(frame_end_time * self.frame_rate)

        return frame_start_time, frame_end_time, attack_samples, release_samples, frame_start_index, frame_end_index

    def build_amplitude_array(self):
        # Initialize an array to hold the amplitudes for each frame
        self.amplitudes = np.zeros(self.num_frames)

        # Loop through the audio data and populate the amplitudes array
        for i in range(self.num_frames):
            # Get the start and end times, attack and release samples, and start and end indices for this frame
            t1, t2, a, r, idx1, idx2 = self.get_frame_data(i)

            # Make a copy of the audio data array and convert it to a floating point array
            frame_amplitudes = self.audio_data[idx1:idx2].astype(np.float64)

            # Check if the length of the frame amplitudes array is zero
            if len(frame_amplitudes) == 0:
                # If the length is zero, set the corresponding entry in the amplitudes array to zero
                self.amplitudes[i] = 0
            else:
                # Calculate the envelope for this frame
                if i == 0:
                    # Calculate the attack coefficients for the first frame
                    attack_coeff = np.linspace(0, 1, a)
                    attack = attack_coeff[:a]
                    env = attack
                elif i == self.num_frames - 1:
                    # Calculate the release coefficients for the last frame
                    release_coeff = np.linspace(1, 0, r)
                    release = release_coeff[r:]
                    env = release
                else:
                    # Calculate the attack and release coefficients for all other frames
                    attack_coeff = np.linspace(0, 1, a)
                    attack = attack_coeff[:a]
                    release_coeff = np.linspace(1, 0, r)
                    release = release_coeff[r:]

                    # Calculate the length of the middle section of the envelope
                    middle_length = idx2 - idx1 - a - r

                    # Check if the length of the middle section is non-negative
                    if middle_length < 0:
                        # If the length is negative, set it to zero
                        middle_length = 0

                    # Concatenate the attack, middle, and release sections of the envelope
                    env = np.concatenate((attack, np.ones(middle_length), release))

                # Resize the frame amplitudes array to match the length of the envelope array
                frame_amplitudes = np.resize(frame_amplitudes, len(env))

                # Multiply the audio data array and the envelope array element-wise
                frame_amplitudes = frame_amplitudes * env

                # Calculate the RMS value of the envelope-weighted audio data
                rms = np.sqrt(np.mean(frame_amplitudes**2))

                # Store the RMS value in the amplitudes array
                self.amplitudes[i] = rms

        amplitude_analyzer = AmplitudeAnalyzer(
            audio_wav_filename=audio_wav_filename
        )
        amplitude_analyzer.build_amplitude_array()

        # Set the end frame of the current scene to the length of the audio file
        num_frames_to_display = amplitude_analyzer.get_num_frames_to_display(bpy.context.scene.render.fps)
        bpy.context.scene.frame_end = num_frames_to_display

        # Iterate over the audio samples
        for frame in range(num_frames_to_display + 1):
            if frame % 4 == 0:
                # Calculate the current frame number based on the audio's frame rate
                amp = amplitude_analyzer.get_amplitude_at_video_frame(frame)
                # Insert a keyframe at the current frame number using the sample value
                fcurve.keyframe_points.insert(frame, value=amp, options={'FAST'})

But without success so far. Pretty difficult to match data from wav file to current scene framerate and I also doubt it is trivial to implement features Blenders GUI provide.

My prototype python code creates these keyframes

but should look like this

Does anyone know a easy simple method to self bake audio data to curve which respects at least frequency filter?

i gotta ask, are the keyframes, the whole sound file? like have you tried expanding the frame limit then trying the code again, bc its weird it doesnt end like it starts

Today i resolved the task with A LOT of math. I cannot delete a bounty question. No answer needed anymore.

Why not answer your own question then?

answer your own question to share the knowledge with others


text:
Why does my render have a gamma value different from the viewport?
Blender seems to be changing the movie clip gamma after rendering. What causes it and how can I fix it?
View Port:

Render:

Here is my .blend file (including 10 frames of the clip).

Could you post a blend so we can examine what's wrong? Try using Blend-exchange. Remember to pack external resources too.

Should I include video clip too?

Yes, but if it's too large (say 10 Mb) you might want to somehow reduce the size (i.e. cut it to only a couple of frames).

Included 10 frames. https://drive.google.com/file/d/0B39l96jiKAYsVDNMWXU3X3c3SVU

I opened your file, made a render, too much exposure.
I went to the compositor, turned on the  "backdrop" functions, everything went OK, even the animation rendering!
Looks like a little bug.

If this really is a repeatable bug, you should submit it to the Bug Tracker. https://developer.blender.org/maniphest/


text:
Issue with Renderman and Blender 2.75
Earlier today, I was able to enable Pixar's Renderman add-on for Blender 2.71. I then decided to update to Blender 2.75, but when I tried re-enabling Renderman, I got this message:
Anyone know why?

Are your Blender and Renderman version based on the same CPU architecture? Is Renderman folder under C:\Program Files\Pixar\RenderManProServer-20.0\ ?

Yes to both. I've noticed that I'm also unable to enable the network renderer and renderfarm.fi

I presume you have RenderMan itself installed, not just the addon?

Yes, it was working fine with Blender 2.71

Have you asked / searched on the PRMan github page, the author of the add-on is still very active and responds to questions promptly.

Please provide System Info.

Renderman module is missing, so I'd suggest moving to the renderman binaries folder and install it again - this should work.

Posted this to Github a couple of hours ago, still in the process of trying to figure this out. I'm running the 64 bit version of Windows 8.1
@poor What module do you mean?

I had the same problem, but when I updated renderman 19 to 20, my problem was solved.


text:
How remove rigify settings from armature
I downloaded one model & instead of usual armature there it's configured via Rigify or something similar. Is there a way to remove all these settings so that only simple armature remains?
I tried to manually clean armature, deleted all constraints & drivers, unlocked all locks that I can found. But armature still doesn't work as it should. Some bones are scaled only along the Y axis, although it seems that they are not locked anywhere. And when I tried to attach clothes, for example, spine, which doesn't scale, that it doesn't react to its bones at all. Therefore, is it possible to somehow completely remove any settings from armature & remove unnecessary bones from all settings & leave only clean armature?
I want to edit model, but all these ready-made settings prevent me from doing it.

Hello could you please share the armature?

Here is that downloaded file with ready armature settings: https://dropmefiles.com/lerT8. Is it possible to somehow remove all these settings & extra bones along with them & leave only standard bones?

I can't download from this site for some reason, could you please use another platform?

Hmm, it's strange that you can't download. The link is working. But OK, here, I uploaded it to another place: https://transfiles.ru/53z7n.

You can see the basic armature (the bones that have the Deform option activated) in the Data panel > Bone Collections > Layer 10:

If you want to remove the custom appearance in Pose mode, go into the Bone panel and click on both Alt and the X on the right of the Custom Object name:

If you want to display the bones as octahedrals, in the Data panel choose Display As > Octahedral:

Yes! It worked! I was just working with the wrong bones. But now after clearing all restrictions & when I connected all bones, everything started working perfectly. I finally got usual armature that I edited without any problems. Thanks a lot for your help!


text:
How make glow in Compositing if emission is behind glass?
Why I can't make glow in Compositing in Cycles if emission is behind glass?
If use Glare, everything in picture will be glow, but I don't need it. I need only certain parts to glow, for example, like here - bulbs in headlights.

why do you want to do this in compositing? isn't it easier to create an emission for the bulb lights and turn "bloom" on?

@Chris, Bloom is for Eevee, not Cycles, it looks like he's working with 2.79

thanks, but yes i know, and how should i know he uses Cycles?

Yes, I want to know how to do this exactly in Cycles.

@Chris, Eevee was not in 2.7, at least it was not installed by default

thanks, did not know that ;)

Related: https://blender.stackexchange.com/questions/68410/light-rays-through-glass

You need to use a trick because alpha is not use for glass transparency so you can't isolate the glass object.
You can fix it in the Compositor with this trick:
Here Jordan Sautron explains how to give an effect to an Emission object behind a glass. It's in french so I try to summarize.

Give a Pass Index to your emission material (Properties > Material > Viewport Display > Settings), for example give 1.
In Properties > View Layers > Passes > Data, activate Indexes > Material Indexes.
In the Compositor, create a Render Layer with the glass, a second one without.
Create a Converter > ID Mask node in front of the second Render Layer node, type the material index of the emitter material (1).
Create a Color > Mix node (Multiply mode). Plug the first Render Layer node in the first socket, plug the ID Mask in the second socket.
Plug the Mix into a Filter > Glare node, put its Mix value at 1.
Plug the Glare into the second socket of a Color > Mix node / Add mode. Plug the first Render Layer in its first socket, put its factor at 1 or more.

Another solution is to fake the glow effect with the Layer Weight node: Create a sphere around your light object and give it a mix of Emission and Transparent nodes, with a Layer Weight as factor:

Of course you can make it a bit more complicated with some noise etc:

You can even give it a Displacement node. In that case don't forget to go into the Properties panel > Material > Settings > Displacement > Displacement Only:

This is useful tutorial. And thanks for translation from french. Only using different layers is not very convenient. Rendering almost the same picture 2 times is long, especially for animations. But I suppose that can transfer objects with Emission to another layer & render it instead of the whole picture without glass. It will be much faster this way & I think result will be the same.

if you don't care about too much realism you have tricks to create this kind of effects like for example create a sphere with transparency and emission mixed into a mix shader with a layer weight as factor, please tell me if you want me to show you

Yes please, show me what you mean if possible.

ok I've edited, I'll show what it gives with a bit of noise...

It looks impressive. I think I'll find application for this. Thanks for all.

This (first) solution will not take into account deformation of light created by the glass right? For instance if you are trying to make this picture glow, you would glow along the original picture right?

hello, it's a long time ago, I guess you're right

As an alternative to blur, use a glare node. It will give you finer control since the effect is based on a threshold, to effect the picture based on the brightness of the pixels.

Read:
Any way to control light halos in the compositor based on emission level?
Also, the default glass shader will not work correctly for a light that is behind glass.
Try something like this:

Read: How to illuminate the darkness inside glass objects in Cycles?

If you must use glow, you can use a pass index to determine what gets blurred.

For complete instructions on how to set this up read:
One part of the render layer glowing?

Thanks for detailed explanation of how Glare node works. But ID mask for Glare also doesn't work if Emission is behind Glass. I need to use ID mask to set strength, shape & glow for each light bulb separately. Simply using Glare won't give the desired result.

If your emission has a very specific color which is not found elsewhere in the picture, you can also easily solve it by just chroma-keying/color-keying it to get your original mask:

(Here I use several "glare" masks to have a stronger effect, but I guess you could use a Gaussian or any other kind of glare)


text:
How to adjust texture coordinates with a distortion texture?
For a turbulent fluid texture I'm working on, I need to distort texture coordinates in a repeated, step-wise fashion, so this seems like a job for OSL. Specifically, I need to offset each point in a texture by a small amount based on the value in a noisy color texture that represents a velocity field (r=vx, g=vy, b=vz=0).
In the illustration below, I've used small arrows to represent the velocity field rather than the RGB texture I'll actually use. Each blue dot represents a starting point to trace the velocity field. Each blue curve represents a path that is consistent with the local velocity field at each point along the way.

However, the examples I have found here and on other sites offset texture coordinates globally (the same offset or scale applied to the entire texture).
I'm looking for a method to distort texture coordinates non-uniformly in small repeated increments to follow the velocity field similar to the blue curves in the illustration above. I will use the resulting coordinate map to warp a simple color texture.
I can imagine this effect could be achieved with a Particle System and a Turbulence Force Field, but (1) I can't imagine how I would fill the entire surface with color without using an enormous number of overlapping particles and (2) I can't figure out how to constrain the particles to the surface of an arbitrary mesh.
I opted for OSL because I hoped to generate a distorted coordinate system for every point in the texture and let the renderer sample the texture appropriately.

No need for OSL, just use a Converter > Vector Math node.

The above node setup uses the image texture on the left to offset the UV (or any other) texture coordinates by adding the distortion map pixel values to the mapping vectors (RGB is automatically converted to XYZ).

If you want a little more control over the distortion strength  and directionn you can add a Separate RGB and Combine XYZ node and use some math nodes in-between.

With the above node setup you can adjust the strength for each direction independantly, if you want the same strength in all directions and don't want to have to play with 3 different values you can plug an Input > Value node into all 3 math nodes.

If you want to do this in texture nodes (instead of material nodes) you'll use the Distort/At node type.

The important issue is that I need to repeat the distortion in small steps to follow the velocity field. I know of no way to do this with just a set of Nodes. I'll edit my question to make this clearer.

@MutantBob  Texture nodes don't work in Cycles.

@astrogeek  I guess I don't really know what you mean by "small repeated steps".  Could you maybe add a picture or something explaining that a little further?

@PGmath , I did not know that.

@PGmath, for the illustration I've added above I faked a velocity field with a turbulence force field and object duplicates & added blue curves to show how the coordinates should trace the velocity field.
I should also add that the effect I'm trying to achieve is the turbulent swirl in a gas giant atmosphere. I'm following the method described in this slideshow:
http://smcameron.github.io/space-nerds-in-space/gaseous-giganticus-slides/slideshow.html#1
My goal is to create animated textures for videos to be used in my astronomy classroom and in our college planetarium.

@PGmath I feel so foolish, I cannot find the Distortion Map node!!!  Where do i find it, pleas?

@WishyQ  It's just an image texture node, you can rename any node in the right-hand toolbar.

I wonder if the fundamental problem is that he wants the distortions to ACCUMULATE OVER TIME.

authors: Владимир Акимов


text:
Advance - Check material, count them and export to CSV file
Topic starts here, so check it if you need more information about subject:
How to print material names (two materials) for selected object

Main Problem
I need generate list of selected object which will print: name of object, name material 1st index + 2nd index material will be checked on sides (this will be always cube).
Goal is to try make list like this:
#side on 1 dimension is checked with materialside - so max is 2 sides print = 2 (or 1)
#if is none - print = 0
#side on 2 dimension is checked with materialside - so max is 2 sides print = 2 (or 1)
#if is none - print = 0

Model; Material; Edges1Dimension(e.g. width); Edges2Dimesion(e.g. length)
Cube.001; Material 1; 2; 2
Cube.003; Material 2; 2; 0

Explain:

Cube.001 - object name
Material 1 - 1st index material of that selected object
2, 2 - numbers of faces which is assigned material with 2nd index of that selected object. (for cube i define as: 2 fronts, and 4 sides [2 for dimiension x axis, and 2 for dimension  y axis] )

Example file:

Link to file presented up (1 week acces to download from now):
https://we.tl/t-kbbkSjJlpg
Imported part for me is that could be translated into CSV (and open that file by Excel)- i have already list with dimension and  names - now i want to add this next step.
Thank you for your time - best regards!

Once again, I shall give you a slight variation on your request, and leave the final adaptation as an exercise.
Here is code that prints the information you want, but not in precisely the format you want.
import bpy

mesh_objs = [ob for ob in bpy.context.selected_objects if ob.type == 'MESH']

def polys(mesh, index):
    n = 0
    for p in mesh.data.polygons:
        if p.material_index == index:
            n += 1
    return n

for mesh in mesh_objs:
    print(mesh.name, end = "; ")
    for index, slot in enumerate(mesh.material_slots):
        print(f"{slot.name}; {polys(mesh, index)}", end = "; ")
    print()

and here is a print out from your test file:
Cube.001;  Material 1 White; 2; Material Edge; 4;
Cube.002;  Material 1 White; 2; Material Edge; 4;
Cube;  Material 1 White; 4; Material Edge; 2;
Cube 1.001;  Material 1 White; 2; Material Edge; 4;
Cube 1.002;  Material 3 Red; 2; Material Edge; 4;
Cube 1;  Material 3 Red; 4; Material Edge; 2;
Cube 2;  Material 2 Green; 2; Material Edge; 4;
Cube 2.001;  Material 1 White; 2; Material Edge; 4;
Cube 2.002;  Material 1 White; 4; Material Edge; 2;
Cube Rotate;  Material 2 Green; 2; Material Edge; 4;
Cube Rotate.001;  Material 3 Red; 2; Material Edge; 4;
Cube Rotate.002;  Material 1 White; 2; Material Edge; 4;

Thank you! That looks like what i needed! I will try use this in my code and I will let you know if this work for me! Thank you!


text:
How to reduce noises of light reflection on the static object in video?
I am not sure what is this problem called. There are many noises of light reflection on the ground. They are different between frames. How do I reduce it? Or how to make it more realistic?
Can texture baking help? I know there are tutorial on this topic but I am not sure if it is relevant.

My settings:

please check an answer as correct (click on checkmark left to the answer) if it helped you

128 samples on this setup is spreading it quite thin. The new default sample count is high for a reason: more samples means less noise, and with a better Cycles engine, shorter times for samples means we can afford more of them. Set the count to at least 512.

I am rendering thousands of frames and it takes too long to render on my 3060. Other solutions?

there is no other solution, maybe a different rendering engine instead of cycles, cycles simply needs more samples and that's it... In still render you don't need too much samples, but for video like this it is simply needed

@MikoCG that's not necessarily true.  There are several things you can do with cycles to improve noise without increasing samples, depending on what the source of the noise is.

I would disable the render denoiser, add a denoiser pass, and use the compositing denoiser.  It seems to do a better job.
Disable the render denoiser in Render Properties of the properties editor:

Enable the Denoiser Data pass in the View Layer Properties of the properties editor:

Here's a staring point for a denoiser pass in the Compositor:


text:
How do I move parent bone, without the child bone following its location?
I am having trouble animating a weapon because I want to animate the magazine of the weapon, but I also want to animate the weapon itself too, but since the magazine is a child of the weapon bone it will always follow its location and it will look weird when I try to animate both of them, so is there a fix to this? (I am trying to avoid unparenting the objects if possible)

You don't.  The whole point of parenting is that the children move with the parent.  But, if you don't connect the child bone to the parent bone then you can move the child after you've moved the parent:

If you really want the child to only sometimes be a child, instead of parenting it, give it a Child Of constraint.  You can then set the influence to 0 when you want the child to be completely independent of the parent and 1 when you want it to move with the parent:

You add a Bone constraint by selecting the bone in Pose mode and going to the Bone Constraint Properties tab of the Properties editor.