text:
EXCEPTION_ACCESS_VIOLATION when running python in background mode and calling region_3d.update()
I need to run a python script in background mode, without GUI.
The purpose is to unwrap uv from top view of some loaded object & texture.
To do that, I use the bpy.ops.uv.project_from_view operation after setting the view to Top.
As I saw in the forums, I need to run region_3d.update() between those calls so that the top view operation take effect, and calling this function causes EXCEPTION_ACCESS_VIOLATION.
Here's a sample of the code to reproduce the failure:
import bpy

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')

for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        for region in area.regions:
            if region.type == 'WINDOW':
                with bpy.context.temp_override(area=area, region=region, edit_object=bpy.context.edit_object):
                    bpy.ops.view3d.view_axis(type='TOP')
                    area.spaces[0].region_3d.update() # <<< blender crashes here <<<
                    bpy.ops.uv.project_from_view(orthographic=True, camera_bounds=False,
                                                 correct_aspect=True,
                                                 scale_to_bounds=True)
                break

Note that running this code while Blender is open, works perfectly, however, when I run it in background mode it crashes:
"C:\Program Files\Blender Foundation\Blender 3.3\blender.exe" untitled.blend --background --python crash_repro.py

untitled.blend is a dummy blender file with cube.
The crash report:
# Blender 3.3.0, Commit date: 2022-09-06 15:39, Hash 0759f671ce1f

# backtrace
Exception Record:

ExceptionCode         : EXCEPTION_ACCESS_VIOLATION
Exception Address     : 0x00007FF6F84E3B72
Exception Module      : blender.exe
Exception Flags       : 0x00000000
Exception Parameters  : 0x2
    Parameters[0] : 0x0000000000000000
    Parameters[1] : 0x0000000000000018

Stack trace:
blender.exe         :0x00007FF6F84E3B40  GPU_matrix_ortho_set
blender.exe         :0x00007FF6F427AB20  view3d_winmatrix_set
blender.exe         :0x00007FF6F427CFF0  ED_view3d_update_viewmat
blender.exe         :0x00007FF6F395DD40  rna_RegionView3D_update
blender.exe         :0x00007FF6F393AAD0  RNA_function_call
blender.exe         :0x00007FF6F3A69840  pyrna_func_call
python310.dll       :0x00007FF851C19DD0  PyObject_MakeTpCall
python310.dll       :0x00007FF851D2F000  PyEval_GetFuncDesc
python310.dll       :0x00007FF851D288F0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF851D288F0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF851D28680  PyEval_EvalCode
python310.dll       :0x00007FF851D197E0  PyWarnings_Init
python310.dll       :0x00007FF851C5E1C0  PyCFunction_GetFlags
python310.dll       :0x00007FF851D26D50  PyOS_URandomNonblock
python310.dll       :0x00007FF851D2F000  PyEval_GetFuncDesc
python310.dll       :0x00007FF851D288F0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF851D288F0  PyEval_EvalFrameDefault
python310.dll       :0x00007FF851DA0410  PyRun_FileExFlags
python310.dll       :0x00007FF851DA0410  PyRun_FileExFlags
python310.dll       :0x00007FF851DA0270  PyRun_StringFlags
blender.exe         :0x00007FF6F3A5DAB0  python_script_exec
blender.exe         :0x00007FF6F3A5D680  BPY_run_filepath
blender.exe         :0x00007FF6F27B3420  arg_handle_python_file_run
blender.exe         :0x00007FF6F869A370  BLI_args_parse
blender.exe         :0x00007FF6F27B12A0  main
blender.exe         :0x00007FF6F88D28B0  __scrt_common_main_seh
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Threads:
Thread : 0000186c
ntdll.dll           :0x00007FFA4ED07720  ZwWaitForWorkViaWorkerFactory
ntdll.dll           :0x00007FFA4EC76730  EtwNotificationRegister
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00008a00
ntdll.dll           :0x00007FFA4ED07720  ZwWaitForWorkViaWorkerFactory
ntdll.dll           :0x00007FFA4EC76730  EtwNotificationRegister
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00008794
ntdll.dll           :0x00007FFA4ED07720  ZwWaitForWorkViaWorkerFactory
ntdll.dll           :0x00007FFA4EC76730  EtwNotificationRegister
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00002ee8
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00005998
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00008ce8
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 000051ec
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00005ea0
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 000046e4
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00007990
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00007100
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00006b1c
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00002cc8
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00008220
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 0000142c
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 0000814c
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00008740
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00005cf0
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 000048f8
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00006cbc
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00006ce4
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00007c60
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00008638
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
blender.exe         :0x00007FF6F9465F30  IlmThread_3_1::Semaphore::wait
blender.exe         :0x00007FF6F9465740  IlmThread_3_1::ThreadPool::numThreads
blender.exe         :0x00007FF6F2973A50  std::thread::_Invoke<std::tuple<void (__cdecl usdBlender__pxrReserved__::HdRenderThread::*)(void) _
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00006dd0
ntdll.dll           :0x00007FFA4ED07720  ZwWaitForWorkViaWorkerFactory
ntdll.dll           :0x00007FFA4EC76730  EtwNotificationRegister
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00004058
ntdll.dll           :0x00007FFA4ED07720  ZwWaitForWorkViaWorkerFactory
ntdll.dll           :0x00007FFA4EC76730  EtwNotificationRegister
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 000088a0
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00000c5c
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00004d9c
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Thread : 00008a08
ntdll.dll           :0x00007FFA4ED03BF0  ZwWaitForSingleObject
KERNELBASE.dll      :0x00007FFA4C4724C0  WaitForSingleObjectEx
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
tbb.dll             :0x00007FFA405AD800  tbb::thread_bound_filter::try_process_item
ucrtbase.dll        :0x00007FFA4C9B6BB0  recalloc
KERNEL32.DLL        :0x00007FFA4CC45540  BaseThreadInitThunk
ntdll.dll           :0x00007FFA4EC64830  RtlUserThreadStart

Loaded Modules :
0x00007FF6F2640000 3.3.0.0              blender.exe C:\Program Files\Blender Foundation\Blender 3.3\blender.pdb
0x00007FFA4EC60000 10.0.22000.918       ntdll.dll
0x00007FFA4CC30000 10.0.22000.1219      KERNEL32.DLL
0x00007FFA4C430000 10.0.22000.1165      KERNELBASE.dll
0x00007FFA4E850000 10.0.22000.1         WS2_32.dll
0x00007FFA4DA60000 10.0.22000.675       RPCRT4.dll
0x00007FFA4E470000 10.0.22000.1165      USER32.dll
0x00007FFA4CAB0000 10.0.22000.1219      win32u.dll
0x00007FFA4D580000 10.0.22000.832       GDI32.dll
0x00007FFA4C310000 10.0.22000.1098      gdi32full.dll
0x00007FFA4C130000 10.0.22000.1         msvcp_win.dll
0x00007FFA4C990000 10.0.22000.1         ucrtbase.dll
0x00007FFA4EB70000 10.0.22000.1098      ADVAPI32.dll
0x00007FFA4D9B0000 7.0.22000.1          msvcrt.dll
0x00007FFA4E200000 10.0.22000.708       sechost.dll
0x00007FFA4CCF0000 10.0.22000.1165      SHELL32.dll
0x00007FFA4D4C0000 10.0.22000.1         SHLWAPI.dll
0x00007FFA4E6B0000 10.0.22000.120       ole32.dll
0x00007FFA4D630000 10.0.22000.1165      combase.dll
0x00007FFA496D0000 10.0.22000.1         dbghelp.dll
0x00007FFA405A0000                      tbb.dll
0x00007FFA4EA70000 10.0.22000.1         PSAPI.DLL
0x00007FFA4E0B0000 10.0.22000.613       shcore.dll
0x00007FFA4D540000 10.0.22000.1165      IMM32.dll
0x00007FFA32070000                      tbbmalloc.dll
0x00007FF9DF070000 10.0.22000.1042      OPENGL32.dll
0x00007FF8544E0000 9.0.0.0              openvdb.dll
0x00007FF851FE0000 59.18.100.0          avcodec-59.dll
0x00007FFA32140000 59.4.100.0           avdevice-59.dll
0x00007FFA4CB50000 10.0.22000.1         OLEAUT32.dll
0x00007FF99B470000 59.16.100.0          avformat-59.dll
0x00007FFA30270000 6.4.100.0            swscale-6.dll
0x00007FF9FE3D0000 1.21.1.0             OpenAL32.dll
0x00007FF9A6950000 57.17.100.0          avutil-57.dll
0x0000000070440000 1.0.28.0             libsndfile-1.dll
0x000000006ACC0000                      libgmp-10.dll
0x00007FFA425E0000                      libgmpxx.dll
0x00007FF9A85B0000 2.0.20.0             SDL2.dll
0x00007FFA4DB80000 10.0.22000.469       SETUPAPI.dll
0x00007FF851B10000 3.10.2150.1013       python310.dll
0x00007FFA4BE00000 10.0.22000.1         CFGMGR32.dll
0x00007FFA4BB10000 10.0.22000.1         bcrypt.dll
0x00007FFA425D0000                      tbbmalloc_proxy.dll
0x00007FFA2FEE0000 10.0.22000.1165      AVIFIL32.dll
0x00007FFA30F40000 6.10.22000.120       COMCTL32.dll
0x00007FFA1E8D0000 14.29.30139.0        MSVCP140.dll
0x00007FFA43010000 10.0.22000.1         VERSION.dll
0x00007FFA413D0000 14.29.30139.0        VCRUNTIME140.dll
0x00007FFA499E0000 10.0.22000.41        dwmapi.dll
0x00007FFA41440000 14.29.30139.0        VCRUNTIME140_1.dll
0x00007FFA1D920000 10.0.22000.1042      GLU32.dll
0x00007FFA3FAC0000 10.0.22000.1165      AVICAP32.dll
0x00007FFA30070000 10.0.22000.675       Secur32.dll
0x00007FFA43B70000 10.0.22000.1         WINMM.dll
0x00007FFA3F090000 10.0.22000.1165      MSVFW32.dll
0x00007FFA427C0000 10.0.22000.1         MSACM32.dll
0x0000000070680000                      libfftw3-3.dll
0x00007FFA46C90000 10.0.22000.653       dxcore.dll
0x00007FFA4B530000 10.0.22000.1098      SSPICLI.DLL
0x00007FFA22370000 4.3.100.0            swresample-4.dll
0x00007FFA4B2A0000 10.0.22000.71        kernel.appcore.dll
0x00007FFA4A1F0000 10.0.22000.1165      windows.storage.dll
0x00007FFA4A080000 10.0.22000.1165      wintypes.dll
0x00007FFA4C060000 10.0.22000.1         profapi.dll
0x00007FFA4C290000 10.0.22000.778       bcryptPrimitives.dll
0x00007FFA4DFF0000 2001.12.10941.16384  clbcatq.dll
0x00007FFA41070000 10.0.22000.1042      MMDevApi.dll
0x00007FFA4BE50000 10.0.22000.1         DEVOBJ.dll
0x00007FFA34690000 10.0.22000.708       AUDIOSES.DLL
0x00007FFA4AA70000 10.0.22000.1         powrprof.dll
0x00007FFA4AB70000 10.0.22000.1         UMPDC.dll
0x00007FFA4B990000 10.0.22000.1         CRYPTSP.dll
0x00007FFA4B200000 10.0.22000.282       rsaenh.dll
0x00007FFA4B980000 10.0.22000.1         CRYPTBASE.dll

# Python backtrace
  File "C:\Users\shama\OneDrive\Desktop\crash_repro.py.txt", line 13 in <module>
  File "<string>", line 1 in <module>

I am having the exact same problem in MacOs and blender 3.6.1 and Ubuntu with version 2.79.

As @Iván found out in a similar post, there is a bug report which states that this is not considered a bug, quote:

I don't consider this a bug. Calling an operator from background can be expected to lead to these issues. As operators might require the GPU and the GPU is only available when running with UI. The region 3d is an editor structure and is expected to be run with UI.


text:
What is the mathematical role of the Factor attribute in the mix color node?
I am trying to figure exactly how, on a mathematical level, the Factor attribute influences the operations of the Mix Color Node in blender.
Say for example you use the Color Burn operation.
The mathematical formula for this is
$Color_{burn} = 1 - \frac{1 - Color_1}{ Color_2}$
So for example if input $Color_1$ has an R-channel value of $0.6$ and input $Color_2$ has an R-channel value of $0.5$, the resulting $Color_{burn}$ with a Factor attribute set to $1$ comes out to an R-channel value of
$1 - \frac{1 - 0.6}{0.5} = 0.2$
So far so good I understand what's happening.
However, if I set the Factor attribute to, say, $0.5$, I get a resulting R-channel value of $0.468$ and I don't understand why.
What, mathematically speaking, is the Factor attribute doing??

I just tested it in the compositor and got a very slightly different result of 0.46 repeating, which is 7/15 if that helps out.

Looking at the source code of the mix fucntion in line 937, it seems to rely on a variable Traits:range, which I haven't been able to track down.

@JonasGörke the definition of range is 1.0, here https://github.com/blender/blender/blob/main/source/blender/blenlib/BLI_color_mix.hh#L60

$$Color_{burn} = 1 - \frac{1 - Color_1}{1 - Fac + Fac \cdot Color_2}$$
$$0 \leq Color_{burn} \leq 1$$
The osl source you can find in Source\blender-3.x.x\intern\cycles\kernel\osl\shaders The source code of the mix color node is as follows
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#include "node_color.h"
#include "node_color_blend.h"
#include "stdcycles.h"

shader node_mix_color(string blend_type = "mix",
                      int use_clamp = 0,
                      int use_clamp_result = 0,
                      float Factor = 0.5,
                      color A = 0.0,
                      color B = 0.0,
                      output color Result = 0.0)
{
  float t = (use_clamp) ? clamp(Factor, 0.0, 1.0) : Factor;

  if (blend_type == "mix")
    Result = mix(A, B, t);
  if (blend_type == "add")
    Result = node_mix_add(t, A, B);
  if (blend_type == "multiply")
    Result = node_mix_mul(t, A, B);
  if (blend_type == "screen")
    Result = node_mix_screen(t, A, B);
  if (blend_type == "overlay")
    Result = node_mix_overlay(t, A, B);
  if (blend_type == "subtract")
    Result = node_mix_sub(t, A, B);
  if (blend_type == "divide")
    Result = node_mix_div(t, A, B);
  if (blend_type == "difference")
    Result = node_mix_diff(t, A, B);
  if (blend_type == "darken")
    Result = node_mix_dark(t, A, B);
  if (blend_type == "lighten")
    Result = node_mix_light(t, A, B);
  if (blend_type == "dodge")
    Result = node_mix_dodge(t, A, B);
  if (blend_type == "burn")
    Result = node_mix_burn(t, A, B);
  if (blend_type == "hue")
    Result = node_mix_hue(t, A, B);
  if (blend_type == "saturation")
    Result = node_mix_sat(t, A, B);
  if (blend_type == "value")
    Result = node_mix_val(t, A, B);
  if (blend_type == "color")
    Result = node_mix_color(t, A, B);
  if (blend_type == "soft_light")
    Result = node_mix_soft(t, A, B);
  if (blend_type == "linear_light")
    Result = node_mix_linear(t, A, B);

  if (use_clamp_result)
    Result = clamp(Result, 0.0, 1.0);
}

For the function definition, you can look at node_color_blend.h in the same directory
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

color node_mix_blend(float t, color col1, color col2)
{
  return mix(col1, col2, t);
}

color node_mix_add(float t, color col1, color col2)
{
  return mix(col1, col1 + col2, t);
}

color node_mix_mul(float t, color col1, color col2)
{
  return mix(col1, col1 * col2, t);
}

color node_mix_screen(float t, color col1, color col2)
{
  float tm = 1.0 - t;

  return color(1.0) - (color(tm) + t * (color(1.0) - col2)) * (color(1.0) - col1);
}

color node_mix_overlay(float t, color col1, color col2)
{
  float tm = 1.0 - t;

  color outcol = col1;

  if (outcol[0] < 0.5)
    outcol[0] *= tm + 2.0 * t * col2[0];
  else
    outcol[0] = 1.0 - (tm + 2.0 * t * (1.0 - col2[0])) * (1.0 - outcol[0]);

  if (outcol[1] < 0.5)
    outcol[1] *= tm + 2.0 * t * col2[1];
  else
    outcol[1] = 1.0 - (tm + 2.0 * t * (1.0 - col2[1])) * (1.0 - outcol[1]);

  if (outcol[2] < 0.5)
    outcol[2] *= tm + 2.0 * t * col2[2];
  else
    outcol[2] = 1.0 - (tm + 2.0 * t * (1.0 - col2[2])) * (1.0 - outcol[2]);

  return outcol;
}

color node_mix_sub(float t, color col1, color col2)
{
  return mix(col1, col1 - col2, t);
}

color node_mix_div(float t, color col1, color col2)
{
  float tm = 1.0 - t;

  color outcol = col1;

  if (col2[0] != 0.0)
    outcol[0] = tm * outcol[0] + t * outcol[0] / col2[0];
  if (col2[1] != 0.0)
    outcol[1] = tm * outcol[1] + t * outcol[1] / col2[1];
  if (col2[2] != 0.0)
    outcol[2] = tm * outcol[2] + t * outcol[2] / col2[2];

  return outcol;
}

color node_mix_diff(float t, color col1, color col2)
{
  return mix(col1, abs(col1 - col2), t);
}

color node_mix_dark(float t, color col1, color col2)
{
  return mix(col1, min(col1, col2), t);
}

color node_mix_light(float t, color col1, color col2)
{
  return mix(col1, max(col1, col2), t);
}

color node_mix_dodge(float t, color col1, color col2)
{
  color outcol = col1;

  if (outcol[0] != 0.0) {
    float tmp = 1.0 - t * col2[0];
    if (tmp <= 0.0)
      outcol[0] = 1.0;
    else if ((tmp = outcol[0] / tmp) > 1.0)
      outcol[0] = 1.0;
    else
      outcol[0] = tmp;
  }
  if (outcol[1] != 0.0) {
    float tmp = 1.0 - t * col2[1];
    if (tmp <= 0.0)
      outcol[1] = 1.0;
    else if ((tmp = outcol[1] / tmp) > 1.0)
      outcol[1] = 1.0;
    else
      outcol[1] = tmp;
  }
  if (outcol[2] != 0.0) {
    float tmp = 1.0 - t * col2[2];
    if (tmp <= 0.0)
      outcol[2] = 1.0;
    else if ((tmp = outcol[2] / tmp) > 1.0)
      outcol[2] = 1.0;
    else
      outcol[2] = tmp;
  }

  return outcol;
}

color node_mix_burn(float t, color col1, color col2)
{
  float tmp, tm = 1.0 - t;

  color outcol = col1;

  tmp = tm + t * col2[0];
  if (tmp <= 0.0)
    outcol[0] = 0.0;
  else if ((tmp = (1.0 - (1.0 - outcol[0]) / tmp)) < 0.0)
    outcol[0] = 0.0;
  else if (tmp > 1.0)
    outcol[0] = 1.0;
  else
    outcol[0] = tmp;

  tmp = tm + t * col2[1];
  if (tmp <= 0.0)
    outcol[1] = 0.0;
  else if ((tmp = (1.0 - (1.0 - outcol[1]) / tmp)) < 0.0)
    outcol[1] = 0.0;
  else if (tmp > 1.0)
    outcol[1] = 1.0;
  else
    outcol[1] = tmp;

  tmp = tm + t * col2[2];
  if (tmp <= 0.0)
    outcol[2] = 0.0;
  else if ((tmp = (1.0 - (1.0 - outcol[2]) / tmp)) < 0.0)
    outcol[2] = 0.0;
  else if (tmp > 1.0)
    outcol[2] = 1.0;
  else
    outcol[2] = tmp;

  return outcol;
}

color node_mix_hue(float t, color col1, color col2)
{
  color outcol = col1;
  color hsv2 = rgb_to_hsv(col2);

  if (hsv2[1] != 0.0) {
    color hsv = rgb_to_hsv(outcol);
    hsv[0] = hsv2[0];
    color tmp = hsv_to_rgb(hsv);

    outcol = mix(outcol, tmp, t);
  }

  return outcol;
}

color node_mix_sat(float t, color col1, color col2)
{
  float tm = 1.0 - t;

  color outcol = col1;

  color hsv = rgb_to_hsv(outcol);

  if (hsv[1] != 0.0) {
    color hsv2 = rgb_to_hsv(col2);

    hsv[1] = tm * hsv[1] + t * hsv2[1];
    outcol = hsv_to_rgb(hsv);
  }

  return outcol;
}

color node_mix_val(float t, color col1, color col2)
{
  float tm = 1.0 - t;

  color hsv = rgb_to_hsv(col1);
  color hsv2 = rgb_to_hsv(col2);

  hsv[2] = tm * hsv[2] + t * hsv2[2];

  return hsv_to_rgb(hsv);
}

color node_mix_color(float t, color col1, color col2)
{
  color outcol = col1;
  color hsv2 = rgb_to_hsv(col2);

  if (hsv2[1] != 0.0) {
    color hsv = rgb_to_hsv(outcol);
    hsv[0] = hsv2[0];
    hsv[1] = hsv2[1];
    color tmp = hsv_to_rgb(hsv);

    outcol = mix(outcol, tmp, t);
  }

  return outcol;
}

color node_mix_soft(float t, color col1, color col2)
{
  float tm = 1.0 - t;

  color one = color(1.0);
  color scr = one - (one - col2) * (one - col1);

  return tm * col1 + t * ((one - col1) * col2 * col1 + col1 * scr);
}

color node_mix_linear(float t, color col1, color col2)
{
  color outcol = col1;

  if (col2[0] > 0.5)
    outcol[0] = col1[0] + t * (2.0 * (col2[0] - 0.5));
  else
    outcol[0] = col1[0] + t * (2.0 * (col2[0]) - 1.0);

  if (col2[1] > 0.5)
    outcol[1] = col1[1] + t * (2.0 * (col2[1] - 0.5));
  else
    outcol[1] = col1[1] + t * (2.0 * (col2[1]) - 1.0);

  if (col2[2] > 0.5)
    outcol[2] = col1[2] + t * (2.0 * (col2[2] - 0.5));
  else
    outcol[2] = col1[2] + t * (2.0 * (col2[2]) - 1.0);

  return outcol;
}

color node_mix_clamp(color col)
{
  color outcol = col;

  outcol[0] = clamp(col[0], 0.0, 1.0);
  outcol[1] = clamp(col[1], 0.0, 1.0);
  outcol[2] = clamp(col[2], 0.0, 1.0);

  return outcol;
}

Here we see a mix function which the inputs is col1, col2 and the factor
It return col1 * (1 - factor) + col2 * factor when no clamp
In your color burn example:
col1 = 0.6
col2 = 0.5
factor = 0.5

According the node_mix_burn function,
tm = 1.0 - 0.5      >>>> 0.5
outcol = 0.6

tmp = tm + t * col2     >>>> 0.5 + 0.5 * 0.5  >>>> 0.75

tmp = 1.0 - (1.0 - 0.6) / 0.75  >>>> 0.46666...

and it doesn't match the 3 cases, so return 0.46666...
On the other hand, you can make a custom node using osl in cycle
https://docs.blender.org/manual/en/latest/render/shader_nodes/osl.html

#include "node_color.h"
#include "node_color_blend.h"
#include "stdcycles.h"

shader my_burn(
                color A = 0.0,
                color B = 0.0,
                float Factor = 0.5,
                output color Result = 0.0
){
    Result = node_mix_burn(Factor, A, B);
}

Nitpicking, but: tmp is uninitialized in the first line of node_mix_burn so this line in your explanation tmp = 1.0 - 0.5     >>>> 0.5 should be removed, it's not correct and confusing. Other than that, great answer!

Agreed .. :) great stuff.  And a helpful comment, too...

Perhaps it should be noted for the extract of formulas that at least (I haven't checked all functions yet) for the Lighten blend mode there seems to be an error (or for whatever reason just a different function) in Geometry Nodes. The formulas above seem to be from the Shader Editor.

In Blender 3.6, I can't see the Open Shading Language checkbox you boxed in yellow, but I'm still able to create the custom node, so I guess it's no longer needed to tick that box?

Not sure if it works when the checkbox is not enabled. I noticed that when your device is set to CUDA, the checkbox disappears. I'm currently using 3.61 OptiX and the checkbox is still there.

Great answer, thank you very much!!

@HarryMcKenzie The Open Shading Language only appears if you have either set the Device to CPU or to GPU Compute with OptiX enabled. As stated in the manual linked in the answer: "These nodes will only work with the CPU and OptiX rendering backend." It is not necessary to tick the checkbox to create such node, but to use it. If you disable OSL or render with CUDA, the node will not produce any output. Like nodes only working in Eevee or Cycles, Blender allows you to create one material for different engines - would be terrible if nodes disappear when switching engines.

source: Stack Exchange

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

sort: votes


text:
Trouble with custom driver
I need to write a custom driver function (because the algorithm I need is too complex to put into a single line). So, I thought I'd try making a custom driver...
I opened the file editor, pasted my function:
import bpy

def spinnerSlowdown(frame, cutoff, slowdownframes, offset):
  r = radians(frame * -18) + offset
  if frame < cutoff:
    return r
  elif frame < cutoff + slowdownframes:
    factor =  ((frame - cutoff) / slowdownframes)
    factor = 1 - (factor - 1)  * (factor - 1)
    newFrame = cutoff + (slowdownframes * factor)
    ret = radians(newFrame * -18) + offset
    return ret
  else:
    newFrame = cutoff + slowdownframes
    return radians(newFrame * -18) + offset

bpy.app.driver_namespace['spinnerSlowdown'] = spinnerSlowdown

... saved it, then ran the script (both with the arrow and Text / Run Script). No errors. (If I type some garbage into the script and run, I get an error, so I know it's at least compiling).
But, when I try to call that fn from a driver: spinnerSlowdown(#frame, 200, 100, radians(130))
It gives me the "Error: Invalid Python expression" message.
If I try to call it from the Python console:
>>> spinnerSlowdown(1,2,3,4)
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
NameError: name 'spinnerSlowdown' is not defined

So, it looks like my fn isn't visible.
Any ideas?
I'm a complete noob to writing Python inside Blender... so be kind.

Your driver expression spinnerSlowdown(#frame, 200, 100, radians(130)) has two little problems:

First, remove the # before frame. The # is used to create a driver automatically, but you already are in a driver, so to say.
radians is unknown in your function. Add this line right after import bpy in your script: from math import radians.

And if you want to call your function from the console, you need to do
>>> bpy.app.driver_namespace['spinnerSlowdown'](...)

radians is not unknown in drivers, all functions from math module are available (also added to the whitelist in the safe python). Indeed the script needs to import radians.

@MarkusvonBroady yes, you're right, i misread the error message first (it was unknown in the custom function, not in the expression). I fixed my answer, thx again.

The 'import radians' thing was the trick (the # was just an experiment). Thanks!

spinnerSlowdown(#frame, 200, 100, radians(130)) is indeed not a valid Python expression. Specifically the # character is unexpected.
The #frame means two things:

# - create a driver with the following expression
frame - current frame number

So either type #spinnerSlowdown(frame, 200, 100, radians(130)) in a normal field to create a new driver with that expression, or skip the # and type spinnerSlowdown(frame, 200, 100, radians(130)) in an already driven field (highlighted in pink) or in the driver editor.

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


text:
Auto Rig Pro Export to GLTF
I'm trying to export a model with miximo animation as a glTF embedded.  Character is rigged & skinned. Animation is loaded correctly. However, when I export via Auto Rig Pro export to glTF, I get an empty file and it is not loading in a glTF viewer.
I can export the model fine, which compiles to a 1400 kb sized glTF file. However when I try to select the armature along with the model, I only get 8k file size.
Validation report
Format: glTF 2.0
Generator: Khronos glTF Blender I/O v3.5.30
Stats:
0 draw calls
1 animations
0 materials
0 vertices
0 triangles
Extensions:
None
Report generated byKhronosGroup/glTF-Validator 2.0.0-dev.3.9.

Info    Message    Pointer
NODE_EMPTY    Empty node encountered.    /nodes/0

Anyone coming across the same issue?

Might be worth submitting a bug report. You can do this on the Preferences > Addon entry for the Gltf addon. There's a 'Report a Bug' button there.

Working with the Auto Rig Pro team to figure out what's going on. Will follow up. Hopefully this is an isolated incident due to my inexperience and not a global issue.


text:
Exporting Animation of non-rigged object
I have object without rig. It's animated by keying objects - rotation, moving and so on. However, now I want to export it as .fbx with animation. I know how to do it when you export armature and rig, but without it, I can't get it right. What is solution, do I need to rig it?

For example, case lid is parented to hinge, and by rotating hinge - I move whole lid.

You have to make sure you enable Bake Animation in the export menu. However, this will bake keyframes on all channels for Location, Rotation and Scale. And if you maybe just have a start and end keyframe with Bézier interpolation, the baked animation will have keyframes on all frames inbetween and they are all with Linear interpolation. You can set a Sampling Rate higher than 1 in the options to not have one key per frame, but since they are linear interpolated, smooth animations become jagged looking.

I tried that and similiar, but it's not exactly precise because of interpolations. Thanks anyway for helping

The ideal way is to rig it first, then to animate it. Even if you rig it now, it will be a bit hard to transfer the animation back to the rig.
Whether the animation can work as is or not, depends on where you want to use it. Right now, it will be a bit complex as you'll end up with a separate action for each object.
If you can share the file, I can give you more details on how to convert it to a rigged asset.

Edit: I transferred the animation to an armature I created. The steps I followed are listed below.

Reduce the number of objects as much as possible by joining them together making sure to apply modifiers. The remaining objects should be the ones that have animations. The Empty object was added to replace one of the objects I merged which was by another object's modifier.

List of objects before:

List of objects after:

I noticed that the origin of the box was inside it. Typically, for assets that sit on the ground, the origin should be at the bottom. I moved the objects up to achieve that by introducing an empty object, making it the parent of the top level objects, then moving it up.

I created an armature with a bone for every mesh object at its origin. I had to add an extra bone for a mirrored animation.

With constraints, I made each bone a child of its respective object. The mirrored animation required a different setup as it doesn't have a source object. For this one, I parented it to the lid, then copied an inverted rotation from the original bone (on the opposite side). Now, when I play the animation, the bones follow the objects as if the mesh was skinned to the rig.

I baked the animation of the bones removing the constraints.

Since I have the animation on the armature, it was safe to merge all objects down into one mesh, but before that, I assigned the weights for each separate object to its respective bone.

After merging all objects into one, I parented it with an Armature Deform to the armature.

I cleaned the file by removing temp empty objects and remaining object animations.

The only thing I would like to do now is to introduce some hierarchy to the bones, but I will let OP decide if that's necessary.
You can download the file from here.

Hello. I uploaded .blend file, go check it and let me know what you find out. Yeah I should have rigged it, but I thought this would be quicker and I wouldn't need to export it with armature. Howver,things changed. Thanks!!

@Radoon I updated my answer with the steps I followed to convert the box to a rigged animated asset. I also attached the file.

This was more than I asked for. Flawless explanation, I got some rigging experience but this surely got me new tips and knowledge. Thanks once more, fixed and perfect!

You're welcome!


text:
Packing island removes overlapping
I am following hard surface tutorial from BlenderBros. In video, unwrap one side and mirror it to other. That way, it preserves texture space and textel density is higher. Later in video, he applied mirror, and went to uv editing and average island scale and packed it. After that, those mirrored parts were still overlaping each other. However, in my case, when I do that - with Blender island packing or Uv Packer, it separates those parts and they are not overlapping anymore. How can I keep them stacked? Notice he didn't pin them, so neither do I.
On picture one you can see my model with UV unwrap. You can see those parts of mesh which are selected on picture two, they both share same texture space - they are stacked.  However, if I pack them to use texture space as much as possible,  it separates them and they are not overlapping anymore. I want to keep them overlapped but still be able to pack islands.

It might be helpful to users if you uploaded an example blend file to the site https://blend-exchange.giantcowfilms.com/ and add that link in the question.

You are right. Thanks, I uploaded

UV Packmaster addon has such a feature, I use it for a long time
https://youtu.be/xuGzSsgnwS4?t=65

This sounds great, but it costs. I assume it's worth it tho.

Totally worth, yes. Im sure there are less costy or even free packing addons, up to you to research and choose from, but this is the best.
Just dont expect UV unwrapping process to be made by default blender tools if its going to be any complex. Using addons is essential.


text:
How to make clothes rig follow original body mesh and deform
I rigged my dog model, and he is pretty ok for now. But I have jersey on him which has to follow and deform as well.
I tried those simple solutions with data transfer, or weights transfer but it doesn't work and so on but I assume this project will need little more detailed aproach. It transfer weights but not nearly precise as I want, since I want jersey to follow exactly and not to crop inside or out.
So, my dog model has it own deformation bones, and jersey has also it's deform bones. However, when I move dog rig, jersey doesn't follow. What can I do to "tell" jersey to deform same as dog rig + it has it's own bones so I could make Corrective shape keys (with drivers), so when it crops, I can fix it with those additional bones.
My jersey is same shape as dog's body, but separate mesh laying on top of dog's body just a little thicker - so, could I transfer weights from dog rig to jersey, or add some constraints so it follow dog deformation, or any other solution?
Picture 1 - dog with jersey
Picture 2 - dog without jersey
Picture 3 - dog properly bending without jersey
Picture 4 - dog bending with jersey, cropping occurs, I want it to bend like on picture 3 but with jersey this time

Why has the model its own deformation bones, and jersey has also its deform bones? Since the jersey is the same mesh as the dog's body I would go with one armature (bones) and transfer the weights. Why and what did not work with the weight transfer?

I tried Data Transfer, but it doesn't actually very precise transfer weights, and when I move control bones, some of jersey vertex points lag behind. However, if I weight paint it by hand it can't be enough precise.  Also, transfering weights by going Weights-Transfer and so on, doesn't do the job well also.

Show how you are transferring the weights and settings you use. Should work fine.

When I do a data transfer, I get a much better result than you:

Here's some specifics about my data transfer:

I disabled all modifiers on source and destination meshes so that they wouldn't affect the data transfer (data transfer will be from modified positions, very important!)

I deleted all vertex groups on the jersey.  There are deforming groups on the jersey that don't exist on the dog.  A data transfer won't overwrite those, so we need to delete them.

I created the data transfer modifier, set it to nearest face interpolated, clicked generate data layers, and applied the modifier.  (We need to apply if we plan to deform the body with an armature-- we don't want it copying weights from the armature deformed positions!)

I re-enabled the armature modifier on both objects.  I did not re-enable the corrective smooth on the dog body, because the corrective smooth will take them out of agreement.  You can't just corrective smooth both, because a CS modifier will affect each mesh in different ways.

Now, a few comments:

Your dog's basic weights aren't very good.  And whenever you have a border, like you have on the jersey, that's going to be more apparent than when you don't, like on the dog.  So the jersey is matching the dog, but that doesn't mean it's pretty.  If you really need this done via weights (see below), consider tweaking the jersey weights and then copying them back onto nearby body verts.

If rendering in Blender, it is easier to use a surface deform modifier targeting the dog's body than it is to use an armature, and it will look better, because this will work even with the corrective smooth on the body.

If not rendering in Blender, like rendering in a game engine, the most appropriate thing to do here is not to have a dog body under the jersey, but to have a single continuous mesh created by retopologizing the body and jersey together.  You can bake normals and other textures from the originals.

If you must do weights, and you must have a body underneath, and the jersey isn't just a straight copy of the body underneath, then some clipping, in some poses, is inevitable.  You can't make the surfaces match precisely unless the meshes share not only the same weights, but the same topology.

Thank you for this answer and also additional tips, appreciated! I will check this on monday and see if I can get it right, but explanations are very precise and good so I think I won't have problems.

I'm not sure if this has been answered or not, but here's my explanation, I recommend that you read it through to the end as depending on the order of your workflow, you have two options.
OPTION 1. My explanation is done with a simple cylinder, but the principles are the same.
Set up your model and rig. I've paired the weights automatically, but I imagine you have gone into more depth with your weights. Ultimately however you weighted your body mesh for your rig is irrelevant.

As we can see the mesh is deforming nicely

I'm now going to make another cylinder around my original cylinder which will act as the "clothes". I have also reset the deformation of my armature.

Parent the clothing to the armature, but this time with empty groups. This will build the vertex groups into your meshes data, but will not populate them with any weighting.

Select your body mesh FIRST in object mode and then the clothes mesh SECOND, and open weight paint mode

Go to weights > transfer weights and in the options menu in the bottom left hand corner select nearest face interpolated for vertex mapping, by name for source layers select and make sure Destination layers is set to all layers.
If you click through the vertex groups in the object data properties tab, you'll see that they'll now be populated with different mesh weights

And now as you can see, if we manipulate our rig again, the clothes and body move as one. I should also note that this is how you make a master rig and clothes for the master posing system in unreal engine 4.

I should note that the quality of deformation will come down to the quality of your topology.
OPTION 2. If you clothing mesh was effectively duplicated from your dogs mesh AFTER you had rigged it up, the vertex groups and weights would have transferred over. If this is the case, when you parent the clothing mesh to the rig just select Armature deform by itself, and that'll be all you need to do.

Thanks James, appreciate detailed answer.   I did that, also tried Data Transfer.   However, it doesn't actually do it precisely. It crops again, on screenshot I uploaded you can see weights, probably because those spine. ribs, and chest bones are not enough for jersey, so that's reason I added more aditional bones for jersey, however - I don't know what to do with them to prevent cropping.

I added .blend file, removed some of mesh since it is project task, hope it doesn't mind.

You should only have one rig, expecting one rig (the jersey rig) to follow another rig (the body rig) is quite unrealistic. You might be able to work with rig constraints but you're over-complicating the matter

I've had a look at your file and my method does work, unparent the clothing from the rig and delete the groups. From their re-parent the clothes to the rig with empty groups, and transfer the weights as described above. Finally touch up your weight painting manually to get the exact results you want. Closely over-lapping bones can often be a pain, tweaking the ray distance can often be beneficial in the weight transfer panel

Maybe that weight tweaking could be solution, but that is my weakest point, I just can't get it right. If you managed, could you upload blend file?


text:
Object.type - Empty / Effector
Is there a way to distinguish empties from effectors ?
If I have one empty and one force field, this :
for obj in bpy.context.scene.objects:
    print(obj.type)

will return :

Empty
  Empty

An empty
is_empty = obj.type == 'EMPTY'
#or
is_empty = obj.data is None

All objects have a field attribute, that is 'NONE' if there is no force field assigned to it.
is_effector = obj.field.type != 'NONE'

Thanks for your answer, it's very clear. Does this mean that a force field can be assigned to any object ?

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


text:
motion trail effect on video in VSE

Can Blender VSE do something like in this video ?

I have been looking on the net for motion trail effect, ghost effect, but cannot seem to find a way to do this.

Would I have to use a script to achieve this?

If so can someone please give me some pointers.

Kind regards,
Reggie.
Addition) I've found this, with linked script. Could this be modified in some way?

One way is by duplicating the strip and offsetting the duplicates it by a few frames. Turning down the alpha of the duplicates will produce a sort of ghosting effect. (the "alpha over" blend mode should be selected for this to work as expected)

Thanks gandalf3, i think that's what the scrip is doing.

Rather than doing this in the VSE you can create this effect using a feedback technique similar to How to do this type of trailing effects where the previous frame is held over to include in the current frame. The only real difference is in masking out the current frame so as to overwrite all but the background each time.
The setup of the scene is the same (ie, a camera pointing at the plane) with the following material on the plane :

Here the feedback is handled by the bottom branch - with the Image Texture pointing at the location of the render result, offset by 1 frame to pickup the previous frame. The top branch injects the video (filed infront of a black background) with the Subtract used to darken the image (this was used as a crude way to remove background artifacts since my video background wasn't perfect) with the Less Than used to detect the 'foreground' so that the feedback can be cut out wherever the new image is above a certain threshold. The images are combined and the Emission with a value less than 1 effects the fade out as the trail ages.
This produces the following result :

This is nice, but everything has to be prerendered for this to work

@placidchat, what do you mean by ‘prerendered’? It’s rendered on a frame by frame basis - no need to render out the whole animation first.

The 2 image texture nodes need 0002.png and proxy_25.avi, which is why i assumed this to be the case. Isn't it so?

@placidchat No, actually the 'proxy' is simply the source video of a hand in this case. The '0002.png' is set as an image sequence but pointing at the render result folder with an offset of '-1' so as to pick up the render result of the previous frame - this is what produces the feedback. There's no need to pre-render at all. In fact, you can place objects in front of the camera and get the same effect but with meshes instead of video - see linked answer here : https://blender.stackexchange.com/a/213312/29586

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


text:
Odd shadow being cast: cube vs plane
I have a cube transposing a plane and just one light. The shadow casted is weird. There is something missing at the corner. When I switch to Cycles, I got the correct shadows.

That artifact is called "Peter Panning", by the way.

You need to enable the Contact Shadows option of the light, and increase the Distance value:

I have just started learning Blender. It might be very basic, right? Thanks!

Further to  @moonboots' suggestion ...
In EEVEE, direct-light shadows are achieved by shadow mapping, which can give rise to artefacts where the fakery fails. 'Bias' is one of the fudge-factors made available to relieve some self-shadowing artefacts, but may introduce some undesirable side-effects of its own.. (which you can see if you read down, from the link)
Your offset shadow is one of the side-effects, if Bias is set too high for the circumstances.
The maps are constructed per shadow-casting lamp, so the adjustments can be found in the lamp's settings:

Really thanks! Both answers were very helpful.


text:
How to have less tired finger muscles when using Blender?
As an old 3ds max user, I realized that Blender is tiring my finger muscles more. Why?
I am pressing my right hand finger to the mouse button AND with my left hand finger, I am pressing to Ctrl, for zooming in and out. Ok.
But when I want to pan, I have to raise my right hand finger and press again to mouse button. During this, I have to release my left hand finger and press Shift. This is 2 active process.
What i want is this (like in 3dsMax):
I want to keep my right hand finger "pressed" (no releasing) during my left hand finger is pressing and releasing for zooming in and panning. This is 1 active process.
With this, I am just moving my left hand finger. Am I wrong?

You can use any (non conflicting) keymap you like in blender. There is an industry compatible keymap in 2.8+ have you tried this?

I would suggest more exercise and working on your hand muscles. Exercising and strengthening your muscles would have additional benefit for health in general and it would save time and effort worrying about things like this. Most people have muscles adequate for pressing mouse and keyboard keys without any additional exercise so it shouldn't take too much effort. This will also allow you to have a consistent keymap across all Blender areas and the ability to use it wherever you find it (when visiting a friend, for example, on their computer).

Consider mouse3 and mouse4 buttons (side buttons)


text:
How do you add an edge around a hole?
I was hoping someone a little more experienced with Blender could help me out here.
I'm working on making a low poly helmet when I encountered an issue, I would like to add an edge where I have drawn the red lines but have no clue how to do so.
I would like to preferably place it parallel to the existing hole.

Related https://blender.stackexchange.com/questions/61430/how-to-use-the-outset-option-from-the-inset-command. In your case it would be filling in a temporary Ngon, pressing I to inset, O for Outset mode, then delete that Ngon

"How" meaning with what tool or with what topology?
The tools you can use are:

The knife tool (K to activate, Z to cut through, C to cut perpendicularly to the view axis).
The join tool to join 2 vertices (J).
The duplication of an edge (AltV).
...

In terms of topology you're almost good, just try to keep quads:

start with

F to fill

I to inset

O to outset

X to delete faces

Here's another way to do it.
Start by going into Edit Mode and selecting all the inner edges for the hole in the visor. You might have to Shift + Alt + click a few times to get them all selected.

Press Shift + d to duplicate these edges only. Press g to grab them and pull them away from the main mesh so that you can confirm that they did indeed duplicate.

Press Numpad 1 to go into orthographic front view. With the new edges still selected press s to scale these edges up until they look about right for your purposes. You may have to scale the different axes individually, or even adjust some edges individually. But not too much tweaking is needed. Then press p and from the Separate menu, choose Selection. Now your edges are a separate piece from the main mesh. This is important for the next step. So is the front view. Make sure you're still in orthographic front view.

Go into Object Mode, select the new "edge" object, then Shift + select the base mesh. Now, with them both selected, go into Edit Mode. They are now both accessible in Edit Mode. Go to the Mesh menu at the top of the screen and choose Knife Project. This will use the edge object to cut a new set of edges into the main mesh. There is a special checkbox setting for this tool called Through. It's accessible from the panel to the bottom left. By default, it is unchecked, and that's what you want. If it were checked, the cut would go through both sides of the main mesh, instead of only the front side.

Here is the result. You can delete the "edge" object after you are done doing this. You don't need it anymore.

Here is what it looks like after a few quick cuts with the Knife tool to clean up the topology and get rid of the ngons.


text:
How would I export the vertex groups data from the "spreadsheet" option in Blender?
I have several vertex groups separated on my 3D model and I would like to export the spreadsheet that reflects the x,y, and z data along with the vertex groups data. I have already been able to export only the x,y, and z data as a .csv file using an open source code I found on here. However, I haven't been able to find any solutions to export the table shown below of the vertex groups. In this example listed below, I would want to export the area of the table with 'Ears', 'Mouth', 'Eyes', and 'Face' as a .csv file.

This is the code I have tried from Blender artists iceythe Kaoi:
import bpy
import os

def write_verts():
    obj = bpy.context.object

    if obj is None or obj.type != "MESH":
        return

    # Output geometry
    obj_eval = obj.evaluated_get(bpy.context.view_layer.depsgraph)
    filepath = "vertices.csv"

    with open(filepath, "w") as file:
        # Write the header, pos x | pos y | pos z
        file.write("pos x,pos y,pos z\n")

        for v in obj_eval.data.vertices:
            # ":.3f" means to use 3 fixed digits after the decimal point.
            file.write(f",".join(f"{c:.3f}" for c in v.co) + "\n")

    print(f"File was written to {os.path.join(os.getcwd(), filepath)}")

if __name__ == "__main__":

    write_verts()

Can be found at: https://blenderartists.org/t/how-do-i-export-an-objects-vertex-positions/1397962/16

What have you tried as far? Can you share the code that works for you with other data you need?

Also "export the spreadsheet that reflects the x,y, and z data along with the vertex groups data." - what do you mean? How should it reflect it? In what specific format? Do you need it in the same format as what you see in the Spreadsheet editor?

Yes, I would like the format look just like the previous image in a .csv file. I attached the code I have tried to the previous post

Every vertex has a list of groups that it belongs to, so in the loop
for v in obj_eval.data.vertices:

you can access these lists, they are simply v.groups. If the vert has a group in that list, you can access its index with v.groups[0].group. 0 here would be the first group in that list and it will not exist for verts that have no groups and there can be multiple groups assigned to a vert. You can access the weight of any particular group - v.groups[0].weight. You need to write a header for each existing group and you can get a list of all object groups - that's obj_eval.vertex_groups.
How do I know all this? Well, I didn't, I checked in the Python console using its autocomplete functionality( Tab ):

You can do the same to explore Blender's Python API. Then it's just a matter of using regular Python functionality to put the data into the format you want.

I keep receiving the error message of "TypeError: bpy_prop_collection[key]: MeshVertex.groups does not support string lookups" when trying to use 'v.groups'. Also receiving an error of "AttributeError: 'VertexGroup' object has no attribute 'groups' " when trying to use 'for v in obj_eval.vertex_groups'. Any advice on what I could be doing wrong?

I suspect you are using a string where you are supposed to use an integer and you are probably trying to access groups attribute of some group that does not exist.


text:
I tried setting up a greenscreen removal process with this blender tutorial but it didn't work. What am I doing wrong?
Here is the tutorial: https://www.youtube.com/watch?v=lA6AuZYbLyQ
I don't understand what I'm doing wrong. Used the droppler key, and nothing.

Try Ctrl+Shift+Click on Keying to move the viewer node.

I think if you connect the Viewer node to the output of Keying, you should see proper results. Otherwise you're viewing the pre-keyed result.

  You may have to refresh the image in the compositor by clicking and releasing the down arrow to the left of the "Untitled.2" selection.


text:
All of my renders are going pink, without textures being an issue. I reassigned materials yet they are still rendering wrong. Blender 3.4.1

I'm not sure what the problem is. I downloaded a 3d file from a free website, I reassigned the materials to the object, and chose a black diffuse shader. Hit render, and this happens. I've included pictures, and a file to download if you need it.
https://www.mediafire.com/file/dftgd1swa6gcv7g/chainlink_fence_2.blend/file

The world environment texture is missing :


text:
Is there a way to change the reflection of an object to look inverted in a mirror surface? So that text reads normally, for instance
I am trying to make sure I can read the text in a reflection during render. I am not sure how I should go about doing this. Edit: I should state that I need both the object projecting the light onto the mirror to read forwards, as well as the reflection.

If the text and the mirror are both facing the camera, then the backside of the text should be what's reflected, which should read the right way.  If I'm thinking correctly...

But if you needed a fix, you're in render layer territory, I think

Could you illustrate with a picture of the 'wrong' version?


text:
How to insert mesh into other object so I can paint them indepentently?
I'm new in Blender. I have my cube and let's say I would like to make a simple face on one of its faces and later paint it with different colours and animate. Is there any way to insert these meshes into cube's face? All solutions or other ideas would be much appreciated.

you can assign a material to each object, and then if you Join (ctrl-J) them into a single object the correct faces will have to correct materials (will become a multi-material slot object).

You can align and use a boolean modifier (union, I would think) on the primary (Cube?) mesh.

use a boolean (choose Intersect) on each of the sub-object: to get only an outline image (2D) on the Cube face. You might want to use the Solidify on each object with a positive offset if you want a bit more surface of the sub-object to show.

For animation, you may want to parent the sub-objects to the Cube object, so that they move relative to (follow along with) any animation of the Cube

Thanks for help @james_t


text:
Problem with metric and imperial measurements
siljelb, thank you for your info. I wasn't;t able to accomplish because of my lack of familiarization. But I found another explanation which made it easy of rme to understand. Thanks very much and I don't know how to give you a thumbs up
But here is the one I found most helpful
How to set Object Dimension
Just beginning Blender learning
In Layout, Edit Mode/Orthographic, I can see after changing the cube to a rectangular shape (looks like a shoe box lid), using Cube>Transform>Scale X,Y,Z to 0.5, 12.o 6.0 (changed from metric to Imperial) consecutively. But after I use letter A to show dimensions, all dimension are 12".
I need x=4", Y=12" z=6"
And even when I scale the measurements do not change. I realize I'm missing a detail that several videos aren't covering or I'm not absorbing
I'm going to close and Save As so I can reopen, which I'm learning well.
As a newbie, for someone to close my question, in less than 24 hours, without enough detail needed, is disheartening, and did not answer my question. So to whoever closed my question, please understand that this is not all I do during a 24 hour time span.
I wouldn't have minded waiting for a few days to get answer. I'm a slow learner. If this is Ai, then I won't do well here in this forum. I'm barely capable of asking a clear question and not at all familiar with how to navigate this forum yet.
How about a little patience for an old timer

Have you tried applying the scale? Object > Apply > Scale

@siljelb Yes as I originally stated " using Cube>Transform>Scale X,Y,Z to 0.5, 12.o 6.0 (changed from metric to Imperial) consecutively. But after I use letter A to show dimensions, all dimension are 12""

but further after entering size dimensions in Cube>Transform>Mode>XYZ Euler, all dimensions show as 12" when I actually had put it in as X 0.50"x Y 12.0 x Z 6.0 thinking these would get me inches. Hopefully this is clearer.

@Invent-A-Thing From what I gather from your questions, I still think the link we've previously pointed you towards has your answer. However, I understand that can be overwhelming when you're a beginner who's probably confused about certain fundamentals. May I suggest you watch some videos about them before anything else? Here's a good, detailed series about "beginner traps": https://www.youtube.com/watch?v=xsXSXnMpT9A

Because you scaled your original Cube object in Object mode the mesh is still showing the original dimensions in Edit mode.
To correct this, in Object mode you need to Apply the X Y and Z scale.
See screen-shots below :
Not sure why my default cube is 24" X 24" x 24" when yours is 12" but doesn't matter for this example :

Resizing the Cube in Object mode:

In Edit mode the mesh is still indicating the original dimensions :

To fix this we need to Apply the Scale in Object mode :

Now Scale is 1.000 in Object mode :

and dimensions correct in Edit mode:

To avoid this issue, best is, whenever possible, do all your mesh editing in Edit mode.
As a general rule always check that your objects scale (in Object mode),is at 1.000 before using Modifiers and UV unwrapping etc.)
A video that attempts to explain this Object mode v Edit mode thing in Blender :
https://www.youtube.com/watch?v=xsXSXnMpT9A
The keyboard shortcut to open the Apply menu is Ctrl A

That certainly looks like what I want. But I'll need to spend some time at this because I don't think I used your suggestions. I'm learning but limping along at best and very very early in this. Thanks very much for the very clear detail and professional instructions with arrows and text and the link to a video. Most helpful


text:
Is it possible to use both FK and IK on same frame
I have quadruped I want to animate. I made FK and IK bones and switch slider which toggles FK or IK via driver. On frame 1, I want my left leg to use IK and my right leg to use FK since I can't properly pose it only with IK. However, when I pose my IK leg to wanted position and start sliding my switch, that leg goes to rest position. What is way to avoid that, is it possible and how?

hello, maybe show some pictures, or even share your armature

Thank you for your time, I uploaded file. Hope you will manage to orientate in it

It is possible, and it is possible to imitate the rigify IK switch plus position swap.  However it's much simpler to just add the IK switch.
The trick is to use four bone chains and rely on how the constraint stack is processed for the switching.  (You can do it with 3 chains if you merge the DEF chain with the switch chain but this is easier to explain.)

I've shown each chain of bones offset from the others, but in the end they all overlay, so that each thigh bone has exactly the same position.

The DEF chain: these are the deformation bones.  They are the ones that the body mesh is parented to.  They copy transforms from the equivalent MCH switch bones.
The MCH switch chain: these are the chain that allows the switch to be implemented without introducing dependency cycles.  They copy transforms from both the IK and FK equivalent bones.
The MCH IK chain: This is your IK chain.  You should only manipulate the CTRL IK.leg bone in pose mode and only when you have the switch set to IK.  The remainder follow the chain.
The CTRL FK chain: This is your FK chain.  You can manipulate each of these bones in pose mode and only when you have the switch set to FK.

The "secret" is that constraints act in the same order they're placed on the stack. So if you place a Copy Transforms constraint on the MCH bone to copy from the equivalent IK bone and then you place a Copy Transforms constraint after it to copy from the equivalent FK bone, you can use the influence value of the second copy transforms as a "switch".  Set to 1, the MCH bone follows the FK bone.  Set to 0, the MCH bone follows the IK bone.

You can switch between IK and FK simply by changing the influence on the second constraint, but there are four bones that need to be set to the same value, so a driver can be used.
To create the driver, hover over the value of the custom property, RMB and select copy as driver from the drop down menu.  Then go to each influence to be driven, in the other three bones, hover over the value and select paste driver.
A common technique is to use a custom property to drive the first bone's influence so that you don't have to find the constraint bone to change the value.

Thanks for answer. That's a lot of content I need to try it and then get back and see if it worked.

Love how straightforward and informative your answer is. It made me curious too. Really well done!

@DarkSoul thanks.

Are you familiair with Rigify? It's a add on that also makes use of both IK and FK bones.
The issue you're having is that when you pose IK bones, the FK bones remain the same.
Rigify has a button that can copy the pose of the IK bones to the FK bones. See below.

You can also do vice-versa. I highly recommend using Rigify. On top of that, rigify even has a quadruppled rigs.
It's a free addon and saved me lots of trouble.

Almost sounds like an advert, lol

So basically, my left leg can use FK and my right leg can use IK at same time? I know it is great, but I haven't use it, and now my custom rig is finished, and making it again from Rigify would again take me a lot of time. Since I need to add all those constraints I already have in my model...

I have seen the rig you uploaded. If I were in your shoes, I wouldn't start from scratch, unless it's easy. If you can somehow figure out what method is used by rigify, then you can recreate that in your own rig. I'm not exactly sure how it's done. But there are several ways.

I think same. I don't have time, neither enough patience to start again :D Hope there is some way to achieve this. Probably has to be, since rigify has it, there is no reason custom rig can't have it

I found this :https://blender.stackexchange.com/questions/140368/how-do-you-make-a-seamless-ik-fk-ik-switch-using-drivers. It seems that snapping method uses a python scripts. I have no experience in that, i'm sorry!

Or mayeb there is a way: https://www.youtube.com/watch?v=6vdHwHSMeRQ&ab_channel=PierrickPicaut

If there is a way, Picaut will know it.  The answer that I just posted is my take on his approach.


text:
How to move one edge's vertice without interrupting other mesh
How to move one edge's vertice without interrupting other mesh - Here on picture, how can I make one more white vertice and slide it to the right to make 2 squares instead of this weird looking n-gons.
EDIT: Here on picture you see I have selected one edge, and it has 2 vertices. That edge seperates mesh in 2 weird n-gons. Left one is triangle(marked as "1." at picture I uploaded), right one is some weird quadrangle. I want them to become 2 squares(something as close as marked in picture "2."), obviously by adding one vertice more but don't know exactly how.
Also, how can I make edge loop to continue through this n-gon, beacuse as you can see it stopped right top of orange vertice.
EDIT: I marked with red dashed line on the picture where I want to cut mesh, but can't do it with CTRL+R.
P.S.: sorry for the unclear information, but I am pretty new to Blender so I don't know proper vocabulary for those problems. Hope now it is little bit clearer.

It's not clear, could you please try to reformulate?

Connect Vertex Path & Dissolve Edge
You don't have to move any vertices: they all are right in place. What you want is to re-arrange the topology, aka changing the connections between them. You'll need this two tools:
Use Connect Vertex Path to create an edge between two vertex

This tool connects vertices in the order they are selected, splitting
the faces between them. When there are only two vertices selected, a
cut will be made across unselected faces, a bit like the Knife tool;
but this is limited to straight cuts across connected faces.

https://docs.blender.org/manual/en/dev/modeling/meshes/editing/vertex/connect_vertex_path.html

and then Dissolve edges to remove an existing edge:

Removes edges sharing two faces (joining those faces).

https://docs.blender.org/manual/en/dev/modeling/meshes/editing/mesh/delete.html

Hello, it helped a lot. I need to get used to it, but it is useful tool. Thanks!


text:
How to blend Decal on Glass material
I made Decal in Substance painter and exported it to Blender. Now I want this decal to be like real full decal on glass. I made glass in Blender with Transparent BSDF and mixed in mix shader to mix them together.
But problem is with this fax that it only can be fully transparent but you won't see decal, or, to be not transparent at all but be full color decal. What is the right way to have fully transparent material with full color decal on it?

Nothing happens. Do I need to tweak any other node?

What happens if you plug the Alpha from the texture to the Mix shader Fac?

@Radoon, please pack your image and share your file: https://pasteall.org/blend/

I uploaded file. Be free to check and try!

you didn't pack your texture, go to File > External Data > Pack all into .blend and upload it again

Sorry-now it should be better

If you plug the Image Texture into the Principled BSDF, you're just coloring the glass material.
You can mix the Glass node (or Principled BSDF is this is the node you use to do the glass) and the Image Texture > Diffuse in a Mix Shader with the Texture's alpha as factor:


text:
How to achieve fountain looking falloff of spheres
I am making lottery wheel with balls in it. I want to make animation looking like water fountain - so, from the bottom of wheel it pushes them to middle of wheel, then they fall a bit do the right or left.

Something like this fountain. I couldn't achieve this only by wind or vortex.
Imagine those lines as paths of balls.

pls provide blend file, we will update it. Normally it is just the cause of wrong parameters. increase wind to e.g. 1000  - then you will see that they react to the wind. Decrease slowly until it is doing what you want. That's where experience hits. If you know what values to put in, you are faster. If you don't know you have to use try and error until it fits.

By giving an initial velocity to the balls, you could do that. Wind or vortex may not be the way to do it.

I added blend file. Thank you. Problem with wind is, if it is too strong it just pushes them to the top of wheel and they stay there like there is some sort of magnetic on top of wheel.
How do you mean about velocity? First time seeing this, do I need just to change object velocity or?

In a real lottery bowl, the balls are blown up from a stream of air that is quite thin in diameter. If you are using the Wind object with default settings, it blows evenly across the whole area.
So you should set the Falloff to Tube, then you have to adjust Max Distance and for the diameter change Radial > Max Distance. The values depend a lot on the size of your objects and the look you want to achieve.
To help blow the balls to the outside I've added a Force object above with limited Max Distance to affect the balls as soon as the wind decreases. I've also set the weight of the balls quite low. The result looks like this:

Thank you! That's it. I will need to tweak controls a little so I can get wanted results.

@Radoon You're welcome. Of course there's room for tweaking and maybe instead of Force you could use other force fields to get different results. I think the main thing is to use the limits of the force fields if you want to recreate certain effects.


text:
Choosing a computer for blender
which is a better starter computer for blender
1.HP Folio 9480m
2.HP EliteBook 840 G3

This kind of question won't be answered here.

So, where can I get it answered?

I don't know. Try to google it. Questions about hardware recommandations are out of topic in BSE.


text:
Mesh deform breaks when posing bones
So iam trying out cloth simulations and i got this pretty sweet mesh deform ready, the proxy model around the high poly works fine and the cloth simulation transforms to the high poly mesh pretty nicely when i just move the armature around. But when get to actually animating the model(posing and adding keyframes) the mesh deform just decides to corrupt. The proxy model is doing things accordingly to the armature but the mesh deformer somehow just cant transfer it to the main mesh. Ive been trying to figure it out for about 5 hours.
Procedure:

made a low poly model that goes around the high poly part
2.added back vertices to pin group
3.added cloth simulation and added the pin group to pin
4.added armature to the low poly and attached all vertices to R.chest
5.added mesh deform to high poly model and selected the low poly as the source
just pressed g and moved it around when playing the animation(works perfectly)
7.if i position any of the bones the mesh deform breaks, but the low poly is intact

Heres how it looks on keyframe 1:
and heres when the spine moves slightly:
i can send the .blend file if needed
ALSO: the surface deform modifier doesnt have this problem, looks pretty good, but there a weird jitter , and ive seen a lot people using the mesh modifier.

Can't say without seeing the file, but it looks like you're doing double deforms: once from the armature, then once from the mesh deformer.  Which is what you can expect if you armature deform and then mesh deform from a mesh that is also armature deformed.  If I wanted to do this, I would do it with a dynamic bind, and bone parent the mesh deformer rather than armature deform it.

That's it! Thanks a lot dude! I didn't know theres a differrence between bone binding and armature deform... All the problems are gone! all i did is bind by bone.....

Fix - Can't say without seeing the file, but it looks like you're doing double deforms: once from the armature, then once from the mesh deformer. Which is what you can expect if you armature deform and then mesh deform from a mesh that is also armature deformed. If I wanted to do this, I would do it with a dynamic bind, and bone parent the mesh deformer rather than armature deform it. –
Nathan 6 hours ago
As said, i just bone binded the proxy models, instead of armature deforming it....


text:
Korean Tile Roof Approach
I'm looking to model an accurate Korean traditional tile roof for archival purposes. I'm quite new to Blender so I'm still unsure of many things. I am wondering how to best approach this problem.
Here are some images of the kind of roof I'm trying to model:

A smaller manner of roof with very little curve to it

The corner of a larger hip/gable manner of roof with a normal amount of curve to it. Notice the differing overlap along the bottom edge of the tiling.

A wider full view of the hip/gable style of roof
What I have so far is this (modelled in Rhino3D and imported into Blender):

This is the main roof structure to be tiled, it is of the hip/gable type and will have a number of curves and joining moments.

This is a little brick shed being archived, it will have the more simple style of roof shown in the very first reference photo. Also seen is my early attempts and beginning to tile it by hand using array modifiers and so forth.

These are the three types of tiles used in these roofs, the whole thing can be constructed out of these three.
The important things are the double tile at the roof's edge—how the tiles break even spacing at the bottom edge of the roof by having one more overlapped tile—and the curve of the roof. As well, I think it would be nice to have some sort of procedural offset to the tiles to mimick a sort of hand layed æsthetic, and, if possible, a modifier to slightly skew the shapes of the tiles to make them look more handmade like in this photo:

This photo shows some older roofs that are hand tiled with handmade tiles and shows the kind of effect I'm looking for.
I did a little study using geometry nodes and following a Youtube tutorial and made this:

But I am not sure if its possible, and do not know how anyway, to apply it to this problem. Ultimately I'd like to do something like this using these premade geometries I have shown in the above photo (the three premade rooftiles) and, using those, apply modifiers to array them, skew them, deform them, and so forth. I feel like the approach for this could be quite straightforward, but, I do not know enough to know what it would be. Any and all help is very much appreciated!


text:
Decal Rotating Wrongly When Following Curve
I am attempting to get a decal to follow a predefined curve. By this, I mean it should follow the path specified by the curve upon changing the Y-value, where -Y is forward as standard.

I first set the decal at the correct height from the path and set it to have the same pivot using the 3D cursor, which is, in this case, at [5, 0, 0.3]

I then apply the curve modifier, using the Y-axis as the axis of rotation.

My result is a distorted, incorrectly rotated decal.
Can someone please explain why this is happening? What went wrong?
BEFORE APPLYING MODIFIER

AFTER APPLYING MODIFIER

EDIT: Added example file.

Hello, please share your file: https://blend-exchange.com/

Added. Thank you.

You need to put the origin at the geometry of the object and then Alt G to bring back the object at the same location as the curve's origin. Then in Edit mode rotate it 90° on Y if you want it flat?

This does work, I checked - before I accept the answer - but why does the decal need to be rotated 90 degrees? It should have the same orientation as the curve.

Don't ask me, I'm always lost with the orientations  ^^

notice that the curve normal direction matters in the object direction (in Edit mode, right click > Switch Direction). The 90° may have to do with the tilt of the curve?

One final question: can a vertical offset be added to the position of the object relative to the curve?

I'm not sure how you could do it, what is the purpose exactly, why not change the curve radius in that case? If you move the object on Z it will get deformed

I have resolved it by creating two curves, one scaled larger than the other, for two rotating objects. The decal should sit on the surface of the other object.

You need to put the origin at the geometry of the object and then AltG to bring back the object at the same location as the curve's origin. Then in Edit mode rotate it 90° on Y if you want it flat (I guess it has to do with the curve vertices tilt, you can tweak the Tilt value in the N panel, also note that you can invert the normals with RMB > Switch Direction).


text:
How to create hexagonal pattern on a mesh?
I want to create a similar hexagonal mesh on a curved surface
Here is the reference image:

This is my 3D model:

Hello and welcome. Please use a title that matches the content of the post. It should read like a question, be descriptive but succinct, unique and identifying, summarizing the problem so that anyone searching for similar issues is likely to find this. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing visitors see, answers you get depend heavily on it. See What is the problem of asking “How do I do this?"

May I recommend to read this : How can I create a hexagonal structure with Geometry Nodes? or that : Applying a polygonal (hexagonal) grid to a surface ?

It would probably be easier to use a normal map in this situation. Seems appropriate. Does it need to be geometry?

I tried modelling the shape but its not working, A normal map is the solution for it Thank you


text:
I created a texture in Photoshop for my object and for whatever reason the UV overlay is on the texture

Here is the texture on the object in blender. Keep in mind I am super new to Blender, I cant find anything explaining what's causing this issue. As you can see the UV map is on my object even though it's not on the texture.

Post an image of the texture. post an image of the material. "For whatever reason" is not a real reason.

hello, could you please share your file (with the image texture packed inside): https://blend-exchange.giantcowfilms.com/


text:
Is there a way to select every other line of faces along a cylinder quickly?
Is there a way to select like in the picture but quickly? and without having to select line by line?
I found a tutorial but it says to select the edges, I would like to select the faces.

ShiftG Select Similar picks up all matches to an existing selection, which makes this sort of thing possible:

1.ShiftCtrlNumpad + Select Next Active
2.ShiftG Select Similar > Normal

Good solution in this case. I just didn't take the "similar normal" option to make it a more general approach. If the cylinder for example was in an object containing more meshes, the similar normal might select other faces as well which are not part of the cylinder (unless you hide the rest).

Hi, @Gordon! Of course! Hence my care in the wording, not to suggest this method is any way 'correct', Yours is.  If  available, though, it's the sort of thing my muscle-memory reaches for, to be quick.

lol... numpad+ ... who the F uses keyboard with numpad? damn...

The following method works with e.g. a cylinder like in your question. For more complex shapes with more varying angles between the adjacent faces this might not work (especially the last step Linked Flat Faces).

Select one row of faces by holding Alt and clicking on the vertical edge between two faces.

From the menu bar choose Select > Checker Deselect.

Now that only every second face in the row is selected, choose Select Linked > Linked Flat Faces.

Now every second column of faces is selected. In the bottom left you have an option called Sharpness to which angle adjacent faces should be taken into account, the default 1° should be okay for this task.


text:
Trying to understand a code phrase from a tutorial
I'm an artist eager to understand something of Python for Blender, I've had some lessons of Python in the past, and been studying really hard, watching a lot of tutorials over and over about bpy. There is a piece of code that I didn't get why is it formatted like that:
tree = bpy.data.materials.new(name='neon').node_tree

emiss_node = tree.nodes.new('ShaderNodeEmission')

data_path = f'nodes["{emiss_node.name}"].inputs[1].default_value'

fcurves = tree.animation_data.action.fcurves

fc = fcurve.find(data_path)

The part about data_path = f'nodes ["{emiss_nod... Why is the content after 'f' formatted like that? The bracketed content suppose to be what in relation to 'nodes'??

Hello ! It's because animation drivers are evaluated using a python expression, not the evaluated result of the python expression. So you compare the character string composing the driver expression, not the value of the evaluated expression. Please elaborate if you don't find this clear :) nodes is a glorified dictionary of a node tree where each node in the tree is a key in this dictionary, and the value is the node construct. This is the syntax to evaluate a key in a dictionary

Do you know what an f-string is, in Python?

See https://docs.python.org/3/tutorial/inputoutput.html

Thanks everyone for the answers! Oh I see now! But not familiar with that therm "glorified dictionary", what does it mean?

It's not a real Python dict, but it implements some aspects of it.

tree = bpy.data.materials.new(name='neon').node_tree

Materials created by default don't have a node tree. Therefore tree should be None, though that may depend on Blender version. A safer way, I think, is:
material = bpy.data.materials.new(name='neon').node_tree
material.use_nodes = True
tree = material.node_tree

The snippet shows the material is newly created, therefore it's reasonable to assume the emission node being created is the first emission node and so its name is the default "emission", so the line of interest…
data_path = f'nodes["{emiss_node.name}"].inputs[1].default_value'

Evaluates the string to 'nodes["emission"].inputs[1].default_value', so under the assumption, the below line should have the same effect:
data_path = 'nodes["emission"].inputs[1].default_value'

(notice dropped f before the string quote)
Repeating the Martynas' link, because comments may disappear in future:
Formatted String Literals

I see. The context of this code is the creation of a material. The node tree have been created by the code already and the intension of an 'f' quote is to assume the node can have it's name changed. Is that a correct thought?

@AAAYerus the intention of the f-string is to avoid lengthy and less readable 'nodes["{}"].inputs[1].default_value'.format(emiss_node.name) syntax, or even worse 'nodes["' + emiss_node.name + '"].inputs[1].default_value'


text:
I want to texture a model from Total War: Warhammer 3
I'm trying to texture a Soul Grinder from Total War: Warhammer 3 but the bottom half of it is giving a weird shading issue. I'm not at all good with fixing up textures in Blender so I've been relying on others this far but it hasn't really gotten me anywhere so if someone could help me figure out the issue I'd really appreciate it

The Model Files

I'm sure there are already questions about the same problem.
(1) Disable the Auto Smooth option. (2) It uses the Custom Split Normals Data. Imported models often have this data and it causes shading issues in Blender. You can delete it if you don't need it outside of Blender.

(3) The Image Texture nodes for all maps and masks (Normal, Metallic, Roughness, etc) should have set Color Space to Non-Color. Only set Base Color to sRGB.


text:
Why does Blender say “Python script failed, check the message in the system console” when trying to import a Blender Python file from SynthEyes?
I am new to SynthEyes and I just tracked something but when I try to import it to Blender it just says:

Python script failed, check the message in the system console.

When I check the system console it says:

Traceback (most recent call last):   File "\3d Camera Track.py", line
3, in  ModuleNotFoundError: No module named 'Blender' Error:
Python script failed, check the message in the system console

It's for version 2.49b or before.
If the script is trying to import Blender assume it is written for Blender version 2.49 and before.
Script will need to be upgraded (or search for upgraded version)  using  bpy for later version.

Im using blender 2.83.1

Sure. ... but the script is for 2.49b @Daniel