text:
Can not render via GPU ERROR Illegal address in cuCtxSynchronize() (device_cuda_impl.cpp:2016)
All of a sudden, my system stopped rendering via GPU. It renders fine via CPU, it looks like the error has something to do directly with my graphics cards too. I have tried rendering via CUDA and OPTIX, no luck. I have tried 3 different versions of Blender (2.90, 2.91, 2.92 beta). I have reset my preferences, uninstalled, re-installed graphics drivers, roll back graphics drivers and nothing. I was able to test rendering. I ran heaven benchmark on direct x11, cinebench (Only openGL), and ran Counter Strike on high settings with no problem. I lastly ran Compubench 2.0 which I believe tests via the CUDA API. Computer specs and the error from the blender console below. Thanks to whoever can help me in this confusing endeavor.
SPECS
CPU: AMD RYZEN 7 1700
RAM: 16GB 3200
GPU: 2 x GTX 1060
MOBO: AsRock x370
ERROR
Illegal address in cuCtxSynchronize() (device_cuda_impl.cpp:2016)
Refer to the Cycles GPU rendering documentation for possible solutions:
https://docs.blender.org/manual/en/latest/render/cycles/gpu_rendering.html
Illegal address in cuGraphicsMapResources(1, &pmem.cuPBOresource, 0) (device_cuda_impl.cpp:2102)

Refer to the Cycles GPU rendering documentation for possible solutions:
https://docs.blender.org/manual/en/latest/render/cycles/gpu_rendering.html

Illegal address in cuGraphicsResourceGetMappedPointer(&buffer, &bytes, pmem.cuPBOresource) (device_cuda_impl.cpp:2103)
Illegal address in cuModuleGetFunction(&cuFilmConvert, cuModule, "kernel_cuda_convert_to_half_float") (device_cuda_impl.cpp:1971)
Illegal address in cuFuncGetAttribute( &threads_per_block, CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK, cuFilmConvert) (device_cuda_impl.cpp:1993)
Illegal address in cuFuncSetCacheConfig(cuFilmConvert, CU_FUNC_CACHE_PREFER_L1) (device_cuda_impl.cpp:2000)
Illegal address in cuLaunchKernel(cuFilmConvert, xblocks, yblocks, 1, xthreads, ythreads, 1, 0, 0, args, 0) (device_cuda_impl.cpp:2012)
Illegal address in cuGraphicsUnmapResources(1, &pmem.cuPBOresource, 0) (device_cuda_impl.cpp:2116)
Illegal address in cuCtxSynchronize() (device_cuda_impl.cpp:2016)

Related or dupe: https://blender.stackexchange.com/questions/102536/cuda-error-launch-failed-in-cuctxsynchronize-and-cuctxcreate-launch-failed

Doesn't matter the scene. Its the same outcome if its only a single cube. I also forgot to mention that this happens via the viewport as well. If I try to render via F12, nothing happens. Error is thrown immediately and blender crashes.

I noticed that this problem occurred if the render mode is selected in the viewport. If you switch to any other one, then my error disappeared and the rendering on the video card occurred. If this is not done, then the render can only be done on the CPU

Solved. I yet again reinstalled my nvidia drivers, except this time I made sure Windows did NOT automatically update my drivers, and manually updated with the latest. For the record, the Nvidia driver version I am now using is 432.00.

An Update to this problem. For me, all Nvidia drivers after 432.00 cause this problem. This maybe because I have older GPU's in my system that I HAVE pushed to the limits for some time, or something else. However, as a warning for Windows users, I am finding even when I turn off automatic driver updates windows STILL decides to update my drivers. If this happens to you, just download the 432.00 driver (or whichever is the closest one that works for you) and keep it somewhere on a hard drive. After all the clean installs have been pretty damn quick.... I should have just kept my system linux.


text:
How can I distribute various objects based on their size?
Are there any techniques or tools in Blender to help make an image like this?

There are a few things in this image that I'm specifically interested in:

size: big objects at the top, small objects at the bottom
density: distribution is less dense near the middle-bottom
packing: there are small stones packed amongst the big stones at the top
collision: there doesn't appear to be any stone/stone overlaps

Still Image or Dynamic?

@atomicbezierslinger still image is fine. I just edited my question which hopefully clarifies what I'm trying to do

Blender has no dynamic modeling built-in. 1, 2 and 3 can be done with cycles particle system. #4 may be done with the animation nodes addon, which can measure distance between particles..

Disclaimer: This is not a true way of sorting by size, just a way of faking it by scaling objects.

This works by using a vertex group to affect the particle size and density, simply create a gradient to affect particle size as desired
Start by creating a circular mesh, a cobweb like topology will likely help.

Add a new vertex group and use Weight Paint mode to paint in in a gradient shape to your liking.

Create new particle system set to Hair type, and use the previously created Vertex Group to drive both its Density and Length parameters.

One of the things I really like about the reference image I posted is how there are small objects packed around the large objects to make for a really dense layout, without having any object overlap. Is there any way to achieve that with this method?

Not directly no, but you could convert the particles into real objects afterwards, add rigid body properties then drop them with a physics simulation. That should make a non intersecting distribution roughly respecting the already obtained gradient. This may help https://blender.stackexchange.com/questions/80690/random-sized-cylinders-with-no-intersection-gaps/80721#80721

2 or More Particle Systems emitted from a circular mesh.
2 or More Physics Systems Baked
Image compositing

source: Stack Exchange

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

sort: votes


text:
Using a BI texture in Cycles
I'm using a displacement modifier on a mesh like this:

Is is possible to get this displacement texture into cycles? I'd like the displacement height to influence the colour of the material.

AFAIK it isn't possible to get the exact same texture the displace modifier uses into Cycles.  But you could use Cycles' true displacement feature instead of a displacement modifier.  Is that an option?

I should have included this in my question, but I'm stacking a few displacements on top of each other (displacing along updated normals along the chain). I doubt I can make this work, but I'm giving it a try.

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


text:
How can I model this organic shape?
What is a good way to model this organic shape?

I've found metaballs merge too easily, so it's hard to get nice folds.
I've wondered about curves and beveling, but I haven't got good results with that either.

You may want to consider the sculpting tools. Dynotopo can be a big help here when using sculpting as well. I would recommend setting it to 6 pixels or less if you were to start with Blender's default cube. You could also do this with curves, see this link - Duarte's answer was pretty awesome

Whatever method you use, if you want those tiny surface bubbles, you will most likely want to use the particle system after your main form.

@RickRiggs Thanks. I don't think I'll have trouble with the material; it's the foldy brain-like model that I'm having trouble with.

Yeah I just looked at it again, and I'm still thinking that if you started with curves, and then converted the curve pipes to mesh, then you can sculpt and blend them together. If I can find some time I will try to break it down in an answer.


text:
Can an armature be added to a curve?
I've got a tentacle, made from a cube with an array modifier (fit curve modifier) and a curve modifier:

I'd like to add an armature to the tentacle and incorporate it into a character.
Is it possible to add an armature to my current setup, without applying all of the modifiers?

Consider using

The Spline IK Modifier.
Vertex hooks, where the hooks are bones of an armature.


text:
How can I convert Python curves to a hair system?
How can I get a set of curves defined in Python (list of Nx3 numpy arrays) imported to Blender as a hair particle system?
I assume there is a python API that I could use for creating a hair system like this, but I'm having trouble finding a reference to it..
Here's an example dataset: https://drive.google.com/open?id=0BweaCBovnNnFeThxWjJOcENwV1U

are you tried this addon https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Objects/HairNet ?   https://blenderartists.org/forum/attachment.php?attachmentid=241787&d=1371832949

This looks like there's a level of indirection with a guide-system, where I'd rather create the hairs directly. Looks like some python code that I should look at to understand though!


text:
Can the base dublivert object be hidden?
Is it possible to hide (in the viewport) the base duplivert object, without also hiding all of its duplicates?

No, not currently possible unfortunately, I think its a known limitation of the current system. You can alternatively use a particle system instead, if it works for you.

Yes it's possible. You have to give it a material with transparency. Set the Alpha to 0 and enable Transparency in Display settings, like this:

Worth mentioning that this is a workaround, and only really works well for Blender Internal/BGE, not Cycles


text:
How to bend a sinusoid into a circle in Sverchok?
What's the best way in Sverchok to create a circular sinusoid, like I drew here with the grease pencil?

I can imagine one one:
1) displace the circle vertices along their normal; or
2) generate a sin curve and wrap it around an origin point
Or maybe there is a third way? Is one of these methods preferable, or more generically useful, from a Sverchok perspective? What would the node setup be?

Here's an example using a simple scaling factor of the given geometry driven by the sine function https://i.sstatic.net/ZVFSq.png or https://i.sstatic.net/tdBxI.png. There is also the SN: Petal_sine node that can be used to make a similar shape. I think that using one kind of implementation rather than onother strictly depends on the particular needs of the situation. Could you be more precise?

use simple translate node and x+1 hack to fit vertices


text:
merging two objects for sculpting
I have two pretty complex objects that I want to merge into a single one so when I can use sculpting tools on it. Here's a picture of what I'm doing:

I want to merge the legs into the body.

yes you should use booleans to merge the meshes, but you should simplify them a bit before, i.e. make it lower in polygons, it will help to rework after the boolens

You select both objects and press Ctrl+J, to make them one object. But if you sculpt, you'll easily get the separate parts appear to be dividing up where they're not joined by their vertices. The best thing to do would be reduce the number of edge flows (temporarily) so you can cut an edge around the body where they meet the legs, delete the faces that are inside the legs, press Ctrl+J to join them, then merge vertices so you have one continuous surface.  Hopefully you have an UN-applied smoothing modifier on which you can delete to simplify the geometry.

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


text:
How do I bend pipes with Blender modelling tools?
Here's a screenshot of my model so far. I can select vector points in edit mode but can't move them. I'm working on a MacBook Pro laptop.Is there any way of uploading and sharing Blender model files on this forum?

That depends on the method that you are modelling your pipes. can you share a screenshot and/or your blend-file of what you have so far?

Thanks v much for the screenshots! I'll try this method.  : ) I have accidentally deleted my previous files. I remember selecting end vertices and using spin but I wasn't in the correct view mode so I was getting  some pretty wild results. My shape need to be straight, then bent quite sharply, then straight for a bit then bent sharply again, a bit like an unfolded twisted paperclip.

For sharply bend you can use the same method in my answer and set the shape of the curve to 2D, then select all the curve handler and set them to vector.

there is different ways to do what you want in blender, one of them is this one:

Add a new bezier circle:

Add a new bezier curve:

With the bezier curve selected, go to Properties menu > Object data > Bevel > Object

Select the bezier circle you previously create.

Now the bezier curve looks like a thick pipe.

You can adjust the pipe thickness by reducing or increasing the bezier circle radius
Now you can manipulate the bezier curve as you want to simulate the pipe bend effect.

For more information about bezier curves visit:
https://docs.blender.org/manual/en/dev/modeling/curves/structure.html#bezier-curves

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


text:
period key won't on iMac
Am using an iMac the period key won't work for me to jump back to the center of the 3d viewport after moving and rotation the 3d viewport want is the hotkey for iMac

The period key centers your view on a selected object. You have to have an object, and make sure it's selected, for the key to do anything. Do you have a selected object?

I selected my object and it still doesn't work it just saws the pie meu for pivot

It sounds like you're using the regular period key. It's possible your keyboard has no number pad  (the grid of numbers on the far right). If that's the case, you'll have to either change the key binding, or use the 'frame selected' option in the view menu at the top left of the 3d view.

The easiest way to change the shortcut is to find the option in the menu I mentioned above, right click on the option, and choose 'Change Shortcut'. Then press whatever shortcut you think will work best for you. You can use any modifier keys (Shift etc.) while doing this too.

Try Shift + C  shortcut. That should reset the 3D cursor to the center and your view-port.


text:
Snowmen's hat wave texture problem
I’m doing a CG Cookie snowmen course and I’m stuck on this part https://cgcookie.com/lesson/materials-for-the-scarf-and-hat at 19:31 where he put a wave texture on top of the hat and I’m having troubles. The wave texture is acting weird on top of my hat please help.
My blend file https://pasteall.org/blend/8f88c59ef9314f1487a5ff53f46f2454
My hat topology

His hat topology

My Hat wave texture

Hat wave texture from course

Can you add an image of what's going on so we don't have to download the blend file?

Since that's a paid course there isn't much point in posting a link to it here!

I updated my post with images

@moonboots I updated my post with two more screen shots one with the course's hat topology and one with my hat topology but I don't understand my topology is like his so shouldn't I get the same result?

@moonboots no he's using the Generated output I updated my post with a screen shot of him using that input take a look five screen shots down.

Actually I was wrong, switching to Object didn't fix anything, but if the Scale value of the Wave Texture node is 5, like in the video, the problem won't be noticeable, so maybe that's why

If the Scale value of the Wave Texture node is low the problem won't be noticeable, maybe this is what's happening in his video:

Another way to fix the problem is to use concentric circles for your topology (right hat):


text:
What are these dots appearing on my model in the 3D View?
I am trying to model something and these keep coming up.
I have tried several buttons and none of them turn it off. This is in Blender 2.8 beta.

How do I fix this?

For me it looks like some kind of GPU driver / incompatibility issue. Maybe try some different Blender version, nightly build or GPU drivers?

@JanKadeřábek Apparently, you are correct. It says no compatible GPU's were found, how do I fix this without getting a new version of blender?

@DannyGreff You do not loose any reputation or anything when someone edits your posts. They are just trying to help. You are still the OP, and you will get the votes.

Updating your GPU driver isn't too hard. Firstoff, locate what type of GPU you're using in the first place. You can find that by going to the Device-Manager in windows. Once you know what kind of gpu you have literally google "GPU NAME HERE drivers". Use the official sites from NVidia or AMD rather than third-party ones, and follow the instructions there.

It may help to set triple buffering File->User Preferences->System Set Window Draw Method to Triple Buffer.

Thanks a lot, everyone. @IAmGettingTiredOfAliases I have searched for my Intel(R) HD Graphics 620 and I believe I have found something, but Intel has now added an automatic computer scan that checks for any Intel driver updates. Thanks again!


text:
How to write bpy.data.libraries avoid packed file with python?
I'm trying to create a .blend file that saves the scene, but I would like the image files to be separate, so I created a script that saves the bpy.data.images image files in a folder next to the .blend file.
like to :
import os, shutil
def save_images(folder_path,my_image_list):
    for i in my_image_list:
        if not i.file_format:
            i.file_format = 'PNG'
        image_path = os.path.join(folder_path,i.name)

        if not os.path.isfile(i.filepath):
            filepath_raw = i.filepath
            i.filepath_raw = image_path
            i.save()
            i.filepath_raw = filepath_raw
        else:
            shutil.copyfile(i.filepath,image_path)

So everything works beautifully, except for the fact that if I have a "packed image", a large file will be saved, therefore useless, as I already have the necessary images alongside that project.

Basically:
I wanted to figure out how to be able to write the project with bpy.data.libraries.write() without it also writing packed images if there are any.
I am aware that I can check them with bpy.data.images['My Image'].packed_file, which returns if the image is packed.
I could write something that unpack temporarily, but I see it as risky.

"I'm trying to create a blend file that saves the scene" - Does this mean you got a blend file and trying to create a second blend file just without the images packed? Or generating a blend from a certain scene without the images packed?

I try to create a .blend file, in which the images are not Packed (This unfortunately happens if some images are packed, so they will also be packed in the new "file.blend") I don't know if I can explain myself well

Get it. The contents of the blend you wanna create are coming from another blend? If so how do you copy the data?

I created a function that - Unpack or Copy - the files in a folder next to the "file.blend" that will be created. This Function understands if the file is packed, or is available in a path. Should I show this function? I didn't want to make the question very complicated, as the function takes into consideration a list of images, but not all those of the bpy.data.images

I would like to understand the basic idea in the first place. See the questions in my comments (1) What scene? (2) What kind of data? (3) How do you create the blend? etc.

I updated the question, Idea: For example, I select 3 objects, and I execute my operator, this creates a data_block and writes the 3 objects with bpy.data.libraries.write(). Through another function, a scan of all possible images contained in the materials is performed. Then comes the function that saves all the images in a separate folder (As you can see in the edited question). So the problem remains that even the images packed in the "file.blend" will be written. Which I would like not to happen, as the images will already be placed side by side with the "file.blend".

Check the data
Chances are the objects are saved to the library blend, . but are not linked to any scene, or collection, hence the file appears empty when opened.
Check the library files bpy.data.object  collection to confirm.
Consider adding the scene datablock to the library.
You can try this.  I don't know much about...


text:
SubD creates a crease in an edge
I have an issue with my SubD model which seems to be creating a crease on a random edge. I checked double vertex but it's not that. And there is no Crease applied on this corned as you can see. Do you know how to get rid of this creased edge?
I am using Blender 2.83.5

This can happen when your normals are flipped on part of the mesh.  Pretty common with Mirror operations.
The problem is that the Subdivision Surface Modifier is interpolating between the inside and the outside of the mesh, at this point, so for the vertices in between they are returned to their original positions.

To diagnose problems like this you can check face orientation overlay in this menu.

Typically you want the blue side facing the camera.  If you see any red you can tab into edit mode, select all your mesh and press Alt+N or go to the menu Mesh -> Normals -> Recalculate Outside.


text:
Rigged model rotates and deforms when applying Auto Weights
When using Rigify as my armature my model falls over and scales up along with deforming when applying auto weights. I seem to get this result consistently when I practice rigging a character, what could be causing this?

Apply rotation and scale on both mesh and armature before parenting.

Yes, I have just tried that with no luck. I've clear all transformations and applied all transformations.

maybe share your file? https://pasteall.org/blend/


text:
How to track footage that goes in a circular motion?
I've been trying to track the game footage in the link below
I tried tracking everything myself, and the detect new features method when some tracks are starting to disappear, the lowest I got was a solve error of 17 with both methods...

It's probably because of the obstructions, but those are important for my scene. So I tracked different things before and after the obstructions and joined the tracks, also didn't work. Since the camera goes in a circular motion, there's no track that stays during the entire clip.
What I'm trying to do is put a robot in the middle and the camera goes around it (I also put bottles on that spot on the ground for more tracking information) I also uploaded some pictures to get an idea how I tracked it.
video link

You don't need to track a point that stays in the picture for the duration of the shot. What is crucial is to track elements that are at different distances. Elements that are close to the camera and those that are far away (and that are moving at different speeds on the frame) is what is going to allow you proper reconstruction. Elements that disappear and re-appear need to be joined, so that blender knows that it is the same element and not a new one. Check that the trackers are not slipping. Accurate tracking is the only way to get successful reconstruction.

Also let blender refine the lens size and distortion coefficients. Read the following link very carefully: How can I get better results when doint camera motion tracking.

Thanks, I’ll have a look at that! One question tho, if there’s an obstruction in front of the whole camera view just for 5-10 frames, do I need to track that as well or only join tracks on the sides of it?

If there is something to track go ahead an track. Otherwise track until elements disappear and re-track after, and join the trackers.


text:
When should I rotoscope in the compositting proces?
I already made my animation and I’m going to composite it in a videoclip. I’m currently tracking the clip, but there are going to be some occlusions in front of the animation that I need to rotoscope. My question is, when in the compositting proces should I rotoscope those things? Should I do this in blender?

When to rotoscope?
Whenever you need to evaluate the integration of the video element you want to composite.
Can rotoscoping be done in blender?
Yes.
You can draw and animate masks that can be used in the compositor. Mask drawing tools are quite robust in blender, allowing you to add, subtrac or intersect different masks and layers, and it allows you to create sharp or feathered edges.
Advanced and semi-automated rotoscoping can be done by parenting masks to tracking points on the video clip editor.


text:
Blender project opens with nothing but basic cube
I was doing a sculpt project.
I tried to open it and after some waiting, there's only a basic cube in my project. Every other object gone. Blender had not crashed last time when I was working on it. Just re-opened my file and everything is gone. I tried recovering last session and recovering autosave, both didn't work. The file still has about 450mb even with basic cube. Is there any chance I can get my project back?

Hello and welcome. As it stands this question is not answerable at the moment for lack of essential details to understand the issue. Remember only you have access to your scene, so unless you tell us only you know your exact setup, settings and what steps you took to arrive where your are now. Please describe in detail what your issue is, possibly supported by some accompanying screenshots with the [edit] button under the post. Editing will automatically put it up for review so it can be reopened.

Any chance you hid your object by mistake? Is it listed in the outliner?


text:
Is it possible to create a BoolProperty on the fly in the panel to control a FloatProperty of a node?
Assuming that the nodes have no possibility of boolean buttons, I was wondering if it is possible to draw one on the fly that sets the value 0-1 (Fac) of a "MIX_RGB" type node.
Suppose that it retrieves all "MIX_RGB" type nodes with an operation of this type:
class CustomMenu(bpy.types.Panel):
    bl_label = "Custom Menu"
    bl_idname = "Test_PT_menu"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Test"

    def draw(self, context):
        layout = self.layout
        ob=context.object
        mat = ob.active_material
        if mat:
            for n in mat.node_tree.nodes:
                if n.type == 'MIX_RGB':
                    #I would like to turn this into a Boolean False = 0, True = 1 :
                    layout.prop(n.inputs[0],"default_value",text=n.name)

This is what I get if there is a node of type "MIX_RGB" in the material:

Actually I'd like to get a boolean property, which if True it sets the value to 1, otherwise the value must be 0 .
Since I would like any node of type "MIX_RGB" to show this property, I was wondering if it was possible to create a property on the fly that does this, avoiding to compile an infinite number of BoolProperty in a class of type PropertyGroup, it would be somewhat difficult to predict, for the simple reason that if the nodes were 100, I should have 100 BoolProperty declared. So I wondered if there was a way to create a situation on the fly

Why not just using a callback on update and set all values to 1.0 and 0.0 based on your true and false logic?

Excellent question, currently I am able to create a BoolProperty that refers to the material (bpy.types.Material) the problem is that I should declare countless BoolProperty, as it is not known exactly how many nodes of type "MIX_RGB" are present in a material. Do you have any suggestions?

Do you generate those nodes by a script? If so, I'd give them a specific name or store those nodes in a property group when adding them to the scene.

Nodes are not generated, but can be recognized, but I think I solved it, just create an operator to pass a string argument (with node name, material, and input number) that sets the value to 1 or 0


text:
How to get / set my_node.inputs or node.outputs .keys()?
I'm trying to access the keys of a particular node of inputs and outputs.
to access the use property keys:
n = my_node #(From node_tree.nodes)

for key in n.bl_rna.properties.keys():
    attributes = getattr(n, key)

now I would like to access the attributes of n.inputs and n.outputs
but this does not produce any results:
for key in n.outputs.bl_rna.properties.keys():
    attributes = getattr(n.outputs, key)

I'm pretty confused about this, I'm probably wrong
Edit:
For more details, this would serve to copy the nodes and their properties.
But when I have to access the inputs and outputs properties I have difficulties at the moment, post a small test that I am running, for now it does not work properly, but perhaps it makes better understand what I am trying to do
for n in bpy.context.scene.node_tree.nodes:
    tipo_di_nodo = n.bl_rna.identifier ##Ty @batFINGER
    nodo_copiato = bpy.context.scene.node_tree.nodes.new(tipo_di_nodo)

    #This copies the node exactly, with some data
    for key in n.bl_rna.properties.keys():
        source_attribute = getattr(n, key)
        if not n.is_property_readonly(key):
            setattr(nodo_copiato, key, source_attribute)

    #I would like it to copy and assign value inputs
    #For now this is not working
    for val in n.inputs.values():
        for key in val.bl_rna.properties.keys():
            in_source_attribute = getattr(val,key)
            if not val.is_property_readonly(key):
                setattr(nodo_copiato, key, in_source_attribute)

Note:
I want to clarify, because i don't want to create further confusion, that the question is not "How to copy an entire tree of nodes" but is how to access the values n.inputs [#].default_values (and other) in complete automation, as it is done in the line of my code in the part where the attributes are set via setattr / getattr
As I want to get there by myself to the copy of a tree of knots, I am trying to study the situation, trying to better understand Blender's API thanks to the help of the community

Could you give a specific example. Eg here is all the names of the bsdf inputs https://blender.stackexchange.com/a/160069/15543

I just edited the question to better explain the situation

The edit doesn't really help here. What you'd like to do and what's your question? You want to copy the whole tree or just some of the nodes?

I apologize for the confusion, I'm trying to copy the whole node tree, but I need to get and set the attributes of the inputs and outputs as they can have floats that need to be copied. I don't know if I'm going the right way

From experience I'd say use a dict to store all the values and create the tree from scratch per execution.

@brockmann Thanks for the tip, however, I would like to understand how to do it and why, at the moment I am a beginner with this type of situation, so I should go into detail before going to examine that script / addon that you created.

What do you mean by "go into detail before..."?

@brockmann I mean, that I have to learn well how all of this works, your script looks good, but I don't understand it much because I don't have the necessary knowledge now to decipher it and understand it

I take it the big picture is "How to copy a node tree?"  Or "How to copy a node"  One suggested small change to above  tipo_di_nodo =  n.bl_rna.identifier  Enjoying getting my Aussie accent around the  Espanol

Ok, thanks. If that operator is too hard to understand, take my advice and remove all nodes of the shader in the first place then create the shader each time from scratch to save you headaches. One big issue is that all default values of each node type are 0. There is no way to "reset" the values of any node and you have to create a new node to get the default values anyway... and really, the API of the node editor isn't the greatest part @Pastrokkio

@brockmann Thanks for the links, all very interesting and useful, but if you notice in my script, the node is copied exactly with its parameters (width height, and much more), for example if the node was the "Composite" output and had "use_alpha" False, this would be copied exactly with use_alpha False, but I would like to access the keys to also set n.inputs [1] default_values, my problem is that I want to assign the old attributes inputs to the new node.
In your example it seems to me that you are "resetting"

If you really want to go this way for whatever reason, I suggest set and get the socket values by their socket names instead of using the index operator to be on the safe side @Pastrokkio

@brockmann Sorry if I continue to comment, but my English is not very good and sometimes I find it difficult to understand if I explained myself well / if I understood correctly.
Technically I would like to access and copy these attributes, exactly as I did by copying the node attributes with for key in n.bl_rna.properties.keys (): (using if .is_property_readonly (key))
, this is ok. now I would like to access the "Sub attributes", [outputs, inputs] in the same way, I have not understood if it is possible to do it as it was done in the first attributes

I suggest take the time and and put more effort into your question(s). You can also make it broader like "How can I copy a node and their properties" as suggested before if that's what you want... I don't know @Pastrokkio For now it seems like you just copied a random snippet of code from stackexchange land.

@brockmann Thank you for your interest, but I would like to insist, if you notice in the first part of the code, the nodes are copied exactly with some of their attributes (for example, location, some Booleans, and the size of the node) this is very convenient as I can direct these attributes where I want (In this example I'm making a copy in the same node_trees). But I can't do the same for the other attributes


text:
How to position a poncho with cloth physics
I'm working on a character who is wearing a poncho:

The poncho has cloth physics, and the character is a collision object. To get the model in that screenshot, I started with a flat subdivided plane with a head hole cut out, I positioned it around his neck, and the physics drop it around his body.
I'm trying to figure out if I can "pose" the poncho differently. I'd like to have it like this:

Is there a good way to achieve this pose?

If you want to animate between both states through simulation, it might be difficult in Blender, as cloth physics are not that refined - mainly cloth collision and self-collision will be problem. With bones and shapekeys you can imho do a good result. If there is no need for transition I would sculpt the clothes in their final form and add some bones or simulation for wind effects and such.

Somewhat related https://blender.stackexchange.com/a/71727/919

I'd check out this answer from Faceb Faceb. My first thought is to grab a few vertices on your poncho, and assign them to a group. In your cloth physics settings, check the "pinning" option. You should be able to use that same vertex group to parent to the cloth to the shoulder of your character. The tricky part is, you'll have to 'pose' the cloth in edit mode all stretched out, and when you apply physics, the cloth should fall into place, and the pinned verts should stick to your object. Check out more here:
Pinning cloth to moving model


text:
Can right click select everything under the cursor, instead of just one thing?
I'm moving some vertices of a mesh to be better aligned to a reference image:

The mesh has depth:

This involves a lot of box selection (or C):

Is there a way to configure Blender to make right click select everything under the cursor, to avoid having to do all of these box selections?

It's funny but I have the same problem right now (you came with your question just in time:)). I started to model a set of animals' base meshes and perpetual box selections with B or C drives me crazy. To speed up the selecting process I started to use Ctrl+LMB (hold Ctrl, then drag a mouse cursor). Using a Mirror Modifier is a big help here too. Though it would be great to have the functionality you described in your question.

Maybe it could be possible to remap Lasso select to tweak event (moving with RMB clicked), like in example, I'm using RMB there. Note that default Tweak event for RMB will go away (not sure about Lasso select, maybe this could be created as additional mapping). I couldn't stop it from deselecting everything when occasionally selecting only one vertex so that's the subject for polishing (if possible)

If the depth is 2 vertices, you can double-click while holding Shift. Maybe it is somewhat easier to repeat. Otherwise I don't think there is easier way to do it :/ I am sure it could be done with an addon.

On the buttons of the bottom bar is "limit selection to visible".
Turn this off and your selection will go through and selevt everything behind the box/lasso/etc selection area


text:
How to maintain multiple cameras with different resolutions
I'm developing a scene and want to have a few different camera settings: an isometric camera with render resolution x==y, and a wide-angle perspective camera with render resolution x>y, and maybe a couple more.
To start, I created a linked copy scene, adjusted the dimensions and set the active camera.
I continued developing my scene, adding objects, etc.
I now realized that the object links were setup when I added the new linked scene, but any new objects I add after of course only exist in the one scene where they were added.

Is there a way to maintain all objects being linked to all scenes?
Is there a better workflow I could be doing to achieve this?

This kind of situation is best handled with Python in my opinion since it's so simple to tweak and you can keep working on just one scene.
This simple script would change scene resolution, change camera (perspective/orthographic views are set within the camera), and start the render:
import bpy

bpy.context.scene.render.resolution_y = 1110
bpy.context.scene.render.resolution_x = 870

bpy.context.scene.camera = bpy.data.objects['camera1']
bpy.data.scenes['Scene'].render.filepath = "C:/Test/"+"orthographic"
bpy.ops.render.render(animation=False, write_still=True, use_viewport=False)

bpy.context.scene.render.resolution_y = 220
bpy.context.scene.render.resolution_x = 360

bpy.context.scene.camera = bpy.data.objects['camera2']
bpy.data.scenes['Scene'].render.filepath = "C:/Test/"+"perspective"
bpy.ops.render.render(animation=False, write_still=True, use_viewport=False)

To use make sure you change the resolution numbers, match the camera object names, change camera object to perspective or orthographic, match the 'Scene' to the name of your scene, change the filepath C:/Test/ to wherever you want to render.

Hm.. Inspiring. With this script, it should be possible to parse the objects, and if it is a camera and its name includes dimensions (eg. "Camera Overview 1920x1080") use it to set the resolution of its render. I'll dive into that asap.

So I did it. It has been made! Get my very own add-on right here:
https://github.com/Gatada/MultiResolutionCameras

Download.
Open Blender Preferences (CMD+comma on MacOS).
Go to the Add-ons tab and click Install.
Browse to the downloaded python script and select it.
Enable the script, it is called: 3D View: Multi-Resolution Cameras.

Now, I should mention that the add-on does not show the size of the camera in the 3D Viewport, but it's easy enough to preview by clicking the Render Stillbutton in the Camera List.
I have started on code that will add a mesh to the view finder to represent the custom camera proportions, but so far not been able to get it to work.


text:
Turning a ring of vertices into a plane
I've got a ring of vertices. How can I add an edge from a newly added centre vertex, to every other vertex in the mesh (and then add faces between all of the new edges)?

Do you definitely want it this way or can the plane can come from any method?

I'm not sure exactly what I want.. I need to be able to map an image onto it though.

ok, I have an idea of something that might work..

It is not easy to extrude a single vertex multiple times to fit several others manually as you described it in your question, even using automated methods… gandalf3's method is the best way to do it if you want it that way. However, based on your comment above, I think these ways might be better… depending on how your mesh is set up.

Use BMesh! Just hit F and fill the thing, this will create an ngon
Grid Fill (introduced in 2.68), if your mesh has the same number of vertices along two opposite edgeloops of a closed mesh and the same number on the other sides, you can use this to fill it.

I'm still on Blender 2.62, so will have to wait until an upgrade before I can try this.

@ajwood you should upgrade to 2.63 at least, stop torturing yourself with archaic modeling tools.. look to the future man! :)

I'm just relying on the Ubuntu repository.. I'll upgrade manually though.

@ajwood http://askubuntu.com/questions/169542/how-do-i-install-the-latest-blender-3d-builds-from-a-ppa

Another method to create a face with a vertex at the centre.

Select your vertices:

Make Face F, this'll create a ngon:

Poke Faces Alt+P, this'll create a single vertex at the centre:

since you have dispensed with the limitation that there should be a central vertex connecting them all (this would be bad for more extreme concave polygon shapes anyway). Because you are writing a script anyway, example code (bmesh.ops.edgenet_fill) ?
import bpy, bmesh

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data

# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
edges = [edge for edge in bm.edges if edge.select]

bmesh.ops.edgenet_fill(bm, edges=edges)

# recalculate n-gon tessellation and update viewport.
bmesh.update_edit_mesh(me, True)

Method one:

Deleting the center vertex, A select all,
E extrude,

then Alt+M > Merge at center.

Extruding then scaling to zero would also work. (either with Auto-Merge Editing enabled or Remove Doubles afterwards)

Method two:

Using the Fill tool.
Select all and press Alt+F

Note that this is with the Beauty option off
With Beauty on:

I think the original method you posted that answered the question as OP asked it was ok, mine complimented it and merely offered alternatives. This updated one with the cross-referencing and inclusion is a bit confusing..

@iKlsR Removed the bmesh bit that was the same as yours. BTW, it's thanks to your selecting the Fill tool instead of Make edges and Faces that I even thought of Fill.. ;)


text:
Edge slide rotation
I'm modelling a worm from a reference image be extruding/rotating/scaling circles.

Is it possible to go back and smooth transition from edge loop to edge loop (e.g. I think the selected loop should be rotated counter clockwise)? Effectively, I think this is a rotation where vertices are restricted to an edge slide.

I don't think blender supports it yet. It was one of my feature requests for long time. :)

Btw, is this what you are exactly looking for?

@LeonCheung Yep, exactly it

If the rotation is small enough, doing a median-pivot rotation locked to the view zed axis might be sufficient. Another option might be creating a tube of parallel circles and shrinkwrapping it to the worm, or some similar retopo maneuver:

I've posted a feature request for this here

It seems that this feature is not currently implemented in Blender.


text:
Snap individual vertex of the selection to closest vertex
I want each individual vertex of my selection to snap to the closest unselected ones, so they superpose each other.
Im aware of the vertex snapping utility along the "closest" mode but it only work on "one" vertex, and thus will move the entire selection.
I could do it by hand but it would become tiresome with hundred of vertices.
Precision: I'd like it to work in UV editor too.
I hope I'm clear, Thank you.

maybe show a screenshot (or link to a hosted image) of the scenario here.

@Kaleb Its bit confusing as in what is it u want to achieve. If you could give an example scenario. And what is the end result you want to achieve it should help find solution

If you don't mind if the extra vertices are removed, you can use remove doubles and in the tool settings (F6), set the merge distance to something higher (probably in the range of .01 and .1). This will merge close vertices that are closer than a the merge distance.

Is there a similiar feature when manipulating the vertices in the UV window? And no other feature that'd do the same without removing vertices?

Yes, there's a remove doubles feature in the UV editor W > Remove Doubles. It works exactly the same way.

Thank you this feature works perfectly with the "unselected" option, however it would be nice if an equivalent wich doesnt remove vertices exist.

In the UVs? I don't think you can delete vertices in the UV editor.

Yes I meant in the 3D modeling view. Indeed, none UV are deleted.

Perhaps the Selection to Grid option from the (Shift+S) snap menu could be of use? It moves each selected object/point to the nearest grid point.
The grid can be configured in the Display panel of the 3D View's Properties shelf.


text:
How to select a group of vertices in edit mode?
Is it possible to select all faces of one of these groups in edit mode?

I tried my luck with this extension, but i wasn't able to figure out how that works. It just says "No Group" when i select a face and hit "Select".

AFAIK, those are Objects, not Vertex groups.

I already had a doubt. Okay, how to I select all faces of an object in edit mode?

Press A to toggle selecting all.

This toggles all faces of all groups. I need to flip the normals of only one group, but I don't want to select 70k faces by hand.

You can select (or deselect) the faces of a Vertex group by pressing Select with the desired vertex group selected in Properties > Object Data > Vertex groups:

To select all the faces of an Object press A or 3D view > Header > Select > (De)select all.

Yeah, i didn't know it would be that simple. Now everything works :D
Thanks a lot!


text:
How to get bone rotation between two matrices?
Before the question a bit of a background...
I have a mesh, and vertex groups as well for it's bones. Before placing the bones, I moved the vertices of the mesh, so every vertex.co += m.translation, where m was a matrix containing a starting position for each bone. Because Blender is handling bones different then the system I was working on before, I had to do a conversion: while I have points in old system, Blender has "sticks" (what are described with two points: with a head and a tail). I was able to create an armature good enough just by telling Blender that a bone's head is the parent's tail, etc. There was no rotation applied on starting position. The stuff seemed to be fine: I even verified the result in Ultimate Unwrap 3D Pro, and seemed to be all right. So far it was too easy. Then it came for animations...
I had to do a bit research: made a primitive mesh and armature with a script and started to learn how Blender handles the bones and animations. I learned, that I can use a .matrix to rotate, and scale the bone relative to the parent. Using translation led to no good, since the bones are connected and so the parent's tail is the inherited's head, so if I would want translation I had to set length of the bone. In my old system everything was different, not just handling the bones. No head or tail, just matrices, so when I say a bone is in m then all the vertices are to be multiplied with it. m is not relative to parent, but the object.
So my question is the conversion... let's see only one bone in pose mode.
I have two matrices in my old system m1 and m2, where m1 is parent. I can make a bone in Blender system called b with a .head of m1 and .tail of m2. Both m1 and m2 contain translation, rotation and scaling. In Blender I think it is like b.head = m1.translation and I am to point the bone to m2.translation, but with m1. rotation and scaling data, but ignoring m2. translation and scaling, because that is the inherited bone's property. My guess is that I am to modify the rotation value with m2.translation value somehow, but I do not know how.
I am not good enough in BPY yet and Math ever, that is why I would like to ask for help with this.

I think you need to give quite a bit more detail. "how I can get the bone's matrix value?" - Editmode? Object Mode? Pose Mode?, What is the matrix relative to?, The question title asks for the "bone rotation between two matrices?", but the question isnt asking about rotation at all. Ideally you could give a sample script which currently fails, then its easier to test and show the solution. (also probably more useful to others)

Thank you for the comment, I will edit the question (had no time for details this time).

@Zéiksz I had a similar issue here http://blender.stackexchange.com/questions/3549/how-can-a-bones-tail-be-changed-by-a-script/3553#3553. This is the first step to convert position data from kinect into rotation matrices. This might be helpful for you since it shows how to calculate rotation from positions.

Any updates to this quesiton?

No, and as far I remember I was unable to solve the issue those days.


text:
how to install blender older version(2.7) in ubuntu20.4
I need to install blender for my research work. Our software supports only 2.79 or below versions. So in the ubuntu 20.4 version, I can't install blender 2.79 or the below versions.

Why exactly can't you install 2.79 on your computer ?

@Gorgious when I started to install 2.79, the latest version will be installed.

Just download the version you need https://www.blender.org/download/previous-versions/ and unpack to a directory of your choice. Then run the blender executable from there.

All blender versions can be downloaded from the blender website (https://www.blender.org/download/previous-versions/) including Ubuntu executables (not installation packages) that will run out of the box, provide all necessary software is already installed.
if you try running the executable, but it doesn’t work because of missing dependencies, you might try installing the latest version of blender with the package manager first. You would end up with two copies of blender, but you would definitely have all the necessary software to run blender.


text:
Get parent from a collection that's already in a collection
Im really struggling with what seems to be an easy task, however Im not able to make this work.
I need to get the parent inside of a collection that's already in a collection,
with the code im using
    print(collection)
    if collection.name == doorname:
        door = collection.children[0]
        print(door) //OUTPUT: <bpy_struct, Collection("Door") at 0x7ff8f180b678>
        for objects in door:
            print(objects) //Error

I want all the objects in the Door collection to be printed.
Is there a way to do this, what am I missing?
Thanks in advance!

Suggest this is for o in door.objects or for o in door.all_objects to get all objects in door collection and its children.

See also https://blender.stackexchange.com/questions/145620/looping-over-hierarchies-of-objects-with-python  .. Can you clarify, comment above addresses error in code, whereas https://blender.stackexchange.com/questions/146685/how-to-obtain-the-parent-of-a-collection-using-python  would appear to answer the question title.

Maybe for objects in door.children since you're parenting them?

Yeah it could be cool to use magic method looping over children


text:
Key Color still shows in sort of a torn manner
I am keying an image and I have a problem on the screen: the Key Color is showing in some sort of a torn manner.

EDIT:
I keyed out the blue color, but other colors still remain.

Does this answer your question? Alpha Matte not keying out video?

So I used tips in the answer, and this is the result. Blender Screen

Your problem is that the image is very poor quality, all of the artifacts (called macro-blocking) is due to the compression (an image in jpeg format most likely).

The main problem is that the alpha channel generated by the keying node has to be associated with the picture. Use an Alpha Convert node in straight to premultiply mode.

The artifacts at the top of the image are caused by the compression on the original image. Some compression algorithms for video work by considering similar colors to be one solid block of color, usually this is not as visible, but since you are using this area for keying, the macro-blocks become visible.

What that means is that the color you are keying out is not even.
The solution are:

Use an image that has less or no compression.

Change the threshold of tolerance for the key, either by modifying the Key Color or by modifying the values for Clip Black (pixels that are considered part of the background) or Clip White (pixels that are considered foreground)
Read the manual for this node:

https://docs.blender.org/manual/en/latest/compositing/types/matte/keying.html


text:
Can one render scenes in a flat LOG color space for outside grading work?
Filmic LOG rendering question from a newbie:
Hypothetically, I have a finished scene that I want to use as a background layer for my live action/CG short. However, the live action footage I shot was shot in a generic LOG picture style. My plan was to have my scene also be in LOG, so that I could composite them together in After Effects (my compositor of choice) before finally color correcting/grading the whole thing in Resolve or Premiere. What is the most effective way (if any) to render the scene in a flat LOG picture style for outside composition and grading?

Save as 16 bit tiff using filmic base contrast, that will be a base2 Log encoded image.

https://blenderartists.org/t/using-filmic-blender-with-animations-image-format/685924/2

A few notes to set the stage for an answer:

LOG is not a color space. It is a way to encode data (designed to scale large dynamic range Scene Referred data to fit within containers for Display Referred formats (0 to 1)).
Proper compositing should be done using linear data, in a common color- space.
Data from cameras should be linearized first (sometimes called "de-loged"), or converted to scene referred linear value for compositing (as per previous statement).
Blender's data is already linear and using scene referred values.

Attempt to answer
Sure you could create log files, but know that log files have to be converted back to linear for proper compositing. Why work twice, and miss the opportunity to carry the full contents of the render layer created in blender?
As per statement 4. Blender already generates data in a format that is perfectly suited for compositing. Rendered images, with all of their passes (composite, Alpha, Z depth and any number of other passes you want) can be easily stored in OpenEXR multilayer files, and that way the information will never distorted or re-interpreted.
Statement no 3 and 2 carry the information for your compositing workflow
Bring those EXRs files from Blender into Resolve, and composite using Fusion (now part of Resolve). Fusion can deal correctly with linear scene referred data. The linearized (de-logged) footage from your cameras should be easy to integrate that way.
On the settings for the project use "Davinci color managed", set the timeline to use Rec709(scene). In the media tab in Resolve you can set the correct color transform for the footage. Use the "gamut" node, (or OCIO Colorspace nodes) to remove any curves (Log is a "curve") and make sure that the color primaries for gamut are set to sRGB/709.
Once the data from camera and blender is all linear, and in a common color space, you can go ahead and composite, and color grade the result.
To finish, just encode the final images to the delivery format and codec of your choice.
For more detail refer to this link: I have tried to import EXR files to Davinci Resolve with the LUT's

Thank you so much. And just to be clear, once both the Blender and camera footage are linearized, I can take them into the compositor of my choice, yes? I only ask because I intend to create 2D hand drawn animated effects that I can’t make in Fusion.

Save the images created in blender as EXR, linearizing the video segments can be done wherever you do the compositing, as long as the application you use can work using Linear data. An alternative is to linearize (de-log) the video segments and save as EXR. Then you can bring those into the compositing software of your choice.

What would you recommend as an effective workflow to transform my video footage to EXR?

@KKAkuoku To create EXRs from camera footage use Resolve. Set the project to use DaVinci Color Managed, set the input color space to match that of the camera used. Set timeline and Output color space to 709 scene. But it looks to me that for your project you don't really need to create EXRs of your footage. Just create a proxy file to set as background for your drawings. create your drawings as a separate layer and composite all the elements together later.


text:
Objects show as outlines instead of solids

I've recently installed blender and when I open the software the cube in the workspace is not in solid form. It is shown using lines and, also, when I add a new object it is not filled but it is shown in lines. Then i go to edit mode and do a small change then again the solid form appears. As you can see in the picture below, I tried to add an object and it comes in lines and not in solid form. Then i went to edit mode made a small change in the shape, then I can see a solid object in the object mode. your help will be most appreciated.

This is a common problem with unsupported graphics hardware (and occasionally out of date drivers). Check here to make sure your GPU is compatible - https://code.blender.org/2019/04/supported-gpus-in-blender-2-80/

@ChristopherBennett Other than replacing the GPU is there anything I can do

You could try using an older version of blender. 2.79 might work for you.

@ChristopherBennett Hey buddy, thanks i've installed 2.80 and its working just fine..You on instagram?


text:
How to get indicative value of the brightness of an image in python?
Is there a way to obtain an indicative value of the brightness of an image?
I am aware that I can get all the pixels of that image with:
myImage = bpy.data.images['My_image']
pxl = (myImage.pixels)

I get a list that should contain the above values (I hope I am not wrong about this):
pxl[0]# is a R value
pxl[1]# is a G value
pxl[2]# is a B value
pxl[3]# is a Alpha value
pxl[4]# is a R value
... etc.

I was thinking that I could average between r, g, b to get a value consistent with brightness, where (theoretically but I'm not sure) the higher than average value should equal a brighter image.
Now the problems are 2:

Traveling to a list of pixels of a 4K image is truly an operation
that takes too long in a for loop.
I don't really know how to approach this and the PIL / Image module
does not exist in the default blender and I'm not going to install
it.

Would anyone know how to direct me to a trick to get a reliable value to average the brightness of an image?
I was also thinking of traveling or taking only a certain portion of the image, in order to speed up the process, I could also think of taking 1 pixel every 4 or even just an area of 1024x1024 that is 1/4 of an image.
But I have no idea how to do it
Edit:
So I managed to make an approximate average of the RGB pixels:
img =bpy.data.images['My image']
result = (mean(img.pixels[:][0::4]) + mean(img.pixels[:][1::4]) + mean(img.pixels[:][2::4]))/3

Even if I don't know the order of these pixels, if they start at the top left or bottom
This seems to work well and the time is around 4 seconds on a 4K image, but I have ryzen 7 3700x in use and this processor is quite fast, so I think this is still slow.
So I'm thinking, in what order are the pixels in the list, I would like to analyze the image in portions. For example:

How to analyze only portion 1 (or 2) of an image?

Edit 2:
So, i found out and if i'm not mistaken, this: img.pixels[len(img.pixels)//2:] returns part 1 of the second image and this: img.pixels[:len(img.pixels)//2] part 2 of the second image
I did a test with an image as top black and bottom white and the order seems to match

Be quicker using pxl = myImage.pixels[:]  Resizing an image, eg 1/2 width x 1/2 height is a quarter size  copy  to estimate it quicker.

@batFINGER Thanks for your helpful suggestion. But I have no idea how to do this

What exactly do mean by luminescence in this context?

@RobertGützkow Hi Robert, I corrected luminescence with brightness I apologize for my bad English

@RobertGützkow  I'm not sure what I have yet to do to get a value that changes (And that is reliable enough) to measure brightness, I need a value that is fairly consistent based on the image that is being used. I don't have much experience in this situation and with python I'm not expert enough to do such a thing without using python add-ons.
I don't even know how to get the right pixels, I don't even know how to navigate to the pixels in a portion of the image, as this operation at the moment seems extremely slow with for or while loops. I am very self-conscious and I don't know what to do

@RobertGützkow At the moment I am not trying to do anything specific, but it is interesting to be able to understand how to study this, at the moment I would simply like to experiment with any image (jpg, png, etc ...) for example if the image was very bright, I think the average between RGB would be quite high, on the contrary a dark image would give a low RGB average. The problem is that I don't know how to average from the list of pixels, nor how to split an image, or take only sample pixels every 3 (for example)

@Pastrokkio No problem. So you're interested in the luminance in the photometric / color management sense. In that case you would have to learn about color spaces. You'd need to know the color space of your input (likely sRGB). Humans don't perceive all wavelength of light in the same manner, which is why simply taking the average wouldn't be accurate at all for the brightness.

Perhaps this is something for @troy_s just to get the color science right. If I'm not mistaken you could convert from sRGB back into CIE XYZ  and then use the Y component which represents the luminance.

@RobertGützkow I managed to find a small solution, I edited my question, but my problem now is how to get the analysis of an image from a list of pixels, and how to manage any portions.
I really appreciate your interest in this question.


text:
Is possible use multiprocessing for joining objects in python?
I strongly suggest not to try this code as it will open a number of blender windows out of proportion.
This is an example for illustrative purposes of what I would like to understand, that is if it is possible to speed up this operation which is very time consuming, I am trying to join certain objects, the test works well, but I currently use a processor with 8core and I am I'd like to try to understand if I can take advantage of this opportunity.
So I stop here and ask for advice, this is my wrong example:
import bpy,multiprocessing
from multiprocessing import Pool

##This list (joining) was created in a previous function,
##I don't place it because the function is quite complex and not useful for my example

joining=[[#obj1,#obj2,#obj3],[#obj4,#obj5,#obj6,#obj7,#obj8],#etc...]

def join_group(joining):
    for g in joining:
        objs = [o for o in g]
        if len(objs) > 1:
            c = {}
            c["object"] = c["active_object"] = g[0]
            c["selected_objects"] = c["selected_editable_objects"] = objs
            bpy.ops.object.join(c)

pool = Pool(processes=multiprocessing.cpu_count())
pool.map(join_group,joining)


text:
Material not displaying on array objects
I have set up my material in the node editor and it showed up fine but when I duplicated it with a array modifier the second object created with the array has no material attached to it. Also applying the modifier has no effect.

Here is my node set-up

Both objects display the same in material view

Why is this?
(Blend File)


text:
Select multiple faces at once
I have a .STL file and all of the faces have been converted to triangles so there are hundreds of long thin triangles.
Is there a effective way to select all of the faces in a small area? Something like a circle and when you click every face under that circle is selected.

You can toggle selecting all elements with A.
Some other basic selection tools are:

Circle select (C), which allows you to select with a brush:

Border select (B), which allows you to select with a rectangular region:

Lasso select (CtrlLMB), which allows you to select with a free form region:

To select all elements under the cursor, you can either select in Wireframe view (Z), or disable Limit selection to visible in 3D view > Header:

Otherwise only visible elements will be selected. (Elements behind other geometry will be ignored).
Also see the wiki for more info about selecting.

If you have wireframe off will it only select the visible faces?

Ok I tried it my self and turning wire frame off works

How do I get out of the selecting mode after I'm done selecting?

@narawagames Right click or escape

While you did ask for a specific way to select faces, there are other options that may be helpful with what you want to do. These options change depending on selection mode, shown options should be available in face select mode.
In the select menu you can select all triangles, EDIT: This first option is available through an addon called Mesh: Select Tools and is only available when this addon is enabled. While it is still listed under testing and isn't included with release versions of blender it is available from the blender git repositories

or faces with a similar size or number of sides.

Most likely what you want to do is convert all those triangles to quads. Even if you select the entire mesh you can convert tris to quads from the mesh menu. While this won't always convert 100% of the triangles it may get you a lot closer with little effort.

The answer is using an addon and should include the name of the addon to enable.

Right. I'm so used to having them there all the time I overlooked what's from an addon.

@sambler can u plz update the link to the addon the link show the that the file is deleted

Most of the mesh select tools was merged into mesh: Edit Tools2 There is also now Select->Select All by Trait->Select Faces by Sides where you can select faces based on the number of sides they have.

You can also use the lasso select tool by pressing Ctrl, left clicking and dragging:


text:
Is there a quick way to reset a .blend files windows and settings to default
Whenever I download a .blend from someone all of the windows and settings are the way they have left them as it is saved in the file. It takes way to long to rearrange every window and toolbar to the way it is by default. Is there any tool or shortcut that can reset the UI to blenders default and just leave the actual contents of the file? The only way I could do this is by creating a new file and using link/append but this is not the best option.

When you open the file there is an option to load the UI from the file which is about to be opened. By default this is enabled, deselecting this option will keep the current settings. See image below.
Edit - Updated with comment by @Samble
In the user preferences under File there is an option for Load UI - this is the default that is used each time you open a file. If it helps you can turn it off and manually turn it on only when you want to load the UI from a file.
Once the file has been loaded it will use the setting pulled from .blend file and to my knowledge there is no "Reset to Factory UI" or "Reset to Start-Up UI" option like you can do for the start-up .blend.
Should probably be put in as a feature request as I a lot of people share files and doing it by accident is annoying as you lose your current UI and then have to either reload factory setting or your own blend file to get back your UI before re-open the file you want to load.

In the user preferences under File there is an option for Load UI - this is the default that is used each time you open a file. If it helps you can turn it off and manually turn it on only when you want to load the UI from a file.

Can't find this anywhere in Blender 2.8.


text:
Is there a low level alternative for bpy.ops.mesh.separate()?
I am dealing with a great model, I have a problem, I want to divide it by parts, but bpy.ops.mesh.separate(type = 'LOOSE') seems to have a big problem, that is not takes into account the materials and keeps all the materials connected to all the generated objects, this is a big nuisance, I created a small script that eliminates the unused slots, but at this point I think the best solution is to create a small operator that does this I work because I think it is faster to create an object with materials already assigned correctly. I don't know what kind of approach can be used, if it is the case to use bmesh, it should basically do the same as bpy.ops, with some small variations.
I hope I'm not wrong, but I don't see any option that does this
Edit:
My research continues to lead me in this post:
It seems to me that it comes close to what I should do, I would like to use the bmesh module, but I think I should navigate to the connected faces, and get a list of material index on each face, then create a list with (face, material_index, # uv ?) and probably create a new object in that location that contains that data.
But I find it difficult to put this into practice

Finally, what you ask is not about separate but about cleaning unused materials? If that there is bpy.ops.object.material_slot_remove_unused() which is available from the UI. And this is also a searchable operator.

@lemon Hi, I would like to create from 0, an operator or function that separates objects, and that only maintains the materials that are actually used on the objects. I think it can become faster than bpy.ops + cleaning unused materials

ok, but you ask about bmesh and if I remember well bmesh is not about materials.Should use bpy.data instead.

also sorry to be 'negative', but I'm doubtful about recoding 'separate' in Python and having better performance than via ops (so via C). And there are many things to take into account (UV, vertex groups, modifiers, shape keys...).

@lemon course, I understand perfectly, but I would like to experiment with this, I think it will be very useful for many things in the future, even just to understand the mechanism. Just looking at that link (of my question) it refers me to counting separate objects, it seemed like a starting point, but I'm not sure anymore

The linked question/answers are useful to identify the loose parts (was involved in it). But what you need here is a Python efficient way to partially duplicate (separate) an object with all its inner data preserved (and material slot cleaning). I hope someone can imagine that from the Python APIs. Some kind of obj.data.copy() but partially copy the mesh. If not the code will involve mesh duplication and mesh part removal which can't be efficient (as I imagine it).


text:
How to clean duplicate materials on multiple faces for all objects in C.scene? (In python)
How can I fix this via script?
In this case the materials are all in use on an object, but they are the same material on multiple face, I would like to simplify it in 1 material only:

Edit:
in order not to make this question a possible duplicate, I want to specify that in this case I would like to iterate all the objects in the scene, and look for possible duplicate slots.

https://blender.stackexchange.com/a/129155/15543

@batFINGER I tried your script on a single object it works very well, but under a for loop or in C.scene.object, it seems to be very slow, a scene of about 250 objects, we are almost 20 minutes waiting, what do you think happens ?

Most likely https://blender.stackexchange.com/questions/7358/python-performance-with-blender-operators  If all materials are mesh linked then the material slot operators could be replaced.   https://blender.stackexchange.com/questions/53366/how-can-i-replace-a-material-from-python

@batFINGER Ty for usefull info,I added the detail concerning all the objects in the scene in the question, in order to be more specific

@batFINGER Your script works well, just add the active object in the scene to each for loop, so it will work perfectly under a for loop


text:
How to get an element in a EnumProperty?
I would like to get only 3 third element of an EnumProperty, is a string:
myEnum: EnumProperty (name = "Enum", items = searchCallback)

searchCallback is a function that returns the list to me.
Then the list returns me ("ITEM", "Item", "Item description")
how can I get "Item description"
print (self.myEnum) returns "ITEM" if I try to do print(self.myEnum[2]) it returns "E".
I don't know if I will use this function but I would still like to find out if this is possible

Have you tried accessing the enum_items through bl_rna, similar to this answer?

Interesting, I think I'm following a wrong way for what I should be doing, but I think it's useful to go into this topic too.
Basically the third element would be a directory that is stored, so as to have faster access to that file, since "ITEM" are a file


text:
Is there a module similar to beautifulsoup in Blender?
I would like to convert an html string that I am currently obtaining from an webpage.
I currently get the whole page using the requests module (Present in Blender)
import requests
r = requests.get(url)
text=r.text

I would like to avoid using modules that are not present in Blender like bs4, but I don't know if this is possible.
Basically I would like to understand if there is something available in Blender's module library that facilitates the conversion to conventional text, or a trick that can do this.
News:
I found the module in Blender which seems to be useful for text files formatted in HTML
https://docs.python.org/3.7/library/html.parser.html
from html.parser import HTMLParser

IMO would go with the 3rd party module. To clarify blender includes a bare bones standard python install (+numpy...) and its API modules bpy, bpy_extras, bmesh etc. Web scraping is not blender related.  Building a web scraping module from the basic python tools, is in the end what the 3rd party module is. Suggest this is off-topic and recommend asking on a python related site.

@batFINGER Thanks, i don't have the ability to judge this, I trust in the community.
Although I think the question is related to blender, in the sense that I was specifically asking if there was a module available / distributed in blender. Thanks for the note


text:
Can't see the vertices of joined objects
I created the body of the character, the hands and feet separately, then i joined them and manually merged the vertices. Everything was perfect.
The hands and feet still are part of the body mesh and follow the armature and rig great, but I went to edit some verts while weight painting and can't see the vertices on the hands and feet.
I can select faces and edges but can't move them. If I hide the rest of the body and un-hide it, the hands and feet show verts again, until i change to any other interface mode. Then they revert back to not visible again.
I have separated the hands and feet and re-joined them and it works, until i change interface modes again.
I don't know exactly what I did nor do I know how to fix it. Materials and textures still apply same as to the rest of the body too.
I think i merged the hands and feet while the body, hands and feet all had mirror modifier on, but I do not have any duplicate meshes. Now after messing with it, I somehow have one vert on the hand that does not seem to be manipulated by the armature/rig. And I can't seem to fix that issue as well, as i think it is associated with my main issue.

overlapping surfaces and one of them (the hand) has wireframe viewport display?

thank you. not sure how to fix that, but i will mess around with it. sorry but i am totally new to computer art/graphics, i have only drawn with paper, so this is another beast entirely.

ok, but never mind... the mesh seems to have a very good topology. If you want to, you can upload the blend file so that people here can have a closer look. Please use this link to do it: http://blend-exchange.giantcowfilms.com/

Please use proper punctuation to make the text more readable. https://en.wikipedia.org/wiki/Wikipedia:Wall_of_text

i have been working really hard on this project as it is my first one really. thank you for the fast reply and the encouragement. i will send the file.

How exactly do i upload the file?

use the link I've indicated. Check the agreement boxes, add a link to the question and drop your file where indicated. Once done click upload. And when upload is finishes get the obtained link and past it here.

I uploaded the file but it stopped at the end and isn't producing confirmation link/number.

I deleted the hands and feet and appended them back in from an earlier saved version, and I edited vertices and went in and out of edit mode. Everything was working great until I weight painted, then they went right back to the issue. I also applied the transforms.


text:
objects rendered as grey without shading etc. how to fix
objects on rendered not shows up and in viewport render mode it looks completely gray.
used default project for testing if it works but not works.
you know default start thingy.

it looks like that.
how i susposed to fix that?
i resetted to factory settings few times but it didn't help.
i can only render in cycles on old versions of blender.(this actually old one
2.80 beta is version.
render looks like this:

Fixed problem by upgrading newer version of blender

could you please share your file? https://blend-exchange.giantcowfilms.com/

solved by upgrading blender. just change versions it will fix it


text:
I am trying to get this glass to show the colored mesh behind it, it wont work, i have version 2.90
]1
Am trying to render this glass in blender, it wont show what,s behind it. its not a background, it is a colored mesh

Is this in EEVEE? If so, you may need to change the blending mode in the material settinsg to be able to see the stuff behind the glass.


text:
No colour when I render model I dowloaded from the internet
I've seen an intro template online in youtube and just want to change the text to someone's name.
I've downloaded this .blend template (it also included a .aep file, .jsx file and an mp3.
I opened the .blend in Blender 2.90.1
Once opened, it shows the original sequence from the downloaded youtube video, but there's no colour. (ie it's black text on a grey background)
I selected and tabbed the "front" and "back" of the original word and replaced this with the new name.
Now the tutorials I see online differ between some saying animate straight into a movie file and others saying to create PNGs.
What I have done is create 650 PNGs in a folder.
These PNGs are all black images on a white background so I'm not sure if I've not done something correct to fill in all of the PNGs with the correct colours.
If I now go to the Video Editing screen, I can select the 650 PNGs and then in rendering output choose FFMPEG using MPEG4 with AAC audio.
Once this has rendered, I get a MP4 file but the whole thing is black.
I do hear the mp3 music track that was in the original download.
Can you let me know how I can actually have the colour version like the original youtube video, and what am I doing wrong in terms of rendering it?
I feel so sure that it's one of those obvious things, but for someone new to looking at Blender there seems so much to it!
On opening the .blend template, Blender shows this
The original looks like this

But in material view it's like this:

can you add a screenshot pls

Here's what Blender shows as soon as I open the .blend file:

Please also make sure you're using the same Blender version that the tutorial is using. Of course, providing a link to the tutorial would help.

Added the image in the original post as requested

With regards a tutorial, there wasn't anything on the youtube video. It showed 10 intor videos with links to them so that they could be downloaded and amended as appropriate. Thanks

So I think the problem is that I also need After Effects to be able to do this. There seems to be lots of videos just saying amend this Blender video/template and doesn't mention any other requirements. If that's the case, as I only wanted to make a small video, then I guess buying After Effects isn't really worth it. Thanks for the replies. I told you I was new to this !! :)

you are in solid view, press z and go to material or rendered view

thanks but even in either material or rendered, it still shows with no colours. I'll post screen shots including that of the actual original video

The first thing I'd suspect is that there aren't any lights in the template.  If that's the case, and the materials used aren't emissive, you'll get a black render-- same as taking a photograph without a flash in a dark cave.  You'll want to look at either lighting or materials for your file.

ok thanks - I was rather hoping that by using a template that all these things would be setup as soon as you opened it, but I guess I've just been too naive to think it would be that simple!! No matter, thanks for your help.

Have you tried  actually rendering it(maybe they are using compositing tricks)

It sounds like you are rendering an animated matte... what is in the after effects file you have as well?

in response to Uncommon Blend: sorry I don't have After Effects, so unable to say what's in the file. I do appreciate your help though. I was hoping to just pick a decent intro blend file (for a video montage), change the text of the name and then use it in my video. It seems that these videos on youtube for intro templates need After Effects as well, which I was hoping to avoid as just wanted a 10 second video clip. I guess I'll try and find something else for now. thks


text:
Parts of model do not follow during animation?
I am new to Blender and struggling with numerous questions. I am in the process of animating a model and all went fine with respect to "Rigging, Skinning" Now I'm attempting to "Pose" and as I move the model parts of a hat and hair don't follow.
Could this be due to "Weighting Issues"? I did manually "Weight" the areas in discussion due to the fact that I believed loose parts such as hair needed to be manipulated to the head etc. Any Ideas? I have yet to complete the first key frame an things aren't following correctly?

Could you add some screenshots of your model and weights? It's a bit hard to point out the issue here.

Hi! This is a very common issue, but it can be caused by several different things. If you can upload your blend file we can see how your scene is set up and find the cause. If you need a place to upload to, you can use PasteAll.org -- it's very easy to use: http://www.pasteall.org/blend/

Also, see if the answer to this question solves your problem, since I think it is exactly the same problem. I've encountered it many times myself when rigging so I wrote this answer to help people with just this problem. :)

Thorn Blair lll,

Thorn Blair lll   Thanks so much for your response and I did post the blend file at http://www.pasteall.org/blend/28829? and I would provide any help would be greatly appreciated! Oddly, only fragments of the hair and the models hat streak behind the model as I move it across the screen. I have figured out that the facial distortion was from using to much control in the FK's and IK's  does that sound correct what other causes promote distortion?

http://www.pasteall.org/blend/28829

http://www.pasteall.org/blend/28829%3E

Thorn Blair lll  I have managed to work out the streaking of hair, hat parts through applying more weight paint and it did work great! One other problem I have encountered is the fk's an ik's aren't working well together? I have tried using just the ik's or fk's for limb movement and the control simply pass through the limbs unless I apply the gauge control to a higher level which allows the limb movement. However, when I utilize enough flow in the gauge to promote limb movment the mesh of the models vertexs flatens and looses a smooth appearance!

After applying several scenarios I have yet to acquire an acceptable medium? is there a trick I am missing?

OMG! I'm sorry! For some reason I never saw your messages here to me, otherwise I would have replied here. Sorry about that! :)


text:
Wavefront export with [Vertex/texture-coordinate/normal] face definitions
I downloaded wavefront obj model from this site http://tf3dm.com/3d-model/edward-kenway-23504.html.
The model I downloaded (According to this wikipedia article: http://en.wikipedia.org/wiki/Wavefront_.obj_file) has "Vertex/texture-coordinate/normal" face definitions. I use blender v2.66 to import and export the model. The problem is when I export the model its face definitions are different. For example:
Before import/export:
usemtl EdwardKenwayHead
s 1
f 15420/12835/15421 15421/12836/15422 15422/12837/15423
f 15422/12837/15423 15423/12838/15424 15420/12835/15421
f 15419/12839/15425 15420/12835/15421 15423/12838/15424
f 15423/12838/15424 15422/12837/15423 15424/12840/15426
f 15424/12840/15426 15425/12841/15427 15423/12838/15424

After import/export:
usemtl EdwardKenwayHead
s 1
f 1/1 2/2 3/3
f 4/4 1/1 3/3
f 5/5 1/1 4/4
f 4/4 3/3 6/6
f 6/6 7/7 4/4

Is there any way to export wavefronts with "Vertex/texture-coordinate/normal" face definitions in Blender? (v2.66) I already have C++ & OpenGL loader models with these faces.
By the way. Before export the model's size is 2.8KB and after export it is 1.8KB - good optimalization!

There are several objects included in the one file, all vertices listed are numbered in the order they exist in the file, each object then uses a range of these vertices for it's faces.
You will find that the objects and it's related items in your exported file will be in a different order than the original, therefore each object uses a different range of vertices. You should find that the total number of vertex lines, face lines etc. should all match up, just that each object is using different numbers.

I see... but still... original file has 80837 lines of code and exported one only 62736. Also faces in original file have more info: x/x/x x/x/x x/x/x, while in the exported one they look like x/x x/x x/x. Info about normal index is gone.

As per the wikipedia reference the face info is vertex/texture/normal - dropping the vertex normals might explain dropping 18000 lines. When exporting to obj there is an option to export normals, turning that on could make a difference.


text:
why is my object solve not matching my plane track?
Ok so im tracking a flat piece of paper and everything seems to look great! when i add a plane track to the points it follows the paper perfectly.  but for some reason when i use the object motion solve and set up the tracking scene the points don't follow the paper any more.  can anyone help me or explain what i'm doing wrong please?
Thanks in advance.
here is a screen shot of it.  left side shows the plane track around the paper and fitting it perfectly. on the right side it shows the plane up right and not tilting back like it should.

The "plane track" can be used in the compositor to place an image over the page you tracked. To have an object follow the markers you need to go to reconstruction and set floor etc while object is selected in 3dview.

@sambler Care to make that an answer with some more details?

Tracking a piece of paper as it moves around in a video is a matter of following some points on the video, an image can then be distorted relatively easy to match the movement of the plane.
To track camera movement you need points that are not only following points on the video but that can also be used to define a three dimensional box in front of the camera. When reconstructing camera motion you specify some points that are flat on the ground and also raised up on a wall. This provides a way to re-create the camera movement relative to the given points.
Once you have the camera movement you can then track objects that move relative to these points.
With enough points on an object you can get the same effect as an object moving in front of the camera, but in your example video you have nothing that adds height to the sheet so there is no way of re-creating the rotation of the page, the best you can do is distort a 2d image to match the distortion of the page in front of the camera.
In your screenshot you have a solve error of 18.65. A solve error less than 1.0 is considered a good track with values up to 3.0 considered possibly good enough to work with. Anything higher than 3.0 is considered a bad track.


text:
What is the best solution to create a function that returns draw?
I have a classic UI panel, and I'd like to call a drawing function that always draws the same thing, and I was thinking of using a function.
Actually I don't even know how to correctly ask this question, I hope you correct me.
Basically I would like to call a layout data block to insert where I need it, something like this:
class MY_PT_Panel(bpy.types.Panel):

    bl_label = "My Panel"
    bl_idname = "My Panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "My Panel"

    def draw(self, context):

        #scn.scn_prop.my_bool_one / my_bool_two property is declared in a PropertyGroup

        scn=context.scene

        layout = self.layout
        layout.prop(scn.scn_prop, 'my_bool_one', text='Show menu 1')
        if scn.scn_prop.my_bool_one:
            layout.label(text='Menu 1')
            layout.label(text='Many options from menu 1')
            ##Avoid to repeat this:
            layout.label(text='My mini-menu')
            layout.label(text='This is just an example')
            layout.prop(scn.scn_prop,'my_bool_three',text='Do something')

        layout.prop(scn.scn_prop, 'my_bool_two', text='Show menu 2')

        if scn.scn_prop.my_bool_two:
            layout.label(text='Menu 2')
            layout.label(text='Many options from menu 2')
            ##Avoid to repeat this:
            layout.label(text='My mini-menu')
            layout.label(text='This is just an example')
            layout.prop(scn.scn_prop,'my_bool_three',text='Do something')

So here's the problem, my "Mini-menu" is actually something complex, I wish I could call it without having to rewrite it all the time. I don't know which way to go. I think it can be solved with a function within the class, but I have many doubts about it

Hi. So what are your 'doubts' about it? Did you try it and it didn't work?

It works like this, but it is only the example where I would like to understand how not to have to repeat the "Mini-menu" every time, if I can insert this "Mini-menu" in a function, so as to insert only one call to the function that draw the "Mini-menu"

I meant did you try the function? Surely very easy to test?

I doubt if I have explained myself wrong. I wish the "Mini-menu" was part of a function to be called, in order not to have to rewrite under each menu 1 and menu 2 every time, but I don't know how to build this function, and where to put it.

The panel is just a class right? So you can easily add a method and pass the scene or context: def my_drw(self, context). Consider to use a for loop in order to draw the properties in one go (if there are 2+ bools).


text:
How to create 2 distinct objects from a single object with 2 Vertex Groups? (python)
I created this example, where I only have 1 object that contains 2 cubes (mesh).
These cubes respectively have a vertex group,1 UV Map and share 4 materials.

Vertex group "Cube1" white and green
Vertex group "Cube2" red and yellow

I was wondering if there was a way to create 2 new objects.
I found this example to iterate at the vertices mesh of a respective group of vertices, but I was wondering if it was possible, to create 2 new objects, iterating also to the materials, since it is necessary to iterate the C.object.data I would have everything I believe available.
Anyone have any suggestions of how to do such a thing?
Keeping in mind that I would like 2 items with 2 materials and its UV map per item as a result.
I add a detail that I had omitted but I took for granted.
Objects must be separated according to the group of vertices

Dupe n Delete
Similarly to another answer re materials and "normalizing"  material slots (removing unused), can use a default dictionary with a list of  the vertices of each vertex group, then remove others from from a dupe for each group.
Ultimately this would be better if could split using bmesh, but as of now cannot set a split target to another mesh or bmesh instance.
Note this will split based on vertex group.  Vertices that are members of more than one group will be in each split off object. Vertices not assigned to any group will not be split off into new object.
Using copy on both the object and the mesh brings along all data.
import bpy
from collections import defaultdict
import bmesh

context = bpy.context

ob = context.object
me = ob.data
vgs = ob.vertex_groups[:]
col = context.collection
rg = defaultdict(set)

for v in me.vertices:
    for g in v.groups:
        rg[vgs[g.group]].add(v.index)

bm = bmesh.new()
all_verts = set(range(len(me.vertices)))

for vg, verts in rg.items():
    if not verts:
        continue #  no empty vg mesh
    oc = ob.copy()
    oc.name = vg.name
    me = oc.data = oc.data.copy()
    bm.from_mesh(me)
    bm.verts.ensure_lookup_table()
    bmesh.ops.delete(bm,
        geom=list(bm.verts[i] for i in (all_verts - verts)),
        context='VERTS',
        )
    bm.to_mesh(me)
    bm.clear()
    for g in oc.vertex_groups:
        if g.name != vg.name:
            oc.vertex_groups.remove(g)
    col.objects.link(oc)

Note I haven't bothered to remove materials, as mentioned this is similar to a previous script used in one of your answers, to test what materials are on a face and remove.
Alternatively, instead of copying a new mesh each time, copy the bmesh and write to a new mesh.  Once again will have to deal with materials, using all faces left after delete operator, to check which materials are assigned to faces of a particular vertex group.
See Delete all materials that aren't assigned to a face?
If the material is data (mesh) linked, can append to the Mesh.materials collection instead of using the slot operators.
import bpy
from collections import defaultdict
import bmesh

context = bpy.context

ob = context.object
me = ob.data
vgs = ob.vertex_groups[:]
col = context.collection
rg = defaultdict(set)

for v in me.vertices:
    for g in v.groups:
        rg[vgs[g.group]].add(v.index)

bm = bmesh.new()
all_verts = set(range(len(me.vertices)))
bm.from_mesh(me)
for vg, verts in rg.items():
    if not verts:
        continue #  no empty vg mesh
    oc = ob.copy()
    oc.name = vg.name
    oc.data = bpy.data.meshes.new(vg.name)
    bmc = bm.copy()
    bmc.verts.ensure_lookup_table()
    bmesh.ops.delete(bmc,
        geom=list(bmc.verts[i] for i in (all_verts - verts)),
        context='VERTS',
        )
    bmc.to_mesh(oc.data)
    bmc.free()
    for g in oc.vertex_groups:
        if g.name != vg.name:
            oc.vertex_groups.remove(g)
    col.objects.link(oc)

This looks good but has a problem, I have tried to deal with an object with with many groups of vertices and it seems very slow, although I must say that it does its job.

I'm trying to understand what your script does, but I noticed (correct me if I'm wrong), copy the whole object and then delete what is not needed with bmesh.ops? Couldn't you think of doing a construction operation from 0? That is, it takes the materials on the faces, the UV and polygons, vertices, edges. And from this create a new object instead of copying the whole context object? I would just like to understand whether to abandon the idea or proceed further studying