text:
Can't set default value to EnumProperty when duplicating existing property
This is a follow up question to:
I'm trying to duplicate properties of an existing operator (the Alembic exporter). It works well I think, with the exception that I can't set a default value on EnumProps. I get a type error as soon as I enable the default value:
TypeError: EnumProperty(..., default=''): not found in enum members

Here's the code I have in the init.py. As soon as the default=prop.default is enabled the error is thrown. This works for String/Bool/Int/Float properties, but not Enums.
import bpy

def get_alembic_enums():
    props = []
    for prop in bpy.ops.wm.alembic_export.get_rna_type().properties:
        if prop.type == "ENUM":
            props.append(prop)

    return props

def dup_enum_prop(prop):
    '''
    Duplicate an EnumProp.
    '''
    items = [(x.identifier, x.name, "") for x in prop.enum_items.values()]

    dup_prop = bpy.props.EnumProperty(
        name=prop.name,
        description=prop.description,
        items=items,
        # If this line is enabled an error occurs.
        default=prop.default
    )

    return dup_prop

class AlembicProps(bpy.types.PropertyGroup):
    __annotations__ = {x.identifier: dup_enum_prop(x) for x in get_alembic_enums()}

bpy.utils.register_class(AlembicProps)

bpy.types.Scene.alembic_props = bpy.props.PointerProperty(type=AlembicProps)

Hello ! Just as a shot in the dark, if the source enum property is dynamic (the items are gathered through a callback) the default attribute will not be available since dynamic enum props can't have a default value. You can try prop.enum_items_static https://docs.blender.org/api/current/bpy.types.EnumProperty.html?highlight=enum_items_static#bpy.types.EnumProperty.enum_items_static

Thanks for the reply. It seems to give the same error unfortunately. Also, if i print prop.default it IS a valid value (meaning I have it in my items list), but I just can't set it for some reason.

Yup I didn't think it was the problem just wanted to give a heads up :) cheers

There is an enum with zero items and an empty '' default value in the enums. It appears Blender doesn't like it when you set an empty default. So you can test for an empty default value and skip setting it:
import bpy

def get_alembic_enums():
    props = []
    for prop in bpy.ops.wm.alembic_export.get_rna_type().properties:
        if prop.type == "ENUM":
            props.append(prop)

    return props

def dup_enum_prop(prop):
    '''
    Duplicate an EnumProp.
    '''
    items = [(x.identifier, x.name, "") for x in prop.enum_items.values()]

    # Test for empty default value
    if prop.default != '':
        dup_prop = bpy.props.EnumProperty(
            name=prop.name,
            description=prop.description,
            items=items,
            default=prop.default
        )
    else:
        dup_prop = bpy.props.EnumProperty(
            name=prop.name,
            description=prop.description,
            items=items,
        )

    return dup_prop

class AlembicProps(bpy.types.PropertyGroup):
    __annotations__ = {x.identifier: dup_enum_prop(x) for x in get_alembic_enums()}

bpy.utils.register_class(AlembicProps)

bpy.types.Scene.alembic_props = bpy.props.PointerProperty(type=AlembicProps)

It's not the most beautiful Python code, but it works ;-)

That does seem to work! Thanks


text:
How do I clean up my mesh topology?
I'm an absolute beginner who attended a small blender course as part of my study. For our evaluation, we were supposed to recreate a real-life object in blender. With the help of a step-by-step tutorial I made a DMG-01 Gameboy (very original, I know). THIS is what my final result looks like. HERE are a couple more pictures and a small lighting animation that I made as well.
After taking a closer look, the professor remarked that my mesh topology looks "absolutely horrendous" and I now have until Friday to fix at least the mesh of the case itself (minus the buttons, etc). This is what it currently looks like: LINK + PasteAll - The bad topology seems to be a result of me using a lot of boolean cutters and bevels.
I admit that I completely ignored my mesh topology while working on my model because the tutorial that I was following wasn't fixing anything either...
So I know that to eliminate N-Gons, I can easily triangulate faces and then turn those tris to quads with a few clicks. The result doesn't look promising, though:

What are the next steps here? How would you go about fixing this topology? I would be glad if someone could point me in the right direction with a few tips. I'm sure this isn't too complicated and won't take much time to fix. I just don't know where to start as I still very much an absolute beginner.
Thanks in advance!

Thanks for the help, everyone!
Today I tried a bunch of things to clean up my topology (Decimate Modifer, Shrinkwrap Modifier, manual fixing, etc) but none of the methods yielded satisfying results, at least not with my lack of experience. I talked to a friend of mine and he let me use his HardOps Addon, or more specifically, its “Dice” tool.
This is my final result after using the tool and doing some manual cleanup afterwards:

There are still some N-Gons around the beveled parts that I will probably just triangulate. I hope this will make my professor happy, that’s the most important thing! ;-)

This tutorial starts with modeling a Gameboy and will introduce you to an unusual but effective workflow for such modeling.

Meshes that are the result of multiple booleans usually require a "full rework" and therefore there is no quick fix most of the time. A good place to start, however, would be to use a Decimate Modifier set to Planar (you will need to be in wireframe mode to "preview" its results before applying it) - it won't solve everything, but it should help clean up some of those webs. This also will likely still leave some n-gons that you will have to deal with afterwards, or you may encounter shading artifacts.

Maybe you should redo it from scratch. Also you don't need such a dense topology, just give your object a SUbdivision Surface modifier, and the end you'll apply it if necessary (always keep a version with unapplied modifiers though).
First prepare a flat version of your object (here a simplified version):

Extrude up:

Dig the slots with Extrude Along Normals:

Bevel, etc:

Thanks for the thorough explanation! If I had the time, I would definitely do it from scratch. But sadly, I don't think I would be able to make it in time.

source: Stack Exchange

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

sort: votes


text:
When i try to move my object it teleports to the location it was originally placed. I am really new to blender
I have no idea how to fix this. There is a yellow line that appears when i try to move the object. Don't know if that has something to do with it.

Does your object have animation keyframes? If so, blender won't 'let' you change it's location unless you have auto-keying turned on (the button with the little circle next to the 'play' buttons in the timeline panel), or if you manually insert a keyframe after moving, rotating or scaling your object.
As for the yellow line, it's probably because you have snapping turned on (the little magnet button on top of the viewport), but I don't think that has anything to do with what's preventing you from moving the object. Can you post a screenshot?

https://twitter.com/matsxio there is a video on my twitter page of this problem. I have no idea how to add a video to this place so twitter is the best i can do! lol

@matsxio you have a keyframe set in the timeline. Either delete the object's keyframes, or if you're trying to animate turn on the auto key-framing by pressing the button with the little circle on top of the timeline.
To delete the keyframe right-click on the keyframe (that little yellow diamond shape in the timeline) and choose 'delete keyframes'.
The yellow line has nothing to do with it, it appears because you have snapping turned on (the little magnet button on top of the viewport).

THIS HELPED!!! THANK YOU

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


text:
How can I smoothen out these edges which I have extruded from 2 points ? Making the legendary donut
So I have been learning Blender and while making the legendary donut I have stumbled  upon this problem where I cannot make the edges smooth and they look all jagged. This happened while I was making the donut icing drips.

hello, it's hard to guess, maybe share your file (share the link it will give): https://pasteall.org/blend/

Try putting the solidify modifier below subdivision subsurface. But like moonboots said, it's really hard to guess from a single image. Blend file helps a lot


text:
Set active clip in Motion Tracking workspace via Python
Is it possible to set the active clip in the Motion Tracking workspace?
clip = bpy.data.movieclips.load(filepath)
#somehow set the clip as the active

By active I mean that it displays in the viewer so I don't have to select it in the dropdown.

Set active clip in all Movie Clip Editor in current workspace
import bpy

clip = ...

spaces = []
for area in bpy.context.screen.areas:
    if area.type == 'CLIP_EDITOR':
        for space in area.spaces:
            if space.type == "CLIP_EDITOR":
                if space.view == "CLIP":
                    spaces.append(space)

for space in spaces:
    space.clip = clip

Thanks for the help, appreciated!


text:
Create node and have the node follow the mouse
I'm trying to create a node in the shader editor and have the created node follow the mouse position until left click, basically replicating the shift+a method in the gui.
I assume this must be run as a modal operator somehow?
import bpy

class CreateNode(bpy.types.Operator):

    bl_idname = "tmp.create_node"
    bl_label = "Create node"
    bl_options = {"UNDO"}
    bl_description = ""

    def invoke(self, context, event):
        '''
        Get the mouse position.
        https://blender.stackexchange.com/questions/218096/translate-area-mouse-coordinates-to-the-the-node-editors-blackboard-coordinates
        '''
        region = context.region.view2d
        ui_scale = context.preferences.system.ui_scale
        x, y = region.region_to_view(event.mouse_region_x, event.mouse_region_y)
        self.x,self.y = x /ui_scale,y/ui_scale
        return self.execute(context)

    def execute(self, context):

        mat = context.material
        node_type = "ShaderNodeTexImage"

        nodes = mat.node_tree.nodes

        node = nodes.new(node_type)
        node.select = True

        # This will set the node to the mouse pos.
        # How to keep this live and have the positon follow the mouse
        # until left click?
        node.location.x = self.x
        node.location.y = self.y

        return {"FINISHED"}

Similar behavior to bpy.ops.node.add_node(use_transform=True, type="ShaderNodeTexImage")
after run the script, go to Shader Editor press F7 to test
import bpy
from bpy.utils import register_class, unregister_class

def get_current_loc(context, event, ui_scale):
    x, y = context.region.view2d.region_to_view(event.mouse_region_x, event.mouse_region_y)
    return x / ui_scale, y / ui_scale

class CreateNode(bpy.types.Operator):

    bl_idname = "tmp.create_node"
    bl_label = "Create node"
    bl_options = {"UNDO"}
    bl_description = ""

    def invoke(self, context, event):
        node_type = "ShaderNodeTexImage"

        try:
            mat = context.material
            nodes = mat.node_tree.nodes

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

            node = nodes.new(node_type)
            node.select = True
            # nodes.active = node  # uncomment to also activate
            node.location = get_current_loc(context, event, context.preferences.system.ui_scale)
            # do other thing on nodes here
        except:
            self.report({'WARNING'}, "Can't add node")
            return {'CANCELLED'}

        bpy.ops.node.translate_attach_remove_on_cancel("INVOKE_DEFAULT")

        return {"FINISHED"}

def register():
    cls = CreateNode
    register_class(cls)

    # add a keymap to test. If there is a conflict with F7, choose other
    key_map_type = "F7"

    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km_name = "Node Editor"
        km = kc.keymaps[km_name] if km_name in kc.keymaps else kc.keymaps.new(name=km_name)

        if not any(e.idname == cls.bl_idname  for e in km.keymap_items):
            kmi = km.keymap_items.new(cls.bl_idname, type=key_map_type, value='PRESS')

if __name__ == "__main__":  register()

Fantastic, thanks a lot! This seems to work exactly like I wanted. Sorry for the late reply, lots of stuff got in the way.


text:
Smoke noise creates weird pause?
So my smoke sim works fine until I add noise, then it creates this weird pause before it dissipates.
Here's the render: https://www.youtube.com/shorts/uecM8D57xzQ
and my sim settings -

any advice would be greatly appreciated.
thanks Blender Gang

Did you try setting the cache folder to something else than the default one ? It sometimes solves re-baking fluids issue.

Thanks for the suggestion - I already made a custom cache folder... but I just realised I put that folder inside of the default cache folder (not sure if that's problematic but seems like it could be an issue), so I've moved it out and will try adding noise again :)

The issue persists after changing the location of the cache folder :(

Ticking the "Slow" check box under Time in the Dissolve menu of the Smoke domain seems to have fixed the issue. No idea why.

It really is a strange behavior. Consider sharing your file with https://blend-exchange.com/


text:
How to select only edges that are fully contained in the selection rectangle (in the side view)?
If I choice the right side view, then when I use rectangular selection, I get the following result.

How to get the  only edges that are fully contained in the selection rectangle like I get in the perspective view.

you could first select in vertex mode, after selection is done, change to edge mode

In that particular case it's probably easiest to switch to vertex (1 on the keyboard) and x-ray mode (ALT-Z). Box select the vertices and then switch back to edge mode (2 on the keyboard. You'll then have the edge between the two selected vertices selected.

@Chris Great minds think alike! :^)

@JohnEason: but i am not sure whether OP is happy with it... ;)

@Chris True! Unfortunately you often have no way of knowing whether a quick comment has been of any use to the person asking the question.

Thank you, guys, but the approach of @Martynas Žiemys looks more native or something.

@JohnEason Actually, when you're in X-Ray or Wireframe mode, it is not necessary to switch to vertex mode. In these modes only fully contained edges will be selected. Something similar when you are on face select: in X-Ray or Wireframe mode only faces will be selected which center dot is in the selection.

Ok. I wasn't aware of that.

Box selection works in a smart way - (1)if you drag over only parts of some edges, it selects the ones that you only "touch", but (2)if the selection includes full edges, it selects only the ones that are fully inside the rectangle. It seems to work the exact same way in perspective and in side views. The issue is that the edge that is not visible is behind the one that is and so the first scenario happens. If you enable x-ray mode(alt+z) then the hidden edge is "visible" to the selection and if it is the only one fully in the selection it will work the way you wish:

Thank you. It works!

Aaah! ....learn something every day.. :)


text:
How to enable Backface culling in all preview modes
I am pretty new to Blender (I'm a Max guy) and I want to have backface cull on whether I'm in render preview or material preview. I have it enabled in solid preview mode but can't seem to enable it in other viewing modes. What am I doing wrong?

Blender use both side of the faces at rendering, thats why you see the back faces in the material and render preview. If you really want to hide the backfaces in the other views, you can make a shader which is transparent only from the backface with the Geometry shader node. Of course in this case the backfaceculling will be visible on the render. https://docs.blender.org/manual/en/latest/render/shader_nodes/input/geometry.html


text:
Why does my mesh get all smoothed out when I join it to another mesh?
I created a table top in Blender and then I made four legs for it. I got the smoothing right on the legs and everything looked fine. But when I join the two together, it looks like Blender just smoothed out all the faces and it looks a mess. I know I can go back and fix these problems manually but obviously I'm not doing some thing wrong. Here are the two meshes before joining them:

This is the result

Do you have any modifiers on one model and not the other? If so they will be transferred when you join the parts so it's best to apply the modifiers before joining objects unless both have identical modifiers, both with the same settings. I'm thinking of Subdivision and Bevel modifiers in particular.

No, i made sure I collapsed the modifiers several times. I have fixed my model manually but I shouldn't have to. It was like Blender just put on the max smooting when I attached the legs to the top!

What do you mean by collapsing the modifiers several times? Usually in those structures expanding and collapsing means you either reveal or hide sublevels, which would be the options of the modifiers in this case. This is not applying the modifier, applying a modifier you can only do once, then it's gone - not several times.

I meant to say "applied."

And you did this by hilighting the modifier on the panel and using Ctrl-A or clicking Apply on the dropdown beside the camera icon on each modifier so that it vanished from the modifier panel? - If it was still there even if minimised, you didn't apply it!

@bobcooksey Well, if everything was done correctly and still doesn't work, then we cannot do anymore except asking you to upload your file here and edit it into your question for further investigation: https://blend-exchange.com But one last question: is Auto Smooth enabled under Object Data Properties > Normals?


text:
2.8 Timeline frame jump hotkey
In blender 2.79b you could jump forward 10 frames. Is there an equivalent in 2.8 that anyone is aware of? Not sure how to go about setting up a similar hotkey.
From 2.79b manual...
The Time Cursor can be moved in steps by pressing Left or Right, or in steps of 10 frames by pressing Shift-Up or Shift-Down.

Also would like to know. Very hard to quickly change poses without hotkey.

You can add the missing hotkeys in the Preferences Panel.

Open Edit > Preferences, then click Keymap.
Click Add New.
Expand the panel and replace none with screen.frame_offset.
Set the Delta value (keyframes): 10 or -10
Click the default hotkey A and type your hotkey Up Arrow
Select the Modifier (Shift)

Save your preferences (if Auto Save Preferences is not selected)

Thanks to Zino.G, who answered this question on BlenderArtist:
https://blenderartists.org/t/frame-jumping-in-2-8/1156440

Works perfectly. Thanks for the screen shots!

The only way to jump 10 frames is to move in step of 10 frames is to start to drag with the right mouse button the current frame in timeline (there is current, start and end frame) and then hold Ctrl - it jumps with step 10 frames but always whole tenth like 10/20/30/40/50...
I didn't found better way and I need it too :(

Thanks! This does seem to work, but its not that convenient.

In 3.1 the increment with Ctrl is 24 frames.

Totally different access to solve this - you can change keymap to 27x in preferences section Keymap. Choosed keymap set default is Blender at the top of this section, but you can use also Blender 27x but then you will loose new shortcuts from 2.8 so it depends on your preferences.


text:
Bone does not respect "child of" constraint on a riggified armature
I have a character with a riggified armature.

I added a sword to its hand. The sword has a bone attached to it.

I added a "child of "constraint on that sword bone. The target is the character's metarig and the bone targetted is the right hand bone.

When selecting the metarig, in pose mode, if I move the hand, the sword will move accordingly. Eg with a rotation:

However, when selecting the rig, in pose mode, moving the hand won't affect the sword, whereas I would expect the sword to follow.

Any idea on what I am getting wrong?
Here is a link to my blender file in case it helps: https://drive.google.com/file/d/1V_9jYf4NxqcltW-dOrMjVm11PDAizgDI/view?usp=sharing
Thank you

Hello and welcome. Please don't post the same question more than once. If your previous question was put on hold, address the raised issues by editing it so it can be reopened rather than post a new one, otherwise see What should I do if no one answers my question?

Thanks for the explanation @DuarteFarrajotaRamos. Since this duplicate received an answer that resolves my problem, I deleted the original question.

It works fine, you need to select the correct armature (rig) and the correct bone (hand_ik.R) in the Child Of constraint:

The rig called metarig has been used to generate rig, metarig is not used anymore (but keep it nevertheless). Result:

Good to mention: the armature object named metarig is only Rigify's tool to generate the full-featured rig. Once the rig is generated, you shouldn't touch the metarig at all. It's good practice to hide it or put it in a collection and disable that collection to avoid unintentional changes. The metarig is very useful to re-generate the rig if you broke something.

Yes that's what i tried to say in my edit   ;)


text:
Best way to cut 3d text according to another surface
apologies for the potentially basic question. I'm learning blender and finding it quite difficult to know what the best conventions are when trying to cut a mesh, specifically 3d text.
I have this 3d text on top of another cube mesh. I want to cut off the excess of the text so that the edges of the text and the edges of the underlying block are completely aligned, and the final result looks like a single unified object.

Conceptually I want to extrude the edges of the cube upwards and cut out any text that falls outside of the extruded faces (but obviously I don't want to see the faces in final render), and then join the cube and the text together.
What is the best way to do this?

Welcome to BSE,
I think a Boolean Modifier may be what you want, applied either to the Text object or the Cube object, depending on the results you want.
A Boolean Modifier combines one mesh object with another in a variety of ways, depending on the settings.
Sample scene

Boolean Modifier applied to Text object, using Cube object as Target

Note: The Cube object is hidden in the above images. Only the Text object is shown
Boolean Modifier applied to Cube object, using Text object as Target

[10

(Modifier applied. View from Edit Mode):

Note: The Text object is hidden in the above images. Only the Cube object is shown
I recommend experimenting with this modifier. Try not only adding the modifier to your Cube/Text object, but also applying the modifier (hover over the modifier with your mouse and press CTRL+A). I believe you should be able to find a way to achieve the affect you are looking for.


text:
UV map shows squares instead of rectangle
I'm trying to UV export a very simple rectangle so that I can import it in Photoshop to paint my rectangle. I need to do this because my game engine requires both the naked model file and texture file.
The problem is that whenever I try to unwrap the rectangle I get the unwrapped image on the left .. which shows the faces as squares instead of rectangles. This makes painting REALLY hard since I'm painting in a square (1:1 ratio) which gets translated to a rectangle.
My question is: How do I unwrap my rectangular model in a way that the UV map shows the result in rectangles instead of squares?

Welcome to BSE,
Have you applied the scale of the object?
In object mode, please press CTRL+A and select Scale. Then retry the UV unwrap.

You are a legend. This did the trick, I've spent so many hours and the solution was that straight forward.
Thank you so much!


text:
Rotation of rigify doesn't work even with modified weights
I have made a model of a cartoon character with a pointy nose but unfortunatly when I applied automatic weights it didn’t work properly so I then changed those weights and it works for most of the body exept the head, especialy when rotating the head, the nose does a weird thing where only a part of it moves, I have tried multiple times to change it, modify weights, switch to different bone layers ect… Could anyone help me ?
here are some pictures to better understand the issue ;

I have yet to finish refining the weights on the model and I might come back with more issues I can’t solve.
If you wish to help me in any way, thank you.

@TheLabCat There isn't any weight assigned from the neck bone to the nose :( even when I double checked by making sure the neck bone wasn't affecting the nose, it still didn't work properly. link

just a guess: Have you checked the normals/face orientation?

@Blunder they are all facing the right way link

hm, well, it was worth a try. Can you share a file with the head and the rig? That would make it easier to find the problem.

@Blunder Sure, how do I send the file ?

You can use https://blend-exchange.com/ to share it or google drive, dropbox or wetransfer.com. You need to post here the link then.


text:
Glass noisy at edges and bottom of objecj
I have a cup model which I applied subsampling and solidify modifiers. I want to render the object as glass. For that I use just the glass bsdf, with an hdri and single area light (disk) for lighting. Camera focal lenght is set to 100mm, samples to 200 and light bounces increased to 24. Cycles with adaptive sampling and denoise for rendering in Blender 2.93.
The results I get are a bit noisy in the edges and the bottom of the cup. See three rendered images at 512x512. I have tried changing the glass shader adding transparent bsdf with mix shader, and tweaking clamp parameters, etc. as I found in several tutorial recommendations. In all the cases the noise at the edges can't be removed.
I guess I'm missing something but I can't really find what.

This is just because the light is bouncing around so many times, even a slight variation in direction near the start can result in a totally different path near the end, and thus a different sample color.

Slightly off topic, but I'd recommend using LuxCore renderer (free) for caustics, glass, etc. renderings. It's more accurate than cycles.

Actually, 200 samples is not very much when using glass and reflective materials. For most of the time I don't use more either, but I have the Denoise option activated for rendering. It doesn't look like you're using Denoise.

Thank you all for the suggestions. I've played a bit more with light bounces with no luck. Increasing num samples to 2000 has improved a bit the scene, but still not good enough. LuxCore gives much better results, however is quite slow.

@JordiSanchezRiera Did you use Denoise? As I said, I hardly ever use more than 200 samples for simple renders... and this is just one single glass object? Can't believe you're not getting a decent result...

Yes, I used denoise NLM and also OptiX, getting very similar results. The use of denoise does not make really a difference in my setup. The small black and white pixels, in bottom, edges and handle of cup still there after denoise.

White pixels are most likely reflections of a light source, black pixels are usually when a ray has hit the maximum number of bounces without finding a light, so the ray is reported back as "lost".  Increase glossy bounces under light paths

I encountered similar problems with other objects, some of them I could solve modifying the topology, but still it seems that the curvy faces generates a lot of noise in the glass bsdf


text:
How do I combine several composed image sequences in one video?
I've rendered 3 image sequences, each one basically is a separate view layer, composed them in the compositor and now just want to get one video file from them.
In other words I want to get a video which is the same as the viewer node shows when I go backwards and forwards using the animation timeline. And cant find the magic (convert?) button to make such video.

In the compositor, add a Composite output node and feed it with the signal you want to export, and choose Render Animation from the render menu.
This node's output refers to the parameters you set in the properties panel.
Check if Compositor in enabled in Post procesing tab.

Yeah, but render animation just sarts to rerender the animation from the begnnning, taking the usual time for it(as if it is being redndered for the first time). But I already have all the necessary image sequences and just want to combine what I already have.

I've never had ocasion to use it but isn't that what the Video Sequence editor is for?

Yes, I want the similar thing. You can import an image sequence to the Video editor and export it from it as a video(or vice versa) fast. But you cant composite in the VSE. And I need the same operation but in the compositor for different image sequences from different view layers, which(the sequences) have already been rendered  and composited in the Compositor and I want to find a way to export/convert the final result of the compositing without rerendering the whole animation one more time.

You have to delete Render Layers nodes and use Image sequence Node input instead.

Tnx for the answers. The deleteng render layers trick worked just the way I needed. I'm saved.


text:
I want blender to automatically assign different materials from the list to different objects
I have hundreds of Blender files laying around with hundreds of materials. I want to make a collage of all of them.
I can append the materials to a new file but then its allot of work to assign different materials to each object, lets say the object is a sphere.
It would be cool if Blender could automatically generate an object for each material.
Is there a way to automate this?
Since I am not experienced with coding, if coding is required, please explain how it is done.

You will need Python to automate this.  If you are likely to be automating many things, I suggest the tutorial series "Scripting for Artists" from the Blender Foundation. You can find it on the Blender Studio web site, or on YouTube.
Here is a very simple example of how to automate your request, using spheres.
import bpy

sphere_x = 0.0
sphere_y = 0.0
sphere_z = 0.0

for material in bpy.data.materials:
    bpy.ops.mesh.primitive_uv_sphere_add(location = (sphere_x, sphere_y, sphere_z))
    object = bpy.data.objects[-1]
    object.name = material.name
    object.data.materials.append(material)
    sphere_x += 3.0
    sphere_z += 3.0

Blender keeps track of all the materials in your file in bpy.data.materials. This code loops through that list.  For each material it finds, it calls a function to create a sphere at a certain location. (bpy.ops.mesh.primitive_uv_sphere_add(location = (sphere_x, sphere_y, sphere_z)))
Then it finds the object it created.  Creating the object adds it to the end of a list. The python way to find the last thing in a list is to use -1 as an index. (object = bpy.data.objects[-1])
Next it changes the name of the object to the name of the material, so you can see what materials go where in the outliner. (object.name = material.name)
Then it assigns the material to the object. (`object.data.materials.append(material))
Finally it calculates a location to put the next sphere.  This probably not the calculation you want, so you'll probably want to change it.  This simply puts the spheres on a diagonal line starting at the origin:

You'll at least need to learn enough Python to figure out how to position the spheres in 3D space.  You could also learn about mesh operators.  There's an add operator for every existing mesh type, so you could use monkeys instead of spheres.
To run this script, open the Scripting workspace, click 'new' in the text editor, paste the script into the text window and type Alt–P to run the script.

I'll give it a shot. Thanks a lot, that looks great. Much appreciated.

Man, it works beautifully! Thank you so much!

@MishaKerch you're welcome.

I have another question, if its ok. What do I need to add to the code if I want to run the script but make blender COPY specific object from a collction and apply the materials to it?

It's OK, but that's enough different that StackExchange would want you to ask another question.  You can point to this question in your new question so you don't have to repeat everything.  Think about how you want to specify the object to copy when you write your question.

I asked a new question here:   https://blender.stackexchange.com/questions/263098/assign-different-materials-automatically-to-a-specific-object

Hello, for some reason my question was closed automatically by the system. What is the best way for me to get that information and help concerning assiging materials to an object?

@MishaKerch  I'll try to get your question reopened.  If I can't, I'll just edit my answer here.

You can mark materials as asset

And get thumbnails:

Also, you will get a material library for free if you will have everything properly set up.
More automated way requires Python I guess.


text:
"Ctrl B" Bevel operation performance is slow in 2.8
When I bevel anything with less then 30K Vertices, it lags really bad in 2.8.
What use to take me 5 seconds to perform now takes me, sometimes, a minute to do.
Thoughts?

I think you need to share the file.

There was a change, but it was in later versions too (like 2.79) where an optimizing solver is used to get more even results when "Loop slide" is on. It could be that that is slowing things down a lot for bevels involving a large number of edges. Try turning Loop slide off and see if that improves things. You can also submit a bug to Blender tracker and I might try to see whether I can make things better.


text:
Blender renders plane in distorted way when enabling displacement only vs. bump displacement
I'm trying to use a plane with an image texture to render a topographic map of the US. When I add a subdivision modifier and use a Bump Only surface displacement, I have a fine looking map:

When I try to use Displacement Only, however, I get this much less fun looking thing:

Is there a reason for this, and if so, what can I do to avoid it?
Here's my set of settings for reference:

You may use a displacement node I think (hard to know as you don't show the node setting). See https://blender.stackexchange.com/questions/144897/problem-using-voronoi-texture-as-cycles-displacement-2-8/144917#144917

See also: https://blender.stackexchange.com/questions/212930/how-do-you-remove-the-line-in-the-noise-texture/213041#213041

It looks like you're connecting your height map directly to the Displacement output. That doesn't typically work well - a better option is to include a "Displacement" node in between (found under Vector > Displacement, I think) with the height map as the "Height" input. That way you can adjust the "Scale" property on the node, which is the equivalent of the "Strength" property chirpywiz711 suggested (if you were using a modifier).

You have the Strength property on the Displace modifier turned up too high. Turn it down to 0.1 (or lower).

I'm not seeing a strength property under the Displacement modifier. I've edited the main post to include the settings I'm seeing. Can you let me know where I should be looking?

@scrollex Add a "Math" node in between Color and Displacement, and adjust the value until it's correct.


text:
New Wavefront obj importer - Split by Object?
Using Blender 3.3.0, the new importer for Wavefront obj is no longer experimental, the python addon is marked legacy. There is already a proposal to completely remove the python version a couple of blender versions down.
While the new importer genereally works like a charm, there is something I'm missing that's very useful for how I use Blender at work.
The python addon has an option to split geometry by object and/or groups - into individual objects.
The new importer only allows to create vertex groups within the imported object.
With the python addon I am able to work with the files my clients provide me with (usually something like .step files), as with the split objects I can handle the individual parts of the device.
With vertex groups... I can not.
Is there a way to split an object by vertex groups? At once? Depending on object having to individually select vertex groups and separate them one by one is far too time consuming.
Also splitting the object by loose parts is also not an option, as objects/vertex groups consist of different unconnected parts.
Alternatively what would be the best way to raise awareness, so that the new importer might get the option to split into objects?
I am fully aware that I could just stop upgrading Blender as soon as the legacy addon will no longer be available. ;)

As a work-arounds:

Keep an older Blender version at hand merely for the import process can be an option. Import -> Save, continue in new Blender...
Using the old script (as long as it works, maybe under a different name).


text:
Use of Proximity Node and Set Material in Geometry Nodes
In a "Geometry Nodes" I use the "Proximity" node to set a different material if the distance between a cube and each face is less than a specific value.
It works fine, but now I would like the faces that have had their material changed to not change again when the cube distance is greater than the specific value.
Any ideas?

The cube

The nodes used.
The cube in action

Thanks for your time and help!
:)

The easy way would be to use dynamic paint. There is probably some other way to do it now with the simulation nodes that I haven't tried yet

I haven't thought about dynamic paint. I'll look it thanks Alex.

double your plane, rename it to "save", give it this GN modifier:

in your plane, make a nodegroup of your node tree, then change your node tree to this:

result:

of course you have to change the behaviour of your cube, because i don't think you want that behaviour - but this is another question ;)
Hope that helps.

I would never have thought to do it this way. Thanks Chris !

you can do it more "elegant" with the new simulation nodes - but i am not sure whether the new GN version would be ok for you...

I have the version 3.2.0. You would change to the new version 3.4.1?

it depends...as usual ;) if you are working with Blender "just for fun" and not for customers - i would recommend using the newest so you learn the new things very early ;) and you can use the newest crazy features at first! ;) i am working with 3.6.... ;)

No doubt, this night i will upgrade Blender.
Thanks ! :)


text:
Moving a point of a line with Geometry Nodes
I have a line with a start and end point.
I need to move the initial point of a variable distance but always following the direction of the line.

If there any Node that allows you to do that easily?
Thanks for your help ;)

If you know the positions of the endpoints you can create a new vector and move the point in that direction like this:

Exactly what I need, thank you :)


text:
Accurate movement with geometry nodes
I need to move a foot using Geometry Nodes.
Instead of using math functions like sine, I would like to be able to control the movement in a more accurate way.

I would like to control the y position, z position and x rotation of the foot for each frame.

The geometry nodes that show the body, the foot and the leg.
Any idea how to do it?
Thanks for your help :)

Hello ! I believe this is an occurence of coming full circle here. I don't think GN was built for this level of precision regarding animation tools, at least it's not there yet. Have you tried using the regular animation system ? Armature, rigging, keyframes ?

Thanks for your reply Gorgeous.
I wanted to use the Geometry Nodes to try to automate the task.
Now I was trying to do it using the GN 'Float Curve'...

Finally I find how to do it.
You must use a  GN 'Float curve' for each kind of movement.
One for the 'X' rotation, another for the 'Z' movement and finally one for the 'Y' movement.
And it works !

The GN with the 3 'Float curve'

I leave the file in case it can be of help to someone.


text:
The Geometry Node 'Vector rotate' doesn't keep the relative rotation of an object
When I add an object with the GN 'Object Info' and the option 'Relative' this one only just keep the location but not the rotation.

What am I doing wrong in my Geometry Nodes, the 'Vector Rotate' in the X-axis, or the the way I use the 'Object Info' 'Relative'?
How can I rotate a vector and have it take into account the rotation of the object?

Thanks for your help :)

what do you mean? if i rotate the finger on x axis...all moves...so it does take it into account. Can you pls be a bit more specific?

If you rotated the finger in z axis, the GN that uses 'Vector rotate' will ignore that rotation and continue to bend in the same way. In the first image the finger is still bent the same even though I have rotated it in the Z axis by 45 degrees

Thanks @Chris :)

Trying to rephrase the question I found how to solve the problem.

You only need to retrieve the 'Rotation' parameter from the 'Object Info' and perform an Euler rotation.
And now if I rotate my finger along the Z axis, the GN works.

This GIF has the most interesting aliasing I've seen in a long while. https://i.imgur.com/7Zn52Mw.png


text:
Natural orientation with Geometry Nodes
I'm trying to orientate the two half spheres with the line. I did a lot of test but no ones gives the result I hope.

My Geometry Nodes

Any idea?
Thanks for your help :)

here you are:

this is, what the align euler to vector nodes does!

Thanks Chris ! If I show you all things I tested I'm sure you laugh :D

if i would show you all things i tried with GN (and failed) you would laugh more... :D


text:
Distance of a face with Geometry Nodes
I have the 'Ground' object which is split into many faces to give relief.
I can calculate the distance between the wheel and the ground.

Now I would like to calculate the distance to the ground face closest to the wheel.
How can I select a specific face of the floor to calculate its distance?

My Geomtry Nodes
Thanks for your help :)

First of all, you can do it with the Sample Nearest Surface node and the setup is like this, you set the Sample Nearest Surface node to Vector. The Geometry you want to sample from is the "Ground" object, you add a Position node and plug it into the Value input to retrieve the surface positions. Then you need the Location of the "Wheel" object as Sample Position. Now this might not result in correct values, I'll explain below:

Just the way it is now is not yet working correctly and needs to be changed. The problem is you can either use Original or Relative position of the "Wheel" object, but it is off the world center. What you need to change depends on how you want to go on:

You have hidden the original wheel object and recreate it in Geometry Nodes from the Object Info node. This way you have to either move the "Ground" or the GN object "Main" to change the wheel's position over the surface. In this case you have to

reset the original wheel to the world origin by unhiding it end clearing the location with Alt+G

Now you can hide the original wheel again and either move the "Main" object or the "Ground" to change the distance (and show the value over the wheel). This way you can leave the nodetree as I showed above.

Or you want to unhide the original wheel and have the ability to move this instead. In this case

disconnect the Object Info node from the Join Geometry node (which you don't need then anymore)
switch the Object Info node from Original to Relative

Now you can move the wheel (or the "Ground") outside of Geometry Nodes and leave the "Main" object stationary to calculate the distance (and show the value always in the same place). To do it this way, change the nodetree like this:

Thanks Gordon for your extended explanation. It was really usefull to understand how to do it. :)

you can do it with the raycast node like this:

NOTE: i calculate the "measuring" point as mean point from all vertices of your wheel with the attribute statistic node. Then i raycast downwards and get the distance to the "hit point" on the floor.
You measure just the origin point. So if you are just moving your origin point of your wheel, your distance won't change.
I hope this helps.
if you really want the "closest face", you can work with the proximity node.

Thanks Chris for your solution- I don't know the Raycast node.


text:
Rotation with Geometry Nodes
I'm making a kind of crane.
I need to control the lenght of the link beetween the shoulder and the hook, and the angle of
rotation of the shoulder.
The control of the lenght of the link works fine.

Now i need to to rotate the hook the same angle that the shoulder. The issue is do it from the
same axis that the shoulder.
How can I retrieve the vector of the axis of the shoulder ?

Thanks for help :)

Instead of joining all objects together with the base in a single Join Geometry node, join the parts of the arm first.
The "trick" here is that you do not rotate the object(s) as a whole, but to rotate the vectors (positions of the vertices) around a given center. To do that there is the Vector Rotate node.
So you join the parts of the arm with a Join Geometry node. Then you take a Set Position node to manipulate the positions of the vertices.
And here comes the Vector Rotate node. Plug a Position node into the Vector input to get the vertices' positions. The Center is the pivot point around which you want to rotate, which is the position of the "head" (instead of repeating typed in values I use a Vector input to plug it in everywhere it's needed so you can easily change the arm's position completely instead of having to set all values manually). On Axis you set the vector (1, 0, 0) because you want to rotate around the X axis. The Angle input finally gets the "Rotation" value from the group input converted to radians.
I also cleaned it all up a little, too many Set Position nodes, the Transform node was no longer needed either. Also I subtracted the "Length" input from the hooks position, since I thought it would be nicer to enter the length in positive values. As a base value for subtraction I used -4.4, this puts the hook in the position where it was originally in your setup at length = 0. At the end I used a second Join Geometry node to join the arm with the base. This is my final setup:

With this setup you can move the arm via the Vector input node anywhere away from the base if you should change it afterwards no matter where the origin of the object is. You can also change the initial position of the hook with changing the first value in the Subtract node.

Thanks Gordon for your solution and explanation :)

I first have to say, this is NOT "the" mathematical intelligent solution, but just a working solution:
So i changed some pivot points (shoulder), changed the object info of shoulder to relative, changed your GN tree like this:

result:

Something went wrong with your repositioning of the shoulder's pivot point... it's off center so the connection between hook and shoulder is not straight.

Thanks Chris, perhaps it's not the most elegant solution, but is very easy to understand.


text:
Rotation with Geometry Nodes part 2
I am designing some kind of crane. It can rotate globally, rotate through the arm and expand it.
What I need now, is that the head of the crane, where the hook connects, always points in the direction of the ground.

How can I rotate the "Arm 4" object so that it always has the same angle with respect to the ground?

The object to rotate 'Arm4'

My Geometry Nodes.
Thanks for your help :)

The solution was easy. I just had to rotate the "Arm4" object in the opposite direction before moving it.

The new Geometry Node

+1 nice !!!!!!!


text:
Move/Rotate a bone with Geometry Nodes
Is there a way to rotate/move a bone using geometry nodes?
Thanks for your help!

No. I'm very sorry.

a bone is not geometry ;-)

You can't directly affect a bone with geometry nodes.  But, you can move a vertex with geometry nodes, and by using bone constraints, you can follow the motions of vertices with bones.
My basic structure for doing things to bones with vertices looks like this:

I have a mesh that represents my basis vectors, and I've marked those vectors by assigning them to vertex groups.  (One of these vectors is redundant, but it's nicer to see, to understand the concept.)  After that, I can use a few bone constraints to follow those:

Those constraints are what I'd typically use (copy transforms or child-of from vertex groups are ambiguous concepts, so I use the unambiguous damped track and locked track.)  We can see that the bone follows the geometry nodes transform given the mesh.
You didn't ask about scale, which is possible, but which is significantly more complicated.

I never thought that it can be done it this way.
Thanks Nathan!


text:
Creating a four points curve with Geometry Nodes
I need to create a bezier curve with four points using Geometry Nodes.
I found the GN 'Quadratic Bezier' but it only works with 3 points.
The curve I need is like this:

The second point is calculated from the first, and the third from the fourth.
Any idea ?
Thanks for your help :)

I have no idea what you mean with "quadratic bezier works only with 3 points", but with this node setup:

you will learn, that the numbers of points of quadratic bezier depends on resolution
you can set each point as you like via index + set position node

Hint: if you change resolution to 3 you will get 4 points as you wanted.

What a fool!
I saw the start point, mid point and end point in the 'Quadratic Bezier' GN and assumed it only worked for three points. Thanks Chris !


text:
Smooth a curve with Geometry Nodes
I defined a curve manually and now I need to smooth it.

I try things like the GN 'Deform curves on surface' but I can't do it work.
Any idea about how can I smooth it?
Thanks for your help :)

I suspect with "smooth" you mean rounded corners. To achieve that, you can plug a Fillet Curve node before the Curve to Mesh node, set it to Poly and adjust the Count and Radius to your liking:

Thanks Gordon ! It's what I was looking for :)

For completeness, I am showing another way to smooth out curves that are comprised of sections.
This method involves setting the curve type to Bezier and setting the handles' type to Auto.
Keep in mind that both this method and the fillet method will give a very different result when the sections that make out the curve are sampled.


text:
blender geometry nodes increase angle along curve
I want to to do a 3 fingers grip with Geometry Nodes.
Every finger is a curve composed of 4 vertex.
With a variable of the group input named 'Angle' I need to increase the natural angle of each couple of edges (alpha and beta).

I try the GN 'Set Curve Tilt' but I don't know how tell it the direction of the rotation.
My main Geometry Nodes

My Geometry Nodes 'GN finger'

Any idea how to do it?

you want to use a vector rotate and a set position, not a 'set curve tilt'

Finally I did it. My 3 fingers grip.

I show how I did it.

In the GN of the grip I positioned the three fingers.

In the GN 'finger' I created the three parts of each finger and I rotated them by the angle of desired of the hand. I rotated them a second time to orientated them correctly.

And finally in the GN 'Appearance' i created the cylinders of every finger and Uv spheres to linked them.

For an unknown number of points, you could use a setup like this:

Since I was recently urged to give more upvotes: Well done, this answer is very helpful! ;-)

How do I increase the resolution of the curve? When I increase the count of ResampleCurve, increases in length, but not in resolution. Thank you for this answer.

@MLmuchAmaze if you double the number of points,  you need to also half the base offset defined in the "combine xyz"


text:
Curve animation with Geometry Node
I made a mobile hand tied to the body by a chain.
When you move your hand, this chain can be made longer or shorter.

Moving the hand...

The GN I use.
Now I need to make it look like the hand chain is fixed and the chain comes out from inside the body.
Any idea how to do it?
Thanks for your help :)

Finally I did it work.

The secret is that you have to move the end of the line so that the animation is realistic.

L1-> The original line between the body and the hand
L2-> The line between the hand and the new position inside the body
marked in green-> the calculation of the new position inside the body

Detail of how it works :D

nice one!!!! +1


text:
How to modify the offset of an instance previously 'naturaly rotated' with Geometry Nodes?
I want to create a little sphere with big towers of diferent height above.
First I create the tower with a height of 11 floors.
After I create a sphere.
With Geometry Nodes I place the towers above the surface of the sphere.
Now I want to randomly modify the height of the towers.
My idea is to use the offset property to move the tower inside the sphere to hide certains floors randomly.

The sphere with the towers above.

The Nodes to place the towers.

The Nodes to change randomy the offset.
When I place this nodes als the towers change the height.
How can I do to randomly change the height of each instance?
Thanks and sorry for my english :(

Translate Instances (with Local Space enabled) after Instance on Points.

As mentioned in the comments, all you would need to do is apply the Translate Instances node after the Instance on Points node, feed it a random value, and enable the Local Space option:

This will perform a transformation on the Z axis while maintaining the current rotation of each object.
(Blender 3.2+)

Really easy ! When you know of course.
Thanks very much :)


text:
Custom profile curve with Geometry Nodes
With Geometry Nodes I am able to create a curve with specific points.

Now I would change the traditional curve profile for a custom one.

How can I define one like this?

Traditional Geometry Nodes for a curve.
Thanks for your time and help ;)

Instead using the GN 'Curve Circle' you can use 'Curve on Points' combined with 'Instance on points' to fill the curve with instances of a mesh.

One solution is to set the radius on the bezier curve before handing it to the curve-to-mesh node. Input to this radius can be a function that will provide your "dents". Here are the relevant edits to your blend.
Which gives you this,

I use a clamped sine wave for the dents, obviously not perfect, but you get the idea. Note that you need more resolution in the bezier curve.

Thank you for your reply. I never thought of solving the problem this way.
Anyway, I would have liked to be able to control the result more in order to put shapes more iregular.
Sorry for my awfull english :(


text:
Changing color with geometry nodes
I have an instance called 'Eye' with two differents materials.
I need to be able to change the color of the material 'R white' with Geometry Nodes. In the image the white color of the fundus of the eye.
How can I change the color without comparing the index of each face?

Thanks for your help :)

You can use "replace material" node for that.
Hope it helps. Have fun!
or this is also possible:

This way is very easy to use.
Thanks Chris !

you are welcome

There are quite a few ways of doing this ..  it would depend on what you want to expose to the user. Here, we put a color into a named attribute, depending on a mix-factor set in the GN interface:

.. and pick the color up in the eye-white material:

for a mix:

.. but you could set the colors in the GN interface, too, or leave the mix to the shader, store the color on a pre-existing attribute rather than creating one, set the mix to be between 2 image-textures..  all sorts.

Thanks Robin, for your solution!
:)


text:
Move a robot with geometry nodes
I am creating a robot that moves with Geometry Nodes.
It can move the body, an arm and a hand independently.
The problem is when it moves the hand and the arm at the same time. The hand comes out of the arm.

If you move the arm and not the hand all goes well

If you move the arm and the hand it seems that the hand goes out of the arm.

The geometry Nodes that moves the arm and the hand
Any idea to rotated the hand correctly?
Thanks for your help ;)

I finally found how to solve the hand problem.
First, you need to turn your hand to the desired angle.
I use the 'transform' GN without translation.
Once the hand is correctl rotated I use a second 'transform' GN with translation and the rotation to follow the arm.

With this GN, the hand stays attached to the arm in any situation
Video of the hand


text:
Odd and Even in Geometry Nodes
I want to draw a line with cylinders. The problem is that I need all the odd cylinders rotated of 90º.
I'm looking for a geometry nodes function like odd/even, but I can't find it.
Any idea how to do it?

My Geometry Nodes

you can add these 3 nodes to your node tree:

The modulo 2 node generates a list of 0 1 0 1 0 1 ... for growing integers.

Thanks Chris, is exactly what i need :)


text:
Pull an object using blender
I am trying to simulate pulling using blender. In this picture, two cubes are connected using a cable. When I move one cube in the pull direction, I want the other cube to be pulled in that direction. The cable is rigid and it should remain unstretched. I am familiar with the cloth modifier which I use for modelling the cable. But, when I use it I am able to move only one body and the cable is getting stretched.
Please help !

what does it give if you parent the other cube to the vertices that are at the tip of the rope?

When I do that, the cubes and the rope move around as a single object, it doesn't look like an actual 'pulling'

In order to get a rope-like effect with cloth simulations, it's best to use a long plane, like you see here:

(Normally you wouldn't need an edge loop in the middle, but in this case it's necessary because there'll be a vertex parent later.)
Assign a weight paint to one end of the rope and then set that weight paint to the "pin group" in your cloth settings:

If you now place a cube on that side of the plane, parent the plane to the cube, play the animation and move the cube around, you can see that it works, but there's not a cube on the other side yet.
So place a cube on the other side and select the plane while holding down shift, so that you have both of them selected. (Make sure the plane is the one that's highlighted.) Then go into edit mode. Selected the three vertices you see in the image below and then go to Vertex > Make Vertex Parent

Now if you press play and move the cube around (Note: It only works if you move the cube which you parented the plane to.), it should work and the result should look something like you see in the image below:

Hope that this was helpful. If you want the rope to be something other than a plane, that you should look up a tutorial on how to use the "Surface Deform" modifier.

Thank you so much. It is working like a charm. cheers :)


text:
Camera rendering the keyframe view
I have setup an animation with five different camera keyframes. When I try to render an image (F12), it always renders the view from the first camera keyframe. I changed the camera view for a different view (numpad 0), but it is still rendering the first keyframe view. So whatever view I have through my camera, it still renders the first view from the animation. I have only once camera. Why is this happening ? Please help.

that's normal if you keyframe the location of the camera. That what keyframes do. The "lock" the attributes you are keyframing. If you only change these attributes (like moving the camera) that won't change anything until you keyframe that new attributes (location).

Oh okay. Thanks. I created another camera for taking still pictures.


text:
Animating a series of obj objects using python
I have a series of .obj objects which I want to play in series to create an animation. The obj files are named according to the time steps. My idea was to import one file, show it, wait for
half a second, delete it and show the next file and so on to make it look like an animation. I created a python file to do this by putting these operations it in a loop, but it is not working. As soon as I use bpy.ops.object.delete() it deletes everything and I can't see the meshes. I used time.sleep(0.5) to give a bit a of time before deleting the mesh, but still I can't see any of the imported meshes.
I tried the method shown in this question:
how to correctly update a mesh while animating series of VTP files?
But it is not working. How can I do this? Please help.

You call an operator (byp.ops....). These are functions for user interaction and they work with a context object that contains additional info (which objects are selected? What mode is active (Object, Edit, Weight Paint, ...)? and so on). In your context (bpy.context probably, context can be overwritten) you have selected all objects. Now, if you call the operator delete() they all get deleted. Solution: make sure that only the object is selected that you want to delete (as you would do as a user).

Check bpy.context.selected_objects in your script to see how many and which objects are selected before you delete them. Also, have a look here about operators and how to override the context: https://docs.blender.org/api/current/bpy.ops.html#overriding-context

This could also be done in geonodes by using a collection and picking a single instance from the collection based on current frame...

@MarkusvonBroady do you have a sample code ? Please do share if you have something similar.

You can create the illusion of animation by showing/hiding objects at the right times. For example, the first object might be shown when the current frame is in [0,3), the next one when in [3,6), and so on.
Probably the easiest way to do this is with drivers.
import bpy

# Path to OBJ files, replace with your own files
obj_paths = [
    'my-file.%03d.obj' % i
    for i in range(1, 5)
]

# The frame when the OBJs should begin playing
frame_start = 1

# How many frames to show each OBJ for
frame_duration = 3

for i, path in enumerate(obj_paths):
    bpy.ops.wm.obj_import(filepath=path)

    # Frame when OBJ first appears
    f_begin = frame_start + i * frame_duration
    # Frame when OBJ disappears
    f_end = f_begin + frame_duration

    for ob in bpy.context.selected_objects:
        # Use a driver to hide it (both in viewport and render)
        # when frame is not in [f_start, f_end)
        for prop in ['hide_viewport', 'hide_render']:
            ob.driver_add(prop).driver.expression = (
                f'frame < {f_begin} or frame >= {f_end}'
            )

This worked, thank you so much :)


text:
Missing Particle System Panel from Properties Menu
New to Blender. Using 3.2.1 and following a tutorial for particles. My properties menu does not have the particle system panel.
I have selected the model, and it still does not appear. I have switched between layout and modeling windows and it doesn't show up in any.
As far as I know I've never changed any of the workspace layout so it should be on the Blender default.

You have a text object there. Text is using curves, only a mesh object can have a particle system so you have to convert your text. So either right-click on your object and from the context menu choose Convert To > Mesh or from the viewport menu choose Object > Convert > Mesh. But be aware that you cannot edit the text anymore after converting.

You can't add a particle system to a text object unless you convert it to a mesh first via the Object > Convert > Mesh menu. The Particle system icon will then appear in the properties sidebar.

Thanks- I thought i had already converted it but I must have forgotten.... oops


text:
AMD Drivers on Linux Mint 21 (RX 6900 XT)
I've been having endless problems getting Blender to detect my graphics card.
It seems to be installed correctly per inxi -G
kennedy@beast:~$ inxi -G
Graphics:
  Device-1: AMD Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] driver: amdgpu
    v: kernel
  Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: amdgpu,ati
    unloaded: fbdev,modesetting,radeon,vesa gpu: amdgpu resolution:
    1: 6144x3456~60Hz 2: 2400x3840~60Hz
  OpenGL: renderer: AMD Radeon RX 6900 XT (sienna_cichlid LLVM 13.0.1 DRM
    3.47 5.19.5-051905-generic)
    v: 4.6 Mesa 22.0.5
    ```

Running kernel 5.19.5-051905-generic


text:
Randomize Scale on Particle Properties
I am completely new to Blender and want to build a cube as a particle system. My particle is an object collection of 2 objects (cube, cone). I use Volume as Emitter, no physics and a Lifetime of 2 frames. Moreover there is a randomization of rotation and random scale. The question is how is it possible to scale x,y,z separately at every particle wich is generated in the particle system. My goal is that every particle cube has a random x,y,z scale but scale even. The picture shows how the particels in the particle system should look but I have no Idea how to scale the axis uneven randomly.

Thank you for your time.

If I remember correctly, there's no option to control axes individually in the particles system. However, a similar result might be possible with geo nodes.


text:
How do I get the scale and rotate option to fit in the middle of my object?

Alright so my character usually has the rotate/scale tool inside of them but im not sure what i did and its stuck outside now. In picture 1 is where my character got spawned in but when i try to move the green arrow it doesn't move forward with my character. In picture 2 i moved my character forward but the tool still stayed in the middle. How do I fix this? c:

You have switched the pivot point to 3D Cursor, which is the red/white circle in the center of the world. You can change it in the menu right next to "Global". The default setting is Median Point, in Object Mode with only one object selected this would mean you rotate and scale around the object's origin. With several objects selected this rotates/scales them around their mutual center.
I cannot see the origin in the screenshot, so if that's somewhere off and Median Point doesn't work for you, you should right-click on the object and choose Set Origin > Origin to Geometry.

thank you so much!!!

Set the pivot point to bounding box:

In the second screenshot you see that the object's location is almost 32 m in +Y direction and 1.5 m in +Z, I guess that's why there is no origin visible. Although displaying the bounding box might show it around the mesh, using Bounding Box Center in Object Mode will result in rotating around the origin, which is even further off than the 3D Cursor and thus not work as Lola expected.


text:
Concrete material: weird patterns appear in the final render
I'm currently working on these renders of a bathroom. There is supposed to be concrete on the walls and in the final render these weird patterns appear and I don't know how to get rid of them. The material is from Megascans, it looks exactly as I need in the thumbnails. I checked the albedo picture and there are no patterns on it, just in the final render. I tried 4k and 8k versions but the problem remains. I was also messing with a bump, but I'm not sure if that's the problem.
Could you please help me? Thank you for your reply.

Ah! Are you using these settings?
Cycles Render -> Experimental,
Adaptive Subdivision on the wall mesh,
Bump + Displacement enabled in the Material Properties of the wall material,
If not, enable them. Try that.

Thank you for your reply, I tried Adaptive subdivision and bump + displacement, and then everything in render turned black, so I disconnected displacement and it stopped doing these weird patterns, so I think I will render it without displacement. Otherwise, I'm using all the settings you mentioned.

Sounds good. Also, one more thing @Tomas: I'd recommend staying away from using displacement and using bump/normal map node-setups instead. Displacement only really looks cool when you are really close to that object. For example, let's say I am rendering a brick wall. From a distance, that brick wall would look real because I am using a normal map. However, when I get really close to it, it looks fake because it is flat. If I was doing a close-up of the wall, I'd use displacement. If I used displacement for that brick wall when I am far away, It would barely look better than a normal map! ;)

Thank you so much for your advicies. I just wanted to try displacement in hope there is gonna be some difference and it will make the material look more realistic, but as you mentioned its not important if its not closeup shot.


text:
Rename all Materials in a scene with Python
Only just started playing with Python and have managed to work out how to change all objects names after a ton of google searches.
for o in bpy.context.scene.objects:
o.name = o.name.replace("grau", "Grey")
Seems to do what I want, but I can't find a way to rename materials for all objects in the same fashion.
Any help would be appreciated, thank you in advance.

for mat in bpy.data.materials:
    mat.name = mat.name.replace("grau", "Grey")

this will change all materials in the Blendfile, not just the ones occuring in the current scene.

Thank you Frederik, better than Google ! Regards.

np, could you upvote and accept the answer, so others won't have to check whether it's already solved?

Done. thank you again.


text:
how to reverse shapekey with only 1 shapekey (VRM)
Okay so I'm currently working on a VRM rig right now, so I want to flip the mouth -180 however when I open instead of going in a similar direction, it goes to its original position, for a better explanation here's a video
https://youtu.be/--3-PEF0V9g
blend file as well to make it easier
https://drive.google.com/file/d/1bZD9rlov-LTmt89oLyuITRfAjfNUSQko/view?usp=sharing

You can try varying Range min and max values of the shape keys: default is from 0.0 to 1.0, but they can be set from - 2.0 to 2.0, and maybe reach your goal in this simple way.


text:
Character won't stop spinning
So I type in #frame into the rotation value so that my friend robot would do some sort of spin dance, however, I kinda want to change it to something different but when I do so it just keeps spinning, even thought I already deleted all the keyframe, is it because I was using Blender 3.4 using blender launcher? or is it something else
here's a video example
https://youtu.be/wnhB62usGbw

If you enter #frame into an input field then Blender creates a driver for you. The field will get a purple background and the driver controls the value. Right-click it and choose 'Delete Driver' from the context menu to get rid of it.

Thanks it worked!


text:
How to disable blue line in weight paint brush
Found this weird line with the weight paint brush, Does anybody know how to disable it?

Looks like the selected bone that you're trying to weight paint where the armature has been set to 'Stick' type under the Viewport display properties.

Sorry, I didn't mean the bone what I mean is the brush why is there a blue line every time I pull the brush?

Ah! I see. See if https://blender.stackexchange.com/questions/183494/how-do-i-turn-off-this-line-in-weight-painting helps. It's called "Stabilize Stroke".

Ah took awhile for me to figure out, Thanks!

We got there in the end! :^)


text:
No active vertices group for painting and aborting
So i was making a Vtuber rig here, when suddenly this pop up appear, and the character rig was all purple, at first i was like "Maybe it's because i join some of the separated part, i'll just unparent and parent it again" however it stayed like that no matter what, can someone help?

The error in itself means that you have no active vertex groups. Maybe show us the vertex groups you have on the model? even better if you could share the file

https://drive.google.com/file/d/1yLWjS9SkJjRnTuRKT9cO7I2GEJbH1ZQ3/view?usp=sharing okay here's the fbx file

Sorry, I should've mentioned it in the above comment, you're supposed to share it on https://blend-exchange.com/
I tried your link, but it's asking me to request access

 hey sorry i just responded now, and happy new year here's the file hope it work this time


text:
How to apply base color to the holes in the picture?

I want to apply a different base color to the holes that I have made through boolean modifier in modelling. But, I don't know how. The holes will have different color.

just give the cutter object the same object color as your base object before using boolean modifier

or you can also go into Edit Mode and hover over each hole and press L to select it and assign a new material to it.


text:
UV Grid not appearing

Can anyone tell me why is the UV Grid not appearing on the model. I have applied it in the base color as well.

Hello and welcome, looks like you are in solid mode, switch to shader or render preview, you could use the shortcut (Z)

Not happening. It is projecting some weird design on the model. Not showing Checkered UV Grids

Show us the screenshot of that "weird design"

https://drive.google.com/file/d/16sdBqjwYiCqZfCNUcIgXsiGBaJaELbFs/view?usp=sharing

It looks like this "weird design" is simply your texture, but your UV unwrap is so small it reads only a small part of it.

Your screenshot says your using Generated texture coordinates on the model. To make use of the unwrapped UVs, this has to be set to UV.

How can I do that? Can you please tell me steps?

@IshanBansal On the menu that is on the right (on you image), there is a dropdown menu with the word "GENERATED"

I couldn't find it. Please elaborate more.

@IshanBansal https://imgur.com/a/XKYyLdn

Got it! What is the next step?


text:
In complete UV GRID

Why is the UV GRID Not appearing on half of the model?

Did you select All in the viewport before unwrapping your object? It looks as if the teapot lid may not have been selected when you unwrapped the object.  From the two questions you've asked so far I'd suggest watching a comprehensive video on using the UV editor before you go any further. There are lots of them online.

How shall we know that from this screenshot? The upper parts lid and handle look like they have a default white material. Have you assigned the grid material to those parts? You're not even showing the material slots in your image.

I got the error. Irrespective of that, please suggest any good source to understand UV Editing

There's a comprehensive tutorial by Darrin Lile here which might help.

1 your model must be whole unwraped
select all in edit mode and press U to unwrap
(remember to create proper seems on object)
2 assign all vertex to material with uv grid
create material with uv grid in material tab
select all in edit mode and assign to material
here is video with some workflow
https://www.youtube.com/watch?v=m4mas3bNO3s
topic you can research in web that conect with un unwraping :
live unvrap, pining, packing islands, streaching uv.


text:
Can I project a Grease Pencil animation onto a moving Mesh?
I have this cloth simulation here and want to animate a 2D ghost face on top of it using Grease Pencil.

I've tried simply drawing on top of the surface but I'd have to redraw the face for every single frame and if I want to tweak the simulation later I'd have to redo everything. Idealy I'd like to animate the face on 2s, 3s and have hold frames as well.
Any help is greatly appreciated, thank you!

I would have unwrapped the mesh before simulation and painted the eyes on a texture...

But then they can't be animated right? I now pinned the Grease Pencil object to the sphere underneath the cloth and set the drawing surface distance to 0.5. That works surprisingly well but isn't the cleanest solution.

Well, you need an animated texture in this case.

Currently Blender 3.3 doesn't have any tools to keep your drawing to the moving mesh.
Grease pencil drawings have an issue with weight painting which leads to problems with moving objects. If you really wanted, you could rig the grease pencil drawing with empties or armatures and manually weight paint the drawing. Then you could parent the rig to the moving object. This will be more complicated than your current solution but it's probably the closest way CURRENTLY to get what you're asking for.

That's the information I was looking for. Thank you!


text:
How can I randomize the position of my instances here?
I'm using geometry nodes to animate soda cans getting pressed into a cube.
The main issue is the animation path. The instances clearly follow a cube like shape and I was hoping to randomize it a somehow.
Currently it looks like this: https://youtu.be/Ki55nzpjFpA
And this is my node setup:
I'm also open to completely different methods, I'm still very new to blender and don't really know how best to approach a subject.
Thanks!

I used a Set Position node after the Instance on Points and plugged a Random Value node into the offset of Set Position. Then I just animate the max value of the Random Value node.

you can use the distribute point on faces to randomize the positions of your cans in your grid

Is there a way to animate these into a cube shape? I experimented a bit but can't find a way to unrandomize them.


text:
Any way to prevent "Backface Culling" checkbox from being enabled every time I startup Blender? (version 3.2)
To preface, I am still new to Blender, and not knowledgeable with scripting; so, if you offer a script to use, please tell me which method to use to run it (saving as a .py file, or running it as a script within Blender, etc).
I use Blender only to create mods for American Truck Simulator/Euro Truck Simulator 2, and I hate having to select each material individually and uncheck the "Backface Culling" box every time I start up Blender or open a project file. I prefer to not see through solid objects in my workflow (unless it's a transparent object like glass).
I've searched on how to do this and found nothing relatable or pertinent. There was one post where someone offered a script to run, which I've tried, but that did nothing.
I was running version 2.8 last month and found that it would remember keeping "Backface Culling" disabled every time I created a new mesh, start up Blender, or even load a file, unless there was an option I selected but can't remember now.
Surely, there must be an option buried somewhere (or vaguely listed) to allow this.

Are you speaking about material setting or solid viewport setting? Both disabled by default. You have posted a lot of text, but I still not sure. Maybe some screenshots would be helpful.

Looks like you import files and the importer sets this by default. That format it is?

@Crantisz Solid Viewport Shading will show all objects as solid regardless of culling. I did mention in my second part that it was the material. I don't know what you mean by "disabled by default" as it is not. And, I don't import, I can create a brand new mesh and the Backface Culling option will still be automatically checked. I didn't have that issue with v2.8.
https://imgur.com/HzG48rU

Change show_transparent_back to use_backface_culling:
import bpy

for eachMat in bpy.data.materials:

    eachMat.use_backface_culling = False

You can also use operator template
bl_info = {
    "name": "Set Backface culling",
    "author": "Your Name Here",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "F3",
    "description": "Set Backface culling to false in all materials",
    "warning": "",
    "doc_url": "",
    "category": "Object",
}

import bpy

def main(context):
    for eachMat in bpy.data.materials:
        eachMat.use_backface_culling = False

class SimpleOperator(bpy.types.Operator):
    """Set Backface culling to false in all materials"""
    bl_idname = "object.set_backface"
    bl_label = "Set Backface culling to false in all materials"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        main(context)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Then install this file as an addon add it to quick favorites using F3:

And you will have it in one click in Q menu:

That first code, where am I supposed to put that? Do I make that as a .py file in the Addons folder? Or, do I run it in the Scripting tab of Blender?

I tried that second code, but it doesn't show up in the search field when hitting F3. Also, it doesn't show up in my Add-ons search. It said it was successfully installed but I cannot find it anywhere.

Okay, I didn't realize that there was extra code at the beginning of the second script you provided. Scrolling with the mouse wheel made it disappear. However, while that did show up in the Add-ons selection, and I was able to enable it, it does not show up in the search when hitting F3.


text:
Dynamic paint waves only on one face
I want the dynamics paint waves on one side only, for example if I do the dynamic paint wave on a cube, there are waves on the 6 faces, I just want to have waves on the top face. Is it possible?

Does this answers your question? https://blender.stackexchange.com/a/304289/53447

I'm very sorry for the late answer, yes it answers my question. I will delete this question later. Thank you.

No need to delete, people who will find this topic on google will get redirected to the right place.

Ok, I'll leave my question here.


text:
Weight being added instead of reduced when painting
I've been trying to fix this issue for a while and i'm not sure if its a bug or if there's a way around it, a wrong part of an object was weight painted so i tried to erase/reduce the weight but it kept on adding more weight even if the brush weight was at 0.000

do you have the Auto Normalize option enabled?

yes i do have auto normalize enabled

so does it fix your problem if you disable it? Not sure why it is set this way though

nope i tried,it's still the same as it was before

maybe share this part of your object? https://blend-exchange.com/

i just re-made this part all over again and it works now, not sure what the problem was before but thanks for the help

oh ok then........   ;)


text:
My sculpting brush is pulling not adding
im fiddling around with sculpting and wanted to make a monster but when i try to add mesh with any brush it just pulls not adds
i dont want it to do this any help would be greatly appreciated

Maybe flipped normals? This can happen if you apply a negative scale. Then the mesh is inside out and you need to flip the normals.

how might i do this?

Enable the Face Orientation overlay. If there is anything red is turned inside out. To fix it go to Edit mode, select everything (key A) and try Recalculate Outside (Alt+N). Alternatively, you can try the voxel remesher in Sculpt mode. But this can remove your sculpted details. It's Shift+R for the grid to see the voxel size, and Ctrl+R to remesh. See https://blender.stackexchange.com/a/252944/107598


text:
Video Editing: Masking Problem
I'm a complete beginner with Blender and would greatly appreciate any help with the problem described below. Thanks in advance.
I would like to create a video sequence in which text scrolls vertically over part of a background image. The background image contains a box. I want the text to appear only within the bounds of this box.
Over the top of the background image, I add a text box in a new channel and use keyframes to animate it. When I scrub through the video, the text animates but, of course, it scrolls over the whole image.
In a new channel, above the text channel, I create a copy of the background image to use as a mask. To this I add an adjustment layer mask. The mask is positioned over the box in the image and then inverted, so that the box is the only part of the mask that is transparent.
Now, when I scrub through the video, the text only appears when it's within the bounds of the box (great) but nothing but the box area is rendered (not great). Everything surrounding the box displays the chequerboard pattern.
I can't figure out what I'm doing wrong. As I said above, any help would be much appreciated. Thanks again.

Hello and welcome to https://blender.stackexchange.com/! Usually it helps to understand a question better and avoid misunderstandings by adding pictures that outline your problem. In some cases it can also be helpful if you additionally share your blend file on https://blend-exchange.com. This way you help others to answer your question faster. Thank you!

so you want this? [1]: https://i.sstatic.net/3G4jx.gif

Thank you, yes. Actually, I've figured out a solution. I edited my overlay image, so it had proper transparency in the required region and used it as a mask channel. If (when) I post a question in future, I'll add pics and blend files. Thanks again.


text:
Turning on/off .psd layers inside Blender
Is it possible to turn on or off the visibility of specific layers on a .psd file from within Blender? Or better yet: pick Layer Comps within Blender.
I'm asking so that I might use a single .psd file containing everything from albedo, gloss, bump, normals, etc. (If I remember correctly, I could do this in Maya, though I never could get it to work perfectly.)
Thanks


text:
Snapping/Shrinkwrap not working properly
I'm having quite the problem with the snapping tool, and before you ask, shrinkwrap modifier doesn't seem to change anything. I am trying to create the eyebrows for my character, so I want it to snap to the body mesh, and, well, it does snap to it, but inside the model. The normals of both the eyebrow and the rest of the model point outwards, so that's not the issue. Also, changing the orientation of the origin point doesn't seem to work either. I'm running out of ideas on to how to fix it. Any ideas? Here's a picture of the eyebrow outside and inside the model.

It's obvious that, if vertices are perfectly snapped on a surface, the face they create will lie below a curved surface, and that's what's happening.
Even if the faces were perfectly lined up there would be a problem, called "Z fighting", where the renderer can't decide which material (face or eyeborws) to show, resulting in artifacts.
The best solution is to add a solidify modifier, so that some thickness resolve the problem and makes the eyebrows look better.
If you really want to stay flat, simply move by hand the eyebrows after projected on the curved surface.


text:
Strange deformation when apply "Realize instance" Node
When I realize my instances, they don't look deformed.
Here are my instances without realization.

Here are my instances when realized

And here is my node setup (here with Realize Instance node unplugged but at the position I plug it after)

What could be the reason for it?

Z coordinate here is too big, which cause floating point precision error
Then you realize instances faces converted from instance space to object space, which means add -828276... number to Z coordinate of each point inside instance.
But floats may handle a limited number of digits. For example, if it was
1.0012 adding -828276000 will cut off .0012, because it is too many digits to handle for float:

As result all numbers like 1.0012, 0.9992 1.0034 will clue together at -828276000 position

To fix this, your objects have to be closer to center.

Amazing ! Thank you a lot for your answer and the "under the hood" explanation


text:
Trying to export multiple textures/materials to .gltf file, but only exporting one texture
I am trying to export multiple textures applied to an object in blender.
I have the following:
However, when trying to export the gltf file, only one of the materials gets exported.
I am trying to export with the following settings:

Thanks for your help in advance!

Is the second material actually applied to the mesh? What happens when you import the glTF back into Blender?

@scurest how would I apply the material to the mesh?
The only way I am able to actually change the one applied is by changing the image "attached" to the "texture75" in this case.
When importing the gltf I only had the "texture75" (which was first created)

https://blender.stackexchange.com/a/517/88681

@scurest doesn't that allow applying only one texture at the same time?
I tried this and the only one that gets exported is the last one I assigned.
Edit:
I think there might be the possibility you misunderstood my question or i badly explained myself.
I want to be able to use both textures on the mesh, however only want one applied at a time.

Only materials that are actually used on the mesh are going to be exported, "unused material slots" is not a thing that exists in glTF. Perhaps you'd be interested in material variants though: https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html#gltf-variants


text:
Refactoring animation nodes into python script
There's this video that I have been referencing where I am trying to recreate the the idea into a python script. I feel like I am on the right path but there is definitely something I am missing. Instead of one cohesive curve, my curve data seems to be creating multiple splines, but it seems like it's suppose to be just one based on the video. Any idea what I am doing wrong?
Current Code
import requests, json, bpy

data = requests.get("https://www.econdb.com/api/series/PPIUS/?format=json").json()

values = data['data']['values']

dates = data['data']['dates']

pairs = [[value, date] for value, date in zip(values, dates)]

bpy.data.curves.new(name='curve_data',type='CURVE')
curve = bpy.data.curves['curve_data']
curve.dimensions = "3D"
curve.resolution_u = 2

bezzy = curve.splines.new("BEZIER")
bezzy.bezier_points.add(len(pairs))

for index, pair in enumerate(pairs):
    value, date = pair
    bezzy.bezier_points[index].co = (index, 0, value)

new_curve = bpy.data.objects.new("my_curve", curve)

collection = bpy.context.collection
collection.objects.link(new_curve)
bpy.context.view_layer.objects.active = new_curve
#new_curve.select = True

print(bezzy.points, new_curve)

current viewport output

What you see in this image is not multiple splines, but the bezier curve's handles which are all at (0,0,0) coordinates.
As handles coordinates maybe hard to define here, I suggest to create a poly spline instead. You can convert it to bezier once defined.
Also note that
bpy.data.curves.new(name='curve_data',type='CURVE')
curve = bpy.data.curves['curve_data']

will create a new curve each time, but the second line will always get the first one named 'curve_data'. I've added few lines below to avoid this issue.
The script can be the following.
import requests, json, bpy

data = requests.get("https://www.econdb.com/api/series/PPIUS/?format=json").json()

values = data['data']['values']
dates = data['data']['dates']

# if you don't do this, you'll create new data structure each time the script runs
name="line"
index = bpy.data.objects.find(name)
if index != -1:
    bpy.data.objects.remove(bpy.data.objects[index])
index = bpy.data.curves.find(name)
if index != -1:
    bpy.data.curves.remove(bpy.data.curves[index])

curve = bpy.data.curves.new(name=name,type='CURVE')
curve.dimensions = "3D"
curve.resolution_u = 2

# use poly to avoid bezier handles problem
spline = curve.splines.new("POLY")
spline.points.add(len(values)-1) #if not -1, an extra point is added

for index, (value, date, point) in enumerate(zip(values, dates, spline.points)):
    point.co = (index, 0, value, 1) # 1 is the weight

# eventually transform it to bezier if you want
#spline.type = "BEZIER"

new_curve = bpy.data.objects.new(name, curve)

collection = bpy.context.collection
collection.objects.link(new_curve)
bpy.context.view_layer.objects.active = new_curve

This is great man!! Thank you. It makes sense why I had so many issues dealing with bezier initially. Quick question, if I wanted to reference the dates as text, would I also create a new text for each tuple with the text_add method?

@joA, for performance reasons, prefer adding the texts using bpy.data.curves.new(type="FONT", ...), because bpy.ops involves a whole scene update each time it is used.

that works perfectly, thanks!


text:
Creating an animation that transforms location along local z axis
I have a bunch of buttons set up at different locations and I'd like to animate them all using a single action map, but to do this I need to animate them all to move slightly down and up along their local z-axis, is there a way I can do this in blender?

Hello, have you tried a Transformation constraint?

or joining them?


text:
Distribute objects with different sizes on face without overlapping - Geometry Nodes
I want to distribute some objects on a face, I'm using the "Distribute Points on Faces" node with "Poisson Disk" which allows me to change the distance minimum to avoid overlapping.
But the problem is that the objects have different sizes, and setting the minimum distance according to the biggest object is not the perfect solution for me.
Is there any way to make the "distance min" change according to each object size?

Short answer: currently, unfortunately, no. Distribute Points on Faces does not know which objects you instantiate afterwards, and therefore cannot take into account the size of these objects.

@quellenform thank you for answering.


text:
Convert UVmap attribute to UVmaps using geometry nodes
What I want is to make a mesh ready to be exported with its UVs after applying the geometry nodes modifier, it can be done manually (converting UVmap attribute to UVmaps), but is there any way to do it automatically using the geometry nodes.

if you look next to the menu your attribute is in there are + and - buttons; below that there is a down arrow v, if you click that dropdown there is an option to convert it to a uv map.

Not the OP but it worked for me, thanks!!


text:
How to run a python script when geometry nodes group input changed
Is there any way to run a python script the moment that the user changes a value of a specific input in geometry nodes group? for example a Boolean input.

You can create a custom handler that fires everytime the scene changes and using if statement check whether the change happend in the specific node you want. You'll probably have to keep track of the value of this node so that you can compare it with a new one and decide whether the change really happened or was just prompted and then canceled (the handler will fire in both cases)

I've never used it but this might help: If you have Python Tooltips checked under Edit > Preferences > Interface > Display and hover over the required input field on the Geometry Node modifier panel it will show you the python code for that option. Note that the ["Input x"] at the end of the bpy string doesn't seem to bear any relationship to the order of the inputs in the list!


text:
Make changes on the selected curve spline (Edit mode) using geometry nodes
I have this curve that contain many splines. What I want to do is:
Select the curve -> Edit mode -> select one or more splines --> delete it using geometry nodes.
Do geometry nodes can detect the currently selected spline?

Selection in gn is available when defining a "tool" gn tree. But these tools are available for meshes, not curves.


text:
How to add Vertex Group for each group of linked vertices using python
I have mesh that may contain many groups of linked vertices, and I want to create for every one of them a Vertex Group using python.


text:
Make distributed points on faces' rotation follow a curve orientation - Blender GeoNode
I have troubles making distributed instances rotation follow curve orientation.
This is what I got: (red arrow is showing the unwanted orientation)

This is what I want (red arrow is showing the wanted orientation):

This is my geometry:

In order to align objects along a mesh that you have previously created with Curve to Mesh, you would need two parameters:

The tangents of the curve points (or the course of the curve).
The normals of the curve points

In your case, you would have to capture these before converting the curves into a mesh.
Then you can use these two parameters in combination with the node Align Euler to Vector to create a rotation that aligns the axes of the instantiated objects to the curve:

(Blender 3.2)

Thank you so much this is exactly what I need

@Sicarius1 You are welcome!


text:
Weird reflections on normals
I'm new in blender and have recently started making a car model. Everything seems to be fine, but when I turn on the Material Preview, blurry and stretched reflections appear in some places. I suppose it may be related to autosmoothing, but I would like to find out from knowledgeable people how to solve the problem.

Thats my material

Select your model in Object mode and Ctrl - A > Apply Scale. Then go into Edit mode, select All and Shift - N to recalculate the Normals. If that doesn't fix it, please share the Blend file: https://blend-exchange.com/

@JohnEason Thanks for answer, but it didnt work. My blender file -> https://blend-exchange.com/b/aa0N8Jq9

I think you're just seeing reflections from the built-in HDRI in Eevee which is what is used in Material Preview mode. See what it's like in rendered view when you've set up the lighting.

@JohnEason I am actually making model for Unreal Engine, not for Eevee rendering. But anyway, it looks like I found a solution. After subdivision surface and UV-unwrapping(not Smart UV project), reflection looks little bit weird in Blender and Unreal, but generally it seems fine now. So, I guess my problem was the low-poly mesh and/or wrong uv-unwrapping. Anyway, thanks for help! I will comment if something goes wrong.

You need to transfer the normals from high poly mesh (good topology) to your low poly mesh, make a vertex group ,with the vertices that need the fixes, then search in modifiers, propieties, data transfer. select the high poly mesh, and then face corner data, custom normals, and then select project, this should solve the issue.
you can find some tutorials looking for data transfer.