text:
Blender is not using CUDA, aulthough it is configured to do so
I'm using Pop!_OS 17.10 (based on Ubuntu 17.10) on a Dell XPS 15 9560 and Blender 2.79b. CUDA is installed, the Nvidia GPU (GeForce GTX 1050) activated and Blender is recognising both:

But when I hit render, it's rendering on the CPU:

This is my second Pop!_OS installation because I messed up the previous one. But before, Blender was rendering on the GPU as expected. Am I missing something here? How can I make this work again?


text:
Water drops on a moving spider web
I'm trying to create a spider web that is dynamically moving using wind and vortex force fields. Water drops, in slightly random sizes, should be sliding down the threads at a random but constant speed. I've tried a few different scenarios but all without success. Here's what I tried already.
I created a cylinder, made it very thin and long and added a cloth modifier with pins at the top and bottom. Then I added a path and gave it a shrinkwrap modifier to follow the cylinder. Next I added a particle system and added a curve guide force field on the path so the particles would follow the curve. Lastly I added the vortex and wind force fields. Unfortunately this setup doesn't work. The particles keep following the initial shape of the path rather than the dynamically calculated shrinkwrapped curve.
The thread has the perfect movement so I'm nearly there. Now what I need is to be able to get the drops stick to the thread (e.g. cylinder) while sliding down at random speeds.
I could solve this with shape keys on detached meshes in the cylinder object, but I would rather like to have the drops generated by a particle system. Eventually I will need to have about 50 threads, every one with it's own random set of drops, so manually generating all of them would be a massive job :)

I found this video helpful for understanding curve guides: https://www.youtube.com/watch?v=dPdHEVdanJY   Maybe you'll find a clue in there.

Thanks for the link. It's a comprehensive explanation of the curve guide but  it doesn't contain the info I need. In my scenario I think the influence of the shrinkwrap modifier on the path is only visual and doesn't actually change the geometry of the curve. Ss While I can see the path change, the curve force field only uses the original geometry to guide the particles.

source: Stack Exchange

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

sort: votes


text:
Visual viewport controls
I've been using Blender since 2007 and before I've used (in that order) MiniCAD, Strata Studio Pro, Alias Wavefront and Cinema 4D. I love blender and I could never go back to my previous love Cinema 4D because I think Blender is simply better once you get the hang of it.
Now I am starting a 3D project with other people and most of them are using Cinema 4D. We decided to use Blender and I am introducing them to the workflow. A general issue with the interface is viewport navigation. Most of them are used to point and click so I am thinking about writing a plugin for Blender.
Basically what I want to achieve is this:

I have a lot of experience with Ruby and JavaScript programming and I will be able to get into Python really quickly. I only need a few pointers to get me started. So here are a few questions:

how can I add such a hanging tab to the 3d viewport
how can I activate pan/zoom/rotate of the viewport when the mouse button is pressed
is there an existing addon to build on?

There is a fly mode available using Shift+F shortcut, not the best solution, but if you have some spare money I would suggest to get Space Navigator 3D mouse from 3DConnexion.

That's not what I am after really. As you should have read, I need a point/click/drag solution.

I know you are asking for a specific solution, but if you are looking to streamline the process consider a pie-menu specifically for those functions. pros 1) Less travel time for the mouse,  2) you don't have to move the mouse into the 20*20px box at the top of the window to start a behaviour.

There are viewport navigation add-ons here's a list of useful threads: how-can-i-navigate-the-viewport-using-python,  how-can-i-control-the-viewport-without-a-mouse

Download this addon
Blender > File > User Preferences (Ctrl+Alt+U) >

Add-ons Tab > Install from file... > Choose the downloaded file > Save user setting
Input Tab

Save user settings > Close User Preferences

Now in the viewport you can use

touchpad > drag = rotate
touchpad > Alt+drag = moving
touchpad > Ctrl+Alt+drag = zoom

In the Node Editor you can use

touchpad > Alt+drag = moving
touchpad > Ctrl+Alt+drag = zoom

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


text:
Open a .blend file and start rendering
I am looking for a way to start rendering a .blend file the moment it is opened.
Doing this with a python script that is executed on load is not an option.
That setup will render the image before the interface is fully shown.
So basically you're looking at a grey screen until the image is fully rendered in the background.
What I want is that when the file is openend, it starts rendering and you can see the rendering process.
Ideally, Blender should quit when the render is completed.

If you aren't going to interact with the interface, why not use the command line?

@NᴏᴠɪᴄᴇIɴDɪsɢᴜɪsᴇ Not a dup, but it is related.

@iKlsR Well, I want to visually show the rendering process. I've built a file for that is driven by a bunch of parameters in an XML file. That way my client can update that XML file using a simple UI and launch the render. I could just tell them to press F12 but if the file starts rendering immediately, what would be even better.

@NᴏᴠɪᴄᴇIɴDɪsɢᴜɪsᴇ This is hardly a duplicate.

Don't see how this is a duplicate.


text:
Cycles normal input relative to object's rotation
In continuation to this questions:
Visualise texture based on direction a surface is pointing using Cycles
Mapping the XYZ colors to faces based on their normal orientation works great. But if I rotate the object, the normal values change. This is even the case when the object is parented to an empty.
Is there a way to lock the normals to the local rotation of the object? Or is this always calculated based on te global values?

You could bake those colors to the texture which is probably unflexible, or try using Texture coordinate node instead. A bit related - https://blender.stackexchange.com/questions/7222/cycles-texture-mapping-generated-coordinates-with-world-orientation

Thanks for the pointer. Adding a vector transform from world to object did the trick.

Thanks to Mr Zak for the pointer, I started fiddling with the vector transform and that gave me the desired result.

This is without the vector transform:

And this is with vector transform:


text:
Use Geometry Nodes to Align Instances Along Mesh Edges with Instance Z-Axis Always Aligned to Perpendicular Ajacent Faces?
I'm using Geometry Nodes to to instance two meshes onto another mesh, here an icosphere to start out, such that I can develop sets of modular 3d printable "Hubs" and "Struts" that I'll be using for costume elements.
Getting the "Hubs," (at the icosphere vertices with their z-axes pointing outward from the ico's vertex normals) in the mesh was fairly easy, but I'm having some trouble getting the "Struts" to behave the way I want. Apparently a solution is somewhere in this answer Geometry Nodes: Instance And Align Mesh Along Edge? but I can't quite figure it out (I'm relatively new to Geometry Nodes, and have a pretty basic understanding of vector math).
The two issues I'm having:
1 -  some of the instances' z-axes are pointing "erratically." I suspect that this may have to do with a zero or one vector or value getting thrown somewhere, but even if that's the case I don't know how to deal with it.
2 - when I deform the icosphere mesh, the edges begin to point "erratically" in the affected area.
The images show what I have so far:

Although @quellenform 's solution works great in the given conditions it is slightly limited to applying it to different Mesh objects.
Here is a slightly optimized and improved solution to the problem.
Let's set our Instance object ("Wrench") to be oriented along the Y axis and Z axis points Up. The object's origin should be at equal distance from the -Y and +Y boundary (optional).
Let's set our Target object to be a Mesh object (Icosphere, Monkey), which will have the Geometry Node Modifier.

With setting up an Instance on Points derived from the Edges of the Target object, the following problems need to be solved for the Target Object:

Get the orientation of the Edges.
Get the average Normal of the neighboring Faces (faces on both sides of the edge).
Get the Edges lengths.

The following problems need to be solved for the Instance Object ("Wrench"):

Align (Rotate) the instances to the Target's edge directions.
Align (Rotate) the instances to the average Faces normals (although incorrect lets name it 'Edge' Normal).
Scale the instances to match the Edges lengths.

The solutions relies heavily on Sample Index node, but consists of substantially simpler node set up.
Here is a screenshot of the setup with some additional explanation inside:

Here are some results:

Some deviation from the Edge alignment may occur when using N-gons (4 or more sided polygons) due to noncoplanarity.
But it is very stable with triangular meshes even if deformed prior to the Geometry Node Modifier.

Always interesting to see what develops from some answers ...when applied correctly. Well done!

@quellenform Thanks!

Thank you @RumenBelev! This looks like it's going to work beautifully, and it seems an elegant solution building on what @quellenform started. Glad to see the co-creative spirit still very much alive on the internet :) I'll update if I have further issues (will probably have more time to wire up the solution on my own Blender install tomorrow).

@RumenBelev well, just wired it up... Looking great! There's some further stuff I need to figure out about scaling the instances, but I think I can figure that on my own. Beautiful and elegant solution! Thank you again!

You are very welcome @EmmaScottLavin ! Try and replicate the node setup carefully. Let me know if you have any issues.

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


text:
Can I change colors of my operator buttons in Blender?
Here in this task I am trying to add some QC Validation in blender, where my objective is once clicking the operator button if it passes QC Validation then the button turns green otherwise it turns red.
I have Python script where I am trying to add this sample logic in operator Mesh Count QC, so my mesh_count_operator should be something like this following pseudocode
class MeshCountOperator(bpy.types.Operator):
    bl_idname = "object.mesh_count_operator"
    bl_label = "Mesh Count Operator"
    count = len(bpy.context.scene.objects)
    if count > 5:
        set Mesh Count Operator -> green
    else:
        set Mesh Count Operator -> red

My python script is as follows:
import bpy

class AssetOperator(bpy.types.Operator):
    bl_idname = "object.my_operator"
    bl_label = "Asset Operator"

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

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

    def draw(self, context):
        layout = self.layout
        layout.operator("mesh.primitive_cube_add", text="Asset Tool 1")
        layout.operator("mesh.primitive_cone_add", text="Asset Tool 2")

class MeshQCOperator(bpy.types.Operator):
    bl_idname = "object.mesh_qc_operator"
    bl_label = "Mesh QC Operator"

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

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

    def draw(self, context):
        layout = self.layout
        layout.operator("mesh.primitive_cube_add", text="Mesh Geo QC")
        layout.operator("mesh.mesh_count_operator", text="Mesh Count QC")

class AssetQCOperator(bpy.types.Operator):
    bl_idname = "object.asset_qc_operator"
    bl_label = "Asset QC Operator"

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

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

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.operator("object.mesh_qc_operator", text="QC Validation")
        row.operator("object.mesh_qc_operator", text="Publish Asset")

class TOPBAR_MT_custom_sub_menu_1(bpy.types.Menu):
    bl_label = "Publish Tools"

    def draw(self, context):
        layout = self.layout
        layout.operator("object.asset_qc_operator", text="Asset QC")

class TOPBAR_MT_custom_sub_menu_2(bpy.types.Menu):
    bl_label = "Asset Tools"

    def draw(self, context):
        layout = self.layout
        layout.operator("object.my_operator", text="Asset Tools")

class TOPBAR_MT_custom_menu(bpy.types.Menu):
    bl_label = "Zas Tools"

    def draw(self, context):
        layout = self.layout
        layout.menu("TOPBAR_MT_custom_sub_menu_1")
        layout.menu("TOPBAR_MT_custom_sub_menu_2")

    def menu_draw(self, context):
        self.layout.menu("TOPBAR_MT_custom_menu")

classes = (TOPBAR_MT_custom_menu, TOPBAR_MT_custom_sub_menu_1, TOPBAR_MT_custom_sub_menu_2, AssetQCOperator,
           MeshQCOperator, AssetOperator)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.TOPBAR_MT_editor_menus.append(TOPBAR_MT_custom_menu.menu_draw)

def unregister():
    bpy.types.TOPBAR_MT_editor_menus.remove(TOPBAR_MT_custom_menu.menu_draw)
    for cls in classes:
        bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()

Is it possible to achieve this functionality or I need to go with some other ways to let user know about the QC status.I have done similar process in maya using pyside/pyqt but I am quite new to blender scripting so any reference would be really helpful as well.
2 ) Also one more thing is there any way to add a refresh button as well, so for example i have 3 objects in blender scene , i clicked on the qc operator it turns red(as it will fail according to the logic), but then add few extra objects and now the number is greater than 5, so rather than re-doing all process i can directly change the status of the operator using the refresh button.
Thanks & Regards

Hello ! It seems you can't change the text color using the python API. You can however change the field background color to red if you use the alert flag https://blender.stackexchange.com/a/8861/86891 but that's as much customization as you'll be able to afford. Another solution is to use a custom shader using the gpu module but that's another nut to crack

Okay okay got it, do you have any reference to the gpu source tho where i can learn a bit about them, also any input of yours on the second part of the question as well please. Thanks

it's pretty sparsely documented unfortunately, and the previous way to draw text on screen was phased out in the last versions... Try "blender python gpu text screen space" as keywords in your search engine of choice. On this site you should ask only one question per thread, would you mind opening a new question to ask it ?

Thanks and sure I'll open a new question .

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


text:
How can I add a camera to my scene such as my required mesh object will always be in it's view irrespective of its size?
I am trying to find a way to add a camera such as when I add it to my blender scene it will set it's location, rotation_euler and lens(focal_length) properties such as my required mesh object will always be in camera's view.
Here what I have done till now
import bpy
import math

def turnaround():

    scene = bpy.context.scene
    camera_data = bpy.data.cameras.new(name="turnaround_camera")
    camera_object = bpy.data.objects.new(name="turnaround_camera", object_data=camera_data)
    scene.collection.objects.link(camera_object)

    turnaround_camera = bpy.context.scene.objects.get("turnaround_camera")

    target_obj = bpy.context.scene.objects.get("Hi")

    target_obj_dimensions = list(target_obj.dimensions)

    max_val = max(target_obj_dimensions)
    fl_factor = 50 * 2 / 30

    camera_height = target_obj_dimensions[2]
    camera_loc = fl_factor * max_val

    turnaround_camera.location.z = camera_height/2
    turnaround_camera.location.y = -1*(camera_loc)

    rotation_x = math.radians(88.1723)
    rotation_y = 0
    rotation_z = 0

    turnaround_camera.rotation_euler = (rotation_x, rotation_y, rotation_z)

turnaround()

In the script I am adding a new camera and setting it's properties such as my object will be in it's view, but the thing is as I have hardcoded few things like rotation values
fl_factor due to which object of default size kind of coming fine, but as soon as I change their dimension it is failing.
You can refer to this image for better understanding of my requirements.

Any help would be great.
Thanks & Regards

Well seems like it is really simple we can just use the following snippet and it will do the rest
turnaround_camera.constraints.new(type='TRACK_TO')
turnaround_camera.constraints["Track To"].target = target_obj

I am still not sure if this the best way to go for or not but it works.


text:
Why does Blender freeze when compiling shaders
A lot of game engines and other software compile shaders in the background and show a placeholder shader (or the old shader) during compilation. Why doesn't Blender do this?
Sometimes I modify shader nodes and have to wait 10-20 seconds just because I unplugged something while editing

What answer do you expect? Computing needs time. It's faster with faster hardware. Certainly does not take 10-20 seconds with a decent GPU unless you have crazy procedural setups in your shaders in which case it's slow because it's complex. Baking helps. What's the point of this question?

I’m voting to close this question because it's not really about using Blender. Technical reasons why some algorithms work some ways are more related to the development of Blender, which is off-topic. Also the problem cannot be solved in an answer.


text:
Outlining in Blender?
I am currently working on converting my logo vectored as a SVG to a 3D model using the 2.72 version. I ran into a problem with my logo because it contains a black stroke and an orange stroke (see both images below), but currently all I have is the interior color of each shape. I was wondering whether or not there was a simple way to add in these strokes, and how exactly to go about creating the strokes. Thank you in advance community!

The SVG importer will ignore stroke thickness property, which means you have to convert strokes to paths in external vector editor such as AI or Inkscape, then you can edit curves much more conveniently within Blender.

While of course it is always better to use the original SVG-data (see accepted solution), there is another method if this cannot be found or generated for a particular picture. This option makes use of the displacement modifier:
From A (original Image), make a version like B) in your favorite image manipulation tool. Then go in blender, add a plane, add a few subdivisions (with subdivision mofifier) and add a displacement modifier. Set B.) as the displacement texture and Apply all modifiers. Then delete the lower plane (with box select). Then make a material with a node setup as seen in E.) with the image texture of A.).
And you're done!

Happy Blending!


text:
BGE: Getting keyboard entries on screen, entered characters are black
In an application I would like to get a gamer's name to use it later in my Python code. So far I am using "Dynamic Text Display" as shown in http://www.youtube.com/watch?v=GKO4jfAHtjk. I find the procedure pretty complicated. In an older version of the appliction it worked, but now I get only black boxes instead.

I made a lot of changes and don't know where I lost it. In the object I check I think everything according to the clip above. Still all black.
Then I tried to get the name from the keyboard events, but since I am using a german keyboard I run into trouble with our special characters. It seems that the program assumes an US keyboard. I even thought about changing the bge.events. EventToString() method to cover my keyboard type, or create a new one based on it. But I did not find the source code.
Any ideas? I prefer a Python solution based on the keyboard events, getting the keyboard events right.

Text objects are supported in the latest versions of blender (have been for a while now).
Example .blend (start game and type): http://www.pasteall.org/blend/32301
By default, "BFont" is used, but you can set other TTF fonts, as you would normally for blender, and those should also work.

Way better, very simple compared to the youtube procedure. But now the special character (ß, ä, ü, ö) issue comes up again, because an US keyboard is assumed. I think I will fix that in Python.

I found out that the problem is the console output we are using to debug the programme. On Windows the special characters (ß, ä, ö, ü, Ä, Ö, Ü) do not come out correctly, even though ord() of the character is the correct ASCII code (http://web.forret.com/tools/charmap.asp?show=ascii). So that is not a problem in my application. The only issue is that the upper umlaute (Ä, Ö, Ü) come out as A, O, U. Well, for me that is good enough. Case closed. Thank you.


text:
HDRI Environment not showing on add - Blender 3.5
Issue: HDRI environment is not showing up when I add to project?
Machine - Mac Pro M1
Render setting - GPU Compute
I'm at the 2:55 mark in this tutorial and am stuck.
https://youtu.be/uUQ6GnMfKu8
Thank you

Hello and welcome. Your description is very vague, you need to add as much detail as you can about your setting and issue

Your screenshot shows you are in solid shading:

You should be in Rendered Shading.

It's the only one that shows an actual render of your scene in the viewport. The other shading modes only show some limited imitations of certain aspects of your scene, to provide you with different information during certain tasks that need it at a low resource cost.


text:
Surface Material effects more than the selected object
I'm applying a glass material to the surface of an object in my scene. In this case the 'V_'
Why does the surface effect also happen to the backdrop?
I only want the effect on the 'V_'
Thank you

hello, do they have the same material?

Hello, yes. The glass effect I want applied just the V_ is also effecting the backdrop which I don't want to happen.

So you just need to assign another material to your plane


text:
GPU Compute Render Setting option not available in Blender 3.0
I'm on a Macbook Pro M1 series which technically doesn't have a graphics card but does have a GPU intergrated into the M1 chip.
This is a problem when I try to set the render option to GPU mode - there is no graphic card to point point to in blender system settings.
Is there a work around for this?
Thank you!

I believe you need Blender 3.1 or above to use GPU render with a Macbook.

Thank you! That was it.


text:
How to match the local transforms to another object without rotating the model
I'm trying to match one objects orientation to another without changing the model rotation.
I was able to come close to what I wanted by creating a custom orientation, but I would need to apply that custom orientation to the locals of the current object to get what I want.
EXAMPLE:
Starting with two objects with different local transforms:

I want a way to make the local rotation of the top object to match the local rotation of the bottom object without moving the mesh itself:

I can get close to what I want by creating a Custom Orientation out of the bottom object and using that with my tool, but I would like to be able to apply this to my local rotations instead of relying on using the custom orientation:

Ok. I was close but was just missing the 4th step below:

Enable Transform > Affect Only > Origins
Select the object whose orientation you want to change, SHIFT + CLICK the object you want to match
Object > Transform > Align to Transform Orientation
Change from Global to Local

Shoutout to moonboots for prompting me to check again which was when I noticed this setting.

Select the bottom cube. In the Transform Orientations panel, switch from Global to Local. Activate the Transform Affect Only > Origins option, select the top object, shift select the bottom object to make it the active object, go into Object > Transform > Align to Transform Orientation:

That's what I would have assumed too but I tried that earlier and it just set the orientation of both objects to match the global/scene defaults
EDIT: I figured it out: after doing this I need to change the action settings so it applies to local rather than global, which is the default. Thanks for prompting me to check again because that felt correct to me, I was just missing one setting

OK I've edited  ;)


text:
donuts sprinkles look like paper (no thickness)
I follow the instruction of this series blender donuts video: https://www.youtube.com/watch?v=bLw0HwphXO0. When I render my model, I found that the sprinkles on the icing look like paper without any thickness. See the screenshot.

If you have any ideas, I hope that you can help me. Thank you so much! Here is the blender file.

It is just a scale problem.
If you select one of your sprinkles object, you will see that its scale is not 1 :

A scale other than 1 often cause problems like this. Problems appear mostly when you use the object as a particle or when you add modifiers etc...
You must always pay a close attention to scale and you always sould have your objects at scale of 1 unless you know exactly what you're doing.
For your problem, just applying the scale would solve it. Select all your sprinkles and press CTRLA and choose Scale :

Now the sprinkles look just fine :

Just don't forget to plug the nodes in the node editor since, for some reason, they were not plugged in the file you uploaded :

Personally, I would go further, and suggest: 'Never scale in object mode, while modelling'.  Half the questions on this forum would disappear. But I'm probably bossier than you.  :)

That's right though. You should never scale in Object mode and if for whatever reason you do, you should apply the scale unleass there's a really good reason.

Yup.. object-level scaling is for animation. Otherwise, one legitimate use comes to mind: re-scaling to dimensions, in the 'Dimensions' panel. (And Ctrl-A applying straight away, as you say)

Thank you so much, my friends! It's really very helpful! I will pay more attend to the scales in the future.


text:
IK refusing to follow target around Z axis
The IK have set up does not follow the target around the Z axis. I am using an Empty as the IK target. You can download the blend here.

Each bone except the bottom one has the following IK constraints;

And the bottom bone;

What have I done wrong?

Here is how you do it properly:
The IK limits should be used only when needed. The limits on last 3 (Proximal, Middle and Distal) bones are fine.
Now change the IK constraint chain length to 3, this will remove the first bone from IK chain.

Instead rotate the bone with constraint, here is a LockedTrack that will also constrain the Y axis so the fingers end can move up and down with the base in correct orientation. This will also solve any flipping issue.

If you need to position the finger in space, do it with parenting it to a bone and then transforming that bone. Everything will keep working as expected.

I deactivated the x-axis limits for the three end bones and the odd error clears up as shown below.

I re-enabled the limits but changed the range from -90 to 90 for all 3 bones and tested it with some fairly exaggerated movements of the curve and the animation seems to behave sensibly.

The issue with this method is that the bones still snap to 180 degrees. If you look at the bone axes themselves, they are flipped when 180 degrees is reached. This can especially be seen in a non symmetrical model, like this.

If the default Standard IK solver is not satisfactory, you may want to try the iTaSC solver.

Comparing to Standard solver:

iTaSC is a generic multi-constraint IK solver.
iTaSC has a stateful mode, which means that the pose at frame n+1 is computed from the pose at frame n. (Simulation mode).
It also supports a stateless mode, identical to iksolver operation mode, where the pose is computed from the rest pose (or animation pose) at each frame by reiterations until the constraints are met. (Animation mode)

WIKI documentation

Jack, this is a problem with 'zero-lock' in the IK of the bottom bone, as your assymetrical final example shows clearly.  I suggest keeping the limits on and set to -90 to 90 for the top 3 bones (as in the first answer), but further you should change the bottom bone limits so they range from 0 to 359. This should put the flicker artifact directly pointed at the camera as the motion passes in front of the model -- it still will happen, you just won't 'see' it as bad.
Please post a result to show pass/fail.

sorry but rig that works only from certain camera angle is a bad rig.

The issue with gimble (zero) lock is pervasive in most software and needs to be worked around. The bottom bone in your model will rotate all the way around, it just needs to reset the measure of the angle. My answer simply points out that the best place to reset the measure of an angle is when pointed at the camera/user. It's not a faulty model nor a software bug, just an implementation consideration.


text:
Exporting to GLTF2 breaks character skinning
I am setting up a pipeline between Blender and Godot, and I've opted to use GLTF2 in order to do this. My plan is to create multiple animations in a single blender file (run, idle, attack) along with the rigged mesh and then export them all in a single file into Godot.
The animations, rigging, mesh, etc. all looks good in Blender, but when I export it the mesh breaks. Vertexes are pulled in weird directions. The skeleton and animations work fine, the problem is with how the mesh is attached to the bones.
The export works fine when I used Collada (I can re-import into blender and everything works), but it will not import into Godot. I am also aware of the Godot exporter addon for blender, but that breaks the animations themselves.

The problem was with the exporter itself, and was solved by upgrading from Blender 2.80 to Blender 2.93. The glTF 2 exporter has improved significantly between versions. For future people reading this, make sure you are using the most up-to-date version of the exporter (probably in the most recent stable release of Blender) and see if that solves whatever problem you have.


text:
How to change the default views of quad view?
How do I change the TOP ortho view to BACK ortho view for my BACK image?
check out the pic I uploaded to see what I'm talking about.

Do you want to make the view in that section look from the back? Or do you want to adjust your model so that the back view looks like the current top view?


text:
Installing an add-on from zip does not show up in Edit > Preferences > Add-ons
following advice posted elsewhere (SO thread, Ducky 3D tutorial) I followed these steps to install the Bizualizer addon:

Downloaded the repo
zipped the repo
located the .zip file in Edit > Preferences > Add-ons > Install...
the add-on does not show up in the search.

I decided instead to try and install the add-on by moving the downloaded repo (not the zip) into the User-Defined Add-on Path and it was indeed detected but gave me the following error when I tried enabling it:

Does this mean that it was failing before because of an error in the module? If I put the .zip into my user-defined add-on path it simply is not detected, but putting the folder there lets it be detected but then Blender claims that there is a module not found error.

what version of Blender are you using? 3.5.1? I don't use this addon but it says in the repository that it is for 2.80 so maybe it is not supposed to work on 3.5?

@MikoCG ah, that could be it, thank you. I am currently on 3.5.1

Hm, thats not it I tried to install this addon which claims to work for Blender 3.5, and I am receiving the same error

It's a third-party addon, not part of Blender so you should ask the author.

The issue here has been resolved by updating Python, I was on python 310, updated to 311 and it works now.

Thanks for your self-answer. After a little while you'll be able to accept it (with the tick,) marking it solved, for us.


text:
Alembic: Exporting several objects as a single object
Lets consider this example:
Having a destruction simulation composed of several objects in Blender.
I want to export the scene using Alembic animated format.
It works correctly, it exports 1 single file with animations and stuff. BUT the alembic file is composed of all thousands of objects separated.
This is immediatly noticeable when trying to reimport the alembic in Blender, because the viewport becomes very, very slow.
Is there any solution / addon / workaround / script to somehow "join" all geometry in 1 single object when exporting?
It used to be possible in the very old Blender version 2.79b (Blender Fracture Build), but apparently not in all the recent versions.
Having the possibility to export an Alembic as a single object instead of thousands, makes a great difference in performances for Blender viewport, I made some tests and its impressivly huge the difference.
By doing that, I used to be able to re-import the same simulation multiple times, which is way more convenient instead of using an Alembic file composed of thousands of objects, that instead is very very slow.
Note: I already tried to use geometry nodes "join geometry" but it doesnt makes any difference for Alembic files.
Thank you

I faced the same task today - export complex alien station animation to single object in alembic. The solution I figured out was pretty siple:

Create any mesh object.
Put geometry nodes on it.
Add collection info node.
Connect it to realize instances node, then to output.
Export your object. Beware of heavy weight!

that incredibly works!


text:
Easier way to remove particles textures from ripped model?
I've ripped several models from a PSP game, and I noticed that nearly all of them (except for the organic models) essentially duplicate the model, one with the normal textures, and one with either black, gray, or purple textures, which I assume are used for some sort of particles-based specularity effect.
Thus far, I've had to manually pick out the faces with the particles texture and delete them, which can become quite tedious when you're working with nearly 8K faces. (Note that a group of only 5 to 10 faces is its own object when I initially import the .obj file.)
I am wondering if there's a way to systematically remove the unwanted particle textures. I've tried joining all of the objects then removing double vertices, but it appears as though the correct textures that are kept or deleted are arbitrary as I get a splotchy model.
Note that if I right click on a face with a particles texture, I end up selecting the face behind it with the normal textures, and vice versa.
http://pasteboard.co/2up5MRE6.png This is an image of a model with some normal textures visible and some particles textures visible.
http://pasteboard.co/2up3BZR3.png This is an image of the same model after I've selected a few particles textures, which makes the proper textures visible.
So, down to my question. Is there a way to have Blender accurately target the particles faces? As far as I know, the object names are just model_<number> with no real pattern. Each object has only one material, though if I join all of the models to get one then there are thousands of material slots.
(Note that the models I rip are purely for personal use as I'm currently a modeling student and want to learn from professionals. As far as I know it's perfectly legal as long as I'm not using pirated software or games, which I'm not.)

If you hadn't seen it Daniel Salazar just explained a similar problem which may give a bit more understanding of what is happening and offers an easy solution obj.data.validate(). While this does remove the duplicated faces it doesn't offer the ability to decide which face to keep so may remove the face using the texture that you want to keep.

The black, white or grey images are most likely masks, for example a specular mask will define where the specular is high (white) and where there is no specular (black) with grey being in the middle. These 'maps' can also be used to adjust many settings like transparency, emission, mirror... instead of having one value used over the entire model.
The blue/purple images are normal maps. To get low poly objects looking detailed it is common to sculpt or model a high poly version and then bake the difference into a normal map to get a visually similar result with less geometry, these maps predominantly have a distinct blue to purple colouring.
To the issue of removing duplicate faces - if you know the material used on faces that you want to delete then you can select all the faces using that material and delete them. The technique to apply different materials to parts of a model should explain how to select faces used by a material. You could also select the faces used by the material you want to keep then invert the selection with ⎈ CtrlI and delete those faces.
As you mention many materials in use, you may also want to use python to go through them all. If you want to keep one or two materials and delete the others then a small script like this might help.
import bpy
import bmesh

me = bpy.data.objects['model2808'].data
bm = bmesh.new()
bm.from_mesh(me)

for f in bm.faces:
    if objmats[f.material_index].name != 'Material.002':
        bm.faces.remove(f)

bm.to_mesh(me)
bm.free()


text:
Removing specular intensity from all materials with internal
I've ripped a model from a video game and for whatever reason whenever I import the .obj file all of the materials have an unwanted default specular intensity of 1.000 (I am using the internal Blender Render engine.)
There are thousands of materials, so is there a way to set the intensity to 0.000 for all materials without doing it manually one by one?
This seems to me to be a job for a python script but I'm unfamiliar with both python and scripting inside of blender (maybe I'm wrong about that, anyway).
Any help would be much appreciated. :)

For Cycles and Eeve refer to: removing speculuar intensity from all materials

copy the script below, add a new text block, paste, right click, run script.  The specular intensity of all materials will be set to 0.
import bpy

for m in bpy.data.materials:
    m.specular_intensity = 0.0

Thanks, that worked! I knew it was probably very simple. Will accept in uh... 4 minutes?


text:
How to smooth camera animation to have fluid feel?
When dealing with camera motion, its very sensitive to any movement discontinuities. Is there a way to easily achieve natural looking motion when dealing with complicated motion paths and timings?
Follow path animation feels too robotic unless I adjust all the keyframe easings carefully and this has to be re-done everytime the animation changes (the automatic bezier type just doesn't work).

A way to achieve camera motion with fluid non-synthetic feel is with softbody camera rig. This will do automatic easing of any motion and will save some graph-editor work.

Create a filled Circle with 3 vertices, subdivide it and delete the middle face:

Create new empty vertex group, don't assign any vertices to it, leave it empty:

Add camera to the scene and parent it to the 3 inner vertices (select Camera, select Mesh, enter edit-mode, select vertices, Ctrl+P):

Add Soft Body to the mesh object. These are the settings to take care of:

Friction: higher will be more lazy smoother camera
Damping: less means more camera jiggle and more overshoot

Its good to hide the Soft Body modifier visibility when animating. Always bake the softbody cache. This is a result of a simple linear-interpolation animation with just 2 keyframes, you can see how the soft body smooths everything:

Best it's in combination with follow path animation to smooth any paths and timing discontinuities. Use the Follow Path constraint on the softbody to animate the location (animate evaluation time under the curve) and Track To constraint or just keyframes for the softbody rotation.

The resulting camera motion will be the curve smoothed, so even when the curve itself is not C2 smooth the resulting animation will be. This can't be done in graph editor or with smoothing the curve with smooth modifier (it follows the un-smoothed curve)

This is an awesome solution cheers to that!

Found it - the soft body menu is under the Physics tab of the Property editor, which is on the far right.

@Jaroslav Jerryno Novotny
Why do you have to parent the camera to a mesh object? Is it not possible to add the soft body modifier to the camera itself? Just curious.

@faybn no, a camera object is basically just an empty. You can add a force-field or a rigid-body constraint to it, that's all.


text:
Blender won't render on Dual / Single GTX 980
Recently, I've finished building my new Desktop. First thing I did was to install Blender and render a complex poly old project of mine. But Blender won't render on my Dual GTX 980, not even on single GTX 980. I've tried everything, but I can't get it to work.
Can somebody help me?
P.S : I've already tried the " Set it on Experimental " thing, but no luck.

What happens when you try to render?

Blender enters in render screen, but that's it, nothing renders.

Sounds like your GPUs might be running out of memory. Is there any output in the console?

Nothing. BTW, I'm using Windows 8.1

This could be a case of your drivers being too new for the API that Blender is compiled against.  Something like that was happening a few months ago with people who bought really new cards.  I mentioned this question on IRC #blendercoders but you should file a bug report if nothing else works so it can be fixed as soon as possible if this actually is the problem.(BTW, when this happened before it was fixed within a week so I would not worry too much about it)

Actually it's a known problem, due to changes in latest CUDA kernel compiling for GTX 970 / 980. You can try to copy the file 2.72/scripts/addons/cycles/lib/kernel_sm_50.cubin to another in the same folder, named "kernel_sm_52.cubin". Or you can wait for the release of Blender 2.73...

Polosson - It worked! Thank you. I'm very pleased with the results. Dual GTX 980, Resolution 1920x1080 - 75%, Samples - 2.500. Project - Sculpted Mesh : 1.5 million Verts, 3 million Faces. Final time : 10 minutes


text:
How can I avoid Depsgraph rebuild times?
I have two objects (in collections) in the scene and I want to render only one of them programmatically (from Python). When I measure the rendering time, there is always overhead of Depsgraph build time.
import time
import bpy

bpy.app.debug_depsgraph_time = True

start = time.time()
print("Start: ",start, "s")

bpy.data.collections['B747'].hide_render=False
bpy.data.collections['B757'].hide_render=True
bpy.ops.render.render(animation=True)

end = time.time()
print("End: ", end, "s")
print("Duration: ",end -start)

Start:  1687435725.4579306 s
Depsgraph built in 0.105444 seconds.
Depsgraph updated in 0.009703 seconds.
Depsgraph evaluation FPS: 0.020573
Saved: '/tmp/output0001.exr'
 Time: 00:00.14 (Saving: 00:00.02)

Depsgraph updated in 0.008152 seconds.
Depsgraph evaluation FPS: 0.023989
End:  1687435725.734076 s
Duration:  0.27614545822143555

As you can see, rendering + saving takes only 0.14 seconds while the whole duration of the code is 0.27 seconds.
When I comment out hide_render, there is no such overhead.
# bpy.data.collections['B747'].hide_render=False
# bpy.data.collections['B757'].hide_render=True

Start:  1687435918.4967954 s
Depsgraph built in 0.000358 seconds.
Depsgraph updated in 0.001326 seconds.
Depsgraph evaluation FPS: -nan
Saved: '/tmp/output0001.exr'
 Time: 00:00.16 (Saving: 00:00.02)

Depsgraph updated in 0.008340 seconds.
Depsgraph evaluation FPS: 0.020629
End:  1687435918.680713 s
Duration:  0.18391752243041992

Here, we observe 0.02s overhead which is fine.
Now, I want to avoid this Depsgraph build time overhead due to hide_render.
What I tried is:

Move away method

Leave all the objects to be rendered and do not configure hide_render in the code.
Move the object away from the camera that I do not want to render in the image.

=> It still loads the textures of all the objects for each rendering, so the rendering takes more time.

Visibility method

Don't touch hide_render.
Turn off all the visibility parameters to False from here

=> Same as 1.
Is there a way that I do not reload all the objects per rendering without setting hide_render?

Hello, it looks like what you want isn't really achievable, modifying the scene data and not allowing it to rebuild itself will logically lead to incorrect rendering results


text:
Texture painting doesnt work as intended
Im new to blender and wanted to try making the famous donut. But when i started working on texture painting i came across a problem. When I tried painting the texture, i couldnt paint the 3d donut because my drawings were random and not where i wanted them to be. What could be the problem here?

If your texture painting isn't working right its probably because of your mesh. I had to go to Edit Mode and select all vertices. Then I just simply go to Mesh > Normals menu and then click on Recalculate Outside.


text:
Tube Slide Rotation
I am making a waterslide with a spiral on it. To make this, I have used a Nurbs Curve and applied an Array and Curve modifier to a small section of my slide which made it go all the way down the spiral. But my problem is that the side of the slide is rotated from being on the side at the top to being near the top at the bottom. I am trying to keep it all at the same level staying on the side and I can't figure out a way to fix this. Any help is greatly appreciated, Thanks.

Possible duplicate.. (although, I know, they're sometimes hard to find)
https://blender.stackexchange.com/a/281197/35559

+1 RobinBetts ... YoDub - you should mainly care a Tilt rotation of each control point of your Curve object (used in modifier).

It worked! Thank you so much you two, I doubt I would have figured it out.


text:
ShrinkWrap modifier not maintaining same offset for all vertices
I'm trying to use the Shrinkwrap modifier to connect two meshes, but I can't make it work properly on the cylinder. I tried to change the Shrinkwrap settings but I got nothing out of it.
The vertex (one in red) should be at green arrow, but I don't know why it's behaving in that way, is there a way to do it without manually changing the vertex ?
Cylinder modifier

So, we're assuming that the modified object's Y is in the red-green direction, and the vertex marked with the red arrow is weight 1 in 'Group'  .. is that right?

Object's Y direction is in the red/green direction, and the entire loop is weight 1 in 'Group'.

Thanks! Maybe edit that in to make it absoulutely clear, and share the relevant chunk of your .blend on  https://blend-exchange.com/ ?


text:
How to model this ellipse shape?
I'm trying to model the ellipse of this spaceship:

But I can't figure out how to do it... I tried to use two circular and use "brige edge loops" but I couldn't achive what I wanted, then I tried to scale a torus along the Y axis and still isn't good.

I'm having a hard time working with circular shapes, can someone help ? Thanks in advance.

another option is to start with a curve circle and extrude it.

similar to this one: https://blender.stackexchange.com/a/298605/107598

Create a circle, extrude inwards:

Move the inner circle:

Remove the 2 faces in front:

Move some vertices to make the tip sharper, etc:

Mirror with a modifier, extrude up:

Etc:


text:
Weird topology when using subdivision on a cylinder
I'm creating a cylindrical shape and I'm getting weird topology when use subdivision surface modifier, I tried to add loops across the Y axis of the cylinder, but it made the edges on the Y axis sharp which I don't want. I spent some time trying to figure out how to solve it, but I couldn't find a solution...

Observation: The red loops are tightning loops that I have marked.

Maybe the best is to switch to a 32 vertices cylinder then use this topology: https://www.zupimages.net/up/23/26/hnhy.jpg

Woah it works, much thanks. But why was it happening and why does it solve it ?

Switch to a 32 vertices cylinder and choose the following topology, it will fix your shading problem (16 vertices leaves faces that are too large to avoid the pinching effects, as they are bending much more):


text:
Visibility in viewport
Newbie to Blender, working my way through Blender Bros tutorial.
Despite having visibility turned off on all objects I can still see some. If I select them nothing is highlighted in the scene collection.
I've moved over from Modo and still find my fingers on auto for shortcuts, so I don't know if some of these have caused this effect but can't figure out how to sort out.
Using M1 iMac running OS 13.4.1
Attached screen grab.
Any help appreciated.

Try hilighting one of the objects in the viewport then hovering over the outliner and hitting the '.' (period) key either on the main keboard or the numpad. That should expand the tree and hilight the object in the outliner.

try pressing the little flag button in the outliner:
and press the little viewport button, this should give you another way to disable visibility, but only in the viewport, and will not affect any render

also posting the blend file is very helpful for issues

Hi, How do I post the file. New to this site.

https://blend-exchange.com/ and follow the instructions on that page. However you can only share files up to 30Meg in size there so if yours is larger you'll have to find another site and post a link to the file there.

Thanks, file uploaded.

You haven't added a link to it so we can't download it!

Sorry. Anyway, it's sorted now. Don't understand why they were visible when all visibilty icons were turned off but fixed by copying to new collection then deleting objects.


text:
Strange BoxCutter behaviour
This happens only in one file which admittedly is getting a bit complicated. I select object to be cut, then the cutting option ( Box or whatever ). When I drag across the object selected, it deselects and nothing happens?
Anybody else had this?
Blender 3.6 on Mac M1 with OS 14 ( Sonoma )

Hi. Since BoxCutter is a third-party addon this question will probably be closed. You should have a look at the documentation page at https://boxcutter-manual.readthedocs.io/en/latest/  and if somewhere in there you don't find a solution, you should contact the developer.

No problem.
Sorted by removing buildup of cutters. Now working fine.


text:
Blender to Sketchfab
I have parented some armour to a shark model that is animated. I have then added some rotation animation to the armour to counter any clipping but when I export to sketchfab the secondary animation I did is just not on the model. When I try and rotate the armour in the same action as the shark the whole shark rotates. So is my only option to unparent the armour and then animate it to follow the shark? Surely you can have secondary animation on the armour and be able to export it as one full animation? When I bake actions it doesnt seem to also bake in the saddle (armour).

I assume you parented object to each other? Maybe try to add an empty object, and parent all top-level object to that empty, so that they are all in the same hierarchy. Then try to export again. If it doesn't work, try to use an armature instead of animating objects directly.

feel free to upload your file on Blend-Exchange and share the link here if you want to allow us to check your project and give a more tailored answer.


text:
How do I make procedural volumetric planetary clouds?
So, I’m making a procedurally generated planet in blender, and I need a way to make realistic looking volumetric clouds that look good from both space, and the surface. Even if I use a sphere around the planet for the clouds (not volumetric), then I would need to figure out how to actually make that iconic cloud shape. The clouds on earth twist and turn, making formations that are hard to describe. I want to mimic that look in blender 100% procedurally volumetricly. When I add non-volumetric clouds right now, they just don’t feel right. They look vaguely similar to clouds, but they lack that twisting and variety. You can only do so much with a noise node and some transparent nodes plus a color ramp and some mix shaders.

i recommend at least adding an image to your question how you want it to look like

https://blender.stackexchange.com/questions/186597/does-anyone-knows-how-to-make-spiral-clouds-hurricane-for-a-planet https://blender.stackexchange.com/questions/220679/artifacts-in-cycles-clouds-and-volumetric-atmosphere https://blender.stackexchange.com/questions/111462/planetary-atmospheric-volumetric-clouds https://blender.stackexchange.com/questions/45484/render-of-planet-earth-in-blender-render-and-cycles https://blender.stackexchange.com/questions/31424/planet-texture-generator https://blender.stackexchange.com/questions/7509/atmosphere-rayleigh-mie-scattering-in-cycles


text:
how do i remove mesh from inside of the model?
Basically the way i made the hand is i sculpted the palm withought the fingers and scultped the fingers independently and stuck em onto the hand, but to finish sculpting the hand i need to remove the mesh from inside the palm and remesh the part where the fingers connect to the palm, is there any way to do that? preferably withought altering the rest of the model.

You can remesh but the size of the faces need to thin enough to preserve the shape

remeshing it completley is a problem because the remesh needs to be really small for the fingers to not get merged together and when i got too small blender starts lag really hard

Maybe try going into Edit mode and then, in face mode, Select->By Trait->Interior Faces, then delete them.
But that geometry looks very messy so I'm not sure it's work.
You should probably just remesh it. If you don't want to affect the whole model then just cut the hand into a separate object before doing it and join them properly with a boolean afterwards


text:
Multiple Alpha Meshes Stacked Turning Black
So uh, I'm rather new to the Cycles Engine, and while I've been able to find a lot of it out, I'm struggling with one specific thing.
The center of this model I'm working on, (Not my model by the way) has a kind of ball of lightning in the center, comprised of multiple plane meshes kind of randomly rotated within the model. However, attempting to recreate this in cycles is giving... odd results.
As you can see, the alpha is getting applied properly, but as multiple of the meshes layer up, the meshes kind of, create a blackness again, as if they were created without the alpha layer. But as you can see, the edges of the lightning, where there isn't another mesh behind it, is still transparent.

You can observe it more here with this tower of planes, after five or so, they suddenly turn black.

This is the material in the node editor by the way. https://i.gyazo.com/5e42f53885e115a5e9b708a0ecee9ce1.png

Well actually I found the answer, here
https://blender.stackexchange.com/questions/27718/black-artifacts-when-looking-through-many-transparent-objects
So that's useful. Leaving it here for future reference if anyone needs it.


text:
What`s wrong with this Eevee Lighting Setup?
I have run into some issues with the EEVEE render engine. I want to render a smartphone but the areas around the camera Lens show some weird lighting problems as you can see in the first picture.
The area near the seams is lit up, but in reality, it should be darker near the seam. I have tried to solve the problem with a boolean operation in case it is a topologic issue. I have also enabled ambient occlusion and tweaked the light and shadow settings but it does not help.
I have never really worked with EEVEE.

Hi! It would be really helpful if you could share the file     https://blend-exchange.com/

Solved: There are more Lighting-Settings in each Lightsource. Tweak this in Combination with the Shadow Cube Size and Cascade Size in the Render Settings is the solution.
This video describes:
Video Tutorial i`ve used


text:
How do I wrap a wire around a torus into a X shape like in the image without the wire deforming

I'm trying create something like the x shaped wire on the bottom of the torus. I tried using the skinwrap modifier and manually creating it by snaping the vertices to the torus but it ends up deformed

Try to cut it on the tourus with the "Bisect" tool and extrude it.

it started to deform the mesh after 2 cuts

do you use a curve? Here is a similar question: https://blender.stackexchange.com/q/235744/107598


text:
Blender 4.1 USD export not applying modifiers
Very pumped about the USD armature and shape key export features added in 4.1. But when I tried it out just now, many of my modifiers are not being applied on export like they used to. So far I've noticed simple deform and subdivision modifiers that aren't exporting. Is there a trick to this now? I've looked all around for a checkbox or something like there is with .glb exports, but I've got nothing. I won't be able to use this feature for my animations in this state.

Ok, got to digging around in the more detailed release notes (check the link below). Turns out this is not a bug. It was a known consequence of the changes. Too bad it came with some major compromises. I'm going to have to gum up my files with an un-subdivided version for animation, and a subdivided version for export. Hope they figure out how to solve this soon.
https://projects.blender.org/blender/blender/commit/c6d61e8586


text:
Is there a way to set the pivot point directly to the object's origin in the edit mode?
What I always do is:
(1)Return from edit mode to object mode
(2)Shift+S → Cursor to Selected
(3)Return to edit mode
(4)Set the pivot point to 3D cursor
If I can set the cursor to the object's origin directly in edit mode,
or if I could choose the origin of the object at the pivot point, that would be very nice to me.
I'm not the person who cares about efficiency so much,
(Even the pie menu that everyone loves is not for me!)
but I use this process so much, so It's so glad if there's some solution.
My hope is to do just this simply, without adding any extra features as much as possible.
Thank you!

Not possible. There is only Python to solve this:
bl_info = {
    "name": "Cursor to origin from edit mode",
    "author": "Martynas Žiemys",
    "version": (1, 0),
    "blender": (3, 5, 1),
    "location": "3D Viewport, Alt+Shift+Ctrl+E",
    "description": "Cursor to origin from edit mode",
    "category": "Modelling",
}
import bpy

class OBJECT_OT_cursor_origin_edit_mode(bpy.types.Operator):
    """Cursor to origin from edit mode"""
    bl_idname = "object.cursor_to_origin_edit_mode"
    bl_label = "Cursor to origin from edit mode"
    bl_options = {'REGISTER', 'UNDO'}

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

    def execute(self, context):
        o = context.object
        o.update_from_editmode()
        context.scene.cursor.location = o.location
        context.scene.tool_settings.transform_pivot_point = 'CURSOR'
        return {'FINISHED'}

addon_keymaps = []
def register():
    bpy.utils.register_class(OBJECT_OT_cursor_origin_edit_mode)

    kcfg = bpy.context.window_manager.keyconfigs.addon
    if kcfg:
        km = kcfg.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
        kmi = km.keymap_items.new("object.cursor_to_origin_edit_mode", 'E', 'PRESS', any=False, alt=True, ctrl=True,shift=True)
        addon_keymaps.append((km, kmi.idname))
def unregister():

    for km, kmi_idname in addon_keymaps:
        for kmi in km.keymap_items:
            if kmi.idname == kmi_idname:
                km.keymap_items.remove(kmi)
    addon_keymaps.clear()

    bpy.utils.unregister_class(OBJECT_OT_cursor_origin_edit_mode)

if __name__ == "__main__":
    register()

This will install as add-on if saved with .py extension from Blender's Text Editor. You can change the code to set different shortcut than  Ctrl  +  Shift  +  Alt  +  E
It does pretty much exactly what you do manually.

Thank you so much! I'll give it a try.


text:
Problem with drop off when sculpting rock face
I'm trying to sculpt rock faces in blender. My normal work flow was to append photos sscanned rock textures to my draw brush in sculpt mode and then go from there. Since downloading the newest blender when using this brush they are creating a big bulge every time I 'drag' them out. (see photo) I assume it's something to do with drop off, however if I change the drop off to make it less bulbous the rock texture is hardly seen and this wasn't happening previously. Any ideas?
Thanks

I was having the same problem! After clicking almost every option in the brushes settings, clicking the Vector Displacement checkbox under the Texture Tab is what did it for me!


text:
How do I put a face on top of this halftone shader?
As the title says, I've been trying to put a simple black line on this half-tone shader using mix shader, mix, diffuse, etc. I've been using blender for a few months so I'm at a loss. Linked is what I want to do and my .blend.

In the material called Halftone Pixel you need to plug your current setup into the input B of a Color > Mix Color, plug your image in the factor, and in input A choose the color of the drawing. Plug the Mix Color into an Emission that you plug into the Output:

thank you again moonboots


text:
How do I put two shaders on the same object separately?
I'm trying to make my character have blue jeans but peach feet, I can't find a way to separate it so that the leg contains both blue AND peach.As always, the .blend file is attached, but only 1 leg cuz 2 legs is 40 mb lol

Does this answer your question? Add different materials to different parts of a mesh?

no, I tried doing that but the faces don't line up with where I want. I could maybe line the faces up so that it doesn't put flesh tones on the pants? But if there's another way, I'd like to try that first.

Very short lived but I just made the leg and the pants separate objects. Thank you Emir for helping me.

You might also be able to do it procedurally with the Texture Coordinate node and a Mix Shader or Mix RGB nodes (depending on whether you're mixing shaders or colours). Don't forget to change the Colour Ramp to be "constant" for a nice, sharp transition between the two (or more) textures.


text:
Creating Faces from Edges for an n-shaped object
I've recently started a project, for which I need some help.
What am I doing? I have a .csv containing real world coordinates(in decimal) in order to build a certain shape.
As of now, I've managed to extract my values to produce the shape I want with Vertecies and Edges:

What I need to do now is to make this whole thing a box.
My Attribute "H" contains the height which I'd like to use.
So I need some way of creating faces on all three axis(in order to get my Box) and the z-axis shall be extended according to the value "H".
"H" will always be positive, so extending upwards.
Thanks in advance!

Are the meshes always a closed curve? If so you could use a "Mesh to Curve" > "Fill Curve"

To create surfaces from edges in Geometry Nodes, you have two options:

Create a curve and use Fill Curve
Create a mesh primitive and move its points

Curves
If you want to use curves, then one solution might look like this:

The principle should be what you are currently already using, but here I don't create a Mesh Line, but directly a Curve Line.
Then I resample it with the required number of points and move them to the desired positions.
Afterwards I apply Fill Curve, whereby I get a mesh with faces. Finally I just have to extrude them with the desired height.
Mesh Circle
It is even easier to directly create a mesh with the required number of points.
This could look like this:

Here I simply create a Mesh Circle. This has the advantage that I can specify the required number of points already during the creation.
These are then also moved and the faces extruded.
(Blender 3.2+)

Thanks a lot!
This solved my problem.
I realized I just didn't catch that I simply could've replace the mesh line with a mesh circle :D There's been my fault^^


text:
UV Editor acting strange

Hi everyone, I've got this shape here and I've marked seams around the edges but the UV.. comes out looking like this. Any idea what's going on? I've tried restarting the program, resetting the UV and trying again. It was working at one point, but I had to edit the shape and it hasn't worked since
I'm hoping I just broke a setting somewhere by accident. I'm on 3.2
Can't update software as it's a university PC but I could send the file to myself and try at home tonight if that might be the solution as my own laptop is on 3.5

You have some (or all) vertices of UV map Pinned (see Red points) ... go to UV Editor and Unpin (ALt+P) them first ... than Unwrap ...

what is pinned vertexes used for sir ?

Thank you this was the issue! Never come across those before :)

@hamed.design ... Blender Manual > Unwrap > Pin


text:
How to turn a 3D model into a normal map?
Not sure the title really explains it, but I have a high poly flower model that I want to turn the top-down view of into a normal map (or other solution?) so that it can be put onto a plane
I figured I could just bake the shape onto the plane but it came out blank unless I went wrong somewhere.
Is this possible? It's for importing into Substance Painter

You need to bake the normals, maybe share your file so that we can check if there's a problem?

You are just interested in the top view right?

Ah I found it! Turns out I forgot to click 'select to active' when baking. Squashing the model has made it work out


text:
How to access an attribute inside the simulation zone from the previous frame?
So I am trying to simulate a particle under gravity, specifically trying to use a verlet numerical method. All I want for now is to have the particle move under constant acceleration downward. The formula for the method is X(n+1) = Xn + (Xn - X(n-1)) + aΔt^2.
Basically to compute the new position, I need to add the current position minus the old position to the current position and then add acceleration times timestep squared. For that i would need the position for the last frame. But im not really sure on how i could access that/if its even possible inside simulation nodes.
Im thinking it may be possible by storing attributes maybe? But am confused on how it should look inside nodes, specifically how i lay it out in the simulation zone. Hope someone can help:)

This is not a direct full answer to your question, but with understanding the node tree you should easily be able to do what you want:

Just store the "old position as named attribute". Then in the loop do "something" with the old Pos and your current position, then save the old Pos as your new position within the loop.


text:
Problem simulating elastic collisions using simulation nodes
So I have a question regarding simulation nodes and am hoping someone can help resolve my issue.
blender version: 3.6 (Stable)
I am creating a geo nodes setup that attempts to simulate perfectly elastic collisions in four particles. The particles must move inside a unit circle boundary and collide in a perfectly elastic fashion with the interior walls of the unit circle. As of posting this I have set up the velocity part (they move with a constant speed and direction when I click play on the timeline). I want the particles to have an initial 'Kick' as if they are projected from their initial positions and then after each timestep a constant distance is added.
I am calculating the reflected velocity vector by reflecting it around the normal vector at the collision point. I am only executing this calculation on the contition that the particle's current position exceeds 1 (if d > r) using a switch node. Though, illustrated by the gif (if i can post it here) you can see that once the particles reach the point that they should rebound, they do collide which is good but they dont carry on with the new velocity vector, as in they just stick there and dont bounce away with a new constant velocity after the collision.
PS. Once I get the rebound fixed, i intend to add a small deviation to the rebound vector direction so that the result is more chaotic (otherwise, if Angle of incidence = angle of reflection, then im pretty sure the particles will just trace out a circumscribed quadrilateral which is boring imo) so i guess it will no longer be perfect elastic collision but will mimic it.
I am certain I am missing something in my node set up or something in the implementation I have overlooked. I hope someone can help and thanks :)
https://youtu.be/HgWHkZQC8dM
Node setup below (or above depending on where I post this)

Hi Ruben, unfortunately your node tree cannot be read, so please improve that. And i would recommend providing a blend file so people can check it out and don't have to rebuild it manually.

Hi, Ruben .. thanks for trying .. but until we can read your node-tree, we can't really figure out what's going on.. and personally I can't see the connection between your provided video and the rest of the problem as stated. Please edit to clarify, for complete strangers to your problem. Then we can re-open your question.

I would start with a circle, for which a collision detection is easier than for an ellipse. Then programming the collision resolution.
Initialization
I'm spawning 33 points, all of them within 20 cm of the border (which will be a 1 m radius circle), so we don't have to wait for them to come closer to the circle, and without particle-particle collisions they are still likely to hit the border at an angle:

Loop
The idea is to:

Detect a collision (moving outside the boundary).
Calculate when/where the collision happened.
Evaluate the moment of collision.
Evaluate the collision normal and reflected velocity from that normal.
Calculate where the point should be now, after the collision happened.
Update positions and velocities.

Scale velocity by $Δt$.
Add it to current point position.
Check if after such movement it would go beyond allowed zone (circle $r=1$).
If so, calculate how far it would cross the zone ($1 - $ distance from $<0, 0, 0>$).
Scale the velocity by the above length…
…And subtract it from position obtained in 2. This way position got clamped to the boundary.
Reflect velocity around the above position (because it's a circle, the position equals the normal).
Pass the reflected velocity as the new velocity to the Sim Out.
Scale reflected velocity by the length calculated in 4.
Add it to the position obtained in 6.

Display

Everything¹ Everywhere All at Once

¹- well, OK, I didn't code the particle-particle interactions, but already the setup got large. To draw the rest of the owl you need to, for each point, check if it collided with any other point, and if so, do the same logic. The "only" problem here is then, that a point can be caught between a rock and a hard place, it may simultaneously bounce from more than 1 point. In this case you could average resulting velocities. In order to program substeps, just put all the logic inside the loop in a custom group, and chain custom groups.

Last Minute Thoughts
Consider multiplying the velocity by $<1, 1, 0>$ to flatten it on each frame.
Also consider how because the calculations are done on points, and $r = 0.01$ spheres are instanced on them, the actual boundary becomes $r = 1.01$ (and so for correctness, the circle at the end should be increased so that the spheres never intersect with it).


text:
Human Base Assets install problem
I have installed Blender 3.6 and downloaded the Human Base Mesh assets. I opened the blend and that works fine, but following the instructions of saving the asset library I get an error:
Unable to copy bundle due to 2 external dependencies; more details on the console

Then I check the console and it says:
Unable to copy bundle due to 2 external dependencies:
   "C:\Users\werne\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderkit\thumbnails\vs_rejected.png"
   "C:\Users\werne\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blenderkit\thumbnails\blenderkit_logo.png"

That's just two png files and I have no idea what it means that because of them the bundle cannot be copied.
I know I can technically just use the blend file to use the meshes but I would like to be able to save them to my asset library. Anyone know what I'm doing wrong?

I was having the same problem. If you go to your Outliner window, and then the Display mode to "Blender File", and then delete the problem files listed. Then you should be able to Copy the Bundle and Undo Deleting the files!


text:
difference Boolean modifier: put new vertices into their own vertex group
I have a rectangular prism that I'm cutting letters into using an extruded text mesh and a difference Boolean modifier. I want to put all of the new "texty" vertices created by the modifier into one vertex group. Is there a way of doing this?

did you apply the modifier? can you show some pictures of what you have tried?

The modifier worked great. I just can't select the vertices I want to select. There are thousands of them. I want to tag the intersection faces for different shading.


text:
Any way to remove these useless faces all at once?

Modeled a mesh grille but forgot to clean up these and now I don't want to remodel it all over again

Hello and welcome. you could select one set of perpendicular sides and press F > Intersect (Knife). This will split the faces of the planes perpendicular to your selection and then you can select and delete them.

How are we supposed to guess what the topology of the mesh is?

As far as I get it you do want to remove "interior faces" and they're repetitive and you don't want to do it one by one, so here is a replicate of your issue down here in this animated image.

Hit TAB key on your keyboard to get into Edit Mode
From the select menu choose "Select All by Trait" then choose "Interior Faces"
Press X and delete those faces

Select object, press 3, select faces, press  X and choose Delete > Faces

OH, use "shift + G" to select all similar objects/faces/vertex etc etc !

Could you please elaborate a bit? The way this answer is currently worded, I'm afraid it doesn't really help anyone. Thank you for your understanding.


text:
Highlight vertices by vertex color as animation
I have a mesh object with specific data information displayed by various vertex colors. In my case, each color value represents a specific time point from red (earliest) to blue (latest). Now, I would like to make an animation in a way that all vertices with the same color data light up at the same time.
So basically there are three parts of the problem:

Select all vertices with the same color
Adjust the hightlighting only to these vertices and at the same time if possible
Store the highlighting as keyframe for animation

-> Repeat for the next color value
Hope anyone can help.
This is an example of how the object looks

didn't you ask that same question a few days before!?

Yes on a different page, but my problem wasn't solved. Thats why I tried it here again, hope thats okay.

This can be effected by using the hue component of the vertex color. For future reference, I might use black to white and gone with the value component instead, as you’d have more dynamic range. In this case, you’ll also have to use a Map Range mode to stretch the hue of blue all the way to 1 (I think blue’s hue is 0.66, so use that as the From Max value). Now, use a Math node on the gradient value, set to Compare. Animate the value it’s comparing to so that it moves across the 0-1 range in whichever direction you want, and set the compare threshold based on how wide you want the illumination band to be. Plug the output into emission strength, and there you go.

Thanks for the specific answer, I'll try that. One follow up question, is it possible to store / export that animation as glb file? Or do I need to bake the highlighting in every keyfame somehow?

@hans1 I’m not sure.

Okay thanks @TheLabCat


text:
Move instance to world origin using geometry node
I want to move an instance to the world origin using a geometry node, but it doesn't work,
Conversely, when I try to move the sphere to the instance origin it works. Why is this?

It is always a question of the reference point, and this is in your case always the origin of the object, which contains the Geometry Nodes modifier.
Since version 3.4 there is the node Self Object, which in combination with Object Info (set to Original) outputs the position of this object in world coordinates.

With this information you can move the geometry relative to it:


text:
One separate object affect another one when u want to edit
I separated two objects and selected them both in edit mode, but when I want to modify one to move it or something like that, the other one also moves... I don't know what the problem is.In the image you can see when I move the object on z the other one also deforms..

Hello and welcome. Rather than take photos of your monitor post actual screenshots instead, see How to take a screenshot. Photos are harder to read because we have to look past external interferences (like reflections, smudges or Moiré patterns) and guess if we are looking at hardware issues such as a malfunctioning display or connections, a software level issue like driver malfunction or glitch, or actual artifacts or issues with the model itself.

The problem is that your Proportional Editing option is activated:

Omg man! Thanks so much. You save my day:)


text:
My procedural pool tile texture strectches quite a bit on the pool walls
I hope I don't cause any inconveniences but I've been having quite the trouble applying a procedural pool tile texture to my pool in a blender project, let me provide an image:

I've tried to uv unwrap the texture by adding seams and rotating it, moving it, etc. But nothing has worked out so far, it's also worth mentioning that the Texture Coordinate node has its object coordinate connected to a noise and brick texture node, does anyone know how to fix it?

Hello could you please share your object or at least show a screenshot of your Shader Editor? https://blend-exchange.com/

Connect the UV texture coordinate to the noise and brick textures (instead of object) so it will use your UV map to map them to your object. (Object uses object coordinates which are 3D - brick texture is 2D - this is why the texture is stretching with object coordinates - UV map is also 2D so it will work with the brick texture nicely).


text:
Importing SVG as Grease Pencil Layer with Blender Python API
From what I've gathered, if my objective is to import an SVG file as a Grease Pencil layer in Blender, one viable strategy seems to be importing the SVG as curves first, then making subsequent modifications to simulate the functionality available through the user interface:
bpy.ops.import_curve.svg(filepath='', filter_glob='*.svg')

Alternatively, I could potentially create an addon that activates this corresponding C code which is available in the Blender source on GitHub:
https://github.com/blender/blender/blob/main/source/blender/editors/io/io_gpencil_import.cc
I'm curious though, are these two methods the only pathways to replicate the UI-based import operation through scripting? I'm open to any insights or alternative suggestions.

https://docs.blender.org/api/current/bpy.ops.object.html#bpy.ops.object.convert
convert to grease pencil
bpy.ops.gpencil.convert(target='GPENCIL')

Hi, thanks for the post. This site is not a regular forum, answers should be substantial, stand on their own, and thoroughly explain the solution and required steps. One liners and short tips rarely make for a good answer. If you can [edit] your post and provide some more details about the procedure and how it works, perhaps add a few images illustrating some steps and final result. See How to write a good answer?, otherwise it may be converted to a comment.


text:
How to delete unwanted/unused parts of texture?
I've used photogrammetry to scan two objects.
The texture that was generated has tiny patches of unconnected faces of both objects all mixed up together. These patches make up the texture for both of the objects, which is a single (and huge) image.
Using Blender, I am trying to reduce the texture file size by deleting the parts of the texture that correspond to the texture of the 1st object and keeping the parts of the texture that correspond to the texture of the 2nd object.
How can I do this?
I tried, while the whole object is selected in "Edit Mode", going into "UV Editing" Tab and under "UV" clicking "Unwrap" which does select exclusively the faces on the Texture that I want to keep.
As I said, I do not know how to cut out these faces and discard the rest, or restructure these selected areas on the texture to create a smaller texture.

It sounds as if you want to unwrap the 2nd object on its own, into a new UV map, with a suitably sized and format of blank image,  and bake the texture into it, with the new map and image active.

Hi Robin, thanks for your comment. I tried to search for "unwrapping into a new UV map" or "baking texture" and couldn't come up with something sufficiently explanatory. Could you direct me to some links or resources on how to do the things you outline?

For anyone else who doesn't understand the lingo of "unwrapping" and "baking" or how to accomplish doing these operations in Blender (like me 2 months ago) hopefully this will help:
Check out these tutorials:

Bake Textures From one UV Map to Another UV Map (Blender Tutorial)
By: YouTube channel "Ryan King Art"

How to Unwrap and Bake Textures in Blender 2.8, 2.9, 3.0, 3.1, and 3.2?
By: "One Wheel Studio"

Bake Multiple Materials to One Texture Map (Blender Tutorial)
By: "Ryan King Art"

I myself had to perform such operation in Blender, where I received a cropped .obj mesh as input which was referencing a texture file that contained extraneous data that was no longer needed in the cropped mesh. To decrease the size of the texture file such that it contained only the needed textures, I followed the above tutorials. In the process, I wrote down the steps I took in the Blender GUI to accomplish the Texture Unwrapping and Baking task, as well as automated the laborious process by using the Blender Python API. In case it helps, the detailed steps I took and their Python counterparts can be found in this Github repo file which I reproduce below in case the link breaks.

Also, link to a similar question: How to remove unreferenced UV Coordinates from a Texture
Steps for using the Blender GUI for creating (i.e. baking) a texture map
from a textured 3D obj model. The steps were created from following tutorials.

Begin by importing your obj file, delete default cube, then open 3 windows/editors inside Blender by hovering mouse over bottom black line, right click, 'split view': a) Open UV editor, b) shader editor, and c) "normal" view (not render, to save RAM)

Select your object and click Object data properties tab on right.

Open UV Map menu on right, Create new UV map called uv map 2

Open Object Data Properties tab on right > UV Maps > Click on UV Map 2

Go to Edit Mode (tab)

With UV map 2 selected: UV smart unwrap with island padding of 0.001

Inspect and check that UV map 2 doesn't have overlapping triangles
ctrl+p to re-pack islands?, if they dont fill up the image?

In shader view, to create new node: shift+a > search > image texture >
new > name: test_texture (4096 x 4096) (Reqs 7-9 GB RAM). Maybe
try something smaller like 2K (2048x2048) (reqs 4-6 GB RAM during baking)

In shader view, shift+a > search > uv map > connect "UV" to
"vector" of test_texture node
After connecting, Select uv map 2 from the drop down menu of the uv map node

In shader view, create another uv map > connect it to existing texture,
and select the exisiting UV map from the drop down menu to show blender
that the current texture uses the current uv map. At this point, there
should be 3 new nodes in the shader view

Repeat above steps 8-10 for each of the materials (the active material
can be selected on the right from the  material properties tab)

On right, select render tab > Render Engine: Cycles

For max samples select 10 and 10 for viewport and renderer.

Click bake dropdown panel > diffuse. Uncheck boxes direct & indirect light.

In shader view, for each material, Select the new texture image node

Click Bake (being in Object Mode doesn't seem neccessary like in tutorial)
(Requires 5-6Gb RAM for 2k, 8-9GB RAM for 4k) Takes 10+ seconds

In shader view, for each material, attach the new texture image node to
the BDSF node in place of the previous UV map

Save baked texture: Image > Save As...

File > External Data > Pack Resources

File > External Data > Unpack Resources > Use Files in Current Directory (create if not found)

File > Export obj

Check that the new texture is specified in the outputted .mtl file

import bpy
import os
import sys

# Argument parsing assumes this file was called from terminal in this format:
# ./blender --background --python ~/Code/blender_code.py -- arg1 arg2 arg3
# "--" is Blender specific for passing in arguments (i.e. arg1, arg2, etc.) to Blender python scripts
# https://blender.stackexchange.com/questions/6817/how-to-pass-command-line-arguments-to-a-blender-python-script
args = sys.argv[sys.argv.index("--") + 1:]
print("ARGS:",args)
INPUT_PATH = args[0]
OUTPUT_PATH = args[1]
RESOLUTION = int(args[2])
print('Input Path:', INPUT_PATH)
print('Output Path:', OUTPUT_PATH)
print('Resolution:', RESOLUTION)
print()

input_path = INPUT_PATH
export_filepath = OUTPUT_PATH

# delete the default cube at blender startup
objs = bpy.data.objects
if 'Cube' in objs:
    objs.remove(objs["Cube"])

# Load obj
imported_object = bpy.ops.import_scene.obj(filepath=input_path)
obj = bpy.context.selected_objects[0]
print('Imported name: ', obj.name)
objs[obj.name].select_set(True) # obj should already be selected, but just in case
# sets our mesh to be active
bpy.context.view_layer.objects.active = objs[obj.name]

bpy.ops.object.mode_set(mode='EDIT') # Go to Edit mode
new_uv_map_name = 'UVMap_2'
obj.data.uv_layers.new(name=new_uv_map_name) # create and name new UV Map
# Set new UV map to active
bpy.data.meshes[obj.name].uv_layers[new_uv_map_name].active = True
# UV Unwrap the mesh textures
bpy.ops.uv.smart_project(angle_limit=1.15192, island_margin=0.001)

# Working in shader view now...
obj = bpy.context.active_object
# You can choose your texture size (This will be the baked image)
image_name = obj.name + '_BakedTexture'
img = bpy.data.images.new(image_name, RESOLUTION, RESOLUTION)

texture_node_name = 'Bake_node'
old_uv_map_node_name = 'UV1_node'
new_uv_map_node_name = 'UV2_node'

print("Creating nodes for each material...")
for mat in obj.data.materials:
    node_tree = mat.node_tree
    nodes = node_tree.nodes

    orig_img_tex_node = nodes['Image Texture']

    # Creates uv map node in shader view and sets its uv map to current uv map
    uv_map_node = nodes.new('ShaderNodeUVMap')
    uv_map_node.name = old_uv_map_node_name
    uv_map_node.uv_map = obj.data.uv_layers[0].name
    node_tree.links.new(uv_map_node.outputs['UV'], orig_img_tex_node.inputs['Vector'])

    # Create image texture node in shader view and sets its image
    texture_node = nodes.new('ShaderNodeTexImage') # Creates node in shader view
    texture_node.name = texture_node_name
    texture_node.select = True
    nodes.active = texture_node
    texture_node.image = img #Assign the image to the node

    # Creates another uv map node in shader view and sets its uv map to new uv map
    new_uv_map_node = nodes.new('ShaderNodeUVMap')
    new_uv_map_node.name = new_uv_map_node_name
    new_uv_map_node.uv_map = obj.data.uv_layers[new_uv_map_name].name
    node_tree.links.new(new_uv_map_node.outputs['UV'], texture_node.inputs['Vector'])

    # Make texture_node the only one selected. Make it active, as required for baking
    for n in nodes:
        n.select = False
    nodes[texture_node.name].select = True
    nodes.active = nodes[texture_node.name]

# Set render engine to cycles and set settings
# This changes things in the Render Properties tab on the right-hand-side (Camera icon)
bpy.context.scene.render.engine = 'CYCLES'
bpy.context.scene.cycles.samples =  10
bpy.context.scene.cycles.preview_samples = 10 # Takes a few seconds to update GUI
bpy.context.scene.cycles.bake_type = 'DIFFUSE'
bpy.context.scene.render.bake.use_pass_direct = False
bpy.context.scene.render.bake.use_pass_indirect = False

print("Baking...")
bpy.ops.object.bake(type='DIFFUSE', save_mode='EXTERNAL', filepath='/home/nitz/Downloads/8_8_22')

# This tells Blender what textures belong to the model during export
# In shader view, for each material, link new texture image node to BDSF node
# And delete the original image texture and old uv map nodes
for mat in obj.data.materials:
    node_tree = mat.node_tree
    nodes = node_tree.nodes

    texture_node = nodes[texture_node_name]
    old_texture_node = nodes['Image Texture']
    old_uv_map_node = nodes[old_uv_map_node_name]
    BSDF_node = nodes['Principled BSDF']

    # Link new texture node to model
    node_tree.links.new(texture_node.outputs['Color'], BSDF_node.inputs['Base Color'])

    # Delete old texture and uv map nodes
    nodes.remove(old_texture_node)
    nodes.remove(old_uv_map_node)

# Remove old UV Map layer, which essentially makes the new UV Map used during export
uv_textures = obj.data.uv_layers
uv_textures.remove(uv_textures['UVMap'])

output_dir = os.path.dirname(export_filepath)
print("OUTPUT PATH:", output_dir)
if not os.path.exists(output_dir):
    os.mkdir(output_dir)

# Textures will be saved to path where blender file is saved to.
# The saving of the blend file has no other purpose. File is deleted.
blend_file_name = 'temp.blend'
blend_file_path = os.path.join(output_dir, blend_file_name)
bpy.ops.wm.save_as_mainfile(filepath=blend_file_path)
# Packing and unpacking is used for exported files to include textures
bpy.data.images[image_name].pack()
bpy.ops.file.unpack_all(method='USE_ORIGINAL') # USE_ORIGINAL saves textures in curr dir
bpy.ops.export_scene.obj(filepath=export_filepath, path_mode='RELATIVE')
os.remove(blend_file_path) # remove temp blend file
print('Exported to:', export_filepath)
print('Finished! \nBlender quitting...')


text:
Lines appear volumetrics
I am using a Volume scatter node to get a foggy effect, but I get these lines showing up on the floor.

Try increasing the density in the volume nodes and the number of render samples until the lines and noise disappear.

I did that yet I still got the same lines


text:
How to make the color space gamma instead of linear? (for rendering)
I think by default that Blender uses the linear color space for rendering. How would I make it so that the renderers use gamma instead??

There seems to be a misunderstanding what color management does. Blender always renders in scene linear color space. The results can be transformed into another color space, e.g. to display it on your monitor. Gamma is not a color space though, perhaps you mean sRGB (IEC 61966-2-1:1999) which uses gamma correction? If your Display Device is set to sRGB and the View Transform to Standard then the sRGB Opto-Electronic Transfer Function (OETF) is used for the image that you're seeing / saving.

Maybe I should post a picture. I'm used to Unity Engine and that's what they refer to it as. Here's a picture for reference: https://docs.unity3d.com/uploads/Main/LinearRendering-LightingSphereLinearGamma.png


text:
Intersections in 3d model
How can I remove some intersections in my model?
They cause wrong slicing for my printer.
The model consists of a path curve and a profile curve.
I use the bevel in the path curve with the object the profile curve.
I use Blender 2.8.
Thanks.

In 2.82 builds there is a voxel remesher inside mesh tab, it can deal with intersections.

Thanks. Where can I find out the documentation for using it?

It's a development build, so not that much info: https://docs.blender.org/manual/en/dev/modeling/meshes/editing/retopology.html

Blender 2.81 adds support for the Voxel Remesh operator, which can efficiently get rid of intersecting geometry such as meshes generated by tightly turning or self-intersecting beveled curves, for example this one:

The step by step process goes like this:

Ensure that the endpoints are capped - you can manually add faces later but since you are using a profile curve anyway, it's easy to add caps right here:

Convert the curve to mesh: Object -> Convert to -> Mesh From Curve/Surf/Meta/Text.

Press F3 (operator search) -> type "Voxel Remesh"

The result should now be something like this. Note that there are visible "welds" because the voxel resolution is not too big.

To adjust the parameters for the voxels, select the mesh, enter sculpt mode,

Then on the properties window adjust the settings for the remesh operation.

You need to increase the curve's radius or decrease the radius of the bevel object. In short, the second one cannot be bigger than the first. An alternative is to make the curve with bezier curves and extrude it (Extrude in Curve Geometry tab).To convert it to mesh, and extrude+scale. Add bevel to round.

I know it :) But I cannot do it! If I do it the geometry of my model will change. It will be wrong for me... Is there another way?