text:
How to assign a different material attributes to different geometry nodes instance
I designed a parametric wall with windows in geometry nodes. I can change the width, height, window count etc.
Now, I am trying to assign differnet parts of a material node tree to certain parts of the geometry node tree. (For example I would like to define the borders, shown in the image below, sepeterately for the different parts of the wall so they all have the same distance from the edges.)

I could maybe somehow do it by recreating all the calculations from the geometry node tree in the shader nodes. But that seems rather laborious.
I tried doing it by assigning attributes in geometry nodes and referencing them in the shader as suggested in this post:
How to assign a different material color to each geometry nodes instance
But by using the realize instance node, I loose the texture object coordinates per instance, which I rely upon for defining the borders. Is there any way of transferring attributes without the realize instance node? Or alternatively to keep the per instance texture object coordinates?
Thanks in advance,
Ollie

I know this is an old question but I ran into this same issue and found an easy fix to keeping your object coordinates despite realizing instances. All you have to do is store the position of your instanced object as an attribute before instancing, then use that attribute in the shader. You can also store a named attribute for each instance so you can tell them apart later in the shader.
In geonodes:

In the shader:

In 3.4+ it works even without realizing instances - Just change Attribute: Type to Instancer.

Yeah but I needed to realize them anyway in order to apply deformations/material variations to each instance.

You cannot assign different materials to the instances after the instantiation, because all instances are of one and the same object.
But you can set a switch before the instantiation, and achieve a different assignment of the materials with something like shown here.

Update:
If the above example does not help you, then you should use Blender 3.2. In this version your UVMaps will be preserved even after applying the node Realize Instances.

Thank you for your answer. I need to assign different parts (of the node tree) of just one material.

As far as I know, this is currently not possible. Once instantiated, objects can only be assigned to one material, and also the transfer of attributes to individual instances does not currently work in Blender as one would wish.

https://blender.stackexchange.com/questions/253723/is-where-a-way-to-pass-data-to-material-without-realizing-instances


text:
How to use Convex Hull on Geometry from collection info?
Whenever I use the Group Input node as a geometry source, the convex hull node will wrap around the geometry as a -whole-. However, using the collection info node as the source geometry makes the convex hull wrap around -each- mesh. How can I use collection info and convex hull together so that it wraps around the geometry as a whole?
Group Input as a source (wraps geometry as whole)

Collection Info as a source (wraps individual objects)

Realize instances.

Realize your instances before passing them to the Convex Hull node.

source: Stack Exchange

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

sort: votes


text:
Why do duplicate bone names in seperate armatures cause problem when animating for one action
I have two armatures that have the same name for their root bone; ROOT. When I try to animate both armatures at the same time in Pose Mode, animating one ROOT bone of an armature will apply the same animation to the ROOT bone of the other armature. It doesn't look like it at first, but once you move the timeline cursor it then "processes" and the other bone will copy the translation of this bone. The quick and easy fix is simply to name them ROOT and ROOT.001. Is this intentional?

the action needs to be played in order to make the bone move, as long as the action is not played, the bone doesn't move. That said I don't understand what you mean by the way to fix is simply to rename, if you rename the bone, the bone that shared the same name in the other armature won't be animated anymore, as the keyframes of the action are attached to bones...

I meant that the issue specifically is that I cannot have two bones in two separate armatures be named the same, as if I animate one bone, the other bone will be animated as well, which I don't want

yes exactly, you can't, you need to either change the bone name, or duplicate the action so that it is not the same

Wait, so what if I have two seperate armatures that are humans. They both have a head so I would name the head bone like DEF_Head.001. Is the other armature just supposed to be called DEF_Head.002? What if I imported 2 characters that happen to have the same bone name? Would I have to make sure the characters don't have matching bones before I start animating? Also, thank you for replying

they can have the same bone name, what I say is that if you want to give the same action to armature2, you need to make sure that it has the same bone names as armature1, otherwise armature2 won't move

let's say you have armature1 with action1 and you've made action1 move a bone called headbone. If you give action1 to armature2, if action1 finds a bone called headbone in armature2, it will make it move, otherwise nothing will happen. But if 2 armatures have the same bone names but don't share the same action, they will move differently.

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


text:
Does the Video Sequencer have any kind of comment strip?
Almost like in code, you can write comments that are valuable for readibility but also are not included in the final compile. Markers wouldn't be sufficient, I'm thinking of paragraphs that can be placed in certain parts of the timeline. My idea is that I can write the script there and read off of it for the audio component. Thanks

You can just use Text strips placed in the same channel, have the channel enabled with reading and recording the audio, and then disable the channel when exporting the video. Afterwards you can, in the View menu, find the option to export them as subtitles - which might be useful if you're exporting to ex. YouTube.

Thank you, but is there anything that could be visible directly in the sequencer graph though? Only a certain amount of text can be visible on a strip in the graph. My idea is that I can get a big overview of all of the text in the graph, as far as writing the script itself within the graph. Is that too much to ask?

Using subtitles will accomplish your "paragraphs placed in certain parts of the timeline" goal. There are Add-On options[0] for working with .srt and other subtitle formats. This also works for your Voice Over scripting goal and gets you closer to making your videos accessible.
Making your notes visible directly in the sequencer vs Properties might need configuration or reconsideration.
[0] Subsimport, e.g.


text:
My renedered image is completely blacked out
When I try to render my scene, everything blacks out. Another weird thing is even if I set the scene camera to active 'Camera', it just switches to 'Plane' when I press numpad 0.
Just to save your time, I have tried all of the following 6 solutions, and none of them were the case.
https://gachokistudios.com/why-a-blender-render-result-is-completely-blank-or-black-and-how-to-fix-it/
You can download my .blend file from the following link. No textures have been used, so you should be able to open it just as it is. I would very much appreciate your help. Thank you so much in advance.
https://file.io/09hpX1ExkP0m

Hi :). Please upload your file at https://pasteall.org/blend/, the linked file was deleted ;)

I'm sorry the file wasn't avialable anymore. The problem was solved after a bit, but I still appreciate your trouble and time!

Sometimes through an accidentally pressed shortcut (Ctrl + Num0), you can set a (non-camera) object as the active camera (causing that object to be selected when using the camera shortcut - Num0). If this happens, select your camera in the outliner, and make it the active camera again:

Thank you so much! I guess it's those small things that can get you stucked sometimes. Learned a great lesson.

Yeah - It happened to me back when I was first learning blender... I thought I was losing my mind


text:
Rendered animation cropped in unintended way
I am relatively new to blender, and have done only a several renders.
The following link takes you to my insta post with the video. I did select render region to speed up the render time, but as you can see, certain areas disappear or gets cropped as the camera moves.
https://www.instagram.com/tv/CboDKg2Bc2p/?utm_medium=copy_link
Is there any solution to this? Even a wild guess would mean a lot to me. Thanks in advance.

have you checked the camera or scene clipping values?

Thanks for your quick response! I might have tweaked the settings without knowing what I'm doing along the way. I will look it up. Thanks again.

Check the N panel > View > View > Clip Start and Clip End, and also select the camera and in the Camera panel > Lens > Clip Start and Clip End. I'm not sure this is your problem though...

It does look like an end clipping issue, but the clipping settings to change for final render are on the camera, panel Lens, make the clip End bigger and leave clip Start as it is.

It seems the Clip End was set to 100m, and apparently my scene was larger than that. There is no way I could figure it out without asking you guys. Thank you so much...

Check the N panel > View > View > Clip Start and Clip End, and also select the camera and in the Camera panel > Lens > Clip Start and Clip End.


text:
Is it possible to loop particles on curve
i was wondering. Is it possible to loop paticles moving on a curve path? And if it is, is there a way to loop them after they reach the end of the path so their movement on the curve can be saved in the animation.

Sorry, just to clarify - by "loop" do you mean repeat? Do you want the particles to move along a curve, then "jump" back to the beginning and do it again - OR - Do you want particles to move in a certain, repeating (looping) pattern, as they move along a curve?

@ChristopherBennett Here is a link to the animation - https://drive.google.com/file/d/18pBXsBeHmo6pkVTr8YYZadBYP2VDBnL2/view?usp=sharing I want the particles on the 2 curves coming from the sides to be able to move on repeating loop pattern, so the animation can be used in a web site and not glich when repeating itself. I want to save the movement of them coming on the screen and then loop the second part of the video when they are fully shown on the screen

This can be done with geometry nodes.
The points are placed randomly along the curve and an offset is added for each new frame. The offset should be 1/(total number of frame). The result modulus 1 will be a repeating pattern.
Here's a quick sketch up. Create a curve and add a geometry node like this:
https://i.sstatic.net/upYRS.png


text:
I can no longer get smooth playback in video editor after 3.1 update. Anyway to fix this?
Hi I recently downloaded Blender 3.1 and I'm now having problems with the video editor.  I know 3.1 has a feature that automatically creates a proxy but since I'm used creating it on my own I changed the setting in system preferences: proxy setup to manual.  Anyway after the proxy is done rebuilding  I can scrub through it without audio fine until I try to play the video in normal time.  It will play in normal time after chugging a bit but after that I can't scrub through it smoothly anymore.  I've found a partial fix that if under playback I change the sync to frame dropping or play every frame I can now scrub smoothly again but I would really like to be able to use sync to audio and scrub smoothly like I could before I updated.  I previously had an older version of blender (2.8 or so I believe)  If anyone could help me I'd appreciate it!

Does it help if you turn off the audio waveform? I don't think it gets baked down to proxy but it does cache and may fill up ram?

The audio strip doesn't have the waveform on it.  I tried adding it but it didn't make a difference.

I found a solution to my problem.  I highlight the audio strip and then on the right select the strip tab and then click on source and then check the caching box.  This loads the audio into ram and allows me to scrub smoothly again.

I noticed that when I load gopro footage I don't have this problem.  It only happens with gaming footage I recorded with OBS.

OBS can record at variable frame rates. Blender does not like this. You'd find that it plays better after transcoding to a regular frame rate. Also the Codec might be to heavy for Blender to play back easily.


text:
Shadow Detached from Object
I'm very new to Blender. After creating this chair, I added a flat plain for the ground and have confirmed the my chair is snapped to the ground plain. When I added a light, I noticed the shadows are detached from the chair legs, as if it were hovering above the ground. Any idea what may be causing this?

Select the light you're using to light the scene, click the lightbulb on the properties panel, and go down to where it says "Shadow". Under that section, check the box that says "contact shadows"

Thank you Christopher. Well, it seems so obvious now. LOL


text:
Render Preview Issue - Looks like UV's are not unwrapped
This is the first time I've experienced this and it occurs in both Blender 2.93.8 and 3.0.1. I've created a procedural texture on this building (which is UV unwrapped). It looks correct in the Material Preview, Rendered in Eeevee and also Rendered in Cycles but when I try to view it in the Render Preview, the texture looks like it's applied to an object that is not UV unwrapped.
Eeevee Render

Cycles Render

Render Preview

Hi :). Looks like displacement only enabled in viewport. Disable displacement and double-check subdiv modifiers ;). That should narrow it down.

Jachym, I'm not sure where to disable "displacement only" in the viewport. My viewport is set to combined if that's what you mean? I disabled my displacement modifier and I'm not suing any subdiv mods. Same result. This particular material is procedural. I have two materials in other objects, created in Substance Painter and they look fine if that helps narrow down the issue.

Hi :). Sorry for not being clear. Does your material have a displacement? Does turning it off change things in any way? Because the walls/windows are visibly displaced.

You can also share parts of your file so others can take a look: https://pasteall.org/blend/

Jachym, the siding has a displacement modifier on it. Turning it off does not change the result. I'm not using a displacement in the material node setup, only a normal map. I'll see if I can simplify my file for upload.

Answer: I had a Boolean object used to trim the wood siding for the roof line. That object's visibility was set to on in the viewport but off in the render. I figured it out while prepping the file for upload, so thank you Jachym.


text:
Blender 2.9 Cycles: Render issue with Alpha Masked Leaves on Trees
I recently purchased some tree models from Globe Plants specifically for Blender Cycles Render. I'm hoping to get a response from them directly but thought I'd ask if anyone else knew what was happening. Some of the models I've purchased from them look great but the Trees are having alpha issues with the leaves. In most cases, the leaves are transparent and the black alpha portion of the material is visible. It's even worse when back lit. Screen shots of the trees, nodes and display settings are attached. I've tried changing the material settings from Opaque to Alpha Clip but that doesn't seem to be the issue.
enter image description here

Does this answer your question? Black artifacts when looking through many transparent objects?

Increase the number of transparent (or transission) bounces

https://blender.stackexchange.com/questions/112449/stacking-multiple-alpha-planes?noredirect=1&lq=1

I do not believe it's an issue with Light Paths. I increased both Transparent & Transmission to 20 with no difference in render. Also, I have Bushes and other plants with multiple leaves that look fine. The material node setup appears to be the same as the trees but it's only the tree models that have the issue.

Susu that is not the problem. I just rendered with both set to 1024, the max. Absolutely no change. I should also mention that the bush objects that look perfect in final render, with many many leaves in front of one another also look perfect in the viewport shading render mode. The trees look the same in both as well but look as shown above. Leaves that are not layered in front of other leaves are transparent. The ones where the leaves are visible are backed by other leaves but in both cases, you still see the black alpha channel.


text:
undo action is causing blender to crash when changing position value in a custom Panel
I'll be quick:
I created a panel.
I created a column with a prop: the position vector of a given object.
column = layout.column()
column.prop(MyObject, "location")

I can now play around the position from this custom panel.
HOWEVER: When i change the value anywhere in blender, then hit CTRL+Z, Blender crashes with an error: EXCEPTION_ACCESS_VIOLATION
Here is the full code:
import bpy
import sys
import os
os.system('cls')

###############################################
#### Global Variables ####
AVX_cam = bpy.data.objects['AVX_Camera']

###############################################
#### Operator Classes ####

class Cam_LockView(bpy.types.Operator):
    bl_options = {'UNDO'}
    bl_idname = "cam.lockview"
    bl_label = "Lock AVX Camera"

    def execute(self,context):
        bpy.context.scene.camera = bpy.data.objects['AVX_Camera']
        for area in bpy.context.screen.areas:
            if area.type == 'VIEW_3D':
                for space in area.spaces:
                    if space.type == 'VIEW_3D':
                        space.region_3d.view_perspective = 'CAMERA'
                        space.lock_camera = True
        return {'FINISHED'}

class Cam_UnlockView(bpy.types.Operator):
    bl_options = {'UNDO'}
    bl_idname = "cam.unlockview"
    bl_label = "Unlock AVX Camera"

    def execute(self,context):
        bpy.context.scene.camera = bpy.data.objects['AVX_Camera']
        for area in bpy.context.screen.areas:
            if area.type == 'VIEW_3D':
                for space in area.spaces:
                    if space.type == 'VIEW_3D':
                        space.region_3d.view_perspective = 'PERSP'
                        space.lock_camera = False
        return {'FINISHED'}

###############################################
#### Main Panel ####

class AVX_Panel(bpy.types.Panel):
    """A dedicated panel for AVXcelerate Sensors"""
    bl_label = "AVX Camera"
    bl_idname = "AVX_PT_main_panel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "AVX"

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

        # Lock camera to view
        layout.label(text="AVX Camera:",icon="VIEW_CAMERA")
        row = layout.row()
        row.operator("cam.lockview", text = 'Attach' , icon="LOCKED")
        row.operator("cam.unlockview", text = 'Detach' , icon="UNLOCKED")

        # Position and Orientation
        column = layout.column()

        column.prop(AVX_cam, "location")
        print(column.prop)

###############################################
#### Class (Un)Registration ####
def register():

    bpy.utils.register_class(Cam_LockView)
    bpy.utils.register_class(Cam_UnlockView)
    bpy.utils.register_class(AVX_Panel)

def unregister():
    bpy.utils.unregister_class(Cam_LockView)
    bpy.utils.unregister_class(Cam_UnlockView)
    bpy.utils.unregister_class(AVX_Panel)

if __name__ == "__main__":
    register()
    #subscribe_to_all_rns()

It's driving me crazy not knowing how to fix this issue.

You are using bpy.context in your execute functions.  You should use the context argument that was passed in instead, so replace bpy.context with context everywhere.

@Gorgious how can i set this up in an internal Blender operator? I know i can set this for custom operators, but in my case I'm simply including the location of my object in the panel by using:
layout.row().prop(MyObject, "location")
How can i pass on this argument in the row().prop method?


text:
installing grpcio through pip NOT working
trying to install grpcio and grpcio_tools (v 1.38.0) using pip.
This is what i'm running in the terminal and the output i'm getting
C:\Program Files\Blender Foundation\Blender 3.3\3.3\python\bin>python.exe -m pip install --no-cache-dir grpcio==1.38.0
Collecting grpcio==1.38.0
  Downloading grpcio-1.38.0.tar.gz (21.4 MB)
     ---------------------------------------- 21.4/21.4 MB 54.7 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six>=1.5.2 in c:\program files\blender foundation\blender 3.3\3.3\python\lib\site-packages (from grpcio==1.38.0) (1.16.0)
Building wheels for collected packages: grpcio
  Building wheel for grpcio (setup.py) ... /

It gets stuck building for a while, then it fails (timeout).
I've upgraded pip, setuptools, made sure everything is coherent and dependencies are OK.
I forced installation (no cache).
I tried to install other versions, nada.
i'm running the default python that comes with blender 3.3 (3.10.2 to be exact).
Tried uninstalling blender (and deleting the python directories since they're not removed by default), reinstalling blender (and python by concequence), still nothing.
would appreciate the help!
Cheers

i have the same error . i have no way to solve it .

Apparently, this specific version didn't work. Simply pip install grpcio and get the latest version. That's what i did.

i have solved it .

create a new python env by anaconda or pyenv;
pip install grpcio ,it will take some time ;
go back to python and use blender python.exe to install grpcio;
i dont know why ,but it worked.


text:
Why is camera view not visible in layout tab
I have scene like this, and if I press the view camera (numpad 0), it displays an empty screen. Please any idea how to solve it? It works in the shading tab, but not in the layout. In the layout, it works in an empty new project. I am not sure how I broke it.
I tried to modify clip start and end

Hello could you please share your file?

here it is https://www.dropbox.com/scl/fi/iuspqm6bfnt252iqqr7gy/camera-issue.blend?rlkey=bg1yzznxxp1llh9mr4dhdoool&dl=0  I just simplified with cube

Look through the Camera then press Home key or go to View>Cameras>Frame Camera Bounds.  This will solve the issue.

Thank you! It helped :D ... Blender is so great, but sometimes those things are so hard to solve.

I've found a solution in Blenderartists, quit Blender, reopen, and when you open the file, open the options panel and disable Load UI, the problem will be fixed (you could also copy-paste or append from a file to another), but it doesn't explain what happened:

Thank you for the answer, I have not tried it. It was solved by Rumen's solution via View>Cameras>Frame Camera Bounds.

Yes, you're right, still don't know what happened though


text:
Cant find backups of .blend files from months ago
So a couple of months ago I modeled a realistic human model but ended up redoing it in the same file, but looking back I wish I had the version of the model from 3 months ago, but in my autosaves folder, it only shows backups of it made after I had already remade the model. If anyone can help me that would be greatly appreciated!

When there are no other files containing the version you want, I'm not sure what you expect us to do? Travel back in time to restore the files...?

Do you not have a blend1 file in the same folder as the original? - See https://blender.stackexchange.com/questions/298904/how-do-you-undo-save-changes-to-a-project/298906#298906 This will only work if you haven't saved it more than once though assuming you have the default of one backup set.

impossible to recover if u kept overwrite-save it, especially for such a long time.


text:
Crash when running this python script to resize mesh faces
I am trying to automate some fairly tedious model prep steps before exporting a mesh to Unity. It creates 2 extra UV maps with special conditions and then slices and resizes all the mesh faces to very small sizes using the Individual Origins pivot for each face. Unfortunately, the line of code that actually runs the resizing instantly crashes Blender with no error that I can find. I have also tried iterating through the faces to resize them individually instead of all at once.
What am I doing wrong here? I am a novice at python and blender automations but I am bumbling my way through it. The problem is the very last line. Everything else works up until then.
import os

# Get the directory of the current .blend file
current_directory = os.path.dirname(bpy.data.filepath)
export_directory = os.path.join(current_directory, "export")

# Create the export directory if it doesn't exist
os.makedirs(export_directory, exist_ok=True)

# Store the current area type
previous_area_type = bpy.context.area.type

# Activate the UV/Image Editor
bpy.context.area.ui_type = 'UV'

# Loop through all objects in the scene
for obj in bpy.context.scene.objects:
    if obj.type == 'MESH':
        # Remember the active object
        original_object = obj

        # Step 1: Create a second UV map
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.uv_texture_add()

        # Step 2: Default UV unwrap for the second UV map
        bpy.ops.uv.unwrap()

        # Step 3: Reset UVs on the second UV map
        bpy.ops.mesh.select_all(action='SELECT')  # Select all faces/UVs
        bpy.ops.uv.select_all(action='SELECT')
        bpy.ops.uv.reset()
        bpy.context.object.data.uv_layers.active.name = "ResetMap"  # Rename the second UV map

        # Step 4: Create a third UV map
        bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.object.select_all(action='DESELECT')
        original_object.select_set(True)
        bpy.context.view_layer.objects.active = original_object

        # Create a new UV map for the active object
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.mesh.uv_texture_add()
        bpy.ops.object.mode_set(mode='OBJECT')

        # Rename the UV map to "RandomMap"
        original_object.data.uv_layers[-1].name = "RandomMap"

        # Step 5: Lightmap Pack project the UVs on the third UV map
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.uv.lightmap_pack(PREF_CONTEXT='SEL_FACES', PREF_PACK_IN_ONE=True, PREF_NEW_UVLAYER=False, PREF_BOX_DIV=12, PREF_MARGIN_DIV=0.1)

        # Step 6: Switch to UV Editing mode
        bpy.ops.object.mode_set(mode='EDIT')
        bpy.ops.uv.unwrap(method='ANGLE_BASED')  # Angle-based unwrap for the third UV map

       # Step 7: Scale UVs on the third UV map
        bpy.context.area.type = 'IMAGE_EDITOR'
        bpy.ops.uv.select_all(action='SELECT')
        bpy.context.space_data.pivot_point = 'INDIVIDUAL_ORIGINS'
        bpy.ops.transform.resize(value=(0.01, 0.01, 0.01), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=False, use_proportional_edit=True, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False, snap=False, snap_elements={'INCREMENT'}, use_snap_project=False, snap_target='CLOSEST', use_snap_self=True, use_snap_edit=True, use_snap_nonedit=True, use_snap_selectable=False)

        # Step 8: Split the mesh 'Faces by Edges'
        bpy.context.area.ui_type = 'VIEW_3D'
        bpy.ops.mesh.select_all(action='SELECT')
        bpy.ops.mesh.split()
        bpy.context.scene.tool_settings.transform_pivot_point = 'INDIVIDUAL_ORIGINS'
        bpy.ops.transform.resize(value=(0.001, 0.001, 0.001), orient_type='LOCAL')

The culprit is not the last line but bpy.context.area.ui_type = 'VIEW_3D'. You can verify this by running this minimal script
import bpy

for obj in bpy.context.scene.objects:
    if obj.type == 'MESH':
        #bpy.context.area.ui_type = 'VIEW_3D'   # <-- enable for crash
        bpy.ops.transform.resize(value=(0.001, 0.001, 0.001), orient_type='LOCAL')

You need to use the correct context and normally you use some temporary override. Here is how it's done the old way but since some Blender 3.x you get a warning in the system console (but its still working):
DeprecationWarning: Passing in context overrides is deprecated in favor of Context.temp_override(..)

Therefore, try this code for Step 8. Overriding the context avoids the crash and also makes sure that the individual origin option works.
# Step 8: Split the mesh 'Faces by Edges'
bpy.context.area.ui_type = 'VIEW_3D'

area = [area for area in bpy.context.screen.areas if area.type == "VIEW_3D"][0]
region = [region for region in area.regions if region.type == 'WINDOW'][0]

with bpy.context.temp_override(area=area, region=region):
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_mode(type='EDGE')
    bpy.ops.mesh.select_all(action='SELECT')

    bpy.ops.mesh.edge_split()

    bpy.ops.mesh.select_mode(type='FACE')
    bpy.context.scene.tool_settings.transform_pivot_point = 'INDIVIDUAL_ORIGINS'
    bpy.ops.transform.resize(value=(0.001, 0.001, 0.001), orient_type='LOCAL')

Awesome, I will give this a try. I am learning a lot about contexts and how tricky they can be.

the old way of context override will stop working in version 4.0. for more info on context overriding see here


text:
Cycles Hates My Materials
So I have this lovely shield I put together as a first time project in Eevee.

It looks great, I'm excited, but I need to bake it apparently so I can have all those lovely colors on the FBX file or something like it, supposedly. So I do as I'm told and switch over to Cycles to bake it and...

Nope. It's decided only the bottom most material gets to exist, and color ramps are just nonexistent. What gives? I've been at this for hours and I'm at a loss!

The shader to RGB node does not work with cycles.

Welcome. Please use a title that matches the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue in such way that anyone searching for a similar problem may easily find it. Use the [edit] link above, remove anything superfluous, avoid words like "this","issue with" or "question about". Remember, your title is the first thing potential visitors will see, answers you get depend heavily on how inviting it is. See "What is the problem of asking “How do I do this?""

Apart from the Shader to RGB node not working in Cycles, it looks like you have created a black outline object using Backface Culling to be only visible around the shield. Backface culling also does not work in Cycles like in Eevee, you have to create it manually in the shader. And for the Color Ramp disappearing, read this: .fbx export why there are no materials or textures?


text:
Why do some mesh vertices not shrinkwrap to the target object?
My objective is to displace the vertices of one mesh to match the positions of the vertices of another mesh.  Both meshes are composed of the same number of vertices, located at the same XY locations but with different Z locations.  I have been able to use the shrinkwrap modifier (using the project wrap method along the Z axis with the positive and negative directions enabled) to get essentially the result I am aiming for, except that some of the vertices along part of the mesh boundary are not moving to the corresponding vertices of the target object (see highlighted part of the screenshot below).

Here is a link to download the blender file -
shrinkwrap_mesh.blend
I am hoping someone can explain why these vertices are not projecting to the target object and offer a solution so that all vertices displace to the corresponding vertices located at the same XY locations.

i think it might be just a rounding issue. Just increase the target size by 1.002 and it works.

it looks like they are missing the face they should project onto (even though they are at the exact same X and Y location), I don't know why, but you can just move very slightly this edge and it will project correctly

Thank you Chris and moonboots for your responses! That works for me too.


text:
How to turn off light effect
I work on a project where I want to render a little video scene out of blender and edit the rendered frames with the Nividia GauGan filter. For GauGan to work my rendered Frames need to be the exact same color values as I imported them before rendering the assets in my scene, but the lightning settings I use always affect the colors a bit. I already tried changing the display device, view transform, and sequencer, but nothing works, because the light always affects my scene. Is there a setting to get rid of lightning completely?
I appreciate any help.

Give the images an emission shader set to 1 (I assume you are mapping the images onto planes). This value causes the image to ignore shadows or lights and display its true colors, thus making it shadeless as you wanted.

Thank you for the suggestion. I tried it and it made the result clearer but still, after rendering the Frames Blender made all colors a little bit darker. But maybe I use the emission shader wrong I'm still a newbie.
I took the color output of the image to emission input for color
and emission output to the surface of material output.
But I got the same result if I just bypassed principled BSDF completely and took the color output in the surface input directly.

Hmm. Try scrolling down to color management in render settings and switching views transform to standard?

Sadly already tried it but it just reduces the effect a little bit and doesn't get rid of it completely.


text:
No compatible GPUs found for the path tracking
The error when open Blender as I am using the AWS instance G4x4large (GPU Tesla T4). As I read here this GPU support OpenCL here

Make sure you're using the most up to date drivers.

Not an expert here, but shouldn't this Nvidia card support Cuda or even OptiX?

OpenCL is only used for AMD GPUs, check in the CUDA or OptiX tab.


text:
Change background image in blender
could anyone advise how to change background image in different key frames in 2d animation? I need to have one background image on the 1st frame and other images on other frames. If i change a background image on the 2nd frame then it is automatically changed on the 1st frame. It looks like i can have only one background image on all key frames or not?

Hi and welcome Anna! Just curious: Does one of our answers solve your issue? If no, do you mind adding more details to your question? I recommend take the tour to see how this site works: https://blender.stackexchange.com/tour Thanks!

In case this is for world background image, you can also do it.

Add an environment texture node.
Open the image files from it: if you select several files, Blender will now this is a sequence.
Now you can keyframe the "offset" value of the node.
Finally, you'll just need to set the animation extrapolation to constant (if the images are not frame numbered sequentially).

You'll need to name the files like that so Blender can attach a frame to each:

Sure. Select your Background Image (Empty), go to Properties > Object Data > Image, set the Source property to Image Sequence or Movie and select your clip using the File Browser:

Manual: https://docs.blender.org/manual/en/latest/modeling/empties.html

Empties are not rendered, can they be?

As I understand the question it's not about rendering rather using the background to actually do some rotoscoping with grease pencil -> .https://en.wikipedia.org/wiki/Rotoscoping @lemon


text:
Blender , an angle between faces
I have such an example:
On an object
the obtuse angle between 2 faces is 150 deg (but I know it, blender shows 30), in another place the acute angle between 2  different faces is 30 deg.
In both cases, Blender shows me 30 deg. How could I find the difference with Python help

The value shown is face1.normal.angle(face2.normal)

yes, i used that , but it shows me 30 deg in both cases

actually it shows me 30 when i use degrees(face1.normal.angle(face2.normal))  , face1.normal.angle(face2.normal) gives me values:0,1,or 2

is there anyone who could help me somehow?


text:
Face edges angle - python
How can I find angles between the edges in a face,
and then make a loop for all faces in an object.
I know I can set it up in a blender and just read it, but I'd like to send these angles to a text file. How to do it with Python

To clarify: As in the interior "edge angle" of an equilateral triangle is sixty degrees?

Project into 2D
The verts and edges are wound in order. Knowing the face normal can walk around the edges in a face, using the vector of the "incoming" edge, and vector of "outgoing" edge can calculate the internal angle as as outlined in Finding Internal Angles of a Polygon  Blender winds its faces in a counter-clockwise direction.
IMO other answers  fail to take this into account, see below
Blender has an angle_signed method for 2d vectors.  To use here may require having an arbitrary "Greenwich" point as a reference.

If not colinear, The three verts of the 2 edges form a plane

The corner of 2 edges is the middle vert (b) Subtract
this from other vert of each edge (new origin)

The cross product of the two edges is the axis of rotation (normal to
plane)

Change the space to project (rotate) corner plane into XY plane to represent the corner edges as 2D xy vectors.

Test script. By way of point of difference have used an edit mode bmesh. In edit mode, select the faces you wish to see the internal angles of, then run script.
import bpy
from mathutils import Matrix, Vector
from bpy import context
from math import degrees, atan2, pi
import bmesh
# project into XY plane,
up = Vector((0, 0, 1))

ob = context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
def edge_angle(e1, e2, face_normal):
    b = set(e1.verts).intersection(e2.verts).pop()
    a = e1.other_vert(b).co - b.co
    c = e2.other_vert(b).co - b.co
    a.negate()
    axis = a.cross(c).normalized()
    if axis.length < 1e-5:
        return pi # inline vert

    if axis.dot(face_normal) < 0:
        axis.negate()
    M = axis.rotation_difference(up).to_matrix().to_4x4()

    a = (M @ a).xy.normalized()
    c = (M @ c).xy.normalized()

    return pi - atan2(a.cross(c), a.dot(c))

selected_faces = [f for f in bm.faces if f.select]
for f in selected_faces:
    edges = f.edges[:]
    print("Face", f.index, "Edges:", [e.index for e in edges])
    edges.append(f.edges[0])

    for e1, e2 in zip(edges, edges[1:]):

        angle = edge_angle(e1, e2, f.normal)
        print("Edge Corner", e1.index, e2.index, "Angle:", degrees(angle))

Test run on concave ngon

2x2 grid center vert dissolved. Bottom vert moved to origin making a 270 degree internal angle between edges 5 and 1
Face 0 Edges: [1, 6, 2, 7, 3, 4, 0, 5]
Edge Corner 1 6 Angle: 45.0
Edge Corner 6 2 Angle: 180.0
Edge Corner 2 7 Angle: 90.0
Edge Corner 7 3 Angle: 180.0
Edge Corner 3 4 Angle: 90.0
Edge Corner 4 0 Angle: 180.0
Edge Corner 0 5 Angle: 45.0
Edge Corner 5 1 Angle: 270.0

For file IO consult the python docs. (Or see other answers).
Re other answers, angles when run on ngon above
@lemon
[135.00000034162267, 0.0, 90.00000250447816, 0.0, 90.00000250447816, 0.0, 135.00000034162267, 90.00000250447816]

@MohammadHosseinJamshidi
[45.00000125223908, 90.00000250447816, 180.00000500895632, 90.00000250447816, 180.00000500895632, 90.00000250447816, 180.00000500895632, 45.00000125223908]

this answer is most helpful :)

You can also (more directly):
import bpy
from mathutils import Vector
import csv

def get_face_angles(obj, poly):
    # Get vertices
    vertices = [obj.data.vertices[i] for i in poly.vertices]
    # Append first and second to loop back from the last ones
    vertices.append(vertices[0])
    vertices.append(vertices[1])
    # Get angle triplets
    triplets = [(v1, v2, v3) for v1, v2, v3 in zip(vertices, vertices[1:], vertices[2:])]
    # Keep elements and get angles
    return [(poly, v1, v2, v3, (v2.co - v1.co).angle(v3.co - v2.co)) for v1, v2, v3 in triplets]

def get_faces_angles(obj):
    # Loop over the polygons and get the results
    results = []
    for p in obj.data.polygons:
        results.extend(get_face_angles(obj, p))
    return results

def save_to_file(path, angles):
    with open(path, 'w', newline = "") as f:
        writer = csv.writer(f)
        for a in angles:
            #Five columns: face index, three vertex indices, angle
            writer.writerow([a[0].index, a[1].index, a[2].index, a[3].index, a[4]])

obj = bpy.context.object

angles = get_faces_angles(obj)

save_to_file("your file name", angles)

This is not what wanted. 1) It gives unknown triangles angles which share common vertices with polygon (if a polygon wont be single-planar, your triangles may not match with real model's triangles). 2) the question is about edges of polygons not triangles (for example a 6-gon or so)- in this way for polys with more than 3-edges you always calculate smaller angles

@MohammadHosseinJamshidi, I could be wrong but could you provide a concrete example?

I even learned something from your code so please accept my thanks.
example: consider a flat 6-gon . move 1-vertex a little up. blender itself creates its own triangles. now if you connect every permutation of 3-vertices and calculate angles, you have (also calculated whats needed but) created triangles which are not even blender's triangles. they may not match. if there's a need for a picture please tell me.

@MohammadHosseinJamshidi, yes a picture will help maybe. But from a given face, vertices are counterclockwise (considering face normal orientation), and so edges are following this vertex path.

in this picture red triangles are blender's tris and yellow ones are what you calculate more.

@MohammadHosseinJamshidi, I'm very sorry but still don't get it. I may be wrong again but if this is one face (6gon) in Blender polygons model, I do not consider the upper segment in yellow. And I either don't consider the red ones. Maybe we'll need to continue in chat at some moment.

excuse me! I'm really sorry. I forgot that the loop is over those ordered tuples.

No problem. We agree now if I understand well?

thank you very much for all answers ,
I have to digest this :)

use this for polygon-wise angles:
import bpy
import math

path = 'D:/01 Projects/edge_angles.txt'
obj = bpy.context.object

def angle_between_edges(obj,poly,e1,e2):
    common_vert = set(e1).intersection(set(e2))
    if common_vert==set():
        return None
    v0 = list(common_vert)[0]
    v1 = list(set(e1).difference(common_vert))[0]
    v2 = list(set(e2).difference(common_vert))[0]
    vec1 = obj.data.vertices[v1].co -obj.data.vertices[v0].co
    vec2 = obj.data.vertices[v2].co -obj.data.vertices[v0].co
    angle = vec1.angle(vec2)
    angle = math.degrees(angle)
    return angle

def write_angles_in_file(obj,path):
    file = open(path,'w')
    for p_i,poly in enumerate(obj.data.polygons):
        for i,e1 in enumerate(poly.edge_keys):
            for j,e2 in enumerate(poly.edge_keys):
                if i<j:
                    angle = angle_between_edges(obj,poly,e1,e2)
                    if angle==None:
                        continue
                    line = str(p_i) + ' ' + str(e1) + ' ' + str(e2) + ' ' + str(angle) + '\n'
                    file.write(line)
    file.close()

write_angles_in_file(obj,path)

and this one for all angles:
import bpy
import math

path = 'D:/01 Projects/edge_angles.txt'
obj = bpy.context.object

def collect_all_edges(obj):
    all_edges = set()
    for poly in obj.data.polygons:
        all_edges.update(set(poly.edge_keys))
    return list(all_edges)

def angle_between_edges(obj,e1,e2):
    v1 = obj.data.vertices[e1[0]].co - obj.data.vertices[e1[1]].co
    v2 = obj.data.vertices[e2[0]].co - obj.data.vertices[e2[1]].co
    # edge is not directed
    angle = min(v1.angle(v2),v1.angle(-v2))
    return angle

def write_angles_in_file(obj,path):
    all_edges = collect_all_edges(obj)
    file = open(path,'w')
    for i,e1 in enumerate(all_edges):
        for j,e2 in enumerate(all_edges):
            if i<j:
                angle = angle_between_edges(obj,e1,e2)
                angle = math.degrees(angle)
                line = str(e1) + ' ' + str(e2) + ' ' + str(angle) + '\n'
                file.write(line)
    file.close()

write_angles_in_file(obj,path)

Using a set for collecting edges won't give the wanted result as you will loose the per face view when calculating angles.

I have added a code for calculating angles per face

this fragment for i,e1 in enumerate(poly.edge_keys): for j,e2 in enumerate(poly.edge_keys): if i<j: suggests for e.g. 10th edge, you will list 9 angles, between 1st and 10th edge, 2nd and 10th edge... and finally 9th and 10th edge. Now, when you compare edges, you check for common vertices, so that fixes it, but still, if 10th edge is the last edge and connects with the 1st edge, then you will list 2 angles instead of 1. Sure, the first edge counters it by having 0 edges satisfying i < j, but you end up with wrong ordering: https://i.imgur.com/xJ7FNS5.png

@MarkusvonBroady  in polygonwise angle calculation a common vertex is considered to calculate the angle, and in second script, all of edges regardless of their order are considered.

@MarkusvonBroady it is also reflected in the image you have attached. if you see the edges share a common vertex.
and the i<j condition just removes doubles and the ordering is considered by common vertex

@MohammadHosseinJamshidi so this ordering is by design?

@MarkusvonBroady It doesn't disturb calculation and the questioner didn't ask for it. In addition the ordering could be in several manners (order of vertices inside face, which itself has several cases) (order of vertex indices which can be so different) and more. so considering ordering (although it is simple,) is something else and could be done in a separate thread.


text:
My Doughnut icing ends look weird Blender

Hi,
I'm following Blender Guru's doughnut videos. At one point, when I was making the icing I encountered an issue and changed some settings around. After a few days, I managed to fix the issue, but now this this is stuck here and I don't know how to get it back. Does anyone know what I enabled?
Thanks,

Love Blender Guru!

Yeah, me too :D

could you share your file with me so I can take a closer look?  you can use this link:https://blend-exchange.giantcowfilms.com/

Right Click, select Shade smooth

Ethan, where do I find the files? Sorry, I'm a complete beginner )L


text:
Character start distorting when I moved the body rig
blender community.
Sorry, if this question was asked so many times but I am working on character rigging from months but when I rotate or move any bone of the Rig then the body starts distorting.
I have tried so many solutions but nothing works. Please help.
Rigged character

make sure that the weight paint is correct in Weight Paint mode

@moonboots you can check this https://drive.google.com/drive/folders/1tmB-YfBAoJ0acabIHE7ecDu22b_Y6_Tt?usp=sharing

I would personally merge all the character's part to make one object, it would make things easier in my opinion. But first select the armature, display the layer with the deforming bones:

Then shift select the mesh and check the bones, you can see that some have influence when they should not:

Select these parts in Edit mode, in the Properties panel > Object Data > Remove From All Groups, then reassign to the right group (the one that has the name of the bone that is supposed to control) with the Assign button. Or do the corrections with a brush (in Mix or Subtract mode) in Weight Paint mode.

For the smoothness yo could add a Subdivision Surface under your Armature modifier, but you should add edge loops where the bending is happening (by the way, no need for so many horizontal edges in my opinion, especially if you add a Subdivision Surface):

Thanks, Moonboots for the answer. Problem is not the ear actual arms & legs are distorted & there are not smooth.

I've edited my answer, the problem is the same, you need to give some corrections, check each bone and correct their influence in Weight Paint mode.


text:
How to get a blend file from a link and append it using blender python?
I want to be able to have a python script append a blender file from a link that it is housed in. I have the .blend file on my website and I want to be able to grab it from blender, and append it. Is there any way to do this?

Everything? Related: How to Link/Append a data-block using the Python API?

Thanks, but I meant link as in website link like example.com link

No problem. Here you go: https://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python Otherwise I'd suggest share the current state of your code, see: https://blender.stackexchange.com/help/how-to-ask

Than you Brockmann!


text:
Snapping not working correctly in object mode
So, I'm having this problem that I'm sure is just some setting that I'm missing but I'm not able to find anything about it. So when I want to align the rotation of an object with the angle of another object (while keeping the object rotation) I usually do the following: I snap the object-to-rotate to the target object with closest. Then I set the origin in the vertex I want to align and the 3D Cursor to the vertex that is already snapped to the target object. Then I change the pivot point to 3D Cursor, turn snapping on, face mode, active and set it also to rotate. Then I just rotate on an axis and it usually snaps correctly. The problem is that depending on I-don't-know-what some files are set like that and some aren't.
I hope the explanation was clear, I know it's a bit complicated. I uploaded a quick vid to youtube showing my problem (https://youtu.be/eE00rKKap30). Hopefully someone knows how to solve this because I use this all the time.
Please let me know if there's some info missing or anything else that can be useful
I'm using Blender 3.0 but I also tested it in Blender 2.93 with the same result.
EDIT: Snapping behaviour works fine in edit mode

So basically you want to snap the object to a target's surface with the snapping object aligning its rotation with the target surface? CG Masters made a tutorial about that https://www.youtube.com/watch?v=Gc8BekthXAQ I don't know if that's what you are looking for.

Thanks for your help but unfortunately that doesn't solve the snapping issues.. it's more about the behaviour of the snapping than the alignment itself :/ It's a good way to align objects though.

Instead of rotating around the 3D cursor, what about moving the object? If you use the Snapping tool with Face snapping and the option "Align Rotation to Target" enabled, moving the object closer to another face should snap it there and align it (i.e. align the local Z axis of the moving object to the local Z axis of the face it snaps to).

@GordonBrinkmann thanks for your answer. It does align somewhat, but not really precise. However, this is not really the issue. It's the snapping behaviour that I want to solve.. I solved the alignment with a quick shrinkwrap.. fast and dirty but it worked... but I would like to know why the snapping works in a way in some files and in another way in other files :/ I'm sure it's a simple setting that I'm missing.. Thanks again for the answer!!

@mresala To explain why it behaves in one way or another depends a lot on which options you have enabled and if you are working in Object Mode or Edit Mode. It's a bit tricky and unpredictable from time to time (at least in my eyes), but experimenting a lot with the different settings I got a feeling for how it works in most cases and which works best for me and my usual workflows.

@GordonBrinkmann hey! yes, I know that it may be a bit unpredictable.. but I checked all the settings (available in the header) and they match those of the file where the snapping works as I expect.. I thought maybe there were more settings elsewhere that I don't know about... for example I have a startup file and there it works fine.. I uploaded a video to youtube if you want to check it out, and also to understand the expected behaviour: https://youtu.be/jOgT_sAVkFE Sorry, english is not my native language and I'm afraid I'm not being clear

Well, as I said before - I won't do it with rotate. What I see in your video different to my suggestion is: 1. You're rotating, not moving. 2. You don't have "Align Rotation to Target" enabled. If I do these two things it seems my result comes close to what you want to do. And talking about precision: the snapped face lies exactly flat on the target's face.

@GordonBrinkmann thanks, but still.. I want to understand why I do one thing in one file and the same thing in another file and the result is different.. it's not about the alignment itself... it's about the snapping behaviour. Thanks anyway for taking the time :)


text:
Can't save a single pass from an OpenEXR MutiLayer file
So, I'll try to make it as clear as possible but I just started working with OpenEXR MultiLayer Output and I might miss some important info. Important to know I render with Cycles.
I'm working with an interior scene that has Depth, AO, and Noisy Image passes. I started rendering with a render farm (GarageFarm) to avoid long rendering times. They told me that to keep the passes, I should set the Output as OpenEXR MultiLayer .
I did as they told me to and got a .exr file that has all the different passes as I wanted to. I open this file using F11 to open rendered image, I go to image, open, and double click on the .exr file. After doing this I can choose between the different passes and they all look as they should. The problem is that when I want to save one image (clicking image, save as) the program simply does nothing. I can't save the different passes as .png as I would want to.
I don't use the compositor because I find it really confusing, I prefer getting all my passes as png and simply post-process them with Photoshop, so if I could avoid using the compositor for this I would be happy as a cow!
Important info: I don't open the .exr file directly on Photoshop because I like to do the color management in Blender first.
I hope I made myself clear, but if I'm missing something or you need more info/screenshots/whatever, please let me know!
Have a great weekend!

You cannot composite passes saved as 8 or 16 bit PNG files in Photoshop because that format will be missing part of the data. Passes need to be composited while in 32 bits format and without any color transforms. So even if solving the problem described in your question was possible specifically avoiding using the tool designed for it, this would not help you at all. You need to do compositing in 32 bits and before color management. Photoshop is not a very good tool for this purpose. I suggest learning to use the Compositor in Blender.

The capacitor isn’t as scary as it looks. Trust me. I used to be terrified of the shader editor back at 2.78 and hid in Blender Internal, but nodes are actually very intuitive once you know how they work. Just one thing piping into the next. It’s like hooking machines together with hoses. You just need to make sure you’re piping compatible types. Color will automatically convert to a grayscale value if you pipe a Color output into a Value socket.

Why do you say Photoshop is not a good tool for this?

@MartynasŽiemys thanks for your answer, I guess I will have to learn to use the compositor. Still, I don't really understand why I can't save my images since I already have them there, and since Blender allows me to hit "save as".

@ZargulTheWizard Thanks for your answer. I know that it's time for me to learn how to use the compositor... I've been putting it off since I already know how to do most of the things I need directly in Photoshop using layers...

@AlexandreMarcati I don't think Photoshop isn't a good tool for color management... on the contrary, but I test my renders using the exposure value in Blender, and sadly it doesn't work the same way in Photoshop. I can mimic it in Photoshop afterward, but it's an extra task that I wanted to avoid.

Photoshop is designed to work with 8bit @AlexandreMarcati They are still in the 90's.

Well... Maybe we are a little too harsh regarding Photoshop... It does somewhat work. You can use EXR IO plugin and import Multilayer EXR files even with Cryptomatte masks and while really a lot of functionality does not work in 32 bit mode a lot of important stuff does, so it is possible to use it for compositing.

Ok, so I found a way to save the passes as I wanted. I opened the .exr image in the compositor by adding an Image node, then with node viewer active I opened the Image Editor with F11 and searched for "node viewer" image. I only had to switch between the passes in the compositor instead of doing it directly in the Image Editor. I'm not sure is the correct way to do it but worked fine for me! Thanks again to everyone for your help!

This is a really bad idea. If you save passes in 16 or 8 bit formats with color transforms applied the compositing will be wrong. If you want to do compositing in Photoshop, use EXR IO plugin(free - https://www.exr-io.com/) and do it the way it is done - use the multilayer EXR image in Photoshop.

@MartynasŽiemys Thanks again for your help. I really don't know much about 16 or 32bit images, but for what I need it works perfectly fine. In the end, I get to edit the image in photoshop as I need and I'm pretty happy with the result. I'll do, however, some research regarding the 16-32bit thing to understand better. Thanks again!


text:
highlighter effect in blender on images
I would like to make vox videos like highlighter effect on images and planes. Like when the animation is started some lines are highlighted from left to right like highlighting the line.


text:
How to smoothly mix material on edges of said materials?
I'm somewhat new to blender and i have a problem with mixing materials:
Material A and B are similar (roughness, and colors) but material B has "holes" in it. These holes need to be in specific location on that mesh, and only there.
I need to somehow mix thesee materials so that is transformes smoothly to one another, and i dont know how.
I thought about "merging" them and mixing them with gradient texture as a factor but given that the materials are messy, and they blend in multiple places i don't think it can work, or at least i don't know can it work.
Any help would be appreciated

Have you actually tried merging them with the gradient method you have mentioned? I think it is a great idea.

@EricXue i just tried but the way it worked it applied the "new mixed material" to the whole mesh, and it blended it smoothly, however it blended it in one place (with Mapping node i can chose the place where it blends) and i need it to blend several times;
In the photo i added above with the main question there are two places where blending should take place (places where A ends/starts and where B starts/ends).
Im not sure how to set up gradient texture that blends in two (or more) places, and how to control these places

Cool, I think I found a way. I will be writing in an answer soon.


text:
Difference in color between image render and video render
Can anyone tell me why there is a subtle colour difference between my image render and video render?

This is an EXR image sequence that I have pre-rendered and am importing into the sequencer in a new project. The image render on the left has the correct colour, whereas when I render to video it comes out slightler darker and I can't figure out why.
My colour settings:

Hi :). The transfer from EXR (scene referred) to video codecs (display referred) isn't perfectly precise. You'll probably need to correct the colors in compositor ;)

What video codec do you use? If you use H.264, it has YUV Color space instead of sRGB, which can probably loss some colors during color convection.

I am using H.264. Should I be using something else?


text:
How can I change the active item in Asset Browser with Python?
I'm trying to highlight different poses in  my Pose Library(Asset Browser) with Python. The same way like when you just click it once—but this time with code.

I need it to execute bpy.ops.poselib.apply_pose_asset(override, blend_factor=1, flipped=False)
How can I do that?
Blender 3.0.1

Have you tried {id = bpy.data.armatures["Armature.00x"]} as an override ?

@Gorgious I like your thinking, but I can't get it to work. And after fiddling with it I believe it's actually bpy.data.actions but even with that it doesn't work.

I would not try using the bpy interface to the asset browser just now.  There are discussions of issues on devtalk and it seems like there's a rewrite coming.

The Pose Library doesn't really have a Python API (this makes me miss the pose lib a lot, tbh)
You can work around it by getting a hold of the SpaceFileBrowser space_data.   I see people looping through the screens/areas etc, trying to find it (with heuristics like "what is the largest area on screen" and stuff like that).   I just run the operator from the asset browser itself to just go context.space_data.
This type of space_data has a couple of methods that will allow you to prepare for the apply_pose_asset operator.  The most important one is activate_asset_by_id.  Note that it doesn't take a string, but if you know the name of your action, you can pluck it from bpy.data.actions and pass the id_data prop.
Then you can call the operator and the pose will be applied.
Just be careful with which selected bones you might have, etc. as it might make it seem that it's not working when it is.
See here a minimalist example:
    def execute(self, context):
        data = context.space_data
        data.deselect_all()
        data.activate_asset_by_id(bpy.data.actions['zz_jawDrop'].id_data)
        bpy.ops.poselib.apply_pose_asset(blend_factor=1)
        return {'FINISHED'}

How do you run the operator from the asset browser itself?

Thank you gabriel. I used part of your example to write this script trying to help someone else do the same thing but also keyframe the poses on every frame in a new action.
import bpy

def get_poses():

    poses = []

    for action in bpy.data.actions:
        if action.asset_data != None:
            poses.append(action.name)

    return(poses)

def apply_pose(action):
    area = [area for window in bpy.context.window_manager.windows for area in window.screen.areas if area.ui_type == 'ASSETS']

    bpy.ops.pose.transforms_clear()

    w = bpy.context.window

    for a in area:
        for s in a.spaces:
            if s.type == 'FILE_BROWSER':
                space = s

    with bpy.context.temp_override(window=w, area=area[0]):
        space.deselect_all()
        space.activate_asset_by_id(bpy.data.actions[action].id_data)

        bpy.ops.poselib.apply_pose_asset(blend_factor=1)

def key_frame_poses():

    bpy.ops.anim.keying_set_active_set(type='LocRotScale')

    if bpy.context.active_object.type == 'ARMATURE' and bpy.context.mode == 'POSE':

        scene = bpy.context.scene
        rig = bpy.context.active_object

        action_exists = False

        for act in bpy.data.actions:
            if act.name == "Pose Library All Poses":
                action = act
                action_exists = True
            else:
                action_exists = False

        if action_exists:
            bpy.data.actions.new(name = "Pose Library All Poses")

        rig.animation_data.action = action

        pose_asset_names = get_poses()

        for i, pose_name in enumerate(pose_asset_names):

            scene.frame_set(i + 1)  # Set the current frame
            apply_pose(pose_name)

            bpy.ops.anim.keyframe_insert_menu(type='LocRotScale')

key_frame_poses()

Hopefully someone will find this useful. Sharing is caring after all


text:
How to get first or last vertex of a loose edge in Python?
I wish to select the first vertex of each loose part in my object. How can I do that with code?

That depends on how you want to define 'first' versus 'last'.  It's easy enough to find the end points on loose edges: They're the vertices that only have 1 edge attached. But without knowing your definition of 'first' it's impossible to pick between them.

@MartyFouts thank you Marty, that is definitely something I can work with. As for telling which end is which, an example that comes to mind would be Houdini where the points are numbered and you can for example assume that lower point number will be the first/bottom vertex. Not long ago blender introduced a Spreadsheet tab -- do vertices in blender have their own numbers that we can access by any chance?

Vertices have their own numbers, but they're unique within the entire mesh, rather than unique to an edge loop. One of the edges might have 3, 4, 5, and 6 and the next one 17, 19 and 21, depending on how they were created.

@MartyFouts Same as in Houdini. My idea is that you can just pick the lower number of the two. Perfect!


text:
How do I make operator properties show up as a dropdown in keymaps?
I've just learned about property definitions in operators. I can't find an answer on how to set them up in a way that their possible options appear as a dropdown in the Keymap panel. Like this one:

I've managed to get something to appear there by inserting something into default = '' but that's about it.
uitype: bpy.props.StringProperty(
        name = 'uitype',
        default = 'Something',
        #preset_options = ['item1', 'item2', 'item3']
        )

How do I program that?

I think I just figured it out. I needed to use bpy.props.EnumProperty
uitype: bpy.props.EnumProperty(
        name = 'uitype',
        items = (
            ('Something1', "Something 1", ""),
            ('Something2', "Something 2", ""),
            ('Something3', "Something 3", ""))
        )

https://docs.blender.org/api/current/bpy.types.Operator.html#enum-search-popup


text:
Is it possible to make my script toggle the console on?
I have a script which enters a long loop and prints a bunch of things in the console.
Sometimes after a crash I forget to toggle it back on and I run the script and now I can't see what's it doing and the whole blender is not letting me click anything.
Is it possible to do something like this?
if console.visible == False:
    console.toggle()

Do you want to turn on the console when blender start?

there is no way to check if it is visible. https://blender.stackexchange.com/questions/3155/how-to-know-if-the-system-console-is-open

you can actually, using win32gui ; please refer to my answer bellow

You could start Blender with the console on by default by adding -con to the shortcut properties:
\blender_path\blender-3.2.0-windows-x64\blender.exe -con

As @radoo has already pointed out you can run blender.exe with the argument -con (for "console on")
On Unix and Unix-Like systems that is easy since we can directly run it in the terminal and see the console outputs. If you are on Windows you can create a .bat file for convenience with the following contents
start "" "X:\blender_path\blender.exe" -con

Then you can directly run the .bat file and you will have the system console always available.

You can on Windows ;
On Windows, it's possible to check using python code, whether the blender console window is already visible or not.
That Blender's console window being most probably the only window of the console class (ConsoleWindowClass) with the name ""
(see bellow to install win32gui)
def show_blender_system_console():
    import win32gui

    def enum_windows_callback(hwnd, results):
        class_name = win32gui.GetClassName(hwnd)
        if class_name == "ConsoleWindowClass":
            results.append((hwnd, win32gui.GetWindowText(hwnd)))

    windows = []
    win32gui.EnumWindows(enum_windows_callback, windows)

    for hwnd, title in windows:
        if title=="":
            break

    print(f"The Blender console window is {hwnd}")

    # Check if the window is visible or hidden
    is_visible = win32gui.IsWindowVisible(hwnd)

    if is_visible:
        print("The window is visible.")
        win32gui.SetForegroundWindow(hwnd)
    else:
        print("The window is hidden.")
        bpy.ops.wm.console_toggle()

win32gui is included in pywin32 ; to install a python package do in a cmd (win+R>cmd):
C:\[path to your blender app]\python\bin\python.exe -m pip install pywin32

e.g. (Change the path accordingly to your version):
C:\Program Files\Blender Foundation\Blender 3.5\3.5\python\python.exe -m pip install pywin32

you might want to do ensure pip is installed and updated before:
C:\[path to your blender app]\python\bin\python.exe -m ensurepip
C:\[path to your blender app]\python\bin\python.exe -m pip  install --upgrade pip

You need to include an explanation on how to install win32gui. It is not there by default.

explanation added :)

improved solution:
import bpy
def show_blender_system_console():
    import win32gui

    def enum_windows_callback(hwnd, results):
        class_name = win32gui.GetClassName(hwnd)
        if class_name == "ConsoleWindowClass":
            results.append((hwnd, win32gui.GetWindowText(hwnd)))

    windows = []
    win32gui.EnumWindows(enum_windows_callback, windows)

    for hwnd, title in windows:
        if "blender.exe" in title:
            break

    print(f"The Blender console window is {hwnd}")

    # Check if the window is visible or hidden
    is_visible = win32gui.IsWindowVisible(hwnd)

    if is_visible:
        print("The window is visible.")
        win32gui.SetForegroundWindow(hwnd)
    else:
        print("The window is hidden.")
        bpy.ops.wm.console_toggle()

show_blender_system_console()


text:
Layout object placement
A noob question: I scaled the default cube to 8m along x. If I set transform to 4m (in x), why isn't the object now just sitting on the ground plane? Isn't the origin of the object in the center by default?

The object origin is set in the center of the cube (x/2, y/2,z/2) by default. If you want to have it at the center of your ground plane, you have to set it manually.

Thanks for your response, which makes perfect sense. I'm not really trying to move the origin, I'm just trying to understand why using transform to move the object isn't acting as I expect. Like I mentioned, I scaled it to 8m tall, so 4m should be the origin in x, but when I use the transform to move it to 4m in x, the whole cube should be sitting on the ground plane, but it is not. I have to set the x location to 8m for it to sit on the ground plane.

To make it sit on the ground plane you need to move it in the Z axis. If your cube is 1m in height then setting 0.5 in Z will make it sit on the ground plane.

Thanks for your response, which makes perfect sense. I'm not really trying to move the origin, I'm just trying to understand why using transform to move the object isn't acting as I expect. Like I mentioned, I scaled it to 8m tall, so 4m should be the origin in x, but when I use the transform to move it to 4m in x, the whole cube should be sitting on the ground plane, but it is not. I have to set the x location to 8m for it to sit on the ground plane.


text:
RPG game objects with medieval graphics filter?
I want to create 3D scenes, but I don't have much time to add medieval-style artifacts to these scenarios. I believe that writing code in Blender 3D or a similar tool should help with this. Although the internet has a wealth of resources, they are limited in scope due to the lack of medieval resources. To give the players the impression that they are in the Middle Ages, I intend to create sceneries in 3D, gather the necessary items from the internet, bundle them together, and apply a medieval filter on top of them.
Can you say that there are already simple ways to accomplish this, or are there any online tools or presets? Where should I begin to think?

What are "medieval-style artifacts" and what do you mean by "medieval filter"? Do you have any specific examples or reference images? Is this a question about using Blender?


text:
Alembic eye mesh not following the character body
I'm trying to export Malcolm(Animschool rig) from maya to blender as an alembic file. But after exporting his eye mesh break the connection with the body and they come on grid in blender. Any valuable suggestions would be helpful.

Nevermind. I found the answer after spending my entire day to get that eye mesh. Solution was: My rig eyeball has the same naming convention and alembic dont read same name file so i had to separately export the eye mesh from maya to blender. And now its working:)


text:
Why do convex curves with sharp edges automatically flatten?
I've been making a few weapons for a short while now and I've found that a similar issue arises pretty commonly. This time I've noticed that when making a convex portion of a blade with an edge that sharpens to nothing, the curvature is lost and somehow flattened prematurely.
The blade is two-sided but there should be no clipping faces, I've already merged vertices and tried remaking the faces. I know that making more edges to join the outer and the inner vertices can resolve this, but it doesn't preserve the smooth look of the blade. I also noticed that this problem doesn't arise when only one side of the sword has the face that's causing the issue.
This is blender 2.8

This happens because the surface is pretty much undefined. The only guaranteed flat surface there is is between exactly three vertices. If you have more vertices without edges,  it's a guessing game for Blender, so it will come to different conclusions, depending on angle and other factors.
What you can try is using the subdivision surface modifier, simple, not cattmull-clark, in a high resolution. It will try to fill the face with edges.

Would it not also work to go from Edit Mode to Mesh > Clean Up > Split Concave Faces? How might these two options produce different results?

1.: This would probably create edges between the vertices which define the curves, which would lead to an "edgy" look, which OP specified they didn't want. 2.: Modifiers are nondestructive, you can turn them on and off as you go, so OP could keep their current workflow.


text:
Why can't I reach this specific keybind through Python?
I'm trying to reach view3d.view_qcd_slot allegedly located inside Object Mode category. But I'm getting KeyError: 'bpy_prop_collection[key]: key "view3d.view_qcd_slot" not found'
Here's my train of thought:
I've got this code that works for view3d.move located inside 3D View category.
wm = bpy.context.window_manager
wm.keyconfigs.default.keymaps['3D View'].keymap_items['view3d.move'].active = False

When I try it with my desired keybind, both .keymaps['3D View'].keymap_items['view3d.view_qcd_slot'] as well as .keymaps['Object Mode'].keymap_items['view3d.view_qcd_slot'] throw the not found error.
Inside the Preferences window it seems that view3d.view_qcd_slot is nested a little bit deeper, like so:

But when I exported my keybinds to a .py file to inspect it it seems they're right next to each other:

So I'm super confused why .keymaps['Object Mode'].keymap_items['view3d.view_qcd_slot'] doesn't work. Maybe it has something to do with keyconfigs.default?

The keymap item view3d.view_qcd_slot for the Collection Manager add-on can be access through:
km = wm.keyconfigs.addon.keymaps["Object Mode"]
kmi = km.keymap_items["view3d.discard_qcd_history"]

Blender's Python API separates the access to the key configurations of add-ons from the default one. Hence wm.keyconfigs.addon has to be used.

Oh wow! I guess I confused it with the native system that hides (eye icon) collections with 1,2,3,4... keys, which Collection Manager does as well but with enabling/disabling checkboxes. But you're right! Now I see I can actually just disable the QCD hotkeys altogether in the addon's settings. Still, thank you very much!

The API page confuses me.  Should this entry also be available through the wm.keyconfigs.user?

@MartyFouts Yes, it is also available through wm.keyconfigs.user. I do not know the reason for this design decision either and would have to look it up.


text:
How to properly execute Poselib operators? (Pose Library)
I'm trying to change poses on my armature with Python and Pose Library, but I'm getting incorrect context errors and to be frank I don't even know what exactly am I supposed to use the operators from the docs on.
In the documentation I found this: bpy.ops.poselib.apply_pose(pose_index=- 1) described as "Apply specified Pose Library pose to the rig; Pose, Index of the pose to apply (-2 for no change to pose, -1 for poselib active pose)" which sounds like what I need.
How do I get the correct context? Pose-mode didn't seem to be it.

context errors usually mean you're trying to run the ops command from the wrong context, ie, from the Python console when it need to run in the 3D Viewport. You can override context for most ops commands and that will usually be sufficient or you can wrap them in operators that you only invoke from the correct context.

@MartyFouts Thank you, I prepared a simple test .blend file on 3.0.1. I'm completely new to context overrides. I understand the general concept, but it's hard for me to come up with working solutions. poselib_operators.blend

@MartyFouts are you saying it's not possible? I'm using that Pose Library addon shipped with Blender. Is there no way to actually apply its poses with Python? When I check the Info panel it says bpy.ops.poselib.apply_pose_asset(blend_factor=1, flipped=False) so it's definitely using these operators somehow

Once I enabled the addon, I was able to figure out the correct context.  See my answer.

EDIT: pointed out in a comment: my code needed some error handling and I didn't demonstrate how to use an override with arguments.
Here is an example of how to use an override to allow you to invoke apply_pose_asset:
win = bpy.context.window
scr = win.screen
assets = [area for area in scr.areas if area.type == 'FILE_BROWSER']
if len(assets):
    region = [region for region in assets[0].regions if region.type == 'TOOLS']
    if len(region):
        override = {
            'window': win,
            'screen': scr,
            'area'  : assets[0],
            'region': region[0],
            'scene' : bpy.context.scene,
        }
        bpy.ops.poselib.apply_pose_asset(override, blend_factor=1, flipped=False)
    else:
        print("Current Pose Library does not have a tools menu open.")
else:
    print("There is no Pose LIbrary open.")

The override is inserted into the function call as the first argument, all other arguments remaining the same.
The override argument takes the form of a Python dictionary.  Each entry represents one piece of context to override.  The above example shows the complete override for the command.  Note that the area type is FILE_BROWSER.  That is the area type of the editor window that the command expects to run in.
Note:  The command itself uses the first valid entry in the catalog if none are selected, or the active entry if one is selected.

bpy.ops.poselib.apply_pose(pose_index=- 1) is currently an operator designed for the deprecated (but still functional) separate version of the Pose Library system, soon to be removed post Blender 3.1. It exists in the Properties sidebar as a tab in Armature's settings. It requires its own pose entries and 'PROPERTIES' area type context to be executed. Like so:
import bpy
bpy.ops.poselib.apply_pose({'area':'PROPERTIES'}, pose_index=0)

3.2 Update
Context overrides are deprecated in Blender 3.2 and are scheduled to be removed in Blender 3.3  The replacement is temp_override. The manual has examples of how to use the new function.

Thank you for this detailed response, but I can't get your code to work.
I got errors. I was using your code on the .blend file I provided earlier. The first code gave me IndexError: list index out of range on line 6, which was the region = [...] line.
The second code gave me context is incorrect on the bpy.ops line.
I understand that your code searches for windows of certain type and uses them as context for operators, right?
How could I override context on bpy.ops.poselib.apply_pose(pose_index=- 1) but still control the parameter value? Thank you!

The error on line 6 is because the search on line 5 didn't turn up any open FILE_BROWSER windows.  I should have checked the len of assets before getting region.  If you don't have a window of that type there's nothing you can do.  arguments go after the override, so you would use bpy.ops.poselib.apply_pose(override, pose_index=- 1).  I'll change the answer to reflect both of those things.

I'm so close to getting this to work! I believe there's a small mistake in the code above, it's supposed to be .apply_pose() not .apply_pose_asset() for this particular function. Nevertheless, your code almost works for me with the bpy.ops.poselib.apply_pose_asset(override, blend_factor=1, flipped=False) it actually changes poses! But I have no idea how to change the active(highlighted) pose. I need something like bpy.data.workspaces["Layout"].active_pose_asset_index = 2 but for the asset browser. Sidenote, the .apply_pose() throws "incorrect context" for some reason.

@AlexM Thanks for the correction.

Just to complete an awesome response by Marty Fouts, here is a code snippet on how to choose an appropriate asset from the asset browser (tested with Marty's example only)
Inject the original code with the following:
space = assets[0].spaces[0]
space.deselect_all()
space.activate_asset_by_id(bpy.data.actions[pose_id])

A full example would be (with minor irrelevant changes):
def apply_pose(pose_id, blend_factor=1):
    #  https://blender.stackexchange.com/questions/258952/how-to-properly-execute-poselib-operators-pose-library/258970#258970?s=d03c6944322f4034875046fad6b365de

    win = bpy.context.window
    scr = win.screen
    assets = [area for area in scr.areas if area.type == 'FILE_BROWSER']
    if len(assets):
        region = [region for region in assets[0].regions if region.type == 'TOOLS']
        space = assets[0].spaces[0]
        space.deselect_all()
        space.activate_asset_by_id(bpy.data.actions[pose_id])
        if len(region):
            override = {
                'window': win,
                'screen': scr,
                'area'  : assets[0],
                'region': region[0],
                'scene' : bpy.context.scene,
            }

            bpy.ops.poselib.blend_pose_asset(
                override,
                blend_factor=blend_factor,
                flipped=False,release_confirm=True)
        else:
            print("Current Pose Library does not have a tools menu open.")
    else:
        print("There is no Pose LIbrary open.")

I came up with a solution when accidentally found this https://docs.blender.org/api/current/bpy.types.SpaceFileBrowser.html#bpy.types.SpaceFileBrowser.activate_asset_by_id


text:
Is there any reason anyone would prefer appending/removing external parts over excluding/including collections in an object generator?
I bumped into this NFT generating script where a guy just keeps on deleting everything->adding new random objects from external files->rendering->deleting everything->repeat.
And I started wondering: is there a reason to do that and not just have one larger file and just include/exclude collections with separate parts?

Yes, there is a potentially valid reason: the second approach results in a much larger blend file while the first approach allows the blend file to remain relatively small.
Whether it's the reason for the script you bumped into is impossible to say without asking the script's author.  Often the reasons for such thing come down to 'it was the first approach I thought of', or 'I already knew how to do it this way', et cetera.

A NFT author using whatever hacky way they first thought of to generate thousands of renders as quick as possible? surprised pikachu face


text:
How to enable/disable all keybinds of the same identifier/operator with Python?

I found this working code to enable/disable keybinds:
wm = bpy.context.window_manager
wm.keyconfigs.default.keymaps['3D View'].keymap_items['view3d.move'].active = False

But it disables the first keybind it finds instead of all which have view3d.move assigned to them.
To disable all of them I thought about running something like:
wm = bpy.context.window_manager
keys = wm.keyconfigs.default.keymaps['3D View'].keymap_items['view3d.move']

for key in keys:
    key.active = False

But got an error TypeError: 'KeyMapItem' object is not iterable. I'm still new to Python.

keymap_items is a list that has implemented an iterator over its member's idname.  It is possible to have multiple entries in a list with the same value.  Your line
keys = wm.keyconfigs.default.keymaps['3D View'].keymap_items['view3d.move']

returns only the first value.
One way to find all of the keys that have an idname of "'view3d.move'" is to use a list comprehension, like this one:
key_list = [key for key in bpy.context.window_manager.keyconfigs.default.keymaps['3D View'].keymap_items if key.idname == 'view3d.move']

The above code says to create a list consisting of all of the keys in the 3D View keymaps that have an idname of view3d.move That will create a list that you can iterate over:
for key in key_list:
    key.active = False

Confirming it works perfectly. Thank you for teaching me :)

@AlexM you're welcome.


text:
Tracking different clip to different camera
my question is how I can apply a different clip camera motion to another camera. I manage to import various clips in the motion track tab and track them but there is no way I can solve the track to a different camera, every time I select the different camera and make it active the tracker always solve the tracking data of the new clip to the same camera.
I want to have multiple cameras in my scene with different camera motion tracking data.


text:
How would I create curved badges like the Apple Watch fitness badges?
I'm looking for ways to be able to relatively easily produce badges like these Apple fitness badges:

You can see they're also slightly bulging/curving outwards towards the camera.
My initial attempt has been a workflow that imports SVG lines to get the curves, then adding some thickness and a bevel, converting to mesh, using the remesh modifier to fix the bad topology from the curve to mesh and add more topology to support the outwards bulge, then using the cast modifier to get the outward bend.
It works but it's very high poly (1m verts) and there's a lot of shading distortion from the remesh. Are there some better ways to approach this?

why do you need so many faces? also you could use a Lattice to deform. As for the letters: couldn't it be a normal or bump map?

It could be normal/bump but the badges need to spin so ideally it would be actual geometry, although I could probably get away with a normal map for the bevel.
And the number of faces just to support the deform - the curve to mesh creates really long faces across the entire model and remeshing just ends up creating a lot of geometry to retain the shape


text:
Domain Stays a Cube for First 2 or 3 Frames when Baking
I am attempting to complete a tutorial of a fluid simulation (MK Graphics Fluid Simulation), and everything goes great until I bake the mesh for the fluid. Once baked, the first 2 or 3 frames is a solid cube, but it then disappears, and the rest of the bake runs as normal.
I've changed the size of the domain cube and tried to offset when the various animation features trigger all to no avail. Offsetting the events just makes the cube stay solid longer.
I've tried recalculating the normals on the fluid mesh with no joy either.

Try to change domain resolution +/-1 to be sure cache is refreshed or check if fluid sim cache start is set to 1 ... Or share a simplified file, just with elements needed to reproduce the issue ... Use https://blend-exchange.com/

I tried the above suggestions with no joy. I even switched to a different HDD for the project and started from scratch with the same result. It always happens after I bake the mesh.

Upon further reflection, it happens after I add keyframes and then bake the data and then the mesh. Before keyframes, it's normal without the beginning flash frames.

Sorry for delay ... See answer if still actual for you. if you want to notify me you will have a more chance to catch me if you type @vklidu in a comment.

Hm ... right ... Any time there is not a fluid mesh generated (start, end or even in a middle of sim) domain appears in render.

I agree it is really unwanted effect.
If we know what is causing this issue you can try to avoid it by placing a small Flow object somewhere in a domain inside an Effector and hide these helpers from Rendering (Outliner > Camera icon).

Just to be sure there would be still generated some drop of liquid (mesh).

Alternatively as another workarounds ...

for the beginning of sim you can animate gravity value instead of scale
you can animate Domain object's Render visibility in outliner (Camera icon)

Thanks, I'll give these a try. @vklidu


text:
Want to make a camera in Blender
I am working on a game in UPBGE (Ver. 0.30.0), and I want to make a camera the way a photo camera works in the game, Iron Lung. I want it to be placed in front of the submarine I control, and allow me to take a picture and view it on an internal screen when I click a button. Bonus points if there's a way to make the picture look grungy.

I kinda want it something like this. Any help is greatly appreciated!

i am not totally sure but shouldn't this be pretty easy with adding just a second camera and parenting? or what is exactly your problem here?

So is the camera clip a video or actually there in Blender? Could you explain the question a little?

In the game, it's set up in a way that the camera is not functional 24/7. You need to click a "take photograph" button in order to display the photo. The picture is of what's in front of you. I'm wondering how I should set it so that:-

It is displayed on a screen
Preferrably with a grunge filter
Just a picture, not a movie

IDK how you would do it in BGE but in Unreal you can get a Cameras viewpoint, use that to render a snapshot of what the camera sees, and then use that rendered image as a texture in a materials emissive input. I imagine it would be fairly similar in BGE as well.


text:
Blender "Rigacar" won't properly follow a Nurbs Circle
when I try to make my car follow a circle the car will lock on to the path, however it has a weird bobbing/jittering motion every couple of frames. This does not happen when I make the car follow a straight path or a curvy path. This only happens with a Nurbs circle. Can someone explain what's wrong? I'm trying to make the car do donuts (drifting)
It won't let me put a video but the car will follow this path and have 2 weird jitters per every one rotation.
.

Could you attach your .blend file: https://blend-exchange.com

Sure I have 2 circles however I want to use the Nurbs circle not the bezier. I left both in the scene. Please let me know and thanks. https://drive.google.com/file/d/1JGqYslXL7wNN0oxWPKXKlnDwwJt6hgB5/view?usp=sharing

@Austin your file is too large. i don't think we need all of the data that is in your file, kindly strip down as much as data as you can and only leave that which is important to reproduce the issue. You can also use File->Clean Up after deleting all unnecessary data.

@HarryMcKenzie Agreed, it's almost 1GB


text:
Creating and printing Split Normals in Python
I created custom split normals, they show up in the viewport, but how can I get a list of them in python?
import bpy

mesh = bpy.context.object.data

mesh.use_auto_smooth = True
mesh.normals_split_custom_set( [(1, 1, 0) for v in mesh.loops] )

for l in mesh.loops:
    print(l.normal)

The code above just prints out (0.0,0.0,0.0) vectors, so split normals are probably stored somewhere else.

You need to call mesh.calc_normals_split() once before you can access the loop.normals. Otherwise they will all be zero, as you found out.
In addition to use_auto_smooth needing to be on, polys need to be smooth-shaded (poly.use_smooth = True) to use the custom normals.
Make sure the vectors you pass to split_custom_set are really normalized or you will get weird results.

mesh.calc_normals_split() did give me results, but they're random(probably auto-calculated by blender, as the function name implies). I want my custom normals to be printed (the (1,1,0) ones).

You can't ever get [1,1,0], it isn't unit length. Like I said, it has to be normalized.

Oh, true, I'm dumb. The vector length has to be 1, not individual components. Sorry!


text:
Modifiers doesn't work in render
I'm trying to create a 3D scene and noticed that the modifiers are not working on render.
I can see the modifiers in the 3D viewport, but not in the render. Idk what i have to do, do you know why the modifiers are not working?
Even if I create a new project, it's the same
Here is a simple example on a cube :
3D Viewport

Rendering

Modifiers

You can clearly see yourself that you had set the Subdivision Surface "render value" to 0:
Just set it to something above 0 and it will work.

oh thanks, i didn't know what this parameter was for.

@Alex No problem, have fun playing around !)


text:
Particles casting shadows of plane?

Why is the particles, rocks in these case, that are on the bottom plane have those squares around them? the problem is those are casting shadows of squares on render view, how do I remove them, I am kinda new to particles

Hi. I don't see any shadows in your screenshot nor any planes around particles

It looks like you added an area light to a collection that is being instanced for particles (thus making many "particle" area lights in addition to the rocks). Move the light to a different collection.


text:
Making a Character Hold A Weapon
Well I am trying to make a character hold a sword, or a knife but when I rig a hand container for the weapon, mixamo doesn't animate it right for me, sword points to wrong places. I can not use child of constraint since unity does not support constraints. Any idea how can I do it and import it to Unity?

You can set parent or enable/disable object in Unity in script, that can be triggered by animation state

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.


text:
How to rename an image with a user interface blender python
i would like to create an add-on in python that can check the name of textures and if a texture is not well named, the add-on propose to rename it.
For that i would like to make a UI instead of input("rename")
I try to make a dialog box, but i didn't succed.
def createBadTextureList():
    badTextureList = []
    goodTexture = re.compile(r"^[DNR]_.*")
    modele = re.compile(r"^modele_.*")
    for image in bpy.data.images:
        if not(image.name == "Render Result" or image.name == "Viewer Node" or modele.match(image.name)):
            if not(goodTexture.match(image.name)):
                badTextureList.append(image)
    return badTextureList

class TextureName(bpy.types.Operator):
    bl_idname="object.texture_name"
    bl_label="Vérifier le nom des textures"
    bl_description="Verifier que les textures respecte la nommenclature suivante : 'D_' ou 'N_' ou 'R_'"

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

    def execute(self, context):
        badTextureList = createBadTextureList()
        for texture in badTextureList:
            print("la texture " + texture.name + " est mal nommée")
            newName = input("renommer")
            texture.name = newName
        return {"FINISHED"}

class MyPanel(bpy.types.Panel):
    bl_label = "Export"
    bl_idname = "VIEW_3D_PT_Export"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "SNCF"

    def draw(self, context):
        self.layout.label(text = "Nomenclature :")
        self.layout.label(text = "- Modèle : 'modele_...'")
        self.layout.label(text = "- Texture : ")
        self.layout.label(text = "    Diffuse : 'D_...'" )
        self.layout.label(text = "    Normal = 'N_...'" )
        self.layout.label(text = "    Rougthness = 'R_...'" )
        self.layout.column().operator(TextureName.bl_idname)

classes = [MyPanel, TextureName]

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

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

if __name__ == "__main__":
    register()

Does anybody have an idea ?
Thanks

is this helpful? https://blender.stackexchange.com/questions/109711/how-to-popup-simple-message-box-from-python-console

Does this answer your question: https://blender.stackexchange.com/questions/57306/how-to-create-a-custom-ui

Thanks, but unfortunately no. The problem with a simple UI is that i can't ask to an user to enter text in a loop. I have to create a bpy.props for every texture i want to rename. But the way props are created doesn't work with a loop.

Perhaps you are looking for a UIList then?


text:
Why can't I switch geometry based on instance index?
I'm attempting to create a clock using geometry nodes and want to use roman numerals. I have elected to instance the appropriate models of I V and X based on the instance index around a 12 pointed mesh circle. I thought I could use the geometry switch node by evaluating the index but my initial 'testing the theory' node setup is giving me a red line and I don't understand why.
If I simply use values in the compare node it works fine. If I use the index node it shows this error. Does the index node not simply output an integer? What am I missing?
Blender v3.6.1

The Switch node accepts only a single value as input. You are trying to feed it a list of in index values.

Got it, thanks!


text:
particle system is still rendered after deletion
so I made a particle emitter system only to delete it after, but this shot of the particle still rendered on the screen and when I render the image or the animation, I cant select them to delete them, any help would be appreciated.

Can you share the blend file? https://blend-exchange.com/

the server cannot upload files bigger than 30mb, mine is 45

You could try to reduce the size of the file by only leaving the necessary parts. Maybe in this process you find the culprit causing your issue.

thanks for guidance, i kept looking for a way to get into the project files, and kept deleting unused materials and meshes until i found the issue