text:
Incorrect selected tool circle. box. or lasso
When I select vertices, edges, or polygons with the circle, box, or lasso tool in Edit Mode, spontaneous vertices are selected all over the mesh.
example:

I select the vertices on the legs, and the vertices are selected throughout the mesh.

If I selected vertices, edges, or polygons, with circle, box, or lasso tools, on head mesh, then automaticly selected vertices on all mesh! On foots, or bodyes, hands! Why? this error happens on any mesh! Even if you started the blender and added a sphere, or something else!

What if you change system/selection/opengl mode(s) option(s) in the preferences?

I selected all possible options, but the problem did not dare.

ok, so try anti aliasing options, a bit below (in "window draw method"). Though this may require to restart Blender. First try to turn it off: "No multisample"

quite sure I've encountered it in the past. Should be around OpenGl, antialiasing... can you confirm this does not happen in wireframe mode?

I don’t know what exactly I did on your advice, but the problem was solved! Thank you very much!

I'm so happy) Thanks!!!

Happy for you too!!


text:
How to stop background video stretching?

it is not like this in the render only in the viewport. But this makes it hard to line things up when my viewport is different then my render. My video is 1920x1080 and my project is 1920by 1080 so i dont know why it is stretching.

Is this motion tracked video?

why is my footage smearing out towards the border on renderintg an image? and how to determine lens distortion coefficients for motion tracking? and edges of the tracked image are cropped

source: Stack Exchange

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

sort: votes


text:
Problems with knife tool
I'm having some problems with the knife tool, sometimes it works and sometimes doesn't.
I would like to cut the shape of the lingerie texture at the body but the knife tool works at some places and doesn't work at others
I've already removed the doubles and verified if has a face.
20s video of what happens
Blend file

it seems to work fine here, both with 2.79 or 2.9, do you press Enter when you create the last vertex?

Yes.. I pressed enter. It works ok at some parts and doesn't work at others.. so annoying. I used the 2.70, I'll try 2.79. Thanks

@moonboots Thanks a lot! It works on 2.79!

oh ok so maybe the tool was improved in 2.79

Please do not add "solved" as part of the title. If you found a solution for your problem please write it on the
answers section and mark it as accepted there. Read:
[what does it mean when an answer is accepted?](https://blender.
stackexchange.com/help/accepted-answer)
Please take the [tour] to understand how the site works.

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


text:
Can't get displacement to work Properly in 2.91
I want the displacement to displace outwards using the normals.
That is not what is happening, see picture:

You can see the bounding box, and you can see that the displacement is happening along one axis, pushing the whole thing up and to the side. It's like what used to happen when they first moved over to using the vector displacement node and people still tried to use just the multiply node.
I can achieve the result I want if I use the displacement modifier, but then I can't use adaptive subdivision (or can't figure out how to), so I have to subdivide the shit out of my object to get anything like the detail I want.
this is the setting I have in the subdivision modifier

Hello :). You're using a Vector Displacement node. Use a simple Displacement node instead and it should work :).

This was the perfect solution - in case anyone else needs a more specific answer I plugged my Image Texture color output into the Height input of the DIsplacement node, then Displacement out to Displacement in on the Material Output node


text:
How to work with layers in 2.9x like in previous versions (2.7x)
I'm trying to learn Blender using version 2.9.  I'm watching a tutorial from Blender Guru, Andrew Price, in which he uses an earlier version (tutorial made 2017).  This is the Anvil tutorial.  However I am trying to "interpret" what Andrew is doing on his version and how to do the same on 2.9.
A prime example of this is Layers.  In his Anvil tutorial he makes a duplicate anvil and places it on a spare layer for use later on in the "bake".  This allows him to work on the first layer and keep the other for later.(High poly and low poly version)
In 2.9 I have found the box with layers in the top right.  I have tried copying to a new layer, but when I sculpt on the original one it changes the other layer too, which can't be the aim.
I can't seem to create the same actions in the latest version and run two distinct layers with different info on each.

Hello :) Andrew updated the Donut tutorial for 2.8 interface. You may find it a bit easier to follow.

The 2.7 Layers have been replaced by Collections, you should now use Collections. Basically one former Layer is now one Collection (and when you open an old Blender file Layers are automatically replaced by Collections).

You're confusing Layers with View Layers, which are completely different things, View Layers are useful for the Compositor (which is not the case in this tutorial).
With View Layers you're just changing the visibility settings of the current scene for later compositing purpose, so when you modify an object, it's the exact same object as the one of another View Layer.


text:
Move an object on an irregular plane with python
At this moment I would like to move an object, suppose a "cube" along its y axis, with a slider from the UI panel with a FloatProperty. So far there is no problem.
Now, suppose this object encounters a terrain (an irregular mesh with various polygons) is there a way to make it follow the normals of this hypothetical path?
Normally I would have used a path with a bezier, but I would like to be able to do this with a simple control in the UI panel, I insert an image to understand better
I have no idea  to do this, I suppose I probably have to register all the faces of that plan? Or something similar? It seems a bit complex to me.
Edit: I was kindly suggested by Leander, to use the raycasting method, obviously I did not know this function , I would also like to understand if it is possible to record the animation correctly using keyframes, I could put a kind of operator that cooks the keyframes, or something similar

Possible duplicate of Script for getting Camera Look At co-ordinates

I've voted to close this as a duplicate. Even if the wording is not the same, the answer also solves your quest. Just raycast a ray straight downwards at the specific (X, Y) location and position the cube at the "hit" position.

@Leander Thank you very much for reporting, surely it's a similar question, but not too much, some people like me might find a solution to this specific question interesting, I really appreciate your script with the camera. The raycast method is very interesting. I should also take into account being able to animate everything with keyframes, which this seems a bit problematic

I thought you would be willing to do the additional coding and transfer yourself. I added an answer, don't feel like you need to accept it though. Good luck.

There's something wrong with the ray_cast, which messes up on a few casts. But I think this could clear up if placed in a modal operator.
I believe the script from this answer achieves what you want.
The result looks very similiar to your gif.

Convert the collision geometry to a bmesh, apply the transformation matrix and get a bvhtree from the transformed bmesh.
Cast a ray from above the Cube's location straight downwards (0, 0, -1) and check if it intersects with the bvhtree.
Create a keyframe.

import bpy
import bmesh
from mathutils.bvhtree import BVHTree
import mathutils

# the epsilon value for the BVHTree calculations
EPSILON = 0.0000001

# maximum ray distance XY plane
MAXIMUM_Z = 1000

# make sure you have a Camera and an Empty named like this
landscape = bpy.data.objects["Landscape"]
cube = bpy.data.objects["Cube"]

# create the BVHTrees from a bmesh of the "sticky" object
# the bmesh conversion makes it easy to apply the individual objects transformation matrices
bm = bmesh.new()
bm.from_object(landscape, bpy.context.scene)
bmesh.ops.transform(bm, matrix=landscape.matrix_world, verts=bm.verts)
tree = BVHTree.FromBMesh(bm, epsilon=EPSILON)

# the main method for setting the new z position
def reposition_z(scene = bpy.context.scene):

    # create a direction vector, which points downwards and
    # a origin for the raycast
    dir = mathutils.Vector((0, 0, -1))
    origin = mathutils.Vector((*cube.location[:2], MAXIMUM_Z - EPSILON))

    # if there is a hit, move the cube to that location
    loc, no, i, d = tree.ray_cast(origin, dir)
    if d is not None:
        # assign the cube's location
        cube.location = loc

# remove all handlers, then create a new one with the reposition_z function
post_handlers= bpy.app.handlers.scene_update_post
[post_handlers.remove(h) for h in post_handlers if h.__name__ == "reposition_z"]
post_handlers.append(reposition_z)

Setting a keyframe could look like.
for i in range(start, end):
    bpy.data.scenes["Scene"].frame_set(i)
    reposition_z()
    cube.keyframe_insert(data_path = 'location')

Why do you remove all handlers?

@lemon Testing purposes... so I can run the script multiple times and "clean up " on the fly. Got anything more graceful?

More graceful I don't know... I usually test to remove only the handler that I will append so that I don't remove handlers from other scripts. Like in this answer (Scene Handler part) https://blender.stackexchange.com/questions/143273/how-to-create-a-tetrix-sierpinski-tetrahedron-fractal-radiating-from-0-0-0-pyt/144493#144493

@lemon Shouldn't have been lazy, updated.


text:
How to get a label in the ui panel, with the bpy.data.materials count?
Is there a simple way to get a label on the panel containing the number of materials in the project? Especially updating yourself
Edit:
In accordance with the suggestions, I add a fundamental detail:
I'm trying to visualize in the panel a label that indicates the number of bpy.data.materials
I don't know what the correct practice is, so I didn't sketch a script, as I don't have the idea of what the right path is.
Basically the way that comes to mind is a script like this:
mat_list=[]
for m in bpy.data.materials:
    if m.users!=0:
        mat_list.append(m)
mat_count= len(mat_list)

I don't know how to place this, if I use a function and how to update it without weighing down the script, I don't know if we should use a pointerproperty. I have serious doubts about it
Edit: 2 (My solution)
In relation to the inspiration given to me by brockmann, I have reached this compromise that seems simple and works, I only hope that it does not take away too many resources from the CPU.
layout.label(text= "Material in use: {}".format(len([m for m in bpy.data.materials if m.users!=0])))

This:
##`if m.users!=0`

because I am interested only in materials that are actually in use on objects, bpy.data.materials also collects materials not in use so it would give me a wrong count. For now I think I have solved, I hope I have found a correct way.

What have you tried and what failed. What python scripting knowledge do you have, how complex can the answer be?

@Leander I edited the question, as it is more a question of correct practice, of ways I think there are many, but currently I have no idea how to do it. I'm sorry if I seemed unclear, I hope to be with this edit

len(bpy.data.materials) returns the number (int) of all materials in the file. To draw this number onto a custom panel, means that you have to pass it to the text argument of the label() call (string).
In fact, you can either use str.format() or the old C-style formatting syntax for integers "%i" % number to pass the variable. A nice collection of examples here: https://pyformat.info/
# Number of all Materials in the .blend
layout.label(text="Materials: {}".format(len(bpy.data.materials))

Following example displays the number materials per file (Data.materials) as well as all materials in the current scene (custom object iteration). Layout code is ripped from How to create a custom UI?

import bpy

from bpy.props import (BoolProperty,
                       IntProperty,
                       PointerProperty
                       )

from bpy.types import (Panel,
                       PropertyGroup
                       )

# ------------------------------------------------------------------------
#    Scene Properties
# ------------------------------------------------------------------------

class MyProperties(PropertyGroup):

    my_bool: BoolProperty(
        name="Enable or Disable",
        description="A bool property",
        default = False
        )

    my_int: IntProperty(
        name = "Int Value",
        description="A integer property",
        default = 23,
        min = 10,
        max = 100
        )

# ------------------------------------------------------------------------
#    Panel in Object Mode
# ------------------------------------------------------------------------

class OBJECT_PT_CustomPanel(Panel):
    bl_label = "My Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"

    def scene_materials(self, context):
        mat_list_per_object = []
        for ob in context.scene.objects:
            if ob.type in ("MESH", "CURVE", "SURFACE", "FONT", "GPENCIL"):
                if ob.data.materials:
                    mat_list_per_object.append(ob.data.materials.items())
        # Flatten the list and return a set (unique)
        return set([i[0] for i in sum(mat_list_per_object, [])])

    @classmethod
    def poll(self,context):
        return context.object is not None

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        mytool = scene.my_tool

        # Custom Properties
        #layout.prop(mytool, "my_bool")
        #layout.prop(mytool, "my_int")

        # Number of Materials in File (bpy.data)
        layout.label(text="Number of Materials in this File: {}".format(
                len(bpy.data.materials))
            )

        # Number of materials (unique) per scene in context
        layout.label(text='Unique Materials in "{}": {}'.format(
                context.scene.name,
                len(self.scene_materials(context)))
            )

        # Draw a list of materials per scene
        layout.separator()
        layout.label(text="List of Materials:")

        for i in self.scene_materials(context):
            layout.label(text=i)

        layout.separator()

# ------------------------------------------------------------------------
#    Registration
# ------------------------------------------------------------------------

classes = (
    MyProperties,
    OBJECT_PT_CustomPanel
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.my_tool = PointerProperty(type=MyProperties)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)
    del bpy.types.Scene.my_tool

if __name__ == "__main__":
    register()

Thanks for the inspiration you gave me, I found a solution that seems to work and mentioned it in the Edit 2

Huh, problem is that bpy.data.materials returns all materials in the file (as stated in my answer), doesn't necessary makes sense to display that for the user... Next, you can get rid of the =! operator: len([m for m in bpy.data.materials if m.users]) Note: would be nice you had mentioned that you want to check for a user in your question @Pastrokkio

Right! excellent observation, Thank you for your time

Even faster is using a generator: sum(1 for _ in (m for m in bpy.data.materials if m.users)) for counting instead of len([m for m in bpy.data.materials if m.users]) @Pastrokkio

I'm happy with this help, it's great, sometimes I worry about the interface, because it updates often, I don't want to overload it unnecessarily. We hope I'm choosing the right way. Ty brockmann

Not sure what you're talking about... Choosing the right way, the interface updates often? There are always hundreds of ways implementing something, you just need t make sure it's working in any case the user expects. Also I don't think there is any speed issue when iterating over a few hundreds of materials, but that is also something you can test beforehand @Pastrokkio


text:
How to build a website to upload and download file from blender by python?
I tried to ask this question in the most correct way for my knowledge on stackoverflow, but unfortunately as I believe I don't know an adequate language to ask a question like that I was canceled the question from the administrators (This is not a criticism, but it is only to introduce to the fact that I do not currently have the capacity to ask a question in technical language). So I try here, hoping the administrators understand and even suggest me how to correct my question.
I would like to build a script that will export / import certain files, directly from blender on a web platform that allows you to share files (.txt at this time), the files must have the possibility of being downloaded by other users, so I speak of a kind online library accessible by those who use my script.
Now my question is divided into 2 parts:

What kind of web service can I use?
What kind of python script/module can I use?

Basically I will accept answers that show me the way and to do a correct research.
If someone wants to correct the question to make it more technical, I think it's a good thing.

Are you trying to build that webservice yourself? Is Blender supposed to run on the client-side and interact with the webservice or is Blender supposed to run on the server-side? Please be aware that loading untrusted content from other users has security issues.

Thank you very much, actually there would be security problems, in fact I'm trying to figure out how to orient myself. Basically it's a question I asked for blender but it's more on the technical side of how to safely transfer files and where and how

Start with downloading
It's a lot easier to get content from the web than it is to post to the net.  So we'll start there.
For more info than you can poke a stick at search google et al with
download files with python

Simple example uses python requests to download this question's page source into blenders text editor.  Any file that can be browsed  can be downloaded in this way.  For this can choose any web hosting.
import bpy
import requests

url = 'https://blender.stackexchange.com/questions/160565/how-to-build-a-website-to-upload-and-download-file-from-blender-by-python'
r = requests.get(url, allow_redirects=True)

t = bpy.data.texts.new("Question")
t.write(r.text)
bpy.context.space_data.text = t

Uploading is trickier, generally requires passwords etc, and is probably outside the scope of BSE.

Wow, ty batFinger  Does this also make it possible to download files hosted on a web site?

Yes. Alter url to test.


text:
Allow ray to see through properties?
Here is my code:
import bge
from bge import logic

controllor = bge.logic.getCurrentController()
scene = bge.logic.getCurrentScene()

target = scene.objects['Target']
ray = controllor.sensors['Ray']

if (ray.hitObject and not 'Fire_False' in ray.hitObject):
    target.worldPosition = ray.hitPosition

I've noticed that if you have an object with the prop "Fire_False" and an object behind it without the prop, the ray doesn't track to the object behind the first. I am looking to modify this script so the ray can look through the object with the prop and find other objects behind it. If the script sees a situation like this, it uses the object with the prop as a dead end, and does not continue tracking. How can I have this ray see though props? Any help is appreciated. Thanks!
EDIT: I would also like this to work if an object in in another object and the bound object does have Fire_False, but the object in it doesn't.

You are thinking of this backwards from how the ray sensor works. You want to look for "target" no mater what is in front of it.
Add a property to everything you want to get hit say "target". Then change the ray senor to look only for that property ("target") and enable X-Ray Mode.

Last your code can then look like this.
if ray.hitObject:
    target.worldPosition = ray.hitPosition

X-Ray Mode will let the ray look through everything, and the property will only return the objects with the property "target."

I'm sorry if I was unclear on this. I need the ray to detect objects without the property Fire_False. The ray and script is in the camera. An empty is named "target" and that empty tracks to where the ray stops. When I use x-ray, the ray uses the last used position.

@blackhole I understood that from your question. You are still going to have to change the ray sensor look for a property (call it whatever you want I used "target") on all objects that you want to get hit. There is no way to use X-Ray Mode and script it to look only for objects that do not have "Fire_False."

@blackhole i'm assuming you're using this so you can't shoot your allies and stuff. What david is saying is correct, you want to put a property on all of the badguys that means that you can shoot. or you may have the guns default always shoot and the allies in the crosshairs means you can't. it depends on the situation.

@Radish of the Opera You can shoot the good guys, that is not a part of this. I need an empty that is always at the center of the screen that collides with objects without the prop Fire_False. The objects with Fire_False are objects that trigger events and are invisible, or are not a part of the game. I already have tons of work put into this after I figured out what to do, and changing everything would be difficult. I am just looking for an x-ray to work.

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


text:
Greater than in python?
I have 3 props: prop1, prop2, and prop3. I want a python scrip to work where it will determine if prop1 is is greater than or equal to prop 2. Also, I want it to determine if it is less than. If it is greater than or equal to, prop 3 will be true (boolean). Else, it will be false. Here is my code:
def property(cont):
own = cont.owner

if 'Ammo_Reserve' in own and 'Ammo_Fired' in own:

    reserve = own['Ammo_Reserve']
    fired = own['Ammo_Fired']
    sit1 = own['Situation1']

else:
    print('No properties found in object')
    return

if reserve < fired:
    print('Ammo_Reserve is less than Ammo_Fired')
    sit1 = True

else:
    print('Ammo_Reserve error (less than)')

if reserve >= fired:
    print('Ammo_Reserve is greater than or equal to Ammo_Fired')
    sit1 = False

else:
    print('Ammo_Reserve error (greater than or equal to)')

Why does this not work?
Also:
Ignore the extra logic.

@X-27 I agree, that is more likely

I think the main problem is that it is not setting the sit1 property correctly.

yes you should do own['Situation1']  = True not sit1 = True , if you assign new value to sit  it will be separate than own['Situation1']

@Chebhou It still doesn't work. When reserve is clearly less than fired, it is still false.

the other thing is the test i think it's incorrect if 'Ammo_Reserve' in own

Yes, I clearly have Ammo_Reserve and Ammo_Fired in the object with the script.

I'll test it and be back

Ok it is working if you did replace   own['Situation1']  instead of sit1

It is not for me. I do not understand why. I have the 2 properties I need, along with sit1

i'll write an answer  with example file

Let us continue this discussion in chat.

You can do this Extremely easily.
at least from the way your question is worded, I think this is what you want.
Enable debug properties to see Prop 3 display in the BGE, and then change either Prop 1 or prop 2 to make one higher that the other, and Prop 3 will now change to be true or false.

If it is that simple, then please answer the following: http://blender.stackexchange.com/questions/29152/properties-not-working?noredirect=1#comment45695_29152. I was told to use python.

I tried to decipher your logic in that file, and it is Quite confusing. One possibility is that it will not work if you have it detecting if (any property)  is greater or lower than Prop Name . Use Prop_Name instead.

I did. I have them as prop_name format.

When you write sit1 = own['Situation1'] then sit1 will have the value of own['Situation1'] but it's not the same variable ( because of the way python works ), so you should assign the new value to own['Situation1'] itself, this should work ( i have removed the second if/else since it is the exact opposite of the first ) :
import bge
from bge import logic

def property(cont):
    own = cont.owner

    if 'Ammo_Reserve' in own and 'Ammo_Fired' in own:

        reserve = own['Ammo_Reserve']
        fired = own['Ammo_Fired']
        sit1 = own['Situation1']

    else:
        print('No properties found in object')
        return

    if reserve < fired:
        print('Ammo_Reserve is less than Ammo_Fired')
        print('Ammo_Reserve error (greater than or equal to)')
        own['Situation1'] = True

    else:
        print('Ammo_Reserve error (less than)')
        print('Ammo_Reserve is greater than or equal to Ammo_Fired')
        own['Situation1'] = False

cont = logic.getCurrentController()
property(cont)

example file

This is driving me nuts; I have the exact same outcome except sit1 not changing. I clearly have reserve as 1 and fired as 10, and sit1 stays false!

@blackhole did you try my file ?

Yes I did. I've had problems like this a lot. Problems where I replicate something to the exact, it doesn't work, I show someone, no one fixes it, and my question gets abandoned.

I've added pictures. I have your script and that!

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


text:
Blender mouselook problem
Intro:
Hello there! I am making an FPS, and I have deleted way too many good projects of mine due to this problem; I am sick of it and I want it solved. My other question about it got closed because it was unclear, so I'll make this as clear as possible.
Scene:
I have a simple scene with a plane. The plane is default, with no edits to it, not even a texture. It has only been scaled, that's all. After that, above the ground a bit, is my character. The collision bounds (rectangle) is basically just a collision bound to a model (character) that is set to "no collision" and is not an actor. The character has nothing to do with this. It does not affect anything. The only important part is the head. The head is part of the character and has Mouse (Movement) > Python. The Python is just the mouselook script. The head is the parent of the camera and just has ml.inherit along with some cap options (in the logic editor). There is also some basic lighting.
Problem:
Every time I look upwards with my mouse (moving my mouse forwards), just 1 degree above where the head normally faces, the whole scene just gets "ruined." However, this does not happen when I look down. What happens when I look up is that it seems that the lighting, first of all, is quickly, every millisecond, "flipped" where the ambient is more brown instead of blueish yellow. At the same time, the head keeps on flashing (going between visible and invisible). I think the head flashes once per second, but I'm not sure. How do I stop the "twitching" from happening? Here is my .blend, thank you!

Make sure to remember that the collision bounds are also the parent of the character!

can you share a blend file?

http://www.pasteall.org/blend/29768 - .blend: just look upward and see.

As of 2.72, there is a new mouse actuator which you can use to rotate objects based on mouse movement.

By using this actuator instead of the python script, it seems to work fine:

I already figured the error in 2.70 but thanks, also, why is 2.72 marked as 2.72b? When is 2.72 coming out officialy, is a and b beta? im confused

@BlenderDev See http://blender.stackexchange.com/q/3030/599

Oh so nothing is wrong with 2.72b, the next one will come along in a long time right?

@BlenderDev Yes. Well, in a couple months or so. Then next one will be 2.73.

Just 1 more thing, in my Blender folder, since I downloaded 2.72b, is it fine if I delete the 2.7 files? Sorry for all the questions, your just a good source :)

@BlenderDev Not sure what you mean by "2.7 files"..


text:
Filling a Void between two 2D objects (Meeple)
I am trying to create Meeple in Blender.  I have the portrait of the meeple(s) designed as 2D images.
How far have I made it... I have an image inserted into Blender, I put a copy of that spaced away from it... I just want to know if I can fill the void in between those objects to quickly make a 3D object instead of shaping objects until it matches the shape...

Sadly there is no way to quickly create 3D models from 2D images in Blender. However, there are tricks to accomplishing the modeling of whatever it is you are creating quickly and/or easily. See this similar question on Blender Stack Exchange:https://blender.stackexchange.com/questions/63246/how-do-i-make-a-3-dimensional-character-out-of-flat-picture/63256#63256

Read: How do I connect the top loop with down loop with faces

Use a vectorial drawing program to trace the shape as path. Save as SVG.

Import to blender as SVG. (File > Import > Scalable Vector Graphics)

Use the Geometry section of the curve to create extrusion.

Done.
Read:
How to model an object with width and depth, based only on an image that shows the outline?


text:
Looking for pyqt combobox and listwidget equivalents in blender
I need to port a tool from nuke (to blender).  The nuke tool uses pyqt comboboxes and listwidgets.  The widgets are populated with info from an external database.  The widgets are displayed vertically.
production [combobox] <- list of productions
sequence [combobox] <- list of sequences in a selected production
shot [combobox] <- list of shots in a selected sequence
assets [listwiget] <- list of assets in a selected shot
When a selection is made in one of the comboboxes, the subsequent widgets are updated.  Ultimately, I extract the list of selected assets from the listwidget at the bottom.

Is it possible to make multiple selections with an UIList?

Hi and welcome! Related q/a: How to create a custom UI? Please edit your question and ask only 1 question per post to make this q/a useful to future visitors. Recommend take the tour to learn about how this site works: https://blender.stackexchange.com/tour, also see https://blender.stackexchange.com/help/how-to-ask Thanks. -> In short: (1) Yes (2) update callback (3) Yes, no other option (4) Yes (5) Yes (6) No However, explaining all of that as well as providing some code examples, the answer section would explode as you might guess...

@brockmann if you type "tour" between brackets ( [  tour   ], with no spaces) it will automatically generate a link to the [tour], same as the [edit] link, to generate a link to edit the question.


text:
When erasing in a new 2D frame one of the layers stays from previous and gets erased for both frames
I've been working on a 2D animation in grease pencil and was using two separate layers so I could move and copy only specific pieces from each frame to the next.
So far I had been copying each frame and just moving lines or erasing and it was working just fine locking whatever layer I didn't want to be touched.
For the frame I am now working on it was an entirely different scene so I didn't copy any of the the previous frames but instead moved the node the amount of spaces I wanted and began to draw. One layer disappeared as I expected but another layer is still on top of the new work.
I tried to just erase the lines in that layer but, when looking back at the previous frame, the same lines that the new frame had copied were also erased.
I tried changing the layers but nothing happened and now I'm confused if either of my layers are even separate any more.
I have some ideas now after typing this that I will try but I would like to know how to fix the issue future preference.


text:
where should i mark a seam onto my mesh?

Where i should mark a seam so my texture doesn't look discontinuous in a certain area.

you can add one in the bottom , and probably one in the back

Think of how the material would be in real life. There is always a seam if it is fabric, or a place where all of the parts are put together.

You need to put the seams on a part that won't be visible on rendering. You can't avoid discontinuity with this kind of object, unless you give corrections afterwards and recreate continuity with a Clone brush for example, but it will depend on the nature of your pattern, if it's a big pattern (like big flowers) it seems hard to achieve.
As you can see here I put the seam along the back of the cube, so that it will be hidden in render. For this kind of pattern it would be very hard to create a continuous texture:

i see, although i wanted the texture to be continuous all around, because im making an asset for my game that can be moved in any way, but i guess i"ll have to do something else. Thank you for the help though!

there may be a solution but please show your texture and even share it so that we can see and maybe give a try

https://imgur.com/a/F9iCeJ7

oh ok so it has nothing to do with the example I gave, maybe try this technique: https://blender.stackexchange.com/questions/191621/how-to-make-a-cast-iron-shader-that-has-scrapes/191654#191654

https://imgur.com/a/Tz6xmy7

So how does it work? Maybe share your file if you meet any problem, don't forget to pack your image: https://blend-exchange.giantcowfilms.com/

sorry about that, i added the wrong file;) also i cant pack the image with it due to an unused texture, not being found or some error like that.

you didn't pack any image but anyway I've tried with another one, and actually it works fine if you follow the method I give here: https://blender.stackexchange.com/questions/191621/how-to-make-a-cast-iron-shader-that-has-scrapes/191654#191654

actually i did use that method in a different save, i did notice that the texture looked alot better.

I don't think you can get much better with texture, another way would be to use procedural texture, it depends on the level of realism you need, also do you need some close-up shots on your object etc...

well the whole point of the model, is to be used as an asset in a game i plan to make, so i want it to look like its comfortable and made of material of a chair, so not that realistic, but to give that sort of illusion. the model, would be pretty close to the player character too.


text:
2D morphing from square to circle
I am a beginner in 2D animation . Would be grateful if somebody guide me how to animate change of shapes, eg from square to circle. Thanks !

do you want to do it with the grease pencil?

This is done with shape keys.

Does this answer your question? How can I morph a flat plane to be a flat cirlce?   or   https://blender.stackexchange.com/questions/129197/how-to-turn-a-square-into-a-circle-in-2-8


text:
Snap group of vertices into one vertex individually
Instead of snapping each vertex individually, is there a fast way to snap multiple vertices into 1?

I don't get it but do you want to merge them? Oh never mind someone answered it

not necesery, just want to snap individual vertices into one without pressing any key like snapping do

This way doesn't merge. It involves pressing keys, but you do have to tell the application what you want, somehow.

Keyboard . (period) set the pivot point to 'Active Element'
Make your selection, ensuring your target vertex is active, for instance by selecting it, and Box/Circle selecting the rest.
Hit S0

Yes. With the vertices selected, press M, and select for example At last, so all will be merged into the last one that you selected. By the way, M > By Distance is also used to remove duplicate vertices.

thanks, its pretty helpful! And is there any faster solution without merging them? without pressing any keys, like snapping do


text:
Hair particle bugged
(blendfile attached : https://drive.google.com/file/d/1DwS8ZN3pF6nQY0i9CgwZgsIfeeG0TcSD/view?usp=sharing )
My hair is very buggy.
I have a hairstyle composed of two layers, two particle system, one for the main hairs, and one for the frizzy hairs. The scalp where the hair is, has modifiers set up like this :

And here is a picture of the hair how I want em, and how I stylized em in the particle editor :

But this is how it looks when I disable the fluid modifier that the scalp has

And this is how it looks when I uncheck the “Dynamic Hair” box

I want to simulate my hair, but when I bake it, it comes out weird and deformed, plus, the main hair are static, there is only the frizz going crazy.
I want to simulate hair correctly, looking exactly like the first picture, but without the fluid modifier, wich I think is causing problem in the sim.
(blendfile attached : https://drive.google.com/file/d/1DwS8ZN3pF6nQY0i9CgwZgsIfeeG0TcSD/view?usp=sharing )
Edit : If you wanna see the particles in edit particle mode, make sure this option is set to particles :

Your question is very detailed. But why is there a fluid system on the head?

Well no reason, It's a mistake, I wanna remove it

Ok, and why not just remove it? Sorry, I have to ask because it's not clear what the problem is. When you remove the unnecessary fluid then the fizz hair will be moved and look different. Ok. But it's not a heavy combed hairstyle, is it? And you want to animate it and it has Hair Dynamics enabled? So why don't delete the edit of the hair, add some hair particles again and let the Hair Dynamics do its job?

Well everything is changed when the fluid modifier is removed check the images above, especially on the bottom right of the image you can se the hair is way longer + even If I do that my hair doesn't simulate properly, but you can test is, just bake 3-2 frames and you'll see immediatly it doesn't work. Also, might I ask you to put an upvote in order to make my issue known by more people ?

Oh, ok. You're right, it changes also the main hairs. It's probably because the fluid modifier alters the mesh data. The particle systems are below the fluid modifier on the stack. You should edit your question that you want to get rid of the fluid modifier without breaking the combed main hairs

Yes, thanks for the advice, would you check my file ?

Why is this file so big? (160Mb) ...

I don't know why too

Ok. You have Fluid modifiers everywhere! On the Scalp, on the Body and, on the (hidden) Hat object. (How did that happen?)
Here is a fix list ;-)

Remove the Fluid modifiers from the objects
When you remove the Fluid modifier from the Scalp object then the main hair will be modified (2nd picture of the model in the question). There is a long "children" strand on the left side of the head, far away from the hair particle (hair guide). The reason for this is that [X] Long Hair is ticked in the Hair Particle Settings for the Interpolated Children. Turn off Long Hair for the children. Then the children will follow closely the hair guides and the hairstyle will look like before.
If you make the main hair static by turning off Hair Dynamics the hair will change and look like in picture 3. This is because there is a Collection named "SCALP" set in the Hair System Settings → Field Settings → Effector Collection. Clear the value here and the hair will look fine again.

Side notes:

I've tried to run your hair simulation but when I press the Play button the frame jumps 1, 30, 70, 123, ..? I have no idea what's going on there. If I move the fixed Scalp object into a new blend file the hair animation works fine and the tips of the 'Fizz' hair move slightly.
The 'Body' has a Subdivision modifier, level 3 for viewport and render. This results in 280k faces and 500k tris. Maybe turn it down to 1 and 2? There is no difference between level 2 and 3 except for the 200k extra faces (70k -> 280k).

Thanks. No I can assure you I can't uncheck the long hair particles, as the hair won't look the same as the same picture, it looks similar yes, but not the same. For the force field collection, it's because somehow it affects the look of the hair even when dynamics are turned off, it might be a bug. I reduced the force of these force field and the problem was gone, I also make sure to delete the cache file manually before every simulation, and it resolve the problem of my particle going nuts when simulated. Still, my hair are sometimes intersecting with the hat, how to solve that ?

Also the cache steps must be set to 1.


text:
Why does the mirror modifier create a new object instead of mirroring the object?
When I mirror my object it seems to create a new object instead of just mirroring.
I've changed cursor to selected object but it's still not helping.
Please someone help me.

You have moved the object away from it's origin point. In edit mode, move the plane towards its "mirror". You should be able to see what's happening. Often, when mirroring something, you cut it in half first, down the middle, so the edge of the "half" that's left over lines up with the origin.

Off topic; imho you should be using some form of "Screen Capture" instead of taking a picture of your screen. It would be so much more efficient in a lot of ways.

@Dontwalk lol I didn't even think about that, the problem had me confused. Thanks

this is not a separate object , its just a physically separate mesh, which means that these 2 planes are the part of the same object , this is happening because you object origin is not at the correct place thats why you re getting weird results , you can right click on the object to set origin or in edit mode change the position of the object

What's happening here is that the mesh isn't lining up with the origin, and mirror modifier works by using the object's origin as the mirroring point by default.
To fix it you can go to Edit Mode, select all with Ctrl + A and then move the geometry towards the origin with G.
You seem to have "Clipping" enabled, so when you move them together, the sides will automatically merge and it'll have the look of a single object again.


text:
Problem with text and boolean
When I apply the boolean modifier modifier the letter E shows the
reverse of what I expected that it would have done. Is there any way to fix it?

File:
https://pasteall.org/blend/0618b60d8e79429083946bc1c867ecce

looks like it has do do with the size...if you change the size on the z-axis and make it bigger, it is ok. Maybe you should describe how you used the boolean modifier....or show us the blend file without the applied modifier.

File: https://pasteall.org/blend/0618b60d8e79429083946bc1c867ecce

if you use the Fast option instead of Exact, it will work fine, I don't know why it still works better than Exact sometimes

Thanks for help


text:
How to Parent jeep Rig to Character rig
I want to parent the rigs, so that when I move the jeep with rig the character will also move.

Check this picture:

You probably don't want to parent one to the other as that may cause problems, try moving the roots of both at the same time so the frames line up perhaps?

You can add a "Child of" bone constraint to the root of the character, pointing to an appropriate bone of the vehicle. You can animate the influence of the constraint, to separate the two actions. After the set up of the constraint, click its "set inverse" button to build the correct location relationship.


text:
How to wait the finish of the bpy.ops.render.render('INVOKE_DEFAULT',animation=False, write_still=True)?
What interests me is basically to stop the execution of my code until the end of the render but at the same time view the progress of the render, considering that the possibility of the "ESC" key that cancels the render.
I am looking on the internet but the situation is unclear to me, I found this:
Is it possible to make a sequence of renders and give the user the option to cancel the process through the UI at any given time?
but it seems quite complicated, I was wondering if there was a simpler solution to my specific case, as my situation is slightly different, as I don't want to render multiple.
Practically:
    ## my code
    ## my code
    bpy.ops.render.render('INVOKE_DEFAULT', animation = False, write_still = True)
    ## if render is done:
    ###### my code
    ###### my code

If you want to execute code when the rendering is completed you will have to use an application handler.

@RobertGützkow Thanks, I was taking a look at this, but I don't really understand how to use them for my situation

What particular aspect is unclear? You can write a function and then append it to bpy.app.handlers.render_post or bpy.app.handlers.render_complete as shown in the answer you've linked. Once the render is finished the function will be executed.

@RobertGützkow Forgive me, I'm not very familiar with bpy.app.handlers and their management, I still have to learn a lot about it

What if I have a for loop with the render as the final step, and I don't want another functon afterwards, just the loop to go into the next step? I can't find how to do this.

Blender's API documentation shows how to use the application handlers. In order to execute a function after rendering is complete, you can use one of the following two handlers:

bpy.app.handlers.render_post - Executed once after each rendered frame
bpy.app.handlers.render_complete - Executed once after all frames have been rendered

The function you want to execute is appended to the list of handler functions through append(some_function), where some_function is a reference to a function. It needs to take one argument, because an object of bpy.types.Scene will be passed to the function. Example:
def some_function(dummy):
    print("some function")

bpy.app.handlers.render_post.append(some_function)

If you later want to remove the function from the list of handlers, simply use remove(some_function). Example:
bpy.app.handlers.render_post.remove(some_function)

import bpy

def some_function(dummy):
    print("some function")

def some_other_function(dummy):
    print("some other function")

# Will be executed once after each rendered frame
bpy.app.handlers.render_post.append(some_function)

# Will be executed once when the whole rendering process is completed
bpy.app.handlers.render_complete.append(some_other_function)

bpy.ops.render.render('INVOKE_DEFAULT', write_still = True)

Thanks to your answer I understood a lot of what I have to do. In your opinion, can I put bpy.app.handlers.render_complete.remove (my_function) inside my_function? It seems to be working, but I don't want to create possible crashes

That should be completely fine.

This brilliant answer should be a part of Blender documentation, i too found the blender docs pretty unclear especially in the aspect of how handlers are fired while rendering animation

i wonder now when render_init gets called when rendering animation

The strange thing is that rendering isn't actually complete in the render_complete handler.  You can tell this if you create a timer in the render_complete handler and then put this in the timer:
if version >= 3300:
        if bpy.app.is_job_running('RENDER'):
            print('render has still not completed')
            return 0.0001

The timer wont start running until Blender returns to the main thread (cycles runs in it's own thread), and even then it will keep printing 'render has still not completed' for a short while.
This is problematic because it means you can't safely launch a new operator.  I've also noticed that the timer intermittently doesn't even get created, any ideas why that could be?


text:
How to set the newly added material to an object as "active" (or selected) material
I add a new material created by this little example :
ob = bpy.context.active_object
mat = bpy.data.materials.new(name="Example Material")
ob.data.materials.append(mat)

I noticed that the material is added but not active, as in the normal practice of adding blender materials bpy.ops.object.material_slot_add ()
I was wondering how to do this simple step, I tried with ob.active_material = mat, but is wrong:
Edit:
This is what I get, it creates confusion and does not set the active slot correctly:

I would like to get this:
Note that the newly created slot is selected by default (which is what I would like to get)

@batFINGER Ty bat, i edited the question , because ob.active_material = mat create many problems

Sorry my mistake, set the active material index, to newly added slots index.

@batFINGER Is there an answer I can refer to on this site? (like an example)

To select the last appended material (which corresponds to a material slot in the UI), you can set active material index:
import bpy

ob = bpy.context.active_object
mat = bpy.data.materials.new(name="Example Material")
ob.data.materials.append(mat)

# As appended the new material slot index is len - 1
ob.active_material_index = len(ob.material_slots) - 1

Thanks lemon , this is exactly what I wanted


text:
How to scale plane 2d with bmesh and floatproperty in ui?
THe classic method of scale 2d object is like to
###some script to configure ob data bmesh etc.
pivot = Vector(0.5,0.5)
scale_factor = 0.9 decrease scale example

for v in bm.verts:
    v.co -= pivot
    v.co.x *= scale_factor
    v.co.y *= scale_factor
    v.co += pivot

but i whant controll the scale with floatproperty in ui panel like to
pivot = Vector(0.5,0.5)
scale_factor = my_float_property

for v in bm.verts:
    v.co -= pivot
    v.co.x *= scale_factor
    v.co.y *= scale_factor
    v.co += pivot

Clearly this cannot work, I tried to declare a previous value in another floatproperty, so I tried:
def myfunction(self,context):
    custom = bpy.context.object.mycustomclass

    pivot = Vector(0.5,0.5)
    scale_factor = 1- (custom.my_float_property-custom.last_float)

    for v in bm.verts:
        v.co -= pivot
        v.co.x *= scale_factor
        v.co.y *= scale_factor
        v.co += pivot

    custom.last_float = custom.my_float_property

but have some problem,it is not accurate.
Any idea how to control the scale with a slider, in fact (my_float_property)?

Use a setter getter on the property

Can keep the previous value of a property using the custom property ob["scale_factor"] to store the previous value.
Warning will cause an issue if you hit exactly 0.0, which may need to be handled in some way.
import bpy

def draw(self, context):
    layout = self.layout
    ob = context.object
    layout.prop(ob, "scale_factor")

def set_float(self, value):
    prev_sf = self.get("scale_factor", 1)
    sf = value / prev_sf
    self.scale.xy *= sf
    self["scale_factor"] = value

def get_float(self):
    return self.get("scale_factor", 1)

def register():
    bpy.types.Object.scale_factor = bpy.props.FloatProperty(get=get_float, set=set_float)
    bpy.types.TEXT_HT_footer.append(draw)

def unregister():
    pass
    # TODO

if __name__ == "__main__":
    register()

I have done the scaling on an object level here. For a mesh could use bmesh and
bmesh.ops.scale(bm,
        vec=(sf, sf, 1),
        space=Matrix.Translation(-pp), # pivot point (x, y, 0)
        verts=bm.verts)

or simply make the scale and translation matrices and
import bpy
from mathutils import Matrix, Vector
pp = Vector((1, 1, 0))
sf = 2
me = bpy.context.object.data

Sxy = Matrix.Scale(sf, 4, (1, 0, 0)) @ Matrix.Scale(sf, 4, (0, 1, 0))

me.transform(Matrix.Translation(-pp))
me.transform(Sxy)
me.transform(Matrix.Translation(pp))

Your script works beautifully, thanks!


text:
Best way to load image from list python script
For some reason i have append images , now i want load all image by step.
image_path  = C:
image_list= []
for fn in os.listdir(image_path):
    image_list.append(fn)
    ###first_image = bpy.data.images.load(image_list[0])  <----?
    ###second_image =  bpy.data.images.load(image_list[1])   <----?

Try this to batch load a list of images in a folder:
import bpy
from os.path import join, isfile
from os import listdir

imageObjects = []
imagePath = '/users/you/yourImagePath'
imgFiles  = [
    join( imagePath, fn )                    # Create full paths to images
    for fn in listdir( imagePath )           # For each item in the image folder
    if isfile( join( imagePath, fn ) )       # If the item is indeed a file
    and fn.lower().endswith(('.png','.jpg')) # Which ends with an image suffix (can add more types here if needed)
]

# Load entire list of images
for imgFile in imgFiles:
    # Add to image object list to use later
    imageObjects.append( bpy.data.images.load( imgFile ) )

# Load a specific index from the list (5th in the list in this example)
imgObj = bpy.data.images.load( imgFiles[4] )

ty but i have to load not full image list because have  some variable by controlling the loading , i have to know the way by load single image from list. for example the first image of the list and in the second step , load second image.

@Andrea see edit and LMK if this is what you meant

Sorry @TLousky in the first time i put name of node with diffuse = nodes.new(type='ShaderNodeTexImage')
diffuse.location = (-600,550)
diffuse.name =  imgFiles[0]  now name is all path of image.. in the first time is only image name. an idea?

try to replace the imports from os.path and add basename. Like this:  from os.path import join, isfile, basename. Then use it in the diffuse.name: diffuse.name = basename(imgFiles[0]). Basename extracts the filename from a full path.

Work very fine is very usefull, ty


text:
How can I have objects in second scene be affected by lighting?
I have an FPS, the weapon is a part of the HUD, and I want it to be affected by lighting in scene 1. I can have it be affected by sun and main things, but it wont work when your character moves and there's a spotlight or a point light. How could I make objects in other scenes be affected by lighting in the main level scene?
-I have gotten a great answer but no .blend; therefore, I will ask kindly for another answer.
Place steps, and a gif(Recommended: http://recordit.co/), and post a .blend. Try to avoid python as much as possible. Sorry this might be asking for too much, but the answer is sitting there, just do it. I want it to be the best type, that is, have it be affected even by walls in the first scene. In other words, I want the weapon to be JUST as it would be in the regular scene but another. Thanks!

Would it work to link the lamps into the second scene? (Ctrl L > Link objects to scene)

Im not sure, but in scene 2 the weapons are still. There are no movements

Ensure, that your spot light Energy is way higher. Also, ensure your weapon material has good material.
For starter, use a simple 50% gray material (no spec) and try to move it under the sport lights, which aren't showing up , and play with light energy.

One thing comes to mind:
Create the same light source in your second scene (weapons scene) at the same origin, with all properties being the same as the light source in the first scene.
Then save the transformation matrix of your camera from the first scene -> inverse the matrix -> and apply it onto the light source in the second scene.
This way the light source in scene2  will move according to the player movement (camera), and will affect the weapons in the correct way.

Now, to have even more realism, we would want to stop seeing the light affecting the weapon, when the player is outside the direct reach of the light source. The simplest solution would be, casting a ray from the 8 corners of the bounding box (bbox) of the player, towards the desired light source, if any of them gets to the light source without hitting any obstacle on the way (we assume no transparent objects), than some part of the player is still in the light, so we set a flag, like so: bool inLight = true.
This flag is used in the second scene, and we compute the light affecting the weapon, only if the flag is true...
Now if you like to be even more specific than that you can create a bbox in scene1, in the place where the weapon would be, and do the same procedure. However, I wouldn't bother going into so much detail in a game (keep it lighter), especially in a FPS game.
What I would do to achieve a similar effect for an FPS game is just cast a single ray from some offset from the front of the character (presumably where the weapon would be) and proceed with the check.

As for the ray-tracing check, in the case that you do not have a space partitioning algorithm (octree, kd-tree, etc), you would have to check the ray, brute force, against all objects (not very nice, especially in a game), so I suggest at least having a Bounding Volume Hierarchy to store the objects in your scene, as that would optimise things, and I strongly recommend using a spacial partitioning algorithm too. However prove that it works first, with the easiest way! Slow and correct is better than quick and wrong! Not always true for games though. ;)

My computer doesn't work as of now but I'm sure this works. I will accept this answer at the end of the bounty unless I get a better answer.

Well, in theory it should work. However, even if it does it wont be perfect as it wont take into account other objects and thus, being in shadow (if the player is behind a wall - hidden from the main light source, the weapon will still be lit) There are ways around this but it can become quite involved...
Do let me know if that has worked in the first place, I will edit if i think of a better solution.

Yeah as I said I don't have my PC right now. It would be nice if you could explain how do do it, even throught walls.

Can you place a .blend?

You mean, place a .blend in the 2nd scene? I wouldn't think so. .blend is a project file, hence that would mean you are working on separate projects. Keep them in one place, you can export and import objects or even append objects into a scene, see this thread: http://www.blender.org/forum/viewtopic.php?t=8799

No I would like a .blend as an example, lol.

I wouldn't be able to help in that manner, at least until the end of the month as I am very busy at the moment. Cannot promise, but will look into it in more depth after that.

Well whatever you can, I just hope you will. Take your time.

I believe it has been FAR more than a month, now can you post a .blend? I hope you're not a take the rep. and run, but actually keep the help. That is all I want, a .blend of the result.

How do I even access "transformation matrix"

Hey, sorry for taking long, however I don't have the time. I wont be able to do the scene for you. But don't give up on it... if you have specific questions (as the one above) the community here will answer and help you out.
Now to get transformation and the it's inverse all that needs to be done is the following on the active object...
myInverse = Matrix(bpy.context.object.matrix_world).inverted()
... make sure you use inverted() rather than invert() as the latter will apply the invert matrix to the object, but you want it copied over.

I don't know how to write python, I have made a lot of progress through complex logic bricks; I thought there is a simple technique for this.

I don't have much experience with logic bricks (so you might be able to do it with them too). However I suggest you try writing something with python because all that the logic bricks do are 'visualise code' ... if you can rather write it in code it would be much cleaner, and perhaps you would have much more freedom. Checkout a blender python game engine (e.g. https://www.youtube.com/channel/UCuGWRbFrq3bZkOEpQ02Xpww has quite alot)
Logic bricks and nodes can get very messy once things get complex, something that a code implementation wouldn't have.


text:
Set Object Position
I have a question that may or may not be confusing, so bear with me. In my characters right hand, their are two states. One state is for walking around without a weapon equipped, and the other state has his hand just pointing outwards as if a gun were in his hand. I don't need an animation in the weapon state, but I want the hand to stay stuck pointing outwards. How do I achieve this? -No python pls.

I am not sure I understood this, but...
If your weapon does not stay stuck out when you press key to do it, than your logic syntax should be like this:
Always(pulsed) -> And(state1) -> Weapon not stucked out(IDK what do you use for it)
Keyboard(the key to switch) -> And(state1) -> State(set state: 2)
Always(pulsed) -> And(state2) -> Weapon stucked out
Keyboard(the key to switch) -> And(state2) -> State(set state: 1)
This should work, but I am not sure so that is what you want. Anyway, in my game this syntax did not for for some reason. I use 2.72b. When I did it all, it just did not change state when I pressed the key to do it in-game.
Good luck with it, anyway!;)
Edit:
If you ask how to make weapon position in each of the states, use this:
For weapon equiped:
Make tabs as in default view(3Dview in center, timeline on bottom)
Select first frame.
Position weapon as you need it to be positioned.
Press I and select LocRotScale.
Go to logic tab and in Weapon not stucked out(which I shown on top) select action.
Make it play, TheWeaponMeshNameAction in list of aviable actions and frist frame:1, end frame: 1.
Do the same for weapon unequipped, but put it in frame 2 and select frame 2 in action.
In second state I would reccomend you to make weapon placed in character's belt or something...

I asked basically if there was a logic brick or something to hold position.

Maybe use always with pulse and states. Always should hold position and states should switch between 2 always actuators. But use pulse in always...

I know that, but what are the bricks I would use? Always > And > ?

I think it might be Action. Use action and frame, in which you set weapon position to the one you want in each situation;)


text:
Collision Bounds/Mask not working?
I have a .blend showing an exact copy of the objects that are in my game, but just simplified without any models. I have a head, a torso, rigs for the head and torso, and collision bounds along with the floor. The floor will act as a map. I am trying to have things collide with only certain things, but it doesn't seem to work. In my game, I need the collision bounds to only collide with the map. The head and torso should not collide with anything except projectiles (the floor in the .blend provided). The projectiles should collide only with the map and the character (head and torso). The .blend provided includes all the objects with names to help. Anything is appreciated, thank you!
EDIT: It seems like it does not work because of the parenting, I still need the parenting the way it is. Thus you need to make a script or do something in order to have the parenting not affect the collisions.

Can't you just move the different objects to different collision groups?

No one knows how to solve this?

If you don't mind my asking, why are there two armatures for one object? I was also wondering why didn't use an Empty as the base for you item. I haven't really gotten around to playing with the game engine yet, so I don't know if there's an actual reason for using the boundary object as your base object.

Well, I use more armatures for the mouselook. The mouselook is according to the rig, not the object. I use the bounds as the main object as it is the dynamic piece that is controlling everything when moving. It is not the collision bounds for bullets though, i.e. head and body.

@BlenderDev you have an answer! quick!

It was not necessary to change the parenting at all, or use python.
Your main problem was that you had not checked the check box labeled Ghost

It is also important you change the settings for the collision group and the collision masks.
Basically the head and torso are on collision group 2 and are masked so that they can collide with Every Other collision group except for the first. This is because the ground is on the first.
The main collision group is set so that it can collide with everything Except for collision group 2, because the bullets are on that group.

Notice that ghost is Not checked on bounds. This is because it needs to be able to collide with the ground. It is masked so it can collide with everything except for collision group 2, because the bullets are in that group.
The last important change you need to make is on the bullets themselves.
This is on the same collision group as the torso and head, so they can collide with everything and not cause a problem. because the collision bounds object is on collision group 1, and because it is masked so that it can not detect collisions with the bullets, the bullets will pass through them harmlessly. However, the ground is also on collision group 1,

Using these methods, the end result is that the bullets can collide with the head and torso, the head and torso detect collisions with the bullets, and can decrease health/armor accordingly. The main physics object (bounds) can only collide with the ground. the bullets can also collide with the ground.

And how will the body collide with projectiles if its a ghost?

Just a sensor. I see.

Yeah, I wanted the bullets to actually collide with the body just in case for the future, I will vote up and accept but I hope you can fix.

However, doing this will make your bullets no longer be able to react with the floor.


text:
How to implement "air-strafing" in the BGE?
Introduction
What exactly is "air-strafing"?

Air strafing is a technique in which a player would sync strafe keys and mouse movements when in-air. (For example, if you press the right strafe key, you would move your mouse rightwards smoothly as you hold the key).
It had spawned an exploit - a player can exceed maximum velocity; this will give the player additional speed.
It was unintentionally created (as a bug) back in Quake.

Reasoning
So why exactly does air-strafing work? What is the specific anomaly/cause?

Instead of limiting velocity directly, only the projection of the current velocity onto acceleration is limited.
This way, in certain scenarios, the velocity projection is less than the actual velocity!

About mass - you can multiply the accelerate by player.mass.

@Adrians Netlis I am certain that applyForce() already incorporates mass with the force it adds. The problem arrives when the to-be-added velocity is truncated. This fixes problems with velocity (to avoid passing the cap); however, the player will decelerate when he is reaching his maximum velocity. He will accelerate at what seems to be a fixed rate, but will start to accelerate more slowly as he gets near the cap. This creates for an unwanted result: the player will never reach his maximum velocity. He may, but I have not seen it happen; the player will get very near.

You can remove translation damping. However, this behaviour is more than realistic. It is what's known as drag force. You should be happy that it accidently appeared there:D

Ahah! I found it! The entire time I was using player.getLinearVelocity(), not player.getLinearVelocity(True). I assumed "True" was default. Although, I've spent tons of hours and have about ~25 .blend files with different approaches. Just about all of them worked when I fixed the velocity error. :<

I'll be updating the question and posting an answer and a .blend. ;)

Introduction

Refer to this page for an explanation of bhopping as a whole (air-strafing is a part of bhopping).
It seems that the original developers tried to do it the original way, but they've ran into an issue of some sort. They've then tried a different attempt, and this is where the exploit started.

Explanation
As mentioned, the following is the reason why this is all possible: instead of limiting velocity directly, only the projection of the current velocity onto acceleration is limited. Usually, you would have a value for max velocity and a vector for velocity. When the player intends to move, the difference from max velocity from the length of the velocity vector will be added (to the velocity). In this case, the vector projection of the current velocity and the normalized acceleration direction is used as the velocity length (, not the actual velocity length). The acceleration is a server-defined property that determines how much to add to the current velocity. Since the acceleration direction vector is normalized, this all works out: the acceleration is multiplied to the acceleration direction, and this value will be added to the current velocity vector. This is if the acceleration value is not truncated; the acceleration value is truncated if the current velocity projection plus the acceleration value exceeds the max velocity. It will be truncated to the max velocity minus the velocity projection.
Vector Projection
The vector projection of a on b is a vector whose magnitude is the scalar projection of a on b and whose angle against b is either 0 or 180 degrees.
Scalar Projection:

Vector Projection:

Unit Vector:

Alternatively, we can simply use a dot product.
Implementation in Code
import bge
from bge import logic
import math
from mathutils import Vector
import numpy

cont = logic.getCurrentController()
player = cont.owner
keyboard = bge.logic.keyboard
input_active = bge.logic.KX_INPUT_ACTIVE

#acceleration keysx
forward_input_key = "WKEY"    # Forward
backward_input_key = "SKEY"   # Backward
leftward_input_key = "AKEY"   # Leftward
rightward_input_key = "DKEY"  # Rightward

#acceleration inputs
forward_input = keyboard.events[getattr(bge.events, forward_input_key)]
backward_input = keyboard.events[getattr(bge.events, backward_input_key)]
leftward_input = keyboard.events[getattr(bge.events, leftward_input_key)]
rightward_input = keyboard.events[getattr(bge.events, rightward_input_key)]

#server-defined properties
svr_accelerate_air = 1.2     # These properties are server-defined. Increasing svr_accelerate_air will make
svr_velocity_max_air = 10     # air-strafing easier, and svr_velocity_max_air is the max in-air velocity

#properties
velocity = player.getLinearVelocity(True)
player["velocity"] = velocity.length

#accelerate_direction
accelerate_direction = Vector()

if forward_input == input_active:                    # Every tick, this will determine where the player is intending to go.
  accelerate_direction += Vector((0.0, 1.0, 0.0))    # Pressing any movement key will change this value.

if backward_input == input_active:
  accelerate_direction += Vector((0.0, -1.0, 0.0))

if leftward_input == input_active:
  accelerate_direction += Vector((-1.0, 0.0, 0.0))

if rightward_input == input_active:
  accelerate_direction += Vector((1.0, 0.0, 0.0))

accelerate_direction.normalize()    # This is crucial to the result!

#accelerate
def playerAccelerate(velocity, velocity_max, accelerate_direction, accelerate):

    velocity_projection = numpy.dot(velocity, accelerate_direction)
    velocity_accelerate = accelerate

    if velocity_projection + velocity_accelerate > velocity_max:    # Here, we truncate the acceleration value
        velocity_accelerate = velocity_max - velocity_projection    # if it will make for an unbalanced total velocity.

    player.localLinearVelocity += accelerate_direction * velocity_accelerate    # Acceleration multiplied by accelerate_direction will be added
                                                                                # to the current velocity. This is why normalizing the vector
                                                                                # is crucial!

#apply acceleration
playerAccelerate(velocity, svr_velocity_max_air, accelerate_direction, svr_accelerate_air)    # Execute playerAccelerate() every tick. This is
                                                                                # done in this format to make adding ground acceleration
                                                                                # easier to implement.

Notes

The variables use "air" in the name as, in order to create a full movement system, ground acceleration will also be needed. Ground acceleration will have its own set of values.

Final Result
I have compiled all the work in a .blend file very neatly. Hopefully, there is nothing misleading or confusing. Everything works perfectly (that I know of). The final result:

Notes

The file contains explanation and instructions for air-strafing.
Here is an example of the exploit: you can see that my velocity is over the server-defined max, but I am using air-strafing to exploit it!

Oh! And make sure to add velocity[2] = 0 after velocity is defined in order to make sure it's only the x and y axis, not z.

it's simple really,
just use seperate logic to apply forces on axis independently, and have each key only apply a cap to it's own directions
if keypressW.positive:
    if own.localLinearVelocity.x<10:
        own.applyForce((100,0,0),1)
if keypressE.positive:
    if own.localLinearVelocity.y<10:
        own.applyForce((0,100,0),1)

this way X(10) + Y(10) is greater then X(10) could ever be.

From observing the code, it just seems that there will be an unbalance of velocity when using this code: the player's diagonal movement (AW, AS, WD, SD) will be faster than usual. This is not strafing.

I am sorry, this is what I gathered you wanted from my initial read through, I have read it over again, and it is indeed complex, I will try and take a crack at it.

I just happened to find that all of my recent approaches seem correct. It just won't work, for adding force doesn't directly add to x, y, and z, but adds the given force over a period of time; this time seems to be determined by the objects mass. I have been trying different ways, but all I need is a way to directly add a value to the velocity, not adding a force.

Try using
if localLinearVelocity.x<= (max - incriment): localLinearVelocity.x += incriment

Ah. I can't believe I put up 150 reputation for this. The entire time I had the correct code, I just wasn't using what you've suggested. Other than one small bug that I think is an easy fix, everything works as expected. Thanks. I will be putting up an answer soon if everything goes well.

Well, I've stumbled upon many,  many more bugs. I'll hope someone answers. Otherwise, I'll keep updating this.


text:
Texture showing errors (edges of texture)?

Here I have a simple white-to-transparent image in the UV editor.

I've selected a plane thats in correct proportion in size to the image, and I've unwrapped it.

At first, it looks just fine.

When you zoom in or focus at the very edge of the plane, you can see a little error: the texture and unwrap goes from white to transparent, but the object is showing a little white part at the edge of the object. It is small, but it is very noticeable in play-mode.
How can I fix this? How can I have the texture not show these errors?

Black on black is not really good to notice anything. Please post images with higher contrast. I can't see what you mean

Yeah, my bad. But the last image is the edge of the plane - I've just zoomed in. I'll get to it when I can.

How about preparing a sample with more contrast e.g. solid white?

Does it show up this way in the render too, or only in the viewport?

Cause
I think the texture gets blurred either because it is scaled out or scaled in via automatic mipmapping texture.

Blur means the adjacent texels are considered when calculating the color.
It will include any texel outside the UV area. It even wraps around the around the texture's border (which is the cause of the effect you discover).

Solution
In both cases I suggest you shrink the UV-face that you get some border around the face (in UV-Editor).

Reference
See Avoid Seams in Textured Objects

This is a very recurring issue. Resizing tons of faces doesn't really seem to be an ideal solution. Is there a way to stop the "blur" rather than compensating for it?

You do not need to change tons of faces. Just to faces with the problem (corner to higher contrast colors and corner to texture border with higher contrast on the opposite side). And yes, when you know about that you can design your UV right from the beginning that way.

So, I'm trying out the solution. How exactly would this be done properly, so that the texture still covers the same amount of the UV image as before? In the above example the face is the entire image. If I have a larger image, the face will still cover the entire thing. Thus, I will shrink it down. But How much? In some specific areas I need to have the exact image/face scale so that it looks just like before.

I added images to the answer. I hope that makes it more clear. - To cover the same amount of texture ... increase the texture size and add a border to the image


text:
How to pack data into .blend with bpy.data.libraries.write
I have noticed that it is a discourse of which one speaks little, the correct way to write a .blend file and save objects etc is for example
data_blocks = set(bpy.context.selected_objects)
bpy.data.libraries.write("my blendfile dir", data_blocks)

But I noticed that for example my models, if I move the file to another computer, the materials are not displayed (purple object)
I was wondering if there was a way to "Pack into .blend" through the script like:
bpy.data.libraries.write(#pack into blend = True)
I need this for create a .blend file that has textures and images packed
without open new .blend file , "write" method think is incomplete because if i delete image or texture new .blend file loose the images/textures

Someone asked about it and tis is the answerthat was okayed.

Thanks for linking. I still think that the problem (as Pastrokkio correctly identified) is the packing. He's not complaining about models not showing up, but about texture files not being present. I kind of think the linking to the scene is the difference between a library file and a "normal" blender file. You can still import the objects fine from the library because they will be linked on import. Also I was wrong about needing to add more data: The scripts works just fine with what Pastrokkio has written if you just add the pack/unpack stuff.

I want to clarify that currently the object I write in the .blender file has all the textures, nodes, and images, but they are not packed, the problem is if i delete image folder or texture folder, i want pack the image into new file

@Lukasz-40sth this is not my problem , the objects have all in new file, the problem is Pack the image into new file

Edit:
Actually the assumption on what data gets saved was wrong
data_blocks = set(bpy.context.selected_objects)

is enough to get all the linked materials, nodes etc.
The script to pack the texture images works just by
import bpy
bpy.ops.file.pack_all() #Tells blender to pack images into the file on save
data_blocks = {*bpy.context.selected_objects, }
bpy.data.libraries.write("my blendfile dir", data_blocks, compress=True)
bpy.ops.file.unpack_all() #Tells blender not to pack images into the file on save

The option compress=True adds compression to the library file.
The Problem
I think the selected_objects data only includes the data of the linked object:

If it is a lamp it will contain brightness type etc
If it is a mesh it will contain the vertices, faces and the link/name to the materials assignes but NOT the material/nodegroups/textures itself.

Also the Images need to be packed
The Research
Taking a look at the api docs:
https://docs.blender.org/api/blender_python_api_2_77_1/bpy.types.BlendDataLibraries.html

import bpy

filepath = "//new_library.blend"

# write selected objects and their data to a blend file
data_blocks = set(bpy.context.selected_objects)
bpy.data.libraries.write(filepath, data_blocks)

# write all meshes starting with a capital letter and
# set them with fake-user enabled so they aren't lost on re-saving
data_blocks = {mesh for mesh in bpy.data.meshes if mesh.name[:1].isupper()}
bpy.data.libraries.write(filepath, data_blocks, fake_user=True)

# write all materials, textures and node groups to a library
data_blocks = {*bpy.data.materials, *bpy.data.textures, *bpy.data.node_groups}
bpy.data.libraries.write(filepath, data_blocks, compress=True)

The Solution?
import bpy
bpy.ops.file.pack_all() #Pack all images into the file
data_blocks = {*bpy.context.selected_objects,
*bpy.data.images,
*bpy.data.materials,
*bpy.data.textures,
*bpy.data.node_groups }
bpy.data.libraries.write("my blendfile dir", data_blocks, compress=True)
bpy.ops.file.unpack_all() #Will unpack ALL files in the current file.

If the pack_all() command does not  work or you don't want it, I think you could loop over all the images and pack them individually:
for image in bpy.data.images:
    image.pack()

I tested the code on packing images (as images) and for me at least it works

This code pack into another .blend file?

I'm 90% sure it does. To test, I started from a non saved startup file, added an image and created a library file. As the library file gets completely rewritten every time and the file was present in the library file this worked. I'll quickly recheck! Tested, worked.

it's important to don't  pack in current open .blend file

Ah ok, then I need to modify to unpack after the library file is created. Are there already files packed in the current file that shouldn't be unpacked?

It must compress them in the destination file. The current .blend file may also have uncompressed images. I need it to work regardless of whether they are compressed or not

Not sure if I understand you correctly: I am quite certain, blender doesn't do any compression (unless its lossless) if you save a file. I am not aware of a function that allows you to use some kind of proxy images. Of course the images the render operates at are uncompressed in memory, but should never bet touched in storage.

Need to pack from script the object with image etc from .write , i don't want open the new file,Otherwise I would have done it manually since the option exists in blender

I just tested the script again: With the minimal data_blocks = set(bpy.context.selected_objects). Blender saves the ONLY the textures connected to these (selected) Objects into the library file. To test it I created 2 objects with different textures. If selecting only one, only the texture used is saved to the library.   The pack_all doesn't do anything on it's own except to tell blender to include the external images on the next save.

That is the problem, i want pack image into my new .blend file

The this should solve it. Writing the library file with packing enabled tells blender to write the images as well! Basically bpy.ops.file.pack_all() behaves somewhat like a libraries.write(**, pack=True) option (which unfortunately does not exist/ is not documented).

I try but not work the .blend file created are not packed

I tested it with the internal also. You are aware, that with data_blocks = {*bpy.context.selected_objects, }, it will export the materials only for the selected objects. If you need to export for all objects in the scene, you need to either select all or change to the other script. Also you might be able to test with a new file, If the image gets packed the library file is much bigger.

Yes, but this is not the problem to be solved, it is like packing, the question is very specific, I apologize for being frank but I am looking for a specific answer

Exuse me for the confusion ,your code is right , that solve the problem , now have to get the status of pack option from preference

Nice to hear that it worked. Can you maybe formulate a new question about the status. You can check individual files by the answer given https://blender.stackexchange.com/a/93413. When you loop over all the images as the last code in my answer, you can check which are packed and which aren't. Once again blender has no global "all" packed or "all unpacked" because the pack_all() just sets a flag to pack on the next save action, it doesn't pack anything on its own.


text:
Best way to find the 2 closest vertices from a list of vertices?
Assuming there is an object, then a list of vertices that could be.
obj = bpy.context.object
for v in obj.data.vertices:
    #?print(closest vertex/vertices)###noob example

for example , how to find the closest vertices of v[0]?
is there any bmesh operator? or something really fast?

You could have a look at Blender's internal KDTree implementation.

Thanks this is very useful, but I'm still groping in the dark because I don't know how to approach, this example refers to some points, while I would like to refer to a list of vertices, and at the same time find the vertex closest to the one processed in that moment

Naively, this creates a look-up list of closest vertex indices.
import mathutils
import bpy

ob = bpy.context.object

# create a kd-tree from a mesh
me = ob.data
size = len(me.vertices)
kd = mathutils.kdtree.KDTree(size)
for i, v in enumerate(me.vertices):
    kd.insert(v.co, i)
kd.balance()

# create ordered list of closest vertex indices
closest_vIdx = []
for v in me.vertices:
    co_find = v.co
    closest_2 = kd.find_n(co_find,2)
    closest_vIdx.append(closest_2[1][1])

#Insert the index of the queried vertex here:
vIdx = 5707

print (f"vertex:{vIdx} closest vertex:{closest_vIdx[vIdx]}")

Bear in mind with this one:

The distances are in 3-space, not necessarily down edges.
Only the 'first' of any set of equidistant vertices is chosen

You wouldn't want to build the KDTree (or the closest list) more often than necessary - the best way of finding the closest vertex may depend on exactly if/when you want to modify the mesh, and would therefore have to rebuild the tree.

Yes, that is kd.find_n is the right function! Ty

What if i want to find the closest vertex in another object mesh, how to adapt the code ?

@WadeWang  The closest vertex in the target mesh to any vertex in the source mesh, or the closest to a particular vertex in the source mesh? (This may be worth posting as another question, having made that clear.. there are better scripters than me out there)


text:
How to use bpy.context.scene.use_denoising in Blender 2.8?
This give an error: AttributeError: 'Scene' object has no attribute 'use_denoising'
I know that in the previous version like Blender 2.79 the command to access use_denoising was:
bpy.context.scene.render.layers[0].cycles.use_denoising

How to access this in Blender 2.8x?
This question is very specific to use_denoising, so it has no precise answer except in this post (at the moment), I think it can be useful to many.
The answers are given by @ydvisual and @batFINGER has specified an important question.

Does this answer your question? Blender Python and pass settings

There is a distinct difference between command, property (class attribute) and parameter.

@p2or You're absolutely right, I corrected the question

Try this:
bpy.context.scene.view_layers[0].cycles.use_denoising = True

Or context.view_layer.cycles.use_denoising

@batFINGER Do you think using bpy.context.scene.view_layers [0] could get errors in particular situations?

The context view layer may be view_layers[0] or  view_layers[1].... for each vew_layer in scene.  In general we are interested in changing objects that have context.   If you wish to change for all viewlayers in the scene would then use for vl in scene.view_layers:  Could say it's never a good idea to use first object in a collection if you are not sure that's the one you wish to update.


text:
Correct way to delete double material on object by exact words inside
I try to excluding objects except 4 types, the objects in question have these letters in the name, but they are not always in the same place, for example ".Type1.001" to delete duplicate material , the script without the list work fine:
import bpy

mat_list = bpy.data.materials
scene = bpy.context.scene
obj_list = [".*Type", ".*AnotherType", ".*Example", ".*AnotherExample"]
patch_list = re.compile('|'.join(obj_list))

get_objs = [obj for obj in scene.objects if  obj.name == patch_list ]

for o in get_objs:
    for slot in o.material_slots:
        if slot.material.name[-3:].isnumeric():
            if slot.material.name[:-4] in mat_list:
                slot.material = mat_list[slot.material.name[:-4]]

return

Match the compiled re
Not sure you will ever get ob.name == patch_list recommend using patch_list.match(str)
>>> "xxxxType1.001" == patch_list
False

>>> patch_list.match("xxxxType1.001")
<re.Match object; span=(0, 9), match='xxxxType1'>

>>> patch_list.match("xxxxType4.001")
<re.Match object; span=(0, 9), match='xxxxType4'>

>>> patch_list.match("xxxxTpe1.001")
>>> patch_list.match("xxxxTpe1.001") is None
True

In question code
import bpy
import re

scene = bpy.context.scene
obj_list = [".*Type%d" % i for i in range(1, 5)]
patch_list = re.compile('|'.join(obj_list))
get_objs = [o for o in scene.objects
        if  patch_list.match(o.name)]
print(get_objs)

on your edit.  I'm not sure this changes anything.  Below I've simply added a names list of potential names of objects and how they match.
To repeat I dont think any object name is ever  going to be equal to a compiled re object.  name == patch_list hence your get_objs list will always be empty.
import re

obj_list = [".*Type", ".*AnotherType", ".*Example", ".*AnotherExample"]

namelist = ["SnoopType", "Frog", "DogisAnotherExample.001"]
patch_list = re.compile('|'.join(obj_list))

get_objs = [name for name in namelist if  patch_list.match(name)]

print(get_objs)

results in
['SnoopType', 'DogisAnotherExample.001']

forgive me, I asked the question incorrectly, because is an example but not have number list, now re edit my post so that everyone can understand better

That is the way ! Ty batFinger


text:
Rotation problem when using bezier interpolation
I have built an helicopter and I rotated its propeller, when I used linear curve interpolation everything went fine. However, when I changed the interpolation to bezier it keeps rotating back and forth. I am using Blender 2.91.2.

The rotor would only need bezier, when starting and stopping, going from zero to full speed, and back to stillness. Once it reaches a certain RPMs, the rotation should be the linear, sustaining the same speed. Also keep in mind that there is a point where, depending on the frame rate, the rotation seems to go backwards, not because it is actually going backwards, but because of how we perceive motion. On some films you will see the wagon wheels running backwards or the tires of cars or trains as well. See: https://io9.gizmodo.com/why-do-wheels-sometimes-appear-to-spin-backwards-1593807400

Thanks for your reply. However, I do not think this is the problem, otherwise, when I changed to linear interpolation I would see the "whell effect", but that not happens.  What is important to mention though is that if I set the amount of rotation not too high this does not happen, no more than 4000, it works fine, if more than that, it start fast and decrease the speed a lot then start increase again. But again, this does not happen in linear interpolation.


text:
How to fill a color inside circle in grease pencil
I have to fill a circle with yellow color but if I use fill tool it just fills the borders. I want to fill the inside.
Here is a picture for example:

I just want to fill the inside with yellow by one click, rather than using a brush tool.
Thanks.

You may need to change the selected Material. By default it will be "Solid Stroke", if you select "Solid Fill" before you use the Fill Bucket tool - it should fill the body of the circle.
Long story short - You need a material will a Fill color enabled. You can also change the settings of the current material.

Use a combination of stroke and fill.


text:
All my objects move together as if they are linked
I have this problem: all of my objects are linked, I don't know what I did for that to happen. Even if I add an object and I move another, it will move the object I've just inserted.
Here's my problem in video: https://kapwi.ng/c/edUbpldI

Hello :). This looks like you enabled Proportional Editing (Shortcut: O to disable).

Thank you very much @JachymMichal, it worked!

Literally the same issue haha. I love finding out that I'm an idiot. Thanks, @jachymmichal!!!

@JunoSprite No problem, this happens to everybody at some point :)). Good luck with your project :)


text:
How can I etch a perfectly straight line into a sculpted model?
How can I etch a perfectly straight line into a sculpted model? I sculpt heads for ventriloquist dummies. I want to etch straight and parallel slot lines on either side of the mouth. Thank you.

You might want to try using booleans, just create some cube objects in the right spots and add a boolean modifier to the head and select the cube as the carver.

Hello, please post a picture of the expected result and the starting mesh

you can also use: crease + space with stabilize strokes in sculpt mode or strokes lines


text:
Mist pass looks noisy
I have a following problem: when I render my final image with mist pass, the mist pass itself becomes noisy, see in these images:

Mist pass combined in image:

Mist Pass itself:

Could the problem be that I am using complicated objects in  my scene (grass particles, volumetric fog, etc.)? How one would proprely render mist pass?

Please use the built in tools
to add images to your posts. Use any image editor or online optimizer
if you must resize an image.
Information should be displayed in this page to help those who would answer your question.

Since there is a part of grass without noise, it seems to be something with material. Try to disable some elements in the scene to see if issue persists.

T66149 T65887 possibly related to these two bugs.

@HISEROD Yes, seems like that. I was thinking about fogy clouds in the scene so I placed a plane with transparency into scene and it results like his screen. https://imgur.com/FwxzlHk

Seems that removing these particle systems and fog helps. So it is probably a bug then.

You may be able to remedy the problem by using the despeckle or denoise nodes.

If I understand you correctly, you mean that I should blur the mist pass in compositing process?

I had a similar problem once with a grass particle system.
The issue arises when there are insufficient light paths for rendering.
Try increasing the light path counts. Depending on your materials, it varies which one you have to tweak.

If you don't want to increase the overall rendertime you can add a Denoise Node right after the Mist path, before you mix Mist and RGB together. (I wouldn't recommend this)


text:
Black contour artifacts when using OpenEXR renders with bloom and transparency background in VSE
I try to render some shapes with EEVEE bloom effect and transparent background.
I understood that the rendered file output had to be OpenEXR instead of PNG format in order to keep the effect and the transparency.
Nevertheless, when opening the OpenEXR files into the VSE, and adding a background clip, there are always some black contour artifacts around the rendered shapes.
How could I get rid of that and have it done properly from the beginning ?
Blender version used is 2.90.
Note : I tried to tick the use alpha box in the compositor. It works better but the colors are changed.

Try compositing directly in the compositor using an Alpha Over node, not in the VSE.

Does this answer your question? EXR Transparency Border with bloom and glare

At first I thought it has something to do with the blend mode of the material (settings panel: Opaque, Alpha Clip, Alpha Hashed, Alpha Blend). But, that seems not to be the matter.
The reason of this artifact lies probably within the AlphaOver blend mode in the VSE. You can find a very nice explanation with CGCoockie (Working with Alpha Edges for Compositing in Blender).
A possible work-around is the following:

Duplicate the strip with the 'blooming'shape.
Set the Alpha attribute in the Source panel to "Straight".
Increase the scale of the duplicated strip a little untill the black artifact is covered.

As susu mentioned above, transparency works well in the compositing window. So I don't understand why it should be different in the VSE (it sounds like a bug to me).

As susu mentionned, another workaround is to use the compositing window with an alpha over node :


text:
Some areas of the mesh are dark (Shadow artefacts)
I've been modeling a hermit crab and I don't know why but some areas of the mesh are really dark on some spots, like the legs and the claws.

I hope you can help me fix it.

Try to select all mesh in Edit Mode and press Ctrl+N to Make Normals Consistent... did it help?

I've already try that it didn't work

can you upload your .blend via this link so I can take a look at it?
http://blend-exchange.giantcowfilms.com

Related https://blender.stackexchange.com/questions/27982/how-to-avoid-terminator-artifacts-while-still-using-smooth-shading-and-the-new-p

This is called shadow terminator artifact and happens with some render engines on low poly meshes. It is a limitation that Cycles has, devs know about it.
Bug T37814: Artifacts in Cycles render for lowpoly models

The solution is to increase the polygon count.
The black on the silhouette is another kind of artifacts you might encounter called rejection sampling - also does go away with polycount.
You can change also the shading method. Your whole surface is set to smooth - it is interpolating the surface normals making shadows where there probably shouldn't be. You may want to turn on Auto-smooth or set some sharp edges:
How to smooth shade an object while retaining hard edges?

Since Blender 2.9 you can now easily fix the Terminator Effect that you show, just tweak the Shadow Terminator Offset value in the Properties panel > Object > Shading:

Also, when rendering with Eevee, check if Contact Shadows option for your Light source is on. This option tends to give similar edgy-looking shadows in render, even with Subdivision Surface.