text:
How to update compositor render after creating nodes in blender 2.81 with python?
This question has already been asked in the past for blender 2.79 and below, but I have seen that it has not received any useful answers, so now I try to ask it for blender 2.81.
I have created nodes in C.scene.node_tree.nodes
So far everything is ok, the problem is that it does not update, so the render is the same without taking into account the newly created nodes, obviously use_nodes, it is set to True, so I also tried to make C.scene.node_tree.nodes.update()
for n in C.scene.node_tree.nodes:
    n.update()

C.scene.node_tree.links.update()

None of these yield results.
I noticed that it updates, only in case the render window is open, and we switch to a compositor window, in that case it updates, at this moment I need to find a solution, even just a trick that does this, without risk receiving contextual errors.
Anyone who knows how to fix this?

i'm stuck on this too.


text:
GPU doesn't render the image with many moving particles
I recently was making a scene with particles being moved from forcefields and after making the particles over 100k
But while rendering as always the first frame didn't show the particles at all but in second frame where the particles should've appeared GPU simply doesn't render, but CPU does it but in a detail lossy way. I tried on my PC (GTX1070) and at friends PC (RTX2070 super) both had absolute same issue.

The reason why it struggles so much is the motion blur. since it has to know where the particle was to make the blur effect. and with so many particles looks like GPU just cant keep up. simply turning off the Motion blur helped, but if you need motion blur, you probably need to use CPU Only render. Why CPU only? because if you use GPU render with CPU acceleration the tile that supposed to be rendered with GPU won't let the CPU finish the job.
I hope it will help someone :)

source: Stack Exchange

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

sort: votes


text:
All my objects transforms are the same
I've imported a model from an .obj file. It imports fine, and I can see all the separate mesh objects that make up the model. But when I look at their object properties, all the transforms are the same for each mesh. I'm not really sure how that happened or what's going on; I wouldn't mind, but I'm exporting it via fbx to import into a game and it's screwing that process up somehow. Is there some local/global coordinate distinction I'm missing somewhere?

Are you looking to merge them all into one object, or do you want the centre to be inside each separare object? It is possible to set the centre of an object, however you would have to do it manually for each object as far as i'm aware.

do you want the centre to be inside each separare object? - I think that's exactly what I want, for each object to be centred on its own origin. Is there no way of doing that automatically?

Select all desired objects in 3d View (Object Mode) and go to Object > Set Orgin and choose Origin to Center of Mass (Volume):

You can also call the operator using the Search Menu:

Press F3
Search for Set Origin
Press Enter
Select Origin to Center of Mass(Volume)

Read more here: How to recenter an object's origin?

That does exactly what I wanted, thanks!

No need for that script. Object > Set Origin works for all objects in selection...

Yes i just noticed :)

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


text:
How to use pycollada module without install in blender? (Addon)
I'm trying to figure out how to use the pycollada module inside an addon without installing the module on Blender, so I have a root folder called pycollada-master, which contains everything needed. I put it in my addon directory
I have tried various methods, but I can't understand the best way to use this , for example form. import pycollada-master obviously cannot be the correct way to use the modules, I think the answer is simple but I don't come to terms, I don't know if I have to use import sys or not. Anyone with some experience with this type of procedure know the answer?

@brockmann Hi, I don't understand why of this reference, am I doing something wrong? Please be specific as I don't understand why this link of yours would help me understand what you are referring to, yes, entire reposity is downloaded in my pc

Not necessarily wrong but it's a git repository, you can clone it. Nice to know how that works anyway: https://en.wikipedia.org/wiki/Git

The hyphen is interpreted as a minus sign. This is why you see underscores in filenames. The collada folder is the module as is prob in link brockmann posted.  Recommend you don't distribute with your addon, rather give instructions on how to install,or add installation via script.  Notice https://github.com/skrat/bpycollada also doesn't come with collada module  included.

@batFINGER Hi, it looks like I managed to get the module working through import sys and sys.path.append () now works great. But I would like to understand why I advise against distributing it with this module (currently it is not in my interest)

Let's say bpycollada also distributed the collada module and appended it to sys.path as well as another 10 addons The addon repo will have 12 copies of collada.Installing into a virtual environment can be as simple as pip install git+https://github.com/pycollada/pycollada Search for questions here re using ensure_pip which comes with blender.


text:
Hot to change : to = or viceversa in FloatProperty declare by bpy.app.version statement?
The transition from blender 2.79 to 2.8x changed many bees, so I was thinking of making the scripts compatible with all 2 versions through various if statements.
So at the time of the declaration of a FloatProperty, for example, in Blender 2.79 it looks like this:
my_float = FloatProperty()

in Blender 2.8x it looks like this:
my_float: FloatProperty()

Instinctively I would do:
if bpy.app.version > (2,8,0):

    my_float: bpy.props.FloatProperty()

else:

    my_float: bpy.props.FloatProperty()

But I have many things to change, and I was wondering how we could simply use a variable, which takes on something like this
if bpy.app.version > (2,8,0):
    #dec= :
else:
    #dec= =

so:
my_float dec FloatProperty()

I understand that this example is ridiculous, but I would like to understand more how you can do such a thing correctly, if possible.

It would be better to make separate scripts.
If you want to know other ways look at this question https://blender.stackexchange.com/questions/133457/is-there-a-better-way-to-make-addon-working-on-both-blender-2-80-and-2-79

Very exact the topic you reported, I know it well, in fact at the moment I have 2 scripts that use the bees of the 2 versions, so 1 works on 2.79 and the other on 2.8x, but it is a pretty frustrating practice having to update 2 scripts , I wanted to understand if a question like mine was feasible


text:
Error when use: bpy.data.collections.remove(my_coll) blender 2.8
I not understand if is a bug or is my mistake,that script work fine , but i not understand tipology of error,
ERROR (bke.library): c:\b\win64_cmake_vs2017\win64_cmake_vs2017\blender.git\source\blender\blenkernel\intern\library.c:242 id_us_min: ID user decrement error: GRMyColl (from '[Main]'): 0 <= 0

removing a collection the way you mention works fine for me. Are you using the latest build of Blender 2.80? Can you provide more information on what happens before, and what my_coll is?

build is from 25 February, my_col = bpy.data.collections.get('My_Coll'), the operation work fine, but get this error

Please try today's version from https://builder.blender.org/download/ - I still cannot replicate the issue. A simple bpy.data.collections.remove(bpy.data.collections.get('colName')) works fine for me if the collection is present, otherwise throws a Function.collection does not support a 'None' assignment Collection type error. The error you post comes from the C code itself, so if it persists, you'll need to file a bug report at https://developer.blender.org/

Can't replicate this either. Please add code being used and a sample file. Minimal case producing such error, if possible. The error infers that some object (a collection or something  in one maybe) is trying to set its users to less than 0. (subtracting from users <= 0).    For bug report best (from experience with writing some very bad bug reports, one because  I hadn't built against python 3.6) to test with an official build of blender as suggested above by the 'guru.


text:
Way to ignore some object or mesh when snap is active in blender 2.8?
Question about way to exclude some object (target) when snapping is active on face,
 on interface or python script.

The only way I can think of is hiding those object that you don't want to snap to

Is an idea, but for me is no a good way unfortunately


text:
How avoid "esc" event and input by keyboard number, in the ui panel in a FloatPorperty?
By default FloatProperty showed in panel can inset number by keyboard input, and if press esc return at the previus value, how to avoid?

Hi. So we are able to understand your problem better, are you able to explain why you need that?

Hi Ray, Because i have a problem with update function in update function i created a subtraction from 2 FloatProperty ,work fine but work bad if press esc and input a value from input value in panel , I do not care to have the input in the interface neither less than when I press esc it returns to the previous value, I wondered if there was a method to avoid this otherwise I have to change the function, In addition I wondered if it was possible at the time of the mouse release to return the floatproperty to the default value


text:
Problem to install my addon on blender without use __init__
I made a little addon with a library. My problem is i have 2 version for 2.79 and 2.8
I would like to call the .py file in a recognizable way for example addon_2.8.py and addon_2.79.py but this case addon not work ... addon is a single module/file .py and the only way to make it work is call it __init__.py (this is confusing about the distribution of my addon)

Lose the period in the file name. Trying to run import addon_2.8 will throw an error. Something like some_sane_name28x.py and 27x.

Very sorry @batFINGER not understand. Is single file .py  , but i try some without "." name but nothing changes. It only work if name is init.py (with double underline) look on top for correct name

any idea because work only with init? is the same problem in 2.79 and 2.8

If it is in a folder needs an __init__.py Basically an addon is like any other other python module.  Check the python docs on setting up a module.  If its a folder in __init__.py put a version test and import foo_bar_version as foo_bar  then  in register method foo_bar.register().   Also check addons folders for examples of techniques that successfully install.  (To clarify single file is py file installed to addons folder, not a folder with single file.)

Ok it is the problem. But if install the addon not in a single folder when i unistall from preferences , unistall only module .py but the library it is not deleted

If this "library" is contained in a folder, recommend it be in addon folder and hence need an __init__.py  lol.

From preferences-add-ons "Remove" button (Delete the add-ons from the file system) but delete only the module .py not the library folder. But if install in a single folder with "init" name "Remove" work fine


text:
How to delete world (unlink) fwithout get the Name (2.8)
How to delete world without get the name of world in blender 2.8.
For add world i use new_world = bpy.data.worlds.new(my_var_string)
but name change by string. I think : can delete "Active world" without name?
i try:bpy.data.worlds.remove()`but that line need a world  .. i think  if is possible delete world in use?

bpy.data.worlds.remove(new_world)

sorry @batFINGER your example is right but not work for me because i create a class with button panel for delete world background

maybe if context.world: bpy.data.worlds.remove(context.world) to totally remove that world, or do you want to just unlink from scene?

@batFINGER your example give me error: context object has no attribute 'world'

context.scene.world  (context.world is only available in the PROPERTIES space)

@batFINGER This is exactly what I was looking for. if you want to put it in the answer is the correct answer to my problem


text:
After adding loop cut bunch of ngons appears (cylinder)
Why is this happening? I never had problem like that before. Scale is applied. Its really small cylinder (about 0.5 cm radius and 64 parts)

Your top face circle has more verts than the vertical faces. Share your .blend
https://blend-exchange.giantcowfilms.com/

But how it has more verts at the top if it is just plain generic cilinder with radius of 0.5 and 64 segments? Strange.

In your image, I can only count 10 vetical edges, but many more verts in the top circle. Do you have any modifiers? Perhaps there is a bunch of extra edges around the circle? Try Merge by Distance?


text:
Blender 2.82 - can't pack .blend "cannot pack absolute file" error
Hello I have a problem with Blender and packing into .blend file (for render farm).
While packing I have no errors, but then when I'm trying to upload file into render farm I have a message about missing files. For the first time I rendered whole scene and problematic objects lacks of textures (white), but then after adding next files I have absolutelly nothing even mesh.
When I'm using F3 > "Pack Blender Libraries" command I have error "cannot pack absolute file".
Which is funny, when I save scene with camera in lighting within problematic .blend file it's render just fine. Only when I'm trying to add this .blend file to my other scene I can't (look above).

This is just my 2 cents, but judging by the error, you could try File > External Data > Make all paths relative

After make all paths relative I have 35 errors even with textures which previously packed without problem. I have only problem with .blend files from addon I'm using - trees, plants etc... For the first time those rendered without textures (clay render) and after that not even appeard in the render view...
But when I upload .blend file with one of these plants then it renders just well with render farm... It just won't allow me to pack it into my main scene. Maybe should I do something with those .blend files contain trees etc?

I also got this error with Blender 3.6.5... "make paths relative" did not help me either. The error remains.


text:
Adding staints to paintwall (two image textures) - UV map problem
I'm trying to create simple box shaped column with two textures.
One is concrete, second vertical stains. I want to add this stain texture to the top of the column, but I encountered some really stupid problem. I can remeber one of my first blender projects was a model of TV. I use procedural (i meanjust grey BDSF haha) material for plastic colors and an image texture of the logo, but now I'm using TWO image textures. And I have a problem.
When I'm trying to mix these with MixShader node my stains are way too big. When I'm trying to scale up UV map with stain texture as a background, both stains and concrete texture getting bigger... Please help.

please show as many images as possible to make it more understandable, perhaps what you need is to create a second UV map for the second Image Texture and use an Input > UV Map node that you plug into this Image Texture node?

Yeah I just find tutorial for that I didint know that I can create second UV fo the same material, but stil. When I create that new UV thats the time when I can add that new image texture (with new UV map selected)? Then I can just select desired faces and click unwrap or smartunwrap and its done?

you can unwrap just one or several faces then plug the UV map node into the Image Texture, plug the Image Texture into a Diffuse then Mix Shader to mix it with the other image

by uv map node You mean this nodw which I can generate with ctrl+t using node wrangler addon? Sry I'm a blender noob.

In the Shader Editor (Node Editor in 2.7), press A > Input > UV Map, and in this node choose the new UV map you've created for the second image

My knowledge is limited here, but I believe you may need to go into the Shader Editor and create a new texture coordinate node and link it specifically to the stain texture, and make your changes to it within that node only, so as to prevent the other texture from scaling similarly. This is what immediately occurred to me as a possible course to take after reading your post, so if this isn't the answer, it may hopefully still put you on the right track.

So let say you want to make this object, but the sign is a PNG image apart (make sure it has a transparent background):

Load your background picture, create your first UV map, put your UV on the background.

Load your sign image, create a second UV map, put the face(s) you want on the sign, reduce the other ones so that they don't overlay the sign (I thought I could create a one face map but it seems like not, perhaps someone will tell):

In the Shader Editor, use this node chain. Use the Input > UV Map nodes to tell what UV map Blender is supposed to use for each image (you don't need to use the first UV Map node as the first UV map will be chosen by default). For the stain's Image Texture, choose Clip instead of Repeat to make sure that the other faces are not overlaying the sign (or move them over a transparent zone). Don't forget to plug the alpha output into the Factor of the Mix Shader.

Yes what I missed is that UV Map node. I created it on the right column, but didin't inside shadder.


text:
Change Bones Axis Blender 2.8
I've had a problem the past couple days with animating my rig on the left side.. every time i upload a animation and rename all the bones to the rig on the right, the axis of the bones are wrong and it turns into a side scrolling animation. how can i change the bones axis/Orientation to the right rig?

You can change a bone's axis by going into edit mode, selecting the bone, and pressing Shift + N. then you'll be able to change the transformation axis
https://i.sstatic.net/Qcr2v.jpg


text:
Exporting character with multiple equipable armor parts and animations from blender to unity (Blender 2.78)
I have a problem with a character i created in blender: he has multiple equipable armor parts and multiple animations as well as additional bones for hands (for weapons). When i try to import it to Unity, however, it imports numerous empty animations for armor parts, that are not even in my animation list in blender as well as skipping the primary animations from it. The only option that worked differently, was when i exported as fbx with the option "all actions" disabled, but then it only imported 3 animations "Run" "Walk" and "Grip right" for some reason.
Also, in NLA editor, it shows me only 1 animation.
PS: I also have 3 instances of empty walk animations below with no users, that i can't get rid of even with shift+x and reloading.

There's also a problem with character just hovering frozen even with applied animations in Unity, but i think that's just Unity linking problem somewhere and unrelated to this issue.
PS: The warning message in unity is about activating translation DOF for improved animation retargeting which doesn't fix the issue either.

When exporting to fbx, check the options on the right hand side. Most of the defaults are bad for unity. E.g. if you don't want to refine animation, you don't need non-deforming bones and especially not leaf bones. Using settings that make sense to you in regards to Unity might already solve the problem.

Finally got it fixed (the animations importing part, at least). In FBX export options, had to change the version from FBX 7.4 binary to FBX 6.1 ASCII.
ARGGHH.


text:
Is there any possibility to replace Blender 2.80 Keymap with Blender 2.79b keymap?
I searched for 2.80 shortcuts but there's not any at the moment and i
thought if i
could change it to previous blender settings


text:
Each bone is deformind the entire mesh and not just a part of it
I am still an amateur to blender and I usually use automatic weights for my Character's armatures, but this time I have encountered a problem in which the automatic weights makes so a bone has a way larger influence radius than it should. how can I fix it?
Here's a video of me demonstrating the problem
https://www.youtube.com/watch?v=7wGtnDnQXYw&feature=youtu.be

you often need to make some correction after parenting, either with the brush in Weight Paint mode, or with the Vertex Groups list in Properties > Data > Vertex Groups

Could you upload your .blend file on https://blend-exchange.giantcowfilms.com/ so I can check and try to help you?


text:
Paraview x3d file rendering in Blender
I have a simulation with some nice bubbles floating in the water. I am very new to the Blender community and by reading about it a bit (and also performing some tutorials) tried to render my simulation result first on paraview and then render it in Blender.
I have a left and right wall and then the bubbles floating around in the fluid(the space between the walls). The red and the blue wakes are the volmetric rendering of the temperature in those cells with the mid range blanked out. What that means is my left wall is cold and right wall is hot. I selectively set some the mid range as transparent and I am only interested in the boundary layers at the walls.
When I export the x3d file and import it in Blender (say for one snapshot) I do get the walls and the bubbles but I dont get the volumetric rendering of the temperature field. My paraview file and blender files after import looks like this

How do I render the temperature field (the field that appears colored in the paraview version) ?
The view always appears to be rotated in the blender, i guess the orientation of axis in paraview and blender is different.
How do i import more such snapshots to create a movie out of this ?

PS: Link to download the X3D file hosted on pcloud

If you upload a couple of frames of data, it will help courting out how to animate.

@EdTate sure i will try that. Any idea on te rendering of volumetric temperature field.


text:
Making a hole in a Dynatopo sculpt without Boolean
I was just wondering if there are other ways of creating holes in meshes that aren't 100% symmetrical (thanks dyntopo) or too intricate using something other then the Boolean modifier.
I'm currently working on a skull for starters but I need a hole in the cheeks and it got me wondering about whether there are possibilities beyond the obvious.
Thanks in advance!

Related: https://blender.stackexchange.com/questions/60459/dyntopo-sculpting-how-to-carve-out-like-a-boolean-instead-of-push-in

You can try to use a more advanced boolean solver. there's a plugin somewhere that uses the CarveMT solver to make more complex cuts
The biggest villain in boolean operations is that it comes to a point blender doesn't know how to deal with all the vertices and all the new geometry it has to create to accomodate the change, be it a union or a cut. If possible, decimating or reducing the mesh density in the area of the cut will increase the chances of success

Well it shouldn't be too hard to just merge some faces where you'd wanna do the boolean i think.

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


text:
Screw modifier problem
Im having trouble using the screw modifier to create a screw cap on a lightbulb.  Ive been trying to follow this guys video for it but cant seem to get the screw modifier to do something even vaguely similar to his.  It about 45 seconds in:
https://www.youtube.com/watch?v=P60Fk5YiTds
I created the same sort of edge loop but when I add the modifier it loops in on itself weirdly.  Any help with this?
Tutorial version edge loop

Tutorial version screw modifier

My edge loop

My screw modifier..

The object origin should be in the middle, not on the thread. Because the object origin is what the modifier uses as a reference for rotation.
If you look at the first screenshot, you can see how the object's origin is at the center line of the bulb, surrounded by the translation widget. Only the edges are left.
In object mode with only the object selected, set the cursor to the object using SHIFTS "Cursor to Selection". That will make sure the cursor is on the same plane as the object. Then place the cursor on the symmetry line of the bulb and use "Set Origin" >> Origin to 3D Cursor from the tools panel on the left.
You might need to adjust the axis that the modifier uses in its settings.

ahhh... how do i fix that? sorry

Also either your object rotation is wrong, unapplied, or you have to use screw in a different axis.

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


text:
mix a noise texture with a normal to make patches
I have a forest ground but I want to mix in a grass texture over that. I have tried but found no susses so far.
My plane are to use a noise texture an after that put on a image texture on top.

Try to use MixRGB node for blending Color and Height images with Noise Texture then put result to Base color and Height inputs of Principled BSDF and Displacement node.


text:
V 2.91 Shrink Wrap Modifer is Not Allowing Target Selection
Total newb. Ubuntu 18.04 Blender 2.91. Uninstalled all previous versions and did a clean fresh install from download.
I've been over this most of the day in these posts and in the documentation, my goal is to simply round the edges of a primitive. The simple method I found via various sources is to create and subdivide the object, then apply a shrinkwrap modifier and set the offset. Here is what happens.
-Create default project cube, subdivide 10 (at first, then tried subdividing multiple times per posts about having enough surfaces.)

Apply shrinkwrap modifer and select the target, but it doesn't allow selection.

(Side note, I do see the Material attached to the first cube, it must be the default. Tried it with and without material attached to the object.)
After trying a few dozen times and digging through more posts and documentation, I found that if I create multiple objects in the collection it allows me to select one of the other objects but the shrinkwrap applies to the FIRST object and incorrectly.
In the screen shot below, "Cube" is the first object and "Cube.001" is the second. I moved Cube aside, created a new cube, and target the second cube with the first's modifier. The result is the modifier is now applied to the first cube (not the target!) and reduces it to a no-dimension object designated by the orange outline select. Note the dimensions pane in this screen shot. You can't see it here, but the offset is set to 0.33mm in the second shot, played around with that a bit.

Remove the modifier the first object re-appears. I also tried, as in many posts, not dividing the cube in advance any applying a Subdivision Surface modifier above the shrinkwrap. What could I be missing? A simple rounding of the cube is all I'm after.

Sorry, if all you are after is a rounded cube, is there some specific reason you are using a shrinkwrap modifier? I think the easiest way is to add a bevel modifier, increase the segments to something like 3 or 4 and then add a Subdivision surface modifier set to something like level 2 - rounded cube done!

Hehe Thank you! Right after I posted this I went back and deleted the shrinkwrap modifier and while the subdivision surface modifier was still active, I saw it also rounds the  corners. With less subdivisions it's almost there. I played with bevel too, I could use either in a pinch but am having issues getting the right radius.  I'll need the shrinkwrap for other applications, the modifiers should work as described and there is probably something I'm doing wrong.  As mentioned I followed several tutorials as to the "right way" to do this, several of them are using the shrinkwrap approach.

Sorry, just saw your comment. If anything in my answer is helpful, let me know and I'll expand on it. In the meantime, I'll investigate the shrinkwrap solution.

If you just want a cube with rounded corners, the easiest way is to add a bevel modifier, increase the segments to something like 3 or 4 and then add a Subdivision surface modifier set to something like level 2:

If you want the whole cube to be round (like ballooning out), use a Subdivision Surface Modifier, followed by a Cast Modifier set to cuboid:

If you want the edges and corners rounded (like dice), inset every face slightly, and then add a Subdivision Surface Modifier:

Marking as answer because it does solve the root problem and so much more simple, as mentioned in comment above. Not sure why there are so many tutotials on using the shrink wrap method. Do you have any insights as to why the shrinkwrap isn't working?


text:
Odd crash with 2.8
I have a scene that contains some 2500+ individual meshes.  They were imported from a STL and separated via Separate(P)/Loose(L) and the center of each mesh is on the origin.  I ran the script below to move the origin of each mesh to the center of mass for each individual mesh.
Now, any time I click edit on a single object in that file, my computer locks up entirely, and even after waiting 60+ minutes, it never comes back.  No mouse movement, no response to ctrl-alt-del, nothing.
I was able to save the file to a .blend, but even opening that file, and then clicking edit on any object, the computer again hard locks.
######################
import bpy
import os

def recenter(a):
    a.select_set(True)
    bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_VOLUME',center='MEDIAN')
    a.select_set(False)

objs=bpy.data.objects[0]

for x in objs:
    print(x.name)
    recenter(x)

Can you share that file, preferably stripped done to a bare minimum of objects necessary to cause this problem? https://blend-exchange.giantcowfilms.com/

Over 2500 meshes are a challenge even for powerful CPUs/GPUs. Does the scene have to have that many objects?

I have overwritten the original file (because it was crashing). I will try to regenerate it.
The whole point here was to eventually merge everything down to just a few meshes, but the objects don't overlap.  I want to also run a script to enlarge each object by 1% so that they do overlap, and then boolean them all together. But, I need the origin at the center of mass before I enlarge them.
Yes, it takes a couple of hours for the script to run :(  "a bit more on an x86"

Select and run once on selection
Issues with question script include
When selecting and using operators don't iterate over all objects in a blend bpy.data.objects use bpy.context.scene.objects instead. This ensures that objects are linked to the context scene. Operators run on context.
Only choose the desired type of object to operate on, in this case assume that's mesh.
Many operators "do their thing" on all objects in  the context.selected_objects list.  A quick test in UI will confirm for set origin.
Most importantly please read
Python performance with Blender operators
Script below calls 2 operators for 3.5K objects, yours 3.5K operator calls.
Test script, chooses all mesh objects and transforms their origins to center of volume.
import bpy

# select only all mesh objects
bpy.ops.object.select_by_type(type='MESH')
# run once for all selected
bpy.ops.object.origin_set(
        type='ORIGIN_CENTER_OF_VOLUME',
        center='MEDIAN')

My bad.. while cleaning it up for posting, I didn't remove the array index.
My actual code was:
first=bpy.data.objects[0]
others=bpy.data.objects[1:]
for x in others:
I'll try your method.

Here's the broken file.
https://www.dropbox.com/s/q6x18a39yrgcqvh/Broken.blend?dl=0
Just a few minutes ago, i opened this file and started selecting and hiding (H) various objects.  After a couple of dozen, my computer again hard-locked.  Only power cycling brought it back.


text:
PNG Plane picture showing over other planes out of order in render view

The bottom to the “tower” is appearing in front of the mountains in render view.
However, it is supposed to be behind them, and is aligned that way in 3d view.
What is causing this issue and how do I fix it? Thanks!

can you please provide the .blend file or take some screenshots of your setup?

https://imgur.com/a/GPfJ2Y7
Here are the screenshots, and below is the blend file
https://file.io/WjJ7UK
Edit: turning transparency off of the tower png plane fixes the issue, but then the tower is not transparent, which is needed. Don't know if it is related.

the .blend file link is broken.

Sorry, used a bad website. Here it is:
https://gofile.io/?c=ACVpiS

Visibly textures are needed for the rendering, but your file does not include the textures (not packed in the blend file). So nothing is visible. And you should preferably use this link to upload blend files https://blend-exchange.giantcowfilms.com/


text:
Boolean modifier makes dent, not a hole
Im using a boolean modifier to make holes for windows on a car, but instead of cutting a hollow hole, it adds to the mesh, making a "dent". Any way around this?

Id like to keep it as a modifier with out applying anything so I can change it later easily if necessary.

Try to fill the bottom of the mesh.

@FFeller tried this out, but got the same results unfortunately

The Boolean modifier is supposed to work like that!
In Blender objects are usually full 3D models, with a surface and a volume: in your case, since your car's "walls" are made of only one layer, the Boolean modifier thinks that the object is full, and that the inside of the car is its volume (it doesn't work like that, but it's to make the concept easier).
That's why it makes a dent: it is trying to remove part of the volume of the car.
However, you only want to remove part of the car's door, because you know that the inside of the car is empty, so you need to make the doors thick (so not one layer, but 2 with a volume inside).
The easy fix is a Solidify modifier before the Boolean, like shown in the picture


text:
How do I turn a scene into a 3-color...logo or cartoon looking image?
I want to turn a scene into a more graphic-design looking image, something that can be screen printed onto a T-shirt which means few colors. Is there a conventional way to do that which makes the rendered models look crisp and very monotone, but still take into account a little bit of shading?
More like these examples but with a crisp distinction between colors instead of a smooth gradient https://www.google.com/search?biw=1600&bih=757&tbm=isch&sa=1&ei=04mGXZK4KsGOtQWH9ab4DA&q=shaded+logos&oq=shaded+logos&gs_l=img.3..0.17866.18966..19014...0.0..1.222.1149.9j1j1......0....1..gws-wiz-img.......0i67j0i8i30j0i24.px0-LbngAZk&ved=0ahUKEwjS7cmk4uLkAhVBR60KHYe6Cc8Q4dUDCAc&uact=5
I am sure there is a way to set that up, but I am not sure what kind of lighting and materials would accomplish this.

Grease Pencil From Mesh Addon That'll give you what you need to style your design into a handdrawn/painted look.

Oh...you want to do that to a scene? Whoops. Well this is how it would work. You would still use nodes, but instead of using the Material nodes, use the Compositing Nodes (the tab with the two pictures at the bottom of the Node Editor.)
This is what the scene would normally look like.

Here's a few different effects you could try out.
A Persona-esque effect:

A Noir (or Gameboy) effect:

Or just a totally simplified color scheme:

Again:
Make sure your film is transparent. Open the tab with a photo camera on it in Properties, scroll down to "Film," and check the transparency box.
Feel free to mess around with the ColorRamps until you get a good result. Any change makes a big difference! Just remember to keep it on "Constant."

Thanks, I will give it a try and see if it works.

If you are using cycles, you could have a setup like this here.

My Tips:
Make sure your film is transparent. Open the tab with a photo camera on it in Properties, scroll down to "Film," and check the transparency box.
Feel free to mess around with the ColorRamps until you get a good result. Any change makes a big difference! Just remember to keep it on "Constant."
Use an image with Transparency (a.k.a. alpha) to get the best results. It never looks good when you try cutting it out yourself. (At least it never does for me.)
Use a high quality image. One with a low color depth or resolution will look ugly. (like mine.)
When you're done, don't forget to render and save the image.


text:
Quick smoke in blender 2.8 goes the wrong direction
I tried looking for it everywhere, but I can't seem to find a fix for it.
Maybe I'm making just some really du b mistake but I can't seem to figure out what that would be. I looked everywhere and made node setups for the fire and smoke but they all had the same problem: the smoke and fire are going to the left instead of going up. Please help it has been very frustrating.

you have a field effector in the, that is directing the smoke.

You have a wind force in the scene. If you want that to make the smoke go up, scale the domain, and rotate it parallel to the Z axis. Then bake the smoke at whatever your settings are for it, and your problem should be fixed. This problem was caused because the wind blew the smoke across the top of the domain, not up.

I have no idea how the wind force got into that project because I never used it there, but creating a new project fixed it for me. Thanks mate


text:
Getting R, G, and B of Active Color in Custom Color Palette?
I have a custom palette that already has colors inside of it. I can even select which colors I want, but they don't do anything. Although, I can print out the locations of color in memory with 'print(pal.colors.active)' where 'pal' is a 'Palette' object - how can I get the R, G, and B components of the active color within said palette? I know there are tons of questions asked on colors already. But, I couldn't seem to find another post with this specific problem relating to colors.
Thanks in advance! Any help is appreciated.

Consider expanding tags on this question. At least add python.

According to docs PaletteColor class has color attribute, which is

float array of 3 items in [0, 1], default (0.0, 0.0, 0.0)

And active is just another PaletteColor.
Assuming these values are RGB, it would be
print([value for value in pal.colors.active.color])


text:
How to display hidden functions in menu bar?
I use (and study) the Blender 2.8x and find the Solidify function in menu of Mesh in Edit mode by hotkey F3 and entered keyword but the function don't displayed in menu bar. How display all available and hidden functions in menu bar? How to get a list of all hidden functions?

The function is available in Edit mode under Face > Solidify Faces.
You can then adjust it in the pop-up overlay.
I believe all functions are accessible through the main menu bar, they're just hard to find sometimes. :).

Hmm... I a lot times tried find it in all submenu but don't find it. Amazing ;) Thanks!

You're right. I was sure it was in there, but it still took me a few minutes :)


text:
How to get real location (coordinates) of an object
When I applying modifications like "Track To" or/and "Copy Rotation" to object, it location of the object on Numeric Panel (Transform) does not changes but the object really change location and it see in a Viewport.
Also I tried to got coordinates from Python but unsuccessful, they mirror values from Numeric Panel:
bpy.data.objects["Camera"].location
bpy.data.objects["Camera"].rotation_euler

How I can to get real position and rotation of the object? How to get numeric location that it can to copy and to apply to another object?

ob.matrix_world contains the visual transforms in global coordinates.  eg  loc, rot, scale = ob.matrix_world.decompose()

Thank you! It does what I need


text:
Volumetric Lighting looking very bad
I've tried increasing all sorts of samples yet the lighting looks terrible (Even on render!) How do i fix this? This is eevee 2.81.

This isn't the correct place you should be putting these questions in https://blenderartists.org/

What is your current node setup for the volume?


text:
A Scale Map For Texture Nodes?
I'm modeling a character and making a procedural skin shader, but I would like to fine control the scale of my bump maps (I'm using Voronois) since pores are different sized on different parts. I know I can't attach an image texture to the Scale of the Voronoi, but I was wondering if there is a way.

You can attach an image to the scale factor. It works pretty fine.
"..or into the scale factor of a mapping node, if the texture doesn't have its own 'scale' input" – Robin Betts

..or into the scale factor of a mapping node, if the texture doesn't have its own 'scale' input

Huh! So it seems I didn't realize to use a math node, and I gave up too quickly. Thank you so much! It does indeed work perfectly.


text:
Apply texture to a model via blender script
I am trying to apply a texture to a model programmatically via script. Via GUI, it's easy enough to do (Blender 2.8):

Import model (obj file)
In model properties go to texture properties
Change "Base color option" to "Image texture"
"Open", then load dds file for the image texture

For writing the script, this is as far as I went:
import bpy

obj_path = '/my_path_to_files/mytest.obj'
tex_path = '/my_path_to_files/mytest.dds'

# import model and texture
bpy.ops.import_scene.obj(filepath=obj_path)#, axis_forward='-Y', axis_up='Z')
bpy.ops.image.open(filepath=tex_path)
# get reference to model and texture
myobj = bpy.data.objects['mytest']
mytex = bpy.data.images['mytest.dds']

# try to set the texture (doesn't work)
myobj_material_nodes = myobj.active_material.node_tree.nodes
node_texture = myobj_material_nodes.new(type='ShaderNodeTexImage')
node_texture.image = mytex

I don't know which properties I have to set to get this working. Or if I am in the right path at all. The properties set when doing via GUI are:
bl_description:
bl_height_default: 100.0
bl_height_max: 30.0
bl_height_min: 30.0
bl_icon: NONE
bl_idname: ShaderNodeTexImage
bl_label: Image Texture
bl_rna: <bpy_struct, Struct("ShaderNodeTexImage")>
bl_static_type: TEX_IMAGE
bl_width_default: 240.0
bl_width_max: 700.0
bl_width_min: 140.0
color: <Color (r=0.6080, g=0.6080, b=0.6080)>
color_mapping: <bpy_struct, ColorMapping at 0x7f752ae3e298>
dimensions: <Vector (0.0000, 0.0000)>
draw_buttons: <bpy_func ShaderNodeTexImage.draw_buttons()>
draw_buttons_ext: <bpy_func ShaderNodeTexImage.draw_buttons_ext()>
extension: REPEAT
height: 100.0
hide: False
image: <bpy_struct, Image("mytest.dds")>
image_user: <bpy_struct, ImageUser at 0x7f752ae3e5c8>
input_template: <bpy_func ShaderNodeTexImage.input_template()>
inputs: <bpy_collection[1], NodeInputs>
internal_links: <bpy_collection[0], ShaderNodeTexImage.internal_links>
interpolation: Linear
is_registered_node_type: <bpy_func ShaderNodeTexImage.is_registered_node_type()>
label:
location: <Vector (-280.0000, 280.0000)>
mute: False
name: Image Texture
output_template: <bpy_func ShaderNodeTexImage.output_template()>
outputs: <bpy_collection[2], NodeOutputs>
parent: None
poll: <bpy_func ShaderNodeTexImage.poll()>
poll_instance: <bpy_func ShaderNodeTexImage.poll_instance()>
projection: FLAT
projection_blend: 0.0
rna_type: <bpy_struct, Struct("ShaderNodeTexImage")>
select: True
show_options: True
show_preview: False
show_texture: True
socket_value_update: <bpy_func ShaderNodeTexImage.socket_value_update()>
texture_mapping: <bpy_struct, TexMapping at 0x7f752ae3e208>
type: TEX_IMAGE
update: <bpy_func ShaderNodeTexImage.update()>
use_custom_color: False
width: 240.0
width_hidden: 42.0

My question is, what would be a good, clean way of doing this?

What it was missing is a link between the shader and the texture. We can do it as follows:
myobj_material_links = myobj.active_material.node_tree.links
my_obj_shader = myobj_material_nodes.get('Principled BSDF')
myobj_material_links.new(my_obj_shader.inputs["Base Color"], node_texture.outputs["Color"])


text:
Why can't I insert a keyframe into the prop from the operator panel?
In this code example, I try to call an operator popup, in which I put a "location" property of the active object, I'd like to right-click to insert or remove keyframes from these properties, but that doesn't seem to work. I wonder if it's a bug, or my problem, It would be really interesting to understand why, and possibly, how I can fix this?
import bpy

class MYPANEL_PT_Panel(bpy.types.Panel):

    bl_label = "Test"
    bl_idname = "MYPANEL_PT_Panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Test"

    def draw(self, context):

        layout = self.layout
        layout.operator("mypanelop.test", text = "Test")

class MYPANELOP_OT_Test(bpy.types.Operator):
    """ """
    bl_idname = "mypanelop.test"
    bl_label = "Test"
    bl_options = {'INTERNAL'}

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

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

    def draw(self, context):
        layout = self.layout
        ob = context.object
        if ob:
            layout.prop(ob,'location')

classes = (MYPANEL_PT_Panel, MYPANELOP_OT_Test)

def register():

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

def unregister():

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

if __name__ == "__main__":
    register()

The layout.prop that you're using is not in a Panel, but in the Operator dialog, which serves as an UI to an operation itself, and skips UI events that call for other operators (like the bound key to call 'anim.keyframe_insert', or to invoke another dialog for 'buttons.context_menu' that you mention)..
So if the function of the operator is to also insert a keyframe, you need to do that in the execution call.
import bpy

class MYPANEL_PT_Panel(bpy.types.Panel):

    bl_label = "Test"
    bl_idname = "MYPANEL_PT_Panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Test"

    def draw(self, context):

        layout = self.layout
        layout.operator("mypanelop.test", text = "Test")

class MYPANELOP_OT_Test(bpy.types.Operator):
    """ """
    bl_idname = "mypanelop.test"
    bl_label = "Test"
    bl_options = {'INTERNAL'}

    def execute(self,context):
        # INSERTING KEYFRAME
        context.object.keyframe_insert(data_path='location')
        return{'FINISHED'}

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

    def draw(self, context):
        layout = self.layout
        ob = context.object
        if ob:
            layout.prop(ob,'location')

classes = (MYPANEL_PT_Panel, MYPANELOP_OT_Test)

def register():

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

def unregister():

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

if __name__ == "__main__":
    register()


text:
Is it wrong to use Metal-Roughness-Specular etc. maps in sRGB mode?
I think this "Non-Color" procedure to be set in the "Normal Map" image node is necessary in most cases (Except for any maps in different color space)
I understand 100% regarding the use of "Normal Map" and have done my tests to really check what happens.
But I am wondering if it is really necessary to set "Non-Color" space on the Black / White maps for the texture nodes "Metal", "Roughness", "Specular" etc.
I usually use jpg and png textures.
This question has been on my mind for a long time, even though I see that pretty much Everywhere I look, on any tutorial, "Non-Color" is set.

Hello :). It's not wrong in any way, just the colors will be shifted a bit. Normal maps will be affected more, since they use all three channnels.

Related: Is possible simulate Non-Color Image with procedural nodes, from an sRGB image into Shader Editor?.

Hello @JachymMichal , sure, but I'm trying to understand, however, on types of maps not of the "Normal" type

It is technically incorrect not to use the “non-color” color space you’re using is non-color, but the result will not be horribly incorrect. as another user said, values will be shifted a bit, and normal Maps the most because they use all three channels. But anyway, why do you not want to set this? There is thankfully a way to do it with the python API, as I’ve discovered when needing it for such a purpose.

Hi, I would like to point out that I am doing the example for maps not of the "Normal Map" type, therefore only "Black / White" maps. In any case it is more my curiosity, I do not have in mind not to use, but to understand why I have to do it in that way.

@NoobCat Well in that case, I think it would be best if you actually try it with SRGB instead of non-color and see what happens.


text:
How to increase the "Strength" of a normal map procedurally, Before the "Normal Map" node?
There are some "Normal Map" textures that have a limited strength, even putting the input of the "Normal Map" node at maximum 10.
I was wondering what would be the best solution, using nodes, to accentuate the strength of the Normal map, before entering the input of the "Normal Map" node, so as to better adjust the strength.

You can separate the RGB channels, amplify them with a Map Range node (say, 0.4 to 0.6 mapped to 0, 1), and then recombine them.
However, amplifying normal maps like this should never be neccesary. Normal maps do not alter geometry, unless it is not being used for normals: in the case that Cycles is using them to displace the existing vertices through a displacement material output. Changing the normals of a mesh will never change the mesh itself. I think you are mistaking for weak normal maps what is actually an inherent disability in faking light interactions.


text:
How to speed up the template_icon_view()?
I think this depends a lot on the size of the images you are trying to upload, but I notice that the compilation of the previews in the popup always seems to be slow.
The compilation of the icons in the pcoll was done with a function similar to this:
def enum_previews_from_directory_items(self, context):
    """EnumProperty callback"""
    enum_items = []

    if context is None:
        return enum_items

    wm = context.window_manager
    directory = wm.my_previews_dir

    # Get the preview collection (defined in register func).
    pcoll = preview_collections["main"]

    if directory == pcoll.my_previews_dir:
        return pcoll.my_previews

    print("Scanning directory: %s" % directory)

    if directory and os.path.exists(directory):
        # Scan the directory for png files
        image_paths = []
        for fn in os.listdir(directory):
            if fn.lower().endswith(".png"):
                image_paths.append(fn)

        for i, name in enumerate(image_paths):
            # generates a thumbnail preview for a file.
            filepath = os.path.join(directory, name)
            icon = pcoll.get(name)
            if not icon:
                thumb = pcoll.load(name, filepath, 'IMAGE')
            else:
                thumb = pcoll[name]
            enum_items.append((name, name, "", thumb.icon_id, i))

    pcoll.my_previews = enum_items
    pcoll.my_previews_dir = directory
    return pcoll.my_previews

I was wondering if there is anything that can do the trick.

Where is it slow? Have you timed it. Is it slow re the dynamic enum items?  Big fan of pathlib over os.path  can for instance glob the extension.  https://blender.stackexchange.com/questions/204268/simple-python-script-to-stitch-images-into-movie-failing-with-incorrect-context/204418#204418  vs  https://blender.stackexchange.com/questions/135690/load-images-with-substring-in-filename-from-a-given-path

would weigh up having a "refresh" button to reload if need be.  For example the text editor if saved source is touched. over the need to constantly keep an eye on the folder.  The logic above also suggests an update method on my_previews_dir property.   IIRC have answered re an icons module that uses a folder keyed dictionary (instead of "main" above) to do much the same...


text:
Can Rigify IK stretch without deform?
Is there a way to modify Rigify's IK stretch so that my mesh's limbs do not lose its volume? I'd like my arms and legs to stretch but I don't want them to turn into thin noodles.


text:
Can you switch between different material versions?
So I have a model that has two different shading versions. The usual principle bsdf and emission for a shadeless render. Using mixer nodes makes it easier to switch between the shaders in nodes but I still have to go through each material to update the mix node. Is there an easier way to switch shaders?

could you please show some screenshots?

@moonboots https://imgur.com/a/HqxvvE4
It's just one material with two shader nodes into a mixernode. Could I do this for several materials to quickly switch shaders without going through each material? Do I have to make a keyframe or something?

Add a driver to the Fac (mix factor) of the Mix Shader nodes. Use a Custom Property or the X-value of the position of another object to control the driver. If you change the value (0 or 1) then the driver(s) will update the Fac value for you and you can switch between all materials with a single click.
Example with Custom Property

create a new Customer Property. You can use any object like the camera or an Empty. I used Suzanne the monkey in this example because Custom Properties of an Empty are not displayed in the side-panel ("N-panel") of the viewport, just in the Object Properties panel under the Custom Properties section.
Enter 0 or 1 (no trailing .000) for the Property value and Default Value and give it a proper name ("Shadeless" in the example). If you change the name later you need to update all drivers manually.

Right-click the value of the new property and select "Copy as New Driver"

In the shading editor, right-click the Fac value of the Mix Shader node, select "Paste Driver"

repeat the last step and paste the driver in all materials that you want to switch

Finally, to switch it, select Suzanne and change the value of the custom property.

I tried yours because it was the most in depth of the three solutions and it worked like a charm. Although I was worried at first because when I tried to copy-paste the driver from the n-panel properties onto the mix node my blender 2.91.2.0 would always crash. But thankfully it worked from the object properties. Thank you so much, Blunder!
https://i.imgur.com/yBph1Kg.gif

A bit dirty but you could use a node group:
Select the Mix Shader that you use as a shutter, press CtrlG to create a group. Once done, press Tab to go into the group and unplug the factor socket that will be created by default. If you play with the factor value it will switch from a shader to another:

Press Tab again to go out. In all your other materials create the group you've created with ShiftA and plug the shaders:

Now select one of these groups and play with the Mix Shader factor value, it will switch all the other material Mix Shaders as well.

why dirty? I think it is pretty clean, if you give the group node a good name like "color all nodes" or something ;)

I don't remember, I guess I expected a more direct way to do it  ;)

If your model is one object..
You could use the Object tab > Relations panel > Pass Index, or some function of it, as a switch. It's called 'Object Index' in the Object Info node:


text:
How do I make a high poly model from a low poly model and a normal map?
Complete noobie to Blender here.  I was wondering if there was a way to add the bumps from a normal map into a model so I can 3D print it with all the indents and such.  I assume it's something to do with the Displacement modifier but I have absolutely no idea how to use it or any nodes or such.  If you need more info on what the normal maps look like and such I'll be happy to send them.

so you need to first convert normal map to height map, it doesn't seem to be possible within Blender, it looks like some programs can do it? Here a guy says that he has created an app that is supposed to do it, I can't open it though: https://www.reddit.com/r/gamedev/comments/fffskm/convert_normal_map_to_displacement_map/

see https://www.youtube.com/watch?v=AOdpGgqIub8

Moonboots was kind enough to provide one link in the comments, which I'll check out further.  Scroll down that Reddit page to find usage instructions; it works for me.
Another option here is njob ( http://charles.hollemeersch.net/njob/ ).
Njob just outputs 8bpc height maps.  Neither NormalToHeight nor Njob can properly handle texture tiling.
Note that conversion of normal maps to displacement maps is inexact.  There exists some data necessary for displacement that isn't present in a normal map.  Neither of those utilities take your UV tangents into account, and you'll find that displacement is incorrect as your UV rotates.  You will need to adjust displacement parameters to eye.
It's also possible for a normal map to encode for impossible angles, that can't be represented by geometry.
However, I know that it is possible to get reasonable results using Njob.  I sometimes convert from normal to bump in order to not have to worry about UV tangents during material creation, or to smooth out a rendered displacement-- smooth shaded normals interpolate differently than position, so rendering as normals and converting to height can create a smoother displacement map than just rendering height/position.
Once you've converted a normal map image into a bump map image, you can use that image for displacement via a displacement modifier:

Notice a few things.  First, only actual vertices are going to get displaced, so I use a subdivision modifier (on "simple" here, but you might try C-C, it depends on use) to generate a lot more verts.
Then I create a displacement modifier after the subdivision.  The precise settings depend on your needs.  You need a way to map from 3D vertex coordinates to 2D image coordinates, and here I'm using a UV map to do that, but there are other options.  In order to displace from a particular image, it's necessary to use the properties/textures tab to load your image into Blender (this is one of the few remaining use cases for that tab.)  Strength and midlevel should be tuned to eye; there is no right answer for these, not when using an image that has been created from a normal map.
If desired, these modifiers can be applied for further editing or sculpting.


text:
Modal operator on keypress overriding the default bevahiour even with pass through
I have this code that triggers a modal operator everytime you hit the R key, i am trying to retain the default behaviour of blender while running this operator, meaning if i am in pose mode and want to rotate a bone i hit the R key and start rotating it. But somehow it doesn't work even with the "PASS_THROUGH". Any solution to this ?
I want to perform a set of operations when the Bone is being rotated, like disable something and enabling it right after the operation is finished. Is this the best solution ?
Thanks
import bpy

class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

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

    def modal(self, context, event):

        if event.type == 'R':  # Confirm

            print('bone is being rotated')

            return {'PASS_THROUGH'}

        elif event.type == 'LEFTMOUSE':  # Confirm
            print('bone has been  rotated')
            return {'FINISHED'}
        elif event.type in {'RIGHTMOUSE', 'ESC'}:  # Cancel
            # Revert all changes that have been made
            print('bone rotation has been  cancelled')
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):

#        self.execute(context)
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

addon_keymaps = []

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

    # Add the hotkey
    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new(ModalOperator.bl_idname, type='R', value='PRESS'  )
        addon_keymaps.append((km, kmi))

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

    # Remove the hotkey
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()

Just found out that you can call the rotate operator inside the modal so i guess that's the solution
import bpy

class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

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

    def modal(self, context, event):

        if event.type == 'R':  # Confirm

            print('bone is being rotated')
            bpy.ops.transform.rotate('INVOKE_DEFAULT')
            return {'PASS_THROUGH'}

        elif event.type == 'LEFTMOUSE':  # Confirm
            print('bone has been  rotated')
            return {'FINISHED'}
        elif event.type in {'RIGHTMOUSE', 'ESC'}:  # Cancel
            # Revert all changes that have been made
            print('bone rotation has been  cancelled')
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):

#        self.execute(context)
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

addon_keymaps = []

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

    # Add the hotkey
    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = wm.keyconfigs.addon.keymaps.new(name='3D View', space_type='VIEW_3D')
        kmi = km.keymap_items.new(ModalOperator.bl_idname, type='R', value='PRESS'  )
        addon_keymaps.append((km, kmi))

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

    # Remove the hotkey
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()


text:
Blender outliner Context Menu entry

I want to add an entry in the object context menu of the outliner. I tried with  bpy.types.OUTLINER_MT_context_menu with no results.
Any idea how i can do that ?
Thanks

Ok i found the answer and it was dead simple :
bpy.types.OUTLINER_MT_object.append(menu_func)

You should note that the menu is different if you click on a collection, in a blank space, on a button or on an object in the outliner


text:
blender python check if the Rotate or grab mode is active?
Is there a way to know with python if the user has activated the Rotate or grab mode ( R key or G key) for a pose bone ?
Thanks

Detect specific operator is triggered
import bpy

# background detection modal, self-destruct when open a new blend file, switch workspace, switch to quadviews
class XX(bpy.types.Operator):
    bl_idname = "view3d.xx_modal_operator"
    bl_label = "XX Modal View3D Operator"

    INSTANCE = None
    HANDLE = None

    @classmethod
    def modal_fin(cls):
        try:
            cls.INSTANCE = None
            bpy.types.SpaceView3D.draw_handler_remove(cls.HANDLE, 'WINDOW')
            cls.HANDLE = None
            print("    modal finished")
        except:
            pass

    def modal(self, context, event):
        if context.area is None or context.space_data.region_quadviews:
            self.__class__.modal_fin()
            return {'CANCELLED'}

        # if event.type in {'ESC'}:
        #     self.__class__.modal_fin()
        #     return {'CANCELLED'}

        for kc in context.window_manager.keyconfigs:
            for km in kc.keymaps:
                operator = km.keymap_items.match_event(event)
                if operator and operator.active:
                    if operator.idname == "transform.translate":
                        print("When transform.translate is triggered, this message will be displayed. But when this message displayed, transform.translate is not necessarily triggered")
                        print(operator.name, operator.idname)

        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        cls = self.__class__
        if cls.HANDLE is not None:
            self.report({'WARNING'}, "Abort, modal already running.")
            return {'CANCELLED'}

        if context.area.type == 'VIEW_3D':
            cls.INSTANCE = self
            cls.AREA = context.area

            cls.HANDLE = bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')

            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "View3D not found, cannot run operator")
            return {'CANCELLED'}

def draw():
    try:
        # if open a new file, it cannot access the INSTANCE
        ins = XX.INSTANCE
    except:
        XX.modal_fin()

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

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

if __name__ == "__main__":
    register()


text:
blender python, condition inside preset_values
I want to make a preset system for storing light parameters, like the light size, intensity and so on...
My issue is that there are parameters specific to each type of light like spotlights have light.data.spot_size .
How can i add a condition inside the preset_values array to check which type of light i am dealing with ?
Because otherwise if the parameter doesn't exist it will throw an error. Or maybe there's another method to handle this?
Here is the code:
class AddPresetObjectDisplay(AddPresetBase, bpy.types.Operator):
'''Save current parameters'''
bl_idname = "lighter.object_display_preset_add"
bl_label = "Save as a preset"
preset_menu = "OBJECT_MT_display_lighter_presets"
@classmethod
def poll(cls, context):
     return True;

# variable used for all preset values
preset_defines = [
   "import json",
   "obj = bpy.context.active_object",
   "modifier = next(i for i in obj.modifiers if i.type == 'NODES')",
   "obj.data.update()",
   "light1 = bpy.data.objects['my-light0']"
]

# properties to store in the preset
preset_values = [

    "modifier['Input_6']",
    "light1.data.type",
#    Part where i want to add a condition
    "light1.data.shadow_soft_size"

]

Thanks

if you add a runnable script, i will have a look. But tbh i have no desire to stare at code fragments and guessing how it could work...

I found the answer.
class AddPresetObjectDisplay(AddPresetBase, bpy.types.Operator):
'''Save current parameters'''
bl_idname = "lighter.object_display_preset_add"
bl_label = "Save as a preset"
preset_menu = "OBJECT_MT_display_lighter_presets"
@classmethod
def poll(cls, context):
     return True;

# variable used for all preset values
preset_defines = [
   "import json",
   "obj = bpy.context.active_object",
   "modifier = next(i for i in obj.modifiers if i.type == 'NODES')",
   "obj.data.update()",
   "light1 = bpy.data.objects['my-light0']"
]

# properties to store in the preset
@property
def preset_values(self):
  preset_values = [
    "modifier['Input_6']",
    "light1.data.type",
    "light1.data.shadow_soft_size"
    ]

  light1 = bpy.data.objects['my-light0']
  if light1.data.type == "SPOT":
      preset_values.append("light1.data.spot_size")
  return preset_values


text:
Blender 2.8 Texture coordinates keyframes are not visible in Graph Editor
Here's the material property I'm animating: Vector Mapping

No keyframes show up in the graph editor.

I need to change the interpolation mode to linear, but i can't find the keyframes
Edit:
In version 2.81 the same happens.

Is is possible for you to provide the .blend? That would be extremely helpful.

I have 2 options for you.
1) You need to select the object AND the node that you want to animate. It should now be visible in your Graph editor.
2) You need to disable the "Only Selected" icon in the Graph Editor (little icon arrow).
See picture

The Object IS selected but for me it looks like the Diffuse BSDF Node is selected and not the Mapping node.

Seems to me as the correct answer. Either turn off "Only Selected" button or select the mapping node and the keyframes should be visible in the Graph Editor.

Exaclty, not do you only need to select the object, but you also need to select the "Mapping" node or you can either turn off "Only Selected".

The only way to know for sure is for the person who asked the question to say so. They were last seen in July, last year. I didn't even use stack exchange then, so it is unlikely they will answer.

Ah. I think I may have found the answer. This is 2.81, but the same thing that solves this issue in 2.79 should be the same. MAKE SURE that the editing content being displayed IS set to f-curve, and also make sure that the visibility is turned on.

Make sure you select the object with the material which has the keyframes you're trying to edit else they won't show either.

I had the similar problem earlier with keyframes not showing in the Action Editor of the Dope Sheet. As I remember I switched the Action Editor to the Dope Sheet and then back again.

Hold shift+scroll mouse wheel up to show the keyframes, and shift+scroll down to hide them.

That doesn't hide them. It just moves them up or down. In this case, the keyframes should be shown on the graph, because the picture shows the origin of the graph, the place they normally appear.


text:
I can only go to Object Mode
I can't go to Edit Mode or any other mode besides Object Mode.
Can someone help me out? It won't show any other mode besides Object Mode.

have you selected an object and pressed tab?

Hi! What did you try so far?
Do you have this problem with more files or just one?

can you share some screen shot

There are mainly two ways to switch between Object and Edit mode.
1. TAB

As @depperm suggests you need to have at least one object selected;
you also need to have the mouse pointer inside the 3D View window;
just press TAB to switch.

2. Mode menu

In the 3D View header you'll find a mode menu (see picture below);

just click on it and select the mode you want to switch to.


text:
Cant use bones on differnt part of mesh
When I connect my bones to the mesh, I want to use surtan bones to move a surtan part of a mesh, I have 2 bones and one of them is for the arm and one for the leg, how do I allow the bones to only move a part of a mesh at a time?

your question is too large, it would take too long to explain everything about rigging, you should follow some tutorials about it on youtube

You need to parent the mesh to the armature "With automatic weights". BTW, what's surtan? Do you mean "certain"?


text:
How would you create this glass material in Cycles?
I am working on a project where I need this glass material that has frosted glass on the outside. I have tried numerous node setups but they all seem to look off. I have tried glass bsdf with just about all roughnesses, glass bsdf mixed with translucency, glass shaders downloaded from the internet (like chocofurs node groups), but I can not seem to get the materials right.
Here is an imgur link to two versions that I have tried and rendered.
https://i.sstatic.net/NbHLa.jpg
Here is an imgur link to the actual object I'm trying to recreate. https://i.sstatic.net/7K4GS.jpg
Any help would be greatly appreciated.

Objects will appear flat if rendered in a plain environment. Try adding an HDR environment for the illumination or add some objects around the glass to be reflected and/or cast shadows to put it into some context rather than a uniform white environment. Also, objects in the real world have flaws and imperfections - try including some noise in your material to add some natural variation to the glossiness and roughness.

I actually am using an hdri. The white background is just something I added to make it like a product shot. And thank you for your help!


text:
Doubt with python modules with the same Operators inside
While programming some addons, I created some Operators, which fit all 2 addons.
So I would like to put the operators in a python module which I will call operators.py
Now I would like to use this identical module, in 2 different addons, but I don't know if I run any risks when all 2 addons are activated.
The operators are identical, and they do exactly the same things.
Will there be conflict problems?

Before the advent of workspaces would have suggested making a single addon (extra objects for example is many merged addons).  For the most part registering another operator with the same bl_idname overwrites  prior without "There is already an operator registered" issues. If they're the same won't matter which order they are registered in.  Should you write more addons that use the same operators each time, consider creating an addon with common operators and use addon_utils https://blender.stackexchange.com/a/140499/15543 to enable if need be.


text:
What exactly does this do: bpy.app.handlers.version_update?
I want to clarify that I know the use of bpy.app.handlers.
I have been wondering for some time what this handler is really for, what is its example of use?
For what purpose?
I would like to have an example of this

if i understand this discussion https://developer.blender.org/D761 correctly, i would say (i don't know but i assume) that it is called if your blend file/add-on is called with another Blender version and might be incompatible so you can "upgrade" e.g. your data.

looking at https://github.com/dfelinto/blender/blob/master/intern/cycles/blender/addon/init.py makes me wonder if  it is intended so addons can self update or by some construct as code can be on home pages / git / etc might be handy.

https://docs.blender.org/api/current/bpy.app.handlers.html#module-bpy.app.handlers
triggers an action after the versioning check that happens when blender launches (or the addon), for other variants those can be per frame render.
The way i understand its a callback handler outwards to python getting out out of the c code.
its coded in here
https://github.com/dfelinto/blender/blob/master/source/blender/python/intern/bpy_app_handlers.c
although i lost the location (you could do a text search over blendcers python code) there is some code that can set default versions for specific blender versions, so if some file is pre blender 2.5 you can overide the blender internal render for eve such stuff, or alter clamp values based upon blender executable, it offers some flexibility i believe towards upgrading blender. if something depends on some value, but trhough improvements of blender the value can be lower or higher then its possible to do it on this property (that rarely happens for addons though(blenders current code has no such overrides for generic addons, ea flipfluid, rigify, .. ..  etc), though it is possible.

Yes thanks your right its better to put people to the right official sources, i put it in


text:
Is it possible to keep in memory a PointerProperty different from bpy.props?
I would like to store some properties in the scene, and on other bpy.data objects, I would like to create lists and dictionaries, but I am noticing that when the project is restarted, even if saved, these properties disappear. Example:
class SceneProp(bpy.types.PropertyGroup):

    test_dict_prop = {}
    test_list_prop = []
    classic_bpy_props: bpy.props.StringProperty() #etc

def register():
    bpy.types.Scene.scene_prop = bpy.props.PointerProperty(type=SceneProp)

I assumed that the properties of type not bpy.props were stored, but this is not the case, when blender is restarted, the dictionaries or the list will be empty. I foolishly thought it might work like that, but it isn't.
In addition, as far as a list is concerned, it could be solved with an EnumProperty, but it is not much for the purpose, as it will only be able to store strings, while I would also need to store Blender data objects.
Is there a practical solution? Always keeping pointed to a Blender property?

Short answer I think is no for PropertyGroups. You can use a CollectionProperty to store a List. For a dictionary I don't think you can at least not with some boilerplate, but you can directly assign custom properties as List or Dictionary though : https://blender.stackexchange.com/a/87871/86891 and https://blender.stackexchange.com/questions/53393/how-can-i-store-lists-dictionaries-in-an-object

Wow, this is science fiction to me, really useful, it works great, I didn't know about this possibility.


text:
How to unglue the interface areas corners from the intersections?
I am aware of the banality of this question. But sometimes I find myself in this slightly annoying situation.
When the areas coincide perfectly, they automatically anchor at the intersection. Obviously in the video I show that you can do the trick by creating a new one and sliding the one of the 3d viewport at the bottom. So ok.
But is there any hotkey to unpick this?

More than related: https://blender.stackexchange.com/q/216004/78972


text:
Why this error appears "GPUTexture: Blender Texture Not Loaded!"?
I am performing a material removal from an object, via bpy.ops.object.material_slot_remove() into Blender 2.91
So far everything ok, so immediately after that script, I put a function that cleans the elements of the date, no longer in use.
It seemed to work fine, but in reality I get this error (Sometimes) and Blender crashes:
After various tests, I noticed that if I don't run the purge function, everything goes smoothly, no errors in any case.

So, the script looks something like this:
ob = context.object
mat = ob.active_material
if mat:
    bpy.ops.object.material_slot_remove()

def purge():
    orphan_ob = [o for o in bpy.data.objects if not o.users]
    while orphan_ob:
        bpy.data.objects.remove(orphan_ob.pop())

    orphan_mesh = [m for m in bpy.data.meshes if not m.users]
    while orphan_mesh:
        bpy.data.meshes.remove(orphan_mesh.pop())

    orphan_mat = [mat for mat in bpy.data.materials if not mat.users]
    while orphan_mat:
        bpy.data.materials.remove(orphan_mat.pop())

    def purge_node_groups():
        orphan_node_group = [g for g in bpy.data.node_groups if not g.users]

        while orphan_node_group:
            bpy.data.node_groups.remove(orphan_node_group.pop())
        if [g for g in bpy.data.node_groups if not g.users]:
            purge_node_groups()

    purge_node_groups()

    orphan_texture = [t for t in bpy.data.textures if not t.users]
    while orphan_texture:
        bpy.data.textures.remove(orphan_texture.pop())

    orphan_images = [i for i in bpy.data.images if not i.users]
    while orphan_images:
        bpy.data.images.remove(orphan_images.pop())

    return

purge()

Try removing the removing images line. If you look up the error message in the source code it occurs in gpu_image.c and movieclip.c  The error is thrown, and warning printed when the gpu texture has an invalid image or image buffer.


text:
Blender 2.8 model showing random color shading in object mode
I was creating some building model and lot of work I have done on it, and accidentally, I have press some keys and now my model looks with random colour, can anyone tell me what's the cause of this, is it some settings. I a  am beginner in blender.

Looks like z fighting. Do you have a duplicate mesh in the same location? Hide meshes in the outliner one by one to check.

Thanks for the feedback, the problem was with duplicate, I accidentally imported the same object instead  of exporting, that's how the duplication happens.


text:
Array and Curve modifiers Issues Blender 2.8
I'm currently working on a T-44 as a side project from my Airbus A319. It's all been pretty straight forward up till now. But I've ran into two problems that I could not solve.
Although I have seen many solutions to the array problem, I can't get mine to work.
The two problems I have are:
1_ I have a gap that I can't close. I've tried many things, although I got close It's just off.
2_ My track deforms around the front and back wheels.
Thanks,
Karl.

You can fill the gap, by increasing the lenght of the model a little. Curve modifier always will bend the model. If you want them stay straight you have to use dupliverts instead of these modifiers. http://builder.openhmd.net/blender-hmd-viewport-temp/editors/3dview/object/properties/duplication/dupliverts.html

I agree with @FFeller: you can use a duplivert set to faces like shown here https://blender.stackexchange.com/questions/5910/how-do-i-prevent-object-distortion-when-applying-a-curve-modifier.
This won't probably work if you want to make an animation, and in that case I would use a follow path constraint with a quick python script to generate all those object instantly

Thank you, I've managed to solve the issue now


text:
How to make a texture transparent in Blender?
I've been making a scene of an office. I have to put in a office chair that has a mesh, but I'm struggling with the texture as I can't make it transparent. Does anybody know how to fix this? Or where I can find a working texture for the mesh?
Attached is the model so you guys can take a closer look at it.

Many thanks, look forward to your suggestions.
Karl.

Hello. Here is a short post on how to make any texture transparent https://blender.stackexchange.com/a/156619/78972.

You're using JPG image that doesn't support transparency. Use PNG instead, and it will work :)

Technically, you can add a transparency node that will take a b/w image, using the values in a mix shader that will mix in transparency.


text:
How to make the grass look more realistic using a particle system
I'm using a hair particle system to create grass in my scene. I've added 3 different blades of grass and 60,000 particles of each. But still Im not getting a realistic grass effect. Is there anything im doing wrong?
I'm using cycles.

look at the image behind the model. It is not only the shape of grass that is important, but the many different tones and colors.

Yeah, I know what you mean, But that HDRI is only there for lighting. There is going to be bushes and trees to cover up the difference

No i mean the grass is not always green, but yellow green, light green, dark blueish green and so on.

You'll get the biggest visual benefit via Material, try using a Colorramp node to define a range of colors like shades of green and yellow. Also, try enabling Interpolated Children in the Hair Physics properties and explore those settings, namely Clumping and Kink.

as jackiejake says, use the ColorRamp, plug the Input > Object Info node and plug its Random socket into the ColorRamp. Also, play a bit with the rotation of your herb, they all seem to be rotated in the same direction, put a bit of randomness (there's an Advanced option in the Hair panel, have you enabled it?)


text:
Mesh/Shading Issue in Blender 2.8
I'm not too sure what is going on here to be honest.
I had seperated the part of the mesh where the cockpit windows are, but when I joined it back up together, It shows me a weird shading that I can't get rid off.
I've tried removing doubles, and recalculating normals.
Any suggestions?
Look forward to hearing,
Karl.

have you tried a W > Shade Smooth? Please share your file: https://blend-exchange.giantcowfilms.com/

Yes, in that picture, it's shaded smooth.

please share your file or at least a part of it, it's hard to tell what's your problem without the file

First you have faces that don't stick together, you can fix this with an altM > Merge By Distance, and play with the distance parameter in the last operation box (bottom left of the 3D view).

You'll still have artefacts where the triangles are very stretched, you should better use quads, but if you are lazy you can cut your triangles with additional edge loops (use the knife tool) and it will improve the shading.

Thank you! Appreciate the help!


text:
Changing background color without affecting objects in a scene
I need to render a sort of a mask of the objects animation, where the background is solid black and the object is solid white. However when I try to change the background color, the object changes color aswell. I am setting the color in World properties -> Surface -> Color.

Is there any other option to change the background color, whilst preserving the color of the object? Or are the shading settings at fault here? Is there any way to entirely turn off the shading?

I would like this object to be completely white without any shading

Hello and welcome :). The linked thread answers only the first part. To make your object completely white and without shading, use the Emission node set to 1. That way, your object won't receive any shadows.

Awesome, thank you very much! I have overcome the issue by placing a few lights around the scene, but your solution is much cleaner.

Happy to help :). You can use standard world colors (black in your case) for the background, because there will be no shading anymore.

@ᴊᴀᴄʜʏᴍᴍɪᴄʜᴀʟ consider adding as  an answer to the duplicate.

@batFINGER Isn't there a way to reopen this question instead? It's actually quite different from the "duplicate". This one is about a flat silhouette on a flat background, essentially 2D animation. Is there a way to reopen it somehow?

Vote to re-open. Editing will put it up for reopen in review.

@ᴊᴀᴄʜʏᴍᴍɪᴄʜᴀʟ or you could wait for another question or create a new user and ask the question then answer that one lol.. such serendipity.


text:
Automatically setting the rendering frame range in compositing
Is there any way to set the frame rendering range based on the Movie Clip input node (using a script)?  I would like to automatically render different movie files, but in order to do that I need to correctly set the rendering range to cover the entire movies duration in number of frames. I tried looking for a parameter in Movie Clip node that would perhaps contain the clip duration, or frame count, but I wasn't able to find anything like that. Is there perhaps a different way this can be achieved?
My compositing workspace looks like this:

Turns out I just wasn't accessing the right object type. The movie clip node contains a clip parameter, which contains the data I needed. The frame end range can then be set like this:
frameCount = bpy.data.scenes['Scene'].node_tree.nodes["MovieClip"].clip.frame_duration
bpy.context.scene.frame_end = frameCount

Full specification of the MovieClip datatype can be found here


text:
Copy/Paste pose operator not working
I am trying to copy the pose of an armature to another armature. I was, unfortunately, unable to find a solution that would work for me. Both of the armatures have the same amount of bones that are named identically. I tried using the Pose -> Copy pose operator, however when I try to paste the pose into the second armature, nothing happens. Before copying the pose, I first select all of the bones. Are there some specific naming conventions that I have to follow, or could the issue be entirely different? I am importing both of the armatures from an .fbx file. Below is a hiearchy of both the armatures.

The operations you described work well for me. Would you mind sharing your blend file ? You can remove everything except the two armature and the pose you want to Copy/Paste.

Thank you for the quick answer, here is the blend file. https://pasteall.org/blend/78f0a6a6a769469890dc719025b552ea

On your second armature "Armature.001", the mode "Rest Position" is enabled. That prevents you from modifying the pose.
Select "Armature.001", go to "Object Data" properties, then select "Pose position" instead of "Rest position". The Copy/Paste operation should now work as intended.

Thank you for the tip, I haven't noticed that! However, I am still doing something wrong, or perhaps I have misunderstood the mechanics of armature poses entirely. I have switched the Armature.001 to "Pose position", but I am still unable to reach the desired effect. My understanding was that after pasting the pose, the two armatures should look identical (the bones should all have the same settings as in the second armature). Is this understanding wrong? Currently, when I copy/paste, I do get the little pop-up menu, but nothing happens (at least that I am aware of).

No, they shouldn't look identical - unless Armature.001 is a perfect copy of Armature ; but, what would be the point ? But "RigSpine1" and "RigSpine2" should have the same relative transform in both armatures.

Also, I noticed you're in Pose Mode with both armatures selected. As far as I know, it's not a good idea for this kind of operation. You should select an armature in object mode, switch to pose mode, ctrl+c ; switch to object mode, select the other armature, switch to pose mode, ctrl+v. Multi-edit in Blender is a work in progress, so a lot of things don't work "naturally" for now...

Ahh, that is probably where I went wrong, I completely misunderstood how the posing coordinate system works. I have now noticed in the documentation, that poses are determined by an offset from their rest position, so it makes sense now why "nothing happened" in my eyes (please correct me if I said it wrong).
The root problem for me is that I have a skinned model saved as fbx file and a bunch of animations also as fbx files. The animations are however not skinned, so I have to transfer the animation action to the skinned model. The animations however have different "default" poses.

And because the default poses are not identical, when I apply the animation to the skinned armature, the animation looks "messed up". I was trying to copy the bone settings, so that both the armatures look identical, but I now see that I misunderstood how poses function. Is there any easy way to achieve my goal? Is it possible to easily skin the animation, or is it possible to copy the "default/rest" pose position to the skinned model, so that the applied animation works properly?

Thank you for all your help, I have finally found the solution. I will mark your answer as the solution, as the error was on my side for not understanding the mechanics properly. I have also added a link to the post, which contained the information I was after.

I have finally found the solution to my problem, which was unrelated to the question I asked due to the initial lack of understanding on my side. I was trying to copy the "absolute transforms" of the bones, which can be achieved by adding "Copy transforms" bone constraints to each bone. Thankfully a script exists, which automates the process and produces the results I was after.


text:
How to make a foggy background
I wanted to know how I can make this foggy effect on the background just like in the image below, that the far parts are hidden by the fog.

Thank you.

Another option is to surround your scene with a cube and give it a Volume based on a Volume Scatter node, with it's density controlled by the Z-Depth or View Distance output of a Camera Data node. In the example below, I used "multiply", as this gives the best generalized effect, whereas, "add" will make the fog "fill in" the caverns as the camera scrolls out. Have a try with both if you like.

This is the scene in solid mode:

As you can see, all I did was surround the scene with a cube, remove the surface color from the cube, and connect the Volume Scatter with a low density (governed by the Math nodes)

Could you please walk me through it? I'm having some difficulties getting it right.
The box doesn't become transparent and doesn't generate any fog.
https://imgur.com/eLcTiTa

Sure, I added a second image to my photo. Can you elaborate more on what's wrong? I did nothing special to the cube except for modify the volume as shown in the first photo. Note the position of the light, however. It is necessary to illuminate the fog

read: Low lying fog

Thanks a lot!!!

You can achieve this effect using a Mist Pass in the compositor. Search on this site for "Mist Pass" and you should find many examples.

Thank you very much!


text:
Listen to insert_keyframe event using python
I can't figure out how to listen to a keyframe insert event in an armature and retrieve the newly inserted keyframe(s) using a callback. Msgbus, Depsgraph, Modal ?
Any help would be much appreciated. Thank you

One way is: bpy.app.handlers.depsgraph_update_post.append(fx), fx will run when certain key frames added or doing some behaviors in UI. But it will not trigger when adding a keyframe from a script.

Thanks for the tip, i have the feeling that i can't really use that to do heavy computation on the callback because it is firing way too many times like every time you move or rotate a bone.

Listening to keyframe insert events in Blender using Python can be achieved with the Message Bus (bpy.msgbus) system, although Blender does not directly expose all events. You'll need to subscribe to changes in the relevant data paths (like the armature's action data) and use a modal operator to continuously check for these changes.

care to share an example ?


text:
Lighting issue when looking at render
I am trying to follow along with a tutorial on youtube, however i seem to have an issue with the lighting on the rendered view. does anyone know whats happening here?

Hello, probably the latest AMD driver that doesn't work, try the previous one or try to active High Quality Normals in Render > Performance

Is your light hided because this looks exactly an issue like that if not try restarting blender and maybe its because you have no light at all
EDIT:I am seeing that there is a sun so my bad :( is this the donut tutorial lol

Thanks for trying, but this isn't an answer.. to keep the archive as clean as possible, it may be deleted. Nothing personal.


text:
How to record grease pencil sketching in real-time and retain editability
I am looking for a way to capture real-time drawing in Grease Pencil.
For example, to make a video like this https://youtu.be/tfF_-Db8iSA?t=36 of drawing math on a virtual whiteboard while speaking, but be able to use Grease Pencil Edit/Sculpt features for post-processing to tidy up the strokes. The end result would be the seemingly real-time video of speaking and drawing at the same time but with cleaner strokes.
I have found a workflow that is close to what I want:

Enable Auto Keying to record strokes appearing at the right wall-clock time.
Enable Additive Drawing so that each frame includes the previous strokes.
Enable Build Modifier in Additive mode to animate only the new stroke.

This successfully animates the strokes appearing one-by-one and starting at the right time. The problem is that they don't finish at the right time. Specifically if there is a pause between strokes then the first one is slowed down to finish when the second one starts. But what I want is to preserve the original timing of both the start and end of the stroke.
Mechanically the issue seems to be that Auto Keying is creating a new keyframe at the start of each drawing command, when I click left-mouse, but it does not create one at the end of each drawing command, when I release left-mouse.
I would love some advice on whether it is possible to accomplish what I want, or else whether the existing behavior of auto keying is intentional and desirable, and even tips on how the code might be modified to support the feature that I want.
Note: I have tested with Blender 3.3 (on Linux.)

If the problem is only pausing, you can animate the Factor property of the build modifier.

Can this be handled by "Auto Keying" somehow? It's vital that the start/end times are automatically recorded when the strokes are made because going in later and manually "inventing" end times for the strokes would seem a lot of work.

I realize now that there is a major flaw in my workflow: editing/sculpting strokes won't work because the changes won't carry through to the copies of those strokes made by Additive Editing.
So it starts to sound like what I need is to have one frame covering the entire animation and then to animate the Factor property so that strokes appear at the wall-clock appropriate moments.


text:
Cloth Simulation Not going through Ring
Good day,
I'm making a 3D model of a garbage bag holder. Unfortunately, when I got to the plastic bag, I hit a major barrier. I've been trying to make a cloth simulation to make it look like a bag is hanging.
I did a few experiments to see if I could solve the problem on my own. See below a few screenshots of the issue at hand.
This is the garbage bag stand:

I tried to sculpt the bag, but it looks terribly as I'm not skilled with the tool. But I though to attach this screenshot as it is a useful picture to show what result I'm trying to get.

So I started to do experiments with this ring and the floor beneath.

Unfortunately, it does not go through the ring, but rather rests on it as if it were a table.

Any ideas?
Many thanks,
Karl.

How about modeling a "folded" bag, make it a Cloth, add a pin group set to the top vertices and apply some simple shapekeys? Here is a quick example:

With more geometry and some experiment a bit more details can be added...

Thanks! I've managed to do it now.