text:
How to copy an action strip from one object to another?
I have those two identical armatures. I would like to copy a part of one's animation to the other. I came up with the idea of making an action strip and then I'll copy it. As shown in the pic, I need to copy a3 to the second object.
I used the method of CTRL+L > Animation Data. But copies everything and it affects a2.  Affecting a2 means that in larger projects it'll affect all the strips which isn't a good idea.
I appreciate your ideas :)

Assuming, both armatures have same bone names (etc)
just did a quick test, NLA editor won't let you copy action strips from one object to another via dragging / moving (G key) .
Option 1 (shift + A) in NLA editor will let you pick action as well

Option 2 (as shown in image)
Right now, best way to do is to use 'Action Editor' in Dope Sheet Area. Just use the action there on armature and then use it in NLA

What a great answer! I'll try it today later and get back to you :) Thank you so much :)

The easiest way that I've found currently is to select the object, then select the object you want to copy the data from last. Then hit Ctrl+L and choose to "Link Animation Data". This will not only copy the NLA data tracks, but also the scaling information and any modifiers on those tracks as well.
Thank heavens we don't have to manual copy and re-apply modifiers!


text:
Can I use blender VSE as if it's power point?
I'd like to write some text and animate it. I also would like to put some shapes like arrows, circles, rectangles, and lines. I might need to animate the shapes too. I know that the best software to do it is powerpoint but I'd like to use open source software so does blender VSE has the same efficiency as powerpoint?

There are opensource alternatives to powerpoint. However, Blender is not one of them. I have done a presentation using the opengl viewport. It involved some scripts and hardcoded cameras but wasn't very efficient.

@Leander Okay thank you so much for your comment

Have you considered LibreOffice? It has a module called "Impress" which offers similiar functionality to powerpoint. It's a free, open-source office suite, available for all platforms.

I have done this in Blender for small projects, mainly for the credits section but also for some labels. I found that setting an orthographic camera with a strong sun lamp pointing straight down allowed me to set the render samples very low and still get clear results. Also found duplicating the basic scene handy for keeping everything organised. To make text/basic objects appear and disappear, set the location off screen at one frame and on the next and key frame it, Blender with calculate the interpolation correctly.

source: Stack Exchange

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

sort: votes


text:
Why are Texture Coordinate or UV map used before mapping node?
I learned how to use textures. To control the size texture, I use the Map node. The input of the Map node should be a Texture Coordinate or UV map and it seems that they are very important because when I remove them, the texture disappears. I don't understand what they are and why they must be used. I tried to read the manual but it seems that I'm too beginner to understand it :D I'm not trying to do a specific thing. I'm just asking about the general concept. Thank you,

https://blender.stackexchange.com/questions/57420/confused-about-unwrap-vs-modifier-unwrap

Mapping node only transforms texture coordinates(rotates, scales and moves) while UV Map or Texture Coordinate nodes provide the actual coordinates. It is possible to transform various kinds of vectors with the Mapping node.

I'm sorry for being stupid..what do you mean by the actual coordinates?  :) Do u mean that the UV map sets or controls the coordinates of the texture (or the image) in the 3D space so that it's wrapped on the object ?

Yes, that's pretty much it. But also UV map is only one kind of possible coordinates, there are others.

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


text:
Is there an easy way to create particles and destroy them in an unequal periods of time?
I need to make all particles to appear at once and disappear gradually.
To appear at once, I set the start and end values to be the same.
But they all disappear at once too because of the lifetime value. I think this input value should be replaced with two values so that we can specify the exit or dissolve time of a particle system.

you can create multiple particle systems with high randomization values and keep the lifetimes different

you can also change the lifetime random value


text:
Why does this cube move in the Y-axis even after rotating it?
I'm sure that this is something related to global and local axes but I don't know how to implement that in blender. When you play my animation, you will see that the cube doesn't follow it's new local y axis. It follows the global y axis. How can I change that?
Click here to download my .blend file

That's how it is supposed to happen, you can only save animation datas on the world axis, except for bones, which are children of the armature, or if you make your object child of another object, it can be an empty, then if you rotate the empty the object will rotate as well and follow the axis of its parent, the world axis won’t matter any more. So depending on your goal it might be sometimes useful to use bones or empties.

@moonboots Thanks for commenting. My goal is to create a walcking cycle for a character and make it turn left/right. I just wanted to test turing left and right with this box but It didn't work.

@moonboots For bones, if I animated the root bone (that bone that animated the whole armatre), would it move as I expect? or would it move like the cube?

for a walk cycle the best is to give a Follow Path constraint to your armature so that it follows a curve

@moonboots One more question, please. When I think of the turning left or right while using Follow Path constraint, I feel like the foot of the character will slip or slide every time the radious of the curve changes. So, I need to adjust that every time the character turns left or right. Am I right about that? I hope I'm not :)

yes I guess you need to create a particular animation for when he turns left or right and push it down into the NLA so that it replaces the straight walk   :/

but maybe the Follow Path is not the best solution and it would be better to just duplicate and move the poses forward? I really depends on your movie sequence...


text:
How to create a ball that is able to jump using physics not animation?
I learned how to make a bouncing ball using soft body physics. Visually, I can use part of the ball movements so that it looks like as if the ball is a living creature that is able to jump.
Of course, I can do this using animation but it takes long time and effort.
I got an idea from a question here and I tried to export soft body physics as .mdd file and then I imported it back as shape keys but it didn't look great because there were some location movements and the ball is rotated although I didn't do any rotation.
I would like to ask about the best method or idea that enables me to use the physics system or any other easy system to create a jumping ball. Can I use force field or something similar to create the jump movement easily?
Thank you so much,

I think you would create collision objects that hit the soft body causing it to move and make the collision object invisible to the viewer.

@rob 1 sounds a good idea. Thanks :)


text:
What does this step do in Texture Paint?
I was watching a tutorial about texture paint and the teacher said:

Go to “Active Tool and WorkSpace Settings” tab > Texture Slots section.
   Change the Mode to Single Image. Don’t create a new image. Just pick the name of the image that you’ve just created.

The image that I selected appeared on the object and he said that this connects the image to the object. But I still don't understand what this does or what he means by "connects". Of course, it's not connected to the object as a material. Is this step just to shows us what part of the image are we painting on? Just for a demonstration purpose?

Simple objects or low realism 3D objects may only require a single texture. Do you understand that some 3D objects with complex or high realism appearance may require many textures?  Suppose you present a dull object such as a old ball and you want a optional shiny wet hand print to appear and disappear. This might easily be done with 2 textures.  Thus for the Blender User, Blender gives a mechanism to command which texture the [texture paint] mechanism is to use now in the UI.  Dull and Shiny are just two examples.  These multiple textures are evident in the node system which you can view.

The connection may be evident in the texture nodes for materials because it is the permanent record saved in the Blender file.  Perhaps this is the display of information that may be helpful. Part of that record is called ... slots.


text:
how to use a plan to bisect an object?
I have a character where the hair particles of the back of the head penetrate the head surface and can be seen from the mouth. The picture shows a very simplified model of my issue.
I would like to keep the part of the hair that exists out of the head and delete the rest of it or at least delete the part that appears when you look inside the mouth (if it's open).
I tried the Boolean modifier but they don't work (I think because the head is a plan and has no volume). What else can I try?

Hair object position from the emitter surface is relative to its origin. That mean you can keep it outside modifying the origin point position. For more detail see for instance: https://blender.stackexchange.com/questions/147610/how-to-change-x-location-axis-for-particular-system/147618#147618

It seems that I forgot to mention that they are no longer particles as I already converted them to mesh.  Sorry :)

Now,  it's all about dealing with meshes only.

About the boolean cut, have you tried to convert the head to convex hull (you said this is a plane not a volume).

@lemon No, I didn't. I'll try this soon and I'll get back to you. Thanks :)

@lemon I'm not sure if I didn't the right way. I went to edit mode and selected all the vertices. From Mesh menu, I selected Convex Hull. This destroyed the "shape" of the head. I tried it with the hair as well destroyed it too. I created it from the default cube and what I meant by plane is that the walls that the head is made of are very thin (like what the picture shows).

Difficult to do it with another mesh to show you. That could work or not depending on the geometry and boolean operation. But convex hull is for the head only in the idea.

@lemon Thank you so much lemon for your assistance. That's really appreciated. I know I ask hard questions. It's just because I'm too curious :) I'll do it manually. I'll go to edit mode (for the hair) and zoom inside the mouth and try to get rid of  the extra faces of hair.

What you can try is to make a sphere that is more or less deformed to fit your needs and use it for boolean operation on the hair. The guess is is the sphere is more regular, so it should work better with the modifier.

A sphere is a good idea. It'll make the process easier. Thanks again :)


text:
How to render in almost real-time (eevee)?
The animation is played very smoothly at 20-24 frames per second (fps) in the viewport.
This means it takes about 1/20 seconds to render one frame. That's a tiny fraction of a second.
When I press F12 to render, It takes 20 seconds to render a single frame. That's x400 increase in the rendering time of a frame!
I reduced the number of rendering samples to be less than the number of the viewport samples and reduces some other things that may affect the rendering speed but it still takes about 5 seconds to render a single frame. For me, This is still too much given that my PC was able to play the animation in real-time.

https://blender.stackexchange.com/questions/112597/why-does-eevee-take-more-time-when-it-is-rendered-from-the-button-than-viewing-i

Hi @DuarteFarrajotaRamos Thanks for providing the link to that question. I did an experiment based on that. I calculated my viewport dimensions roughly. Viewport takes about a quarter of the area of my screen. My screen resolution is 12801024. This means the viewport resolution is 320256. I also set the rendering samples to be 8 samples only (viewport is 16). The result is the rendering time is still high 1.20 seconds instead of 0.05 seconds (real-time).

@DuarteFarrajotaRamos I think there are some other factors that mainly affect the rendering speed and I would like to know them :)

@DuarteFarrajotaRamos One of the factors that I discovered is the subdivision surface modifier. I play the viewport with it disabled but I render it. This reduced the rendering time by half (0.5 seconds).


text:
Blender 2.8 interface becomes so laggy
I downloaded blender 2.8 a couple of weeks ago and it was working fine. Yesterday, the interface became so laggy. I'm not able to spot the issue because I didn't install a new software or something like that. Maybe I tried to install Quick Functions and Power Sequencer addons but I deleted them and the issue still presists. I also tried to load factory settings and other things but no avail.
Version: 2.80 (sub 37), branch: blender2.8, commit date: 2018-12-12 23:51, hash: 81ea815dcb6, type: Release
build date: 2018-12-13, 00:07:18
Operating System : xubuntu-18.04


text:
How to zoom world HDR image?
I use environment texture as a "material" for my world to produce light and a nice background. When I move my camera to zoom in, the objects zoom but the background doesn't zoom. The only way to get around this is to change the Focal Length of the camera but it is not practical because it's very hard to do with many camera movements. Is there any way to get around this?

I am not sure what do you mean by this question, what is the actual problem? How does your scene look and how should it look? Also resizing HDRI is a bit not working, because environment texture is mapped to a theoretical sphere of infinite radius, changing of its scale would not change the angular increments of its spherical projection, and would thus not be perceived as different in scale... If you however want a specific part of your HDRI to be a part of your background, you need to add a mapping node to your texture and scale/rotate it (if you scale it too much you will see distortion)


text:
world image texture in the viewport is different from the render
For the same frame, I show my viewport and rendered image. They are different.
The world texture is not rotated correctly. I think it might be the rotation value around the Z-axis is not implemented during rendering but I'm not sure if this is the reason or not so this is my world material:

is the gray background part of your image?

Yesss, it is. Just a different rotation.

could you please pack the image and share the file? (delete all the useless objects)

I'm so sorry to bother you. When I deleted everything, the issue is resolved. I inspected again and I found a very big Icosphere that I previously made. It surrounds my scene and It has the same image. I hid it from the viewport but I forgot to hide it from render. Sorry again :)

ah ah nice then   ;)


text:
I need a code to get the current value of the waveform from an audio file at specific frame
I would like to build a function that does something based on the current value of the waveform of an audio.
Inputs:

An audio file: like a speaker object or a path on the hard drive or a track name in VSE or whatever.
Frame number.

Outputs:

A number that represents how high or low the audio is. But I don't need to get the volume which is constant by default (100%). I need to get a number that represents the current point on the waveform.

Is there a python code that does the following? I'll use it for something like visualization and auto move the mouth (auto speak).

https://blender.stackexchange.com/search?q=bake+sound+to+fcurve

@batFINGER But that's too direct. What If I need to play with fcurve after baking? Is there an easy method to change the key frames (add/remove/edit value)?

once a sound is "baked" can get any  value with fcurve.evaluate(frame) .  Didn't download but suggest it relates to "I need".. and no to little research.   Personally find the aubio module very good for this and have put together a lot of new code to replace blenders bake ... Some related links https://blender.stackexchange.com/questions/127895/how-can-you-invert-an-f-curve  https://blender.stackexchange.com/questions/39231/whats-the-range-of-values-on-a-sound-baked-f-curve/39241#39241  https://blender.stackexchange.com/questions/171087/how-to-add-a-minimum-value-to-f-curves

Re un-baking an fcurve have posted re this .. couldn't find, however found this link https://blender.stackexchange.com/questions/19357/smoothing-a-baked-f-curve  (** didn't down-vote (not download))

@batFINGER well, I did my own research but I didn't find something useful. I was thinking about scripted expressions (drivers) from my research but not that useful. I'll try to read your links and get back to you. Thanks for helping.

Re scripting drivers. Spent far too much time on this one https://github.com/batFINGER/batFINGER-blender-addons   IIRC also added lip-sync. Have since moved to using aubio, scipy, numpy, matplotlib  .. but still way back on back burner. Can dig up some code re aubio -> blender fcurve.

I would recommend looking at other forums on python for how to read audio files. This is not possible with blender’s normal API usage. You would need to go through Python.

Pygame. I believe that pygame.mixer can return a sound as an array which will give you the individual samples. This is what you need.
Wave. A module for reading the data in wave audio files.

You may not be able to install these Python packages to blender’s copy of Python, But you might be able to run python externally to convert an audio file into your own, native-Python-readable format for blender to open.

"You may not be able to install these Python packages to blender’s copy of Python" - according to this source: https://docs.blender.org/api/current/info_tips_and_tricks.html you can remove Blender Python subdirectory in order for Blender to fall back to system Python, in which you could install needed packages.

Oh!  thx for that.

I had a similar need was able to get something working for .wav files
 average_sound_level = np.mean(np.abs(frame_data))
                print(f"Frame {specific_frame}: Average Audio Level = {average_sound_level:.2f}")

frame_data: This variable contains the audio samples for the specific frame being analysed. Each sample is a numerical representation of the audio signal's amplitude at that moment in time.
np.abs(frame_data): This function takes the absolute value of each sample in frame_data. Since audio levels can be both positive and negative (representing the waveform above and below zero), taking the absolute value converts all samples to non-negative numbers. This helps in calculating the average level without cancellation of positive and negative values.
np.mean(...): This function calculates the average (or mean) of the absolute values of the audio samples. The average sound level gives a sense of the overall loudness of the audio for that specific frame. A higher average indicates a louder sound, while a lower average indicates quieter or silent audio.
For the whole script I used the following: (Note that I am new and for some reason
import bpy
import wave
import numpy as np

# Set the frame to analyze
specific_frame = 400  # Change this to the frame you want to analyze
frame_rate = 30  # Set to your actual frame rate

# Specify the name of the audio strip
audio_strip_name = "WHAT_EVER_BLENDER_NAMED_THIS"  # Blender's naming convention which you can find in the strip tab (you will see the name at the top once you are in the stip tab)

# Get the audio strip
audio_strip = bpy.context.scene.sequence_editor.sequences.get(audio_strip_name)

if audio_strip and audio_strip.type == 'SOUND':
    sound_path = bpy.path.abspath(audio_strip.sound.filepath)  # Convert to absolute path

    # Load the sound file using wave
    try:
        with wave.open(sound_path, 'rb') as wf:
            num_frames = wf.getnframes()
            sample_rate = wf.getframerate()

            # Calculate samples per frame based on the specified frame rate
            samples_per_frame = (sample_rate // frame_rate) * 2

            # Calculate sample positions for the specific frame
            start_sample = (specific_frame - 1) * samples_per_frame
            end_sample = start_sample + samples_per_frame

            # Read the audio data
            audio_data = wf.readframes(num_frames)
            audio_data = np.frombuffer(audio_data, dtype=np.int16)

            # Ensure we do not exceed the audio data length
            if end_sample <= len(audio_data):
                frame_data = audio_data[start_sample:end_sample]

                # Calculate and print the average volume
                average_sound_level = np.mean(np.abs(frame_data))
                print(f"Frame {specific_frame}: Average Audio Level = {average_sound_level:.2f}")
            else:
                print(f"Frame {specific_frame}: Exceeded audio data length.")

    except FileNotFoundError:
        print("The audio file was not found. Please check the path.")
else:
    print("Audio strip not found or it is not a sound strip. Please check the name of your audio clip.")
```


text:
Why do the bones move when editing an action strip in the NLA editor?
I just need to do a simple thing which is editing an action. I press Tab after selecting the action to enter the edit mode.

All of the sudden, the mesh moves before making any edits! Look at the arms. What could be the reason? I know I'm missing a simple thing.

To be honest, I haven't pushed down an action that moves a single bone controlling the mouth. When I push it down, the issue is resolved. But I still want to learn. If I should guess an issue to happen, I would expect it to happen to the mouth or the eyes. But why the arms and the upper legs bones move too? They have nothing to do with the action that is not pushed down or the action that I'm trying to edit. Blender v2.93 experimental is used.

Sounds like expected behaviour of  https://docs.blender.org/manual/en/latest/editors/nla/editing.html#start-editing-stashed-action  ie putting tweak strip in solo mode & hence removing any influence of other strips.  Is that pretty much the rest pose?

@batFINGER That brings another 3 points. First, this is not my rest pose because the legs are bent so I don't think this is the solo mode. Seconds, I entered the tweak mode of other action strips but they don't do the same issue. Only two actions strips do the issue (the eye blinking one and the action below it that controls the legs). Third, I put the "eye blinking" action in the solo mode by pressing the Star icon but it doesn't give the same result. I don't know what's going on :)


text:
What is "Factor" in Point Scale (Geo Nodes)?
If I want to use this node on the "Attribute" mode, how can I use it? what is it used for?
I tried to play by typing some built-in attributes next to the Factor input. It changed the scale but I still don't know how to use it. I mean how is the scale calculated?
The manual says:

Use the values from the attribute to move each point by a different
amount.

Why points should be moved? Is it about scaling or moving or both? or is it just my english?
I know how to use the "Vector" mode.

The link to the manual is broken, Do you mean this? Point Scale
But your quote is actually from Point Translation. In the title of this question you wrote Point Scale. I think you confused them, didn't you?

@Blunder Yes, that's the link (point scale). If you read the subtitle (Attribute), you'll find the quote. Maybe it's confused in the manual. That's why I'm asking.

You can use this node to scale points by amount in a specific attribute. For example, I generated an attribute using Attribute Proximity node.  Attribute Proximity generates attribute based on distance between vertex and closest point in geometry, I called it "new_attr":

Next I scaled vertexes by this attribute. Of course, to view scale you need to have some instances distributed by them, so I distribute Suzannes.


text:
How to write Arabic text in Blender VSE?
Many non-English languages (including Arabic) are not supported. Letters and words cannot be understood. This issue lasted for a very long time and still exists. Some add-ons were made for the 3D viewport but I think they are now obsolete and may have major bugs. No addons were made for VSE at all. Arabic speakers struggled enough trying to get around this (like typing the text in an external software then, saving it as an image). This is a basic/essential function that must exist in Blender, just like any other software.

I created this FREE add-on to make Blender VSE support the Arabic language.
What the addon does:
After you write Arabic text, you click a button to correct the shapes of the letters, and connect the letters in a proper way (according to the Arabic grammar and writing rules).
How to use:

Create a strip in VSE.
Write some text (It will look incorrect).
Click "Correct Text" button and the text will be fixed/corrected as shown.

Video tutorial:
It contains more info about how to install and use. You will see the add-on tested and working live.
https://youtu.be/iFeGGFd3I84
Download Link:
https://88k88.blogspot.com/2021/07/how-to-write-arabic-language-in-blender.html
Source Code:
This may be helpful for you if you're a programmer or a developer:
bl_info = {
    "name": "Arabic Text Correction",
    "author": "Michael George",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "description": "After writing arabic text, this addon corrects it",
    "doc_url": "",
}

import bpy
text_buffer = []
current_char_index = 0
arabic_chars = ['ا', 'أ', 'إ', 'آ', 'ء', 'ب', 'ت', 'ث', 'ج','ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص','ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل','م', 'ن', 'ه', 'ة', 'و', 'ؤ', 'ي', 'ى', 'ئ', 'ـ']
right_connectable_chars = ['ا', 'أ', 'إ', 'آ', 'ب', 'ت', 'ث', 'ج', 'ح','خ', 'د', 'ذ', 'ر', 'ز', 'س', 'ش', 'ص', 'ض','ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل', 'م','ن', 'ه', 'ة', 'و', 'ؤ', 'ي', 'ى', 'ئ', 'ـ']
left_connectable_chars = ['ب', 'ت', 'ث', 'ج', 'ح', 'خ', 'س', 'ش', 'ص','ض', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ك', 'ل','م', 'ن', 'ه', 'ي', 'ى', 'ئ', 'ـ']
chars_variants_bases = [0xFE8D, 0xFE83, 0xFE87, 0xFE81, 0xFE80, 0xFE8F, 0xFE95, 0xFE99, 0xFE9D,0xFEA1, 0xFEA5, 0xFEA9, 0xFEAB, 0xFEAD, 0xFEAF, 0xFEB1, 0xFEB5, 0xFEB9,0xFEBD, 0xFEC1, 0xFEC1, 0xFEC9, 0xFECD, 0xFED1, 0xFED5, 0xFED9, 0xFEDD,0xFEE1, 0xFEE5, 0xFEE9, 0xFE93, 0xFEED, 0xFE85, 0xFEF1, 0xFEEF, 0xFE89]
chars_arabic_symbols = ['ـ', '،', '؟', '×', '÷']
chars_common = [' ', '.', ',', ':', '|', '(', ')', '[', ']', '{', '}', '!', '+', '-', '*', '/', '\\', '%', '"', '\'', '>', '<', '=', '~', '_']
chars_digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']

#some functions and/or classes are derived from the Arabic text addon.
def is_right_connectable(c):

    if c in right_connectable_chars:

        return True

    return False
def is_left_connectable(c):

    if c in left_connectable_chars:

        return True

    return False
def get_char_index(c):

    if c not in arabic_chars:

        return -1

    return arabic_chars.index(c)
def get_char_variants_base(c):

    char_index = get_char_index(c)

    if char_index == -1:

        return -1

    return chars_variants_bases[char_index]
def is_arabic_char(c):

    if c in arabic_chars:

        return True

    return False
def is_arabic_char_variant(c):

    if ord(c) >= 0xFE70 and ord(c) <= 0xFEFE:
        return True

    return False
def get_previous_alphabet(index, text):

    index -= 1

    while index > 0 and (text[index] in chars_common or text[index] in chars_digits or text[index] in chars_arabic_symbols):
        index -= 1

    if index >= 0:
        return text[index]
    else:
        return None
def get_next_alphabet(index, text):

    index += 1

    while index < len(text) and (text[index] in chars_common or text[index] in chars_digits or text[index] in chars_arabic_symbols):
        index += 1

    if index < len(text):
        return text[index]
    else:
        return None

def link_text(unlinked_text):

    linked_text = []

    previous_char = ""

    next_char = ""

    char_code = 0

    skip_char = False

    uncounted_chars = 0

    #

    for current_char in unlinked_text:

        #

        if skip_char:
            skip_char = False
            continue

        #

        previous_char = ""
        next_char = ""

        #

        chars_count = len(linked_text) + uncounted_chars

        if chars_count > 0:
            previous_char = unlinked_text[chars_count - 1]

        if chars_count < len(unlinked_text) - 1:
            next_char = unlinked_text[chars_count + 1]

        if current_char == 'ل':

            if next_char == 'ا':

                char_code = 0xFEFB

            elif next_char == 'أ':

                char_code = 0xFEF7

            elif next_char == 'إ':

                char_code = 0xFEF9

            elif next_char == 'آ':

                char_code = 0xFEF5

            else:

                char_code = 0

            if char_code != 0:

                if is_left_connectable(previous_char):

                    char_code += 1

                linked_text.insert(0, chr(char_code))

                uncounted_chars += 1

                skip_char = True

                continue

        #

        if current_char in chars_arabic_symbols:

            linked_text.insert(0, current_char)

            continue

        if current_char == '\n':

            linked_text.insert(0, current_char)

            continue

        #

        if current_char in chars_common:

            previous_alpha = get_previous_alphabet(chars_count, unlinked_text)
            next_alpha = get_next_alphabet(chars_count, unlinked_text)

            char_pos = 0

            if not is_arabic_char(previous_alpha) and not is_arabic_char(next_alpha) and previous_alpha != '\n':

                while char_pos < len(linked_text) and not is_arabic_char_variant(linked_text[char_pos]) and linked_text[char_pos] != '\n':
                    char_pos += 1

            linked_text.insert(char_pos, current_char)

            continue

        #

        char_code = get_char_variants_base(current_char)

        if char_code == -1:   # = Not an arabic character

            #

            previous_alpha = get_previous_alphabet(chars_count, unlinked_text)
            next_alpha = get_next_alphabet(chars_count, unlinked_text)

            char_pos = 0

            #

            if len(linked_text) > 0 and linked_text[0] in chars_digits:

                while char_pos < len(linked_text) and linked_text[char_pos] in chars_digits:
                    char_pos +=1

            #

            elif not is_arabic_char(previous_alpha):

                c = chars_count - 1

                while not is_arabic_char(previous_alpha) and char_pos < len(linked_text) and linked_text[char_pos] != '\n':

                    previous_alpha = get_previous_alphabet(c, unlinked_text)
                    char_pos += 1
                    c -= 1

            linked_text.insert(char_pos, current_char)

            continue

        #

        if is_left_connectable(previous_char) and is_right_connectable(current_char):

            if is_left_connectable(current_char) and is_right_connectable(next_char):

                char_code += 3

            else:

                char_code += 1
        else:

            if is_left_connectable(current_char) and is_right_connectable(next_char):

                char_code += 2

        linked_text.insert(0, chr(char_code))

    text = ''.join(linked_text)

    return text
def swap_lines(linked_text):

    new_text = []

    current_line_start = 0

    char_counter = 0

    for c in reversed(linked_text):

        if(c == '\n'):

            new_text.append('\n')

            current_line_start = char_counter + 1

            char_counter += 1

            continue

        new_text.insert(current_line_start, c)

        char_counter += 1

    return ''.join(new_text)
def unlink_text(linked_text):

    #

    unlinked_text = []

    #

    for c in linked_text:
        if ord(c) in {0xFE8D, 0xFE8E}:
            unlinked_text.insert(0, 'ا')
        elif ord(c) in {0xFE83, 0xFE84}:

            unlinked_text.insert(0, 'أ')

        elif ord(c) in {0xFE87, 0xFE88}:

            unlinked_text.insert(0, 'إ')

        elif ord(c) in {0xFE81, 0xFE82}:

            unlinked_text.insert(0, 'آ')

        elif ord(c) in {0xFE80}:

            unlinked_text.insert(0, 'ء')

        elif ord(c) in {0xFE8F, 0xFE90, 0xFE91, 0xFE92}:

            unlinked_text.insert(0, 'ب')

        elif ord(c) in {0xFE95, 0xFE96, 0xFE97, 0xFE98}:

            unlinked_text.insert(0, 'ت')

        elif ord(c) in {0xFE99, 0xFE9A, 0xFE9B, 0xFE9C}:

            unlinked_text.insert(0, 'ث')

        elif ord(c) in {0xFE9D, 0xFE9E, 0xFE9F, 0xFEA0}:

            unlinked_text.insert(0, 'ج')

        elif ord(c) in {0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4}:

            unlinked_text.insert(0, 'ح')

        elif ord(c) in {0xFEA5, 0xFEA6, 0xFEA7, 0xFEA8}:

            unlinked_text.insert(0, 'خ')

        elif ord(c) in {0xFEA9, 0xFEAA}:

            unlinked_text.insert(0, 'د')

        elif ord(c) in {0xFEAB, 0xFEAC}:

            unlinked_text.insert(0, 'ذ')

        elif ord(c) in {0xFEAD, 0xFEAE}:
            unlinked_text.insert(0, 'ر')

        elif ord(c) in {0xFEAF, 0xFEB0}:

            unlinked_text.insert(0, 'ز')

        elif ord(c) in {0xFEB1, 0xFEB2, 0xFEB3, 0xFEB4}:

            unlinked_text.insert(0, 'س')

        elif ord(c) in {0xFEB5, 0xFEB6, 0xFEB7, 0xFEB8}:

            unlinked_text.insert(0, 'ش')

        elif ord(c) in {0xFEB9, 0xFEBA, 0xFEBB, 0xFEBC}:

            unlinked_text.insert(0, 'ص')

        elif ord(c) in {0xFEBD, 0xFEBE, 0xFEBF, 0xFEC0}:

            unlinked_text.insert(0, 'ض')

        elif ord(c) in {0xFEC1, 0xFEC2, 0xFEC3, 0xFEC4}:

            unlinked_text.insert(0, 'ط')

        elif ord(c) in {0xFEC5, 0xFEC6, 0xFEC7, 0xFEC8}:

            unlinked_text.insert(0, 'ظ')

        elif ord(c) in {0xFEC9, 0xFECA, 0xFECB, 0xFECC}:

            unlinked_text.insert(0, 'ع')

        elif ord(c) in {0xFECD, 0xFECE, 0xFECF, 0xFED0}:

            unlinked_text.insert(0, 'غ')

        elif ord(c) in {0xFED1, 0xFED2, 0xFED3, 0xFED4}:

            unlinked_text.insert(0, 'ف')

        elif ord(c) in {0xFED5, 0xFED6, 0xFED7, 0xFED8}:

            unlinked_text.insert(0, 'ق')

        elif ord(c) in {0xFED9, 0xFEDA, 0xFEDB, 0xFEDC}:

            unlinked_text.insert(0, 'ك')

        elif ord(c) in {0xFEDD, 0xFEDE, 0xFEDF, 0xFEE0}:

            unlinked_text.insert(0, 'ل')

        elif ord(c) in {0xFEE1, 0xFEE2, 0xFEE3, 0xFEE4}:

            unlinked_text.insert(0, 'م')

        elif ord(c) in {0xFEE5, 0xFEE6, 0xFEE7, 0xFEE8}:

            unlinked_text.insert(0, 'ن')

        elif ord(c) in {0xFEE9, 0xFEEA, 0xFEEB, 0xFEEC}:

            unlinked_text.insert(0, 'ه')

        elif ord(c) in {0xFE93, 0xFE94}:

            unlinked_text.insert(0, 'ة')

        elif ord(c) in {0xFEED, 0xFEEE}:

            unlinked_text.insert(0, 'و')

        elif ord(c) in {0xFE85, 0xFE86}:

            unlinked_text.insert(0, 'ؤ')

        elif ord(c) in {0xFEF1, 0xFEF2, 0xFEF3, 0xFEF4}:

            unlinked_text.insert(0, 'ي')

        elif ord(c) in {0xFEEF, 0xFEF0}:

            unlinked_text.insert(0, 'ى')

        elif ord(c) in {0xFE89, 0xFE8A, 0xFE8B, 0xFE8C}:

            unlinked_text.insert(0, 'ئ')

        elif ord(c) in {0xFEFB, 0xFEFC}:

            unlinked_text.insert(0, 'ا')
            unlinked_text.insert(0, 'ل')

        elif ord(c) in {0xFEF7, 0xFEF8}:

            unlinked_text.insert(0, 'أ')
            unlinked_text.insert(0, 'ل')

        elif ord(c) in {0xFEF9, 0xFEFA}:

            unlinked_text.insert(0, 'إ')
            unlinked_text.insert(0, 'ل')

        elif ord(c) in {0xFEF5, 0xFEF6}:

            unlinked_text.insert(0, 'آ')
            unlinked_text.insert(0, 'ل')

        else:

            unlinked_text.insert(0, c)

    return unlinked_text

def init():

    global current_char_index
    global text_buffer

    if bpy.context.object is None or bpy.context.object.type != 'FONT' or bpy.context.object.mode != 'EDIT':

        return

    text_buffer = swap_lines(bpy.context.object.data.body)
    text_buffer = unlink_text(text_buffer)

    addon_dir = os.path.dirname(os.path.realpath(__file__))
    new_font = os.path.join(addon_dir, "bmonofont-i18n.ttf")

    if os.path.exists(new_font):
        bpy.context.object.data.font = bpy.data.fonts.load(new_font, check_existing=True)

    bpy.context.object.data.align_x = 'RIGHT'

    current_char_index = 0

    update_visual_cursor_position()

#

def update_text():

    global text_buffer
    global current_char_index

    linked_text = link_text(text_buffer)
    linked_text = swap_lines(linked_text)

    bpy.ops.font.select_all()
    bpy.ops.font.delete()
    bpy.ops.font.text_insert(text=linked_text)

    update_visual_cursor_position()

def insert_text(char):

    global text_buffer
    global current_char_index

    text_buffer.insert(current_char_index, char)

    current_char_index += 1

    update_text()

def move_previous():

    global current_char_index

    if current_char_index > 0:

        current_char_index -= 1

        # update_text()

    update_visual_cursor_position()

def move_next():

    global text_buffer
    global current_char_index

    if current_char_index < len(text_buffer):

        current_char_index += 1

    update_visual_cursor_position()

def move_line_start():

    global text_buffer
    global current_char_index

    while current_char_index > 0:

        current_char_index -= 1

        if text_buffer[current_char_index] == '\n':

            current_char_index += 1

            break

    update_visual_cursor_position()

def move_line_end():

    global text_buffer
    global current_char_index

    while current_char_index < len(text_buffer):

        if text_buffer[current_char_index] == '\n':

            break

        current_char_index += 1

    update_visual_cursor_position()

def move_up():

    global text_buffer
    global current_char_index

    line_start = get_line_start()
    line_offset = current_char_index - line_start

    previous_line_end = line_start - 2

    previous_line_start = get_line_start(previous_line_end)

    previous_line_size = previous_line_end - previous_line_start

    new_index = previous_line_start + min(line_offset, previous_line_size + 1)

    if is_valid_char_index(new_index):

        current_char_index = new_index
        update_visual_cursor_position()

def move_down():

    global text_buffer
    global current_char_index

    new_line_size = 0

    line_start = get_line_start()
    line_offset = current_char_index - line_start

    new_index = get_next_line_start()

    if new_index == -1:

        return

    for i in range(line_offset):

        if not is_valid_char_index(new_index):

            break

        if text_buffer[new_index] == '\n':

            break

        new_index += 1

    if is_valid_char_index(new_index) or new_index == len(text_buffer):

        current_char_index = new_index
        update_visual_cursor_position()

def delete_previous():

    global current_char_index

    if current_char_index > 0:

        text_buffer.pop(current_char_index - 1)

        current_char_index -= 1

        update_text()

def delete_next():

    global text_buffer
    global current_char_index

    if is_valid_char_index(current_char_index):

        del(text_buffer[current_char_index])

        update_text()

#

def get_line_start(index=-1):

    global text_buffer
    global current_char_index

    line_start = current_char_index if index == - 1 else index

    while line_start > 0:

        line_start -= 1

        if text_buffer[line_start] == '\n':

            line_start += 1

            break

    return line_start

#

def get_next_line_start():

    global text_buffer
    global current_char_index

    next_line_start = current_char_index

    while next_line_start < len(text_buffer):

        if text_buffer[next_line_start] == '\n':

            next_line_start += 1

            break

        next_line_start += 1

        if next_line_start == len(text_buffer):

            return -1

    return next_line_start

#

def is_valid_char_index(index):

    if len(text_buffer) > 0 and index >= 0 and index < len(text_buffer):

        return True

    return False

def update_visual_cursor_position():

    global text_buffer
    global current_char_index

    for i in range(len(text_buffer)):

        bpy.ops.font.move(type='PREVIOUS_CHARACTER')

    #

    current_line_start = get_line_start()

    for i in range(current_line_start):

        if text_buffer[i] == '\n':

            bpy.ops.font.move(type='NEXT_LINE')

    bpy.ops.font.move(type='LINE_END')

    for i in range(current_line_start, current_char_index):

        if text_buffer[i] in {'ا', 'أ', 'إ', 'آ'}:

            if i > 0 and text_buffer[i - 1] == 'ل':

                continue

        bpy.ops.font.move(type='PREVIOUS_CHARACTER')

class HelloWorldOperatorBtn(bpy.types.Operator):
    """Select the strip first. Write Arabic text. Then, press this button"""
    bl_idname = "wm.hello_world"
    bl_label = "Correct Text"
    bl_options = {'REGISTER', 'UNDO'}
    text : bpy.props.StringProperty(name="Enter Arabic Text Here", default="")
    def execute(self, context):
        print("Hi World")
        myArobj = bpy.context.scene.sequence_editor.active_strip
        myArobj.text = link_text(myArobj.text)
        return {'FINISHED'}
bpy.utils.register_class(HelloWorldOperatorBtn)
class HelloWorldPanel(bpy.types.Panel):
    bl_label = "Arabic Text Correction"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type =  'SEQUENCE_EDITOR'
    bl_region_type = 'UI'
    bl_category = 'Strip'
    bl_context = "object"
    def draw(self, context):
        layout = self.layout
        cobjext = context.object
        row = layout.row()
        row.operator("wm.hello_world")
def register():
    bpy.utils.register_class(HelloWorldPanel)
def unregister():
    bpy.utils.unregister_class(HelloWorldPanel)
if __name__ == "__main__":
    register()


text:
How can I use Visual Keys?
I have a cube with a Follow Path constraint. In the first part of the animation, I need it to move along the path. In the second part of the animation, I need it to be free of constraints and move according to keyframes.
I know that using the normal keyframes will cause the cube to jump to its original position after disabling the constraint. I also know that the answer is to use Visual Keys. I tried using them but the cube also jumps to far places.
I would appreciate it if you write the steps of getting rid of constraints like Child Of and Follow Path and keeping the cube at the same position so that I can continue the animation with keyframes or even add another constraint.

This is not employing Visual keys but these examples do allow you to switch freely between constraints, animation and physics. Something akin to this - Rigidbody - Change Dynamic simulation to animatic -
Go to the link at bottom and at the bottom of that answer again there is a demo, switching from animated and physics and back again, along with a path constraint thrown in for good measure.
You can use model duplication or if the model is complex, use a 'Child-of' constraint's influence slider as described along the way.
Additionally a path constraint can be departed from mid-length as shown here (the 2nd path wouldn't be needed) -
How to sequence paths?
If the path has been followed to the end, it's constraint will become ineffective anyway. The model can be freely animated.
Another alternative is to bake the constraint action to keyframes and after deleting any redundant Dopesheet strips, the model is again free to do as you wish. Make sure to tick all boxes in the bake panel.
I've thrown this together in a hurry as it's quite late and will elaborate if you need more detail.


text:
How to remove the effect of current rotation while rotating a bone (Python)?
The answer in this question is great : How to rotate a bone using python
I use it to rotate bones in Pose mode but it adds the current angle to the new angle instead of setting the new angle regardless of what the current angle is.
Example:
I run the code to set the rotation of a bone to be 10 deg.
I run it again to set a new rotation of 20 deg. But I get 30 deg instead. I get the summation or the effect of the two codes. I need to get the last code's effect only. How can I do that?

If the rotation is directly assigned to bone.rotation_euler then the it will not accumulate, unlike when you're using bone.rotation_euler.rotate_axis().
import bpy
import math
import mathutils

def rotate_bone(armature, bone, rotation_euler):
    # Remember active object and its mode
    old_active_object = bpy.context.view_layer.objects.active
    old_mode = old_active_object.mode

    # Set the armature as active object and switch to pose mode
    armature = bpy.data.objects[armature]
    bpy.context.view_layer.objects.active = armature
    bpy.ops.object.mode_set(mode='POSE')

    # Set the rotation mode to use euler angles and adjust the
    # rotation of the bone
    bone = armature.pose.bones[bone]
    bone.rotation_mode = 'XYZ'
    bone.rotation_euler = rotation_euler

    # Restore previously active object and its mode
    bpy.context.view_layer.objects.active = old_active_object
    bpy.ops.object.mode_set(mode=old_mode)

if __name__ == "__main__":
    rot_x = math.radians(10.0)
    rot_y = math.radians(0.0)
    rot_z = math.radians(0.0)
    rotation_euler = mathutils.Euler((rot_x, rot_y, rot_z), 'XYZ')
    rotate_bone('Armature', 'Bone', rotation_euler)

Relative vs Absolute.
The "accumulative" nature is the nature of a 3D transform, ie rotate the bone from where it is by this much about an axis.
Whereas you wish to set the absolute rotation.
As well as using method in accepted answer, contend you could also pre-set the rotation to zero before applying any transform, for example if the rotation mode is euler
posebone.rotation_euler = (0, 0, 0)

Zeroing before applying a rotation will result in an absolute value.  Could say, absolute is relative from zero.
Matrices
The following will zero rotation of a pose bone, regardless of its rotation mode, Euler, Quaternion or Angle Axis.
Using matrices can zero the rotation by finding the inverse of the rotation part of the matrix and pre or post multiplying. The inverse of a rotation matrix is the relative rotation to apply to rotate back to zero.
The top left 3x3 submatrix of a 4x4 transform matrix is the rotation part.  A rotation matrix is orthogonal, hence the transpose is also the inverse (a cheaper calculaton)
>>> pb = C.object.pose.bones['Bone']
>>> M = pb.matrix_basis.to_3x3().transposed().to_4x4()
>>> pb.matrix_basis @= M

To set the rotation from whatever to 22 degrees about Z in whatever rotation mode
>>> R = Matrix.Rotation(radians(22), 4, 'Z')
>>> M = pb.matrix_basis.to_3x3().transposed().to_4x4()
>>> pb.matrix_basis = R @ M @ pb.matrix_basis

or similarly using below as rotation matrix, will set a pose bone of any rotation mode to the euler equivalent without the need to set the mode.
>>> R = Euler((0, 0, radians(22)), 'XYZ').to_matrix().to_4x4()

Why?  what if I don't want all the bones changed to 'XYZ' Euler, and instead want to keep all as assigned, using above can keyframe with something like
pb.matrix_basis = R @ M @ pb.matrix_basis

if pb.rotation_mode == 'AXIS_ANGLE':
    pb.keyframe_insert("rotation_axis_angle")
elif pb.rotation_mode == 'QUATERNION':
    pb.keyframe_insert("rotation_quaternion")
else:
    pb.keyframe_insert("rotation_euler")


text:
Why does Emission shader dilute colors? EEVEE
I would like to create an “outer glow” to Suzanne the monkey so that It emits some red and purple lights (and the plane should reflect them).
To illuminate the monkey, I added the Emission shader and there are two cases:

Using low strength values keeps the colors but it doesn’t emit enough
light.
Using high strength values emits the required light but the colors of the monkey change!

Changing the bloom settings is not a good idea for me as it affects the lighting in the whole scene and other glowing objects.
I tried to use Light Path node but it didn't help or maybe I didn't know how to use it properly.

I need to emit light with the same red and purple colors (not yellow and purple with white line separating the two colors). How can I solve this?

Hello :). Meshlights in Eevee are considerably limited: https://blender.stackexchange.com/q/99631/, https://blender.stackexchange.com/q/101244/

Just to add - Light Path node is also limited in Eevee.

It's not the emission shader.  It's the color transform.  Sorry, if you want to change bloom, you need to change bloom settings, and adjust your other objects to match, or else use multiple render layers.

https://blender.stackexchange.com/questions/46825/render-with-a-wider-dynamic-range-in-cycles-to-produce-photorealistic-looking-im

Hey,I would suggest you to just turn off the bloom in render settings and then add it after rendering in compositing. This way, you can get desired color with Suzan and still be able to control bloom in compositing.

@Rajjaiswal Wow, I know nothing about compositing but I'll try to learn it. It sounds a great idea. Thanks a lot.

added a comment but I think it's an complete answer.
So, here's what you can do.
Turn off bloom settings in eevee and use emmision strength of just 1.
Now,render the thing. After that,go into the compositing tab and click on use nodes. Add in a flare node just before output node. Now you can use bloom effect without changing the mesh's colour.
You can watch this video if you had any problem using glare node-
https://youtu.be/SN8nJXn7CqI

I guess there is more than one way to do this. I would have tried a RGB-Curve node with a Vector-Math multiplier before and probably after to tweak things (dial back the Green). Skip the color ramp and mapping nodes.


text:
Sometimes, rigid body works!
I'm trying to simulate a very basic rigid body setup. I want it to start from frame 297 (not from the beginning). I do this by animating the Dynamic property. Everything works but at the first few frames only. I mean when I enable the Dynamic say at frame 23 it works and the object starts to fall down at frame 23. When I enable the Dynamic say at frame 80 or 200 or 297 or whatever, it doesn't work. It seems that it's something to do with catch or baking or something similar. How can I solve this? It doesn't calculate the physics of the later frames.

please provide blend file

@Chris Thanks I already knew the answer a few seconds after i posted this question. Thanks for trying to help

Oh, I've just discovered it. I can control the cache from the Scene Properties tab. I thought it is in the physics tab just like particle system and some other physics systems.


text:
Is there a method or an addon where I can use G,R,S with the preview screen of the VSE?
I'm talking about the feature in Openshot and sony vegas where you can select the items in the preview screen and drag/move/rotate/scale them.
In VSE, it seems that I need to select the item in the timeline and press the N-Panel. Then, play with the properties. But I can't do this from the viewport as far as I know. There could be a method or an addon that I don't know about. I just want to use it as If it is a 2D viewport where I move items as if they are nodes or something similar.
Is it possible to do it?

Install this add-on and open the toolbar in the preview:
https://github.com/zeograd/VSE_Transform_Tools

It's good but it doesn't work with blender 2.9x.

The default version is for 2.92+  If you're using an earlier version of Blender 2.9x you need a different version.  See the comments in the github page for details.

Just before answering I tested it against 2.93 and the major functions works fine here(some functions haven't been updated yet).

@tintwotin Well, I think I'll ask another question about why it doesn't work for me lol. I'll do my research first.


text:
"Blend from shape" What does this do? how can I use it?
I can't find info in the manual or google. I want to learn about this option and what it does to shape keys? How can I use it?
https://docs.blender.org/manual/uk/dev/modeling/meshes/editing/vertex/blend_shape.html

One very common use is to repair a shape key from a mistake, while leaving the desired deformations intact: if you like your shape key but you see some moving vertices that should stay still, you can select them, choose blend from shape, pointing at the basis shape, unchecking the "add" option (so to replace the moving vertices informations with the basis static locations).

What about the value of the shape key that needs to be kinda like "edited"? Should I set it to 0 while doing the steps you mentioned?

No, it should be set to 1, for total influence (go exactly in the basis locations). A value less than 1 will attenuate the effect of the shape key on those vertices. A value of 0 just does nothing.

It looks like it's a way to copy the location of the selected vertices from another shapekey.
For example let say that it's your basis shapekey:

And this is your shapekey #1, called Key 1 by default:

If you want one vertex to go back to the location it has in the basis shapekey, select this vertex, press CtrlV > Blend from Shape:

then in the Operator box select the shapekey from which you want to copy the vertex location, tweak the Blend value:

Now your Key 1 will look like that, the vertex gets the position it has in the basis shapekey:


text:
I need help making my first "Hello world" Addon. Adding a button with a function
I would like to add a button and I looked at many tutorials (examples) but there are no good explanations. After many tirals, I got confused. I'm sure that the mistake is in the line that starts with  row.operator because the button doesn't appear and I don't know how to link it to the function called pressedButton.
class Single_PT_Button(bpy.types.Panel):
    bl_label = "amazing"
    bl_idname = "Single_PT_Butto.n"
    bl_space_type = 'SEQUENCE_EDITOR'
    bl_region_type = 'UI'
    bl_category = 'Strip'

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

        layout.label(text= "Press the button")
        row = layout.row()        # Create a simple row.
        row.operator("Single_PT_Butto.n", text= "Add Text", icon= 'OUTLINER_OB_FONT')

    def pressedButton ():
        print("Button is pressed")

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

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

if __name__ == "__main__":
    register()

Result:

Also, I would like to ask about one more quick info, is it possible to add it inside/under an already existing Panel like Effect Strip?

A good explanation: How to create a custom UI?

You can find a simple example in Scriping -> Templates -> UI Panel simple:
   import bpy

class HelloWorldPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

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

        obj = context.object

        row = layout.row()
        row.label(text="Hello world!", icon='WORLD_DATA')

        row = layout.row()
        row.label(text="Active object is: " + obj.name)
        row = layout.row()
        row.prop(obj, "name")

        row = layout.row()
        row.operator("object.text_add")

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

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

if __name__ == "__main__":
    register()

then you get in the "object properties" this:

and here is an example how you can call your own custom function:
import bpy

class HelloWorldOperator(bpy.types.Operator):
    bl_idname = "wm.hello_world"
    bl_label = "Minimal Operator"

    def execute(self, context):
        print("Hi World")
        return {'FINISHED'}

bpy.utils.register_class(HelloWorldOperator)

# test call to the newly defined operator
bpy.ops.wm.hello_world()

class HelloWorldPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

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

        obj = context.object

        row = layout.row()
        row.label(text="Hello world!", icon='WORLD_DATA')

        row = layout.row()
        row.label(text="Active object is: " + obj.name)
        row = layout.row()
        row.prop(obj, "name")

        row = layout.row()
        row.operator("wm.hello_world")

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

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

if __name__ == "__main__":
    register()

This example will print "Hi World" in the console, if you press the button.

In the line:
row.operator("Single_PT_Butto.n", text= "Add Text", icon= 'OUTLINER_OB_FONT')

You assigned the panel's bl_idname in the operator method's first argument which is incorrect. This argument should be used to assign whatever operator you want to execute when this button is clicked. You can assign either your operators or any already existing blender operator.
For example this line will assign blender render operator bpy.ops.render.render() to the button:
row.operator("render.render", text= "Add Text", icon= 'OUTLINER_OB_FONT')

Well, it seems that the argument is text. What if I want to assign the function? How can I write pressedButton() in the argument? In other words, I still don't know how to link the function to the button.

I recommend reading this [documentation][1] page it will guide you through writing your first operator, but as a simple rule for now, whatever will you write in the operator's execute() function will be called when you call/assign this operator.
[1]: https://docs.blender.org/api/current/bpy.types.Operator.html


text:
What is the relation between Time Remapping, FPS, and the number of frames?
I just needed my animation to be a little bit faster so I set the time remapping options to be:
Old = 100
New = 125
I need my output video to be 24 fps. Do I need to change the number of frames in the timeline (the end value)?

Related: How to animate time and render at a higher framerate and how to stretch frames of animation and calculate speed/duration for animataion

A ratio of 100/125 means you want to stretch your action by a quarter, it keeps the exact same action but plays it 1/4 slower (and not faster!).
Note that the Time Remapping values dont affect the duration of the rendered movie, the Timeline still does it.
Let say your action finishes at the end of your Timeline. In the case of a slowed action, if you want to see the full action, and don't want it to be cut off by a quarter, you'll also need to increase the Timeline length by a quarter.
If you want to speed up your action by a quarter you need to set a ratio of 100/75, in that case your action will be finished at 75% of the rendered movie, you can either let it as it is (the last quarter will be still), or cut off 1/4 of your timeline, or cut off the last 1/4 of the rendered movie.
In both case you don't have to change the fps, Time Remapping precisely allows you to ignore the fps!


text:
How can I see the output of geometry nodes?
I need a node like the "view" node in the Animation nodes. This is for debugging purpose. If I added two values or used the sin function and I want to check the results are correct or not, What can I do? How can I display the values inside attributes?
I googled and found out that there is no original node made for this. Is there a method to get around it?

If you have a node tree like this:

just open the spreadsheet...

and if you mute the point instance node you will see your values.

Worth noting this interface is from 3.0 alpha, it features a "viewer" node in replacement of the monitor icon which is in the top right of nodes in V.2.93. The Geometry domains were also placed in the left hand side rather than popups on the top of the Spreedsheet editor

This isn't quite for displaying attributes, but it's still useful.
The Node Wrangler Add-on has a hotkey for connecting something to the output with a single click. Node Wrangler is one of the built-in add-ons, so if you go to Preferences > Add-ons > Community, it should already be there. Simply hit the check mark to enable it.
Alt+Shift+Left Click any node that has a Geometry output and it'll connect it to the output, so that you can see what that intermediate step looks like in the Viewport.

This doesn't work for values like float or int since they are not geometry, but you can just hover over the output or input socket of a node and it'll display the computed value in a tooltip.

If the tooltip says 'The socket value has not been computed yet.', you can Ctrl+Shift+Left Click that node to connect a Viewer Node (works without Node Wrangler), which will make the value show up in the Spreadsheet. The value will then be computed and hovering should work again (...if you have the spreadsheet open, and if it is set to Viewer Node)

Relevant documentation on Inspection: https://docs.blender.org/manual/en/latest/modeling/geometry_nodes/inspection.html


text:
Is it possible write a python code in a text input?
I would like to add a simple python code here (like when I type 1+1, it shows 2. Or like encoding some text or whatever). Is it possible?

AFAIK it is not possible

Related https://blender.stackexchange.com/questions/184906/what-is-it-called-when-you-type-math-directly-into-a-property

@batFINGER Well, that answers my question. Thank you,

You can't :-(
Typically, you can right-click any field and choose "Add Driver" or just type an expression with a hashtag in front, but here the hashtag is just being displayed and there's no driver related options in the context menu. Trying that from the script doesn't work either:
>>> car = bpy.data.scenes["Scene"].sequence_editor.sequences_all["Text"]
>>> curve = car.driver_add("text")
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: bpy_struct.driver_add(): property "text" not animatable

But... :-)
Someone like Will Chen would probably hack his way through this problem using a driver that updates this field as a side-effect, something like setting the Size to #[40,setattr(bpy.data.scenes["Scene"].sequence_editor.sequences_all["Text"], "text", str(frame))][0] -where the # is there only if you input the script for the first time (when the field is not purple) to tell Blender to turn it to a driver, and 40 at the very beginning is the actual size - the rest is the nasty hack to update your text to current frame.
Perhaps a more elegant solution is to run a script like so:
import bpy

def frame_change_post_text_update(scene):
    scene.sequence_editor.sequences_all["Text"].text = str(scene.frame_current)

name = frame_change_post_text_update.__name__
listeners = bpy.app.handlers.frame_change_post
for l in [l for l in listeners if l.__name__ == name]:
    # this is here so you can change the script and run it again without having
    # multiple listeners stacking - make sure the function name is unique
    listeners.remove(l)
listeners.append(frame_change_post_text_update)

Can use if handler.__name__ == "your_listener_method":  to remove specific handler methods. What you have changed to could be replaced with  handlers.frame_change_post.clear()   Re-opened.

@batFINGER Thanks! I edited this in.


text:
Where can I see the output of the viewer node?
Let's assume that I want to see the frame value. I can't find it in the spreadsheet. Where can I find it?

You need to plug geometry info into the Viewer node. Since you're trying to see a scalar and not a field you can pretty much use any non-empty geometry.
It will be evaluated like if it was a field on the domain you have selected.

If you use a heavily subdivided mesh all the viewer column values will be set to the value you want to view. It might adversely affect performance though.

I like the way you can debug in AN, just plug any value to it and see it in the node. I hope that gets implemented in GN

Yes it is a bit awkward, I'm sure this will be improved in a future iteration of Geometry Nodes


text:
How to add Shrink-wrap bone constraint to a child bone?

As you can see in the image, I added the constraint to the child bone and that should prevent it from going below the plane. But it seems that the parent bone overrides the constraint and moving it may put the child bone under the plane. How can I solve this?

What behavior do you expect? The ShrinkWrap bone constraint locks the bone to the surface. So the child should push up or rotates its parent? What is the purpose?

@Blunder Yes, it should push up, rotate, or at least limit the animation (movements) of its parent so that the child doesn't go below the plane. The purpose is to prevent the feet from going below the ground in case of a character animation or similar applications.

There's more than one potential reason for this, but here's what I suspect, because it's probably the most frequent reason.  I can't tell you with more certainty than that without a file to look at.
Here, we've got a bone, with a shrinkwrap constraint, but it's not shrinkwrapping:

Why?  Look at the other properties viewport, on the bone tab, in the relations subsection.  It's grayed out here, because it's uneditable while in pose mode, but this bone has the "connected" property enabled.  This basically anchors the head of the bone to the tail of the bone-- the constrained bone cannot shrinkwrap, because it cannot move, and so the constraint does nothing.
How to fix?  Enter edit mode, select the constrained bone, and alt p -> disconnnect bone.  (Or, uncheck that "connected" box in properties/bone/relations.)  Now the bone can leave its parent's tail to shrinkwrap to our plane:


text:
First time to try water simulation but I can't do it
I used HDRI image to light my scene. I was just trying to learn how to simulate fluid. In the viewport, the fluid is in good shape:

But it renders the domain in the final image instead of rendering the particles, even after baking the simulation! how can I solve this?

In the newly updated fluid simulation (Mantaflow) you need to enable ‘Mesh’ in the settings. This uses the fluid particles (that you can see in your screenshot) into the final mesh. You may need to re-bake the simulation to see the result (there are some known issues with Replay cache mode not always auto-detecting that the simulation has changed and needs rebaking - try changing the Resolution or change the cache to Final to allow it to be baked).


text:
How to restart the animation of a particle system?
I create an expulsion so my particle system has the following settings:
End frame = Start frame + 1
I mean the value of the end frame is one frame larger than the value of the start frame.
Life time = 6
velocity = 8
Those settings create an expulsion starting from the start frame. What if I need this expulsion to start at frames 10, 50 and 100? Is it possible to Restart the expulsion?
I can't animate the start frame or the life time. Animating the number of particles doesn't work.

I think you need (3) separate Particle settings for that, like so:

Also a gif:

Thank you so much  for the answer :)


text:
Isolate particles from fixed bed CT scan
this is my first post, but as a silent reader I learned a lot, so first of all: Thank you, you are awesome!
I now have a problem, which I don't know if it belongs here, but I'll give it a shot:
For scientific researches my group did a CT scan of a tube filled with hundreds of hexagonial prisms (a so called 'fixed bed'). The goal is to compare this 'real world' filling with filling simulations done with Blender (works great btw ;) ).
Unfortunately, the .stl-file provided by the CT scan lacks of 'resolution' (see the attached image): You can see the different pellets, but when you look at the contact points/edges/faces, you see that the surfaces bake together, which is not what we want. We want a closed surface for every single pellet (with empyt spaces between). A CT scanner with higher resolution might solve this problem, but I am curious if there is another solution based on software and smart people.
So long story short: Is there an algorithm/ workflow in Blender which can detect shapes and isolate them from each other? Or do you know another software which is more suitable?
I am grateful for every single idea!
Cheers,
Leo

This is more of a https://scicomp.stackexchange.com/ https://cs.stackexchange.com/help/on-topic https://datascience.stackexchange.com/ question. My thought is to use an iterative algorithm depending on the data source(Point-cloud, mesh, CT-Slices?) .Find best fitting hexagonal prism, (get orientation, position, scale? remove contained geometry find next best fitting prism). I would guess, that working of the slices themselves is easiest, as the intersection between the prism and the slice will probably give you a characteristic hexagonal shape from which you can guess orientation of the prism.

Can you provide a wireframe or edit mode image. Interesting q, some iterative routine to reduce to edges of two known lengths, and 2 known face shapes. Can you add a sample file https://blend-exchange.giantcowfilms.com


text:
Extrude object along curve not working
I'm trying to create a series of arches based on a single molding profile. I've created each arch as a curve and the plan was to then take the profile (a single face at the moment) and extrude it along the curve to create the arch I want. However, something I can't even explain is happening and the extrusion is not conforming to the curve. I've also tried extruding first and then attaching a curve modifier and get the same result.

If it will help, you can download my blender file here.
http://www.mediafire.com/?27kos3cwfkf2c
Let me know what I've done wrong and thanks in advance!

it works, you have to deactivate the snap option, extrude your shape, give it an Array modifier that you put above the Curve modifier, choose the bezier curve as the Object of the Curve modifier, apply the rotation of the curve, find the right Deformation axis and rotation for your object... you could also convert your object into a bezier and then select your arch and choose the profil as the Bevel Object in the Data panel

Well I'm not sure what technique you are using to "extrude along a curve".  The array modifier is one way to do it as moonboots mentions.  Another one, which I used to create the image below, is to convert your profile mesh to a curve, then use it as the "Bevel Object" of your arch form curve.  You can then convert the resulting curve to a mesh (as I've done with a duplicate in the screenshot).  You will need to be sure to apply location, rotation, and scale to your objects, INCLUDING the arch curve object, to get this to work right, and even after that you may need to rotate the profile (and apply the rotation) so that the right bits are pointing in the right direction.

Would you mind clarifying how to rotate the profile? I selected the profile curve, rotate it several different ways, hit enter and nothing happened. I then went to the arch curve and deleted the bevel object and reconnected. It is still terribly twisted and upside down.

https://imgur.com/a/8mJ1omO

Did you try applying the rotation?  Object-->Apply-->Rotation, or Ctrl-A-->Rotation.  You need to do this each time you rotate.  You also need to apply the rotation of the arch curve.

You can use the Bevel Object option under the Curve Properties for each arc. In your case you must first convert your profile (a mesh) in a curve, the shortcut is ⎇ Alt+C. Then select one of the arcs, and choose the name of the profile in the Bevel Object option.


text:
How to wrap cylindrical object around 2 posts
Currently working on a chair and can't get the back rest right. It's essentially a cloth draped around the wood legs that extend all the way up into posts. Anyway, I tried taking a cylinder, extruding half of it over to the other post but can't seem to get the trajectory and rotation right. Any ideas for how I can accomplish this in a more accurate way? Would love for it to look more realistic so any tips and critiques would be appreciated.

Here are my reference images

I don't see a reason to model it with cylinders. Duplicate border edges of that place from the chair legs, separate them into new object and create faces between them.

This worked for me. Thanks so much!

It looks like you’re pretty close. I probably would have started with a cube. Because it’s usually better to start with less detail rather than more. And from the photo, it looks like the ends of the backrest are a bit flat rather than completely rounded over like starting with a cylinder gives you.
Start with a cube and get the top left corner from n the correct place at the end of one vertical post. I edit mode grab the bottom face and pull it down and slightly forward so you have a skewed rectangle matching the slope of the back.
Now grab the side face and move it over to the other post. Now you only have 4 vertices on each end of the backrest to adjust to get the alignment right.
Now that the basic form is there start edging details: vertical edge loops to add the contour between posts, bevel the edges with only one or two subdivisions to make them more rounded and soft looking. Once this level of detail is done, subdivide and/or sculpt it to add the asymmetrical details of a soft cushion.

Try the ShrinkWarp modifier (add more geometry), or try making a simulation.
Try going into wireframe and by pressing the view keys (1, 3, 7,Ctrl + 1, Ctrl + 3, 9) getting your vertices right.


text:
Emissive Material not Rendered at Some Angles
This is a night scene I modeled with some windows in the building.
Normally all the windows should be lit. But the light does not pass through the window if the camera is not perpendicular to the it.

What should I do to let the light pass at any angles?

By the way, I am using Blender 2.91

Check that your normals are facing the correct way and that your glads panes have ‘thickness’ (ie, they aren’t just a single face - add a Solidify modifier or extrude to give them physical thickness).

Fixing the normals of and adding thickness to the glass are the best solutions.
Thanks for @Rich Sedman and @Robin Betts's comments. It works by simply setting the IOR value of the window glass to 1.0 or slightly larger (1.45 is the default setting), but it is not a physically correct solution.
Check their comments. I am adding this since they didn't post it in an answer.

@Allen Simpson' s answer inspired me. Now I found the solution by simply setting the IOR value of the window glass to 1.0 or slightly larger (1.45 is the default setting).
Here is the result.

... but @Rich Sedman's answer is strictly the more physically correct one. (That may not matter, here)

The light is getting through, but it's going straight through like a prism because of the light source.
In real life the window would be receiving bounced lighting from all directions inside the room.  The easiest way to recreate this is probably to bump up the transmission roughness value.

Note that while a realistic IOR value would be around 1.5 for most types of glass, I personally find an IOR of close to 1 helpful for rendering thin panes of glass.

Bumpping up the transmission roughness value seemed not to work. But you inspired me to adjust the IOR value down to 1. And suddenly every window is lit!

Right, I forgot to mention that.  For thin panes I find an IOR of 1 to be helpful.

In real refraction, the light would be bent one way on entering the glass, and back again on exiting it. For Blender's refraction model to be realistic, the glass has to have thickness. The ray must encounter front and back-facing surfaces on the way from the world, through the glass, and back again.


text:
Blender 2.80 Remove double vertices option gone
I downloaded the latest version of Blender 2.8 beta today.
I used to remove double vertices by switching to Vertex selection mode -> Choose all vertices -> Right click > choose Remove Doubles (in Blender 2.80 which I downloaded in April).
But I found the option - Remove double vertices gone. I switched to Vertex selection mode and press F3 to search but could not find it. Maybe it has got another name?

It looks like it has been replaced by alt M (Merge) > By Distance

Yes, it has been rename to a more reasonable name - Merge by Distance.
Since Remove Double doesn't explain the operator well by it's own name at all. It merges those vertices which are too close to each other by a defined distance.

For developers, the API does't change at all, nothing to worry about it.

In code details
In case someone is curious about why it doesn't remove the double by exactly same position, the problem is that vertices store coordinates (x,y,z) in float numbers, a 32-bit number used commonly in computer science. It is not always precise in manipulating.
For a easy code in Python 3.6.0:
co = 0.1 # Create a 'co' object that gets a float value 0.1
sum_co = 0.0 # Create a 'sum_co ' object thats going to store sum

for i in range(10): # Do the block 10 times
    sum_co += co # Add co(value: 0.1) to sum_co

sum_co == 1.0 # If sum_co exactly equal to 1.0
# Should be true in common sense since 0.1 * 10 = 1
# But the answer is 'False', the sum_co == 0.9999999999999999

Since this situation happens a lot, Blender can't remove the duplicated vertices by exactly same value of the coordinates. Hence, compared by a tiny tolerance is a more common way to deal with this kind of problem. Therefore, Merge by Distance replaces the original name.

Wow. Thank you so much for the quick answer!


text:
Why an object looks darker after Applying Scale and how to fix it?
I was trying to create a symmetric wall by doing:

Shift + D to duplicate the wall on the right side and move it to the left.

Change the Scale of Y of the duplicated object to -1.

Ctrl + A to apply scale.

And the color of the object changed.

How can I change it back?

go in Edit mode, select all the vertices and ctrl N?

Welcome to bse. Like wrapping paper one side has decoration the other doesn't. For a mesh face the "decoration" is the normal pointing out, what you want to see. Inverting the scale (negative scales) can have the effect of flipping the side we see. The ctrl N suggested above flips the normal back.  There are options to make all normals consistent, or flip them on a face by face basis. Normals

Blender does not fix surface normals(vectors defining surface direction) automatically when you invert the geometry so they are pointing the wrong way - to the inside of the object. The best thing to do would be to flip the normals:

Note that you need to be in edit mode and have the geometry selected. You can also reach this function from Faces menu that can be called with ctrl+f, you can just hit f once the menu is called - that's a very quick way to reach the function.
You could also use Recalculate Outside(ctrl+n) or Recalculate Inside(ctrl+shift+n) functions, however this might lead to undesired result if you have a mesh that has normals already set up in some particular way or if you are working with geometry that the automatic algorithm may not be suitable for (for example simple planes might confuse it since it cannot determine where the outside should be and if you have a few disconnected planes in one object that might be a problem). Most people will advise to recalculate normals in this situation, however it is a lot more logical to just flip them instead if you know that the problem is caused by inverting the geometry(scaling with a negative value).


text:
How to show the normal of a face
How do you show the normal of a face in Blender 2.8.
It used to be in the properties panel (n to show) but now where has it gone?

I think this place could do with a 2.8 tag as there will be a lot of questions that relate to the new way of doing things.

Figured it out

Expand Overlays (top-right)
Tick Face Orientation

Now blue faces are one way (presume forward) and red are other (presume backwards)

in overlay option check "Face orientation"

that is face orientation. In this picture, "Normals" section is just below the "Measurement" section


text:
Does 'Inverse Kinematics' override other bone constraints?
Rig is for a quadruped, I have IK applied at second bone, but I want to place a limit on the to the toes, so that they can't go below 0 on the Z axis. Selecting  the Limit Location bone constraint doesn't appear to be honored when striking a pose.
Any ideas?

I think I found the issue. My active 'Copy Location' constraint was overriding my "Limit Location" constraint. Priority in the constraints appears to flow up to down.

Yes, the upper constraints or modifiers have the first priority. It's also explained here somewhere in this tutorial that explains everything about IK. It could be related: https://www.youtube.com/watch?v=gq7K1mX4pRI


text:
ID user decrement error raised when I try to clear users from a screen, what does this mean?
The code responsible for the error:
def cleanup():
    for s in bpy.data.screens:
        if '.' in s.name or s.name.startswith('temp'): s.user_clear()

    bpy.ops.outliner.orphans_purge(do_recursive=True)

I'm trying to write code that clears a bunch of extra screens that get automatically created every time I use bpy.ops.wm.window_new(). I thought I could just run user_clear() on each screen and then the orphans purge call would automatically remove them. This does work successfully the way I intended it to, however in the system console an error is raised that reads:

ERROR (bke.lib_id): C:\Users\blender\git\blender-v310\blender.git\source\blender\blenkernel\intern\lib_id.c:339 id_us_min: ID user decrement error: SRtemp (from '[Main]'): 0 <= 0

This error doesn't seem to affect the actual functioning of Blender in any way, the rest of the code I've written seems to work as intended, and Blender doesn't crash or exhibit any other strange behaviour. If the system console didn't raise this error, I wouldn't even know anything's amiss. I can't figure out any other way to delete these screens that works as intended, so I'm considering just entirely ignoring this error and moving on, but I know that's not best practice. Why is this error being raised and how can I change my code to avoid this?

At first glance I'd say you're trying to clear users of an object that has no users. You may want to test if s.users: https://docs.blender.org/api/current/bpy.types.ID.html#bpy.types.ID.users

@Gorgious I've tried putting in print() statements at various points in the code to check exactly which line is causing this error to be raised, and the error is always raised at the orphans_purge line. When I don't run user_clear() on the screens, no error is raised but the screens aren't deleted, and when I run user_clear() on the screens but don't purge the orphans, no error is raised but the screens aren't deleted (until after I close blender and reopen it, but I don't want to have to do that in order to get the screens to delete)

Can you paste the entire error trace back?

@MrBill that is the entire error, there is no traceback. The only text that appears in the console is the text I pasted above, and then on a new line, Info: Deleted 23 data block(s) which happens automatically due to the purge command

This answer was suggested by @Gorgious though their comment seems to have been deleted now.
Instead of running s.user_clear() on each screen, putting all the screens I want to remove in a set and running bpy.data.batch_remove() on that set seems to have accomplished the same intended result with no error being raised. I've got my answer. Don't clear the user, do a batch remove.


text:
How do you write python script that detects when a window has been closed?
In my code, some data items are created, then a new window is opened via bpy.ops.wm.window_new. The user can then do a number of things within this window, manipulating the data just created. I have a function that is supposed to run when the user is done with the window and wants to exit. I've registered an operator that runs this function and closes the window, but what if the user just clicks the red 'X' button in the corner to close the window without calling my operator? How do I make my function run when the user closes the window?
import bpy

a = piece_of_data
b = another_piece_of_data

bpy.ops.wm.window_new()

def on_close():
    do_stuff()
    bpy.ops.wm.window_close()
    print ('window was closed')

class WM_OT_close_my_window(bpy.types.Operator):
    bl_idname = 'wm.close_my_window'
    bl_label = 'Close my window'

    def execute(self, context):
        on_close()
        return {'FINISHED'}

def draw_item(self, context):
    self.layout.operator(WM_OT_close_my_window.bl_idname, icon='CANCEL')

def register():
    bpy.utils.register_class(WM_OT_close_my_window)
    bpy.types.VIEW3D_HT_header.append(draw_item)

def unregister():
    bpy.types.VIEW3D_HT_header.remove(draw_item)
    bpy.utils.unregister_class(WM_OT_close_my_window)

if __name__ == '__main__':
    register()

You might want to look into msgbus as a solution, or possibly a calback on depsgraph to detect the close event.

Use the threading module. It allows you to run while loops concurrently with Blender's usual functioning. You can use a while loop to periodically check if the window's been closed, and if so, exit the while loop and run your on_close() function.
import bpy
import threading
from time import sleep

a = piece_of_data
b = another_piece_of_data

bpy.ops.wm.window_new()
my_window = bpy.data.window_managers[0].windows[-1]

def on_close():
    do_stuff()
    print ('window was closed')

def on_window_close():
    window_open = True
    while window_open:
        sleep(0.25) #Set the value to however often you want to check if the window's been closed
        if my_window not in bpy.data.window_managers[0].windows.values():
            window_open = False
    on_close()

my_thread = threading.Thread(target=on_window_close)
my_thread.start()


text:
Cycles Not Baking Emission Material Properly?
I’m trying to bake my neon sign but it’s not working. The emission is off, I think it’s because of my material set up. My emission material is connected to a multiply, colorramp and layer weight nodes (please see image below) This gives that neon / glow looking effect. Do certain materials not work for cycles rendering?

Thanks!


text:
Object animate and deform follow path not working
I hope you are having a great day.
I am following a tutorial to make an object, in my case something that will eventually be modeled into a bendy bus or tram, and at one point I followed the tutorial and it worked, even in 2.79b and 2.8, but I have since been unable to get it to work.
What is happening is that as I set up the triangles using the offset and then creating single user out of each, when I click play, they all return to their origin. In the video, they stay where they are.
I have watched the linked video many times, but I cannot get it. I have linked to a blend file to show what I am getting at.
I am aware there is a similar question, but I only want the object to deform in specific places.
Thank you very much.
The video tutorial

The blend file

I figured it out. I had a serious middle-aged moment. As each new triangle is added, it needs to be keyframed in. Doh!

I'm not sure you've chosen the easiest way to do it though

I am the master of making simple tasks needlessly complicated. However, this method suits me OK. It gives me control over the deformation that the curve deform does not. I am, however, open to new ideas.

ok then, ah ah, but I'm not sure your method is even the one explained in the video


text:
Baking a displacement map with Blender 2.8 and Cycles?
I want to achieve a greyscale displacement map, like this one:

I have a model and another model which has been modified using a displacement modifier, now I want to bake that displacement into the uv map.
Following this awesome tutorial I was able to generate a normal map, however I see no displacement in the bake type selection

How do I make a displacement map instead?
Here is the blendfile if anyone wants to take a look.
https://drive.google.com/file/d/1IrQmUGCSRCOfJQmsxSaZAlCw4XE49YZi/view?usp=sharing

Sadly there is no built-in method to bake displacement maps in Blender yet. However, there is a lot of talk going on within the Dev community about it lately, so this might change in the future. Right now, the only workaround I can offer, is described in a video tutorial by CGCookie: "Convert Material Displacement to a Mesh". It can be done with Blender 2.79 and Blender 2.80, but for both it works only in experimental mode.

Thanks for the info, sadly my setup is different from the one in the video, I have two models where one is "bigger" than the other, and they share the same vertices/faces. I don't have a node setup like that


text:
mirror modifier leaves a gap

My mirror modifier leaves a gap and I can't move the edges in to close it. What's the fix?

Remove the internal face (would be internal when mirror gap removed) then move the vertices until the gap is closed.

Do you have subsurf on or something in the list before mirroring?
Sort of has that look.
Otherwise can, with clipping on for the mirror, drag verts to center.

Yes I did have a subsurb before mirror.

Make the mirror come before the subsurf. Infact make the mirror modifier top of the list

You can increase merge limit. It's usually 0,000001 but here it should be more
or
set origin to one of the vertices and then mirror.
Before that remove all unnecessary verts/faces/edges as @rob says.


text:
How to make afro (solid)

I want to make an afro like in the picture. Unlike the ones you can see the fine strands of hair since this will be 3d printed. Is there a nice way to do it that isn’t sculpting mode and grabbing at every bump? Thank you.

You can use a displacement modifier with a clouds texture. If you need help with how to do that reply and I'll walk you through it.

@NascentSpace Yes please. I have no experience with the displacement modifier and would love if you could walk me through it.

Make sure you have selected the hair object, and then go to the modifiers tab on the right side of the screen. Then click add a modifier and find the displacement modifier and click it. Then make sure to add a new texture and press the tiny wrench button to edit the texture. There you can change the texture type to clouds and change the size as well.


text:
How to attach new object around a round surface

I already have the head model. What's a nice way of doing the beard as a new object around the rounded face. Also how can I add texture similar to image without sculpting.

There are several ways to do it, one simple would be to duplicate the head mesh area where the beard is supposed to grow, draw the lines of the beard shapes with the knife tool (here it's a roughly try) then extrude twice, give it a Subdivision Surface, rework with additional edges, etc...


text:
How to separate 2 faces connects by an edge

I want to separate these so I can put one edge over the other later on.

Did you tried the "Rip" operator / tool?

Yup that works! I'll set that as answer.

Go to 'Edit Mode' and select the edges that u want to separate. Now select Alt + M. Then select Faces by Edges option. That will do the trick.

What version, as in some versions this command is used for merging


text:
Exporting an object's edge length and edge angle data to CSV file
is there a way of being able to export an object's edge length and edge angles to a CSV file?
I have created an object with some 200 triangulated faces and I would like to export the information about its edge length and edge angle to a CSV file that can be used to build the object (not 3D print).
I'm relatively new to blender. I'm using Version 2.93.5 (2.93.5 2021-10-06)
I have tried to find an answer unsuccessfully.

here's something using bmesh to calc edge and angle between faces, it should work in 2.93
angle is signed and in radians, it fallbacks to 10 if edge doesn’t have 2 faces, see I rounded values too...
you may want to change those things, see bmesh docs if you needed something else I didn't understand
import bpy, bmesh, csv
rows = []

bm = bmesh.new()
bm.from_mesh(bpy.context.object.data)

for i, e in enumerate(bm.edges):
    len = round(e.calc_length(), 5)
    ang = round(e.calc_face_angle_signed(10), 5) # use fallback=10 for Blender 3
    rows.append([i, len, ang])
bm.free()

with open('C:\\tmp\\egdes.csv', 'w') as f:
    writer = csv.writer(f)
    for r in rows: writer.writerow(r)

Thank you alambre, I'll try it out


text:
Is there a way to delete unused collections?
Just learned about instancing in Blender and noticed that I have some unneeded collections. I tried to find a way to delete them but the only thing I managed to do is leave an empty collection.

Only with python script

There is an option in File > Clean Up > Unused data blocks, which does what it says. I don't think it'll do what you're looking for.

you can use this script:
import bpy

for eachCol in bpy.data.collections:

    if len(eachCol.all_objects) == 0:

        bpy.data.collections.remove(eachCol)

I assume this deletes any collection if there are no objects in them. In case anyone finds this useful, I found two more scripts, the first removes the collection but not the objects, and the second removes both the collection specified and its objects. https://b3d.interplanety.org/en/removing-collections-through-the-blender-python-api/

With pre-installed addon "Collection Manadger"
M>Specials>Remove Empty Collections


text:
Render looks like there are weird artifacts on the walls
I created this scene and it was ready for rendering. I am using cycles as my render engine. In viewport, my max samples is 100 and is starts in 50. My noise threshold and denoise is turned on as well. It was looking okay at first but it somehow looked like this now in viewport and even in the final render.

I tried solving this issue by turning off the noise threshold in viewport and it looked normal and the weird artifacts something on the plate and walls were gone.
I wanna know if this is about the noise threshold and how can I fix this? Or is this somehow connected to my materials that include transmission? Please help.

This is due to a combination of the noise threshold and the Optix denoiser (the Automatic one).
If you try the OpenImage denoiser for example, you'll see that you get a different result.
In the Render where you have much more samples and if you lower the noise threshold, you won't get that issue.


text:
2 Materials with the same image and UV offset for meshes give different results?
I'm trying to combine 2 textures into one, and I successfully put the images together, however while the UVs for the face colour and Hair are in the same place overlaying the same spot, it messes up the face.

NOTE: While the images only show the Hair UVs, I did change the skin as well, getting the more messed up result.

I don't understand what you're showing there. The first screenshot shows there is an object called "Hair" and you've put a material called "Hair" on it. The next screenshot shows you have replaced the "Hair" material with a material called "Face". The UVs might be in the same spot, but you cannot put two materials in the same spot of the mesh. And especially not if you remove one material and replace it with the other.

How so? And is there a way I can combine the textures of the Face and Skin/Hair?

It's sometimes a good idea to post your blend file, or a truncated version of it that has the problem (remember to pack the relevant image textures into the blend). The Blender StackExchange has its own service to share blend files: blend-exchange.com/help

@DPadderz To put more than one material on a mesh, first add those materials to the object in the Material Properties, i.e. if there's only one material, you only have one material on the object. To add more, create more material slots with the '+' button next to the material's name, then choose a material from the dropdown menu below or hit the 'New' button to create a new one. Then those materials have to be assigned to selected faces in Edit Mode. To have different textures etc. on the same face of an object, you have to mix them inside the material which is assigned to the face.

@DPadderz But I would highly recommend going through some tutorials on how you basically put materials on objects in Blender, and texturing etc.