text:
How to move modifiers of multiple objects up or down?
I would like to move a modifier (which I have already identified) to the bottom of the list of existing modifiers. Unfortunately it does not work and I don't get why...? However, if the object is active, it moves perfectly to the bottom:
#ob = my object, not necessarily it must be selected, it is found by a function
#smooth = #my modifier (found through a function)
for m in ob.modifiers:
    bpy.ops.object.modifier_move_down(modifier = smooth.name)

This only works if the active object is ob. Do I have to override the context? There is a similar question to this but I have no idea how to apply this in my case.

It seems that I have solved my problem by overriding the context members:
for m in ob.modifiers:
    c = {}
    c["object"] = c["active_object"] = ob
    bpy.ops.object.modifier_move_down(c ,modifier = smooth.name)

Any thoughts? Is there a better way of doing that?

I guess you mean to the top right? See: https://blender.stackexchange.com/q/98891/31447

Ty @brockmann I had already taken a look at this question, but I see that it is practically the same thing that I am doing, the problem is precisely that bpy.ops seems not to work if the object is not active and selected . Please correct me if I'm wrong

WiP... A comprehensive list of operator overrides

Override the context by passing the actual object {'object': obj} to bpy.ops.object.modifier_move_up() or  bpy.ops.object.modifier_move_down() operator.
Example on how to move all subdivision modifiers by name (they are usually called 'Subdivision') of multiple objects to the top (position 0) in the modifier stack:
C = bpy.context
mod_name = "Subdivision"

for obj in C.selected_editable_objects:
    # Test whether there is a modifier called "Subdivision" at all
    if any(m for m in obj.modifiers if m.name == mod_name):
        # Iterate through all modifiers in reverse
        for mod in reversed(C.object.modifiers):
            # Move the modifier as long as its position is 0
            while obj.modifiers.find(mod_name) != 0:
                bpy.ops.object.modifier_move_up({'object': obj}, modifier=mod_name)

Related questions:

Move modifier to the top of the stack through python?
How can I put a modifier at the top of the modifier stack?


text:
iterating through pose bones to change Euler
I'm trying to change all the pose bones Euler with a script. My failed idea is this:
for bone in bpy.context.active_object.pose.bones:
print(bone)

This gives me
<bpy_struct, PoseBone("thigh_ik_target.R") at 0x7f8061bafef8>

But all I need is just the name of the bone.
"thigh_ik_target.R"

So can use
for bone in...

To loop through all the bones to change the "rotation_mode" with
bpy.context.object.pose.bones[bone].rotation_mode = 'XYZ'

Should I try and extract the name of the bone from that printed statement and put it in a variable?
Any ideas?

Thanks for clarifying that.

I figured it out from this post
import bpy

selection_names = bpy.context.active_object.pose.bones

for i in selection_names:
    bone = (i.name)

    bpy.context.object.pose.bones[bone].rotation_mode = 'XYZ'

source: Stack Exchange

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

sort: votes


text:
Complete beginner question, merging vertices
So I've been trying to learn blender, and I wanted to make a gun model. I got a reference image, and I've been trying to merge some vertices in a way that looks like this:
https://i.imgur.com/rf3nrln.mp4
Unfortunately, the result looks like that:

https://i.gyazo.com/b30627e966835efebd77756330f7c54b.png
I could make it the hard way and connect the vertices from both sides like this:
https://i.gyazo.com/cac033f1ca0cc122a8bbcd666a763564.mp4
But it isn't really effective. Is there a way around it, or do I have to do it like that everytime? Sorry If my english is broken, but I hope you'll understand what I mean.
Thanks in advance!
edit: I've been trying to make that the images show up without entering the external links, but I couldn't do that, sorry!

Hi. For images to show up they should be added using the built-in uploader. See: https://meta.stackexchange.com/questions/75491/how-to-upload-an-image-to-a-post

Alrighty, I'll keep that in mind the next time I'll decide to post something. Thank you very much for your help!

To merge vertices to corresponding vertices on another loop..
Select the sections of the loops you want to merge, (with an equal vertex count)
 and use CtrlE > Bridge Edge Loops, with the 'Merge' option checked in the Tool region, or Options panel in 2.8.

as Ray Mairlot has commented, you may intend to merge vertices at opposite ends of existing edges.. in which case you would AltCtrl select the edge ring, followed by X > Edge Collapse.

In this case it looks like ther eare already faces inbetween their vertices, in which case, Edge Collapse would be better.

@RayMairlot you could be right.. I'll edit...

Edge collapse worked, thanks for your help. I really appreciate it!

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


text:
how to create a Pop up dialog and link the property to an object
I am still really new to Python and I am working through some new things. I would like to create a Pop up dialog box that the user can input some text. I would like to then use that Text for something else, for example changing the Name of the default cube.
I have read through some posts and I see that creating the pop up dialog box is pretty simple but I am not sure how I can then use the user's defined text for the object name.
Here is what I have so far (which is just the pop up dialog box which works fine) I need to know how I can then use the text that the user inputs into that Dialog box and use it to change the name of the cube.
import bpy

class WM_OT_myop(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "wm.myop"
    bl_label = "Simple Object Operator"

    text = bpy.props.StringProperty(name="Name", default="")

    def execute(self, context):
        bpy.data.objects['Cube'].name = #rename cube to User Input?

        return {'FINISHED'}

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

def register():
    bpy.utils.register_class(WM_OT_myop)
    bpy.ops.wm.myop('INVOKE_DEFAULT')

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

if __name__ == "__main__":
    register()

Edit, Thanks to @Matt's explanation I made an addition:
text = self.text

here is the full script:
import bpy

class WM_OT_myop(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "wm.myop"
    bl_label = "Simple Object Operator"

    text = bpy.props.StringProperty(name="Name", default="")

    def execute(self, context):
        text = self.text
        bpy.data.objects[0].name = text

        return {'FINISHED'}

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

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

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

if __name__ == "__main__":
    register()
    # test call
    bpy.ops.wm.myop('INVOKE_DEFAULT')

Complete example: Is there an addon for renaming an object with a keyboard shortcut?, Related: How to call a confirmation dialog box?

Also recommend using context.object.name = text in execute to rename the active object. As it is it renames the alphabetically first named object of all objects each time.

@p2or It's good to see the examples, Thanks for sharing!.

@batFINGER Yeah I know it's probably better to use the Selected object rather than the object index, but at the time I wanted to rename the default cube.. I did later change it to the Selected Object but thanks for mentioning it!..

There are a few things to know, some of which are Python specific.
Firstly, text probably won't exist anymore by the time you call execute() because text is merely a local variable, not a class member. To make it a class member, simply declare it as self.text = bpy.props.StringProperty(name="Name", default=""). If you're familiar with C++ or C#, self is almost exactly the same as this.
Secondly, you probably want that declaration in a constructor for that class. The Python constructor is __init__(self) (it has two underscores before 'init' and two underscores after) which you declare the same as any other class method. Put code there that you want to run when an instance of the class is created, just like any other constructor.
Thirdly, I'm assuming that when you call bpy.props.StringProperty(name="Name", default="") it returns the text that gets typed into the dialog. If so, it should be as simple as bpy.data.objects['Cube'].name = self.text

Thanks for the response!.
I am not familiar with any other language (I only started with Python not long ago) so I still have a lot to learn.
I have not used init before, is there a template script I could take a look at?..
I made only one change to the script, and that was to add text = self.text (as you can see above) and it now works as I hoped.

Welcome to the Python family! I hope you pick it up quickly. This is a decent introduction to the concept of classes and Python classes in particular: https://www.programiz.com/python-programming/class Be sure to check out StackOverflow.com, where they will be able to answer Python-specific questions a lot more easily. Alternatively, feel free to find me in this chat I just set up for this recurring theme of "Python" : https://chat.stackexchange.com/rooms/104110/python-stuff

Maybe I'm missing something, but most of this answer doesn't seem relevant and possibly just incorrect in the context of blender add-on development. E.g. text = bpy.props...etc. is the correct way to define operator properties, init and self.text is not needed and the text property will most definitely be available when execute is called. The part of the answer that solves the question is the self.text part in the very last paragraph.

@RayMairlot since I am really new to Python, I am not sure what is relevant. I know that (as you mentioned) the part of the Answer self.text is what makes it work. As for the init? I am still not sure if that's needed? Probably not tho because it seems to work fine?

@Darkfall All you need is self.text. init certainly isn't needed for what you're doing and you won't find init in any of the blender templates relating to operators (Text Editor> Templates> Python - and I doubt you'd find init in any of the templates). One of the templates that might be of interest is operator_mesh_add, which shows creating and using properties exactly like you have done.


text:
Difficulty Exporting to OBJ - Texture Clamping
I have a model that utilizes clamping for its textures. When I export to OBJ, these clamps are lost and the model looks terrible. Is there a way for me to have the OBJ save the clamping?
So here is an image of the problem

The one on the left, that's how it's supposed to look. You can see an obvious difference on legs and pelvis, I'm sure.
These issue is, it doesn't seem to export the clamping. Is this really something that cannot be exported? I did not even build this model in blender originally.
It just seems like there has to be an easy fix for this that I'm missing.
So to break down what happens. I import the model into blender originally, it looks fine. I make some minor tweaks to it, still looks fine. I then export the file to OBJ via blender's export feature and it loses all clamping for some reason.

Possible duplicate of .fbx export why there are no materials or textures?

Hi and welcome to Blender Stackexchange. Please add more information to your question buy editing and adding images, because - you know... "looks terrible" is such a broad term, it could mean anything.

@metaphor_set thank you, I made some changes based on your comment. Hopefully this make it more clear.

@DuarteFarrajotaRamos I don't think that answers my question. It's not a lack of textures. It's just texture clamping. My textures appear, just not correctly. I have to imagine something as simple as texture clamping can be exported. Perhaps I'm wrong though


text:
Object (head shaver) is bubbling/moving after rendered?
Object moving on it’s own when rendered! (EEVEE)
In the cli[ you can see that the head is bubbling/moving. This when the head had no keyframes,no empty, no link to anything. It only has a Bevel and Sub. Modifier.
Does anyone have any idea why this happens? I checked the internet but most there was related to an Empty or keyframe.
I haven’t used the boolean. It was build up with a plane. Used the modifiers and some edge bevel weights. And started out with a mirror but had applied that early in the process
I looked for doubles but there were zero. Also, I had applied the modifiers and rendered again but the same result? Ad when applying the modifiers the memory does up 3G :shushing_face:
I just don’t get it. I had this one before when I had made an octopus. In the end, I rendered every frame single handle that had a defense. But that is a hell of a job.
I just don’t get it?
See clip https://youtu.be/o8xzt7JRPgQ
Oh and the material is just a simple principled shader. Nothing extra

The camera is moving, not the object...

@thibsert   I know the camera moves :) But the object moves bubbling out of itself when rendered. See clip
https://youtu.be/o8xzt7JRPgQ

Sorry, didn't see the video :)

I found what caused it, I replied to OP on Facebook and posted an answer here.

I fiddled with the .blend and inspected rendering results between frames around 30-34 which were shading inconsistently. Turns out it's not about geometry or animations but the culprit is unused / misused Displacement-slot on the Material Output node of the material. Removing the connection (from multiply node and empty image node) to the Displacement slot solved the rendering issue. This slot should behave properly with an actual texture, you have to be feed it very small numbers. But I wouldn't be surprised if this feature was still a little bit unstable with Eevee.

@ Kheetor I really feel stupid now, missing something like that. Thank you so muts for taking your time to look it up and finding my mistake!!!!
The Displacement was not needed for the scene. So i deleted it.
Now it rendered just fin
Again many thanks for taking your time to find my error :)


text:
Is it possible to make reflections in (UP)BGE?
I'm working on a game and would like to know is it possible to make a reflective surface for stuff like mirror and high rise windows (via textures).
The image is from LEGO: Marvel Superheroes how to I add reflections like they did on the Empire State Building, but in blender?

Have you looked at the eevee upbge branch? Got bloom, reflections and all the fancy eevee stuff. https://blenderartists.org/t/does-anyone-have-the-upbge-eevee-branch/1159722/8

Information
Both UPBGE 0.2x and 0.3x both have internal, real-time reflections.
You can get the exact same result in BGE but you'll need to use an external shader script.
Blend File (in a 0.2x release)
https://blend-exchange.com/b/XjnaWgkE
Screenshot (in 0.2x)


text:
HairNet Add-on is screwy
Hi I'm still trying to work on a braid, but it keeps acting all screwy.
The first image is the result and the second is what it looked like before. Then when I figure out that error it says that the mesh guides are not the same length.
.blend file: https://drive.google.com/drive/u/1/folders/1QqSpjGz4KgfaY2YlozwF1AScxMrXXtI-

Tutorial Link: Creating Braid in Blender

https://blender.meta.stackexchange.com/questions/344/where-to-upload-blend-files-non-expiring-links

Make sure your braid curves all have the same number of points. Go into edit mode, and in the viewport under display overlays, turn on statistics. It should show you how many point you have per curve. Delete a bunch so that your point count per curve matches and you should be good to go.

Is that the the same amount of vertices of the mesh to match to curve or both curves to match one another or the same amount of vertices on the curve to the mesh?

The curves that your are using to generate your hair from the hairnet should all have the same number of points. I am guessing you have three curves per braid, so all three should have the same count. (eg. 20-20-20pts per curve).

The tutorial that I'm following shows that I have to click on the hair emitter and when I do it doesn't work. I just added same amount to points to my curves and when I do the emitter... nothing.


text:
How to populate UIlist with certain collections?
I'm trying to understand how to populate an UIList with certain collections based on their name. I am trying to extend this very useful answer by @batFINGER In addition, I would like to be able to show a button/operator alongside each collection shown in the same row, if that's possible. Based on this answer collections can be iterated and returned using a BoolProperty:
import bpy

def traverse_tree(t):
    yield t
    for child in t.children:
        yield from traverse_tree(child)

coll = bpy.context.scene.collection

for c in traverse_tree(coll):
    if c.col_prop.tag:
        print(c.name)

class CollectionPropertyArchive(bpy.types.PropertyGroup):
    tag: BoolProperty(default=False)

def register():
    bpy.utils.register_class(CollectionPropertyArchive)
    bpy.types.Collection.col_prop = bpy.props.PointerProperty(
            type = CollectionPropertyArchive)

def unregister():

    bpy.utils.unregister_class(CollectionPropertyArchive)

Q: How to populate an UIlist with certain collections?

@brockmann My mistake. Thanks for correcting.

No problem, I really appreciate that you're trying to keep things organized @RayMairlot

Go get the UIList for materials for 2.8x from Create an interface which is similar to the material list box
Set the type of the PointerProperty to bpy.types.Collection in order to store a pointer to the collection per item added to the PropertyGroup. No matter if the user adds new objects, changes the name of the collection or anything else, it always returns the reference added to the list:
class CUSTOM_objectCollection(PropertyGroup):
    #name: StringProperty() -> Instantiated by default
    coll_ptr: PointerProperty(
        name="Collection",
        type=bpy.types.Collection)

Edit the draw_item method to display the items properly (you can use a label too):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
    split = layout.split(factor=0.3)
    split.label(text="Index: %d" % (index))
    split.prop(item.coll_ptr, "name", text="", emboss=False, icon="COLLECTION_NEW")

The last tiny bit you have to implement is a new operator to append the collections to your UIList. To get the idea I modified CUSTOM_OT_actionsoperator to add the active collection to the list. Just add a new item and assign the collection object to the coll_ptr variable declared before:
if self.action == 'ADD':
    act_coll = context.view_layer.active_layer_collection.collection
    if act_coll.name in [c[1].name for c in scn.custom.items()]:
        info = '"%s" already in the list' % (act_coll.name)
    else:
        item = scn.custom.add()
        item.coll_ptr = act_coll
        item.name = item.coll_ptr.name
        scn.custom_index = (len(scn.custom)-1)
        info = '%s added to list' % (item.name)

    self.report({'INFO'}, info)

Once a few items have been added to the list, you can use the console to make sure all is working. You can easily print the names of the collections, the objects per collection or whatever...
>>> for coll in C.scene.custom:
...     print (coll.coll_ptr.name)
...
Collection
Collection 2

>>> for coll in C.scene.custom:
...     for ob in coll.coll_ptr.objects:
...         print (ob)
...
<bpy_struct, Object("Cube")>
<bpy_struct, Object("Light")>
<bpy_struct, Object("Camera")>

To set the selected collection of the list as active collection in the Outliner, you can use a callback for custom_index property see: https://docs.blender.org/api/current/bpy.props.html#update-example

Note: You don't need that extra bool, just add the collection to the list when adding a new one to the scene.

Thanks to you now, I understood something more and I was also able to build a callback function that activates the collection in the outsider which is updated through IntProperty to which the UIList index refers

I have managed as well, but if I change one of the collection's name in the UI, that renamed collection is not activated.

Sorry to bring up this thread again and sorry for the possible beginner's question: How can I reuse the same operator class with different UI_Lists? How do I pass the different coll_ptr and coll_ptr.index to the same operator when I call it from two different UI_Lists in the UI? Currently I created 2 operator classes in which only the ptr and ptr_index are different. Not very efficient...


text:
Button callback based on the objects particle system?
I have button in my panel, that button switch emitter/hair in particle system
it works, but the problem is i have many object, and if i change object selected, button not update.I'm looking for a correct method. This sctipt is simplified
for explain:
import bpy
from bpy.props import  BoolProperty
from bpy.types import PropertyGroup, Panel, Scene

def UpdateMitter(self,context):

    toogle = bpy.context.scene.my_prop_grp.emitter_hair
    obj = bpy.context.active_object
    part = obj.particle_systems[0]
    settings = part.settings

    if toogle is True:
        settings.type = 'EMITTER'
    else:
        settings.type = 'HAIR'

class PropGroup(bpy.types.PropertyGroup):
    emitter_hair: BoolProperty(update = UpdateMitter)

class MyPanel(bpy.types.Panel):
    bl_label = "My Panel"
    bl_idname = "test_toogle"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "View"

    def draw(self, context):
        layout = self.layout
        layout.label(text="My problem:")
        scene = bpy.context.scene
        layout.prop(scene.my_prop_grp, 'emitter_hair',  text="Toggle")

classes = (PropGroup, Panel)

def register():

    bpy.utils.register_class(PropGroup)
    bpy.utils.register_class(MyPanel)

    Scene.my_prop_grp = bpy.props.PointerProperty(type=PropGroup)

def unregister():

    bpy.utils.register_class(PropGroup)
    bpy.utils.register_class(MyPanel)

if __name__ == "__main__":
    register()

An Object property?
Make it an object property then it is set on a per object basis.
Since the property is defined on an Object class, then self in an update method is an object of type bpy.types.Object of which context.object is an instance .  If it was registered as a scene property, self would be a scene.
If it were a scene property, I would set the PS type for all objects with it.
def emitter_update(self, context):
    toogle = self.my_prop_grp.emitter_hair
    pobs = [o for o in self.objects if len(o.particle_systems)]
    for ob in pobs:
        part = ob.particle_systems[0]
        settings = part.settings
        settings.type = 'EMITTER' if toogle else 'HAIR'

Consult blender docs re naming conventions for classes, methods.
One of my pet hates: when context is passed as a function argument .. use it. Get out of the habit of bpy.context.foo.blah.bar...
Added a poll method in panel so it doesn't show when context object has no particle system.
import bpy
from bpy.props import  BoolProperty, PointerProperty
from bpy.types import PropertyGroup, Panel, Object

def emitter_update(self, context):
    toogle = self.my_prop_grp.emitter_hair
    part = self.particle_systems[0]
    settings = part.settings
    settings.type = 'EMITTER' if toogle else 'HAIR'

class MyParticleSettings(bpy.types.PropertyGroup):
    emitter_hair: BoolProperty(update = emitter_update)

class VIEW3D_PT_toggle_ps(Panel):
    """Test"""

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

    @classmethod
    def poll(self, context):
        ob = context.object
        return ob and len(ob.particle_systems)

    def draw(self, context):
        ob = context.object
        layout = self.layout
        layout.label(text="My problem:")
        layout.prop(ob.my_particle_settings, 'emitter_hair',  text="Toggle")

classes = (MyParticleSettings,
        VIEW3D_PT_toggle_ps)

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

    Object.my_particle_settings = PointerProperty(type=MyParticleSettings)

def unregister():
    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()

I imagine this will be extended, otherwise could simply put the enum in layout
row.prop(part, "type", expand=True)

or a window manager context toggle operator.
TIP.
In version 2.7x could reload scripts using the F8 key. It is  AFAIK not mapped to a key in default 2.8.
Either map it to a key, run in python console.
bpy.ops.script.reload()

Pre(ap)ending a simple operator button draw method to headers of both text editor and python console provides a couple of handy and often used buttons
For example when testing above, posted with ob.my_prop_group in the draw method after it had been renamed to ob.my_particle_settings.  As I hadn't reloaded scripts it was still registered from a previous test run, and worked as expected.
Running after reloading scripts will throw errors for such unregistered props.

ty , but now i not understand why if i select object with particle system ok panel appears, but not the toggle

ok my_prop_grp in layout.prop it becomes my_particle_settings

Cheers.  Edited.


text:
Geometry Nodes - Wrapping instance on mesh - Scales (mermaid)

I am fallowing along with CG cookie trying to wrap some scales on a mesh to make a nice scaled fin
https://www.youtube.com/watch?v=fmDv81dMQ6c (20m point)
however many of the nodes he's using are just...gone in 3.4 and 3.5 iv done the above to get it to work .... kidna and it does work for the most part but if I spin the model around...the scale is rotated 180 on its Z axis...and I cant seem to use any of the common tricks I'm finding to get it to track to another object of flip around or anything. Does any one have any suggestions on how to wrap to a mesh that gives an output like scales?
"correct scales"

Incorrect scale orientations

I think the problem you'fe facing likely has to do with the Transfer Attribute node - you are correct, it has been removed for blender 3.4 and up, but this guy has a good workaround - https://www.youtube.com/watch?v=LS7nsFNCRfY

In Blender 3.0, your tutor could have used Mesh to Points on faces to simplify his tree. Nowadays, you can use Dual Mesh to create your offset grid. Both of those eliminate index-wrangling and transfer of normals in similar ways:

This version sets the size of scales relative to the underlying faces, and allows the user to set their tilt and swivel relative to surface normal.

trying now. looks much simpler and I like that output so far. What is the X,Y,1 node? I can see its a math node I think but not sure what one it would be. Arctan2? sorry I use blender as a blunt object I do not understand most of what I do.

@Wenth sorry, I just re-labelled a collapsed Combine XYZ to make it unambiguous. To fit stuff in, I wind up H collapsing nodes quite a lot for illustration. If that conceals their meaning, I re-label.

Thanks Robin! was able to get everything working and it works much better then the older way! thank you.


text:
how do i export every part of the model
when I export my model from blender to unity some of the objects parts are missing and i can't seem to fix the problem? does anyone know what the problem is?

There can be many issues, you could upload the file to get inspected. Most common is unapplied transforms (Ctrl A). Re-importing into a new Blender file is correct?


text:
I'm trying to making clothes starting from the pattern sew
i'm trying to bring my clothes sketch to life just to get an idea of how would it be in reality.
I'm starting from this reference:

I started using bezier curves,

than tried to fill it, but it can't.
I wanted to use garment tools addons, and tried to make the pattern warp around the mannequin.
Since it can't be filled, i't can't be warped. I tried even to convert the bezier into mesh, but it adds too many vertex and its impossible to work with.

Please, someone could explain/suggest some way to make it easier, (also for making the eye cut) i'm literally losing my mind on this from one day.

There is a built-in sewing tool in Blender under the Cloth-Physics properties "Shape" section. Did you try that? You can find tutorials on Youtube.

https://blender.stackexchange.com/questions/184984/why-does-cloth-sewing-not-work-correctly-on-this-imported-svg


text:
Blender Animation
Do you have some suggestions or ideas on how to make this kind of animation. Specifically on how in the example the DNA splits and the other part joins in between? How to go about this?
I'm pasting some example pictures and video here (0.45 - 0.50 in video)
Link: https://www.youtube.com/watch?v=-MucL_RlbnE

Hi Please use a title that reflects the content of the question. It should be descriptive but succinct, unique and identifying, summarizing the issue so that users can at a glance understand what your post is about. Use the [edit] link below your post and avoid anything not strictly essential to the post. Remember, your title is the first thing potential visitors will see, and makes your question findable for future users. See "What is the problem with posting an image or link and asking “How do I do this?""

Give a Curve modifier to objects 1, 2 and 3 with 2 curves as Curve Object:

Push away objects 2 and 3:

Move the object 1 and its curve until it matches:

Thanks for your fast response and time! Helped a lot :)


text:
Why in some cases my icons disappear from the panel?
The code shown here is essentially what I am using to load the icons contained in the path of my addon. It is not the first time that I use this method, and it has never bothered me until now. However, in this case it seems that this also blocks the load of bpy.utils.previews of other addons so nothing will be loaded anymore, neither icons, nor personalized previews.
If I open a new project, the icons will be shown, but not always, in some cases I try to start Blender as Administrator, it seems to solve it but after a while the the icons are gone. System console is empty too.
import bpy,os

class MY_PT_Panel(bpy.types.Panel):

    bl_label = "My panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "My category"

    def draw(self, context):

        ico = my_icon["icon"]

        layout = self.layout

        row =layout.row()
        row.label(text='My text',icon_value = ico['my_png_image_1.png'].icon_id)
        row.label(text='My text',icon_value = ico['my_png_image_2.png'].icon_id)

my_icon={}

classes = (MY_PT_Panel,
           #etc..
           )

def register():

    import bpy.utils.previews

    iconUtils = bpy.utils.previews.new()
    my_icon["icon"] = iconUtils
    iconsDir = os.path.join(os.path.dirname(__file__),"Icons")
    for ico in os.listdir(iconsDir):
        iconUtils.load(ico, os.path.join(iconsDir,ico), 'IMAGE')

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

def unregister():

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

    for ico in my_icon.values():
        bpy.utils.previews.remove(ico)
    my_icon.clear()

if __name__ == "__main__":
    register()

The problem seems related to the mode of Scene.render.engine
When I open the project and use 'BLENDER_WORKBENCH' the problem appears while opening the project in another render mode, all the icons are loaded correctly.
Any idea why this happens? I don't understand whether that's my fault or a bug...? All icons are 32x32px, Blender 2.81, Win 10

There's currently an open ticket T74405 about this.

@RobertGützkow Yes, it seems to be a real bug, I am trying to get around the problem, but I am noticing that it seems impossible, since if they are loaded while viewing render 'BLENDER_WORKBENCH' these will remain loaded but not displayed


text:
How can I achieve a clean transparent alpha using cycles?

I've added a plane with a clip of the smoke on it. I also turned off the shadows from the object as I don't need 'em. After I set up the alpha material it looks clean, but when I spread the plane on some area, using geometry nodes, my alpha becomes a bit dirty, not fully transparent.
What could I possibly forget?
Original plane with a texture

And the plane instances in geometry nodes:

don't you need to increase the Transparency value in the Render panel > Light Paths > Max Bounces?

Yep. You're right. There weren't enough samples. Thanks =D

Increase the Transparency value in the Render panel > Light Paths > Max Bounces:


text:
Export multiple .MDD at once?
I have 97 MDD files created from different meshes (armature deformed, cloth deformed etc). Is there a way to select multiple meshes and export them as individual MDD files?
I have seen that there's another post which provides an add-on to export selected objects to FBX, but unfortunately I do not have the skills adapting it to work for MDD files: Exporting multiple meshes individually at once
My progress so far: I've found someone trying to export multiple MDD at once on another forum, and it seems that there's a Python command line to export a MDD: bpy.ops.export_shape.mdd(fps=24, frame_start=1, frame_end=250). Also, there's a python template for Batch exporting:
import bpy
import os

# export to blend file location
basedir = os.path.dirname(bpy.data.filepath)

if not basedir:
    raise Exception("Blend file is not saved")

view_layer = bpy.context.view_layer

obj_active = view_layer.objects.active
selection = bpy.context.selected_objects

bpy.ops.object.select_all(action='DESELECT')

for obj in selection:

    obj.select_set(True)

    # some exporters only use the active object
    view_layer.objects.active = obj

    name = bpy.path.clean_name(obj.name)
    fn = os.path.join(basedir, name)

    bpy.ops.export_scene.fbx(filepath=fn + ".fbx", use_selection=True)

    # Can be used for multiple formats
    # bpy.ops.export_scene.x3d(filepath=fn + ".x3d", use_selection=True)

    obj.select_set(False)

    print("written:", fn)

view_layer.objects.active = obj_active

for obj in selection:
    obj.select_set(True)

How can I export multiple .MDD files ?

Is there any mdd exporter already? If so you just have to replace export_scene.fbx() operator and all corresponding properties/arguments.

@brockmann (I deleted my answer and edited my original post). What do you mean ? Yes, there's a .mdd exporter built in Blender but no option for Batch exporting is displayed. As I said, I don't understand how Python works, and replacing the ".fbx" by ".mdd" gives me an error. Also, I don't know any Python functions, neither specific .mdd arguments. So I need help here, I guess mixing the Batch Export template with the specific .mdd exporting function will do the trick ?

Modified the code of the linked answer: https://pasteall.org/UhqR Make sure the other mdd exporter is enabled, run the code in the text editor, please test and report back.

Hey, thanks for your help. Yes, the MDD exporter add-on is enabled. Copy/Pasted the code in the text editor, saved it and hitted run : bpy.ops.text.run_script() in the system console aand.. that's it. Nothing else happens, no .mdd output in the directory, no loading time after hitting the Play button :/

Go to File > Export > Batch export mdd to execute the process (as usual).

Oh okay sorry, as I said I'm a complete noob about Python and scripting... Okay I got an error trying to run the Batch export in File > Export, because "fps" is not a property off .mdd exporter, so I've just replaced "fps=self.fps" by "fps=self.frames_per_second" line 120 and after running the script again, everything worked perfect ! Thanks you very much sir ! :)
Last question, how can I remove a previous ran script from my Export list in Blender? (The first one gave me the error I was just talking about so it is not usable)

Cool. If that's working, save the file to something like my_batch_mdd.py from the text editor, close blender, start blender, go the user preferences > add-ons, click on Install Add-on, select the file, enable it, done.

Maybe you could post your code as an answer so that I can accept it ? Then it would be easier for anyone else to find it, even when the pasteall links will expire ? Anyway, thank you again for your help (I saw that you were also the savior guy in the .fbx batch export haha) :)

Ops we're crossing answers.
Okay instruction clear, I'll do that. Thank you again ! :)

Addon based on this answer, adapted to export all objects in selection to single .mdd files. Make sure 'NewTekk MDD format' add-on is enabled and install the add-on as usual:

batch_mdd_export.py
# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>

bl_info = {
    "name": "Batch export MDD files",
    "author": "brockmann",
    "version": (0, 1, 0),
    "blender": (2, 80, 0),
    "location": "File > Import-Export",
    "description": "Batch Export Objects in Selection to MDD",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Import-Export"}

import bpy
import os

from bpy_extras.io_utils import ExportHelper

from bpy.props import (BoolProperty,
                       FloatProperty,
                       IntProperty,
                       StringProperty,
                       EnumProperty,
                       CollectionProperty
                       )

class Batch_MDD_Export(bpy.types.Operator, ExportHelper):
    """Batch export objects to fbx files"""
    bl_idname = "export_scene.batch_mdd"
    bl_label = "Batch export MDD"
    bl_options = {'PRESET', 'UNDO'}

    # ExportHelper mixin class uses this
    filename_ext = ".mdd"

    filter_glob : StringProperty(
            default="*.mdd",
            options={'HIDDEN'},
            )

    # List of operator properties, the attributes will be assigned
    # to the class instance from the operator setting before calling.

    # Context group
    use_selection_setting: BoolProperty(
            name="Selection Only",
            description="Export selected objects only",
            default=True,
            )

    use_rest_frame: BoolProperty(
            name="Use Rest Frame",
            description="ToDo",
            default=False,
            )

    frames_per_second: FloatProperty(
            name="FPS",
            description="ToDo",
            min=1, max=60,
            default=25,
            )

    frame_start: IntProperty(
            name="Frame Start",
            description="ToDo",
            default=1,
            )

    frame_end: IntProperty(
            name="Frame End",
            description="ToDo",
            default=250,
            )

    def execute(self, context):

        # get the folder
        folder_path = os.path.dirname(self.filepath)

        # get objects selected in the viewport
        viewport_selection = context.selected_objects

        # get export objects
        obj_export_list = viewport_selection
        if self.use_selection_setting == False:
            obj_export_list = [i for i in context.scene.objects]

        # deselect all objects
        bpy.ops.object.select_all(action='DESELECT')

        for item in obj_export_list:
            item.select_set(True)
            if item.type == 'MESH':
                context.view_layer.objects.active = item # Set active object
                file_path = os.path.join(folder_path, "{}.mdd".format(item.name))

                # MDD settings
                bpy.ops.export_shape.mdd(
                        filepath=file_path,
                        fps=self.frames_per_second,
                        frame_start=self.frame_start,
                        frame_end=self.frame_end
                        )

            item.select_set(False)

        # restore viewport selection
        for ob in viewport_selection:
            ob.select_set(True)

        return {'FINISHED'}

# Only needed if you want to add into a dynamic menu
def menu_func_import(self, context):
    self.layout.operator(Batch_MDD_Export.bl_idname, text="MDD Batch Export (.mdd)")

def register():
    bpy.utils.register_class(Batch_MDD_Export)
    bpy.types.TOPBAR_MT_file_export.append(menu_func_import)

def unregister():
    bpy.utils.unregister_class(Batch_MDD_Export)
    bpy.types.TOPBAR_MT_file_export.remove(menu_func_import)

if __name__ == "__main__":
    register()

    # test call
    #bpy.ops.export_scene.batch_mdd('INVOKE_DEFAULT')

I added all possible arguments of the 'lightwave point cache' operator export_shape.mdd(), see line 117. You can change them or add new properties to the operator, wasn't sure.

Hey, just giving you a feedback : it seems that this script exports the same mesh (the active one, so the first one) over and over. In my case I have the same .mdd for 97 times. I understand that the "for" is used to do an incremental .mdd export but I was not able to find how to correct it. Could you give it a try ? Sorry to ask for your help again :/

Oh and I forgot to mention that the names are correctly set !

Not sure I can properly test the output since I don't have access to Lightwave. Might be necessary to set the current object to the active one, updated the code: https://pasteall.org/2ukq Does that work? @Pdhm

First, thanks for helping me in such an efficient way, I really appreciate it.
Secondly : YES it worked ! :) I tested it on three .mdd exports for a limited amount of frames but it worked. I'll give a try over a lot more now but I need an hour of calculation. Will update you in a couple of hours. Again, thank you very much !


text:
How to correctly merge two objects in blender
I am trying to merge two close boxes into one single cuboid, from the GUI I am able to successfully create the two boxes and set a boolean modifier to the first box to unify(UNION) with the second box before deleting it.
But when I run the following script
import bpy
import ast

def delete(obj0):
    bpy.ops.object.select_all(action='DESELECT')
    obj0.select = True
    bpy.ops.object.delete()

def Merge(obj0,obj1):
    bpy.ops.object.select_all(action='DESELECT')
    obj0.select = True #selecting obj0 so the bpy modifier is constructed for it
    bpy.ops.object.modifier_add(type='BOOLEAN')
    bpy.context.object.modifiers["Boolean"].object = obj1
    bpy.context.object.modifiers["Boolean"].operation = 'UNION'
    bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Boolean")
    delete(obj1) #deleting obj1 since it's no longer needed
    return obj0 #returning obj0 which shoulda become the cuboid just incase a future need arises to merge with another box

def AddBox(x,y,z,width,height,depth):
    bpy.ops.mesh.primitive_cube_add(location=(x, y, z))
    bpy.ops.transform.resize(value=(width, height, depth))
    return bpy.context.active_object

#creating the two boxes and naming them
box0 = AddBox(0,0,0, .5,.5,.5)
box0.name='box0'
box1 = AddBox(0,1,0, .5,.5,.5)
box1.name='box1'

#merging them into a cuboid
Merge(box0,box1)

I get the following exception
TypeError: bpy_struct: item.attr = val: BooleanModifier.object ID type does not support assignment to itself

Need to set the active object.
The issue here is that operators work on the context.object to set an object to "active state" use both
in 2.7x
context.scene.objects.active = ob0
ob0.select = True

in 2.80
context.view_layer.objects.active = ob0
ob0.select_set(True)

Then when you run an operator it sees ob0 as context.
Just setting ob0.select = True is not #selecting obj0 so the bpy modifier is constructed for it
Without the above, because you added ob1 last, it was still context.object and hence you were trying to set its union object to itself.
An object can be active but not selected, selected but not active.
Again from  a previous answer https://blender.stackexchange.com/a/133292/15543 I showed how to add a modifier using api methods to get its reference IMO this is far simpler than using an operator.
Surely
bool = ob0.modifiers.new(name='booly', type='BOOLEAN')
bool.object = ob1
bool.operation = 'UNION'

is more readable (, and simpler) than
bpy.ops.object.select_all(action='DESELECT')
bpy.context.scene.objects.active = obj0
obj0.select = True
bpy.ops.object.modifier_add(type='BOOLEAN')
bpy.context.object.modifiers["Boolean"].object = obj1
bpy.context.object.modifiers["Boolean"].operation = 'UNION'

Soapbox TLDR:
Recommend getting out of the habit of always addressing via bpy.context.foo.bar.blah  For example in test code if the line context = bpy.context is added at the top, removes the need to use bpy.context.... every bloody time, if later we choose to copy paste our code into operators or panels then the context matches the argument context  in draw and execute methods etc.
Or after adding modifier with operator
bpy.ops.object.modifier_add(type='BOOLEAN')
mod = obj0.modifiers[-1] # it's the last added
mod.object = obj1
mod.operation = 'UNION'

Here I've referred to the newly created modifier as a variable  "mod",  over obj0.modifiers["Boolean"] and definitely rather than the long winded bpy.context.object.modifiers["Boolean"]

lol  @ "bloody".

thanks man... You are 2X a life saver. saved a drowning brother twice. really appreciate. I express my deepest BATARANGS


text:
set random active face in python without toggle mode
In python how can I set random active Face in edit mode without toggle the Object/Edit Mode ?
For example re code in this answer can you also automatically set an active face again from the script to loop the option ?

Use the bmesh module.

ok but how to write the function ?

Well, you know how to write a python function, right? You get the active mesh, get the bmesh from it, generate a random number and select that face from it. At the end you write your bmesh back. Where are you stuck / What have you tried?

On Blender.SE, it is common to show that you are willing to do the work yourself with guidance. If the question looks like an unpaid job offer, it may even get closed. You can always edit your question to include more details. Writing the function and explaining every bit of it wouldn't be in the scope of a normal answer.

I can python a little bit, but BMesh Operators are a little bit confusing for me :/

Possible duplicate of Python set active face/batch unwrap Follow Active Quads

i get report error by "delimit" and toggle the mode :(

Welcome to the New user merry-go-round created by inability to comment.   This was initially posted as an answer to https://blender.stackexchange.com/questions/128794/deselect-neighbours-faces which i believe is a question relating to my answer there.  Did the "right" thing and deleted as answer and asked as question, if reviewed by mod would likely have been converted to comment.

Random active face
Please heed the advice given in comments above.  One of the (IMO) dopier rules on bse is the inability of new users to comment.
Noticed your deleted post here re Deselect Neighbours Faces
Here is a test script using method outlined in https://blender.stackexchange.com/a/81425/15543  Sets a random face active, and selects it.
import bpy
import bmesh
from random import randint

def random_face(bm):
    bm.faces.ensure_lookup_table()
    return bm.faces[randint(0, len(bm.faces) - 1)]

context = bpy.context
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
print("before", bm.faces.active)
bm.faces.active = random_face(bm)
bm.faces.active.select = True
print("after", bm.faces.active)

bmesh.update_edit_mesh(me)

To also make the face the active select history
bm.select_history.add(bm.faces.active)
print(bm.select_history.active is bm.faces.active)

does not work ? if I execute it nothing happens... or i get a report message (wm_operator_invoke: invalid operator call) ...

Thanks. How are you "executing" it?  Have no idea how that error message is related???

oh it works, sorry was my fault, I forgot to go to the edit mode.


text:
Upgrading an Old Python Script : Change all Image Paths at once
I found those script i Think it was for Blender 2.49 to change all imagePath at once,
but I cant get it to work in Blender 2.8...
Can some one help , it would be very handie for flies with lots of images?
import bpy  #Original import Blender

from bpy import context, data, ops
#from ORIGINAL from Blender import Texture, Image, Material

#insert the path which should be replaced
oldpath = "C:\\OLDpath\\"

#insert the new path which replaces the old one
newpath = "D:\\NewPth\\"

image_count = 0

for tex in bpy.data.textures.get():

    image = tex.getImage()
    #print image.name

    filename = ""

    if (tex.getType() == "Image"):

        if (len(image.getFilename()) > 0):

            i=0
            while i < len(image.getFilename()) :

                if image.getFilename()[i:i+1] == "\\" :
                    filename += "/"
                else :
                    filename += image.getFilename()[i:i+1]

                i+=1

        if (oldpath == filename[0:len(oldpath)]):

            temp = filename[len(oldpath):len(filename)]
            temp = newpath + temp

            image.filename = temp
            image.reload()

            image_count += 1

print ("image path's changed:")
print (image_count)

I did a few changes, but cant find the rest od my errors.
I thing some stuff is now depricated but I cant find the 2.8 Version
here is the Path to the ORIGINAL Script
https://blenderartists.org/t/script-to-change-paths-for-all-images/460733

You are right, this script is severely outdated (2009 !) This should do :
import bpy

# The path which should be replaced
oldpath = "C:\\OLDpath\\"

# The new path which replaces the old one
newpath = "D:\\NewPth\\"

image_count = 0

for image in bpy.data.images:
    if not image.filepath.startswith(oldpath):
        continue
    image.filepath = image.filepath.replace(oldpath, newpath)
    image.reload()
    image_count += 1

print(f"Image paths changed: {image_count}")

We take advantage of the python string method string.replace(old_string, new_string) to swap the paths. Note that they must both be written the same way, like in your example.

Or could  for image in bpy.data.images: to change all image filepaths rather than only those assoc with an image texture.  Q suggests this a bit, old script goes over textures?  Wonder if it's worth mentioning relative paths, in that, for example: as long as a folder named images is in same folder as blend file then //images/foo.png will be path to image relative to blend file.  Was on BA answering Qs back then.  2009 would have been a 2.49 hanger on... the change from 2.7 to 2.8 was nothing like the upheaval of 49b to 50

@batFINGER Thanks for the heads-up :) I agree it would be better to use relative paths in the case you describe, but if the image library is located somewhere else or on a different drive, you would still have to use absolute path, right ?

for sure more in line with handy to use relative paths if you are moving folders around to avoid need to re-path. Another small thing consider avoiding reloading images with unchanged paths... filepath.startswith(oldpath)  and report updated 3 of 10 (eg).

@batFINGER Good call ! Thanks :)

Thanx, works like a charm. And to the discurs about relatives and absolutes - I think relatives are always better in production, but sometimes you get FBX files from Evermotion and all textures are stored absolute. So you create blend files out of them and reorganize everything. Then this script is top notch.. afterwards we can do the abolute to relativ conversion and everything is back in line again.


text:
How do I rig flip flop sandals correctly?
I'm working on an advanced rig for a character wearing flip flops. I'm trying to get the rig right and is almost perfect. The only flaw is that when you turn all the foot bones at 90°, the weight painting gets screwy. I think it may have something to do with the weight painting I did using vertex groups, but I don't know what I'm doing wrong and I refuse to go without it.
Please help.
PS: I feel like the weight painting is too smooth and I wonder if it's possible to sharpen it. Blender Guru did it before in a towel tutorial and someone did ask about it on another site (I forget which), but it said when I don't have subdivision surface it'll work tried it and it didn't. I just want to know if anyone can help.

File: flip_flop_physics.blend
I'm using 2.83.1 by the way.

Also the bones (the ones that are away from the skeleton) on the outside don't affect the sandal... I think.

Please add images to your question. Other users should not have to rely on downloading a file to understand your question.

Can someone please help? I still can't figure this out. I don't know what to do and like I said, I refuse to go without.


text:
Unintended movement when animating a character in blender!
So I have a LEGO minifigure model I have built.
I only want to animate a walk cycle.
I grab a leg and rotate it out.
Then I move down to another frame and now the head has turned as well!
 Has anybody else had this kind of experience and what can cause this?
TIA!

hard to tell, maybe share your file? https://blend-exchange.giantcowfilms.com/

There you go! Thanks for looking at it.

you've created some keyframes but it looks like you haven't moved anything... anyway I think you should work on rigging because animating a character without armature is going to be hell

@moonboots ok thanks! I left Autodesk Maya behavior nd and I’m just learning my way around everything in Blender

While playing with the scene I learned how to fix the unintended movement! Go to the outliner and delete the animation data there, then start setting new key frames and everything animates as intended, no extra parts are moving around!
Hope this is helpful to anybody else who encounters a similar situation.


text:
How to add material to mesh generated by geometry nodes
What I did is the following: I created a new material and set the attribute "material index" on every face to 1 (0 doesn't seem to work). However this does not seem to have an effect on the shading of the object.
I am using blender 2.93.0 - the latest stable blender version.
If you want to download the blend file you can do so here.
Here you can see the relevant data:

Why can’t you use the material assign node?

@Chris because I didn't know such a node existed. I am using blender 2.93 and not blender 3.0 . After looking into it, it seems like it is a 3.0 feature. Thank you very much.

I think it's a limitation of V2.93 GN unfortunately. The instanced mesh loses all links to the instancer object data, including materials. What's weird is if you go into edit mode, the mesh turns green. Might be a bug ?

@Gorgious In edit mode it gets green because geometry nodes are not taken into account.

@vklidu I beg to differ :) There is an inconsistency here. In V.2.93 the mesh turns green, in V3.00 it stays grey, and in both cases the GN modifier is executed : https://i.sstatic.net/nqmtx.png and https://i.sstatic.net/Mdb1c.png

I have the same problem, or similar. Not sure. But I assigned the materials to the geometry node icospheres using a Attribute Fill and assigning the material_index. I can only see the materials in edit mode. https://www.area.fullframestudios.ch/AREA/BlenderScreenshots/GeometryNodes_Icospheres_ObjectMode.png and https://www.area.fullframestudios.ch/AREA/BlenderScreenshots/GeometryNodes_Icospheres_EditMode.png Do we file a bug? Or am I missing something?


text:
Stange material/mesh glitch in LookDev mode
Whenever I go into LookDev mode with this Cynder model I ported from SFM (which was originally an .mesh.ascii file) a strange graphical glitch occurs where I can see faces glitching through each other.

This was more obvious in edit mode.

In rendered mode it is completely fine, so I don't know what's going on. Because the faces show through each other in edit mode I'm thinking there's something wrong with the mesh but I'm not sure what.

I have many other models that I've imported from SFM into Blender the same way and they've never had this problem before.
Help would be gladly appreciated, please respond asap.
[EDIT]
Blender file below:

Heve you check if there is overlaping faces ? Did you recalculated normals ? Did you remove custom edge split ?

There are no overlapping faces and recalculating the normals didn't appear to do anything. What is meant by custom edge split and how do I remove it?

Seeing your edit mode screenshoot, i don't think it come from that, but you can see what it is here : https://i.imgur.com/NVCdlF5.png

Another thing you can look for is the clip start and end in the view of N panel https://i.imgur.com/IAnBRsE.jpg

I've also tried that, it didn't seem to work either. It just changed the boundaries of what could be viewed. I'm at a complete loss as to what could be going on with this.

Can you upload the .blend file ?

Uploaded the file, hope you can find what's wrong with it.

Your material blend mode is set to alpha blend, changing it to opaque fixes the issue.

I don't have that option in my material settings. Would it be because I'm in Cycles? https://imgur.com/a/EPkzZXh

Look dev uses eevee settings, switch to eevee, to change the setting then switch back to cycles.

I hope that this paper-cut of the lookdev and cycle ui inconsistency will be resolved in the new blender updates.


text:
Randomise Geometry Node Input Value
I am learning Geometry Nodes. I have created a simple scene where trees are randomly distributed on a grid. The trees change in appearance as they scale on the z-axis. All of this is controlled by an input value. How can I create random scaled instances of my trees by randomizing the input value. I probably have my nodes in the wrong order as it looks like I am distributing the same instance with the same scale on my grid.
Sorry. I am trying to attach my blend file using Blend-Exchange but it keeps telling me that "All uploaded files must be in the blend file format". I have only added my file Geom_Trees.blend???
Here is my node setup:

Current result:

I figured this out. As I expected, it was just my node order.


text:
How to apply imported module to active object
I'm trying to import a module (I think that's the right term) and then run it on the active object
In the console I can type:
> from bl_operators.uvcalc_smart_project import main
> main(C, .02, 30, 0.03, True, True)

... and it does smartuvproject on the active object.
In my script I have:
from bl_operators.uvcalc_smart_project import main
bpy.context.view_layer.objects.active
main(C, .02, 30, 0.03, True, True)

... and the console says that "name C is not defined"
I realise I'm missing something pretty basic here, to do with how a function is applied to an object in Blender scripts.
Perhaps the answer is, "go away and learn python." But this stuff is so Blender-specific (maybe even Blender 2.80 specific) that I'm not sure I'm going to find the answer anywhere except here!
Thanks in advance.

Py console convenience variables
C and D are abbreviated named variables for our convenience in the python console (see startup message)
PYTHON INTERACTIVE CONSOLE 3.7.1 (default, Oct 22 2018, 11:21:55)  [GCC 8.2.0]

Command History:     Up/Down Arrow
Cursor:              Left/Right Home/End
Remove:              Backspace/Delete
Execute:             Enter
Autocomplete:        Ctrl-Space
Zoom:                Ctrl +/-, Ctrl-Wheel
Builtin Modules:     bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils
Convenience Imports: from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data

Simply replace C with bpy.context in your script
On importing
you are importing the method main from the module bl_operators.uvcalc_smart_project1 similarly
from bl_operators import uvcalc_smart_project

uvcalc_smart_project.main(...)

for keeping one main method distinct from another main method imported from elsewhere by using module as a namespace.
IMO something like
from bl_operators.uvcalc_smart_project import main as uv_smart_project
# and use via
uv_smart_project(...)

is distinct and readable.

"distinct and readable" is right. That's very neat. Thanks as ever batFINGER - your help is greatly appreciated.


text:
bpy.context not working as expected
I had a script which included bpy.context. Once I'd built the script up with various other functions, it was no longer working properly.
Using advice from here: Problem with bpy.context.selected_objects I changed various lines to use bpy.context.scene.objects if o.select_get() instead of bpy.context.selected_objects.
That worked nicely when I substituted into several of my def functions. Unfortunately in one function I'm relying on a built-in module (not sure if that is the correct term):
from bl_operators.uvcalc_smart_project import main as uv_smart_project
uv_smart_project(bpy.context, .02, 30, 0.03, True, True)

That one no longer works either, but as it is a built-in module I can't easily go in and update the module to use o.select_get(). I get the error:
ob for ob in context.selected_editable_objects
AttributeError: 'Context' object has no attribute 'selected_editable_objects'
If, after the main script fails, I run the two problematic lines in a separate text block, then it runs fine.
Edit:
I have used context = bpy.context throughout, as that seems to be a recurring comment around here. Also called the problematic script via a different text block, but no difference. Finally tried an override like this:
for window in context.window_manager.windows:
    screen = window.screen

    for area in screen.areas:
        if area.type == 'VIEW_3D':
            override = {'window': window, 'screen': screen, 'area': area}
            uv_smart_project(override, .02, 30, 0.03, True, True)

But that gives me 'dict' object has no attribute 'mode' and I can't see how to add the mode to the override (if that is even a thing).
Is there another way to set the context correctly? Arbitrary selection/activation of an object in the 3D view, maybe?

AFAIK cannot override edit mode. It either is or isn't in edit mode. Toggle the mesh object into edit mode before calling smart project.  Also in what context are you calling from?

That's my challenge really - I'm not sure what context I'm in. SmartProject is supposed to be acting on a load of meshes that are in object mode, so that they share the same UV space (i.e. a texture atlas), so I can't call it in Edit mode. The script imports meshes and then cleans them up etc, so I'm not sure why the context has shifted from the 3D view where all the previous functions have been operating. Is there a way to test what context I'm currently in and/or change it?

The last function before it goes awry is to move objects between collections. So maybe that moves the context to the Outliner/Collections?

Thanks to iceythe on BlenderArtists I have resolved my problems in two ways. The first part is this:
for window in context.window_manager.windows:
    screen = window.screen

    for area in screen.areas:
        if area.type == 'VIEW_3D':

            tmp = bpy.context.copy()
            tmp.update(window=window, screen=screen, area=area)

            class Override:
                pass

            for key, val in tmp.items():
                setattr(Override, key, val)
            print('Unwrapping ...')
            from bl_operators.uvcalc_smart_project import main as uv_smart_project
            uv_smart_project(Override, .02, 30, 0.03, True, True)

            return

The second part was a problem caused by my using save/reopen to clear orphaned data blocks, whereas this avoids the problem by using the purge function (which I knew about but had struggled to implement via a script):
context = bpy.context

def override():
    for window in context.window_manager.windows:
        for area in window.screen.areas:
            if area.type == 'OUTLINER':
                override_dict = {}
                override_dict.update(area=area)
                return override_dict

def ClearAll():

    for c in context.scene.collection.children:
        context.scene.collection.children.unlink(c)

    for c in bpy.data.collections:
        if not c.users:
            bpy.data.collections.remove(c)

    for o in bpy.data.objects:
        try:
            bpy.data.objects.remove(o)
        except:
            print('All objects deleted')

    override_dict = override()
    if override_dict is not None:
        bpy.ops.outliner.orphans_purge(override_dict)


text:
How to get custom menu items show up in the search bar?
I have successfully created a sub menu which extends the Shift+A menu in the shader editor but I would like to have the options show up as results in the search bar. Is this even possible, and if so how can it be done?

import bpy
from bpy.types import Menu, Operator

def draw_menu(self, context):
    layout = self.layout
    layout.separator()
    layout.menu("sub_menu")

class SubMenu(bpy.types.Menu):
    bl_label = 'Math'
    bl_idname = 'sub_menu'

    def draw(self, context):
        layout = self.layout
        layout.operator("divide.node", text="Divide")
        layout.operator("multiply.node", text="Multiply")
        layout.operator("add.node", text="Add")
        layout.operator("subtract.node", text="Subtract")

class DivideNode(Operator):
    bl_idname = "divide.node"
    bl_label = "DivideNode"

    def execute(self, context):
        bpy.ops.node.add_node(type="ShaderNodeMath", use_transform=True)
        bpy.data.materials["Material"].node_tree.nodes["Math"].operation = 'DIVIDE'

        return {'FINISHED'}

class AddNode(Operator):
    bl_idname = "add.node"
    bl_label = "AddNode"

    def execute(self, context):
        bpy.ops.node.add_node(type="ShaderNodeMath", use_transform=True)
        bpy.data.materials["Material"].node_tree.nodes["Math"].operation = 'ADD'

        return {'FINISHED'}

class SubtractNode(Operator):
    bl_idname = "subtract.node"
    bl_label = "SubtractNode"

    def execute(self, context):
        bpy.ops.node.add_node(type="ShaderNodeMath", use_transform=True)
        bpy.data.materials["Material"].node_tree.nodes["Math"].operation = 'SUBTRACT'

        return {'FINISHED'}

class MultiplyNode(Operator):
    bl_idname = "multiply.node"
    bl_label = "MultiplyNode"

    def execute(self, context):
        bpy.ops.node.add_node(type="ShaderNodeMath", use_transform=True)
        bpy.data.materials["Material"].node_tree.nodes["Math"].operation = 'MULTIPLY'

        return {'FINISHED'}

def register():
    bpy.types.NODE_MT_add.append(draw_menu)
    bpy.utils.register_class(MultiplyNode)
    bpy.utils.register_class(SubMenu)
    bpy.utils.register_class(DivideNode)
    bpy.utils.register_class(SubtractNode)
    bpy.utils.register_class(AddNode)

def unregister():
    bpy.types.NODE_MT_add.remove(draw_menu)
    bpy.utils.unregister_class(MultiplyNode)
    bpy.utils.unregister_class(SubMenu)
    bpy.utils.unregister_class(DivideNode)
    bpy.utils.unregister_class(SubtractNode)
    bpy.utils.unregister_class(AddNode)

if __name__ == "__main__":
    register()

Do you mind sharing your code? please read: https://blender.stackexchange.com/help/how-to-ask

Here you go https://pastebin.com/9PCr6Dqj Thanks for the help

All the math node operations
Note: this doesn't answer how to put your operators into the search, rather is intended to offer another way to have same functionality in a far more easily extendable way

From one look at the question code instantly has me quoting

Foghorn Leghorn
No, no, no your're doing it all wrong

No menus one operator
Have taken code above and edited to have functionality as demonstrated, with no menus and one operator.
All the question operators are doing pretty much the same thing, the code varies little between them. Instead of an operator for each operation, one operator and an enum of possible operations.
The tricky bit.
When we add a math node, we add an instance of the type bpy.types.ShaderNodeMath.  All the possible operations are available from its definition of the "operation" property.
[Look for links, been well covered]
Our one operator is going to pinch these.
The menus can be ditched because blender can automatically make a menu from the options.  And boy there are a few.  The items list can be narrowed to a select few if desired
Categorize the other way
The naming convention of your operators is, going by "standards", a bit A about T. Using "node.add_math_subtract" will classify it with all the other bpy.ops.node prefixed operators.
Operators use context
For any code run in the shader editor the material we're "lookin' at" is context material. This is the material the bpy.ops.node.foo_bar will work on.  This will not always be bpy.data.materials["Material"]
Similarly only the first math node added via operator (bpy.ops.node.add_node(..)) will have the name "Math".  Hence on subsequent runnings of question code will add a new node but change the operation of the first one added, ie the one with name "Math".  Directly after running the operator the new node will be context.active_node .. another context member of the node editor.
Have instead added a math node to the node tree of the context material and set its operation and name accordingly.
import bpy
from bpy.types import Menu, Operator, ShaderNodeMath
from bpy.props import EnumProperty

class AddMathNode(Operator):
    ''' Add Math Node '''
    bl_idname = "node.add_math"
    bl_label = "Add Math Node"
    items = [
        (p.identifier, p.name, p.description)
        for p in ShaderNodeMath.bl_rna.properties["operation"].enum_items
            ]
    #print(items)
    operation : EnumProperty(
        items=items,
        name="Operation",
        default='ADD',
        )

    def execute(self, context):
        # the material in the node editor
        mat = context.material
        # add a new math node to its nodes
        n = mat.node_tree.nodes.new("ShaderNodeMath")
        # set some properties
        n.operation = self.operation
        n.name = self.operation.lower().title()
        # make active
        mat.node_tree.nodes.active = n
        return {'FINISHED'}
        #return bpy.ops.transform.translate('INVOKE_DEFAULT') # use translate

classes = (AddMathNode,)
def draw_menu(self, context):
    layout = self.layout
    layout.operator_menu_enum("node.add_math", "operation")
def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.NODE_MT_add.append(draw_menu)

def unregister():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.NODE_MT_add.remove(draw_menu)

if __name__ == "__main__":
    register()

Sorting them
There's lots of them. This change circa lines 9-12 sorts them by IDENTIFIER, eg ADD, SUBTRACT
    items = sorted(
        (p.identifier, p.name, p.description)
        for p in ShaderNodeMath.bl_rna.properties["operation"].enum_items
            )

Adding to the search menu.
Because this is now only a single operator removes the sense of searching for it.  Possibly the logical extension of this is to categorize the operation (as is done via the UI to select math node operation)
With developer extras set to show view source option can right click over the add nodes menu and view source, revealing how the search menu is constructed and laid out.
def draw(self, context):
    layout = self.layout

    layout.operator_context = 'INVOKE_DEFAULT'

    if nodeitems_utils.has_node_categories(context):
        props = layout.operator("node.add_search", text="Search...", icon='VIEWZOOM')
        props.use_transform = True

        layout.separator()

        # actual node submenus are defined by draw functions from node categories
        nodeitems_utils.draw_node_categories_menu(self, context)

Which reveals a helper module nodeitems_utils which we can pretty much pinch, to instead of using enum menu expansion can search and categorize.  Perhaps for another day.

What does "A about T" mean?  I am now intrigued.


text:
Orient Custom Shape addon stopped working in versions above 2.9?
Unfortunately the Orient bone shapes add-on either downloaded from GitHub or from developer.blender.org does not work anymore for whatever reason.
I have tried to install those scripts on Blender 2.90.0 and 2.93.1,
namely orient_custom_shape_V2.py and orient_custom_shape.py. But unfortunately all the script gives me same error

"Upgrade to 2.8x required".

For now I manually orient the object's origin as per the bone axis and then reshape the custom shape. But it takes a lot of time...
Q: What can I do in order to get the add-on work again?

As the error message suggests: The add-on needs to be updated to work with 2.8+ - has nothing to do with your OS rather Blender itself: https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Addons. Please provide a link to the add-on so we do not need to search for it. Even better: file a bug report (or a request in this case) on github.

Many thanks for your quick reply, I have changed the value as "blender": (2, 80, 0) inside  bl_info in the python script "orient_custom_shape_V2.py", originally it was "blender": (2, 6, 3). Now when I install this script the error "Upgrade to 2.8x required" does not come. But the goal does not fulfill, means "Orient Bone Shape" button does not come up in pose mode, nightery in view port display ->custom shape, nor in pose context menu (by pressing 'w' button in pose mode).tried all version. Links are, https://developer.blender.org/F207430 , https://github.com/scaredyfish/orient_bone_shapes

If there is a version for 2.8+ already: https://github.com/scaredyfish/orient_bone_shapes install it as is. You do not have to change anything. If this one is not working for whatever reason, I'd suggest file a bug report.

Thank you for your response, I have tried the script provided in the link given by you, but the same error "Upgrade to 2.8x required", Hence I have file a bug report in GitHub. Thank you for your valuable time and response.

I don't get this error. See: How to download and install an add-on hosted on github properly?.

Do not download only one if the scripts. Click on the green code button, download it, install the add-on via add-on preferences (as usual) and it is working fine, see: https://i.sstatic.net/MF6fD.png

Thank you for your help, It worked finally, The mistake, I was unzipping it and then trying to install it. But the link you provided was very helpful. I followed those steps and the option "align bone shape" come up in pose context menu. Many thanks for your valuable time and appropriate guide. The problem is resolved.


text:
Cannot select vertex
I made a plane, and added knife cuts - now i cannot select specific vertices.
See picture below:

Could you in future please use the inline image hosting to display image in question.  https://blender.meta.stackexchange.com/questions/2387/can-a-punishment-be-implemented-for-using-the-word-vertice-in-a-q-a

Hi. Please use the built-in image uploaded to add images: https://meta.stackexchange.com/questions/75491/how-to-upload-an-image-to-a-post

Most likely you have overlapping vertices. That means two or more vertices share the exact same position in 3D space. When you click on one of them, you are actually selecting a vertex, but it doesn't appear like it since one or more are overlapping.
Select all the vertices with the shortcut  A  (in edit mode) then right click > Merge vertices > By distance.

Solved the issue, thank you!


text:
Can I turn Sky texture node into an hdri sequence?
I have a scene where I need to animate the sun, in a timelapse kind of fashion, just going down past the horizon and coming out of the other side, all in a few seconds.
I think the easiest and most realistic way to do this is to use Nishita sky texture, but in the middle of production, I was forced to switch from Cycles to EEVEE because I stumbled onto a bunch of problems and I lacked the time to figure them out.
Problem is, the sky texture node doesn´t work in EEVEE, so I would need to export the animated texture on cycles, lighting included, to an image sequence or video, and then reimport it as an hdri. How can I pull this off?

Okay, I "solved" it and now I feel super stupid. One google search and I found a tutorial on how to do exactly this, from the one and only Ducky3d. In case anyone is interested, it´s over here: https://www.youtube.com/watch?v=6u7MYVmkwyE
Man I suck at this xD

If you add a brief description of what things you have corrected you can and how to do it right you can post this as an answer instead of marking this question as "solved" in the title. If this link to the video goes offline this question has no value for future readers.


text:
Polygon stops when the mirror modifier is turned on and carved in Sculpt mode

I want to carve with the mirror Modifier on. Is there any way to do this?

Why do you want to use mirror modifier for sculpting? Sculpt mode allows for symmetry already.

I want to model while maintaining the square. That's why I'm going to write it.


text:
Correct way to hide a part of mesh in weight paint mode
I'm aware a similar question exists. There is no proper answer and I'll elaborate why I ask this again.
I'd like to show only the upper body of my character, so when I weight paint the arm, I won't accidentally paint the leg or other parts.
I tried the following methods:

Mask modifier. It's horrible because the hidden part still gets painted. You can paint the upperbody than find the lower body's weight is all over the place. And there is absolutely no visual clue telling you're messed up.

Select unwanted vertex, H to hide them in Edit mode. It simply doesn't work at all. Weight paint mode doesn't respect the visiblilty set in Edit mode. (the answer posted on the other question)

Paint Mask of weight paint mode. It kind of separates the unwanted part, which is good, but in this mode I can no longer select bone. With Paint Mask disabled, ⌃ Ctrl+LMB  selects a bone. But with Paint Mask enabled, ⌃ Ctrl+LMB  selects a face (or vertex).

There must be a more proper way to do this, without sacrificing the ability to select bones, right? I just can't figure it out.

Method 2 requires an additional pair of steps.  Once you've hidden the vertices, go into weight paint mode, switch to vertex select and then hit A.  the vertices hidden in edit mode should now be hidden and the weight paint shouldn't effect them.

@MartyFouts well then it becomes Method 3 and I can't select bones anymore...

toggle mask.  make selection. toggle mask.

maybe Alt B to limit borders would help?

Thank you both! Alt+B works quite well for me. I also set a shortcut to toggle Paint Mask just in case.


text:
How do you make a glass cube?
I've watched a couple of tutorials on youtube but none of them give me the result I want.
My cubes always turn out like this where one side is transparent and others are not, I want them to look like the cubes from the PS2 intro. Below are the settings I added to the cubes material and what I want it to look like

Not at all, I messed with those settings before and still no result.

I tried that, still nothing

You have to enable screen space refraction (in the settings) and the same in the out put menu also tell me if you need any image on how to do it

Yea an image would be nice @Nxdhin2005

First enable screen space reflection in settings of the material
then in the render properties enable screen space reflection and then enable refraction in the screen space reflection tab...
Don't forget to change the ior to 1.5

Your IOR is wrong. IOR of typical glass is 1.5

It makes no difference


text:
Select objects in scene by their object color
I would like to select all the objects in the scene that have the same object color Object.color as the active object.
import bpy
active = bpy.context.view_layer.objects.active
color=active.material_slots.data.color
for obj in bpy.data.objects.keys():
    colorSelect = obj.material_slots.data.color
    if colorSelect == color:
        #How do I select this object?

What exactly you'd like to do? Please provide a bit more context.

Given obj is obj.material_slots.data is the question: how to select all objects with same object color obj.color  as context object?

Yes - how to select all objects with same object color obj.color as context object?

Based on your comment, I guess you want to compare against the viewport display color property:

I think one easy way to compare color values is appending the components to a new list and compare the resulting lists using the == operator.
>>> [c for c in C.object.color]
>>> [1.0, 1.0, 1.0, 1.0]
>>>
>>> [c for c in C.object.color] == [1.0, 1.0, 1.0, 1.0]
>>> True

If you don't like lists for any reason, you can also convert the color to a tuple using the slice operator [:], which is even shorter -> thanks to @batFINGER:
>>> C.object.color[:] == (1.0, 1.0, 1.0, 1.0)
True

Full script iterating through Scene.objects, comparing the color values (r,g,b,a) of each object against the values of Context.object and selecting the matches:
import bpy

ctx = bpy.context
obj = ctx.object

# Object color as list
obj_clr = [c for c in obj.color]

for o in ctx.scene.objects:
    if o != obj and o.type not in ('LIGHT', 'CAMERA', 'EMPTY'):
        # Compare both lists
        if [c for c in o.color] == obj_clr:
            o.select_set(True)

obj.select_set(False)

Be aware that there are might be issues with floating point precision when comparing the values. One way around that is using isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0) provided by the math module, which can be wrapped into a little helper function to test all 4 floats at once:
def compare_color(a, b, t=0.001):
    from math import isclose
    comp = {isclose(i, j, abs_tol=t) for i, j in zip(list(a),list(b))}
    return True if (len(comp) == 1 and next(iter(comp)) == True) else False

Another example comparing against Material.diffuse_color using the helper function:
import bpy

def compare_color(a, b, t=0.001):
    from math import isclose
    comp = {isclose(i, j, abs_tol=t) for i, j in zip(list(a),list(b))}
    return True if (len(comp) == 1 and next(iter(comp)) == True) else False

ctx = bpy.context
obj = ctx.object

# Object color as list
obj_clr = obj.active_material.diffuse_color

for o in ctx.scene.objects:
    if o != obj and o.type not in ('LIGHT', 'CAMERA', 'EMPTY'):
        # Compare both lists
        if compare_color(obj_clr, o.active_material.diffuse_color):
            o.select_set(True)

Further Reading: Select an object by name in 2.8 and Set active object in 2.8

or C.object.color[:]

Appreciated @batFINGER, but tbh I dont get why...?

IMO preferable to its equivalent  [c for c in obj.color] or similarly with  bm.verts[:]  etc

Similarly with Vectors
@brockmann has absolutely nailed it.
Here is another example using the length of Vector difference of the colors
import bpy
from mathutils import Vector

context = bpy.context
ob = context.object
col = Vector(ob.color)

for o in context.scene.objects:
    o.select_set((Vector(o.color) - col).length < 1e-4)

To compare only the rgb and not a (alpha) parts, use one of
col = Vector(ob.color).to_3d()
col = Vector(ob.color).xyz
col = Vector(ob.color[3:])

to make the vector 3d (r, g, b)
To select only mesh objects with same rgb color as active
o.select_set(o.type == 'MESH' and (Vector(o.color).xyz - col.xyz).length < 1e-4)


text:
unknown problem with my file, not possible to 3dprint in DXF or STL
So, i need to make a 3d print of my project in blender, but they're is some kind of problem in my file that i don't understand, i asked somebody in a 3d printing store in my city but even him could not help me.
i'm just beginning with the program so maybe i did something wrong creating the object, and i know nothing about 3d printing aha..
i've been told that i have holes in my mesh but i can not find any, or maybe doing it wrong
Can somebody have a check ?

EDIT
Thankyou Carlo, now i understand the significance of manifold and watertight.
Unfortunately, i did not manage to fix the problem... I try a lot of different ways to fix it but did not get lucky.
and i don't have the version 2.80 blender to use the new tool.
i have tried many tied; delete and reconstruct some part and reconnect in many ways..

Not watertight mesh
One thing that may prevent a mesh from being printed, as you already pointed out, is the presence of "holes", which sholud be intended as parts of the mesh that create a discontinuity in the surface.
If you run the Select Boundary loop operator on the mesh:

You'll see that two main edge loops are not connected:

All the rideged surface on the top it's on its own. Being close to each other is not sufficient, you must join the two edgeloops.

A quick and dirty workaround could be to use the new Voxel Remesher tool to fix all the topology issues.
With a low cell size (something like 0.003 for example) you should be able to get an almost identical mesh.

Nice approach. You could also use Select->Select all by trait->Non Manifold. It's pretty useful to get rid of free floating edges and vertices.


text:
Exporting object's rigid body sim XYZ coordinates
I created a simulation of falling apples into a box.
For research purposes, I want to be able to export the XYZ Coordinates of all apples (center of mass of objects, if possible) into a dataset, only for the last frame of the simulation.

I'm new to blender, and have a basic knowledge in Python. Any direction will do nicely.

Related https://blender.stackexchange.com/questions/112029/is-there-any-way-to-export-the-last-frame-of-a-physics-simulation-from-command-l

Bake, then use the matrix world translation
As proposed here Is there any way to export the last frame of a physics simulation from command line?
bake the sim, then in this case instead of exporting, run thru the objects in the scene and print their global translation.  in lieu of Formatting and writing  data to a text file
Make the origin of the physics objects the center of mass when setting up.
import bpy
context = bpy.context

scene = context.scene
rbw = scene.rigidbody_world
pc = rbw.point_cache

# match bake to animation
print(pc.frame_start, pc.frame_end)

bpy.ops.ptcache.bake({"point_cache": pc}, bake=True)

scene.frame_set(250)
#bpy.ops.export_scene.obj(filepath="test.obj")

for ob in scene.objects:
    print(ob.name, ob.matrix_world.translation)

Result on default file, cube made a default rigid and dropped
Cube <Vector (0.0000, 0.0000, -460.8643)>
Lamp <Vector (1.7122, 1.0489, 8.5606)>
Camera <Vector (5.1171, -6.4642, 8.0004)>

Thank you! definitely enough for me to go on

It's easy, if you know python. Use text editor in Blender to write script, and play button (in script editor, not in timeline) to run it

Get selected objects from bpy.context.selected_objects. Then you can get location of object (in current frame) from its location property.
import bpy

for obj in bpy.context.selected_objects:
    print(obj.location)

When you run this script, you will find in terminal something like this:

Each individual component: obj.location.x, obj.location.y, obj.location.z

Looks more simple than I imagined, thanks!

This is great! But how do you run it on a terminal? I actually pressed play inside blender in the python editor and blender just prints bpy.ops.text.run_script() and nothing else. Blender 2.92.0 . Thanks

@iluvatar are you running it in windows? If it so, you should be able to toggle system console in "window" menu

@Crantisz No, in mac. I already found that in Mac i must run blender from the terminal. I did it. When I run the script from blender, I get the initial position of the sphere (in my case), but it does not update even if I animate it. When I play the script with the play button, it just prints the initial position but does not animate and does print the actual position, only the initial one. I need it to print the position of the sphere during the animation (I am trying to design an exercise where physics students play with the restitution coefficient in blender). Thanks for any tip

Why don't you ask a question then? It doesn't work as you think. It launches only one time. If you want to run a script on every frame, you should make a function and add it to frame change handlers: https://docs.blender.org/api/current/bpy.app.handlers.html


text:
How do I append an object from a python script in Blender2.8?
I'd like to Append an object using a python script, and do it in Blender2.8.   I have found some code snippets to do this on 2.7x but having trouble on 2.8.
Below is what I tried.  I get this error on the last line:  AttributeError: 'bpy_prop_collection' object has no attribute 'link'
Thanks for any suggestions or code snippet.  I am beginner level on Python, and intermediate level on Blender.
Matt

# current scene
scn = bpy.context.scene

# path to the blend
filepath = "//2019_template_01.blend"

# name of object(s) to append or link
obj_name = "Chassis"

# append, set to true to keep the link to the original file
link = False

# link all objects starting with 'Chassis'
with bpy.data.libraries.load(filepath, link=link) as (data_from, data_to):

    data_to.objects = [name for name in data_from.objects if name.startswith(obj_name)]

#link object to current scene
for obj in data_to.objects:

    if obj is not None:
       scn.objects.link(obj)

https://blender.stackexchange.com/questions/95408/how-do-i-create-a-new-object-using-python-in-blender-2-80

had the same problem! Here is the solution that worked for me:
change the last code snippet to following:
#link object to current scene
for obj in data_to.objects:

   if obj is not None:
      bpy.context.collection.objects.link(obj)

you can also add collections and their content from other blendfiles with data_to.collections:
for col in data_to.collections:
    bpy.context.scene.collection.children.link(col)


text:
Import FBX using script
Edit: answered my own question! Moderators please delete if not appropriate to leave this here as it doesn't require an answer.
I'm a fool. But for anyone else who might have a similar question in the future ...
import bpy

bpy.ops.import_scene.fbx(filepath="F:/Blender/2019-04-09-S.fbx")

Source: https://docs.blender.org/api/blender2.8/bpy.ops.import_scene.html

Original question:
Can anyone help me to import an FBX file using a script in 2.80?
Based on other answers here, I've tried:
bpy.ops.import_scene.fbx (filepath = 'F:\Blender\FBX\2019-04-09-S.fbx')

Could you put your answer as an actual answer and accept it as solution, so the question won't show up as unsolved? Thx!

Posting as an answer (to my own question), as requested.
For anyone else who might have a similar question in the future, don't forget to use forward slash '/' in filepaths ...
import bpy

bpy.ops.import_scene.fbx(filepath="F:/Blender/2019-04-09-S.fbx")

Source: https://docs.blender.org/api/blender2.8/bpy.ops.import_scene.html


text:
90 degrees angle smooth
I've got a model.
It's shaded smooth in object mode (+ autosmooth). So everything's ok, but I need to smooth several 90 degrees angles. 3 angle is smooth, 2nd is not, the first one needs to be smooth too. How can I do that?
upd:

It looks to me like 3 has a bevel, but the others do not have the same bevel.
Try selecting the 90 degree edges and applying a bevel (ctrl B).

If I separate mesh I can do this for 90 degree angle (autosmooth off, picture updated). Shaded smooth only several faces in edit mode, not whole object. But I have to keep this whole details as one object for UV, so I need shade smooth whole object and these several 90 degree angles

Use Ctrl + B  to bevel if that's what you mean by smooth.
Make sure to apply scale beforehand


text:
Setting per-vertex colors
I would like to be able to set vertex colors via bpy.  There are a number of answered questions including this one Set a specified vertex color to black via python for coloring the central vertex of a hexagon shape.
I have set up a scene with a subdivided mesh (2 or 3 times).  I then ran the following script:
import bpy
import bmesh
from random import uniform
import mathutils

context = bpy.context
mesh = context.object.data

if mesh.is_editmode:
    bm = bmesh.from_edit_mesh(mesh)
else:
    bm = bmesh.new()
    bm.from_mesh(mesh)

if not bm.loops.layers.color.get("color"):
    color_layer = bm.loops.layers.color.new("color")
else:
    color_layer = bm.loops.layers.color.get("color")

red = mathutils.Vector((1, 0, 0, 1))
black = (0, 0, 0, 1)
for face in bm.faces:
    for loop in face.loops:
        print("Vert:", loop.vert.index)
        print("link_edges:", len(loop.vert.link_edges))
        print("LOOP color:", loop[color_layer] )
        loop[color_layer] = black if len(loop.vert.link_edges) == 4 else red
        print("LOOP color:", loop[color_layer] )

if bm.is_wrapped:
    bmesh.update_edit_mesh(mesh, False, False)
else:
    bm.to_mesh(mesh)
    mesh.update()

bm.clear

Thanks to the suggestions of batFINGER the script now works and changes loop colors for the vertices (there are 3 or 4 link_edges for each vertex).  The results can be seen in the Texture Paint workspace by selecting Vertex Paint in the selection box.
Prior to my update of the above script the colors were not changing.  I don't quite understand why it is now working - but I glad it now works.

Couple of things. You are setting the color to red or red.   Each time you run you are creating a new color layer. If you already have a layer you can get it from its name example https://blender.stackexchange.com/questions/76520/how-to-get-random-color-variation-on-a-single-mesh/136926#136926

Good one. Suggest rolling back question edit and making it an answer.


text:
Cannot manipulate UVs in the UV editor viewport
I am unable to select or move UVs through the UV editor. Pressing any of the selection tools (B for box C for Circle and Ctrl-RMB for Lasso Select) does nothing and does not appear in the viewport.  I can manipulate the UVs outside of the UV editor and by using the circle selection option, under the Select tab but I am unable to do anything further. This issue occurred after I was UV editing my object and happened for seemingly no reason. I have tried to undo the affair by unselecting the options on the toolbar to no avail.
I am using Blender v2.79.

It is hard to replicate a problem, that happens for no reason. Can you attach a .blend file with the problem? You can use https://blend-exchange.giantcowfilms.com/ to do so. You can also delete all the stuff you don't want to share obviously and leave only some part of geometry with the issue repeatable. Also, why are you using an outdated version?

@MartynasŽiemys I am using an older version of Blender as that is the version I learnt to use before v2.8 was released. Also, too-much has changed between versions 2.79 and 2.8 such as the menu locations and the shortcuts, so I've decided to remain using it.

@MartynasŽiemys Also when I tried opening the file in the latest version of Blender it seems to work fine however the UV mapping does not update imminently in the 3D viewport.

Well, you are missing literally thousands of improvements. A good reason to use 2.79 would be if you needed it for some very specialized task and used some addon or custom written code not compatible with later versions, but it is hard to see much logic beyond that. You are really missing a whole lot by using an old version. I would recommend not to put yourself at such a disadvantage.

You have UV Sculpt enabled (hotkey is Q, maybe it's not terribly hard to hit it by accident)in the UV Editor's "t" panel. Hit t to show the panel, navigate to options tab and disable it or just hit Q while in UV Editor to get out of UV Sculpt mode:


text:
Can this quality be achieved in Blender?

this is a close-up shot of cardboard sheet,
can i achieve this quality in 3d (blender)?

Hello, yes of course

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.

It's not opinion based at all. 'Quality' can be interpreted in different ways, but that is not relevant. Whatever possible criteria the example image can be evaluated by (apart from artistic/creative) can be replicated using Blender. Blender has tools to make all elements that are required to create it digitally: modelling, texturing, shading, rendering, post-processing. Imperfections can be modelled, sculpted or displacement, shaders don't require properties not supported by Cycles, glare and depth of field is no problem. If provided image was actually made in Blender it would surprise noone.

A gigapixel image of a carpet made with iridescent fiber strands casting acurate caustics can not be rendered in 64bit float color depth format and CMYK color system in Blender in terms of quality for example... That would not be opinion based statement.

Yes.
Obviously. Blender is designed for CGI creation and has all the tools needed for modelling, creating shaders, lighting, rendering and post-processing images. Modelling tools available are more than sufficient to model geometries way more complex than what is shown in the image. Cycles and even EEVEE render engines are capable of rendering even more complex light interactions than shown. Shaders needed for an image like that are not that complex and there is even functionality to create procedural textures with Blender's material nodes so even textures for something like that can be created without leaving Blender. Compositor nodes are sufficient for achieving depth of field and various glow effects in post-processing and the technical side of the example is very basic - it's just a 1436x866 pixel, 8 bit per channel image in the most popular image format - JPEG.
So the answer is: Not only most definitely yes, but tools available in Blender are adequate for achieving way more complex and sophisticated images in pretty much all aspects the word "quality" can be used to describe an image, except of course artistic value - that's up to the creator, not the tool, because Blender on it's own does not do much. It's up to the artist to use the tool in creative ways to come up with impressive visuals.