text:
Copy animation onto skeleton with different bone orientations
First off I want to say that my question is kind of hard for me to put into words,so I apologize if this is hard to understand. I'm trying to port animations from one game to another for a mod I'm making.
The animations I want to port has its skeleton bones rotated differently from the other game's skeleton. How can I port the animations onto the other game's skeleton while retaining its original bone rotation?
I just know it's possible to do this somehow,since someone did it before: http://steamcommunity.com/sharedfiles/filedetails/?id=832086722
I've asked the creator of this mod the same question but they never replied,which is why I came here to try and find out the process. If you need pictures,more details,or even a blend file,I can provide them.

What you are looking for is "retargeting", which is quite complex and needs an addon: https://blender.stackexchange.com/questions/26216/can-blender-be-used-to-re-target-animations-to-other-rigs

How do I use retargeting to port these animations?

It's too broad for this site, you must read all the documentation indicated in the link.

I've watched a few videos by Benjy Cook on retargeting,but I still can't figure out how to get it to work.
https://imgur.com/a/xli7F this is a picture of the bone rotations.

Can I send you a blend file to try and help me?


text:
How to pass text argument to a popover panel?
In the example below I have 3 instance of a same popover panel class
i want to pass a string argument to these panels, so they each display different text, without creating 3 different panel
how can i do that?
import bpy

class TEST_PT_popover(bpy.types.Panel):
    bl_idname      = "TEST_PT_popover"
    bl_label       = ""
    bl_category    = ""
    bl_space_type  = "VIEW_3D"
    bl_region_type = "HEADER"

    def __init__(self,):
        pass

    def draw(self, context):
        self.layout.label(text="Contextual String?")

class TEST_PT_1(bpy.types.Panel):
    bl_idname      = "TEST_PT_1"
    bl_label       = "Panel1"
    bl_category    = "PASS_TXT"
    bl_space_type  = "VIEW_3D"
    bl_region_type = "UI"
    bl_context     = "objectmode"

    def draw(self, context):
        layout = self.layout

        row = layout.row()
        pass_this_string = "This an interesting text about One"
        row.popover(panel="TEST_PT_popover", text="One")

        row = layout.row()
        pass_this_string = "This is all about the number two"
        row.popover(panel="TEST_PT_popover", text="Two")

class TEST_PT_2(bpy.types.Panel):
    bl_idname      = "TEST_PT_2"
    bl_label       = "Panel2"
    bl_category    = "PASS_TXT"
    bl_space_type  = "VIEW_3D"
    bl_region_type = "UI"
    bl_context     = "objectmode"

    def draw(self, context):
        layout = self.layout

        row = layout.row()
        pass_this_string = "And this is α, in another panel"
        row.popover(panel="TEST_PT_popover", text="Alpha") #the method should work on multiple interface too! some of the answers below will not support multiple panels

classes = (TEST_PT_1,TEST_PT_2,TEST_PT_popover,)

def register():
    for cls in classes:
        if not cls.is_registered:
            bpy.utils.register_class(cls)
def unregister():
    for cls in reversed(classes):
        if cls.is_registered:
            bpy.utils.unregister_class(cls)

unregister()
register()

I wanted a behavior similar to what we do when we pass an argument to an operator :
op = layout.popover(panel="TEST_PT_popover", text="One")
op.text = "this" #op will be None, this will not work!

I am aware of layout.context_pointer_set() function, however, we cannot pass simple string argument with this function, unfortunately, we are forced to create properties for each argument we want to pass, there should be an easy trick to pass a simple text argument from a UILayout to a Panel class, isn't it?

IDEA: maybe there's a way to call an operator that will call a window_manager drawing popover function? from the operator we could pass the argument to the panel class easily. I do not recall that pop_over panels could be called from a typical window_manager function tho..

Just for the sake of it I'll add another solution. Warning, it's very hacky. You can abuse the fact that you can set any arbitrary named member to the context and use None as data.
It is highly dependent on the actual strings you want to display and I wouldn't rely on it too much since it can cause name collisions and such, but it is self contained in the draw methods.
I use a prefix my_string_ to recognize the label I want to display. But since the different members add up, I needed a way to take only the very last one I added, hence the integer counter to only pick the last one.
import bpy

class TEST_PT_popover(bpy.types.Panel):
    bl_idname      = "TEST_PT_popover"
    bl_label       = ""
    bl_category    = ""
    bl_space_type  = "VIEW_3D"
    bl_region_type = "HEADER"

    def draw(self, context):
        attrs = [attr.split("my_string_")[1] for attr in dir(context) if attr.startswith("my_string_")]
        attrs.sort()
        self.layout.label(text=attrs[-1][2::])

class TEST_PT_test(bpy.types.Panel):
    bl_idname      = "TEST_PT_test"
    bl_label       = "test"
    bl_category    = "test"
    bl_space_type  = "VIEW_3D"
    bl_region_type = "UI"
    bl_context     = "objectmode"

    def draw(self, context):
        layout = self.layout
        for label, text, i in zip(("Hello", "World", "!"), ("One", "Two", "Three"), range(3)):
            row = layout.row()
            row.context_pointer_set(f"my_string_{i}_{label}", None)
            row.popover(panel="TEST_PT_popover", text=text)

def register():
    bpy.utils.register_class(TEST_PT_test)
    bpy.utils.register_class(TEST_PT_popover)

register()

Ingenious solution :D Indeed hacky but that could work

I marked your solution as resolved, until perhaps someone find something not hacky, i doubt there are elegant solution for this particular case

Hehe I'm a bit ashamed to have posted such a monstrosity TBH >< I hope I just missed something. Maybe worth pinging @ideasman42 who demonstrated a fancy recursive menu just yesterday https://blender.stackexchange.com/a/269716/86891

initial approach
One possible solution which I successfully used in a different context is to use Pythons type() function to dynamically instantiate a class.
This allows you to register Blender classes, like UI_Lists, Popovers, etc dynamically, and if you combine this with the concept of inheritance (mix-in classes), you should be able to re-use code efficiently. The beauty of this method is that it not only works from registration code as I did it here. In my own example I dynamically register UI_Lists from within an Operator as well, and this so far works beautifully.
I have commented the steps in the demo Add-on below. Just add random texts to the texts list as you wish. Of course you could also rework this using Python dictionaries etc. etc., but from here only you know what you want to achieve actually.
Complete Add-on example with comments below:
'''
Created on 25.07.2022

@author: r.trummer
'''

import bpy
from bpy.types import Panel

bl_info = {
    "name": "Popover Demo",
    "author": "Rainer Trummer",
    "version": (0, 1, 0),
    "blender": (3, 1, 0),
    "description": "draws variable popovers in the UI",
    "category": "Interface"
}

#    holder variable for our dynamic classes which each will be a popup
popoverClasses = []

#    the texts you want to pass on to each class
texts = ['alpha', 'beta', 'gamma', 'delta', 'epsilon']

#===============================================================================
#    the TEST_PT_popover class is a mix in class which we will later on
#    combine with the Panel class using inheritance. In here we add our own
#    ui_text Propoerty, which in the dynamic instantiation we can fill with
#    our desired content. Of course you can define as many properties as you
#    like. Even lists will work
#===============================================================================
class TEST_PT_popover():
    bl_category = ""
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    #    note the bl_options has to be set to INSTANCED, otherwise the Panels will
    #    draw twice in the UI. You'll see what I mean if you comment it out
    bl_options = {'INSTANCED'}

    #    hold the text info the user dynamically wants to change
    ui_text = None

    def draw(self, context):
        #    put your to be shared draw code in here
        self.layout.label(text = self.ui_text)

#===============================================================================
#    this class draws our main Panel, where the Popovers will live in
#===============================================================================
class TEST_PT_popover_holder(Panel):
    bl_idname = "TEST_PT_popover_holder"
    bl_label = "sucker"
    bl_category = ""
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        layout.label(text = 'HOLDER')

        #    iterate over all given texts and construct a unique name for the Panel
        for i, t in enumerate(texts):
            print(f'drawing popover myPanel_PT_{i}')
            layout.popover(panel = f'myPanel_PT_{i}', text = t)

classes = (
    TEST_PT_popover_holder,
    )

def register():
    #    standard base class registration first
    #    do NOT yet register our dynamic class
    for c in classes:
        bpy.utils.register_class(c)

    #    now iterate over all texts...
    for i, t in enumerate(texts):
        #    ...and using the type function create a panel class dynamically
        #    this class gets a unique name by adding an index, and inherits from
        #    TEST_PT_popover and Panel classes at the same time
        panelClass = type(f'myPanel_PT_{i}', (TEST_PT_popover, Panel), {})

        #    now give the new class a label
        panelClass.bl_label = t

        #    and finally, this is what you're here for, set the custom ui_text
        panelClass.ui_text = f'{t} is my favorite number {i+1}'

        #    appending the new class to a static variable helps us to unregister
        #    the new class afterwards when we exit Blender or reload Add-ons
        print(f'appending popover {panelClass} to class holder variable')
        popoverClasses.append(panelClass)

        #    now finally register the dynamic class
        print(f'registering class {panelClass}')
        bpy.utils.register_class(panelClass)

def unregister():
    #    iterate over all dynamic classes that we created and unregister them
    for poc in popoverClasses:
        print(f'unregistering class {poc}')
        bpy.utils.unregister_class(poc)

    #    clear the variable too
    popoverClasses.clear()

    #    standard unregistration code
    for c in reversed(classes):
        bpy.utils.unregister_class(c)

if __name__ == '__main__':
    register()

review after additional comment
After reviewing the additional question from the comment, I understand that the request is to create multiple Panels with multiple Popups each, and pass on Strings to them. I have updated the example above with the following approach, where instead of a text list I use a dictionary. Dictionaries are very flexible and can also hold lists as data, while using strings as keys. Only requirement is that the keys are unique. Also the Panel and Popup names need to be unique, so that's something to watch out for.
By constructing a dictionary, where the keys() are the Panel header names, and the items() are the lists of strings that shall become popups, then using dynamic registration twice, this becomes rather flexible. Just change the texts dictionary to whatever you require:
'''
Created on 25.07.2022

@author: r.trummer
'''

import bpy
from bpy.types import Panel

bl_info = {
    "name": "Popover Demo",
    "author": "Rainer Trummer",
    "version": (0, 1, 5),
    "blender": (3, 1, 0),
    "description": "draws variable popovers in the UI",
    "category": "Interface"
}

#    holder variable for our dynamic classes which each will be a popup
popoverClasses = []

#    the texts you want to pass on to each class
texts = {'Panel A': ['alpha', 'beta', 'gamma', 'delta', 'epsilon'],
        'Panel B': ['not', 'a', 'fan', 'of', 'Greek', 'nomenclature'],
        'Some Dude At The End': ['latin', 'rocks']}

#===============================================================================
#    the TEST_PT_popover class is a mix in class which we will later on
#    combine with the Panel class using inheritance. In here we add our own
#    ui_text Propoerty, which in the dynamic instantiation we can fill with
#    our desired content. Of course you can define as many properties as you
#    like. Even lists will work
#===============================================================================
class TEST_PT_popover():
    bl_category = ""
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    #    note the bl_options has to be set to INSTANCED, otherwise the Panels will
    #    draw twice in the UI. You'll see what I mean if you comment it out
    bl_options = {'INSTANCED'}

    #    hold the text info the user dynamically wants to change
    ui_text = None

    def draw(self, context):
        #    put your to be shared draw code in here
        self.layout.label(text = self.ui_text)

def generate_panel_name(number, caption):
    return f'myPanel_PT_{caption.replace(" ", "_")}_{number}'

#===============================================================================
#    this class draws our main Panel, where the Popovers will live in
#===============================================================================
class TEST_PT_popover_holder(Panel):
    bl_idname = "TEST_PT_popover_holder"
    bl_label = "Main Panel"
    bl_category = ""
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        layout.label(text = 'HOLDER')

#===============================================================================
#    this class will also be dynamically instantiated, and create the Panels
#    themselves, as childs of the main manel
#===============================================================================
class TEST_PT_popover_panel_item(Panel):
    bl_label = "subitem"
    bl_category = ""
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    #    make this Panel a child of the holder Panel
    bl_parent_id = TEST_PT_popover_holder.bl_idname
    bl_options = {'INSTANCED'}

    dictionaryIndex = None
    customCaption = None

    def draw(self, context):
        layout = self.layout
        layout.label(text = self.customCaption)

        #    now iterate, for the passed on dictionary element, over the given list of tests
        #    by doing this, we pick a certain text list from the dictionary to be displayed
        #    in this specific Panel
        for i, t in enumerate(texts[self.dictionaryIndex]):
            print(f'drawing popover myPanel_PT_{i} called {self.dictionaryIndex}')
            layout.popover(panel = generate_panel_name(i, self.dictionaryIndex), text = t)

classes = (
    TEST_PT_popover_holder,
    )

def register():
    #    standard base class registration first
    #    do NOT yet register our dynamic class
    for c in classes:
        bpy.utils.register_class(c)

    #    construct unique names for Panel classes
    for k, p in enumerate(texts):
        #    k is the index in the Dictionary
        #    p is the Panel name
        #    register a sub-Panel class first to hold the elements
        panelClassName = generate_panel_name(k, f'{p}_panel')

        print(f'creating Panel Class {panelClassName}')
        panelClass = type(panelClassName, (TEST_PT_popover_panel_item, Panel), {})

        #    pass the dictionary index so the subpanel finds the right text list from the dictionary
        panelClass.dictionaryIndex = p
        #    also change the Panel label while we're at it
        panelClass.customCaption = f'this is {p}'
        #    and if you like, the header too
        panelClass.bl_label = f'{p.upper()}'

        #    register the Panel now
        bpy.utils.register_class(panelClass)
        popoverClasses.append(panelClass)

        #    now iterate, for each dictionary element, over the given list of tests
        for i, t in enumerate(texts[p]):
            #    i is the index of the string list picked from the dictionary
            #    t is the text string itself

            pName = generate_panel_name(i, p)
            print(f'constructing popover Panel called {pName}')

            #    ...and using the type function create a panel class dynamically
            #    this class gets a unique name by adding an index, and inherits from
            #    TEST_PT_popover and Panel classes at the same time
            popoverClass = type(pName, (TEST_PT_popover, Panel), {})

            #    now give the new class a label
            popoverClass.bl_label = f'label of this class: {t}'

            #    and finally, this is what you're here for, set the custom ui_text
            popoverClass.ui_text = f'{t} belongs to Panel class {p}'

            #    appending the new class to a static variable helps us to unregister
            #    the new class afterwards when we exit Blender or reload Add-ons
            print(f'appending popover {popoverClass} to class holder variable')
            popoverClasses.append(popoverClass)

            #    now finally register the dynamic class
            print(f'registering class {popoverClass}')
            bpy.utils.register_class(popoverClass)

def unregister():
    #    iterate over all dynamic classes that we created and unregister them
    for poc in popoverClasses:
        print(f'unregistering class {poc}')
        bpy.utils.unregister_class(poc)

    #    clear the variable too
    popoverClasses.clear()

    #    standard unregistration code
    for c in reversed(classes):
        bpy.utils.unregister_class(c)

if __name__ == '__main__':
    register()

thanks for your input, Could this technique work on multiple panels? I feel that the global will get in the way! I currently rely on a similar procedural registering system, i search for commented markers on all py modules with regex such as #REGTIME_PROP:"my_prop";VALUE"this text" and create the classes/props i need at regtime.
I'll leave the bounty active for a few days, I'm hoping maybe a bpy blender developer such as @ideasman42 or @dr. Sybren could give us a canonical statement on this problem

@DB3D I updated my answer with what I think fits your requirement, even though it's not utterly clear to me what you're looking for in the end. For questions such as this, it is sometimes better to supply a UI mockup with the desired outcome, and describe what you'd like to use as input

Alright I swear this is the last one :)
The awesome recursive menus answer found there pushed me in the right direction to get a solution idea which is quite clean.
You can pass a bpy.types.UILayout.row as data in layout.context_pointer_set.
By dynamically populating a dictionary as a member of the panel class, we can use the row as a lookup key to retrieve the label.
import bpy

class TEST_PT_popover(bpy.types.Panel):
    bl_idname      = "TEST_PT_popover"
    bl_label       = ""
    bl_category    = ""
    bl_space_type  = "VIEW_3D"
    bl_region_type = "HEADER"

    labels = {}

    def draw(self, context):
        self.layout.label(text=self.labels[context.my_mapping_label])

class TEST_PT_test(bpy.types.Panel):
    bl_idname      = "TEST_PT_test"
    bl_label       = "test"
    bl_category    = "test"
    bl_space_type  = "VIEW_3D"
    bl_region_type = "UI"
    bl_context     = "objectmode"

    def draw(self, context):
        layout = self.layout
        for label, text in zip(("Hello", "World", "!"), ("One", "Two", "Three")):
            row = layout.row()
            row.context_pointer_set("my_mapping_label", row)
            TEST_PT_popover.labels[row] = label
            row.popover(panel="TEST_PT_popover", text=text)

def register():
    bpy.utils.register_class(TEST_PT_test)
    bpy.utils.register_class(TEST_PT_popover)

register()

this is much more elegant, however i tried on multiple T panel and it seems that the argument starts to get mixed up, because we rely on blender execution order, and i doubt it is something we can  anticipate/rely upon

the more i look at it... it seems that row or any layout objects cannot be relied as an identifier, because the hash of the obj seems to repeat themselves from one main panel to another. We are really starting to flirt with the limit of bpy here i believe, reverse engineer how they deal memory adress and execution time lmao if you want to take a look https://wtools.io/paste-code/bD8M

Interesting. Yeah I figure it's pushing the limits a bit too far. I hope you find a middle ground that's not too hacky nor ugly :)

You can use a bpy.props.CollectionProperty and populate it with somme dummy instances of a PropertyGroup. It means you'll have to use some boilerplate code at register though.
import bpy

class TEST_PT_popover(bpy.types.Panel):
    bl_idname      = "TEST_PT_popover"
    bl_label       = ""
    bl_category    = ""
    bl_space_type  = "VIEW_3D"
    bl_region_type = "HEADER"

    def draw(self, context):
        self.layout.label(text=context.my_string.name)

class TEST_PT_test(bpy.types.Panel):
    bl_idname      = "TEST_PT_test"
    bl_label       = "test"
    bl_category    = "test"
    bl_space_type  = "VIEW_3D"
    bl_region_type = "UI"
    bl_context     = "objectmode"

    def draw(self, context):
        layout = self.layout
        for i, text in enumerate(("One", "Two", "Three")):
            layout.context_pointer_set("my_string", context.scene.my_strings[i])
            layout.popover(panel="TEST_PT_popover", text=text)

class StringPG(bpy.types.PropertyGroup):
    pass  # name is a default property, no need to redefine it

def register():
    bpy.utils.register_class(StringPG)
    bpy.types.Scene.my_strings = bpy.props.CollectionProperty(type=StringPG)
    bpy.utils.register_class(TEST_PT_test)
    bpy.utils.register_class(TEST_PT_popover)

register()
bpy.context.scene.my_strings.clear()
bpy.context.scene.my_strings.add().name = "Hello"
bpy.context.scene.my_strings.add().name = "World"
bpy.context.scene.my_strings.add().name = "!"

Thanks a lot for your answer!
That's what we are currently doing in our studio and we had to register 30+ additional properties, just to transfer a text arg from one panel to another..  i was wondering if there are a more elegant solutions, thus my question

I think this is the most robust one, but I agree that it would be nice to be able to seamlessly pass arbitrary arguments to UI elements like we can with operators... Cheers

source: Stack Exchange

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

sort: votes


text:
How to create a modal dialog box operator?
I want my dialog box to run a modal function while the user has the dialog box open, how can i do that?

It is possible to launch two instances of an operator simultaneously
in this case a modal operator & a dialog props operator. when a dialog box stop being drawn, the __del__ dunder method will be called, therefore you can track the dialog state that way, & the modal operator can shut down if this dialog state is not active anymore
import bpy

class PLUGIN_OT_modal_dialog(bpy.types.Operator):
    """modal state while the dialog box is active, call invoke default mandatory"""

    bl_idname  = "plugin.modal_dialog"
    bl_label   = ""
    bl_options = {'REGISTER', 'INTERNAL'}

    #find if dialog is currently active?

    def get_cls(self):
        cls = PLUGIN_OT_modal_dialog
        return cls

    dialog_state = False

    def get_dialog_state(self)->bool:
        return self.get_cls().dialog_state

    def set_dialog_state(self, value:bool,)->None:
        self.get_cls().dialog_state = value
        return None

    instance_type : bpy.props.StringProperty(default="UNDEFINED", options={'SKIP_SAVE',},)

    def invoke(self,context,event,):
        """decide if we'll invoke modal or dialog"""

        #launch both modal & dialog instance of this operator simultaneously
        if (self.instance_type=="UNDEFINED"):
            bpy.ops.plugin.modal_dialog('INVOKE_DEFAULT',instance_type="DIALOG",)
            bpy.ops.plugin.modal_dialog('INVOKE_DEFAULT',instance_type="MODAL",)
            return {'FINISHED'}

        #launch a dialog instance?
        if (self.instance_type=="DIALOG"):
            self.set_dialog_state(True)
            return context.window_manager.invoke_props_dialog(self)

        #launch a modal instance?
        if (self.instance_type=="MODAL"):
            self.modal_start(context)
            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}

        return {'FINISHED'}

    def __del__(self):
        """called when the operator has finished"""

        #some of our instances might be gone from memory,
        #therefore 'instance_type' is not available for some instance at this stage
        #not the dialog box instance tho & we need to update class status

        try:
            if (self.instance_type=="DIALOG"):
                self.set_dialog_state(False)
        except:
            pass

        return None

    def modal(self,context,event,):
        """for modal instance"""

        #modal state only active while dialog instance is!
        if (self.get_dialog_state()==False):
            self.modal_quit(context)
            return {'FINISHED'}

        print("modal")

        return {'PASS_THROUGH'}

    def modal_start(self,context,):
        print("modal_start")
        return None

    def modal_quit(self,context,):
        print("modal_quit")
        return None

    def draw(self, context,):
        """dialog box ui code"""

        self.layout.label(text="my drawing")

        return None

    def execute(self, context,):
        """mandatory function called when user press on 'ok' """

        return {'FINISHED'}

if __name__ == "__main__":
    try:
        bpy.utils.unregister_class(PLUGIN_OT_modal_dialog)
    except:
        pass
    bpy.utils.register_class(PLUGIN_OT_modal_dialog)

    bpy.ops.plugin.modal_dialog('INVOKE_DEFAULT')

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


text:
Detect user event (bpy.types.Event) anywhere from blender?
In blender interface, when multiple objects are selected if we press "ALT" on the keyboard while changing a property, the behavior of the property execution change (in this case we can batch change every selected objects at the same time)
How can I have a similar behavior with my python bpy.props properties ?
is there a way to tell if the user is pressing "ALT" from my prop update function?
How can I make my property run a different execution if my user is pressing the ALT key when interacting with my prop from the GUI for example?
Thanks

What i really need is bpy.Types.event, unfortunately, it is only accessible from an Operator invoke() or modal()
so here's the trick
_event = None

class SCATTER5_OT_get_event(bpy.types.Operator):
    bl_idname  = "scatter5.get_event"
    bl_label   = ""

    def invoke(self, context, event):
        global _event
        _event = event
        return {'FINISHED'}

def get_event():
    global _event
    bpy.ops.scatter5.get_event('INVOKE_DEFAULT')
    return _event

event = get_event()

to get event from anywhere in your script
what would have been be nice is something like bpy.context.window_manager.event, unfortunately this API does not exist (not sure why this type is only accessible from operators?)
Also, it would be ideal if there was a built-in python module that can detect keyboard input, unfortunately, I didn't find one.
feel free to propose an alternative method

example of implementation by @batFINGER
press alt/shift/ctrl/oskey while interacting with foo prop
import bpy

_event = None

class SCATTER5_OT_get_event(bpy.types.Operator):
    bl_idname  = "scatter5.get_event"
    bl_label   = ""

    def invoke(self, context, event):
        global _event
        _event = event
        return {'FINISHED'}

def get_event(exec_context='INVOKE_DEFAULT'):
    global _event
    bpy.ops.scatter5.get_event(exec_context)
    return _event

def foo(self, context):
    event = get_event('INVOKE_REGION_WIN')
    print(
        "Shift" if event.shift else "",
        "Alt" if event.alt else "",
        "Ctrl" if event.ctrl else "",
        "OSKey" if event.oskey else "",
        event.value)

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

def register():
    bpy.types.Object.foo = bpy.props.IntProperty(
            update=foo,
            )
    bpy.utils.register_class(SCATTER5_OT_get_event)
    bpy.types.TEXT_HT_footer.prepend(draw)

if __name__ == "__main__":
    register()

Well, looks like 3.3 broke this code
looks like _event = event reference is fading once operator is finished


text:
vertex based occlusion with python?
i was wondering if there's a way to bake (scene scale) ambient occlusion information into an object vertex group?
I believe the only option is to uv unwrap the terrain, create a new image texture, bake a cycle material into an image texture (a destructive i'd like to avoid),  then try to convert the uv image data into a vertex group. but this solution is something i'd like to avoid. as it's taking extremely destructive steps. is there a more direct solution?

Does this answer your question? How to bake to vertex colors in blender cycles?

brockmann no unfortunately i was searching for a more direct solution

Could you please elaborate on how the "more direct solution"  result would look ?

calculate a vertex based occlusion, a function that would receive point clouds as input and return normalized occlusion values ?


text:
Centralizing properties updates in one function?
Is there any way have some more information of the prop from it's update function?
In the example below, unfortunately, self will point out to bpy.types.Scene, instead of the prop itself.
so it seem at first glance that we cannot have any information of the props from the update function, and we are forced to have one update function per prop, instead of a single centralized update function that could work with every one the prop
(Note that We can have more information from set, but of course, it will create feedback loops if we change the prop value.. )
please prove me wrong
def update(self,context):
    print("what is this prop value?")
    print("what is this prop api?")
    print("what is this prop name?")
    return None

bpy.types.Scene._prop          : bpy.props.FloatProperty(default=1.0 , name="Prop", update=update)
bpy.types.Scene._prop_this     : bpy.props.FloatProperty(default=1.1 , name="Prop This", update=update)
bpy.types.Scene._prop_that     : bpy.props.FloatProperty(default=1.2 , name="Prop That", update=update)
bpy.types.Scene._prop_another  : bpy.props.FloatProperty(default=1.3 , name="Prop Another", update=update)

maybe self._prop? What do you want to do exactly?

I want to get the self._prop information, as the update function is centralized, it seem impossible to get prop from where the update was launched

If you want to do something different per prop, why defining several update functions is not the way?

No, i want to do the same thing for each properties, creating one update function per properties seem absurd, but it seem that blender API leave us no choice

Make a generic function to create your update method.
There is another answer very similar to this by @pinkvertex could not find it.
Instead using one function as the update method, create a method factory to pass properties to.
Example code, and example run (pretty self-explanatory),
import bpy
from bpy.props import FloatProperty
from bpy.types import Scene

def update(prop):
    def update(self, context):
        print(f"Update {prop} of {self}")
        return None
    return update

for prop in ("prop_this", "prop_that", "prop_another"):
    setattr(
        Scene,
        prop,
        FloatProperty(
            default=1.0,
            name="Prop",
            update=update(prop)
            )
        )

Sample run.
>>> C.scene.prop_this
1.0

>>> C.scene.prop_this = 4
Update prop_this of <bpy_struct, Scene("Scene") at 0x7fc97bff8008>

>>>

Two things re question code,

The properties are assigned to the type, not as an annotation. Use
annotations in a class definition.
Cannot create a private variable prefixed with underscore.
 >>> bpy.types.Scene._prop = bpy.props.FloatProperty()
 Traceback (most recent call last):
 File "<blender_console>", line 1, in <module>
 ValueError: bpy_struct "Scene" registration error: _prop could not register because the property starts with an '_'

This function factory was a grat idea! thanks a lot!

Finally found the dupe & noticed I  was one of two to mark it as a favourite. Note the lambda def in comments below PV answer. Handy for setting up generic handlers too. https://blender.stackexchange.com/a/133129/15543


text:
Low poly curve to a high poly curve ?
i want to make this set of faces more polished , more round , just having more faces forming a more defined curve
normally i do a subdivision with the modifier and crease the faces from top and below but the model is too complex for that
how am i supposed to do ?
temporary file link:
https://we.tl/t-r7BXMT7Vxd
thanks

If possible please attach the .blend so we can test out what works in this case https://blend-exchange.giantcowfilms.com/

i got an error when uploading to you site , i put a wetransfer link

It's not too complicated, it just has bad geometry. I would separate the desktop, fix geometry and use subsurf on it.

Your topology is not good, therefore it limits the improvements you can make. But you can make that corner much rounder with bevels:

Go in Edit mode > Edge select mode.
Select the edges of your corner.
Press ctrl B and drag your mouse.
Press + or - or scrollwheel to increase or decrease the amount of edges of your bevel.
Your corner is rounder.

thanks a lot , i didnt know i could use a bevel for this king of usage


text:
How to store a PropertyGroup in addon_prefs?
i made some research about propertygroups. it could be really useful if the data of thoses propertygroups are saved within my addon pref and not reset between each blender session. How am i supposed to do that ?
i did an addon example using propertygroups.

# "Scatter" Add-on
# Copyright (C) 2019 Dorian Borremans aka BD3D
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
# <pep8 compliant>
bl_info = {
    "name" : "PropertyGroup [BD3D]",
    "author" : "BD3D",
    "description" : "The scattering tool of 2.8",
    "blender" : (2, 80, 0),
    "location" : "Operator",
    "warning" : "",
    "category" : "Generic"
}
import bpy
import bmesh
import random
from bpy.types import Menu, Panel, Operator, PropertyGroup
import webbrowser
from bpy.types import Operator, AddonPreferences, PropertyGroup
from bpy.props import StringProperty, IntProperty, BoolProperty, FloatProperty, EnumProperty, PointerProperty
import rna_keymap_ui
context = bpy.context

######################################################################################
######################################################################################
# # # # # # # # # # # #          ADDON PREF STORAGE            # # # # # # # # # # # #
######################################################################################
######################################################################################
class ScatterPref(AddonPreferences):
    bl_idname = __name__
    addon_prefs = context.preferences.addons[__name__].preferences

    scatter_01_name                = StringProperty(name="Custom slot name",subtype='NONE',default="Custom01")

######################################################################################
######################################################################################
# # # # # # # # # # # #            ADDON PREF UI               # # # # # # # # # # # #
######################################################################################
######################################################################################
    def draw(self, context):
        layout = self.layout
        full= "................................................................................................................................................................................................................................................................................................................................................................................................"
        addon_prefs = context.preferences.addons[__name__].preferences

        bigbox = layout.box().box()
        col=layout.column()

        col.prop(self,"scatter_01_name")

        self.layout.prop(bpy.context.scene.sample_vars, 'variable1')
        self.layout.prop(bpy.context.scene.sample_vars, 'variable2')
        self.layout.prop(bpy.context.scene.sample_vars, 'variable3')

class SampleVariables(bpy.types.PropertyGroup):
    variable1 = bpy.props.IntProperty(
        name="per square emission",
        description="Sample variable 1",
        default=100
    )
    variable2 = bpy.props.IntProperty(
        name="emission",
        description="Sample variable 2",
        default=5555
    )
    variable3 = bpy.props.BoolProperty(
        name="is per square",
        description="Sample variable 3",
        default=True
    )

######################################################################################
######################################################################################
# # # # # # # # # # # #        SCATTER OPERATOR                # # # # # # # # # # # #
######################################################################################
######################################################################################
class Scatter_OT_Slots_Custom(bpy.types.Operator):
    bl_idname = "scatter.custom_slot_operator"
    bl_label = "Custom Scattering Operator"
    bl_description = ""

    def execute(self, context):
        context = bpy.context
        addon_prefs = context.preferences.addons[__name__].preferences
        scene = context.scene
        A = context.object

        bm = bmesh.new() #four area calculation lines from stack exchange
        bm.from_mesh(A.data)
        squarearea = sum(f.calc_area() for f in bm.faces)
        bm.free()

        A.select_set(state=False)
        for ob in bpy.context.selected_objects:
            particlename = addon_prefs.scatter_01_name

            pref = "SCATTER: ["+particlename+"] v."
            i = 1
            name = "%s%d" % (pref, i)
            while A.modifiers.get(name):
                i += 1
                name = "%s%d" % (pref, i)
            ### ### add particle system + rename and add selection in new coll
            m = A.modifiers.new(name, type='PARTICLE_SYSTEM')

            ps = m.particle_system
            ps.name = name
            ps.settings.name = name
            ps.settings.type = 'HAIR'

            ps.settings.render_type = 'OBJECT'
            ps.settings.instance_object = bpy.data.objects[ob.name]
            ps.settings.hair_length = 4

            print(bpy.context.scene.sample_vars.variable1)
            print(bpy.context.scene.sample_vars.variable2)
            print(bpy.context.scene.sample_vars.variable3)

            #if SampleVariables.variable3 == True:
            #    ps.settings.count = SampleVariables.variable1 * squarearea
            #else:
            #    ps.settings.count = SampleVariables.variable2

        A.select_set(state=True)

        return {'FINISHED'}

######################################################################################
######################################################################################
# # # # # # # # # # # #            N MENU                      # # # # # # # # # # # #
######################################################################################
######################################################################################

class Scatter_PT_ScatteringPanel(bpy.types.Panel):
    bl_idname = "Scatter_PT_ScatteringPanel"
    bl_label = "Scatter !"
    bl_category = "Scatter"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_context = "objectmode"

    def draw(self, context):

        addon_prefs = bpy.context.preferences.addons[__name__].preferences
        layout = self.layout

        layout.prop(bpy.context.scene.sample_vars, 'variable1')
        layout.prop(bpy.context.scene.sample_vars, 'variable2')
        layout.prop(bpy.context.scene.sample_vars, 'variable3')

        box=layout.box()
        bigbutton = box.column()
        bigbutton.scale_y=2
        bigbutton.operator(Scatter_OT_Slots_Custom.bl_idname, text="SCATTER",  icon='PLAY')

######################################################################################
######################################################################################
# # # # # # # # # # # #                 REG                    # # # # # # # # # # # #
######################################################################################
######################################################################################

def register():
    bpy.utils.register_class(ScatterPref)
    bpy.utils.register_class(Scatter_PT_ScatteringPanel)
    bpy.utils.register_class(Scatter_OT_Slots_Custom)

    bpy.utils.register_class(SampleVariables)
    bpy.types.Scene.sample_vars = bpy.props.PointerProperty(type=SampleVariables)

def unregister():
    del bpy.types.Scene.sample_vars
    bpy.utils.unregister_class(SampleVariables)

    bpy.utils.unregister_class(ScatterPref)
    bpy.utils.register_class(Scatter_PT_ScatteringPanel)
    bpy.utils.unregister_class(Scatter_OT_Slots_Custom)

if __name__ == "__main__":
    register()

do i need to use pointerPref ? How to use it ?
class ScatterPref(AddonPreferences):
    bl_idname = __name__
    addon_prefs = context.preferences.addons[__name__].preferences

    addon_prefs.sample_vars = bpy.props.PointerProperty(type=SampleVariables)

I don't really get why? I think you can either use a CollectionProperty or a PointerProperty to solve your issue, here is an example. Notice that there are a few bad references in your script: Within an operator you already have context so you can replace bpy.context.scene.sample_* with context.scene.sample_*. Also as of 2.8x we have to use annotations : for property assignments like variable1 = bpy.props.IntProperty(....

@p2or thanks, because of your example i know that i need to bpy.context.scene.sample_vars.variable1 instead of  just sample_vars.variable1 ! But i don't see how it can help with addon_prefs ? there's none in this example ? am i missing something ? i'm quite new to python and blender api.

That's the wrong way around :) In other words: You already have context (passed via operator methods like execute, draw, invoke etc.) so you don't have to write bpy.context.scene...* rather start with context.scene...*... The example provided might help on how to deal with a CollectionProperty to manage your addon preferences because this type (as the name suggests) allows to bundle/combine multiple other properties of any type per item/entry. Items of the PropertyGroup will be saved per scene/session/blend anyway, so you don't have to worry about that.


text:
How to move up or down a slot from a material/vgroup/dupliob list?
i'm wondering how to use thoses operator in a slot list within a python script.

in a Count list inside of a particle system, order is really important. i absolutely need to be able to move them freely up or down until X index. and the only way i found is with the context operator below. which can only be used when the editor is set to properties -> particles -> with the use coult tab open. And this is not handy at all.
this is the operator:
bpy.ops.particle.dupliob_move_up()
bpy.ops.particle.dupliob_move_down()

i think peoples who like to move material and vgroup slot will have the same issue.
This is the only solution i found. which is quite bad.
old_editor = bpy.context.area.ui_type

#bpy.ops.particle.dupliob_move_up()
#bpy.ops.particle.dupliob_move_down()

bpy.context.area.ui_type = 'PROPERTIES'
bpy.context.space_data.context = 'PARTICLES'

#bpy.ops.particle.dupliob_move_up()
bpy.ops.particle.dupliob_move_down()

bpy.context.area.ui_type = old_editor

and i didn't even find a way to open this list, so this code will not work if the list is closed
as for rewriting a value. there's not a lot of choice here ?

You don't have to use the operator, you can change the index for each material in the collection: C.object.material_slots[0].material = bpy.data.materials['Material.002']. To get the current index there is C.object.active_material_index and you can get the the size of the collection via len(MaterialSlots). There should be equivalent properties for the particle collection.

couldn't find it in the console ? i'm searching in the api, there's none either https://docs.blender.org/api/blender2.8/bpy.types.ParticleDupliWeight.html#bpy.types.ParticleDupliWeight

Here you go: Object.particle_systems.active_index and Object.particle_systems.active

thanks @brockmann. but what about the other operators ? like removing for examples

Wasn't part of the question... for material slots there is pop() and clear():
C.object.data.materials.pop(index=1, update_data=True) and there is probably the same for particle systems...

woohoo thanks !

Did you find something for the particles? @DB3D

i did find pop but unfortunately the arguments are not valid at all.


text:
Selecting Color-range with the shader editor?
can you do the same action as the color range selection in photoshop inside of blender ? is there anyway you can do this action below ?

if its not is it possible trough the compositor? what node is it ?
---

there is a method out there:
How can I use colours to separate texture node treatment?
it really work well for hard edges, but for soft edges its a mess

Look here: https://blender.stackexchange.com/questions/38038/how-can-i-use-colours-to-separate-texture-node-treatment/38041#38041

I kno this, it don’t work for soft edges ? Right ?

Here's a technique you can use to select multiple colors, and get soft edge selections.
I borrowed the idea of using a Vector Math Node set to Length to measure the similarity of colors from Robin Betts. It also relates to this question about replacing colors.
This is not an exact replica of the formula that's coded into Photoshop, but it achieves the same thing. In Ps the "fuzziness" has a range of values from 0 to 200, with 100 being the default. While putting together this node setup I got to wondering what "fuzziness" is actually a measurement of, and found out that it is brightness values. In my node setup the fuzziness is represented in a range of 0.0 to 1.0.
So instead of using Photoshop's eyedropper in additive mode, we place a custom "Select Color" group node for each color we want to add to the color range, and combine them with MixRGB nodes set to Add and Fac set to 1.0. We can chain as many as desired.
Note: It is also possible to subtract from the selection by setting a MixRGB node's blend mode to Subtract (instead of Add). More about the Subtract blend mode here.

This is what's happening inside of each "Select Color" Group Node:

The final Math Node set to Subtract is just inverting the selection so that the selected area is white instead of black.
When dealing with a selection mask or alpha transparency, we want a range of 0.0 to 1.0, so enable Clamp on the final Math Node to ensure the values stay within that range.
The final selection (basically a mask) can be used for anything, but in this example I have it factoring a a MixRGB node so that all the selected colors get replaced with a pale green.
Original image (credit):

Selection (mask):

Example result:

That's basically all there is to it, and this can be customized in various ways to select ranges of colors for whatever purpose.

2023/02/16 update:
Blend file added.

(Created with Blender ver. 3.4)
General notes on color mixing and selection
(Things that will be obvious to many people, but maybe not everyone.)

In my example I am using the Mix node to simply replace the selected area with a solid color fill, however by changing the blend type in the drop-down from Mix to another type you can get different effects. For example, Hue will colorize the selected area with a new hue.
To change a selection with soft edges to one with hard edges, one simple way is to run it through a Math node set to Greater Than and adjust the Threshold.
To make selection edges harder (but not necessarily completely hard), you can route the selection through an RGB Curves node and shape the curve into an S-curve or a steep linear curve. The steeper the curve, the harder the edges become.

would you mind posting the Blender file, I am having a hard time replicate your direction.

@ajthechan Done! :-)


text:
Python: create adaptives Suffix
i want to know how to create adaptive suffix, that are "content aware" of the situation,  to avoid erasing object that have the same names. i think that this is a classic use of python, could someone explain or give me a link to a explanation/ tutorial that can help me understand how this adaptive renaming system work ?
for example in this code below im automatically creating a save as copy in the directory file.
import bpy
import os

try:
    os.mkdir(os.path.dirname(bpy.data.filepath)+"\\save as copy\\")
except:
    print('directory already created')

Dir = os.path.dirname(bpy.data.filepath) + "\\save as copy\\"

bpy.ops.wm.save_as_mainfile(copy=True, filepath= Dir +"Copy.blend")

the only problem is that it erase the previous .blend everytime i do the action, id much prefer to implement an adaptive suffix, that create "copy 001" if copy already exist; "copy 002" if 001 already exist... i could do that with condition but i dont know how to reproduce the steps indefinitely.
in a precedent code someone show me a way to do this ? i dont know if its specific to the situation or not, but i didnt understand how to reproduce thoses act for my situation:
import bpy

context = bpy.context
scene = context.scene
A = context.object

i = 1
pref = "%s Mirror " % A.name

name = "%s%d" % (pref, i)
while A.modifiers.get(name):
    i += 1
    name = "%s%d" % (pref, i)

bpy.ops.object.modifier_add(type='MIRROR')
A.modifiers[len(A.modifiers)-1].name = name
bpy.ops.object.empty_add(type='CUBE')
bpy.ops.transform.resize(value=(0.01, 1, 1), constraint_axis=(True, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='ENABLED', proportional_edit_falloff='SMOOTH', proportional_size=0.00439353)
E = bpy.context.selected_objects[0]
E.name = name
A.modifiers[name].mirror_object = E
A.select_set(state=True)

i tried
import bpy

i = 1
pref = "neww"
name = "%s%d" % (pref, i)
while bpy.context.object.name.get(name):
    i += 1
    name = "%s%d" % (pref, i)

for ob in bpy.context.selected_objects:
    ob.name = name

i also tried
import bpy

i = 1
pref = "new"
name = "%s%d" % (pref, i)

while ob.name = name
    i += 1
    name = "%s%d" % (pref, i)

for ob in bpy.context.selected_objects:
    ob.name = name

dont work

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

didnt get it, already tried to understand, for what i did undestand this was a specific renaming action that occure during the modifier process in a while loop, i dont see how i can apply this in this case, and how the i+=1 could be re-used at for any batch renaming

found it
import bpy

i = 0 #default number
pref = "new" #name
name = "%s%d" % (pref, i)

for ob in bpy.context.selected_objects: #for every object in selection
    i += 1 #add i+1
    name = "%s%d" % (pref, i) #redefinie name
    ob.name = name

if i wanted to just keep the same name, i need to replace pref by
pref = "%s" % bpy.context.object.name

if i want to make the prefix into a suffix or add _ - ect i just need to change
name = "%s%d" % (pref, i)
to
name = "%s_%d" % (pref, i)

basically its simple, for each object in my selection, i add +1 to i = 1
that's it
there is also a special python function that transform the number into numbers like 001 002 003 010.. ect... ii only work with strings so you need to convert the number into a string first:
newnumberfilledwithzeros =str(10).zfill(3) #will be = to 010

with all thoses examples, here what i came with this example below,
and witouth the " "%s" method, its actually not necessary for this small exercise.
name="hello"
#if you want to keep the same name and just add the suffix ? use this line below instead
#name= bpy.context.selected_object.name
start=0 #could start at -1 if you want the first obj to be named 000
zeros=3 #3x= numbers like 001,019... 4x = 0012,0003... ...
for ob in bpy.context.selected_objects:
    start+=1
    f=str(start).zfill(zeros)
    ob.name = name + f
    #result will be "hello001" "hello002" "hello003" ect..
    #want to be "hello_001" ? just to this below
    #ob.name = name + "_" + f
    #want to do a prefix ?
    #ob.name = f + "_" + name


text:
How to fix "Launch exceeded timeout in CUDA queue copy_from_device (integrator_intersect_shadow)" Cycles Error for Nvidia GPU's
i keep having blender cycles randomly crashing (stopping during rendering initialization), i'm using blender 3.6.2 with a RTX2070 and Windows11

Here are a few tips/solutions for these issues, it is most likely linked to a nvidia driver issue:

Identify the problem with microsoft "Event Viewer" in order to have more of a precise idea with your hardware failure. Search for this program in your search bar, go in "window logs", then "system" and see if you have any kind of Error/Warnings in the "Display" category while running cycles in rendered view. Most likely, you will see some errors in there, for me i had an error with nvidia "nvlddmkm" "The description for Event ID 0 from source nvlddmkm cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer. If the event originated on another computer, the display information had to be saved with the event. The following information was included with the event:  \Device\000000b2 Error occurred on GPUID: 100 The message resource is present but the message was not found in the message table"
Ensure you have the latest driver from nvidia, you can download them via https://www.nvidia.com/Download/index.aspx?lang=en-us it is advised to use a "creator" type driver, however, please note that 99% of blender users will be using a "game" driver, so it might be a better idea to use the same driver of the masses instead.
It can help to clean uninstall your older driver first before installing a new driver, use "DDU" for a clean uninstall https://www.guru3d.com/files-details/display-driver-uninstaller-download.html (important, run in in SAFE mode).
You might have some corrupted drivers files from a previous installation failure for example, here's how you can ensure that you don't have any broken files: Search for "Command prompt", run it as administrator, then execute these lines, one by one "dism.exe /online /cleanup-image /scanhealth", "dism.exe /online /cleanup-image /restorehealth", "dism.exe /online /cleanup-image /startcomponentcleanup", "sfc /scannow", it might take some time! then restart your computer.
It might be possible that some leftover installation keys are still left in your registry, use CCleaner to clean your registry from potential drivers leftovers.
Adding "TdrDelay" in your key registry might help, this will ensure that windows is not shuting down cycles GPU processing for responding too slowly. To do so, search for "Registry Editor", go to this path: "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers", and within this GraphicsDrivers folder, right click in the right area, "New", "DWORD", name it as "TdrDelay", edit it's decimal value to be 30 for example (in seconds, the default value is 2second, which can be too quick for cycles, in some rare cases). Then do the exact same but with the name "TdrDdiDelay" instead. Restart you computer. Please note that this solution, while avoiding to automatically shut down rightful process by your OS too soon, allow errors to freeze your computer longer than expected as well.

Edit, All these didn't fix it! see T110657 https://projects.blender.org/blender/blender/issues/110657


text:
How to tweak the hue of an existing shader?
in a project i need to work with an existing shader group that output a shader data.
The entreprise pipeline does not authorized us to change the content of this nodegroup and there’s no hue adjustment slider available.
Is it possible in blender cycles to adjust the hue of a shader data (green noodle) without having any access to original the color input information? Maybe an add shader node could help me ?

If you were rendering on Eevee you could plug your shader group into a Shader to RGB node, then do any color correction you want, and plug that into the Material output or pass it through an Emission Shader.
Though, this is more of a hacky solution and isn't available on Cycles.
Perhaps you can make a copy of that node group and modify that instead?
Otherwise, maybe it's time to contact your enterprise.


text:
Random Issue with Custom Icons Not Loading in Blender Plugin
I've developed a Blender plugin and integrated custom icons from a single folder. I'm facing a perplexing issue where, at random times, some of these icons fail to load. It's not consistent; sometimes it happens and sometimes it doesn't, and it doesn't seem to be tied to any specific icons.
Here's a brief overview of my setup:

All icons are stored in the same plugin sub-directory, i've got +-90 icons in .png format.
I've ensured that the paths are correctly set.
There doesn't seem to be a correlation with any specific Blender actions or sequences.
The issue always occure at plugin register time, closing blender & restart can fix the issues.
Icons appear invisible when this happens, the icon exists in the bpy data, but it render invisible in the interface.
No errors in the console.
I'd say this bug occure 5% of the time. I rarely stumble upon it, but sometimes my users report it.
it's impossible to tell which icons are invisible from bpy.types.ImagePreview api calls

Has anyone faced a similar issue or have any insights on what might be causing this sporadic behavior? Any help in troubleshooting or resolving this would be greatly appreciated.
this is how i deal with icons in my script
def get_previews_from_directory( directory, format=".png", previews=None,):
    """install previews with bpy.utils.preview, will try to search for all image file inside given directory"""

    if (previews is None):
        previews = bpy.utils.previews.new()

    for f in os.listdir(directory):

        if (f[-len(format):]==format):

            icon_name = f[:-len(format)]
            path = os.path.abspath(os.path.join(directory, f))

            previews.load( icon_name, path, "IMAGE")

        continue

    return previews

Icons = {}

def get_icon_id(str_value):

    global Icons
    if (str_value in Icons):
        return Icons[str_value].icon_id

    return 0

def register():

    global Icons
    Icons = get_previews_from_directory(directories.addon_icons)
    Icons = get_previews_from_directory(os.path.join(directories.addon_icons,"placeholder"), previews=Icons)

    return None

def unregister():

    global Icons
    remove_previews(Icons)

    return None

Thank you!

Any chance to see the code? Or at least maybe there is some minimal code example with reproducable issue?

In this case I would rather say: let's see the icons (original files), because this sounds more like a spontaneous decoding error to me.

thank you for the suggestion, i pasted the code above :-)

As Martynas has mentioned, you will definitely get more attention if you can provide fully functional, minimalistic, and reproducible code that we can easily copy, paste, and test.

...and I still think the icons themselves are the cause (and I may be wrong, of course), but please share them additionally as a ZIP.

I'm almost sure it's a Blender Bug, until a few versions ago this was rare. Even in an Alpha version of Blender 3.6 it somehow made images unusable within Blender even on subsequent startup. I never fully understood the problem, but I found a somewhat "Hacky" solution, I don't know if it will be useful to you.
In my addon I created a "Reload" button that clears all icons from memory, which basically does what your functions below do:
def reload_icon()
    # Call this function, by an Operator
    global Icons
    remove_previews(Icons)
    Icons = get_previews_from_directory(directories.addon_icons)
    Icons = get_previews_from_directory(os.path.join(directories.addon_icons,"placeholder"), previews=Icons)

Furthermore, the 3.6 Alpha version of Blender made the icons unusable, to fix this I had to do a dirty trick by copying the icon images and deleting the old ones with this script:
def restore_images(filepath):
    # This is only if the icons persist to be transparent every time Blender is restarted.
    for file in os.listdir(filepath):
        file_path = os.path.join(filepath, file)
        temp_name = file_path + ".temp"
        shutil.copy(file_path, temp_name)
        os.remove(file)
        os.rename(temp_name, file)
    # At the end, reload the icons
    reload_icon()

I know it may sound silly, but this worked, new image files loaded correctly again. This could be a clue to the Blender problem.
It may be useful to make a detailed Bugreport at projects.blender.org


text:
How to snap edges to some other edges?
Consider the following:

I want to snap the edges of that smaller part to the edges of the bigger part:

Using the snapping tool will let me do this, but will change the shape of the whole part. I could also just move the part into position, yes, but I am hoping for a better solution. I can also use the proportional editing tool to move the whole part by moving a single vertex, however then the snapping tool does not work.
Is there perhaps a way to move the whole part when only moving one edge/vertex, and still be able to snap to other edges, or some other way to do this?
Thanks.

I figured out a way to do it (Not sure if it's the best way).
Having all of the faces of the part selected,

but making sure the snap tool is set to vertex snap mode (NOT face snap):

and pressing G and moving the part to the appropriate position, will work:

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


text:
Black Texture in UV Mode
I have a problem in UV mode.
This is what I have

This is how should be to look

One of My friend have same version of Blender 2.79b like Me and for him is work fine..
(I have Rx 480 8GB , Win 10)

Maximum draw type? (see object property in the "display" section)

Hi lemon! Maximum Draw Type: Textured

Can you edit your question adding your blend file? Please use this link to do it http://blend-exchange.giantcowfilms.com/. And... I don't think that's the point, but your texture is "berrel" not "barrel"... just a mistake in the name or other consequence?

I've downloaded your file. The material for the barrel object is 'wood' and 'ring' and they are not textured (see the material object property). Change the rendered method to 'material' to see that in the 3D view.

This worked for me:

Go to face mode, and select one face.

On the UV map side, the texture disappeared, this is fine.

Hit the A key to select all the faces

select the uv map

Texture showed after I did that

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


text:
Auto Export Viewport Render to external file
Looking for someway to link the 2.8 viewport with external programs (ie Adobe InDesign/Illustrator etc) that use linked images.
You would link a 3D viewport in blender via addon to an external file, so everytime the viewport is changed, the external file would update (not a rendered file, the viewport buffer) - if it was camera view, then only the camera view area would be exported.
That way you can get a 'live' preview of the render inside other programs without having to render each time.
If each camera could create a linked file that would be even better(?)
NOTE This is not 'auto save' render/blend file, although that would be semi-useful - the current addons require the render and also increment the file name, which isn't useful if you want to maintain the link - could edit script to remove the increments but would still be too manual. Also it requires a full render which is not what I'm after - just the 3D viewport.
ANSWER From comments - bpy.ops.render.opengl(write_still=True,view_context=True) seems to be the one to use. Any preexisting addon that does this on a timed/controlled manner would be good, but otherwise I'll have a look at creating something myself.
MORE - Quick addon here https://github.com/mgmhunt/Blender_Addon_AutoRenderViewport

Somewhat related https://blender.stackexchange.com/questions/23269/batch-generate-preview-thumbnail-image-for-old-files https://blender.stackexchange.com/questions/35849/how-to-retrieve-the-thumbnail-from-a-blend-file

Hacked together an addon that somewhat gives this functionality. Much to do but proof-of-concept is there.
https://github.com/mgmhunt/Blender_Addon_AutoRenderViewport

It is called rendering
Exporting images made from 3d scene is called rendering. You can render your 3d scenes to image files. There is no other miraculous secret way of getting images from 3d to a file.  If there was, it would still be called rendering. If you are talking about a process of generating images from a 3d scene and saving them to files that is always called rendering. So you do have rendering functionality in Blender. It is accessible from Blender's Python API as well so writing add-ons that would automatically render and save the viewport is also possible.

Yep the last bit "Blender's Python API as well so writing add-ons that would automatically render and save the viewport is also possible." is what I'm after. Do you know of anything out there that does this? Also I'm after a dump of the 3D view, not a 'render' in the sense of Render button, using render settings.

Documentation for version 2.80 Python API might not be complete, but you could see https://docs.blender.org/api/master/search.html?q=render+operators. bpy.ops.render.opengl can 'Take a snapshot of the active viewport' it says. That's the benefit of calling the process what it is - rendering - it's clear what to search for then. I don't think there are add-ons for displaying Blender's viewport in other software in real time. They would be inefficient and slow. I think it's best to script a link that is updated manually instead of constant updating automatically in case you really need it.

Yep bpy.ops.render.opengl(write_still=True,view_context=True) looks pretty much exactly what I'm after. I'm thinking triggering the write on a timed based (per 5 seconds after a viewport change for example, or even better if can detect application loses focus). Thanks for the pointer.


text:
How to do the "light up the wireframe effect"
I want to make an effect similar to the one seen in this music video:
https://www.youtube.com/watch?v=mrZC1Jcv0dw
I want an object to be completely black and then animate it's wireframe lighting up.
Maybe I can somehow achieve this by moving a cube through my object and making it light up where the cube intersects with the object.
EDIT to clarify:
The effect I want is seen in 0:28 in this video when the gray lines start lighting up with blue glow.
I created a little visualization in paint to describe it better:

So the black thing is the 3D model that I am working with.
The orange square is an invisable cube that doesn't show up in a render.
And the red lines show the lit up wireframe.
So what I want to create is an invisible cube that moves along the axes and where it intersects with the 3D model (black), the wireframe lights up. So I create an effect that looks like the wireframe is slowly lighting up.
Anyone knows how this can be done?

I think a duplicated cube with a Wireframe Modifier and an Emitter Shader could do the job.

That would just make a glowing wireframe of a cube...

Hello, emission as volume with material offset on the wireframe modifier in cycles with volumetric environment would be a start, but it would be  helpful to others if you specified precisely what element of this video you wish to replicate by adding an image or two or even a timestamp in the video.

The easiest way to go about this is 3D Masks. Generate objects on a second renderlayer, render them white on a black background, use them as masks for a glow effect.
A more direct (although not necessarily easier) approach would be light path node. Give your invisible cube a transparent shader and toy around with the transparent depth count.


text:
How to make a strings to hold a marionette?
I want to make a marionette with strings holding its elbows and hands
Any idea how I can make a rope threads for this dummy?
(I want them to be attached to his arms with notch and have no Idea how to do that...)

Like this:

But I want to make strings attached via notches not metal rings like shown here

Please can you clarify what you're trying to do here - are you looking to create a ragdoll marionette, with strings to hold up and/or attach to the joints. If so then one solution could be to use Rigid Body Constraints to 'pin' the doll to a control rig and then use Soft Body between the pins for the 'ropes'. By carefully tuning the constraints (which would control the distances between the 'pinned' points) and the soft body lengths you should be able to quite convincingly fake the effect of the strings 'holding up' the doll.

Yes I want to make a marionette with strings holding it' s elbows and hands

Please show us more examples of what you would like.


text:
Texture glitch edit/object mode?
How do I fix this?
In edit mode unwraped texture displays correctly, but in object mode it looks diffrent.

Please clarify what "weird stuff" weird stuff you refer to and how you setup your scene.

shape keys, subdivision sufrrface, hidden faces, or hidden objects?

Oh, I just had an unaplied decimate modifier..
Hope this helps If you others have similar problem


text:
Why are two collections of identical rigid bodies simulated differently?
I have 2 identical collections of rigid bodies with identical settings. They are on different collision collections yet they are acting different when dropped from identical location. I need for them to be simulated in the exact same way as the previous collection. Why is this happening?
EDIT: The effect I want to achieve is a smoke simulation from shards of a cell fractured object and later hide them and replace with identical shards that liquify:

Unfortunately the rigid bodies do not behave the same way when duplicated.
I did however found a workaround by creating 2 blend files - one for smoke sim and other for liquid sim. Tho in the future I might look into baking physics as some of you pointed out.

Maybe edit your question to provide additional details of your simulation - images really help. Also, explain why you need them to behave the same - there could be ways of copying the animation once it’s simulated rather than re-running as a separate simulation - if you need it to behave identically. How are your current simulations differing? Are there just slight differences or are they completely different? Again, images (animated gifs) would be useful to get your explanation across.

In general, rigid body simulations are not perfectly deterministic. The more complex they are, the more influence the small but unavoidable numerical imprecisions have. You might be able to duplicate simple simulations somewhat reliably, but increasing complexity will mean increasing difference in results between simulation runs.
Therefore, if you want perfectly identical behavior, you will need to bake the dynamics (quite possibly it would be best to bake to keyframes in this circumstances) before duplicating the bodies.


text:
Hollow boolean no matter what solver I use
I can't get difference Boolean to stop being hollow. Intersect boolean is solid but diference bool is hollow on both fast and exact solvers.
Here's the problem:

Here's the geometry:

Here's the bool object:

Project file:

Yep, all normals facing correctly

Do you try the "Hole Tolerant" option ?

It's manifold. I tried selecting all non-manifold but nothing got selected. Tried hitting merge by distance and 0 vertices were affected. The geometry should be manifold

The normals of the "Retopo_LOGO.001" object are flipped:

In Edit Mode, select all faces, then use the menu entry Mesh>Normals>Flip to achieve this:

Resources:

Documentation to check face orientation
Documentation to edit normals


text:
How to stop a material from casting shadows
I have an object with multiple materials and I want only one of the materials to not cast any shadow at all. I am aware how to turn off shadows on a mesh but I can't seam to find a way to turn off shadow on only one material without affecting the way it looks. Some way with light paths perhaps?

For Eevee: go in Properties Editor > Material Tab > Settings Panel > Shadow Mode, set it to None:


text:
parallel processing and Job API
Someone told me that the long data processing task can be parallel processing by JOB API of Blender. But I can't find any doc or example about JOB API. Could someone give me some suggestion about it?

Just wondering, why ask here instead of asking that "someone"?

He is so kindly. He told me more about Blender. But he is busy now, and can't be our consultant. So I want to know more about Blender. I found that the Blender have command option -b. I think that the Job API is C API. Thanks a lot.

The job API is a C API, and not exposed to Python. For parallel processing of data in Python, use the regular tools Python gives you for this, like multiprocessing or concurrent.futures.

Thanks a lot.I have read some articles about Blender UI development and proposal. I found that the UI development on Blender is huge job. Would you can tell me which files are concerned in UI?

This is not a forum. If you're interested in Blender development, visit https://wiki.blender.org/


text:
Cycles Shader to assigns a color based on how many light sources hit the surface
I would like to create a Cycles Material that assigns a color to the points of an object's surface based on how many light sources hit that point.
If, for example, there are 10 light lamps into the scene (and no ambient occlusion nor emissions from anywhere), each will contribute with a (0.1, 0.1, 0.1)RGB to the final color of the object surface if any of its rays hit it.
Do you think it is possible? Any suggestions about how to achieve this?
Thanks!
EDIT: (To be a little more specific). For an academic paper I'm writing, which will be a bit long to describe, I need to know how many lights are contributing to the color of a specific point of a surface. My idea was to paint this point with a tint obtained by adding the colors of those lights that hit it. In this way I don't know which lights are hitting a surface point (which could have been even better) but at least I know how many of them contribute to its final color.

As far as Cycles is concerned, all lights in the scene hit all objects in the scene. Some lights just contribute very little to some objects. Could you edit your question with some more info in why you need this, what you're trying to achieve? It might help people offer better suggestions to get the result you need.

You may find blender internal better at dealing with this problem. For example, you can have lamps that have constant falloff, no bounces, and cast shadows. They will contribute to the objects rendered surface color additively, as you described.

@dixiepig: I will give internal a try! Tnks

This is possible using the Toon shader which can be set to produce completely 'flat' shading that is only dependent on the incident lamps. By also setting the lamps to 'Constant' shading the effect of each lamp can effectively be clamped to a constant contribution for each visible lamp.
Start by setting your lamps to 'Constant' illumination :

Adjust the Light Falloff node to adjust the Strength of the lamp. This will result in each lamp contributing the same illumination to a surface regardless of distance.
For the mesh material, use the Toon shader with the Size and Smooth values set to 1.0 to give completely 'flat' shading. Also, set the Render properties Light Paths for 'Bounces' to zero as we don't want to take account of any bounced rays :

This can produce the following result :

Blend file included
Note that you may also want to reduce the lamp size from the default size so as to ensure sharp shadow edges.


text:
What Am I Doing Wrong? (Armature Issue, .blend included for reference)
Link to download .blend file is at bottom of post.
I am currently attempting to parent a rig that I made to a female figure that I am working on for animation practice. After selecting the figure, then the armature, and pressing control-P, I selected the option "with automatic weights" in the parenting menu, as per the tutorial I was watching on the subject. When I did this, however, an error was thrown up, explaining that a solution was not found for one or more bones. Googling this error, I saw that this is not an uncommon problem, and began checking solutions others had posted that worked for some people. None worked for me. Here are some relevant points, in case the solution jumps out at one of the more knowledgeable users here:

My mesh is currently a single object with no modifiers or materials applied.
My armature is pretty basic; since I am new to this, I am not trying to make anything too fancy yet, I want to get the basics down before trying for more advanced animations.
The figure itself, being a modified figure from Daz Studio, is fairly complex; lots of vertices to worry about.
While in the included blend file there are some doubled verts, because I accidentally uploaded an earlier iteration of the file, I have removed all doubles and tried again prior to asking; so far, no dice.

My question is two-fold: First, what am I doing wrong? And second, what steps should I take to prevent myself from getting this error in the future?
FemaleRigFail.blend Download Link: http://s000.tinyupload.com/?file_id=97767392906038212085


text:
Strange Rendering Behaviour...Branched Path Tracing
I started rendering with Branched Path Tracing after learning about the benefits. However, after waiting for hours for a render to finish, the renders always end up with some blocks looking like they completed and then some MUCH more grainy (like they didn't complete...however the process does complete 100%). See images here. Am I doing something wrong?? This seems like a clear bug.
You can distinctly see the clearer blocks vs the ones that look like they had way less passes. I still don't understand how this makes sense.

Edit: Tiles are 256 X 240. I am using an iMac 2017 with 4.2 GHz Intel Core i7, 40GB RAM and AMD Radeon Pro 580 8GB. I know AMD cards aren't the best for Blender but it works totally fine outside of Branched Path Tracing. I am also using the latest daily build and using CPU + GPU...could that be it? I haven't tried in 2.79b because CPU + GPU is just so much faster for me.

Are you using Denoising?

I am not denoising here at all, no. This is with denoising turned off.

Those look like some tiles were rendered on higher quality while others on lower, the area of clear render is a bit bigger than where arrow is pointing to, I took the liberty to encircle it on a screenshot. Did you try changing tile size a bit? Though Blender doesn't render different tiles of different quality afaik so this looks like a bug. Pobably due to GPU rendering

You're right. I'll give a few additional renders a try as you mentioned and perhaps the regular release. Just a shame, because the nightly build GPU + CPU is faster in my experience so far aside from this glitch.


text:
How to revert an area split
I accidentally used the "Split Area" option by right clicking on the border of my viewport, then tried to join them back together, but just ended up losing my original work! The new window is colorless, but the render still shows my original!
I'm using Cycles, but there are no shadows in the new window, nor any light.
It ruined my few hours of work and it's very irritating.

Click on the new border with right mouse button and select "Join Area" then move the mouse to the new area and click with the left button.

I fixed this now, but not your way. I have already joined the areas, but accidentally the other way around, thus losing my first screen. I just had to set the new viewport to the render view (upper right corner of the viewport) and it fixed my issue!


text:
How do I attach an object to an animated Fps Model?
My goal was to have a rectangular prism under an animated first person shooter arm and track its transformation without it warping.

This is the arm that I am using. As you can see there is no armatures to animate the arms, but there are vertex groups. I didn't animate this, this is exported from a game.
The red rectangular prism is what I am trying to attach under the arm.

The idea I had in mind was to put them together and parent each other with automatic weights.(I got this from this tutorial: https://youtu.be/FiaXBDsk4M0?t=193)
Things didn't go its way and this was my result.

Although it has tracked the , the rectangle warped itself.
I have been having trouble for a LONG while and it led me here trying to get some help.
I need the rectangular prism to be stiff(not warped) and follow the transformations of one of the arms. Anyone have an idea to do this?


text:
How to model a vase with a hole through it?
I'm trying to model this vase on the left in this picture,

However, I'm still a beginner in Blender, and the furthest I could go is as depicted in the screenshot below:

As you can see, the beginning was promising, but applying the subdivider made it horrible.
I started from a cube building up, and used Boolean difference to subtract the hole inside.
I'm not looking for a full solution, I just need guidelines like how should I start? a plane? a cube?
shall I start from low model and then apply a subdivider? or I should start as smooth as possible?
EDIT:
I took @Simon approach, I started with a cylinder, squashed it at the bottom, and unsquashed at the top, after the boolean with another perpendicular cylinder, things got ugly and I had to cut faces to make them Quads instead of NGON.
This is the best I could do:

EDIT2:
More progress, this time, to do the boolean, I extracted the edge from the original body, and extrude it to create the boolean operand, this is the result before Subdivider modifier. Do I have to clean the body manually? like moving vertices, merging them, cut some faces? or there is a faster way (considering I have to repeat the process on four sides (unless I have to use Mirror))?

EDIT 3
I fixed the model after the boolean, and the results are better, but still can't get it perfect:

Especially these areas:

Edit 4:
I started over again, to follow @Simon instructions, the results? Amazing.
Check it out:

Hello :). You're on the right track. Your mesh has some large N-gons, but Subdivision works best with Quads. Once you repair the topology, it will work just fine.

That's great, I like the page you shared, it is helpful. Do you suggest that I break them down manually into quads? or there is an easier way?

You are trying to chew too much. Instead of trying to make a custom thing without knowledge howto, make something following a tutorial step by step. Once you get enough experience shapes like these will be no problem.

@JaroslavJerrynoNovotny I like to chew outside my comfort zone :D, also if you noticed there is huge progress since I asked the question. I feel I'm a few hours from answering my own question, but thanks for the advice.

Ignore the hole to begin with. The main shape appears to be a squashed cylinder, so create the main outline by scaling down one axis, then loop cutting/extruding and scaling to create the overall shape. For the neck the shape is circular so un-squash this section. For the large hole, boolean a cylinder then clean up the geometry afterwards.

Start with a 16 sided cylinder. I used a 100mm rad and 350mm height. Scale it down on one axis. Add loop cuts.

From bottom ring to top I scaled by about .7, .9, 1, .9, .6, .1, .1. Rounded the neck rings. Added supporting loops for the neck and base. Inset and extruded the neck downward. Delete end N-Gons then used Grid Fill to finish.

Add a 10 sided cylinder and shape accordingly. I am trying to end up with an easy way to create quads after the boolean so am looking to position the new cylinder vertices close to the vase vertices.

Snap and merge the resulting vertices together, creating quads. Tidy up the mesh. At this step I deleted half the model and mirrored the mesh to save time. Remember to flip normals on the mirror. Add supporting loops to the inner ring.

Subdivision result. This worked out better than my first attempt as there are now no triangles in the bottom corners of the hole.

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

Did you just create the model that I've been trying to create for hours as a quick answer? You, sir, are amazing.
Thanks a lot.

Did you just put a detailed answer with steps and values that resulted in me being able to do the perfect version? I wish I can give you a reward. All I can give you is an upvote. I'm also marking this as answer.
To see my latest version, check the end of the answer.

Your mesh has some large N-gons, but Subdivision works best with Quads.
You can either repair the topology, or start from scratch with quads.
Depends on you, both ways are fine.
Two ways of making quad topology.

From that shape how do you "inflate" the rest?

Hello :). I'd add thickness and then used proportional scaling to 'inflate' it. But Simon's answer is way more elegant.

@JachymMichal as much as I liked your tip (it was really helpful) I had to go with Simon's answer as it really helped me to master this model.
Thanks a lot, I wish I can give you more than one upvote.

@NourSabouny Happy to help, good luck with your project :).


text:
Changing geometry in linked duplicates
I have a parent object with numerous child objects and made also a bunch of linked copies (via alt+D) of said parent object inside my scene.
As it turns out, I need to merge the child objects into the mesh of the parent object now and was wondering if there is a way to accomplish that without breaking the link to all the linked copies and basically propagate the same change to all of these linked copies.
The problem is, that memory usage of the scene would just explode if I loose the linked duplicates.

Let say the object A has a lot of linked duplications, and object A has a mesh called A'. Let say you have a B object with a mesh called B'. You want B' to be part of A. If you select B object, then select A, then ctrlJ, the A object is now made of the A' + B'. All the A linked copies are now made of A' + B'. It won't explode any memory as a linked duplication doesn't weigh on the file.
Now, if B was also linked duplicated and you need to delete all the now useless copies of B (considering B' is now part of A), you can select one of the B objects and press shift L Select Linked > Object Data and it will select all the Bs. Then X to delete.
Does it answer?

Hmm... First of all thank you very much for your answer! Unfortunately that is exactly NOT the behavior I've observed when doing exact that (except A in my case is the parent of B and I tried to merge all children into A). None of the linked duplicates changed in any way when I performed the merge :(. But I went the long way in the meantime, made the merge and created all new linked duplicates of the merged mesh. Thanks again for trying to help though, I appreciate this!

it is the behavior of a linked duplication, you must have duplicated with no link! Linked duplication is alt D, simple duplication is shift D


text:
Exported fbx and obj files getting hidden faces in substance painter
I keep getting these "missing faces" when I export from blender to substance painter. Is this caused because I exported the object in the wrong way or is this an option in substance painter that I've accidentally turned on?
I've checked the normals on blender and it seems to be fine so not sure
I'm not sure if this is an issue with blender or substance painter, so I'm asking here.

Did you apply scale for objects and then proceed to recalculate normals and exporting?

i found a solution : check our scale in the transform part. For me the scale was négative and it caused issues.

It is a mistakes in the normals, is there a chance the legs are scaled in the negative? If yes you should apply the scale and maybe rotation too, then recalculate the normals. If you work in blender 2.8 you can activate blackface culling in the Viewport settings. Or the face normal direction to ease it a bit.


text:
2.8 sharp color over seam color
Is it possible to change sharp edges beeing displayed over seams, like in the 2.79? Right now in 2.8 seams are on the top of the sharps.


text:
How to pack images into blend file
Is there a way to pack all my images into the blend file so I can transfer it more easily?
I'm using the version 2.8

I hope nothing bad happened to you  :/

Search for "Pack External Data"

https://blender.stackexchange.com/questions/47576/how-can-i-move-a-project-that-includes-images-as-planes

thank u all for helping me

You can use the Pack All Into .blend function. Open the project, go to File > External Data > Pack All Into .blend, and wait for the packing of your images/textures (it depends on how many textures you used in your project). Then save again the file (maybe with a different name, e.g. project_packed). So when you open the file on a different computer, you don't have to re-loading the textures.

thank u so much for helping me


text:
seamless mesh placement
Is it possible to place meshes in a seamless way on a plane, I have made some tests with the array modifier but it didn't work
Here is my setup
The part of the fish that are not in the square should be in the opposite edge of the square
Here is what I try to do (this version is eye balled so it is not seamless)

You can use 9 orthographic cameras (3 rows x 3 columns) upon your scene, then merge the 9 rendering using the compositor. I think the cam need to be ortho as if not, say, top and bottom won't have the same point of view. This way, there is no problem placing the meshes. There could be some solution around this also https://blender.stackexchange.com/questions/145175/render-animation-with-multiple-views-of-the-same-scene/145564#145564

Ive had this issue before too and solved it like this:

Have the plane 2m x 2m in size
Apply the particle system
Join the particles to the plane
making it tile

(option 1)
 Duplicate the original plane and move it 2m to the left/right/top/bottom and corners
(option2) use 2 array modifier, uncheck relative, check constant distance and set it to 2m on X and the other 2m on Y, now the middle one has all the overlapping parts.
that way the middle plane has all the overlapping parts
if you have multiple particle system, apply them all at the same time, join them together with the plane
Now you can proceed with the baking


text:
Exported transmission texture for GLTF does not display at all
I am trying to use textures for transmission for my single material model and export a GLTF file. But various GLTF viewer sites do not display the transmission at all. It recognizes that a transmission texture is plugged in, but does not display it.
Here's my Shader setup to export a transmission map.

But here's how it looks like on sandbox.babylon.js

Here's how it should look like, this is without a texture and 2 separate materials.

I would really help me out to see what I am doing wrong or to know if theres some limitation in blender gltf i/o.
Here's my blender and GLB files for download.
https://we.tl/t-N1YMz4bZrd

As a contributor to the Blender's glTF addon, I do not think this issue should have been closed as a duplicate of the (much older) thread about limitations of the FBX exporter. Blender largely supports exporting Principled BSDF materials to glTF when inputs are baked to textures, and the question asked here is a reasonable one with a straight-forward answer.

To the OP — most realtime viewers today are limited to displaying only opaque materials through a transmissive surface. Surfaces using alpha blending or transmission will appear missing, as you see here when using a single material and a transmission texture. If you find a viewer that supports the "depth peeling" technique, I would expect your original export might work. But this method is currently too expensive/complex for most viewers.

@DonMcCurdy  I have assigned the blending mode to Opaque as stated in the blender gltf documentation. Transmission works if I use a value in the Shader. It does not seem to work for me if i use a texture instead. I am basically trying to achieve the red spheres from this Sample model https://tinyurl.com/4xhkyuht . The various viewers recognizes that I have transmission plugged in but does not display them. I would highly recommend to download my files and have a look at it yourself. Thank you for replying.

By "opaque" in this case I mean the material cannot use alpha blending OR transmission. Transmissive surfaces are not visible through themselves, or through other transmissive surfaces. The entire material would be considered transmissive once the texture is connected to the transmission socket.

Yes you are right transmissive materials cannot be vsisble through themselves thats the problem I am facing. So the only solution is to use a separate material on it.

@DonMcCurdy Reopened, could you post that as an answer below?

@DuarteFarrajotaRamos thank you!  posted an answer below.

Most realtime viewers today are limited to displaying only opaque materials through a transmissive surface. By "opaque" I mean the material cannot use alpha blending OR transmission. Materials using alpha blending or transmission will appear missing when viewed through a transmissive surface, as you see here when using a shared material with a transmission texture.
Note that once a texture is connected to the transmission socket, the entire material would be considered transmissive, even if some areas of the texture do not enable transmission.
If you find a viewer that supports the "depth peeling" technique, I would expect your original export might work. But this method is currently too expensive/complex for most viewers. Ideally it is best to keep your fully-opaque materials, transmissive materials, and alpha blended materials separate.

Even though I don't doubt your answer is correct, I still think this is not the issue here. If the OP had read the linked duplicate fully he would have learned that most exporters don't support image textures that aren't directly connected to the Principled sockets, which is not the case here.

The OP is asking about the glTF Exporter in particular though. I'm not sure it supports arbitrary channel packing, but this particular setup is fine. See the documentation for Principled BSDF Clearcoat export for a similar case with a Separate RGB node. If you open the exported model in https://gltf.report/, you can see that the texture is exported and connected to the "transmissionTexture" slot.


text:
Sheen and Sheen roughness exports as black values for GLTF
Now with the upgrades to the GLTF exporter in blender 3.3, I had attempted to export sheen textures.
But the sheen & sheen roughness values only show black so no sheen is reflected on the model while viewing on https://github.khronos.org/glTF-Sample-Viewer-Release/

The sheen colour texture exports correctly.▼

Here's my Shader setup which I have tried to follow from the documentation.▼

If anybody could tell me what I'm doing wrong that would be great.
You can grab the Blender and GLB files from here. http://filedropper.com/KYePNkbG
Edit: If the filedropper link doesnt work. https://we.tl/t-Ut8sBHHWVM

Sorry if I might misunderstand something - but what you show in the screenshots on the left are the original exported textures? And they are PNG files or something like that? And they do look like this in other software like Gimp or Photoshop as well? Maybe there is something wrong with the viewer displaying them as black? Because if the image in the file is correct, I don't believe it's a problem with Blender exporting them. By the way, Chrome doesn't let me download your file because it says it's harmful to my computer.

I created those textures inside blender (using the image texture node in the shaders). Heres the zip uploaded via wetransfer https://we.tl/t-Ut8sBHHWVM

and yes they look as intended in other image editing programs.

After reporting to the github, the bug was confirmed and fixed by Julien Duroure.
https://github.com/KhronosGroup/glTF-Blender-IO/issues/1728
Workaround mentioned in the report comments.
Thank you to those who responded.

No longer a bug in Blender v3.3.1 Shader setup will work as intended.

Sheen export to glTF has changed with the Blender 3.3 upgrade.  Blender's "Principled BSDF" implementation of sheen is not compatible with glTF's PBR definition of sheen, so the export takes a few more steps involving the Velvet BSDF shader from Cycles.
For full instructions, see the updated Blender 3.3 manual on glTF sheen.

Yes, I have follwed the documentation my friend. I even posted a screenshot of my shader setup.

But I still do not get the expected results.

If it's not working as described in the manual, please file an issue on the glTF-Blender-IO project here: https://github.com/KhronosGroup/glTF-Blender-IO/issues

Ok, Thank you for your help.