text:
Fastest and Cleanest way to lower fluid polycount
As it bake the fluid result is pretty poly expensive because polygons are sync with voxel resolution.

What's the best way to get an optimized mesh out of a baked-applied-motionless fluid model?

Limited disolve works pretty fine on planar surface but it takes TOO LONG (1h for 450vx fluid, it use only 7% of my cpu)
Decimate is far more faster, but i wonder if it's fine to use because i have no idea if it first aim "plannar high poly parts" or if it just reduce polys everwhere at the same time...
Any other idea?

I think that there is just to much subdivision in your model :/, try to remove some modifier, or create a low resolution mesh instead. Edit: Did you try to change the preview and Render settings in your fluid simulation panel ? You could maybe change those parameters to get less polygones.


text:
Objects all moving together
Every time I use the 3d manipulator it moves all of the other objects in the scene:

They are multiple meshes and the image illustrates the way they move at different speeds

Perhaps you have everything selected? Maybe they are all joined together as one object? Maybe they are all parented to what you are trying to move? Try hitting "A" to deselect everything. Select everything and hit "Alt-P" to clear any parent relations. Try going into "Edit" mode to see if your objects are actually one object.

How can image illustrate how objects move at different speed ? Record a short animation of that using gif recording to showcase the problem and upload your file. If linked question doesn't answer your question, then yours one is still unclear.

source: Stack Exchange

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

sort: votes


text:
Humanoid mesh breaks when subdivided
I've made a humanoid mesh, but it breaks around the chest and neck area when I subdivide as shown in the pics.
Mesh after subdividing

So i cleaned up the mesh the best i could but its still not working out. What am I missing?

Okay so I posted 2 pics, one showing the mesh before subdivision, but for some reason it didn't show. But i tried to remove all the triangles  and faces that intersect each other. So i don't think its that.

did you made with mirror modifier

@ateks yes i did

You probably don't have enough reputation to post more images you'll be able to when you have a higher score.,I've added it for you for now. Your mesh seems to have some topology issues, I see some ngons around the neck area. I also see some and weird artifacts in the chest. There may be overlapping or duplicate geometry. Cleanup your mesh and check your normals. Otherwise post more information, it is impossible to diagnose from the screenshots alone.

@DuarteFarrajotaRamos Thanks a whole lot for that! I'm new to 3D modelling and kinda just using the internet to navigate my way through it. SO could you tell me what sort of information i could post for a more thorough diagnostic?

If you can provide us with your blend file that would be the best way to see what is wrong

How do I do that? As far as I can see theres no option for file attachments above.

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


text:
Filmic Log: How to render a texture to appear identical to the input image?
EDIT:
I know this is a hack. The thing is why this hack works in Compositor and not as a texture?
I ran into an issue when editing OpenColorIO config file and I don't know if this is a bug or I misunderstood something. So I created this minimal example:
Let's say I have an image/texture in the 3D scene to serve as a reference - I want to see this image in the viewport with the original colors, while at the same time I would like to work on the 3D environment and render it in Filmic Log (in this example. Normally Filmic no-Log, but I will change the config file anyway, this is an ilustration).
So, the View Transform is sRGB / Filmic Log.

If I load this image in Compositor and assign ALSO "Filmic Log" as its color space, the image is output perfectly intact. However, if I assign this image as a texture, again with Filmic Log colorspace, then there are wrong colors are on the output.
You can see the difference side-by-side here, left half of the parrot is the perfect one from the compositor, right half of the parrot is the washed-out texture.

The material is simple Emission shader, the scene is otherwise empty, just camera and plane with texture.

I thought the textures is converted from preset color space (Filmic Log here) into to reference space (Linear) and then back to Filmic Log on the output, but it seems that something else is happening as well and I don't understand it. Thanks for any explanation! :)

Here is the .blend file with the texture, if you are interested in doing your own tests: https://www.pastel.cz/temp/color_spaces_test.zip

If your image is not log encoded you should never set it to use log as color space. I presume the image is encoded as sRGB sot that is the only color space you can set it as. The issue is that log and filmic use a much larger dynamic range, while the jpeg you are importing is limited to display referred values. Start by reading the post on this site on filmic https://blender.stackexchange.com/questions/46825/render-with-a-wider-dynamic-range-in-cycles-to-produce-photorealistic-looking-im

@susu Thank you for the reply! I am aware that what I do is cheating and not a perfect way. The problem is that there is no perfect way (that I know of). So this boils down to: Why Filmic Log texture is different than Filmic Log image in Compositor? This question is basically an extension of a my 6 months old question: https://blender.stackexchange.com/questions/187846/color-management-monitor-calibration-issues-compositor-issues-ideas-for-im/

No there is no perfect way, other than using images that are using scene referred values (log encoded or linear EXRs). Images encoded as sRGB are impossible to reverse to linear scene referred values, they can only be linearized to display referred linear.

Nice thread, I missed that one, thanks! I will explore the answers. However, the more I think of it, the more it seems it should be doable. The image could be a random set of pixels and this just says "this is what we should get at the end". And since we know all the color transformations it should be simple to create an inversion of all of them, concatenate them and we get the texture colors we should use. There might be some rounding errors though.

Images look correct only if they are displayed on the color space that they were encoded to use, or if the color transform to the display deals with the conversion to a different display or color space.
If your image is not log encoded you should never set it to use log as color space. I presume the image is encoded as sRGB sot that is the only color space you can set it as. The issue is that log and filmic use a much larger dynamic range, while the jpeg you are importing is limited to display referred values. Start by reading the post on this site on filmic
Render with a wider dynamic range in cycles to produce photorealistic looking images
and
How to mix a jpeg background image with a 3D scene generated using Filmic Blender?
By reading that you will realize that there is no perfect way to mix apples and oranges, other than using images that are using scene referred values (log encoded or linear EXRs). Images encoded as sRGB are impossible to reverse to linear scene referred values, they can only be linearized to display referred linear (form 0 to 1).
The problem lies in how display referred images are encoded, besides reversing the gamma curve (trivial issue), the way the highlights and shadows are encoded is already non-linear, as it is something that each individual camera does differentrly, and therefore not reversible to linear values accurately. You can play with curves and even with the ASC-CDL node to try to modify the values, but know that at that point is all hokus-pokus and unscientific as it gets, plus you will quickly run into issues where banding and other quantization errors will appear, particularly in 8bit images. Moreover, jpeg is a terrible format to begin with, and will also break once you start distorting the values that make such compression scheme work, showing macroblocks and fuzzy edges.
Display referred image created on a camera is already taking into consideration the fact that we perceive light in a non linear way, as we see better into the shadows than in the highlights, so those images are created to emulate that and therefore need to skew the way values for shadows and highlights are assigned. There are more bits used for the shadows. If you try to linearize the information you will find that at lot of the information on the highlights is just not there, and any tool will have a hard time inventing what is not there.

I appreciate your answer, but now I think we are talking about different things. The texture alone and the means of its obtaining are irrelevant. Let's say instead that I generate a set of random pixels in Blender and I want this exact colors to be on the output after all the render+view transformations. Since Blender knows all the transformations it is applying it should be simple matter to create inversion of those transformations (not the image acquisition/compression transformations) and get the colors that should be used as texture.

It matters when you are using the texture as emission. An image used as texture on a diffuse shader will always be limited to 0 to 1, as the texture deals with albedo, the amount of light reflected, so the final value of each pixel will be dependent on the amount of light and to a great degree the angle of the surface to the camera and the light (fresnel), and after that there is still some subjective factors and artistic intent that can be dealt with "looks".

But images used as emission can (and should) use much larger values their values will depend on the intensity of the emission. but they always will be rolled through some color transform to encode them into display referred values to be displayed on  a monitor .

But if your aim is to mix differently encoded imagery in the compositor, know that the compositor is limited in the ways it can interpret information. So mixing display referred and scene referred that are on different scales cannot be done accurately. If you want to remain in sRGB display referred values then set the color management section to use "standard" as view transform and sRGB as display device and the values will match 1=1

I see where you are heading. So even though I assign "Filmic Log" color space to the texture it will be still limited to that 0 to 1 range? (On the other hand the Compositor works flawlessly with the same Filmic render and texture settings [no need to go to Standard sRGB] and I was even able to add my monitor profile to the mix as described in my answer here: https://blender.stackexchange.com/questions/187846/color-management-monitor-calibration-issues-compositor-issues-ideas-for-im/ )

Again, you are entering the realm of sorcery and guessing, and maybe even getting lucky by bending the way tools are used. If that works for you then go ahead and continue, but is not the way the tools are designed to work and they might not work for you in all situations either, but know that what you see in your monitor might not translate transparently to others.

If you are using None  or RAW as output transforms you are in effect bypassing the color trasnsforms, and the sRGB values are dumped directly to the output, which will make them look correct, but any other object that is rendered with the intent of being displayed using filmic, will not look right, as it will be shown as linear values, most likely very dark and contrasted.

Sure, I understand that well - that sRGB vs Filmic thing and also that sorcery thing. So far I have been able to bend Blender to use my monitor color profile (AdobeRGB gamut), so I am just continuing bending until it does what I need :)

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


text:
Distorted exported .fbx model when objects are under parent
This is the model I am trying to export to FBX:

I consists of leaves (named "Leaf.001" - "Leaf.006") that are linked duplicates of an original leaf (named "Leaf") created from a plane mesh, and a twig created from a cube mesh.
The problem is if I make the Twig the parent of any of the leaves (in the following case, "Leaf.001" - "Leaf.006") and export the model as a .fbx file, re-importing the file gives me a distorted model:

This problem doesn't occur for leaf models left in the root hierarchy.
The same distortion occurs if I import my .blend file into Unity.
I think it has to do with the leaf meshes, because the distortion doesn't happen for Twig objects children to a Sprig (subdivided cylinder), and Sprigs children to a branch (beveled bezier curve), and so on.

did you zeroed out all transformation? Try that first.

Thanks.  Applying the Scaling to the twig solved the problem.

I'm not sure if this problem has been resolved or not, but for future reference, I also frequently work with Unity and when FBX exports are distorting for me, it usually involves one of two things:
1) As mentioned in comments, I have a mesh that has an unapplied transform to it, and the FBX exporter is getting confused.
2) I have an animation doing something wonky on its first keyframe, which needs to be replaced or removed. This can result in distortions which look nothing like the animation itself, particularly if there was unapplied scaling or rotation involved at some point.
This may or may not solve the issue, but I'd bet that it's an animation. Perhaps the model has an entry for the leaves rustling or blowing with the wind?


text:
Adding/removing items to CollectionProperty in PropertyGroup and UNDO
I've added PropertyGroup with CollectionProperty of custom type and define operator for adding/removing items to this property. And User list (bpy.types.UIList) to check changes in this CollectionProperty.
Everything works fine, but undo functionality work with this operator, except changes for adding/removing CollectionProperty items. I wonder is this bug, or i should check my code?
Partial code for PropertyGroup(is this to complex data for UNDO?):
class FaceGroupsPropGroup(bpy.types.PropertyGroup):
    reg_index = 2

    @classmethod
    def register(self):
        bpy.types.Mesh.face_groups = bpy.props.CollectionProperty(
            name="Face groups",
            description="Face groups",
            type=self,
        )
        self.fusion_mstates = bpy.props.CollectionProperty(type=FusionStates)

        bpy.types.Mesh.fgroup_active_index = bpy.props.IntProperty(name="Active index",
                                                                   default=0,
                                                                   update=self.index_update)

        bpy.types.Scene.fgroups_live = bpy.props.BoolProperty(default=False)
        bpy.types.Scene.fg_smooth_iterations = bpy.props.IntProperty(min=0)
        bpy.types.Scene.fg_fatten = bpy.props.FloatProperty()
        self.name = bpy.props.StringProperty(name="Name", default="Group")
        self.wm = bpy.props.FloatVectorProperty(name="World matrix", size=16, subtype='MATRIX')

        self.color = bpy.props.FloatVectorProperty(name="Color",
                                                   subtype='COLOR_GAMMA', min=0.0, max=1.0,
                                                   default=[0.0, 0.0, 0.0], update=self.on_color_update)

        self.strokes_ids = bpy.props.IntVectorProperty(name="Strokes", size=6, default=(0, 0, 0, 0, 0, 0))

Code example for this are bit complex i can make simple one, if needed. Also, i have same problem with undo for changing data per-edge in its layer(added with :bm.edges.layers.int.new("TempLayer"))

I have also experienced this problem with PropertyGroup and was not able to find a solution

Your operator should define bl_options = {"UNDO"}:
class MyOperator(bpy.types.Operator):
    bl_options = {"UNDO"}
    ...

See https://docs.blender.org/api/2.79/bpy.types.Operator.html?highlight=bl_options#bpy.types.Operator.bl_options

Could be some issues without using register also bl_optons = {'REGISTER', 'UNDO'}

this flag already theire, as i`ve wrote undo works for operator. But only partially - it do not undo property changes.

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


text:
How to use one face to cut another face in a bmesh
I have several faces on the same plane, there is always a largest face and several smaller faces "inside" the larger one.
I've currently got all the faces stored in a list and sorted so the largest is always the the first index of the list faces[0] to make it easier to know which face to cut from and the rest to use as cutters. This also needs to be as fast as possible as there could be hundreds of faces in an interactive modal being updated on-the-fly with 'MOUSEMOVE'
The code below creates the mesh on the left, I'd like to remove sections from the largest face using the smaller faces as cutters while keeping everything in bmesh so it ends up something like the mesh on the right:

I have looked at all the bmesh.ops but have no idea which one would do the job, if any at all. I'm generally "okay" with bmesh, but I've never encountered a problem like this before.
Even some pointers on what direction to take would be appreciated.
A side question, anyone know what happened to batFINGER? That dude knew precisely everything :)
import bpy
import bmesh

verts = [(5.88470458984375, 1.1705703735351562, 0.000396728515625), (3.3334121704101562, 4.9888458251953125, 0.000396728515625), (-4.242645263671875, -4.24261474609375, 0.000396728515625), (5.884712219238281, -1.1705093383789062, 0.000396728515625), (-4.242645263671875, 4.242668151855469, 0.000396728515625), (12.054519653320312, 15.040176391601562, 0.000396728515625), (12.767379760742188, 7.8024444580078125, 0.000396728515625), (8.153594970703125, 13.424354553222656, 0.000396728515625), (11.313179016113281, 15.113189697265625, 0.000396728515625), (13.424346923828125, 8.153602600097656, 0.000396728515625), (7.802436828613281, 12.767387390136719, 0.000396728515625), (14.00018310546875, 8.626182556152344, 0.000396728515625), (7.5861968994140625, 12.054534912109375, 0.000396728515625), (14.472763061523438, 9.2020263671875, 0.000396728515625), (7.51318359375, 11.313186645507812, 0.000396728515625), (14.823921203613281, 9.858993530273438, 0.000396728515625), (7.5861968994140625, 10.571846008300781, 0.000396728515625), (15.0401611328125, 10.571846008300781, 0.000396728515625), (7.802436828613281, 9.858993530273438, 0.000396728515625), (15.113174438476562, 11.313194274902344, 0.000396728515625), (8.153594970703125, 9.2020263671875, 0.000396728515625), (15.0401611328125, 12.054534912109375, 0.000396728515625), (8.626174926757812, 8.626182556152344, 0.000396728515625), (14.823921203613281, 12.767387390136719, 0.000396728515625), (9.202011108398438, 8.153602600097656, 0.000396728515625), (14.472763061523438, 13.424362182617188, 0.000396728515625), (9.858978271484375, 7.8024444580078125, 0.000396728515625), (10.57183837890625, 15.040176391601562, 0.000396728515625), (14.00018310546875, 14.000198364257812, 0.000396728515625), (10.57183837890625, 7.586204528808594, 0.000396728515625), (9.858978271484375, 14.823928833007812, 0.000396728515625), (13.424346923828125, 14.4727783203125, 0.000396728515625), (11.313179016113281, 7.513191223144531, 0.000396728515625), (9.202011108398438, 14.472770690917969, 0.000396728515625), (-5.884712219238281, 1.1705703735351562, 0.000396728515625), (-3.814697265625e-06, 6.000022888183594, 0.000396728515625), (-5.543281555175781, 2.2961273193359375, 0.000396728515625), (-10.57180404663086, 15.040168762207031, 0.000396728515625), (1.1705398559570312, -5.8846893310546875, 0.000396728515625), (-9.858940124511719, 7.8024444580078125, 0.000396728515625), (-14.472724914550781, 13.424354553222656, 0.000396728515625), (-11.313140869140625, 15.113182067871094, 0.000396728515625), (-9.201972961425781, 8.153602600097656, 0.000396728515625), (-14.823883056640625, 12.767379760742188, 0.000396728515625), (-8.62613296508789, 8.626182556152344, 0.000396728515625), (-15.04012680053711, 12.054527282714844, 0.000396728515625), (-8.153556823730469, 9.202018737792969, 0.000396728515625), (-15.113143920898438, 11.313186645507812, 0.000396728515625), (-7.802398681640625, 9.858993530273438, 0.000396728515625), (-15.04012680053711, 10.57183837890625, 0.000396728515625), (-7.586158752441406, 10.571846008300781, 0.000396728515625), (-14.823883056640625, 9.858985900878906, 0.000396728515625), (-7.513141632080078, 11.313186645507812, 0.000396728515625), (-14.472724914550781, 9.202018737792969, 0.000396728515625), (-7.586158752441406, 12.054534912109375, 0.000396728515625), (-14.000144958496094, 8.626174926757812, 0.000396728515625), (-7.802398681640625, 12.767387390136719, 0.000396728515625), (-13.424308776855469, 8.153602600097656, 0.000396728515625), (-8.153556823730469, 13.424354553222656, 0.000396728515625), (-12.767337799072266, 7.8024444580078125, 0.000396728515625), (-12.054485321044922, 15.040168762207031, 0.000396728515625), (-8.626136779785156, 14.000190734863281, 0.000396728515625), (-12.054481506347656, 7.586204528808594, 0.000396728515625), (-12.767337799072266, 14.823928833007812, 0.000396728515625), (-9.201980590820312, 14.472770690917969, 0.000396728515625), (-11.313140869140625, 7.51318359375, 0.000396728515625), (-13.424308776855469, 14.472770690917969, 0.000396728515625), (0.0, -5.999977111816406, 0.000396728515625), (6.0, 3.0517578125e-05, 0.000396728515625), (-10.571807861328125, -7.586158752441406, 0.000396728515625), (-9.85894775390625, -14.823883056640625, 0.000396728515625), (-14.472732543945312, -9.201972961425781, 0.000396728515625), (-11.31314468383789, -7.513145446777344, 0.000396728515625), (-9.201976776123047, -14.472724914550781, 0.000396728515625), (-14.82388687133789, -9.85894775390625, 0.000396728515625), (-8.626136779785156, -14.000144958496094, 0.000396728515625), (-15.040130615234375, -10.571800231933594, 0.000396728515625), (-8.153556823730469, -13.424308776855469, 0.000396728515625), (-15.113143920898438, -11.313140869140625, 0.000396728515625), (-7.802402496337891, -12.767333984375, 0.000396728515625), (-15.040130615234375, -12.054489135742188, 0.000396728515625), (-7.586158752441406, -12.054481506347656, 0.000396728515625), (-14.82388687133789, -12.767341613769531, 0.000396728515625), (-7.513145446777344, -11.313140869140625, 0.000396728515625), (-14.472732543945312, -13.424308776855469, 0.000396728515625), (-7.586162567138672, -10.571792602539062, 0.000396728515625), (-14.000152587890625, -14.000152587890625, 0.000396728515625), (-7.802406311035156, -9.858940124511719, 0.000396728515625), (-13.424312591552734, -14.472724914550781, 0.000396728515625), (-8.153564453125, -9.201972961425781, 0.000396728515625), (-12.767341613769531, -14.823883056640625, 0.000396728515625), (-12.054489135742188, -7.586158752441406, 0.000396728515625), (-8.626144409179688, -8.626136779785156, 0.000396728515625), (-12.054489135742188, -15.040130615234375, 0.000396728515625), (-12.767341613769531, -7.802398681640625, 0.000396728515625), (-9.201980590820312, -8.153556823730469, 0.000396728515625), (-11.31314468383789, -15.113143920898438, 0.000396728515625), (-13.424312591552734, -8.153556823730469, 0.000396728515625), (4.2426300048828125, 4.242668151855469, 0.000396728515625), (-3.333423614501953, -4.988792419433594, 0.000396728515625), (2.2960968017578125, -5.543251037597656, 0.000396728515625), (-3.333423614501953, 4.9888458251953125, 0.000396728515625), (12.054519653320312, -7.586158752441406, 0.000396728515625), (12.767379760742188, -14.823883056640625, 0.000396728515625), (8.153594970703125, -9.201972961425781, 0.000396728515625), (11.313179016113281, -7.513145446777344, 0.000396728515625), (13.424346923828125, -14.472724914550781, 0.000396728515625), (7.802436828613281, -9.85894775390625, 0.000396728515625), (14.00018310546875, -14.000144958496094, 0.000396728515625), (7.5861968994140625, -10.571800231933594, 0.000396728515625), (14.472763061523438, -13.424308776855469, 0.000396728515625), (7.51318359375, -11.313140869140625, 0.000396728515625), (14.823921203613281, -12.767333984375, 0.000396728515625), (7.5861968994140625, -12.054489135742188, 0.000396728515625), (15.0401611328125, -12.054481506347656, 0.000396728515625), (7.802436828613281, -12.767341613769531, 0.000396728515625), (15.113174438476562, -11.313140869140625, 0.000396728515625), (8.153594970703125, -13.424308776855469, 0.000396728515625), (15.0401611328125, -10.571792602539062, 0.000396728515625), (8.626174926757812, -14.000152587890625, 0.000396728515625), (14.823921203613281, -9.858940124511719, 0.000396728515625), (9.202011108398438, -14.472724914550781, 0.000396728515625), (14.472763061523438, -9.201972961425781, 0.000396728515625), (9.858978271484375, -14.823883056640625, 0.000396728515625), (10.57183837890625, -7.586158752441406, 0.000396728515625), (14.00018310546875, -8.626136779785156, 0.000396728515625), (10.57183837890625, -15.040130615234375, 0.000396728515625), (9.858978271484375, -7.802398681640625, 0.000396728515625), (13.424339294433594, -8.153556823730469, 0.000396728515625), (11.313179016113281, -15.113143920898438, 0.000396728515625), (9.202011108398438, -8.153556823730469, 0.000396728515625), (12.767372131347656, 14.823936462402344, 0.000396728515625), (12.054519653320312, 7.586204528808594, 0.000396728515625), (8.626174926757812, 14.000198364257812, 0.000396728515625), (-1.1705436706542969, -5.8846893310546875, 0.000396728515625), (4.242645263671875, -4.24261474609375, 0.000396728515625), (-9.85894775390625, 14.823928833007812, 0.000396728515625), (-10.571796417236328, 7.586204528808594, 0.000396728515625), (-14.000144958496094, 14.000190734863281, 0.000396728515625), (-6.000003814697266, 2.288818359375e-05, 0.000396728515625), (-4.988822937011719, -3.3333969116210938, 0.000396728515625), (-4.988822937011719, 3.3334503173828125, 0.000396728515625), (4.9888153076171875, -3.3333892822265625, 0.000396728515625), (-9.858955383300781, -7.802398681640625, 0.000396728515625), (-2.2961044311523438, -5.543251037597656, 0.000396728515625), (-10.571800231933594, -15.040130615234375, 0.000396728515625), (-14.000152587890625, -8.626136779785156, 0.000396728515625), (4.9888153076171875, 3.3334503173828125, 0.000396728515625), (-1.1705474853515625, 5.884735107421875, 0.000396728515625), (1.1705322265625, 5.884735107421875, 0.000396728515625), (3.3334197998046875, -4.988792419433594, 0.000396728515625), (-5.543281555175781, -2.2960739135742188, 0.000396728515625), (5.54327392578125, 2.2961349487304688, 0.000396728515625), (-2.2961044311523438, 5.543304443359375, 0.000396728515625), (12.767372131347656, -7.802398681640625, 0.000396728515625), (12.054519653320312, -15.040130615234375, 0.000396728515625), (8.626174926757812, -8.626136779785156, 0.000396728515625), (5.54327392578125, -2.2960739135742188, 0.000396728515625), (2.2960891723632812, 5.543304443359375, 0.000396728515625), (-5.884712219238281, -1.1705169677734375, 0.000396728515625), (13.488861083984375, 16.000022888183594, 0.000396728515625), (16.000015258789062, 13.488868713378906, 0.000396728515625), (13.488861083984375, -15.999977111816406, 0.000396728515625), (16.000015258789062, -13.488815307617188, 0.000396728515625), (-13.48883056640625, -15.999977111816406, 0.000396728515625), (-15.999984741210938, -13.488815307617188, 0.000396728515625), (-13.48883056640625, 16.000022888183594, 0.000396728515625), (-15.999984741210938, 13.488868713378906, 0.000396728515625)]
faces = [[97, 94, 91, 72, 69, 143, 95, 92, 89, 87, 85, 83, 81, 79, 77, 75, 73, 70, 145, 96, 93, 90, 88, 86, 84, 82, 80, 78, 76, 74, 71, 146], [33, 30, 27, 8, 5, 131, 31, 28, 25, 23, 21, 19, 17, 15, 13, 11, 9, 6, 132, 32, 29, 26, 24, 22, 20, 18, 16, 14, 12, 10, 7, 133], [166, 167, 165, 164, 162, 163, 161, 160], [159, 139, 34, 36, 141, 4, 101, 153, 148, 35, 149, 158, 1, 98, 147, 152, 0, 68, 3, 157, 142, 135, 150, 100, 38, 67, 134, 144, 99, 2, 140, 151], [66, 63, 60, 41, 37, 136, 64, 61, 58, 56, 54, 52, 50, 48, 46, 44, 42, 39, 137, 65, 62, 59, 57, 55, 53, 51, 49, 47, 45, 43, 40, 138], [130, 127, 124, 105, 102, 154, 128, 125, 122, 120, 118, 116, 114, 112, 110, 108, 106, 103, 155, 129, 126, 123, 121, 119, 117, 115, 113, 111, 109, 107, 104, 156]]
edges = []

mesh = bpy.data.meshes.new('test_mesh')
mesh.from_pydata(verts, edges, faces)
obj = bpy.data.objects.new('test_obj', mesh)
bpy.data.collections['Defaults'].objects.link(obj)

bpy.context.view_layer.objects.active = obj
bpy.ops.object.mode_set(mode='EDIT')

me = obj.data
bm = bmesh.from_edit_mesh(me)

def get_area(elem):
    return elem.calc_area()

faces = []
for face in bm.faces:
    faces.append(face)
faces.sort(key=get_area, reverse=True)

# ?? what bmesh operators to use here to cut small faces out of large face ??

bmesh.update_edit_mesh

*** EDIT FOR TLousky ***

I couldn't find a decent way to implement this entirely using bmesh, so I ended up using bpy.ops.mesh operators as well. Should still be fairly fast even on a higher res mesh with more faces. This is more of an automation approach imitating the steps you would manually take to do this, rather than a 100% mathematical / algorithmic solution, but hey - it works :)
import bpy
import bmesh

verts = [(5.88470458984375, 1.1705703735351562, 0.000396728515625), (3.3334121704101562, 4.9888458251953125, 0.000396728515625), (-4.242645263671875, -4.24261474609375, 0.000396728515625), (5.884712219238281, -1.1705093383789062, 0.000396728515625), (-4.242645263671875, 4.242668151855469, 0.000396728515625), (12.054519653320312, 15.040176391601562, 0.000396728515625), (12.767379760742188, 7.8024444580078125, 0.000396728515625), (8.153594970703125, 13.424354553222656, 0.000396728515625), (11.313179016113281, 15.113189697265625, 0.000396728515625), (13.424346923828125, 8.153602600097656, 0.000396728515625), (7.802436828613281, 12.767387390136719, 0.000396728515625), (14.00018310546875, 8.626182556152344, 0.000396728515625), (7.5861968994140625, 12.054534912109375, 0.000396728515625), (14.472763061523438, 9.2020263671875, 0.000396728515625), (7.51318359375, 11.313186645507812, 0.000396728515625), (14.823921203613281, 9.858993530273438, 0.000396728515625), (7.5861968994140625, 10.571846008300781, 0.000396728515625), (15.0401611328125, 10.571846008300781, 0.000396728515625), (7.802436828613281, 9.858993530273438, 0.000396728515625), (15.113174438476562, 11.313194274902344, 0.000396728515625), (8.153594970703125, 9.2020263671875, 0.000396728515625), (15.0401611328125, 12.054534912109375, 0.000396728515625), (8.626174926757812, 8.626182556152344, 0.000396728515625), (14.823921203613281, 12.767387390136719, 0.000396728515625), (9.202011108398438, 8.153602600097656, 0.000396728515625), (14.472763061523438, 13.424362182617188, 0.000396728515625), (9.858978271484375, 7.8024444580078125, 0.000396728515625), (10.57183837890625, 15.040176391601562, 0.000396728515625), (14.00018310546875, 14.000198364257812, 0.000396728515625), (10.57183837890625, 7.586204528808594, 0.000396728515625), (9.858978271484375, 14.823928833007812, 0.000396728515625), (13.424346923828125, 14.4727783203125, 0.000396728515625), (11.313179016113281, 7.513191223144531, 0.000396728515625), (9.202011108398438, 14.472770690917969, 0.000396728515625), (-5.884712219238281, 1.1705703735351562, 0.000396728515625), (-3.814697265625e-06, 6.000022888183594, 0.000396728515625), (-5.543281555175781, 2.2961273193359375, 0.000396728515625), (-10.57180404663086, 15.040168762207031, 0.000396728515625), (1.1705398559570312, -5.8846893310546875, 0.000396728515625), (-9.858940124511719, 7.8024444580078125, 0.000396728515625), (-14.472724914550781, 13.424354553222656, 0.000396728515625), (-11.313140869140625, 15.113182067871094, 0.000396728515625), (-9.201972961425781, 8.153602600097656, 0.000396728515625), (-14.823883056640625, 12.767379760742188, 0.000396728515625), (-8.62613296508789, 8.626182556152344, 0.000396728515625), (-15.04012680053711, 12.054527282714844, 0.000396728515625), (-8.153556823730469, 9.202018737792969, 0.000396728515625), (-15.113143920898438, 11.313186645507812, 0.000396728515625), (-7.802398681640625, 9.858993530273438, 0.000396728515625), (-15.04012680053711, 10.57183837890625, 0.000396728515625), (-7.586158752441406, 10.571846008300781, 0.000396728515625), (-14.823883056640625, 9.858985900878906, 0.000396728515625), (-7.513141632080078, 11.313186645507812, 0.000396728515625), (-14.472724914550781, 9.202018737792969, 0.000396728515625), (-7.586158752441406, 12.054534912109375, 0.000396728515625), (-14.000144958496094, 8.626174926757812, 0.000396728515625), (-7.802398681640625, 12.767387390136719, 0.000396728515625), (-13.424308776855469, 8.153602600097656, 0.000396728515625), (-8.153556823730469, 13.424354553222656, 0.000396728515625), (-12.767337799072266, 7.8024444580078125, 0.000396728515625), (-12.054485321044922, 15.040168762207031, 0.000396728515625), (-8.626136779785156, 14.000190734863281, 0.000396728515625), (-12.054481506347656, 7.586204528808594, 0.000396728515625), (-12.767337799072266, 14.823928833007812, 0.000396728515625), (-9.201980590820312, 14.472770690917969, 0.000396728515625), (-11.313140869140625, 7.51318359375, 0.000396728515625), (-13.424308776855469, 14.472770690917969, 0.000396728515625), (0.0, -5.999977111816406, 0.000396728515625), (6.0, 3.0517578125e-05, 0.000396728515625), (-10.571807861328125, -7.586158752441406, 0.000396728515625), (-9.85894775390625, -14.823883056640625, 0.000396728515625), (-14.472732543945312, -9.201972961425781, 0.000396728515625), (-11.31314468383789, -7.513145446777344, 0.000396728515625), (-9.201976776123047, -14.472724914550781, 0.000396728515625), (-14.82388687133789, -9.85894775390625, 0.000396728515625), (-8.626136779785156, -14.000144958496094, 0.000396728515625), (-15.040130615234375, -10.571800231933594, 0.000396728515625), (-8.153556823730469, -13.424308776855469, 0.000396728515625), (-15.113143920898438, -11.313140869140625, 0.000396728515625), (-7.802402496337891, -12.767333984375, 0.000396728515625), (-15.040130615234375, -12.054489135742188, 0.000396728515625), (-7.586158752441406, -12.054481506347656, 0.000396728515625), (-14.82388687133789, -12.767341613769531, 0.000396728515625), (-7.513145446777344, -11.313140869140625, 0.000396728515625), (-14.472732543945312, -13.424308776855469, 0.000396728515625), (-7.586162567138672, -10.571792602539062, 0.000396728515625), (-14.000152587890625, -14.000152587890625, 0.000396728515625), (-7.802406311035156, -9.858940124511719, 0.000396728515625), (-13.424312591552734, -14.472724914550781, 0.000396728515625), (-8.153564453125, -9.201972961425781, 0.000396728515625), (-12.767341613769531, -14.823883056640625, 0.000396728515625), (-12.054489135742188, -7.586158752441406, 0.000396728515625), (-8.626144409179688, -8.626136779785156, 0.000396728515625), (-12.054489135742188, -15.040130615234375, 0.000396728515625), (-12.767341613769531, -7.802398681640625, 0.000396728515625), (-9.201980590820312, -8.153556823730469, 0.000396728515625), (-11.31314468383789, -15.113143920898438, 0.000396728515625), (-13.424312591552734, -8.153556823730469, 0.000396728515625), (4.2426300048828125, 4.242668151855469, 0.000396728515625), (-3.333423614501953, -4.988792419433594, 0.000396728515625), (2.2960968017578125, -5.543251037597656, 0.000396728515625), (-3.333423614501953, 4.9888458251953125, 0.000396728515625), (12.054519653320312, -7.586158752441406, 0.000396728515625), (12.767379760742188, -14.823883056640625, 0.000396728515625), (8.153594970703125, -9.201972961425781, 0.000396728515625), (11.313179016113281, -7.513145446777344, 0.000396728515625), (13.424346923828125, -14.472724914550781, 0.000396728515625), (7.802436828613281, -9.85894775390625, 0.000396728515625), (14.00018310546875, -14.000144958496094, 0.000396728515625), (7.5861968994140625, -10.571800231933594, 0.000396728515625), (14.472763061523438, -13.424308776855469, 0.000396728515625), (7.51318359375, -11.313140869140625, 0.000396728515625), (14.823921203613281, -12.767333984375, 0.000396728515625), (7.5861968994140625, -12.054489135742188, 0.000396728515625), (15.0401611328125, -12.054481506347656, 0.000396728515625), (7.802436828613281, -12.767341613769531, 0.000396728515625), (15.113174438476562, -11.313140869140625, 0.000396728515625), (8.153594970703125, -13.424308776855469, 0.000396728515625), (15.0401611328125, -10.571792602539062, 0.000396728515625), (8.626174926757812, -14.000152587890625, 0.000396728515625), (14.823921203613281, -9.858940124511719, 0.000396728515625), (9.202011108398438, -14.472724914550781, 0.000396728515625), (14.472763061523438, -9.201972961425781, 0.000396728515625), (9.858978271484375, -14.823883056640625, 0.000396728515625), (10.57183837890625, -7.586158752441406, 0.000396728515625), (14.00018310546875, -8.626136779785156, 0.000396728515625), (10.57183837890625, -15.040130615234375, 0.000396728515625), (9.858978271484375, -7.802398681640625, 0.000396728515625), (13.424339294433594, -8.153556823730469, 0.000396728515625), (11.313179016113281, -15.113143920898438, 0.000396728515625), (9.202011108398438, -8.153556823730469, 0.000396728515625), (12.767372131347656, 14.823936462402344, 0.000396728515625), (12.054519653320312, 7.586204528808594, 0.000396728515625), (8.626174926757812, 14.000198364257812, 0.000396728515625), (-1.1705436706542969, -5.8846893310546875, 0.000396728515625), (4.242645263671875, -4.24261474609375, 0.000396728515625), (-9.85894775390625, 14.823928833007812, 0.000396728515625), (-10.571796417236328, 7.586204528808594, 0.000396728515625), (-14.000144958496094, 14.000190734863281, 0.000396728515625), (-6.000003814697266, 2.288818359375e-05, 0.000396728515625), (-4.988822937011719, -3.3333969116210938, 0.000396728515625), (-4.988822937011719, 3.3334503173828125, 0.000396728515625), (4.9888153076171875, -3.3333892822265625, 0.000396728515625), (-9.858955383300781, -7.802398681640625, 0.000396728515625), (-2.2961044311523438, -5.543251037597656, 0.000396728515625), (-10.571800231933594, -15.040130615234375, 0.000396728515625), (-14.000152587890625, -8.626136779785156, 0.000396728515625), (4.9888153076171875, 3.3334503173828125, 0.000396728515625), (-1.1705474853515625, 5.884735107421875, 0.000396728515625), (1.1705322265625, 5.884735107421875, 0.000396728515625), (3.3334197998046875, -4.988792419433594, 0.000396728515625), (-5.543281555175781, -2.2960739135742188, 0.000396728515625), (5.54327392578125, 2.2961349487304688, 0.000396728515625), (-2.2961044311523438, 5.543304443359375, 0.000396728515625), (12.767372131347656, -7.802398681640625, 0.000396728515625), (12.054519653320312, -15.040130615234375, 0.000396728515625), (8.626174926757812, -8.626136779785156, 0.000396728515625), (5.54327392578125, -2.2960739135742188, 0.000396728515625), (2.2960891723632812, 5.543304443359375, 0.000396728515625), (-5.884712219238281, -1.1705169677734375, 0.000396728515625), (13.488861083984375, 16.000022888183594, 0.000396728515625), (16.000015258789062, 13.488868713378906, 0.000396728515625), (13.488861083984375, -15.999977111816406, 0.000396728515625), (16.000015258789062, -13.488815307617188, 0.000396728515625), (-13.48883056640625, -15.999977111816406, 0.000396728515625), (-15.999984741210938, -13.488815307617188, 0.000396728515625), (-13.48883056640625, 16.000022888183594, 0.000396728515625), (-15.999984741210938, 13.488868713378906, 0.000396728515625)]
faces = [[97, 94, 91, 72, 69, 143, 95, 92, 89, 87, 85, 83, 81, 79, 77, 75, 73, 70, 145, 96, 93, 90, 88, 86, 84, 82, 80, 78, 76, 74, 71, 146], [33, 30, 27, 8, 5, 131, 31, 28, 25, 23, 21, 19, 17, 15, 13, 11, 9, 6, 132, 32, 29, 26, 24, 22, 20, 18, 16, 14, 12, 10, 7, 133], [166, 167, 165, 164, 162, 163, 161, 160], [159, 139, 34, 36, 141, 4, 101, 153, 148, 35, 149, 158, 1, 98, 147, 152, 0, 68, 3, 157, 142, 135, 150, 100, 38, 67, 134, 144, 99, 2, 140, 151], [66, 63, 60, 41, 37, 136, 64, 61, 58, 56, 54, 52, 50, 48, 46, 44, 42, 39, 137, 65, 62, 59, 57, 55, 53, 51, 49, 47, 45, 43, 40, 138], [130, 127, 124, 105, 102, 154, 128, 125, 122, 120, 118, 116, 114, 112, 110, 108, 106, 103, 155, 129, 126, 123, 121, 119, 117, 115, 113, 111, 109, 107, 104, 156]]
edges = []

mesh = bpy.data.meshes.new('test_mesh')
mesh.from_pydata(verts, edges, faces)
obj = bpy.data.objects.new('test_obj', mesh)
bpy.context.collection.objects.link(obj)

bpy.context.view_layer.objects.active = obj
bpy.ops.object.mode_set(mode='EDIT')

me = obj.data
bm = bmesh.from_edit_mesh(me)

faces = sorted(bm.faces, key = lambda f: f.calc_area(), reverse=True )

# Deselect large face and select hole-faces
faces[0].select = False
for f in faces[1:]:
    f.select = True

bm.select_flush(False)

# Translate selected faces slightly above, extrude and select linked
bmesh.ops.translate(
    bm,
    verts = [ v for f in faces[1:] for v in f.verts ],
    vec   = (0.0, 0.0, 1)
)

bmesh.update_edit_mesh(me)
bpy.ops.mesh.extrude_faces_move(
    MESH_OT_extrude_faces_indiv = {"mirror":False},
    TRANSFORM_OT_shrink_fatten  = {"value":2}
)

# Expand selection to include extruded faces
bpy.ops.mesh.select_more()

# Perform boolean intersection to cut new geometry from main face
bpy.ops.mesh.intersect_boolean()

Unfortunately this didn't seem to work in the main script. (See the video I added to my question) I could probably figure out why, but the real problem is it increases the time per 'MOUSEMOVE' by a factor of 20-40... Not so bad on that one part but horrible for something with 10 or more parts  But I'm giving it a up-vote because I did learn some things from your answer, so thanks

For completeness, I have since found the solution to my problem, which is not really related to the question.... Using bmesh.ops.triangle_fill using the edges collected from the bmesh.ops.bisect_plane method I'm using has solved this for me. Wish I had of known what to ask originally


text:
Adding items to VIEW3D_HT_tool_header **after** existing settings/tools
I know how to append and prepend any draw items or operators to the tool_header section:
def draw_test(self, context):
    """Draw in tool_header test"""
    layout = self.layout
    column = layout.column()
    column.label(text="Test me")

bpy.types.VIEW3D_HT_tool_header.prepend(draw_test)

But I would like to draw my items after any existing items, or even completely overwrite the tool_header while my operator is running modal:

I'm struggling to figure this out

https://blender.stackexchange.com/questions/255025/python-how-to-add-menu-in-view3d-ht-header

@scurest Adding to an existing menu is easy enough in the HEADER, but the menus in TOOL_HEADER keep changing with what tool you have selected which makes this method much more difficult. I've been looking at the CAD Transform addon which adds it's settings to the tool_header but it seems that it does this only because it's a tool registered in the tool bar. I'd like to add, or even completely overwrite the tool_header when my operator is called and running modal


text:
Status bar text is converted to icons
5 years ago I asked this question:
status-bar-icons
I still haven't found a way to get the in-built Blender icons into the status bar to display the various operator key modifiers while running modal.
Today I came across this post in a feature request:
Writing guideline for the status bar text
What caught my eye was the last comment by a dev before he closed it:

Probably not needed now that the status texts are being converted to
icons.

Does anyone know what this means and how it works?
The docs make no mention on this, well not that I can find...
I've tried a few things but nothing is creating an icon:
'MOUSE_LMB'
"MOUSE_LMB"
\'MOUSE_LMB\'

It's not exposed to API yet. Operators can't define their own status bar keys

@nickberckley, any idea what the dev was talking about then?


text:
How to copy a few faces from one bmesh to another
I have a function that returns several faces from a mesh using ray_cast under the mouse pointer. Some surrounding faces are collected based on the angle from the hit face and passed to another function, most of this is done in bmesh.
In this function I want to copy the passed faces to a new bmesh to create a new object from them.
The best way I've found is to pass in the original bmesh with the faces I want to copy, iterate over it and append the new faces to a list:
def make_copy(self, context, bm_orig, faces_linked):
    # this gets called with bm_orig as the original bmesh in its entirety of type BMesh,
    # and faces_linked as the faces of that bmesh that I want to copy to a new bmesh as a list of type BMFace

    bm_copy = bm_orig.copy()
    faces_linked_copy = []
    for face_orig in faces_linked:
        for face_copy in bm_copy.faces:
            if face_orig.index == face_copy.index:
                faces_linked_copy.append(face_copy)

    # then this makes a list of all the faces, checks them against the
    # list of faces I wan to keep (faces_linked_copy) and removes the rest from the list
    delete_list = []
    for face in bm_copy.faces:
        delete_list.append(face)

    for face_delete in bm_copy.faces:
        for face_save in faces_linked_copy:
            if face_delete == face_save:
                delete_list.remove(face_save)

    # finally using delete_list to remove all the faces I don't want
    bmesh.ops.delete(bm_copy, geom=delete_list, context="FACES")

From this I can delete all other faces in bm_copy and be left with the faces I need.
This works but it's extremely slow when operating on dense meshes.
This needs to happen every mouse move in a modal so with denser meshes this becomes unusable.
I've tried using bmesh.ops.duplicate with the dest=bm_new option but this always gives keyword "dest" type 4 not working yet! which it has done forever... (Am I doing something wrong with that?? or will they simply never implement it??)
Question is:
Is there a better way to copy some faces from one bmesh to another without having to copy and iterate over the original??
EDIT
@lemon since you were curious as to what this was for, it does this:

Collects the faces, then makes the blue faces from it.
But now seeing it work I probably wont use it this way
But I have learned some things, so thanks again for your help

could you add more details or provide a test case? specially, if face_copy.index is lower than len(bm_place.faces), you'll find the copy with bm_plane.faces[face_orig.index].

@lemon I've updated the code in the question, hope this makes it clearer. There was a typo with bm_plane.faces as well. The main question: Is there a better way to copy some faces from one bmesh to another? A more built-in way? Or some way that doesn't require iterating over the enire mesh, as there could be 100K faces and this happens every mouse move in a modal

Two parts in this answer but I lake of context (so please use comments if not clear or not appropriated).
Your code optimisation, which mainly avoids loops and inner loops.
def make_copy(self, context, bm_orig, faces_linked):

    # creates a copy
    bm_copy = bm_orig.copy()

    # gets a set of face indices for fast access
    to_keep_indices = set(f.index for f in faces_linked)

    # creates the list of the faces to delete
    delete_list = [f for f in bm_copy.faces \
        if f.index not in to_keep_indices]

    # deletes
    bmesh.ops.delete(bm_copy, geom=delete_list, context="FACES")

    return bm_copy

A proposal that avoids to create a bmesh copy of a potential big bmesh.
def from_faces_linked(self, context, bm_orig, faces_linked):

    # set gets unique elements, list gets ordered elements
    vertices = list(set(v for f in faces_linked for v in f.verts))

    # establishes a map between the new mesh vertex indices and
    # actual mesh vertex indices
    vmap = dict()
    for i, vert in enumerate(vertices):
        vmap[vert.index] = i

    coordinates = [v.co for v in vertices]

    # build faces with new indices
    faces = []
    for face in faces_linked:
        faces.append([vmap[v.index] for v in face.verts])

    # create a mesh from that
    mesh = bpy.data.meshes.new(name="copy")
    mesh.from_pydata(coordinates, [], faces)

    # and a bmesh from this mesh
    bm = bmesh.new()
    bm.from_mesh(mesh)

    bpy.data.meshes.remove(mesh)

    return bm

Thanks a heap @lemon! That 2nd method is exactly what I was looking for! I'd tried to go down the from_pydata route but couldn't quite get it to work properly.... and it was far more complex than your version. You've taught me quite a lot today!

I've added a little video to my question with your working code as you wanted a use case for it. I miss a lot of tools from the CAD world so I'm trying to recreate them

@Psyonic, thanks a lot for this feedback. That seems to be a cool addon!

Thanks mate, and thanks again for your help. It's actually just fun to use


text:
Create normal along edge length
Using the bmesh module, I have an edge extracted from other bmesh ops. I'm trying to use the distance_point_to_plane utility to find the distance from another point, parallel to this edge to an infinite plane residing on one of it's verts.
The only data I have is the 2 verts of this edge. I'm Using one of the vert.co for plane_co but I'm struggling to understand how to create the plane_no normal.
The normal of the plane needs to face along the length of the edge, same as the Y axis is facing in this image:

The plane_co would be the vert on the right.
How do I determine the normal along the length of the edge to use as plane_no given only the 2 vert.co vectors?

Can you provide us with a simple drawing of what you are actually trying to do? This is quite confusing. Are you trying to create a plane at one of the two vertices that has its normal facing in the direction of the edge?

@JiříHonzák I'm not creating anything, I'm simply trying to figure out what the normal vector should be when using https://docs.blender.org/api/current/mathutils.geometry.html#mathutils.geometry.distance_point_to_plane

I want the plane_no variable when using https://docs.blender.org/api/current/mathutils.geometry.html#mathutils.geometry.distance_point_to_plane to align with the edge along it's length

Not sure whether I understand correctly what you are trying to achieve. To get a directional vector from two position vectors you simply subtract them.
Let's say you have a point A (3,4,0) and point B (-5,2,1).
Now you want you directional vector to start from A and go to point B.
The directional vector AB-> is (-5,2,1) - (3,4,0) = (-8, -2, 1)
This will create a normal vector that goes along the curve. If you have a plane at one of the two edge vertices, it's always gonna be perpendicula to the edge

Thanks, this is what I was doing but wasn't sure it was right. I'm getting strange results sometimes. Must be a problem elsewhere


text:
region_3d.view_distance not updating until next modal event
The code below runs a modal operator that gets the region_3d.view_distance and prints it out. If you run it you'll notice that the view_distance does not update until the next modal event is detected. It's particularly noticeable when doing 'WHEELUPMOUSE' or 'WHEELDOWNMOUSE' a few times, then a 'MOUSEMOVE'.
You should see 2 'WHEELUPMOUSE' before the first view_distance, and then a last view_distance after moving the mouse slightly.
Is this because the event precedes the action? Is the action (in this case Blender zooming the viewport) only processed by Blender after return {'PASS_THROUGH'}?
If so, how can I get region_3d.view_distance AFTER the viewport has updated and therefor region_3d.view_distance reflects the true view_distance, but during the current model event so I can run other functions that require it?
My goal is to have an object remain the same "on screen" size in the viewport regardless of the zoom level, which works great, it just lags one modal event behind.
import bpy
from bpy.types import Operator

class VIEW_OT_TestModal(Operator):
    bl_idname = "view.test_modal"
    bl_label = "Test Modal"
    bl_description = "Test modal events"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {"BLOCKING"}

    def invoke(self, context, event):
        self.view_distance_last = context.area.spaces.active.region_3d.view_distance
        context.window_manager.modal_handler_add(self)
        return {"RUNNING_MODAL"}

    def modal(self, context, event):

        if event.type == "MOUSEMOVE" or event.type == "WHEELUPMOUSE" or event.type == "WHEELDOWNMOUSE":
            if event.mouse_prev_x != event.mouse_x or event.mouse_prev_y != event.mouse_y:
                print("MOUSEMOVE")
            elif event.type == "WHEELUPMOUSE":
                print("WHEELUPMOUSE")
            elif event.type == "WHEELDOWNMOUSE":
                print("WHEELDOWNMOUSE")

            view_distance = context.area.spaces.active.region_3d.view_distance
            if view_distance != self.view_distance_last:
                print("view_distance", view_distance)
            self.view_distance_last = context.area.spaces.active.region_3d.view_distance

            return {"PASS_THROUGH"}

        elif event.type == "RIGHTMOUSE":
            if event.value == "PRESS":
                return {"FINISHED"}

        return {"RUNNING_MODAL"}

def add_menu(self, context):
    self.layout.operator("view.test_modal", text="Test Modal", icon="AXIS_TOP")

def register():
    bpy.utils.register_class(VIEW_OT_TestModal)
    bpy.types.VIEW3D_MT_view.append(add_menu)

def unregister():
    bpy.utils.unregister_class(VIEW_OT_TestModal)
    bpy.types.VIEW3D_MT_view.remove(add_menu)

if __name__ == "__main__":
    register()

Blender doesn't run other default keymap modals until your modal returns something (except you run bpy.ops.()), so the value doesn't update.

import bpy
from bpy.types import Operator

class VIEW_OT_TestModal(Operator):
    bl_idname = "view.test_modal"
    bl_label = "Test Modal"
    bl_description = "Test modal events"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_options = {"BLOCKING"}

    TIMER = None

    def push_modal(self):
        if self.__class__.TIMER is None:
            wm = bpy.context.window_manager
            self.__class__.TIMER = wm.event_timer_add(0, window=bpy.context.window)
    def kill_timer(self):
        if self.__class__.TIMER is not None:
            bpy.context.window_manager.event_timer_remove(self.__class__.TIMER)
            self.__class__.TIMER = None
    def upd_view_distance(self):
        view_distance = bpy.context.area.spaces.active.region_3d.view_distance
        if view_distance != self.view_distance_last:
            print("view_distance", view_distance)
            self.view_distance_last = view_distance

    def invoke(self, context, event):
        self.view_distance_last = context.area.spaces.active.region_3d.view_distance
        context.window_manager.modal_handler_add(self)
        return {"RUNNING_MODAL"}

    def modal(self, context, event):
        if event.type == 'TIMER':
            self.kill_timer()
            self.upd_view_distance()
            return {"RUNNING_MODAL"}

        if event.type in {"WHEELUPMOUSE", "WHEELDOWNMOUSE"}:
            print("mouse wheel")
            self.push_modal()
            return {'PASS_THROUGH'}

        self.upd_view_distance()

        if event.type == "RIGHTMOUSE":
            if event.value == "PRESS":
                return {"FINISHED"}

        return {"RUNNING_MODAL"}

def add_menu(self, context):
    self.layout.operator("view.test_modal", text="Test Modal", icon="AXIS_TOP")

def register():
    bpy.utils.register_class(VIEW_OT_TestModal)
    bpy.types.VIEW3D_MT_view.append(add_menu)

def unregister():
    bpy.utils.unregister_class(VIEW_OT_TestModal)
    bpy.types.VIEW3D_MT_view.remove(add_menu)

if __name__ == "__main__":
    register()

So... this creates a TIMER, then when it elapses (if event.type == 'TIMER':) it removes itself and updates view_distance? Then creates a new TIMER on the next mouse event? Right?
I think it's the if event.type == 'TIMER': that I'm unsure of. This event occurs when the TIMER elapses?

Thread only runs when it has mouse/keyboard input events except it has timer events. So add a timer it can keep the Thread looping even without mouse/keyboard event.

Occasionally when I mess up some code, I think a timer is left running. This leads to a CPU core running at 100% and Blender crashing after a while (I guess it overflows) I can't seem to find where timers stored using the python console so I can remove it. It looks like it should be in D.window_managers['WinMan'] somewhere but I can't find it. Do you know how I can remove a running timer from the python console?

If you need to remove the timer, you need to know the timer location. In above script, you can get the timer from VIEW_OT_TestModal.TIMER. I'm not sure if there is a way to access all running timers, so remember to remove the timers before the modal finishes.

I am removing the timer in the code, but if I have a bug in my code and it crashes at some point the timer remains in the background. Thanks for your help, I've learned a thing or 3


text:
Camera position from FBX to Blender
I'm trying to import a scene originally made (by someone else) in C4D and exported in FBX.
Everything seems ok, except for the position and settings of the camera.
I've noticed that if I import the same FBX in Substance Painter, the camera is set correctly (so I suppose the problem is Blender's interpretation).
Does anyone know how may I solve the issue?

How exactly is the position wrong ? Might be just a factor of 10, or a unit translation problem (imperial / metric)

It's facing the opposite side of the scene. I tried to rotate it 180degrees, but it's not reflecting the intended position, and the zoom level seems wrong too (not sure about the latter though).

I think simply rotation the camera 180 degrees would make it upside down. Try this: Put the 3D cursor on the world origin (0,0,0), set the pivot point to 3D cursor and then scale the camera -1 on the appropriate axis.


text:
How to Bisect a mesh into two parts but filling both halves?
First of all, thanks to everyone for the effort needed to create this phenomenal app,  maintenance it and answering questions.
How to Bisect a mesh into two parts but filling both halves?
I try to split Mesh Into two Parts but only one part get filled.
I use Bisect tool with fill option checked then:
select ->Select Loops ->Select Loop Inner-Region (select bigger),
then Mesh -> Seperate -> Section.
In the end I get two parts of which only one is filled (bigger one).
I know that I can create a face manually, but the problem is that I have a very complex mesh and it will take me days to fill it in manually with my current knowledge in Blender (select edge->fill)
is there any simpler or automated way to do it in Blender 2.92.0?

Have you considered selecting edge loops?

You can duplicate your mesh and use a boolean modifier with a cube that intersects your object where you want to cut it. Then you set the boolean modifier to difference on one copy and intersection on another.

@ZargulTheWizard: In some cases this tool doesn't work as expected.

Drop us the screenshot of this mesh.

Related https://blender.stackexchange.com/a/133136/15543

Bisect
doesn't have this feature (hard to say why). The work around can be - duplicate object, do bisect with option Clear Inner, write Plane Point and Plane Normals values from Properties panel somewhere (or automate with python). Than to bisect duplicated object as Clear Outer with the same bisect's plane values.
Copy&paste Scripting
Instead of rewriting bisect's plane values manually you can copy&paste all values at once into text editor to automate this process, reuse again or use with another object.

First Duplicate your object and bisect original.

Switch to Scripting Layout and in Text Editor create a New text file, type import bpy, it will call python.

Than right-click Bisect Tool icon (in Tool Shelf) and choose Copy Python Command ...

... and paste command on second line.

Lastly go to Info Editor and copy bisect's plane values (whole line of setup) ...

... and paste it on the third line. Result should look like this ... just change clear_inner to clear_outer in text. With all vertices selected of duplicated object, Run script Alt+P.

Like that you have under one click action  that can be repeated any time ... or you can duplicate text file and change some parameters, like to have one script for inner and second for outer bisect or to have a cut in horizontal direction and other one in vertical.

It's a mystery to me why this isn't an option. As far as the UI is concerned, it's not even an extra. A duped face would be  the entirely appropriate behaviour for  'Fill' checked, without any clearance. Right-Click-Select post coming up, I think.

Right ... even more ... I just noticed bisect is not split into a two parts ... that is what I would expect with Fill option (splitted and filled on both sides) Who would wanted to have a filled face inside a mesh?

..which is redundancy, with the Knife tool...

Thank you @vklidu for this detailed explanation and on your time. Method Bisect – Scripting  works perfectly. It is especially useful since my Mesh has to be cut into several pieces

It's hard to say how complex your object is ... so if Loop selection Alt+Shift or Box/Circle selection is not working for you to easily Fill ... in some cases you can try ...
Boolean
... but it can fail for very complex meshes.
To split object in one go ... you can add Plane object  with Solidify modifier, Thickness like 0.001 (1mm) as cutter ...

For object to be cut add Boolean modifier, Object > Plane ...

... Apply Ctrl+A modifier, select and Separate P half of the object.

Of course if you don't care for this 1 mm gap between parts :)

I'd like to add another way of doing this - vertex groups. I did this in Blender 3.1,it should however be possible to do it in 2.93 as well according the the manual.
After making the cut with the bisect tool, but before separating the meshes, add the still selected vertices to a vertex group. Don't forget to select fill in the bisect widget!

Afterwards, continue like in the question:

Select -> Select Loops -> Select Loop Inner-Region
Mesh -> Seperate -> Section

Now that you have two objects, select the one with the missing face. Go back into the vertex groups, select the group you just created and click "Select". The same vertices that were just cut should be selected and pressing F (New Face from Vertices) and you're done.


text:
Simple python code does not work
Not sure why this simple code does not work. I tried several things... but it only works if the values are statics . In this example I put one dinamic value (does not work) and another that works but is burned.
Code:
import bpy

#create prop_group
props = {
    "name" : [],
    "type" : [],
}

#add props
props["name"].append( "fl_prop" )
props["type"].append( "float" )

print("---" )
class CustomPropGr(bpy.types.PropertyGroup):

    global props

    for name in props[ "name"] :
        for type in props[ "type" ] :

            if type == "float" :
                print("debug:: name : ", name, " type: " ,type )
                name : bpy.props.FloatProperty( name = name )
            # end if

        # end for
    # end for

    no_dinamic_prop : bpy.props.FloatProperty( name = "test" )

# end CustomPropGr
bpy.utils.register_class( CustomPropGr )

#make it enable and discovery for all objects
bpy.types.Object.custom_prop_gr = bpy.props.PointerProperty(type=CustomPropGr)

so = bpy.context.active_object

so.custom_prop_gr.no_dinamic_prop = 5.90
so.custom_prop_gr.fl_prop         = 90.5
print( "no_dinamic_prop    : ", so.custom_prop_gr.no_dinamic_prop )
#comment the below line to see the outputs
print( "dina prop (fl_prop): ", so.custom_prop_gr.fl_prop )
print("---" )

Use Python's type method for dynamic props
Recommend using python's type for dynamically creating classes.
Here is an example.

Set up two float properties "foo" and "bar" in our props dictionary.  Both are given "float" as a type. Have converted to bpy prop by simply making it title case "Float" and tacking "Property" to the end, then grabbing that type via get attribute from bpy.props.

For the non dynamic members have set up some class to define these.

Then using type create a class, give it the name we wish to define, the inherited classes, lastly PropertyGroup.

Finally The annotations, ie our dynamic props are added in the last argument.

Test script.
import bpy
from bpy.props import (
        PointerProperty,
        FloatProperty,
        )
from bpy.types import PropertyGroup

props = {"foo" : "float",
         "bar" : "float",
         }

class NonDynamic:
    test : FloatProperty(name="Bar")

Group = type(
        "CustomPropGr",
        (NonDynamic, PropertyGroup,),
        {'__annotations__' :
            {

                k : getattr(bpy.props, f"{v.title()}Property")(name=k)
                for k, v in props.items()
            }
        }
    )

bpy.utils.register_class(Group)

bpy.types.Object.foobar = PointerProperty(type=Group)

Test run python console.
>>> C.object
bpy.data.objects['Cube']

>>> C.object.foobar
bpy.data.objects['Cube'].foobar

>>> str(C.object.foobar)
'<bpy_struct, CustomPropGr("") at 0x7f5b1a793f68>'

>>> C.object.foobar.foo
0.0

>>> C.object.foobar.bar
0.0

>>> C.object.foobar.test
0.0

Notes: can see from this can extend this quite simply to create a method that dynamically creates classes. I often use this to create AddonPreferences class from the addons  underlying modules.
Have used a dictionary instead of the two separate lists for name and type, if using the two lists suggest using zip
for k, v in zip(props["name"], props["type"]):
    ...

Related:
Blender 2.8 - Field property declaration and dynamic class creation

I can't read some little thinks of the code... Why the for is down and not in top? what is "annotations" and... in what moment you put the name foobar ? how i can change it?  zip is very usefull !!! and the dictionary is better aproach. Thanks friend!

import bpy
class Class (bpy.types.PropertyGroup) :
non_dinamic : bpy.props.FloatProperty()
props = {
"dinamic1" : "Float",
"dinamic2" : "Float" }
setattr( Class, "other_non" , bpy.props.FloatProperty() )
#this for ask for annotation
for k, v in props.items() :
print("key:", k, "value", v )
setattr( Class, k , bpy.props.FloatProperty() )
bpy.utils.register_class ( Class )
bpy.types.Object.propgr = bpy.props.PointerProperty( type = Class )
so = bpy.context.active_object
so.propgr.non_dinamic = 15.5
so.propgr.dinamic1 = 90.5
print("done")

Another aproach using what I understand of your code. It work... but with the warning.

#illegal target for annotations :
"annotations" : setattr( Class, "other_non_dinamic" , bpy.props.FloatProperty() )

Class.annotations[k] = bpy.props.FloatProperty()   That work with no warning.

name : bpy.props.FloatProperty( name = name )

is assigning bpy.props.FloatProperty( name = name ) to the variable called name ( the name before the : )
Then you try to assign a value to so.custom_prop_gr.fl_prop which does not exist, because you used the variable name to create the custom property.
Then in your print command at the end:
print( "dina prop (fl_prop): ", so.custom_prop_gr.fl_prop )

is also trying to call so.custom_prop_gr.fl_prop which does not exist.
Change:
so.custom_prop_gr.fl_prop         = 90.5
print( "dina prop (fl_prop): ", so.custom_prop_gr.fl_prop )

to:
so.custom_prop_gr.name         = 90.5
print( "dina prop (fl_prop): ", so.custom_prop_gr.name )

Try to change:   name : bpy.props.FloatProperty() for a dinamic name not work for me.    f"{name}" : FloatProperty or something like that can't get it work. However help me a lot for discovery what it happen. Thanks.


text:
The bones don't attach to the mesh
I created this "astronauta", I created an armature and attached it with the "automatic height" function but the mesh doesn't move when I enter pose mode.
image
https://i.sstatic.net/vAr9L.png
this is the file
https://drive.google.com/file/d/1KRDiIxtDg7ZsqUJI5yvIXwdaAWklGU-k/view?usp=sharing

Many bones don't have their "deform" option enalbled, and the armature is child of the mesh, while it should be the inverse.
To solve:
Select the armature and press Alt P (unparent, keep transformations).
In pose mode, select all bones, press the ALT button and while pressing Alt click on the deform bone option.
Then  in object mode select the mesh (first), shift select the armature, press Ctrl P, with automatic weights.

Thanks for the ALT trick. I didn't know you could toggle Deform for multiple bones at once this way.

The ALT trick works for a lot of functions when more than one object are selected!

still not working ,this is the new link: https://drive.google.com/file/d/1KRDiIxtDg7ZsqUJI5yvIXwdaAWklGU-k/view?usp=sharing


text:
Particles not going down - Z Axis problem offset
I am trying to solve a particle direction problem, don´t know what I did but its not going down, I saved it and the next day this happened:
it's not going down in the Z axis, it was looking like the first image:

Is there something I did wrong?

I had a wind force too strong.


text:
weird yellow artefacts when baking normals
does anyone know why this is happening to me ?
i tried normals outside, didnt help.
Edit: edited caps, and added photos, sorry new to these boards, thanks in advance :)

Don't use caps please, you can [edit] the question, also upload images inline here as the question totally depends on it. Yellow on normal map usually means intersecting geometry - rays from one surface get to near surface and vice versa

well found an answer in this video:
https://www.youtube.com/watch?v=0r-cGjVKvGw


text:
Thinking of a book cover material
How can I make a more realistic book cover shader?

Link to texture: https://i.sstatic.net/nXzTw.jpg

This is a rather artistic question and it would be better placed on a platform like blenderartists.org. Anyway, improving realism is done by adding many small details with textures and avoiding sharp edges.

The nodes are not readable in the provided screenshot. Could you add a close up of the nodes?


text:
Error message when trying to open blender
I have downloaded blender but an error comes up ...can't detect 3d graphics card...blender requires card with open GL 2.1
How do I get this driver?...I am on windows 10
Thanks

Please add details about your graphic card brand/model

Mobile Intel(R) 4 Series Express Chipset Family (Microsoft Corporation - WDDM 1.1)
SAMSUNG RV510 LAPTOP  WINDOWS 10........HELP!!  Thanks

https://www.khronos.org/opengl/wiki/Getting_Started#Downloading_OpenGL
In the contents, it has 2. Downloading OpenGL
The link varies by Operating System
Read your Graphics Card Vendor notes about openGL support.
For instance, NVIDIA has notes about openGL support here:
https://developer.nvidia.com/opengl-driver
Hope that helps.


text:
Strange artefacts when using Decimate modifier
While using a decimate modifier, I get these weird shading artifacts:

I have managed to narrow it down to the Decimate Modifier causing the problem.

What is causing this weird shading?
How can I avoid it / how to fix it?
How can I keep the low poly count without doing it manually?

Subsurf followed by decimate doesn't seem like a good idea to me. Anyhow, these artifacts can have multiple causes. Try recalculating the normals after applying the modifier (CTRL + N in edit mode, with everything selected) or removing doubles from the mesh.

@IAmGettingTiredOfAliases I have tried that before and tried it again, and it still leaves me with the artefacts. I have a subsurf because my original mesh is low poly, and then I want to smooth it, so the decimate is meant to reduce that new poly count.

This probably pins it down to a problem in topology. In that case you could go and try to reducde the (inevitable) horrible geometry left by the decimate modifier yourself. I'm assuming that it's caused by NGons which really don't like the way they're being bent, I am not completely sure to be honest. I'd greatly appreciate it if you could upload the file for me to tinker with!

@IAmGettingTiredOfAliases I was just fixing it now. It didn't have and ngons, it was a warped grid because I was using the ANT landscape add-on. I am just applying "dissolve vertices" on every point where the issue occurs and it is fixing the problem.

Alright! Glad you could get it fixed, good luck with your project!

@IAmGettingTiredOfAliases Thank you so much! :)

The fix was actually very simple, and I did not need to remove the Decimate modifier. All you need to do is just x> "dissolve vertices" in Edit mode on every point where the issue occurs and it will fix the problem.

I had a similar issue that I can only guess was caused by un-normalized normals. When drawing them they were pointing in the right direction but lighting was clearly broken. The fix for me was in edit mode:
Mesh -> Normals -> Average -> Corner Angle


text:
Combine separate armatures
On the right side under scene I have a couple different armatures like
armature.001 and armature.002 and bone. I was wondering how I make these all one object
I'm trying to parent bone 4 to the neck bone but it wont work. I'm guessing because of these separate armatures.

See the answer to the linked question, your problem seems like a simpler case of the same thing (joining rigs/armatures)

All you have to do is select one armature, shift select the other one, and then press Ctrl+J to join them.
Then shift select the two meshes that go with the armatures, and join them too.
Then all you have to do is select the mesh, shift select the armature, and press Ctrl+P. Then select the armature deform option.


text:
How to round the edges of a mesh with small faces?
I'm trying to round the edges on the top of this model.

Inner (90˚) edge is easy – I can just apply a bevel modifier and limit by angle. I'm having trouble with the outer edge. The bevel modifier either does nothing or makes a mess because the faces near that edge are too small. I've messed around for a few hours and have tried using the sculpting tools, but they don't work well because of only having two faces on the top. I tried selecting all the vertices near the edge and scaling them in towards the center, but it doesn't look good and will take a really long time to get a good result. I also tried doing some boolean stuff with a torus to cut off the sharp edge, but I couldn't get it to look right.
I found this post that addresses almost the exact same problem, but the solution given would ruin the soccer ball look of the model and seems to only be a visual solution. I plan on 3D printing this (soccer ball napkin rings), so the model itself actually needs rounded edges. How can I do this?
I created this model by loosely following this tutorial then using two boolean modifiers with a cylinder and a rectangular prism. Do I need to somehow model this in a different way to be able to round the edges?
.blend file
[edit]
Selecting the very top outside edges and using proportional editing (sharp mode) to scale them inwards starts to do what I want but the resulting curve is lopsided and not a proper bevel.

This is what I'm looking for (except with the soccer ball pattern)

I took a look at this but honestly stuggled to find a good solution.

This was the best I could come up with given the starting point. If this is what you are looking for then I can reproduce the steps. Let me know. Maybe others have different ideas.

Thanks for the attempt! I ended up redoing the model in Fusion 360, which made the edge beveling much easier due to the way it handles 3D objects. If you feel like it, maybe explaining generally what you did or your approach to the problem might help other Blender noobs like me who may stumble across this post in the future. :)


text:
Subsurface making different shape to the mesh
I have made a crack shape mesh. I want to make that crack wrap around the sphere. I Need to add subsurface modifier a curve and shrinkwrap modifier. The problem is getting when i add subsurface modifier the surface getting odd shape from the original. Any suggestion or help Thanks

Original Shape

After adding subsurface modifier

try not using ngons: eg, convert all faces to triangles.

@m.ardito Great Thanks it work. Going to next step to shrinkwrap with the curve

@m.ardito making the triangles faces it work can u make it as a answer Thanks

you could answer yourself, so you can put the result, and explain others what you did...


text:
How to trim the mesh
I have the stars above and below half circle. I want to trim the half circle shape as mark in red color. I have used the boolean modifier but its not working. I have remove all doubles and flip normal yet no result. Any help

Apply Rotation and Scale to both the Star and Circle object.

Then try using the Boolean modifier again.


text:
Duplication not getting in shape its in reverse direction
Im making duplication. Problem is the shape is getting duplication but the shape is reverse as its getting to the other end. Another problem is that its not going flat way. At the end its getting tilted one side. I have applied scale+rotation+location to both curve and the mesh. Whats going wrong.

Possible duplicate of Object on curve wont stay flat!

@atek duplication is not mirroring... the "red" side is perfectly legit imho, it just follows the curve... if you want your duplication to be mirrored along globalX, use half curve and then set up mirror on global X

@DuarteFarrajotaRamos the duplicate link give is different the mesh is changing its shape and its getting tilt upward also. can u give solution for my mesh thanks

Have you tried that solution? What happened when you did? Also make your curve 2D

@m.ardito i never said i need mirror. I said that the object is not turning to its shape its going wrong direction as marked in green and red

@atek: what you are saying you want IS mirroring. Your shape starts following the curve (as parent) from right to left, and thus it points in that direction too. Then, your curve points backwards (left to right) and your shape still follows the curve (it couldn't do differently) and thus it points "opposite" respect to your expectation, but it's perfectly normal: it just follows the curve. You could use only the bottom part of the curve ("green" part) and then mirror all (curve and your shape following it) on X global axis.

@m.ardito thanks but why the below answer section disappeared

@atek? I didn't add (or delete) any answer... maybe others? who knows. Do you need an example posted as answer?

@m.ardito yeah if possible with gif file . How it works for you all and not for me. Maybe something im missing from 1st i mean adding the curve and making it dupliframe. One thing im getting problem when i click object and curve and hit ctrl+p and object the mesh goes other way not in this question. How to solve that. Thanks

can you show a reference of what you're trying to achieve?


text:
How to add modifier to group instances
How can i add modifier for a group instances. I have a group of object (cube, sphere, cylinder) and made a group. With shift+A > Group instance and added the group. I want that group instance to be added array modifier & curve modifier.

I cannot apply array modifier and if i want to make the duplication frame i get only the empty not the objects.

Actually i want my file to be light not to be heavy adding many objects.

possible duplicate

@binweg its not group its group instances


text:
Why is the boolean modifier not working with my model?

I want to cut the hole with the boolean modifier but it's not working. Anyone have any ideas why?
Also, how can I trim a part from the model.

Here is my blend file:

your "cube" base object has mesh problems... booleand cannot work. It seems it was created applying a mirror modifier, but in a wron way, some face is overlapping...

so how to solve the problem? any other addon work to cut

Hi! It looks like you're asking two questions here. Could I get you to choose which of your questions you want asked on this post? One question per post is generally preferred. It just makes answering the question easier, because there isn't any confusion about what is being asked. It's also better for the indexing of the site. Feel free to post whatever question you remove from here as a separate question so that you can get an answer to that also.

I was able to fix it but it wasn't simple.

Started by removing the non-manifold face (in the middle) and manually recreating the center so that there we no interior faces.
I also used the knife tool on the one end to clean up the messed up 'mirror'. this allowed me to recreate the end shape as I believe it was desired.
Now to get to your real question, the below image is what would have happened if you were able to do the boolean modifier as presented. A 'ring' would have been cut out where your cylinder was.
I do not believe that this is what you intended and instead you meant to end up w/ something like the following:

To create this whole, your cylinder needs to NOT be a 'real' cylinder (with thin walls and an empty center) but a full cylinder. When the boolean modifier is performed, you should then be able to remove the hole as desired.

It's a common problem with Boolean operation in blender; it won't work if there's incomplete or bad geometry. The problem is, the boolean is a prime culprit for CREATING the bad geometry.
Ensure your meshes have no loose geometry, remove doubles and dissolve messy faces/unnecessary vertices. Really inspect both objects before using Booleans.
By turning on surface normal lines you can spot weird geometry a little easier, if the line isn't quite centred, something is probably wrong.
I've heard that combining the Boolean modify with a solidify modifier creates better geometry.
I've highlighted the areas of concern - there's probably more.
Lots of unnecessary vertices.
Two faces ontop of each other (pairs of blue lines)
Face normal pointing out across the surface from the vertices.

And inside the oval, you've got some faces that don't have normals, so they're a bit bonkers.. See second picture.
Everything should be neat shapes, quads or triangles preferably.
I feel for you, it's not nice when it happens.

Apart from manually dissolving bad faces, snapping unwanted vertices to existing vertices and then 'removing doubles', this post explains some of the problems with non-manifold geometry.

i have added both the object solidify modifier and with the geometry of the top cylinder is just we import a new cylinder . If u go through my file u will better know whats the problem

I just loaded it now, instantly, looking at the chair in Edit mode, I can see really bad geometry - lots of little black dots and polygons overlapping ontop of each other where I don't think they should be. You have some cleaning up to do. I've used this in the past, but can spot these problems by eye now. https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Modeling/MeshLint

@atek I've updated the answer with some images of what challenge faces you (pun intended).


text:
Inset faces individually with thickness falloff
I want create from this Voronoi cells

Structure like this(i made it by hand by Inseting Individually rows of faces with different thickness each time):
[]
I cant make it with scale tool with pivot set to "Individual origins" and proprotional falloff. This gives this result
[]
So, appreciate any advise. Thanks!

Related

Please add to your question or comment a copy of the text from the info window from the inset operation ... such as ... bpy.ops.mesh.inset(thickness=0.108428)

Direct Application of Inset via Script

Original Vertices. Inset applied. Positive Space. Negative space in large.

Have your mesh in edit mode before running Python Script.

Use at your own risk
Inspect and Improve
The inset has depth, thus positive and negative face selection is available by geometric surface normal in Blender.

Thank you, Atomicbezierslinger! Apresiate for your help. Your method is fine, but it makes overlapping geometry. Little bit better solution is to make inset with tiny thickness and then scale each interior face with bmesh.ops.scale. I tried to do this, but i dont know how to compose "space=Matrix()" for each face.  Can you help me with that?

When the Blender User performs an inset by hand the User can see an example of acceptable numbers in the Blender UI.  Archive your mesh by mesh duplication, scene duplication or other.  The numbers .08 and .08 are successful for my example.  You must determine the numbers are succesful for your example.    Reduce them by half repeatedly to you get an acceptable result.  Then fine tune the numbers to suit your case.  This is part of inspect and improve.  For example in the info window I just copied the manual inset .... as ... bpy.ops.mesh.inset(thickness=0.108428)

Please state how many months or years of experience you have with Python.  Example 1 month, 2 months, 1 year.  This way we can write in an efficient manner.  Do you feel comfortable reducing the numbers?  Please state which numbers you used by copying the line of Python code and pasting as a comment . Example. Here are the numbers that work for me.        t = .04 + (.04 * (d/zdepth))

A have experience with Python about 2 year, but it ocasionally experience. Here what i have without Python just regular inset with big thickness value(right) and inset with tiny thickness value and scaling faces individually. https://www.dropbox.com/s/kpbo9cd1qojgkrh/2017-08-13_20-32-23.png?dl=0

You could do this by converting to a curve, extruding and scaling with proportional editing, then converting back to mesh.
1) Convert to curve

2) In edit mode, select everything and set the tilt to 90°

3) Extrude the curve

4) With linear proportional editing, select a row of vertices and scale the Radius property (Alt+S)

5) Convert back to a mesh

You are following the right process.Just what you need to do is select all the faces then press I(inset).After applying inset do Ctrl+I.It will select the faces you want to delete.


text:
How to adjust image color space, drawn with builtin shader
I`m drawing image with code in this example:
Gpu Shader Module, 2D Image Example.
import bpy
import gpu
import bgl
from gpu_extras.batch import batch_for_shader

IMAGE_NAME = "Untitled"
image = bpy.data.images[IMAGE_NAME]

shader = gpu.shader.from_builtin('2D_IMAGE')
batch = batch_for_shader(
    shader, 'TRI_FAN',
    {
        "pos": ((100, 100), (200, 100), (200, 200), (100, 200)),
        "texCoord": ((0, 0), (1, 0), (1, 1), (0, 1)),
    },
)

if image.gl_load():
    raise Exception()

def draw():
    bgl.glActiveTexture(bgl.GL_TEXTURE0)
    bgl.glBindTexture(bgl.GL_TEXTURE_2D, image.bindcode)

    shader.bind()
    shader.uniform_int("image", 0)
    batch.draw(shader)

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

It looks much darker then same image drawn as camera background image or empty object.
Cant find a way to adjust its colorspace. Please help, thanks.

May be related https://docs.blender.org/api/blender2.8/bpy.types.Image.html?highlight=gl_load#bpy.types.Image.gl_load

Was trying to changle image.alpha_mode to: 'STRAIGHT', 'PREMUL', 'CHANNEL_PACKED', 'NONE'. No luck, no changes. Right now searching implementation of this constant: bgl.GL_FRAMEBUFFER_SRGB, trying to find how to use it.

Unfortunatly, bgl.glEnable(bgl.GL_FRAMEBUFFER_SRGB) works for hole screen not only for texture.

With
shader_code = gpu.shader.code_from_builtin("2D_IMAGE")
print(shader_code["vertex_shader"])
print(shader_code["fragment_shader"])

One can get code for builtin shader and modify it.
Here is mine, just 2 lines changed version:
vertex_shader = '''

    uniform mat4 ModelViewProjectionMatrix;

    in vec2 texCoord;
    in vec2 pos;
    out vec2 texCoord_interp;

    void main()
    {
      gl_Position = ModelViewProjectionMatrix * vec4(pos.xy, 0.0f, 1.0f);
      gl_Position.z = 1.0;
      texCoord_interp = texCoord;
    }

'''
fragment_shader = '''
    in vec2 texCoord_interp;
    out vec4 fragColor;

    uniform float gamma;

    uniform sampler2D image;

    void main()
    {
      fragColor = pow(texture(image, texCoord_interp), vec4(gamma));
    }

'''

shader = gpu.types.GPUShader(vertex_shader, fragment_shader)
shader.uniform_float("gamma", .454)


text:
Point lights not lighting at all; at wits end!
Fairly new to Blender here, quite excited about its capabilities, but unhappy with its quirkiness and unpredictability (to a newbie).
I have been making a tunnel to get some practice with the array and curve modifiers.
Initially, I modeled the road pavement, two sidewalks and the tunnel wall, using an array modifier followed by a curve modifier; I then edited the shape of the path curve to give the entire tunnel some non linearity.
Subsequently, I added a point light to the left side of the tunnel wall, and made it follow the path of the curve used with the tunnel, so that I had one light every few meters.These worked correctly, illuminating the scene as expected.
To model the light bulbs, I added an ico sphere near the first light, similarly made to follow the path of the curve of the tunnel, and coincide with the location of the point lights.
At that point, and as I was moving the point lights back and forth, to make sure they appear near but not inside the ico spheres, I realized that everything was rendering to complete black, none of the lights showing anymore!
I tried adding a sun outside the tunnel, and found out that it lighted the mouth of the tunnel correctly. I even moved the point lights to the center of the tunnel, to no avail. None of the lights inside the tunnel provide light anymore!
I checked the normals, they remain correctly flipped so that they point inside the tunnel.
I am literally at wits end, and look forward to some help.

... ok the previous comment was false (deleted now). The curve itself is dupliframe and this is the reason. Set the dupli to "none" for the curve.

@lemon thank you being spot on! It took me a few (newbie) minutes to understand your comment on the duplicated curve, and you are right! I had, somehow, inadvertently turned on duplication for the curve as well! Not sure why that killed the lights, but my problem is solved, and I thank you very much indeed.

@DuaneDibbley thank you very much for you suggestion on lamps & emissive materials! I had done some experiments and suspected as much, but was not sure.

@JohnParavantis, the "why": if dupliframe is used, then you need a parent object to duplicate it on. If there is nothing as parent, the duplicate is not generated... so nothing appears

Thank you very much @lemon! Since I have your attention, I would like to ask a related question (to avail of your expertise): the curve modifier used after an array modifier, appears to work well along the X axis but it goes bonkers if used along the Y direction, e.g. the dimensions of the object extended as an array along the curve are all over the place and cannot be corrected by typing in new values at the transform pane (even when resetting for scale and rotation after every change). Are there any known such problems/issues/bugs?

Wow @DuaneDibbley, thank you! Great to know!

@JohnParavantis, it is globally dependent on both arrayed object and curve global orientations. Hard to explain/develop more in the comments...

If anything else, this: When you parent an object to a curve and dupliframe it, the dimensions of the objects are reported as the "correct" dimensions of the original (single) object; this way, it is easy to make any changes. If, on the other hand, an object is duplicated via an array modifier and made to follow a curve by a curve modifier, the dimensions of the object apparently refer to the entire array, so it is difficult to change them in a meaningful fashion. This appears to be more of a problem when the curve modifier is directed towards the Y axis. My two pennies anyway.


text:
Curve after Array modifier messes object dimensions
ROAD_ARRAY_before:

ROAD_ARRAY_after:

There is no way I can make a Curve Modifier after an Array Modifier behave. Object dimensions are completely messed up, which makes the creation of an exactly scaled object impossible.
Of the two blend-files attached, in the ROAD_ARRAY_before file, you will see that I have created a Path curve (NurbsPath) of length 100 m, which I have edited so that is swerves a bit towards the negative Y axis (down, as seen in a Top Ortho view). I have also created a 10x10 m plane, which I have duplicated 10 times along the X axis using an Array Modifier. Please notice that the dimensions of the plane array are 100 m length along the X axis, and 10 m width along the Y axis.
In the other blend-file, ROAD_ARRAY_after, I have added a Curve Modifier after the Array, in order to have the arrayed plane follow the curve. As you may see (preferably in a Top Ortho view), the plane object has been deformed (arbitrarily?) to a width of 144.818 m (along the Y axis)!
(I should mention that I was careful to apply rotation and scale during all operations, so that they are set at 0 and 1 correspondingly).
Any attempts to change the dimensions of the plane array to an array of 10 m width (along the Y axis) are futile from now on, as you may confirm by trying either to change the dimensions in object mode or scale the object in edit mode. Scaling in object mode manages to reduce the width of the object to an approximate 10 m, but the reported units of the Y-axis are completely wrong.
Am I missing something, or is there a bug in the combination of Array with Curve modifiers? Similar issues appear to be reported on the web, along with assertions that the behavior of these modifiers has been corrected in current versions of Blender. Not so, as far as I can tell.
Any feedback would be greatly appreciated. Such precise dimensioning is very useful in my work (3D modeling of transportation networks, in the context of Environmental Impact Assessment).

The radius of the control points of the curve are 14. Set them to 1.

I am speechless and cannot begin to thank you enough!

As an addendum, am I correct in understanding that once the Array and Curve modifiers are put into effect, the only way to read the dimensions of the object transformed by these modifiers is going into edit mode, selecting all its mesh and having length units displayed?
I ask because the dimensions mentioned in the Transform Properties panel appear to be the dimensions of the entire array object.

What do you mean by dimensions? The boundings or along the path?

Sorry, my newbiness prevents me from understanding what you refer to. If the object is a 10x10 plane, and it is replicated 10 times along the X axis, it gives an oblong box that is 100x10. I am talking about the original dimensions of the single object, before applying any modifiers. Would these be the boundings?

So yes: edge info in the 'mesh display' part. You also have a standard addon called "measure it"

Oh, thank you very much for the addon tip, found it and activated it.

In Blender 2.8x, disable "Radius" under curve's properties -> Shape.


text:
Dyntopo adds vertices but does not deform mesh
I am sculpting some things using dynamic topology. Everything was working great, but then my mesh stopped deforming.  Vertices are still added, but the mesh doesn't deform.

Image 1 This is the mesh before I try sculpting with dynamic topology.

Image 2 This is the mesh after sculpting an area with dynamic topology.  Notice the vertices have been added but the mesh has not deformed.

Image 3 & 4 Show brush settings.

it all depends on what were the brush settings for sculpting. Could you include one more screenshot?

Check that the brushes you are using are not ZERO strength.

It's hard to tell from screenshot. Maybe open Lock scroll and see if there aren't set all three axes to be locked. Or maybe disable the texture to see if brush works then. Also when in trouble with brush change it by selecting another from list; if that works you'll get the reason.

It would appear that your custom brush type is set to simplify, change it to something that deforms the mesh.

From the manual page

Simplify - This brush collapses short edges (as defined by the detail size) whether or not the Collapse Short Edges option is enabled. This brush has no effect if dynamic topology is not enabled. It can be found in the Brush ‣ Sculpt Tool menu.

Maybe all your axes are blocked in the sculpt mode . Check it out: "Tools"-"Symmetry/Lock"-"Lock"


text:
Mesh and armature un-synced when canceling pose
I have a problem in blender that has been driving me insane.  My rig was working correctly and I made some changes in the hierarchy and now it wont work.
In pose mode if I grab and drag a bone it deforms the mesh just as I would expect.  If I want to cancel the action by hitting "escape" the armature snaps back to its original location but the mesh stays where it was when I hit escape.  This is driving me crazy please help.
Thanks.

Here is the original model.

This is while I am dragging the pose around before clicking to confirm position.

This is after canceling the pose by hitting "Esc" without ever clicking to confirm the position.
Please not that if I confirm the position by clicking instead of canceling the pose works fine and the mesh follows the armature as you would expect.

Please provide screenshots so we can understand the problem easier

There will be some strange object dependancies, (happens often with drivers) which Blender can't handle. Double check parenting, Constraints and Drivers.


text:
Needing help creating an fluorescent glass shader
How can I make this glowing glass material like this?...

use a glass shader with an emission shader plugged into volume

Add Emission shader to the Volume input of Material Output node:

Further you can also add in Volumetric Absorption and Scatter nodes to simulate a real medium inside, not just light originating from the volume.

Phoof this is slick!

Well, thanks! I want to use it my project.

How would you go about the use of Volumetric Absorption and scatter nodes? I would really love to see a material build on this, to simulate a medium!

@sorenfroststaal You just add Absorption and Scatter nodes together with Add Shader and you add that to the Emission also with Add Shader. You will have to bump the energy on the emission a bit, because the light will scatter in the volume and will get absorbed by the volume too. It's more realistic, but the render time is much longer and the visual is not that different.