text:
Can I change entire scene scale?
Let's say I created some objects without regard to their actual size. Is there a way to set the scale of the scene such that nothing actually changes other than what blender considers the size to be?
For example I drew a plane that was 3.1 x 3.1 before I knew how to change units in blender. I set the units to Feet and it shows up as 3.1' x 3.1'. In the real world the the object I'm modelling is 10' x 10'. Is there a way to tell blender to make 3.1' to 10' and all other objects, cameras, lights, etc. all adjust the same way.
In Sketchup I can use the ruler tool to take a measurement then type in what that measurement should actually be and everything gets rescaled. Nothing changes visually in the model other than when I take measurements they correspond to the real world values.

1: Set Units
First you need to tell Blender what type of units you're going to use. In the "Outliner" which is normally in the top-right corner of the application, Select the "Scene" Node by clicking on it.
In the Properties toolbar (usually right under the Outliner) click on the "Scene" button which should be the third one from the left. It has a light, a sphere and a cylinder on the button.
In the "Units" section below you can choose from one of the predefined Units presets such as Centimeters, Feet, Inches, etc. Choose the appropriate one.
Make note of the "Unit Scale" input field. We'll come back to this later.

2: Measure your reference
To scale the image you'll need to know what the current length of a known point is. You can use the Ruler/Protractor tool by opening the Tools toolbar if not already open by hitting the T key, going to the "Grease Pencil" tab and clicking on the "Ruler/Protractor" button. Click and drag between two points to get a measurement. Hold the Ctrl key down as you drag to snap to vertices.
Another way is to turn on edge length. Hit the N key to open up the "Properties" region toolbar if not already open. Hit Tab to go into edit mode then look through the Properties region towards the bottom for a section labeled "Mesh Display" There will be a check box under the "Edge Info:" section labeled Length. If you enable this, you will see the length of each edge when you're in Edit Mode.
Let's assume the reference edge is 3.1" after we set the units and we want it to be 10'.
3: Adjust the scene unit scale

Now we can set the "Unit Scale" I said we'd come back to. Select the Scene in the Outliner, Click on the "Scene" button in the Properties toolbar and look under the "Units" section for "Units Scale".
In example image cube is scaled to dimension 3.1' To make Blender report the size as 10' can adjust the scene unit scale by multiplying it by 10 / 3.1. (Since the scale was unit in image above, didn't need to multiply)
If scene had non unit unit scale, say 3.3, and the dimension was 3.1' to adjust to 10' could have typed 3.3 * 10 / 3.1
Related answer

I'm trying to do it but there are things in blender that don't change with it like position in fcurves, would there be a way to "apply" the scene scale?

A simple solution, run in the Python console:
scale = 0.5
# change scale and location
[[setattr(obj, 'scale', obj.scale*scale), setattr(obj, 'location', obj.location*scale)] for obj in bpy.data.objects]

Maybe you also need to adjust the power of the light to get a more accurate illumination.
If you have Emptys in your object hierarchies, the scale change will get applied multiple times. To get around that, you can modify the above snippet to skip scaling the Emptys:
import bpy
scale = 0.5
# change scale and location
[setattr(obj, 'scale', obj.scale*scale) for obj in bpy.data.objects if obj.type != 'EMPTY']
[setattr(obj, 'location', obj.location*scale) for obj in bpy.data.objects]

It doesn't deal with scale in other settings like for example far and near clipping planes of cameras, distances in modifiers and many other properties.


text:
Pass values from python script to Blender and automate render(mp4) creation
I have a project in Blender that provokes a shape to move in certain ways based on two values (currently I manually change the values in the Python script in Blender and manually click to render to an MP4 file). The goal in mind is to have a web page that collects these two values and passes them into Blender to render a video (MP4) and write it out to a certain location. Essentially I want to automate the render upon the opening of this particular blender file.
I am relatively new to Blender, but I did notice that when I move my cursor over each setting, Python code is displayed. I have been trying to reference that code and the online documentation to auto-render, but I not having any luck.
The command shown to render is bpy.ops.render.opengl(animation=True). However, I am confused on where I would need to place this line of code to initiate the render. I have a python script that will open up blender and my blender file, but I just need a little guidance on how to pull off this next process.

It doesn't matter where you put the render line, of course everything should be set before you render.  Have a look at this answer,  I think it is exactly what you need https://blender.stackexchange.com/questions/6817/how-to-pass-command-line-arguments-to-a-blender-python-script

Thanks WhatAMesh, that did the trick. (thanks Duarte Farrajota Ramos as well)

source: Stack Exchange

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

sort: votes


text:
Calling Blender from Python, local machine vs Server; Unable to find pixel format
I have a python script that calls blender, my blender file, a python program performed in Blender, and 2 variables passed into the python script in blender.
The command looks like this.
subprocess.call(blender + ' ' + blenderFile + ' -P ' + ballSpinScript + ' -- ' + time + ' ' + efficiency)

I have confirmed that the variables all contain the correct paths. The discrepancy is occurring when I run on my local machine vs running on a server. On my machine it runs great. However, I have copied all the files over to a given server and it still runs but it takes much longer and outputs a warning that I am unsure of how to fix.
The warning is "Warning! Unable to find a pixel format that supports WGL_SWAP_COPY_ARB. Substituting one that uses WGL_SWAP_EXCHANGE_ARB.
I am not 100% sure if this is the issue (reason for the increased time to process), but it the only difference I am finding when the process is run.

Do you need blender to be visualized on the server? If not you can use -b or --background (background) that may solve your issue

Yes because it will be an internal web tool. I have tried -b and --background and the issue with that is the following command cannot execute to create the mp4 if running in background..bpy.ops.render.opengl(animation=True)

I don't want to rehash an old question I had, but my ultimate goal is to be able to input two values from my php script, that get passed into blender to render an mp4 file. I have the command worked out, but as mentioned above, blender doesn't seem to work with in the background if a render needs to occur. On my local machine it takes maybe 5 seconds, but on the server it takes closer to 30 seconds.

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


text:
Removing Alpha Channel in Node Editor
five month old newbie who's having some fun, here. I've been experimenting a bit, and got a problem. I was following this tutorial
from Zacharias Reinhardt on how to create massive background forests via alpha channels.
Seems to me to be the best method there is, if you're aiming for not too much processing.
https://www.youtube.com/watch?v=BtUS8QTsVZA
And then I got stuck in the node editor when removing the black alpha channel part of the png.
I'm 99% certain I did everything exactly like Zacharias showed in the tutorial,
but somehow, I'm getting a somewhat different result? And yes, RGBA was selected during export of the original file.
I've added a screenshot of the section in the tutorial and a screenshot
of what I've got on my screen. Any help would be greatly appreciated! :)

Kind of hard to know what is wrong without the .blend file. Maybe try changing the color of the Transparent BSDF with the Alpha channel turned to 0 instead of 1

Hey WhatAMesh,
my previous setup was from a saved template, so I redid everything from factory settings, only enabling the NodeWrangler and Image from Planes addon and got it to work. Thanks for the help. :)

Hey cegaton,
thanks a lot for the link.
I'd exported everything as RGBA, and instead of drag/drop, used the Import Images as Planes addon this time and made sure enable "Use Alpha".
This time it worked, but once I switched to Cycles Render it went completely white. So I started in Cycles and then it worked. And using Shift+Ctrl+Alt+C, I reset the origin/pivot point, so everything's working now again!
(Still learning my way around SEs posting stuff. Pardon that.)

To help troubleshooting, add an emission node and set it as alpha channel viewer, because it looks like there is an uncorrect alpha channel.
An useful shortcut for this procedure is to enable the Node Wrangler Add-on and Shift Ctrl click on a node a couple of times to temporarily view its output values.

Also checking the image in a 2D app (Gimp, Photoshop) could help, because the Blender setup looks correct.

Hey Josh,
thanks. I added the emission and I'm seeing exactly what you're having. I got it to work with cegaton's help. Much appreciated! :)


text:
How to Drive Particles with Global Scaling
Below is an image of a simple particle system. As I move the particle system along the Y-axis the particles retain their global Y position.

This is all well and good and I believe it is the default behavior for such particles, however, I have come across a situation where I need a similar behavior but for scaling.
Below is an image of a similar test, but for scaling. You will notice that all the particles change size, and to the same size:

I am currently changing the size using the following "size" parameter in the "render" section of the particles tab:

Basically, I want to affect the particle size, but only for the current particles that are being spawned, after spawning the particle it should retain its size until it is killed.
I have searched the internet far and wide and either there are no good answers about this subject or I simply do not know the correct terms to search. I have dealt with similar workings in game engines and usually, this behavior is called "world transform scaling" because after being spawned the scale is not affected by the emitter.
Thank you for your help.

Could try this workaround https://blender.stackexchange.com/a/108683/15543

This is a limitation of the current particle system in the blender. With texture, you can control the particle size ONLY with respect to the location e.g with blend texture you can make them bigger from where they are starting and smaller at the end location.


text:
.Problem with randomization of Instances in a Repeat Zone
Hello everyone, my project is still to animate a growth of branches on a trunk and other branches on the firsts and so on…
I want to randomize the position of the branches to do so, in the Groupe Node called Branches, I use two opposite branches in a collection. I measure the Domaine Size, subtract one and put this value in the Max Value socket of a Random node, then use it as the Instances Index of a Instances on Points.
What’s puzzle me is that’s working well on the first pass of the Repeat Zone but not on the second iteration: It change of orientation constantly during the growth.

Thank you for your help.

Since your Random Value is inside your Repeat Zone, it will be recalculated at each frame. One possibility would be to save this random value as an attribute when creating a new branch.

Thanks Lutzi I, will try that.

@Lutzi I don't see How to do that... Could you be more explicit? Thank you.

I'm having a hard time understanding and adapting your blend file. Problem is, at each frame you recalculate everything (including Random Value), where this random pick of branch should be unique and for example computed at first frame. Maybe use a Noise Texture to get a unique value based on position ? Here is an example (only works the second generation of branches) https://blend-exchange.com/b/g5AwjPJX/.

@Lutzi it work with the second generation , the third and so on... I didn't know this technique, I think it's a good way to do things. Thanks a lot.

My pleasure. The idea is to be sure this random value doesn't change. After a bit more thoughts, I would recommend using a White Noise Texture instead (infinitely fine noise texture). Also, now in Blender 4.1 you can display attributes in the viewport. Super useful.

@Lutzi switch the plug to color it work even with the first generation (it's position after all). thanks again Lutzi.


text:
How do I create three curved boards on the back part of the chair?
How do I create three curved boards on the back part of the chair?

Hello and welcome, can you elaborate more. For me it looks like 3 rectangles that can be easily add to your scene and adjust the height and thickness

Hello and welcome. Please use a title that matches the content of the post. It should read like a question, be descriptive but succinct, unique and identifying, summarizing the problem so that anyone searching for similar issues is likely to find this. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing visitors see, answers you get depend heavily on it. See What is the problem of asking “How do I do this?"

The trick to getting this slight curve might be proportional editing.  Those parts are called rails.

Add edge loops to the back posts ( hover over geometry and press control + r and roll the middle mouse button)

Delete the faces where you want the top and cross rails (3 curve parts) of the chair.

Bridge the edge loops to create the rails.  Press F3 to search 'Bridge Edge Loops'.

Add edge loops to the rails ( hover over geometry and press control + r and roll the middle mouse button)

5.turn on proportional editing at the very top of the Blender interface(shortcut: O) and switch it to 'Sphere'

Select the middle edge loops of the chair and drag them until you get a nice curve. Lock it to an axis. (G + X,Y or Z)

You can change the size of the sphere by rolling the middle mouse after making a selection.

Thank you so much man. Very detailed explanation. I didn't get the second step tho. and my chair looks kinda weird atm. like the middle tile under the 3d parts gets curved with it and it feels like the middle 4 edge that I selected and moved are mostly being curved rather than all the other parts curving smoothly. I did make sure to enable proportional editing tho

I think I understand.  When you add edge loops you have to be careful to make everything symmetrical.  You have to watch carefully that everything will line up when you go to step 2.

Also, I would say I am missing one thing in the final step, number 6.  When you select a part of the geometry, you can press G + X, Y or Z to lock your translation along an axis.

Yeh I did lock it to a specific axis. I still don't understand step 2 tho. Everything is symmetrical since I didn't really change the location of the loop cuts.

You can see from the diagram, I added a couple of vertical loop cuts to the back posts, maybe that is what you are noticing so that the rails would sit more in the middle.  It wasn't necessary, but I thought it looked better.

Hmm okay. But still your curve is much more smooth than what mine turns out. Any idea how to fix that? mine feels like only the middle part is being curved

Add loopcuts to the rails.  Also, if you follow this technique, you can apply modifiers to the finished chair, bevel and subdivision, to slightly round all the edges.

I have updated the images.

To do the rails? The 3 curved? I did add loop cuts but it doesn't look good. lemme send you a picture. https://postimg.cc/z3JV1BsZ check this link out

Patience, you've almost got it.  Use your mouse wheel to adjust the area affected by the proportional editing and make it slightly larger.  If you have another question, it should be a new question.

(Also, I noted that you did not switch proportional editing  to "sphere" in the image.)


text:
Texture output problem

I want to export the vrm model with texture to fbx or other format. But I found that the exported texture in texture file is not matched.
As photo1, the texture when I import the vrm have a (instance). When I use the editing and click on the texture(instance) , I found that there is another slot show some of the png are grouped to form a texture(instance).
And that when I change to fbx or even .blend, the texture could not be showed.
Is there any way to let the export model in fbx or .blend have correct texture showing?

.fbx export why there are no materials or textures


text:
spiral slide with geo nodes
I'm trying to make a spiral slide with geometry nodes.
I've been able to do what I want with Instance on Points, but I cannot find a way to extrude from each instance or similar. I've used Align to Euler to achieve the arc pointing downwards.
It seems I should use  Curve to Mesh, but then I cannot use the Euler approach.
I've made an example to visually show how far I am so far.
I'm on Blender 3.2.1

Why not use Curve to Mesh directly on the curve you are instancing over instead, using a semi-circle section?

When using the Curve to Mesh on the Spiral I can't control the rotation, at least not with what I know about geonodes.

You don't need to,  Curve to Mesh  always orients your profile perpendicularly to the curve without manual intervention

It might be that I don't understand fully.. but when I use Curve to Mesh, it rotates like this: https://media.giphy.com/media/Yu9FkLqNqVoDBbsw7t/giphy.gif

https://imgur.com/a/veLP0yy simplified geo node example for clarification :)

Sounds like the XY Problem, that is probably what you should have been asking about in the first place. See https://blender.stackexchange.com/questions/49265/how-to-edit-curve-but-not-ruined-tilt-settings/ or https://blender.stackexchange.com/questions/71787/object-on-curve-wont-stay-flat/ https://blender.stackexchange.com/questions/35771/why-does-a-bezier-curve-twist-when-rotated

What you need to use here is the set curve tilt node. However, still struggling myself on where to pull the correct tilt from, as this has to be procedurally modified along the spiral curve

To align the tilt of the curve upwards, you can use the following node setup:

This calculates an angle from the values for normals, curve tangents and the up vector, which is plugged directly into the node Set Curve Tilt.

how did you figure out the formula on how to calculate the tilt?

Looking forward to trying this! Have left my computer for today but will try tomorrow - and yes, how did you get to this beautiful formula? Usually I can mess around and fond a suitable solution, but this is above my head

nothing but amazing - thanks!

You can get over the tilt problem by constructing the spiral in the flat, capturing the spiral's Parameter or Length, converting to a mesh, and then setting the height as a function of the captured attribute:

Or... you can do it properly :)


text:
How to get tag/description of an asset that's placed in a scene using python
From this question, I understand to set a tag of an asset we need to open the Blend file.
How to add/edit tag of an asset from another asset library using python (add-on)?
But can we get / access a tag of an asset when it's placed/instanced in a scene?
I tried this simple code on object named "Foo" and it return the description if we do it from the asset blend file. But it's not working when the asset is placed in another blend file
import bpy

for coll in bpy.data.collections:
    if (coll.name == "Foo"):
        print (coll.asset_data.description)

bpy.data.materials['Material'].asset_data.tags.new('Material Tag')

Seriously? If the answer contributes to the solution, you will receive a prize for the shortest answer ever given here on Blender SE. ;-) It would definitely help if you could explain a little more about this so others can better understand why this works, right?


text:
Assigning material from Asset Browser using Python

I've created several materials, mark them as asset and group them in a catalog.
How do I iterate and assign these material from asset browser to an active object using Python?
Later on I would like to render the objects one by one after changing the material, hence the need to iterate on these materials.

I do not unfortunately have an answer, but I am having the same issue. Did you find a solution to it?

There seems to be limited documentation on how to access the Asset Browser via Python, but I found that you can access the asset_data property (of type bpy.types.AssetMetaData) on objects and materials to get information about their location in the Asset Browser. Here's a simple script that iterates over all the materials contained within the catalog named "Color Library" in the Asset Browser and assigns each material one at a time to the selected object and does a render. The rendered images will be named render_(material-name).png and be stored in the path specified by the directory variable.
import bpy
import os

directory = r'/path/to/render_directory/' #example: r'C:\Users\xxxx\Desktop'
scene = bpy.context.scene
o = bpy.context.object

def render(image_name):
    #scene.frame_current = 1
    #scene.frame_set(1)
    scene.render.filepath = os.path.join(directory, f'{image_name}')
    scene.render.image_settings.file_format = 'PNG'
    print("rendering file:", scene.render.filepath)
    bpy.ops.render.render(animation=False, write_still=True)

def iterate_asset_browser_and_render():
    for m in bpy.data.materials:
        data = m.asset_data
        if not data or not data.catalog_simple_name.startswith('Color Library'):
            continue
        if not o.material_slots:
            o.data.materials.append(None)
        o.data.materials[0] = m
        render(f"render_{m.name}.png")

iterate_asset_browser_and_render()


text:
Need some modelling advice for my University Final Major Project

I'm new to blender, I'm working on a 3D animation for my Final Major project at University. I've provided a sketch of one of the characters which will be a humanoid robot, also I attached an AI-generated render I made from my sketch using Stable Diffusion. I'll be doing more detailed full-body sketches for the character, but for now, I want to experiment with modelling just the head for learning and I can use it for part of the research and experimentation for my project report. I picture his head being hollow and then you'll be able to see through the spaces between the abstract shapes, I also imagine when looking at the side of the head you'll see a circular hole with a turning gyroscope inside, like a brain.
I've got a bunch of 3D design experience, mostly C4D/Redshift, some Maya, quite comfortable with hard surface modelling techniques. Although I've not attempted modelling a character like this before, I'm mostly wondering about how I'm going to create all the fragmented shapes and form a human-shaped head from them. At the moment I'm going through the donut tutorial for Blender, but soon I would like to start attempting to model this. I would really appreciate some advice on some good 3D modelling approaches to create a character like this.
Thank you for your time.
Nat

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

Hello and welcome. As it stands this question is too broad to be answerable without requiring an extensive tutorial or description. You should show efforts towards reaching your goal, describing what you have tried and why it failed, so we don't risk recommending something you already know. The scope should also focus on a particular step you encountered an issue with. Describing the whole procedure from start to finish would be too lengthy to explain, and is beyond the goal of this site. If you could [edit] your post to focus on where you are stuck we can vote to reopen it.

alternatively you can ask about it at Blender Artists Forum

Select all the edge loops where you want a separation and press VEnter to rip:

Then select all and in the Transform Pivot Point panel select Individual Origins:

Scale down, it will scale all the different parts individually:

Give your object a Solidify modifier to give it thickness:

You can also give it a Subdivision Surface modifier, in that case it will need additional edge loops to keep the edges sharp:


text:
Repairing file for 3D printing
I'm trying to get the this  file 3D printed, but got the following feedback from a service:

1.The wall thickness of the whole part is too thin which has a high risk of crack, loss and deformation. Could you please kindly increase
it to be at least 2.0mm to proceed?
2.The part is hollow in the middle, there is risk of collapse. Please add support rails for the part, and the thickness of the support rails
should be at least.
3.There should be some escape holes add to the hollow part,otherwise the excess materials will stuck inside the part
4.There are some bad edges and errors need to be fixed in your file. Could you please kindly modify and repair the file so that we can
proceed?

I've tried to look into Blender's 3D Print and choosing Make Manifold, but that seems to sort of remove the entire model.
Any feedback, ideas, comments on how to the most easy fix the file for 3D printing is very much appreciated, without needing to manual model the object.

Hello and welcome. While files, images, and external videos or links may be helpful additions they should not be the only way to obtain information about your issue. Don't make understanding your question rely on downloading a file, watching a video or visiting an external site. Use the builtin tools to upload images or gifs, along with thoroughly explaining the problem in written form so it can be indexed and searched for thus helping future visitors with similar issues.

A good video that explains the 3D print toolbox and how to fix the issues it finds can be found here https://youtu.be/0rgrLWFUjlk


text:
Export UV Seams
I'm trying to export this object from an old file in blender because the viewport is messed up.
When I export the object to FBX to a new Blender file The UV seams won't export it's just fresh mesh with no seams is there a way to bring the seams back the seams to the object?

If you Append your mesh from the faulty blend file into your new one (File > Append... and select the correct object in the Mesh folder) the seams should be preserved. Alternatively, if it's just the viewport messed up, you can use File > Open in a new blend file, hit the 'N' key in the file selector, uncheck 'Load UI' and load your dud blend file preserving the standard layout.

Thank you very much that was very helpfull

Did it cure the problem for you? - I should have added that Blender's seams are native to blender and will never be kept if you export to any of the file formats such as fbx.

Yes it did, you are an angel sir.

Not sure about that, but thanks anyway! :^)


text:
Modeling, set to parent or joining objects?
I had a hard time deciding whether should I join these pieces to the barrel mesh or just use set to parent.
Also if anyone can explain the difference why should someone use one of these.

if you have no reason not to join, like for example the barrel has a modifier that you don't want to give to your rings, then join

https://blender.stackexchange.com/questions/123255/should-i-join-or-parent https://blender.stackexchange.com/questions/184033/should-objects-added-in-edit-mode-be-merged-together-or-can-they-exist-as-separa https://blender.stackexchange.com/questions/14482/what-are-the-benefits-of-modeling-in-one-piece-or-as-separate-parts


text:
Change EEVEE volumetric sampling limits
I'm trying to minimize artifacts in EEVEE and I want to change EEVEE volumetric sample and shadow sample limits beyond the cap, is there a Python solution for this?

There is not a Python solution for this.  The cap is set in C code in rna_scene.c at line 7066 and is enforced in C code.  You would have to recompile Blender to change the value.


text:
Method for baking Material displacement to mesh
I saw this method (see fb link for video) for creating rocks/cliffs using material displacement but am wondering if there is a way to convert this to a mesh?
From what I've read, it sounds like there is no direct method, but it would be possible if the metaballs in this example were baked to mesh and UV'd?
https://www.facebook.com/watch/?v=1017363692395438

Hello and welcome. While files, images, and external videos or links may be helpful additions they should not be the only way to obtain information about your issue. Don't make understanding your question rely on downloading a file, watching a video or visiting an external site. Use the builtin tools to upload images or gifs, along with thoroughly explaining the problem in written form so it can be indexed and searched for thus helping future visitors with similar issues.

Instead of using the Displacement node, simply use the Displace modifier and apply the modifier.

Thanks, yes I'm playing with that but it appears to not be as robust? Maybe I'm missing something but the Shader Displacement system allows a node structure to more deeply modify the noise (mixing multiple noises etc), but the Displace Modifier only takes 1 texture. Happy to be corrected on this.

Yes you'll need to bake the b&w map that you've created


text:
Send blend file with vdb
I have a blend file set up with vdb clouds.
Now I want to send it to someone.
However, even though I packed the file and sent it, the vdb is not showing on viewport. It is appearing in the outliner.
On top of that, I also tried to send the vdb separately, and then gave the path of the vdb in the object data properties in Properties panel.

What is the proper way to send a blend file with vdb or better if access the vdb data when you send the file

Blender can pack only images and audio, but not movie or vdb files. What you see in Outliner is "only" an object (container) storing vdb external data. Your second options should work - send .blend file adn .vdb files. Receiver has to update (correct) path to actual location of .vdb files at his directory ... File > External Data > Find missing files ... or if you store .vdb files next to .blend file the path can be relative, so there is not a full path just double slash ... something like this //VDB/cloud###.vdb so receiver doesn't has to change path.


text:
Change FPS rate of particle simulation
I am trying to do a particle simulation at 120 fps because I want some slo-mo shots. But I have noticed the changing BLender's fps rate does not change the simulation. I believe it is still being done in 24 fps. Is there any way in which it can be done?


text:
Is it possible to make multiple camera solvers for motion tracking in one project?
I have a video with many switching angles on one object. Sometimes the object should be outside the camera view. I need to have at least 5 camera trackings to properly insert this object into the video.
I've tried many ways to do that, but it doesn't work in any, it always breaks on the fact that it looks like Blender has motion tracking and a camera solver as a single global instance, even between the scenes, rendering making several cameras having separate solvers or at least one camera having multiple seem impossible.
Please, help with that, is there any possible workaround?
Important: making multiple projects is highly undesirable, the object has its own animation and effects, and copying that over 5 different projects on every slight change would be pretty unreliable.

So, I haven't found an exactly elegant solution, but this one works kind of well.

Copy your project
Open it
Make all the motion tracking for one of the camera angles you need
Select your camera you've assigned motion tracking to
Export it as alembic .abc, make sure you are exporting only the selected object
Import the exported alembic file back to the original project
Repeat for every camera angle on your scene

This will keep a camera motion on the exported cameras without the need to use camera solver
After that you will just need to switch cameras on every angle and will have all the motions set in one single project


text:
When I start rendering, all objects are transparent
I have just downloaded blender and installed it on my PC, as soon as I open it, if I try to render with the default scene, I get an unusual result. Are there any specific settings to render even such a trivial rendering?

Make sure  your graphics drivers are up to date.

I solved the problem by changing the setting on the rendering engine in the render properties section of the scene.
By default it is set to "Eevee", by choosing a different one, the render works.

If the problem only happens in EEVEE, then I still suspect the problem may be GPU/driver related. Do you have an AMD GPU by any chance?

Yes this is my graphic cads specs:
GPU - AMD Radeon HD 7700 Series
VRAM - 2048 MB - GDDR5 1125 MHz
Graphics Chipset - AMD Radeon HD 7700 Series
SubSystem ID - 7750
SubSystem Vendor ID - 1545
Usable Memory Size - 2048 MB
Memory Type - GDDR5
Memory Clock - 1125 MHz
Core Clock - 800 MHz
Total Memory Bandwidth - 72 GByte/s
Memory Bit Rate - 4.50 Gbps
OpenGL® API Version - 4.6
OpenCL™ API Version - 1.2

I solved the problem by changing the setting on the rendering engine in the render properties section of the scene.
By default it is set to "Eevee", by choosing a different one, the render works.


text:
Why can't I zoom in further, and why doesn't applying the scale work?
I'm a total noob and following this beginners tutorial. My aim is developing some smooth models to print in my 3D-printer (which is impossible with Tinkercad which I've been using up until now). At this point in the tutorial he says I need to "apply the scale" and he shows how I should do it. Unfortunately it doesn't work for me. I recorded a short screencast to show what's happening here: https://www.youtube.com/watch?v=T25aDFLxuhc
Does anybody know what I'm doing wrong? Why can't I apply the scale and why can't I zoom in further?

It didn't work because the object wasn't selected...

for the zoom question, maybe check this answer: https://blender.stackexchange.com/questions/644/why-does-the-zoom-sometimes-stop-at-a-point

..and to add to what @AlexandreMarcati said, the object wasn't selected (as you can see on the missing orange outline) and you might wonder why the scale values are shown: the properties show the values of the last selected object until you select a different one.

It looks like that torus is currently the active object (you're operating on it) but it's not selected in the viewport.  Things can be the active object, but no longer selected, if that makes sense.  Click on it and it should get the orange outline that means it's selected, and then Ctrl + A -> Apply Scale should work.
As for the viewport zoom, you had moved the view around at some time in the past and now you've zoomed all the way in to the view plane.  When your object is selected you can press Numpad . to center view on the torus.

Awesome, thanks!


text:
Add a filter of import (filter_glob) for specific filenames (foo.dat;me.dat and nothing else) in file browser
My question is complete enough, here is my current code but it has a breach, I want to patch it and make it only shows files that are exactly "main.dat", "assetlookup.dat" and "debug.dat"
Thanks :)
    filename_ext = ".dat"
    filter_glob: bpy.props.StringProperty(
        default="main.dat;assetlookup.dat;debug.dat",
        options={"HIDDEN"}
    )

https://developer.blender.org/T81208

Hmmm... I checked and it does not answer. It just reports a bug which has no valid answer

According to the bug report, it broke in 2.90 and has not been fixed yet.

It's annoying, I have to proceed mandatorily like this then: *main.dat;*assetlookup.dat;*debug.dat


text:
Automatically apply Matrices4x4 transform on Objects
I'm working on a reverse-engineering tool, it extracts maps from a game, and the game actually stores the positions of objects instances using Matrices4x4 transformation.
I would like to know how I can apply a transform to an object or to a group of objects. The best would be to make it work with my current code, of course, but in any case I can still rewrite some stuff, doesn't matters.
myMatrix = mathutils.Matrix(
    (0.0, 1.254, 68.14, 0.0),
    (0.01546, 1.254, 204.85468, 0.0),
    (0.45, 0.0, 0.0, 0.0),
    (204.154, 451.943, 345.456, 1.0)
)

name = 0
myCollection = bpy.data.collections.new("Custom Collection")
for i in range(randint(10, 200))
    verts = []  # Just imagine that there's a list of vertices tuple.
    faces = []  # Same, imagine there's a list of faces tuple.
    edges = []  # Empty. Ignore it
    meshdata = bpy.data.meshes.new(f"MyObjData_{str(name)}")
    meshdata.from_pydata(verts, edges, faces)
    obj = bpy.data.objects.new(name=f"MyObj_{str(name)}", object_data=meshdata)
    myCollection.objects.link(obj)
    # How do I set the position of my object using the matrix myMatrix ?

Does this answer your question? Apply transforms to linked objects? meshdata.transform(myMatrix)

Some are linked objects and some are basically just objects, does it still work ?

@MarkusvonBroady it's making an error, it says
meshdata.transform(tie_instance_matrix) TypeError: Mesh.transform(): error with argument 1, "matrix" -  expected sequence items of type float, not Vector

Resolved, problem was coming from me


text:
Blender 4.2 Eevee displacement is spliting the mesh
Im testing Eevee displacement in 4.2 and it seams that eevee creates gaps on the mesh, like as splitting the mesh where there are uv seams. This is happening with image textures and also with procedural textures as noise. Suzanne is shaded smooth with 125k faces. Whats wrong? Thanks in advance :-)
Eevee displacement splits the mesh


text:
Why is there a duplicate of a body when I i try moving vertices?
I have an issue with model here, when i try moving edge, there seems to be a duplicate of the model in the background as seen in video. What might be the reason. I have used mirror modifier for the central loop.
https://youtu.be/vllgXg8xpvk

If you have the Mirror modifier set to mirror the mesh on the X axis, everything that's on the positive X side will be replicated on the negative X and vice versa. So if you have one vertex on e.g. (1, 0, 0), it will be mirrored to (-1, 0, 0). If there already is a vertex in the original mesh it will not be replaced by the mirrored one but be mirrored itself to (1, 0, 0), which means you then have two duplicate vertices on (1, 0, 0) and two vertices on (-1, 0, 0).

And actually I don't understand what you mean by saying "I have used mirror modifier for the central loop." Usually the Mirror modifier is used to mirror vertices that are offset from the origin center on the according axis.

.. and following up... a quick fix would be to check 'Bisect' on the relevant axis, possibly with 'Flip', to mirror the side you want.

Thanks all of you. Playing with bisect and flip worked.


text:
How do I fill this Boolean hole? I have already applied Boolean operation

I made these holes on a curved part of the body using boolean and array modifiers. Both have been long applied which was my mistake. How do i fill these holes?

In Edit mode, go to Edge or Vertex mode and Alt-click on the edge of the face round the hole. That should select the whole rim and you can try using 'F' to fill the hole. You'll have to do this for each side of the object of course. Then use Mesh > Limited Dissolve to remove the extra edges that you no longer need.

Hi, Taif.  Please edit this question to show us the topology of your model, ideally from further out, so we can get context. Or better yet, share your file on https://blend-exchange.com/ , Without those, we really can't answer your case, specifically.

Thank you my friend for suggestion. I'm reworking on the model. Thanks.


text:
Why Shrink/Flatten tool does not close this side faces automatically?

I duplicate the required faces to be expanded. I used circle selection option. But when i expand the side faces, sides won't close. I follow a tutorial on which it closes properly.

hello, could you please link the tutorial you are referring to?

you need to extrude instead of duplicating your selection. Press E, right click to keep the faces in place then Alt S to inflate
https://i.sstatic.net/iB085.jpg


text:
I have these extra faces which needs deleting. Is there any solution to this?

I dissolved edges in top surface to made it plain, but i have these extra faces that are giving me hard time. I'm still learning basics.

Hello, could you please share your file? https://blend-exchange.com/

You have overlapping vertices or vertices that are not connected, you should first delete the bottom face:

Then select all and press M > Merge by Distance:

And select the bottom edge loop and fill again:

Seems like it's one big concave face not displaying correctly. Try to avoid having massively concave faces, because this happens with them. Maybe join some vertices near the problem with another parts of geometry:

You can use knife tool for that (k) or select vertices and hit j to join them by an edge.


text:
How do i make this into rounded extrusion in the first go?

Link for the Video:
https://youtu.be/g0UEIeX8Mvo
I'm new to blender. Is there an easy way to round the edge rather than g for extrude and ctrl b for rounding edge? It seems extrusion is coming off very sharply near edges.

You can use the subdivision surface modifier to achieve this result, but beveling wouldn't be a problem
On the left, the mesh has a subdivision surface modifier and on the right I just gave it the shape with bevels and added a bevel modifier on top to make the edges less sharp
1- without modifiers

2- with modifiers on

Thank you, there are so many ways, it just gets mixed up sometimes.


text:
I have street light emission parts group up into a single mesh, sharing same materials, how can i split these up so i can add point lights to each one

Here is an image of the street light emissive parts all joined up together as one mesh, how can i split these up so i can add point lights to each? When i do separate by loose parts, each one of the highlighted parts gets broken up to millions of pieces.

It sounds like each of those lights is made up of lots of individual shapes or 'loose parts', which is why using the option you described is going to give you an unwanted result. I cannot tell unless you upload and share your .blend file for us to look at, but it sounds like you may need to do them all separately.
You can do this by following similar steps as before. In Edit mode, deselect everything, then select just one of the lamps. Now press P and choose Selection. Just that one lamp will be separated. Repeat for all of them.
Alternatively, you'll need to go through and edit the meshes so that they're all just one solid object each, but this sounds like it'll be more labour-intensive if there truly is that many objects in each lamp.


text:
Batch changing materials in a scene

I would like to change all materials so that the base color "multiply" is actually set as an image texture that uses the texture set on Color1. I have a huge amount of materials and will take hours to change them all by hand. How can i do this?

This is the result i want.

Often one can change several objects parameters at once by using the Alt key.   However I'm not sure this is possible with material node inputs.  You may have to look at Python scripting, instead.

Having some fun with python today, I created a script that would add an image texture shader node (actually a node group containing the image texture) to any Material that has a Principled BSDF with an unconnected Base Color input.
If you're comfortable with python you can play around to perhaps only look at materials in objects in certain collections, or only selected objects, etc.
import bpy

###
###  add the existing group node 'ImageNodeGroup' to any Material node that has an un connected Base Color'input
###
for m in bpy.data.materials:
    if 'NoNo' in m.name:  # example skip criteria
        continue
    if m.node_tree != None:  # some materials may not have a shader node tree
        hasImageNodeGroup = False
        principledBSDF = None
        for n in m.node_tree.nodes:
            if n.type=='GROUP' and n.node_tree!=None:
                if n.node_tree.name == 'ImageNodeGroup':  # I renamed this to this name
                    print(m.name, 'has', n.node_tree.name, n.bl_idname )
                    hasImageNodeGroup = True
            if n.name == 'Principled BSDF':
                if len(n.inputs['Base Color'].links)==0: # unconnected: candidate
                    principledBSDF = n
        if (principledBSDF!=None and not hasImageNodeGroup):
            # add ImageNodeGroup to color input of hasPrincipledBSDF
            print( 'adding ImageNodeGroup to', m.name )
            sng = m.node_tree.nodes.new('ShaderNodeGroup')  # create a new group node for this material
            sng.node_tree = bpy.data.node_groups[ 'ImageNodeGroup' ] # have it use the group with the image texture
            m.node_tree.links.new( principledBSDF.inputs['Base Color'], sng.outputs['Color']) # link node input and output of interest

Here my example:   where you can do a Text::Run_Script in the script pane and check the materials for correct outcome.


text:
Artifacts when layering
I'm learning blender and ran into a problem. When applying layers, artifacts appear. Tell me how can I solve this problem? Thanks in advance for your replies and good luck everyone!

File path https://drive.google.com/file/d/1A4Em-9DBDJ-pfU_Ih3pEUFGAwg9o3_t4/view?usp=share_link

That's called Z-fighting and occurs because you have two faces in exactly the same position so that Blender doesn't know which to display. It's difficult to suggest a way to get over that here. You could possibly convert the curves to meshes and then boolean them together but that would still require some cleaning up of the mesh to get a good result.

i fixed it. I built the element from scratch and combined the details. thanks for the comment

authors: Николай Миров


text:
How can i select and move edge loop created by subdivision modifier before hitting apply button?
How can i select and move edge loops created by subdivision modifier before hitting apply button ?

The short answer is you cannot.

the bit longer answer is: you can - with geometry nodes ;)


text:
Is there a way to move the curve vertex on the mesh surface?

I drew a few curves on the surface of the mesh. Keeping the curve vertex on the mesh surface while moving it is challenging.
Is there a way to constrain the curve vertex on the mesh surface?

You can use the snap tool (snap to faces option)

Thanks. Can you be more specific? I don't know what exact it is.

You can enable the Snap (Face Project) option:

Thanks for sharing. I used this method and the process became smoothly.


text:
How to evenly space curve vertices?
I convert one edge of the mesh to a curve.
I want to distribute mesh on the curve by using curve modifier
but it won't space it evenly
because the curve vertices aren't evenly spaced.
How to fix that?

I don't know if it exists forcurves, you could convert to mesh, use LoopTools >Space, then convert to curve again?

https://blender.stackexchange.com/questions/47359/how-to-evenly-space-vertices-along-several-segments-bezier-curve

An alternative to try is to use Geometry Nodes to resample the curve:

Keep in mind you won't see the circles (spheres) in the preview, I added another geonodes tree afterwards for that.
You can't apply the geometry nodes modifier on the curve. But what you can do is select the object, ✲ CtrlA, G Visual Geometry to Mesh. Then F3 and search for convert curve.
The preview node tree (you want to disable it before applying the modifiers) used:

Enable the built-in addon called LoopTools via menu Edit > Preferences > Add-ons > LoopTools. You can evenly space your vertices in a mesh by selecting all vertices in Edit Mode and then right click or RMB > LoopTools > Space. If you have a curve, first convert it to mesh and then do the LoopTools > Space and convert back to curve.


text:
Why the vertex is still acting theweired even after I flip the normal to right

Has anyone encountered a similar issue where face orientation is unified, and normals are in the same direction, but it acts creepy when you try to bevel the vertex? Please help fix the problem.

please share your blend file https://blend-exchange.com. also try a to select all vertices then m > merge by distance

I am sorry; it was fixed automatically after merging the distance. I did that so many times, which didn't work out. But this morning. I open the file again and merge it again. it fixed.  I thought it was some normal issue. I had no idea that It was just a glitch.


text:
How do i rotate this object properly?

Apologies if this is a fairly common question. I want to rotate the wheel that is selected in the picture like how a regular wheel rotates. How do I adjust the gimble so that it lines up with the orientation of the wheel? Thanks.

Take a look at this thread https://blender.stackexchange.com/questions/105398/how-to-rotate-an-object-on-the-local-axis if if doesn't answer your question then, please, come back and edit your question to clarify the details of the problem.

There are also lots of YT videos on rigging wheel animation, for instance this one by Pixxo 3D. It's for Blender 2.83 but is the same in version 3


text:
Free Compositing video tutorials in blender
Where can I get indepth tutorials about compositing in blender for Free? Any channel I can get such videos about compositing in blender?

You can see some tutorials on YouTube in which there is wide use of compositing . These are some examples Blender guru earth tutorial
https://youtu.be/9Q8PwcDzb8Y CG geek city tutorial https://youtu.be/i4ySFm4ey9U


text:
Export image as Scalable Vector Graphic
Hello,
Does anyone know if there is a way to export grease pencil drawing as pdf or
some other non pixel format?

In blender render,
Goto>render settings
Tick>Freestyle
Then Tick>Freestyle SVG Export
Go back to>output
Choose a file to place your rendered work
Then hit>Render
Your SVG is ready at the specified output location
Additionally,
To prevent some object from rendering as SVG,
On the material tab, just click on Transparency

This only works in below 2.8 as the addon has not been made for 2.8

unfortunate, im using 2.8

@Gor It doesn't say that in the question. Please post concise questions with all the relevant information, to prevent others spending their time creating inapplicable answers.

There is now a better way to do this:

Simply select your grease pencil object in object mode

Go to File > Export > Grease Pencil as SVG or Grease Pencil as PDF


text:
UV Mapping exporting problem
i m making a body spray in blender & UV mapping it with my own design of JEPG formate . but when i try to export it for KEY SHOT or another software, only can model export but UV mapped image is not exporting, please help me

You have to save the image file separately in the UV Image editor.

Please describe little more , how to do this ?

Is your question actually how to export a textured model properly and import it in keyshot?

yes dear ......

https://i.sstatic.net/f7YMh.png

its not working , actually i m new user . please help me out . my whats app number is . +971 52 7833582


text:
Need help in Uv/image editor

Noob here, as you see i am trying to select area which i need to be applied to mesh not whole thing but no success, any suggestions?

Your question is a bit unclear. Could you please word it differently?

so i don't need white part as you can see on the left side not whole texture, i just want to have what  i have selected  on uv editor.

Looks like you have other UVs in there that do not show up in the UV-View because they are not selected. Those UVs might be lying outside of the area you want and so map the outside area. You could apply a different material to those verts.


text:
Dynamically adding/deleting foldable panels
I created a panel called "Platforms", which displays some information. In that panel, I have an "Add" operator, which creates expandable rows (which can all be individually deleted by pressing a "Delete" button). To do so, I wrote the following code
import bpy

def update_platform_side(self, context):
    if self.platform_side == "blue":
        context.scene.platform_panel_props.nblue += 1
    elif self.platform_side == "red":
        context.scene.platform_panel_props.nred += 1
    else:
        pass

class PLATFORM_PlatformPanelProps(bpy.types.PropertyGroup):
    ntot: bpy.props.IntProperty(
        name = "Total",
        description = "Total number of platforms",
        min = 0,
        default = 0,
    )
    nred: bpy.props.IntProperty(
        name = "Red",
        description = "Number of red platforms",
        min = 0,
        default = 0,
    )
    nblue: bpy.props.IntProperty(
        name = "Blue",
        description = "Number of blue platforms",
        min = 0,
        default = 0,
    )
    side: bpy.props.EnumProperty(
        name = "Side",
        description = "Choose the platform side (either 'blue' or 'red')",
        update = update_platform_side,
        items = [
            ("platform_blue", "Blue", "Set the platform to 'blue' side"),
            ("platform_red", "Red", "Set the platform to 'red' side")
        ],
        default = "platform_blue",
    )
    is_expanded: bpy.props.BoolProperty(
        name = "Platform expand",
        description = "Expands a platform panel to show all its attributes",
        default = False,
    )

class PLATFORM_PT_Platform(bpy.types.Panel):
    bl_idname = 'PLATFORM_PT_Platform'
    bl_label = 'Platforms'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = 'platform'
    bl_options = {'DEFAULT_CLOSED'}

    def draw(self, context):
        layout = self.layout
        icon = 'TRIA_RIGHT' if not context.scene.is_expanded else 'TRIA_DOWN'

        box = layout.box()
        row = box.row(align = True)
        row.label(text = f"Red {context.scene.platform_panel_props.nred}")
        row.label(text = f"Blue {context.scene.platform_panel_props.nblue}")
        row.label(text = f"Total {context.scene.platform_panel_props.ntot}")

        box.operator('platform.add_platform', text = "Add")

        for i in range(context.scene.platform_panel_props.ntot):
            row = layout.row()
            row.prop(context.scene, 'is_expanded', icon=icon, icon_only=True)
            row.label(text = f'Platform {i + 1}')
            row.alert = True
            row.operator('platform.delete_platform', text = "Delete")

            if context.scene.is_expanded:
                box = layout.box()
                row = box.row(align = True)
                row.label(text = "Side")

class PLATFORM_OT_AddPlatform(bpy.types.Operator):
    """ Create a new platform with its sensor(s) and/or effector(s) """
    bl_idname = "platform.add_platform"
    bl_label = "Create new platform"

    def execute(self, context):
        context.scene.platform_panel_props.ntot += 1
        return {'FINISHED'}

class PLATFORM_OT_DeletePlatform(bpy.types.Operator):
    """ Delete a platform with its sensor(s) and/or effector(s) """
    bl_idname = "platform.delete_platform"
    bl_label = "Delete platform"

    def execute(self, context):
        context.scene.platform_panel_props.ntot -= 1
        return {'FINISHED'}

classes = (
            PLATFORM_PlatformPanelProps,
            PLATFORM_PT_Platform,
            PLATFORM_OT_AddPlatform,
            PLATFORM_OT_DeletePlatform,
        )

if __name__ == '__main__':
    for my_class in classes:
        bpy.utils.register_class(my_class)
    bpy.types.Scene.is_expanded = bpy.props.BoolProperty(default = False)
    bpy.types.Scene.platform_panel_props = bpy.props.PointerProperty(
                                                type = PLATFORM_PlatformPanelProps,
                                            )

The provided code runs, but not as intended: When I add several expandable rows, I cannot expand a particular one (i.e. they all expand simultaneously). How can I solve that issue? I also do not get why I have to declare bpy.types.Scene.is_expanded in the main to be able to expand the rows, instead of just calling platform_panel_props.is_expanded where is_expanded or context.scene.is_expanded is used?

The problem is that you want to control multiple properties with a single variable, which is not possible. I think you need to read about bpy.props.CollectionProperty. It lets you create a dynamically-adjustable collection of properties. I modified your code to make it work like I assumed you wanted.

import bpy

# We don't need a custom update callback since the numbers are calculated on the fly.

class PLATFORM_PlatformPanelProps(bpy.types.PropertyGroup):
    # I used static methods but these could be global functions, or directly used inside the draw method.
    # One could also use a cache feature and an update on prop modification but the computation cost is negligible.
    @staticmethod
    def ntot(context):
        return len(context.scene.platform_panel_props)

    @staticmethod
    def nred(context):
        return len([prop for prop in context.scene.platform_panel_props if prop.side == "platform_red"])

    @staticmethod
    def nblue(context):
        return len([prop for prop in context.scene.platform_panel_props if prop.side == "platform_blue"])

    side: bpy.props.EnumProperty(
        name = "Side",
        description = "Choose the platform side (either 'blue' or 'red')",
        items = [
            ("platform_blue", "Blue", "Set the platform to 'blue' side"),
            ("platform_red", "Red", "Set the platform to 'red' side")
        ],
        default = "platform_blue",
    )
    is_expanded: bpy.props.BoolProperty(
        name = "Platform expand",
        description = "Expands a platform panel to show all its attributes",
        default = False,
    )

class PLATFORM_PT_Platform(bpy.types.Panel):
    bl_idname = 'PLATFORM_PT_Platform'
    bl_label = 'Platforms'
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = 'platform'
    bl_options = {'DEFAULT_CLOSED'}

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

        box = layout.box()
        row = box.row(align = True)
        row.label(text = f"Red {PLATFORM_PlatformPanelProps.nred(context)}")
        row.label(text = f"Blue {PLATFORM_PlatformPanelProps.nblue(context)}")
        row.label(text = f"Total {PLATFORM_PlatformPanelProps.ntot(context)}")

        box.operator('platform.add_platform', text = "Add")

        # Here you want to iterate over your properties and keep the index for the Delete button
        for i, prop in enumerate(context.scene.platform_panel_props):
            row = layout.row()
            icon = 'TRIA_RIGHT' if not prop.is_expanded else 'TRIA_DOWN'
            row.prop(prop, 'is_expanded', icon=icon, icon_only=True)
            row.label(text = f'Platform {i + 1}')
            row.alert = True
            row.operator('platform.delete_platform', text = "Delete").index=i

            if prop.is_expanded:
                box = layout.box()
                row = box.row(align = True)
                row.prop(prop, "side")

class PLATFORM_OT_AddPlatform(bpy.types.Operator):
    """ Create a new platform with its sensor(s) and/or effector(s) """
    bl_idname = "platform.add_platform"
    bl_label = "Create new platform"

    def execute(self, context):
        context.scene.platform_panel_props.add()
        return {'FINISHED'}

class PLATFORM_OT_DeletePlatform(bpy.types.Operator):
    """ Delete a platform with its sensor(s) and/or effector(s) """
    bl_idname = "platform.delete_platform"
    bl_label = "Delete platform"
    # We use an index here so we can delete a specific item from the list, not the last or first one
    index: bpy.props.IntProperty()

    def execute(self, context):
        context.scene.platform_panel_props.remove(self.index)
        return {'FINISHED'}

classes = (
            PLATFORM_PlatformPanelProps,
            PLATFORM_PT_Platform,
            PLATFORM_OT_AddPlatform,
            PLATFORM_OT_DeletePlatform,
        )

if __name__ == '__main__':
    for my_class in classes:
        bpy.utils.register_class(my_class)
    # We only need a single collection property after all.
    bpy.types.Scene.platform_panel_props = bpy.props.CollectionProperty(
                                                type = PLATFORM_PlatformPanelProps,
                                            )

Very neat, thank you. I will give your pointer to the bpy.props.CollectionProperty a read, thanks


text:
Create particle system via Python API scripting
I am having trouble creating an emitter via python scripting (using Blender 3.2.1).
My problem is the following:
suppose I have a cylinder and a plane (which will play the emitter role).
I can create those by writing
import bpy

# create plane
bpy.ops.mesh.primitive_plane_add()
emitter = bpy.context.object
emitter.name = "Emitter"

# Create cyclinder
bpy.ops.mesh.primitive_cylinder_add()
my_cyl = bpy.context.object
my_cyl.name = "My_Cyl"
my_cyl.select_set(False)

# Select (only) the emitter
objectToSelect = bpy.data.objects[emitter.name].select_set(True)
bpy.context.view_layer.objects.active = objectToSelect

From there, if I use the graphical user interface (GUI), select the plane, go in "Particle Properties", and click on Add Particle System Slot, the info displays
bpy.context.space_data.context = "PARTICLES"
bpy.ops.object.particle_system_add()

If in my script I write those above lines, I get the error message
Python: Traceback (most recent call last):
  File "...\simple_tests.blend\script001.py", line 18, in <module>
AttributeError: 'SpaceTextEditor' object has no attribute 'context'

My question is:
how can I manage to write the script to make it such that the plane is the emitter?

try this:
import bpy

# create plane
bpy.ops.mesh.primitive_plane_add()
emitter = bpy.context.object
emitter.name = "Emitter"

bpy.ops.object.particle_system_add()

# Create cyclinder
bpy.ops.mesh.primitive_cylinder_add()
my_cyl = bpy.context.object
my_cyl.name = "My_Cyl"
my_cyl.select_set(False)

Why do you want to make it that complicated? If you create a new object, it is the current active object which the ops operators use. If you create your cylinder later, you don't have to select that manually.

Hi @Chris your answer did the trick, thank you very much. I was wondering how it could be done through a function, which would be easier than copy-pasting always the same code?

i understand that. Then you should phrase exactly that in your question - then my answer would be different ;) please just open a new post with your question -> you can open as many posts as you want.


text:
Blender Modal Operator Gets Slower With Each Execution
I am working on a Blender addon and I'm suffering with a huge problem with performance.
I have created a modal operator and while the actual code is very complex here is a sample that is still able to recreate the same problem. I am using a modal operator because there is no way to report my progress back to Blender if I'm using a basic operator or just making a script run call.
    def modal(self, context, event):

        if self.state == 2:
            #Does something, only called one time in the end
            return {'FINISHED'}
        elif self.state == 0:
            #Does something, only called one time in the beginning
            return {'RUNNING_MODAL'}

        elif self.state == 1: #Where the issue is. On each new execution this part gets slower and slower. It's called 100s of times. In the following log, 240 times exactly

            layerStartTime = time.time()
            try:
                currentLayer = self.listOfParsedLayers.pop(0) # listOfParsedLayers is a List containing lists of objects of a user defined class.
                #listOfParsedLayers is populated in the invoke() function
            except IndexError:
                self.state = 2
                return {'RUNNING_MODAL'}

            #Below two lines create a new collection and link it to the scene. The problem still exists even if I comment these two lines out.
            layerCollection = bpy.data.collections.new("Layer " + str(currentLayer.layerNumber))
            self.parentCollection.children.link(layerCollection)

            for elem in currentLayer.gcodes: #Each one of these `elem`s is roughly the same size. The variation in size is negligible
                print(elem, end='\r', flush=True)
                print(" " * len(elem.__str__()), end='\r', flush=True)

            layerEndTime = time.time()
            layerTimeTaken = layerEndTime - layerStartTime

            print("Layer Done: {}/{}. Processed {} lines/s".format(currentLayer.layerNumber, self.numberOfLayers, len(currentLayer.gcodes)/layerTimeTaken), end='\n', flush=True)

            #This is the status reporting I cannot lose. It is a string that is shown in the addon side panel.
            bpy.context.scene.Stitcher_Props.Status = "Layer Done: {}/{}".format(currentLayer.layerNumber, self.numberOfLayers)
            return {'RUNNING_MODAL'}

Layer Done: 0/240. Processed 99864.38095238095 lines/s
Layer Done: 1/240. Processed 131382.99796028805 lines/s
Layer Done: 2/240. Processed 159292.78861375354 lines/s
Layer Done: 3/240. Processed 162140.667184399 lines/s
Layer Done: 4/240. Processed 162928.60274615657 lines/s
Layer Done: 5/240. Processed 146341.95625650944 lines/s
Layer Done: 6/240. Processed 164387.70720461095 lines/s
Layer Done: 7/240. Processed 161683.34893315283 lines/s
Layer Done: 8/240. Processed 31140.085639301993 lines/s
Layer Done: 9/240. Processed 160100.03930461072 lines/s
Layer Done: 10/240. Processed 133947.06391810934 lines/s
Layer Done: 11/240. Processed 77873.7837885103 lines/s
Layer Done: 12/240. Processed 9964.28099963616 lines/s
Layer Done: 13/240. Processed 30149.528307990942 lines/s
Layer Done: 14/240. Processed 17027.66779537593 lines/s
Layer Done: 15/240. Processed 15721.659918519408 lines/s
Layer Done: 16/240. Processed 16479.150725422034 lines/s
Layer Done: 17/240. Processed 15762.26056642093 lines/s
Layer Done: 18/240. Processed 16314.317159968752 lines/s
Layer Done: 19/240. Processed 11530.099561903391 lines/s
Layer Done: 20/240. Processed 16056.008655678641 lines/s
Layer Done: 21/240. Processed 14822.037499442415 lines/s
Layer Done: 22/240. Processed 13872.080731720363 lines/s
Layer Done: 23/240. Processed 12978.123577635903 lines/s
Layer Done: 24/240. Processed 15712.772026887016 lines/s
Layer Done: 25/240. Processed 17275.93793078029 lines/s
Layer Done: 26/240. Processed 17430.209104502243 lines/s
Layer Done: 27/240. Processed 23530.315584181062 lines/s
Layer Done: 28/240. Processed 21968.71754767077 lines/s
Layer Done: 29/240. Processed 25423.222487011353 lines/s
Layer Done: 30/240. Processed 18506.10602924788 lines/s
Layer Done: 31/240. Processed 23966.65979653851 lines/s
Layer Done: 32/240. Processed 48492.785715129256 lines/s
Layer Done: 33/240. Processed 147976.61308411215 lines/s
Layer Done: 34/240. Processed 20398.098630232842 lines/s
Layer Done: 35/240. Processed 22183.27061390499 lines/s
Layer Done: 36/240. Processed 17178.37899379678 lines/s
Layer Done: 37/240. Processed 21069.219196944763 lines/s
Layer Done: 38/240. Processed 20101.42274633061 lines/s
Layer Done: 39/240. Processed 20930.953064452104 lines/s
Layer Done: 40/240. Processed 20916.825328364346 lines/s
Layer Done: 41/240. Processed 23753.37499049791 lines/s
Layer Done: 42/240. Processed 28772.32244139562 lines/s
Layer Done: 43/240. Processed 17973.050280785985 lines/s
Layer Done: 44/240. Processed 16124.705715451997 lines/s
Layer Done: 45/240. Processed 15655.06738468312 lines/s
Layer Done: 46/240. Processed 22488.346087464986 lines/s
Layer Done: 47/240. Processed 16086.314203070151 lines/s
Layer Done: 48/240. Processed 16273.093981214251 lines/s
Layer Done: 49/240. Processed 22105.272761141478 lines/s
Layer Done: 50/240. Processed 16802.185915179503 lines/s
Layer Done: 51/240. Processed 22507.319261238154 lines/s
Layer Done: 52/240. Processed 16479.673660976223 lines/s
Layer Done: 53/240. Processed 21624.785475732995 lines/s
Layer Done: 54/240. Processed 15401.053531470134 lines/s
Layer Done: 55/240. Processed 20809.55456712191 lines/s
Layer Done: 56/240. Processed 22765.937738626708 lines/s
Layer Done: 57/240. Processed 15540.037074009919 lines/s
Layer Done: 58/240. Processed 20283.536472622847 lines/s
Layer Done: 59/240. Processed 20338.38408528338 lines/s
Layer Done: 60/240. Processed 14714.454760544995 lines/s
Layer Done: 61/240. Processed 20578.027435422544 lines/s
Layer Done: 62/240. Processed 24987.29904114816 lines/s
Layer Done: 63/240. Processed 14915.492770987486 lines/s
Layer Done: 64/240. Processed 21886.31894934334 lines/s
Layer Done: 65/240. Processed 29375.320969905308 lines/s
Layer Done: 66/240. Processed 19374.86567332338 lines/s
Layer Done: 67/240. Processed 20176.82540432062 lines/s
Layer Done: 68/240. Processed 22807.64508117435 lines/s
Layer Done: 69/240. Processed 24547.116391530184 lines/s
Layer Done: 70/240. Processed 21734.008624068993 lines/s
Layer Done: 71/240. Processed 23405.143500620423 lines/s
Layer Done: 72/240. Processed 22763.58553883411 lines/s
Layer Done: 73/240. Processed 32909.717732016026 lines/s
Layer Done: 74/240. Processed 17479.01493945589 lines/s
Layer Done: 75/240. Processed 23371.39038692051 lines/s
Layer Done: 76/240. Processed 23675.685865461113 lines/s
Layer Done: 77/240. Processed 21899.5053015301 lines/s
Layer Done: 78/240. Processed 21745.86065825174 lines/s
Layer Done: 79/240. Processed 23499.876075286204 lines/s
Layer Done: 80/240. Processed 19723.018432326833 lines/s
Layer Done: 81/240. Processed 20446.516371926984 lines/s
Layer Done: 82/240. Processed 19212.534571340144 lines/s
Layer Done: 83/240. Processed 18777.09223052796 lines/s
Layer Done: 84/240. Processed 20222.92784857292 lines/s
Layer Done: 85/240. Processed 19544.02220528382 lines/s
Layer Done: 86/240. Processed 18133.19208258252 lines/s
Layer Done: 87/240. Processed 19010.905058417127 lines/s
Layer Done: 88/240. Processed 16729.449020559718 lines/s
Layer Done: 89/240. Processed 19638.75111242035 lines/s
Layer Done: 90/240. Processed 18671.102369720156 lines/s
Layer Done: 91/240. Processed 26132.73520249221 lines/s
Layer Done: 92/240. Processed 29548.374385127725 lines/s
Layer Done: 93/240. Processed 28710.941706959307 lines/s
Layer Done: 94/240. Processed 28566.017835565275 lines/s
Layer Done: 95/240. Processed 29132.588191049268 lines/s
Layer Done: 96/240. Processed 28434.171367164727 lines/s
Layer Done: 97/240. Processed 29504.695914177064 lines/s
Layer Done: 98/240. Processed 18355.951432276317 lines/s
Layer Done: 99/240. Processed 18040.927948303717 lines/s
Layer Done: 100/240. Processed 16845.655142495296 lines/s
Layer Done: 101/240. Processed 24766.613894910704 lines/s
Layer Done: 102/240. Processed 29228.06980592022 lines/s

These are the first 102 lines of the print message and it only gets worse after this. Number of lines in each segment is not drastically different. The trend is just that the execution time keeps increasing and increasing and I can't figure out why.

Have you tried commenting out the print statements ? It seems you're printing thousands of them per iteration and print is notoriously slow. No idea why it would get slower though. Without seeing what's inside currentLayer.gcodes it's a bit of a guess work. Also, are you familiar with f-strings ? I think they're way easier to read than .format notation

@Gorgious, the point is later runs take significantly longer than previous loops when the data is more or less consistent

Yeah I do understand what you think is happening, I'm trying to help you find the reason with what limited knowledge of your codebase I have :) At a quick glance I would not say that it takes longer and longer to compute. It looks like after the 10th iteration they all more or less take the same time to compute. The numbers looks statistically samey. Maybe you ought to check what happens in the first 10 of your layers.

@Gorgious, I think I found out the reason. every time I create a new object the time for object creation goes higher. That's the issue. I'd have to think of a way to resolve that.

That's a known issue of Blender. There has been a patch adressing this in a recent version. What version do you use ?

@Gorgious I'm on 3.3.0, I'd try with 3.4.1 if that gives a better result. If it does that would be just amazing

@Gorgious. I tried with 3.4.1. The same problem seems to exist. Thanks anyway. I'd see what I can do :D


text:
Driver For Phase Multiplier Option in Graph Editor > Modifiers > Built in Function Generator > Sine Curve?

I am animating multiple objects with different sine waves, but all of them should have the same phase multiplier. I am trying to declare a "global variable" that all the different objects share. I can set the value there and that can be used by all my objects. Somebody told me to "add a driver", but right-clicking this field does not give me the option to add a driver. Any tips?

you can't animate or drive those modifiers... a workaround would be to use a script, if you have many objects it could help you test different setups, but not so much if you need to animate the value... there may be other ways, what do you want to achieve?
value = 0.5

import bpy
sel = bpy.context.selected_objects
ani = [o for o in sel if o.animation_data]

for ob in ani:
    for cu in ob.animation_data.action.fcurves:
        for mod in cu.modifiers:
            try: mod.phase_multiplier = value
            except: pass

I think your script solution works fine for me. I don't want to animate it. I just wanted like a central place where I can edit the value and speed up or slow down the animation, instead of editing it six different times. I anyway did manage a better way to do all that with a lot of changes in my animation strategy.

ok, glad you solved it


text:
Weird Glitch When Adding Bevel Geometry to 2D Curves
I have a script where I create curves from a 3D Printing file (GCode File). The curve created looks like this:

The curve is 2D. When I give it a bevel of 0.1m this happens:

The problem disappears if I change the curve type to 3D:

Due to slight differences in curve behavior in 2D and 3D I would rather have a 2D Curve.
I do understand very well that it might be because two points on the curve might be too close to each other. is there any way I can fix this?

"I do understand very well that it might be because two points on the curve might be too close to each other." So you already know the likely cause of the issue, why not solve it?

I understand the cause, but I don't have a solution for it.

The obvious one is eliminating one of the overlapping vertex

Doing that would make my script inaccurate, although I am thinking along those lines too.

The solution turned out to be much simpler that I thought. You can achieve the result using geometry nodes.
The top one is the old way, adding bevel to a curve. Bottom one has been done with geometry nodes. Both are 2D curves.

This is the geometry node tree:


text:
Creating Tiny Splinters In Plastic Using Shaders or Geometry Nodes
I'm trying a 3D printed look. I have the layer lines down so far, but how can I generate these tiny Splinters?

What have you done so far? Have you used Geometry nodes for this?

@Crantisz The screenshot above is from a plugin that I didn't create. So far I have written a script that imports a GCode file (that's a file that a 3d printer uses to 3d print the object) and creates an object but it looks too perfect. Here's a sample of what my import looks like:
https://i.sstatic.net/K3e01.jpg

Using Bump and material settings
Gunt.r answer is good, but instead of constant interpolation I would set a Linear or Beizer, this should look more realistic:

Also, you can get the required amount of bumps just by sliding colorramp's stops at the right.
Using geometry nodes
If you want to make them "real" You can distribute some simple objects like this:

SSS should wash out edges.

I think changing the interpolation just that little bit does the job for me. Geometry nodes might add too much render time. The shader solutions seems perfect.

A basic noise texture will get you pretty close

However, you're looking for a much lower density of detail - SO what you can do is:
Add another noise texture with a LOWER scale to mask over the top of the smaller one

I encourage you to play with the scale and the color that the color ramp outputs to understand this node setup further. Also ensure that the color ramps are set to constant and the math node is set to divide
Now what we need to do to actually get the dots to pop out is apply a bump map like this:

I was answering the question too quickly and forgot to mention how to add height/normals. Will update it soon

Thanks, I still got a bit of an idea. I can probably play around and get something done I suppose. I'd keep at it

how to get the stuff to pop out had been added to the answer


text:
Make a line from a point to every point on a curve to create a surface
Shown below is an image. The requirement is simple. I want a way to make a bunch of lines from point A to every point on circle B ( that would form a conical surface) and also extrapolate those lines to as far beyond the circle as I want.
B could be anything, a square, a pentagon or any other enclosed or unclosed curve.
There could also be multiple such starting points (A) and multiple curves (B) to which lines are to be drawn in the same scene (for lack of a better word). Analyzing the intersection between these surfaces is crucial. I don't know if Blender is the best tool for the job but eventually, I'd give thickness to these surfaces and export a 3D model.
Needless to say I'm very new to Blender.

In edit mode select all the verts on B, press e to extrude, then right-click to cancel movement, then press s to scale, and type 0 to collapse all the newly extruded points. Move these points to A.
The reselect the verts on B, press gg to grab and slide, and hold down alt to disable clamping.

Your first part worked like a charm. Thank you so much for that. I'm one step closer to what I'm trying to do. But the second part doesn't do what I was going for.
I was hoping for something like edge slide (gg - hotkey), but slide beyonf the actual curve along the normal.

@VipulRajan press GG, slide up, then press and hold ALT and slide down.

@MarkusvonBroady Thank you so much. This is exactly what I wanted.
I could do it with a cirlce. Now I just need to figure out how to make squares and other shapes in Blender but that should be relatively simple. Again. Thanks a whole lot

Thanks @MarkusvonBroady I kind of rushed writing this answer and typo'd the gg part.


text:
Display Blender OSM map in python
In Blender, using the Blosm addon, I can load a map. Using the code provided here, I can export all the meshes as separate .obj files. To display a particular .obj file named test_obj.obj, located at C:/here, I have the following code
import numpy as np
import pywavefront
import plotly.graph_objects as go

# Load the .obj file
obj_path = r"C:/here/test_obj.obj"
scene = pywavefront.Wavefront(obj_path, collect_faces=True)

# Extract vertices
vertices = np.array(scene.vertices)

# Extract faces
faces = []
for name, mesh in scene.meshes.items():
    for face in mesh.faces:
        faces.append(face)
faces = np.array(faces)

# Create the figure
fig = go.Figure(data=[
    go.Mesh3d(
        x=vertices[:, 0],
        y=vertices[:, 1],
        z=vertices[:, 2],
        i=faces[:, 0],
        j=faces[:, 1],
        k=faces[:, 2],
    )
])

fig.update_layout(scene_aspectmode='data') # 'data', 'cube', 'auto', 'manual'
fig.show()

There are some orientation and "filling" issues with the resulting plot. To illustrate my point, please consider the following image, where on the left is the map in Blender, and on the right the result of the display (considering only the buildings of the left part).

The issues are the following

The orientations are different
Some "voids" seemed to be filled in the reconstruction shown on the right (consider, for instance, the building shaped like a cross on the left. The display on the right adds additional faces)

How can I solve those issues?


text:
Boolean Modifier - Why is the computation not working properly in the animation?
In this answer, it was explained how to get the surface intersection between a conical frustum and an ellipsoid.
In a static configuration, it works perfectly, as shown here

Now, I want to make the ellipsoid move, the frustum to orient and scale itself accordingly, and the intersection surface to be computed at each frame.
To do this, I first specify some ellipsoid positions at specified frames
ell_positions = [(2.5, 2.5, 2.5), (2.0, 2.0, 2.0), (4.0, 0.0, 4.0), (6.0, -2.0, 2.0), (8.0, 0.0, 0.0)]
frames = [0, 20, 40, 60, 80]
bpy.context.scene.frame_start = frames[0]
bpy.context.scene.frame_end = frames[-1]

I then place some keyframes
for frame, ell_position in zip(frames, ell_positions):
    bpy.context.scene.frame_set(frame)
    ell.location = ell_position
    ell.keyframe_insert(data_path = 'location', frame = frame)

I then create a frame handler to animate the motion of the frustum and use it with
inter_mat = bpy.data.materials.new(name = "IntersectMat")
inter_mat.diffuse_color = (1.0, 1.0, 0, 1.0)

def modify_fru_at_frame(scene, fru, r1, div, ell):
    frame: int = scene.frame_current
    cf = fru.location
    fru_direction = mathutils.Vector(ell.location) - cf
    fru_direction.normalize()
    up = mathutils.Vector((0.0, 0.0, 1.0))
    fru.rotation_quaternion = up.rotation_difference(fru_direction)
    h = (ell.location - cf).length
    r2 = r1 + h * div
    fru.scale = (1.0, 1.0, h / fru.dimensions.z)
    fru.dimensions = (r2, r2, h)

def create_frame_change_handler_post(fru, r1, div, ell):
    @persistent
    def frame_change_handler_post(scene):
        modify_fru_at_frame(scene, fru, r1, div, ell)
    return frame_change_handler_post

bpy.app.handlers.frame_change_post.append(create_frame_change_handler_post(fru = fru, r1 = r1, div = div, ell = ell))

This delivers the expected result.
If I now try to add the intersection computation at each frame, using
def get_surface_intersection(obj1, r1, div, obj2, inter_mat):
    obj1_copy = obj1.copy()
    obj1_copy.data = obj1_copy.data.copy()
    obj1_copy.name = "OBJ1_copy"

    obj2_copy = obj2.copy()
    obj2_copy.data = obj2_copy.data.copy()
    obj2_copy.name = "Intersection"

    bpy.context.collection.objects.link(obj1_copy)
    bpy.context.collection.objects.link(obj2_copy)

    bpy.ops.object.select_all(action = 'DESELECT')
    obj1_copy.select_set(True)
    obj2_copy.select_set(True)
    bpy.context.view_layer.objects.active = obj1_copy

    bpy.context.view_layer.objects.active = obj2_copy
    bpy.ops.object.modifier_add(type = 'BOOLEAN')
    boolean_modifier = obj2_copy.modifiers[-1]
    boolean_modifier.operation = 'INTERSECT'
    boolean_modifier.object = obj1_copy

    bpy.ops.object.modifier_apply(modifier = boolean_modifier.name)

    bpy.context.view_layer.objects.active = obj2_copy
    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.mesh.select_all(action = 'DESELECT')
    bpy.ops.mesh.select_mode(type = 'VERT')

    bm = bmesh.from_edit_mesh(obj2_copy.data)

    tol: float = 1.0e-3
    normal: mathutils.Vector = (obj2_copy.location - obj1_copy.location).normalized()
    ce = obj2.location
    h = (obj2.location - obj1.location).length
    r2 = r1 + h * div
    for vert in bm.verts:
        world_co = obj2_copy.matrix_world @ vert.co
        if np.abs((world_co - ce).length - r2) <= tol:
            if np.abs(normal.dot(world_co - ce)) <= tol:
                vert.select = True

    bpy.ops.mesh.delete(type = 'VERT')

    if obj2_copy.data.materials:
        obj2_copy.data.materials[0] = inter_mat
    else:
        obj2_copy.data.materials.append(inter_mat)

    bpy.ops.object.mode_set(mode = 'OBJECT')
    bpy.context.view_layer.objects.active = obj2_copy
    bpy.ops.object.origin_set(type = 'ORIGIN_GEOMETRY', center = 'MEDIAN')
    bpy.ops.object.mode_set(mode = 'EDIT')
    bmesh.update_edit_mesh(obj2_copy.data)

    bpy.context.view_layer.update()
    bpy.data.objects.remove(obj1_copy, do_unlink = True)

    bpy.ops.mesh.select_all(action = 'DESELECT')
    bpy.ops.object.mode_set(mode = 'OBJECT')

    return obj2_copy

def modify_intersect_surf_at_frame(scene, obj1, r1, div, obj2, inter_mat):
    frame = scene.frame_current
    intersect_obj = get_surface_intersection(obj1 = obj1, r1 = r1, div = div, obj2 = obj2, inter_mat = inter_mat)
    obj1_direction = obj2.location - obj1.location
    obj1_direction.normalize()
    up = mathutils.Vector((0.0, 0.0, 1.0))
    intersect_obj.rotation_quaternion = up.rotation_difference(obj1_direction)

def create_frame_change_handler_pre(fru, r1, div, ell, inter_mat):
    @persistent
    def frame_change_handler_pre(scene):
        modify_intersect_surf_at_frame(scene = scene, obj1 = fru, r1 = r1, div = div, obj2 = ell, inter_mat = inter_mat)
    return frame_change_handler_pre

bpy.app.handlers.frame_change_pre.append(create_frame_change_handler_pre(fru = fru, r1 = r1, div = div, ell = ell, inter_mat = inter_mat))

what should recompute the intersection surface at each frame does not deliver the expected result. Why is that and how can I solve that issue?


text:
Create a Disjointed Curve Using a Python Script
I'm trying to create a curve with a python script but I want some of the edges to not be connected. This is what I have so far
import bpy
view_layer = bpy.context.view_layer

coords = [(1,1,0), (2,2,0), (3,0,0)]
curveData = bpy.data.curves.new('myCurve', type='CURVE')
curveData.dimensions = '3D'
curveData.resolution_u = 2
polyline = curveData.splines.new('POLY')
polyline.points.add(len(coords)-1)
for i, coord in enumerate(coords):
     x,y,z = coord
     polyline.points[i].co = (x, y, z, i)

curveOB = bpy.data.objects.new('myCurve', curveData)
view_layer.active_layer_collection.collection.objects.link(curveOB)

This gives me a curve

What I'm trying to do is add more points but have some of them not be joined by edges, something like this

I duplicated the curve and joined (Cmd + J) the original and duplicate. That give me just one curve with just one object data.

How can I achieve the same thing in script, I'd like to avoid using bpy.ops.

Just turn the script you have into a function. Then you can reuse it as many times as you want and feed it different coordinates each time. If you use an external variable to keep track of how many new points you've added then you can  use that to index into the point array where you left off.
view_layer = bpy.context.view_layer

def create_points(curveData, coords, index=0):
    polyline = curveData.splines.new('POLY')
    polyline.points.add(len(coords)-1)
    for i, coord in enumerate(coords):
         x,y,z = coord
        # instead of using i to select the points we use the index
        # variable we created outside the function
         polyline.points[index].co = (x, y, z, i)
         # add to the index, if we start this loop again, then we'll
         # be starting at index = 2, 3, 4... then loop again, etc.
         index += 1

coords = [[1,1,0], [2,2,0], [3,0,0]]
curveData = bpy.data.curves.new('myCurve', type='CURVE')
curveData.dimensions = '3D'
curveData.resolution_u = 2

# just a loop to offset each segment by 1 on the Z-axis.
for i in range(10):
    index = 0
    create_points(curveData, coords,index=index)
    for c in coords:
        c[2] += 1

curveOB = bpy.data.objects.new('myCurve', curveData)
view_layer.active_layer_collection.collection.objects.link(curveOB)

Result:

I feel a bit stupid now. I should've figured that out myself. Thanks a lot though.


text:
Revolve/Screw Modifier Using Geometry Nodes?
I have a problem that should've been very simple to solve but I'm new to geo nodes.
I create revolved geometry using a curve and a screw modifier.
This is the curve:

This is the geometry and the modifier:

How do I achieve the same using geometry nodes?

For this you need only half of this curve. You rotate it along the X-axis a certain number of times.
In this example I use $36$ subdivisions.
So you get the angle for the rotation with $\frac{2\pi}{36}$.
Then I create an element with Mesh Line that has also $36$ points (all at the same position or in the center).
At these points I then instantiate the curve and rotate each one by multiplying the previously calculated angle with the index.
Furthermore I create a grid, which serves me as surface. This has as value for the vertices the number of rotations and the number of points of the curve.
Finally I only have to transfer the positions of the rotated curves to the grid and unite the points with Merge by Distance.

Thanks. This solution does work. I have a few concerns regarding the performance. I'm going to have 100s of these in my scene. Any clue on how this might affect everything? But yeah this works and solves my problem.

@VipulRajan There are relatively simple mechanisms involved here, so it should not have a dramatic effect on performance. Above all, there should not be a leaner method with Geometry Nodes.

Okay. Went through the GN tree in the blend file step by step. Most of it I understood. The set position node has be a bit confused at the moment. I can follow how the grid is created, how the structure is created. I also understand the set position node basically "wrapped" the grid around the structure that was created. I don't yet understand how it did that but I'd keep at it.

@VipulRajan Wrapping the grid to the underlying structure works because the indices of the grid are built in a certain order. They are arranged row by row, so the mapping also works column by column.

Yep, got it now. I was a bit confused by the order. One extremely minor improvement I'd like to suggest is to flip faces at the end. Currently, the normals point inside the mesh because of how the grid indices work. Thanks a ton. I really learnt a lot, more than just a solution to my current problem.


text:
How to make peanut (cake) cookies in blender
hope every one is good. I am using blender from last two years but this time stuck in modeling a cake cookies. Picture is attached your help will be highly appreciated.
Thank you.

Hello, welcome to Blender SA!  If you have specific technical questions this is the place, but your request falls more along the lines of a tutorial.  Youtube, Google, and BlenderCookie are all good places to search for such inquiries.

Your are right a lot tutorials on youtube. But i am stuck at curves if add sub-division modifier ir changes shape.

Hello, what part exactly are your struggling with?

Create a cylinder, scale on Z, select the edge ring and Select > Checker Deselect in order to select one edge out of two:

Scale the selected edges on XY only:

Bevel the edge ring:

Scale the bottom, inset or extrude the top face and scale down:

Add some edge loops before adding Subdivision Surface modifier:


text:
Is there a way that I can re-texture a model that has already been made to look like it has hair?
I have the official Nintendo Breath of the Wild Link model.  I want to practice editing models with it so I'm trying to re-texture the model to make it make look more realistic.  I'm working on the hair now, but I don't want to go through the trouble of custom making the hair. Is there a way that I could make the model I already have look like hair easily? Any help would be appreciated.
Thanks

You can texture the current model with hair stencils, but even with the most photorealistic textures, the final result will just look like a toy with a pseudo-realistic texture on. Imagine putting an perfectly realistic textures on a cube, that would still look like a cube.
Now the most obvious way to make realistic hairs these days is to use hair particles, you would have to spend time combing and cutting the actual hair strands, and then do a nice shader work or import a good hair shader made by someone else. But Blender's Principled Hair shader is already quite nice, you can easily make it better by painting the colors instead of using a unique flat color.
You can also use the hair particles plus some manual editing to make stylized hair particles. You are on control of how much stylized or realistic you want the result, but that method allows you a flexibility in shape that the hair particles alone don´t.
Another method is one used in video games when particles are not possible: hair cards. It can be done either by assigning mesh planes to hair particles, or by modeling the cards manually, or both manually modeling and guiding the strands with nurbs curves.

Here is longer video about hair cards: https://youtu.be/oqjKMd9CYI4 and a summery as text here: https://www.blender.org/user-stories/using-blender-in-game-development-by-embark/

"Imagine putting a perfectly realistic textures on a cube, that would still look like a cube." ...

A good picture is worth a thousand words. Even when writing said picture! x)


text:
blender 2.8 freestyle is not working
freestyle did work before rigging, but after animating in pose mode it stopped working.i have also applied transforms

its working in updated version (23 april) my old version was downloaded on 12 april


text:
What's the most efficient way to draw edges for an object?
What's the most efficient way to draw edges for an object?
By efficient I mean quick in drawing and efficient in rendering.
Example:
Adding red edges to a box.

https://blender.stackexchange.com/questions/8300/how-to-solidify-edges and https://blender.stackexchange.com/questions/33871/is-there-really-a-way-to-make-a-true-toon-shader-material-in-cycles/ and https://blender.stackexchange.com/questions/562/how-to-get-silhouette-with-contour-rendering-in-cycles and https://blender.stackexchange.com/questions/3149/how-can-i-render-an-edge-only-mesh-as-solid-lines and https://blender.stackexchange.com/questions/7/how-can-i-start-using-freestyle/20#20

A possible way to do this is to use the Wireframe modifier. To get the result you want, add 2 materials to your object (the first for the faces and the second for the wire edges). Set the Pass Index of the second material to 1 (or any other number different from 0, which is the default value for any new material):

Add the Wireframe modifier to your object, and make sure to unchek Replace Original and to set the correct material index in the Material Offset input:

The final render will be something like this:


text:
Knife tool, Subdivide faces, edge select do not work in blender at all to make a rudimentary split face
I dont understand why something that should be so simple in any 3d modeling software doesn't work in Blender
All I want to do is splice these faces to add a door to my floor plan
I tried using the knife tool, I selected on the first edge, then dragged to the opposing edge. Clicked Enter, nothing happened, no split, no new faces or new vertices
I tried selecting opposing edges, for some reason when I select the opposing edge with SHIFT, it just select the adjacent edge to the currently elected edge instead, and Subdivide operation creates a split between the wrong edges.
I used to be able to select opposing edge by holding ctrl and dragging, but now that I have 3 edges instead of 2, It doesn't work. As you can see, it worked on the first two edges, but now I am stuck because I cannot subdivide the face below, and I cannot Ctrl+Z out of it
All I want to do is split the face down the middle, how do I do this?
Why doesn't the knife tool do what it's supposed to?

That one lonely edge causes n-gons, making it all harder.
Keep your life simple and use loopcuts and quads ;)

Use three loopcuts to define the doorframe
Select the three faces and press Delete > Faces to remove
Select bottom edge and press F F F  to complete the doorframe

Use CTRL+R. This will divide the planes along the circumference.

And also after pressing the left mouse button will allow you to choose where exactly you want to divide the faces.


text:
'bpy_prop_collection' object has no attribute 'unlink' error
I'm trying to remove object and free from memory. I googled some, and found an old article
https://blenderartists.org/t/how-to-clean-memory-after-running-a-script/608062
I copied the script and executed on my blender 2.82. But the console returned error at the line 78.
scene = bpy.data.scenes[0]
# Unlink and remove object first
for ob in bpy.data.objects:
    scene.objects.unlink(ob) # At this line

It says, 'bpy_prop_collection' object has no attribute 'unlink'.
I think it's because the API changed during update, but I can't figure out how to change it. Thanks for reading.

Try:
scene = bpy.data.scenes[0]

# Unlink and remove object first
for ob in bpy.data.objects:
    bpy.context.scene.collection.objects.unlink(ob)

Also maybe remove all objects too?
scene = bpy.data.scenes[0]

for ob in bpy.data.objects:
    bpy.data.objects.remove(ob)

# Unlink and remove object first
for ob in bpy.data.objects:
    print(ob)
    bpy.context.scene.collection.objects.unlink(ob)

Just a little note. It is not necessary to unlink objects following objects.remove(). This is done by default: remove(object, do_unlink=True, do_id_user=True, do_ui_user=True)

ah thanks! good info relaxed


text:
Is there any way to move my perspective in viewpoint as same as my camera is watching?
I'm curious about
Is there any way to move my perspective in viewpoint as same as camera is watching?
I've googled some, but the only one I could find is to move camera to which I'm watching now.
I want to do the reverse, I want my viewport just fit on what my camera is watching.

You can snap your viewport to your active camera with the View Camera operation (as it's called in keybinding), which is, by default, bound to numpad 0.

Thanks! It really snaps my viewport, but I want it to be zoomed to fit my viewport and render result is just the same. Is is possible?

It was my mistake. It's perfect answer for me. Thanks!