text:
Blender Octane - Editing the scene programmatically slows down terribly the rendering
I have this basic scene where an artist set up the Octane shader and the compositing network in order to render some sample images to test materials.
I created a script that programmatically does what follows:

loads the scene
accesses the shading network
visits the textures nodes to replace the textures
visits the displacement node and change the height value
accesses the compositing network
visits the file output node and changes the output format to .png, changes
the output location and the name for the inputs
starts the rendering process
Saving the result of the operation in a file on the disc

The rendering executed on the scene opened and modified by the scripts is super slow, whereas if I do the same operations manually and then hit F12 the layers of the scene are rendered in a handful of minutes (6 layers rendered at 4k x 4k pictures)
Here below comes the function that runs the show.
The argument "assetsToRender" is a dictionary containing all the information necessary to setup the "mother-scene".
def processingScene(assetsToRender):

# basic data

REPOSITORY = "C:/wkspaces/assetdb"

SCENES_DIRECTORY = "/".join(os.path.dirname(os.path.realpath(__file__)).split("\\")[:-2])

SCENE_MAPPING = {
    "Outdoor_Horizontal"    : os.path.normpath(os.path.join(SCENES_DIRECTORY, "Outdoor_Floor_Render_v01.blend")),
    "Outdoor_Vertical"      : os.path.normpath(os.path.join(SCENES_DIRECTORY, "Outdoor_Wall_Render_v01.blend")),
    "Indoor_Horizontal"     : os.path.normpath(os.path.join(SCENES_DIRECTORY, "Indoor_Floor_Render_v01.blend")),
    # "Indoor_Vertical"       : os.path.normpath(os.path.join(SCENES_DIRECTORY, "Indoor_Wall_Render_v01.blend")),
    "Fabric"                : os.path.normpath(os.path.join(SCENES_DIRECTORY, "Fabric_Render_v01.blend"))
}

for renderType, assets in assetsToRender.items():

    RESULT_LOG = dict(
        successful  = [],
        failed      = []
    )

    # LOADING SCENE
    loadedScene = bpy.ops.wm.open_mainfile(filepath=SCENE_MAPPING[renderType])

    # process each asset of a given render type
    for asset in assets:

        assetProcessingStatus = {}

        startTime = time.time()

        try:
            assetName = asset["fields"]["Internal Source Name"]

            # get material
            octaneMaterial = bpy.data.materials["Surface"]

            materialNodesList = octaneMaterial.node_tree.nodes

            # collecting maps
            maps = dict(
                albedo      = None,
                roughness   = None,
                height      = None
            )
            for mapType in maps.keys():
                assetDirectory = os.path.join(REPOSITORY, asset["fields"]["File Path"])
                mapPath = os.path.join(assetDirectory, "02_Output")
                mapPath = os.path.join(mapPath, "{0}_{1}.png".format(assetName, mapType)).lower()
                mapPath = os.path.normpath(mapPath)

                # if not os.path.exists(mapPath):
                #     # figure out how to log errors
                #     continue

                materialNodesList[mapType].image = bpy.data.images.load(mapPath)

            # SET HEIGHT VALUE:
            height_from_airtable = "0,11.558" #need to fetch the value from airtbale record
            min, max = height_from_airtable.split(",")
            min = float(min)
            max = float(max)
            heightValueNode = materialNodesList["Texture displacement"]
            heightValueNode.inputs.get("Height").default_value = max-min

            # DEFINE RENDERING
            thumbnailDirectory = os.path.normpath(os.path.join(assetDirectory, "03_Render"))
            if not os.path.isdir(thumbnailDirectory):
                os.mkdir(thumbnailDirectory)

            tree = bpy.context.scene.node_tree

            fileOutputNode = tree.nodes["File Output"]
            fileOutputNode.base_path = thumbnailDirectory
            fileOutputNode.format.file_format = "PNG"
            for slot in fileOutputNode.file_slots:
               slot.path = "{0}_{1}".format(assetName, slot.path)

            # START RENDERING
            bpy.ops.render.render(write_still=True)

            stopTime = time.time()

            # LOG RESULT
            assetProcessingStatus[assetName] = "successful thumbnail rendering in {}".format(stopTime - startTime)
            RESULT_LOG["successful"].append(assetProcessingStatus)

        except Exception as e:
            assetProcessingStatus[assetName] = "FAILED - {0} - {1}".format(type(e), str(e))
            RESULT_LOG["failed"].append(assetProcessingStatus)

    return RESULT_LOG

Any clues where I am doing things wrong? Thanks in advance for any tip

Use (try:) may slow down you code. Try not put the bpy.ops.render.render() inside the (try:)

Thank you @X Y. That is a great tip, I will definitively need to improve the entire code since it is suppose to create and render hundred of scenes and your suggestion is very precious.
Although I figured out where the problem was: it actually was the insanely high value for the "Texture displacement" node... pretty much a boo boo.
Compare to the value hardcoded in the mother scene it was out of a factor of 300


text:
3D asset toggle options?
Total noob here, day 3. I have downloaded a .blend fighter jet into blender. I figured out how to animate and light a little bit. How do you (or how do you know if) toggle the wheels up into the plane for example and close the bay doors?
Im assuming this is possible since a 3D model of a plane with the wheels rigged down only would not make sense for flying animations. The parameters for .obj and .blend files are where? Thank you in advance for any wisdom you can pass down.

You're asking a very broad question about rigging, animation, blender animation actions, and possibly the non-linear animation editor.  Take a look at this free model to an example of a rigged jet.

is there one obvious way in which to alter the "moving parts" on a 3d object, like an air plane, that allows you to have the wheels retracted into the plane so that it can animate across the sky without looking strange? how do I rig the wheels into the body?

you can align all the object of the plane with the global axis, parent them to some empties, then rotate and move the empties to correctly place the objects, and at last parent all the empties to the main body of the plane. You'll be able to animate each object (like wheels retracting, doors opening, etc)

source: Stack Exchange

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

sort: votes


text:
How do I model this pointed lancet window?
I have managed to do most of the window, but I am really struggling with the arch, I have tried the spin tool, but it can't quite manage the pointiness of the three arches.

You can try with CtrlE (or header menu > Edge) > Bridge Edge Loops, then you'll need to tweak the values in the Operator box (especially Number of Cuts and Smoothness) and probably edit a bit so that it matches your precise shape:

Using Proportional editing > Root should get you pretty close.
Use more vertices on the sides for smoother result ;)

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


text:
Rendering depth of field through transparent objects in blender render
i’m New to blender and I’ve had a dabble with rendering bokeh. I have made this image with transparent orange blobs in blender render using refocus node.
In the image the orange blob is in the foreground and the background is nicely blurred from the defocus node. Unfortunately where the background passes through the orange blobs the defocus is not rendered. The orange blob has transparency frezel applied. Anybody know how to get it to render bokeh through objects? Thanks!!

This is the downside of post processed depth of field.
You see, the depth map is a 2D image. To create it, rays get shot into the scene and depending on how far away from the camera they hit an object, the corresponding pixel gets a grey value. (white if in front of the camera, black if far away)
Because of that there is no information in the depth map how far away the objects in the background are. The same problem occurs if you render through a glass window. The depth map would be totally flat in that case.
So I would recommend rendering the scene with camera dof turned on, rather than adding it in post. Also, adding dof in post is a cheat and will never look as well.


text:
Blender render engine is rendering just part of an object
When I zoom out in the view window, my object is not being shown entirely.

Can anyone help understand why this is happening and how to fix it?
My Hardware specification:
i7 2.80GHz
NVidia GTX 1050 4GB
8GB RAM
Windows 10

Possible? https://blender.stackexchange.com/questions/4946/where-can-the-viewport-clipping-parameters-be-changed

Same thing, different question/answer: https://blender.stackexchange.com/questions/12280/where-are-the-settings-for-draw-distance

https://blender.stackexchange.com/questions/5201/how-do-i-increase-the-render-distance

As pointed out by @rcgauer in the comments, it is a duplicated => post Where can the viewport clipping parameters be changed?
I just changed the end clip property in the View group as suggested by @adhi post linked above and it worked fine.


text:
Can't seem to get bridge edge loops to work properly in blender
Can't seem to get bridge edge loops to work properly in blender. I'm completely new to blender. this is a shot of what I get. Please help.

I don't see how that geometry could be used in bridging edge loops or alike, it's too uneven and unnecessary complex. It would clear things up a bit if you show what you have before bridging, maybe there's a simple way.

Welcome, Mario Jones. You can't bridge a loop to itself. I suggest you read the Blender manual showing the way you should use it. https://docs.blender.org/manual/en/dev/modeling/meshes/editing/edges.html

Please share the blend file here. I'll take a look.You can do this by uploading the blend file on this site - https://blend-exchange.giantcowfilms.com and copy + pasting the generated url here.

Try just pressing F,


text:
Animation in blender: How to link restrict visibility with restrict viewport rendering
I have created an assembly sequence and the viewport visibility of the components have been restricted along the animation. BUT I forgot to retrict the viewport visibility as well :(
Now I would like to link the viewport visibility with the viewport rendering only without affecting the rest of my animation. Is there any way to do this?
This script in the console doesn't create link:
"for ob in bpy.context.scene.objects: ob.hide_render = ob.hide" ; is there a script that would enable this?

thanks Nicola Sap , exactly what I need :)


text:
Weight Mapping Support
Does Blender Cycles allow the use of weight mapping to determine what textures shows up?  I am using some meshes from World-Machine and would love to use Blender for the final render.


text:
mesh is clumping/deforming while posing

I've rigged the model using rigify and while posing I came across an issue. The mesh was deforming in a weird way while posing(as you can see near the elbow in the image) I've applied the scale and moved the armature on top of the modifier stack, nothing helped

you may need to give some corrections in Weight Paint mode, in that case find the layer where the deforming bones are

Weight paint is right I checked

please share your file: https://pasteall.org/blend/

Got the solution, The problem was the topology thanks for the help

Here's a good wiki article about this topic. Elbows and knees specfically are known for issues with topology and deformation.

Got the solution, the problem was the topology.

Could you please add additional details to your answer? Perhaps you can show what the problem with the topology and how you solved it.


text:
Moving objects that have been created using 'Add collection instance"
I've created a model of an octagonal gazebo by creating objects then using "Add Collection Instance" to duplicate objects and then rotating.  The creation went great until I went to move the entire gazebo.  For the life of me, I can't figure it out.  Is there a way to move the entire model including original objects and instances?  Here is a link to a basic blend file depicting what I did with a cube duplicated and rotated.
https://drive.google.com/drive/folders/1mvyGi8goerBRDitDOpIBvyYbekmWJ5Z_?usp=sharing
Any help would be appreciated.
tc

If you move the original at the same time as the instances, the instances will move twice, because their location will also depend on the location of the original relatively to the world space. So first deactivate the original, and then select the instances and move them:

99.6k... getting close :))

ah ah yes, still far from Gandalf3 though  ^^

Thanks for the quick reply. So, I'm guessing from your reply that moving the original object and maintaining the transforms of the instances is not possible.

as soon as you'll move the original it will move the instances, yes


text:
blender viewport and render are different
i was trying to follow the tutorial on youtube (Blender 3D - уроки) but my cycles render result doesn't picture water the same as at viewport shading.
This happens with other projects as well, the result is always different.
Thank you for any help!

At a guess it looks to me like something in (or not in) your World Shader.  It can be a good idea to post your blend file, or a truncated version of it that has the problem. The Blender StackExchange has its own service to share blend files: blend-exchange.com/help

This looks like there is an object that intersects with the water. Double check that you haven't hidden an object in the viewport, but forgot to hide it for the render.


text:
Hair, eyes, moustache, etc don't move in sync with the head when posing head
I've been trying to rig this model, and most of it is working fine, but the trouble is when I move the head bone the moustache leaves the upper lip and the eyes start popping out. I've tried parenting them to the head (they don't move at all if do that). At the moment I've got it so that the eyes and moustache are both maximum weighting with the head bone vertex group, and that has got them succesfully moving with the head bone, but they still pop out of the head. I've tried making it so that the areas around the moustache and eyes on the head are completely red in weight painting, but that doesn't stop them popping out and makes the head move weirdly when looking down.
Problems in images below.
leaving the head weighted as it is automatically

making sure the front of the face including areas around eyes and moustache are completley red in weight paint

the moustache must be part of another vertex group, so select it, on the menu on the right of the vertex groups click on Remove from All Groups and reassign it to the head bone

@moonboots Thanks for your reply but I'm afraid there moustache object only has one vertex group, which is head. I should have clarified earlier the eyes and moustache are seperate objects so they can be given different materials in unity

so maybe you need to deparent the moustache from the head bone, select the moustache and go into the Object panel > Relations

@moonboots removing the moustache's parent hasn't changed anything

could you please share your file?

@moonboots here you go, thanks if you can take a look at it
https://drive.google.com/file/d/1-UWXvfjGJ0YHTpCdfjfJmAYDi0N9DSmR/view?usp=sharing

actually it's your head that is deformed, so you need to either change its weights, or join the moustache to the body (but you says that it must be another object), or parent the moustache to 3 vertices under the nose (but does Unity keep the parenting)

@moonboots You're right it is the weights - not the head weights but the weights on the neck bone. It doesn't look perfect but the moustache stays on the head so I'll just mess around with it until it looks good - thanks

Actually it's your head that is deformed, whereas the moustache follows the head bone correctly. What you can do is select this part of your head (or more), select the Neck vertex group and click on Remove:


text:
Rendering flipped textured backface
I have a scene where I render many falling tickets which consists of a textured plane with some text on. Currently, since it is a single face, the text on the backface is flipped. Is there any way to render both faces un-flipped? Or is the only option to have two faces?

Related https://blender.stackexchange.com/questions/2082/how-can-i-make-a-material-only-apply-to-a-side-of-a-plane

Possible duplicate of How to apply a texture to only one side of a plane

I don’t think this is strictly a duplicate as it’s specifically asking for flipped image on the other side while the linked answers are for different materials on each side. Technically not much difference, I know. I think it would be worthwhile an answer dealing specifically with this (flipping the coordinates based on Backfacing). I can’t do this right now so if anyone wants to oblige...

The Geometry node provides a Backfacing value that indicates whether the front or back face is being rendered. By using this to mix between the normal image coordinates and coordinates which have been scales by -1 in one direction we can effectively flip the image for the opposite face, "unmirroring" the image so that the same image is shown on the front and back.
This can be achieved with the following nodes :

Note the Mapping node with the Y-scale set to -1. The Mix node selects which set of input coordinates (Generated or the 'flipped' generated) are used to drive the Image Texture.

Additional...
This only works 'as-is' due to the Image Texture being set to 'Repeat'. The 'unflipped' coordinates vary in the Y coordinate from 0.0 to 1.0 and so the mapping node is translating this to 0.0 to **-**1.0 - ie, the opposite to the usual coordinates. Since the Image Texture is set to 'Repeat' this isn't a problem since the image repeats in all directions.
In order to allow this to work with 'Clipped' images you can simply use the Location settings of the Mapping node to offset Y by 1.0 (set 'Y' Location to 1.0). This will translate the 0.0 to -1.0 values to 1.0 to 0.0 (ie, reversed).

Maybe you can create an extruded face at the same (or slightly different, if some thickness is allowed) z location. And then add image texture on the two faces. The rotation can be adjusted by adding a mapping and a texture coordinate node.

Additional geometry may require more resources and is not required. Check the links above


text:
Cycles render HDRI lighted object on a 2d background image
I am currently attempting to render a picture with a regular 2D picture (not as a plane), composited onto a HDRI lit object. How can I render where the 2D picture is output, and the HDRI only for lighting?
Thank you for reading

can you draw [by hand] what it would look like?


text:
Rigging mesh with vertex weights: different weights have the same influence
I'm trying to rig a simple plane of few vertices with one bone, such that different vertices would deform with a different amount when moving the bone. I assigned different weights to the vertices, but all vertices are influenced as if they have full weight, and I don't know what I'm doing wrong.
Here is what I did:
1. Create a simple plane:

(I applied scale and rotation, if that's important)
2. Create armature with one bone:

3. Parent bone to plane with empty vertex groups:

(In object mode: select plane, shift select bone, Ctrl+P, With Empty Groups)
4. Paint plane vertices with different weights:

(select bone in Pose Mode, select plane in Paint Mode, and paint)
5. Rotate bone around Y axis (in Paint Mode or in Pose Mode - same result):

and all vertices are rotated exactly the same amount. I also tried assigning weights directly to each vertex:

any weight of 0.0001 or above influence like weight 1.0, and below that has no influence at all. Here, for example, I assigned 0.00009 to the two leftmost vertices:

Do I miss something in the process?

Even with a weight of 0.001, the vertice will be part of the group and the bone will displace it 100%. I think 0.001 must be the lowest value you can enter. But if you create a second bone, parent it, then give a weight of 0.002 to some of the vertices (vs 0.001 for the same vertices in the previous vertex group), the influence of this second bone on these vertices will be twice the influence of the first bone.

Thanks. Adding a second bone did solve the problem. I added a bone in edit mode, without parenting to the first and without assigning any vertices to it, and now the first bone deforms the mesh as expected (creates a curve). But as I understand, this should be the behavior also with a single bone.

Without assigning any vertices to it? What do you mean? It can't have any influence if you don't assign any vertices to it...

Actually, there is no magic here, Have you knew that blender does 'normalize' for all the deform groups of the vertex when it goes to an armature deformation? So, if you have the only group assigned to the very vertex, its normalized value is always 1.0. You don't have to use another bone. Just assign another group to each vertex, and execute Normalize all (keeping your actual group). It will change your helper group values (1.0 - ACTUAL_GROUP_VALUE). You can see vertex groups' values in the N panel in edit mode.

Adding a second bone to the armature helped me (thanks moonboots for the direction). This is the deformation with one bone:

Added bone to the armature (in Edit Mode, Shift+A. No parenting to first bone and no assignment of vertex weights):

And voila, the deformation now looks like I thought it should in the first place:

I don't understand why the existence or absence of a second bone affects deformation of the first bone, but this is a good enough workaround.


text:
How are the reference images that have front and side view called?
How should I call this type of reference images and is there any easier way to find the than just looking up something like "character reference front and side view" on Google?

I know them as "3d turnaround", "character turnaround" and "model sheet"

it's also called "blueprint"


text:
When I try baking the left high poly object onto the right low poly one it ends up like this
When I try baking the left high poly object onto the right low poly one it ends up like this (The center is all black, you can still see the low poly edges even though I smoothed it out, and overall it looks horrible)

From the image, it looks like you baked your Normal Map to sRGB color space - make sure to use non-color space for your target "bake" image, and enable 32-bit float in the image options when you create it (if you haven't already) when baking Normal Maps. Also, is your low poly smooth shaded?

I forgot to enable 32-bit float, thank you


text:
How can I mirror a noise modifier?
How can I mirror this noise modifier so that I get a loop animation?

F-Curve modifier Cycles > Repeat Mirrored ...

... but - Instead of F-Curve's Noise modifier you can use Noise texture in Geometry Nodes to offset location. To loop noise use Empty (or any other object) to control texture location and ensure start end Empty location match.

Like now this Empty animation generates visible back & forth motion. For nicer endless loop effect let Empty follow Curve Circle.


text:
Materials when exporting to UE4
When I export my asset from Blender to Unreal Engine 4 through fbx all the values (metallic, roughness, etc.) disappear and it's just a solid base color. Do I need to export all the values and textures as maps individually?

Short answer: yes.

Thank you, what would be the long answer tho?

See the link above ^


text:
Snow v02. Broken mesh when linking

I link "snow v02" character into my new file. when i save and reopen it, the mesh in the brow or cheek is broken.
I have been redownloaded "snow v02" character and these problems still happen.
How to fix it?

Which version of Blender are you using?

@Atkay now i use 3.1.2.
Previously, i try with 3.1.0 & have same problems.


text:
Texture Baking in Blender not working on my models
i got a models, with multi texture, so now i m looking how to bake texture in one image file to put the models in an 3D engine like unreal
So this my models :

I create a new image
I open the flow manager and i add the image for the selection
i go to bake option and i lunch the generation
but nothink come to me

This is a video of my attempt : https://www.youtube.com/watch?v=rwfOIl9f-uc
what do u thing is wrong on my process please
Webologie :
How do I bake a texture using Cycles bake
How to properly unwrap my mesh?
https://gamefromscratch.com/baking-blender-materials-to-texture-to-make-them-usable-in-a-game-engine/
i follow this video guide : https://www.youtube.com/watch?v=eYvgFWEiNp8

If u want the blender files  : https://easyupload.io/jq7vn4

Hello, you haven't packed your images so we can't test with the current texture, but maybe your problem is that you have a lot of materials, so you are supposed to duplicate the Image Texture for each material, which is not convenient, plus I'm not sure about your unwrap which seems rather messy, so the best is probably to duplicate your character, unwrap it, give it the Image Texture, in the Bake panel enable Selected to Active and increase the Extrusion a bit, like 0.1, and bake again?

Hello, i can't edit my post :
so this is the full pack : https://easyupload.io/dlys75
the file blender is : johannaBakeTexture.blend

Hello so if i unrwap i lost all my texture models :

unwrap the copy, not the original  ;)

Ok so if i do that on the copy i can get this : https://i.imgur.com/ObbTBsy.jpeg
but now how i fix the  texture on the map ?
because evrytime i bake, the texture is dark

now you just need to bake the original onto the new one, give the copy a material with an Image Texture that will be the bake image, put the 2 objects at the same position, select the first one, shift select the copy, in the Bake panel enable Selected to Active, bake

when i use the Seleted to active, i got an error message :
https://i.imgur.com/KrKWj2H.png
and i select my model (the good one for the bake)
i select the image  in flow view, i select the model in object mod and i selecte to activa in bake generation and i got the error ?
https://i.imgur.com/Ra3CMdV.jpeg

please share your file again, but this time pack the images (File > External Data > Pack Resources)

i upluod the files here : https://easyupload.io/ic0ex7

You have a lot of materials in your current object, it will be much more convenient to use the Selected to Active bake mode:

Duplicate your object, keep the copy at the same position as the original
Unwrap the copy with the Smart UV Project mode
Remove all the materials of the copy
Give it a new material with an Image Texture, in the Image Texture create a new image texture that you'll call Bake for example
Select the original object, shift select the copy
In the Bake panel, choose Bake Type > Diffuse, disable Constributions > Direct and Indirect, enable Selected to Active, give a bit of Extrusion (0.1)
Bake, check the result

Hello i do all the step, but somethings missing to me :

u can see my video : https://www.youtube.com/watch?v=drWZIC-MTD4

i upluoad my model with all texture :

One files blender  with all stuff :  easyupload.io/ic0ex7
Or a folder with all models blender and all textures : the full pack : easyupload.io/dlys75 the file blender is : johannaBakeTexture.blend

you need to keep the copy at the same location as the original, that said I don't know why we see the original become black towards the end

Also, as you haven't removed all the material slots in your video, don't forget to assign the new material to your object in Edit mode, or remove all the slots (on the right of the material list, down arrow > Remove Unused Slots)

Hello,
ok i follow what u said to me, and works perfectly !
I make a video of all action i do in blender to make works !!
https://www.youtube.com/watch?v=PKtrekI-b4Y
thanks a lot
merci !!!

you're welcome  ;)

I was having a problem with my baking as well. Turns out for the source object in the outliner I had the Render toggle off. I re-enabled that then baking worked!


text:
Different materials on same object in different view layers/render layers
Is there a way to apply different materials to the same object in different view layers/render layers?

Related https://blender.stackexchange.com/questions/93043/linking-the-mesh-and-location-of-objects-with-different-materials-in-different-s/


text:
What is the best way to separate uv?
I have object unwrapped to one uv, i want to preserve all island sizes and their shapes, but pack them separately. I am using UV Shotpacker. I've separated my model to two materials to use them in Substance Painter, but i want each material to be packed individually. Is there a way to separate them for quite a while, pack and get back together? Maybe there is an easier way?


text:
Fixing subdivision+crease troubles
How to fix that? I've tried to use crease, but it didn't work. Using bevel doesn't help too, but i've checked the normals orientation and it is absolutely ok!

I don't know a lot about creases but it looks like it doesn't give a good result with this kind of topology, but here are other ways to do what you want:

what is wrong with me? Bevel does not work like in solution #2. https://imgur.com/a/88QiBxv

are you talking about the parallelepiped bottom edges? it looks like you haven't given them any weight. Select all the edges on the bottom of the parallelepiped, go in the right (N) panel > Transform menu > Bevel Weight and give some weight. Actually on my picture you can't see the blue lines but I gave weight to these edges and it's hidden by the curve

if i do this, the problem appears too... https://imgur.com/a/jAPxmrp feel so dumb >_<

could you please share the object? https://blend-exchange.giantcowfilms.com/

ok with my method it looks like there are still problems underneath, so you should follow the Robin Betts advice, which is to add creases or weight (depending on the method you've chosen) on the diagonal or orthogonal vertices that are on the ground

that doesn't f*ckin work too! xD

 the model

it's ok, my bus is not finished, but the holes for taillights must be here. I can disconnect the holes to have better result, but your help was really useful and cool! Thanks a lot)

edit: I don’t see anyway to easily fix your problem, if you add some edge loops through your parallelepiped, horizontally and vertically, the result will be good, but then what's the use of crease, or bevel modifier which are supposed to save edge loops? Maybe someone has the good answer, but also maybe try to avoid this kind of tools even though I know bevel modifier can be very useful for some hard surface works. Plus, logically, your bus should be made of different objects and not one, it would simplify your work. I’m going to continue to dig the problem.

It is planned to be completed with multiple objects, but I think the body must be solid to bake normals perfectly

As far as I can deduce, Blender is just about following Pixar's creasing rules, so there's one more to add to moonboots' magnificent collection:

keep your original topology, but crease the diagonals as well.


text:
How do I round off an extrusion edge?
I'm trying to create a part of a column from a church and I'm getting to the section where it is a torus shape, which then goes back to a straight column, here is where I got to with the part highlighted.

Related: How can I create complex edge profiles on columns?

Extrude up, create a loopcut with CtrlR, select the face ring:

Extrude and scale except on Z (ESShiftZ):

Now select the top and bottom edge loop and CtrlB to bevel (use the middle mouse to choose the number of segments, also tweak the values in the Operator box):

Cool thank you, that's perfect! How do I extrude the egdes like you you did? When I select all of the faces on my object, the extrusion just goes in one direction.

I've edited, I hope it helps

Amazing, thank you :)


text:
Merged meshes, need to reapply the armature
Blender newbie here. So here's what's going on.
I had an existing mesh and armature, I had to decimate it, which actually messed up the hands, no big deal, I just reimported another model, deleted this ones hands, and then attached new hands onto this model.
Now however, when I move the armature, it only moves the "previous" mesh (Even though I've merged the two meshes as 1.)
Is there anyway to "refresh" the armature, and apply it to the new hands. Here is a picture of what is occurring:

Here is also an image of the hierarchy that may help:

You need to recalculate the weight for the part of the mesh that you've just joined. To do that you can select the armature, shift select the mesh, switch it to Weight Paint mode, select the bones you want, shift left click to select several bones, go into the header menu > Weight and click on Assign Automatic from Bones

Thank you @moonboots
Alright so I tried these steps & unfortunately, I'm running into another problem I am receiving this error:
Bone Heat Weighting: Failed to find solution for one or more bones.

maybe share your file (remove all the useless objects): https://pasteall.org/blend/


text:
Pouring two types of fluid
I am getting to get familiar with blender and there is a huge question regarding fluid simulation.
In a short animation I'd like to combine two different liquids, one which is already in a "cup" with the other one which comes from a point - as you can see it on the pictures below.
The problem is that i cannot make the yellow solid into fluid that interacts with the blue liquid and that they also combining their colours and quantity.
Do you have any idea how i can manage to get it done?
Thank you very much in for your help, in advance! :)

There is not a problem to mix one liquid with another, but there is not a way to combine two colours or liquid density (like water-oil) with current manta flow solver. Here it is faked by two sims that doesn't interact and here is a nice result with Particles, but that is not what you want, but could be interesting to test it to light meshed fluid result by those particles :)

Hi, vklidu!
Thank you very much for the answer and the help! :)
I've been thinking of achiving the result i want with the help of the first video that you linked to me. I think that is going to get me the closest. The other video seems interesting as well. :)
May i have a tiny question as well?
Is there a way that i can make the "yellow" object a calm liquid? Because every time i try to make that fluid, even if it being:
Fluid
Type: Liquid
Flow type: Liquid
Flow Behavior: Geometry
It is kinda bubbling and it is not a simple calm "water" fluid.
Thank you very much in advance! :)

Probably better if you share your file, to let us check. (Yelow liquid is not reacting, because was not set as liquid at all, but you already noticed that.) If you don't care about colours make it as a one sim so they react together (or you cal fake color mix by shader setup). Or could be interesting try sim failing one first and when liquid mesh is generated use it as obstacle and sim yellow one :)

Hello there! :)
Thank you very much for taking your time on this topic.
Yes, i think i should share the file so you can have a look at it.. :)
Here you can find the original file i was asking about:
https://drive.google.com/file/d/1-tKn56CV9Uq0f1qQqOZNJOQYISwwpnVr/view?usp=sharing
Thank you very much again! :)

If no one I will check it tomorrow, btw you didn't give permission for download ... for now check my answer if you find it useful.

In mean time I recreated one ...

Faked color mix ...

Hi, vklidu!
Thank you very much for the blender file.
The sharing should have worked i don't know what happened.
I've been trying yesterday and now i have donloaded your file and i've gotten to find the same solution that you made in the shared file. :)
The colour changing with the fake colour mix is a great idea! :)
Thank you very much for taking your time on trying to help me with this one! :)
I'm gonna show you my final render when it's done just for fun! :)
Thank you again, have a lovely day, mate! :)


text:
Watch YouTube video inside Blender
Is there a plugin that allow watching a youtube video inside blender ? This could be quite convenient when watching tutorial to have the video available.

You would have to have a local copy of the file as Image Textures do not allow URLs, and in fact you cannot even get a direct video URL from youTube.  you could use some video capture tool to produce the local MP4 or WMV file, but then again you'd have to be "playing" the timeline at full speed, which is another impediment, and imposition on what you might be editing.  Short answer: no.  I'd say your best option is to use a PIP (Picture In Picture mode of your browser so that you can have the video available and "On Top" of your blender session.

You could upload it and put it in the Video Sequencer, if your screen is large enough it will work fine


text:
Error compiling bpy
I've been following this tutorial to build the bpy module
However, I get an error at the end of make bpy:
/usr/bin/ld.gold: error: /usr/lib/x86_64-linux-gnu/libpng.a(pngerror.o): requires dynamic R_X86_64_PC32 reloc against 'stderr' which may overflow at runtime; recompile with -fPIC
collect2: error: ld returned 1 exit status
make[3]: *** [source/creator/CMakeFiles/blender.dir/build.make:498: bin/bpy.so] Error 1
make[2]: *** [CMakeFiles/Makefile2:7410: source/creator/CMakeFiles/blender.dir/all] Error 2
make[1]: *** [Makefile:163: all] Error 2
make: *** [GNUmakefile:327: all] Error 2

How do I solve this? I found this answer which was very vague and didn't help much. I've added
CFLAGS = -fPIC -m64 -pthread -Wl,--allow-shlib-undefined -g

to GNUmakefile and changed the following line under "Build Blender"
$(BUILD_COMMAND) -C "$(BUILD_DIR)" -j $(NPROCS) install

to
$(BUILD_COMMAND) $(CFLAGS) -C "$(BUILD_DIR)" -j $(NPROCS) install

to no avail.

i think questions pertaining to compiling blender and/or modules are off-topic in this forum. you will need to ask at devtalk.blender.org

I don't think they are off-topic according to the site rules, however there are very little actual Blender C programmers that visit this site so the questions often remain unanswered and are better suited for devtalk :)

I cannot reproduce the issue on Linux. Have you checked that you are using the latest commit and library versions by running make update first?


text:
How to create proper text outline with geometry nodes
So the usual way to create text outlines is by creating a text object, Object data property > Geometry > Bevel > select "round" & increase "depth". How would one go about generating a similar look, using the String to Curves node?
The most obvious, and also, the only setup I've come across, is this:

But this doesn't give a desirable output. It's a bit jagged and uneven, and it becomes more glaring when you increase the thickness of it even further.

And so.. Is there a better way to do it? Thanks!

Try changing the handle type to Align using a Set Handle Type node. The curve also benefits slightly from being subdivided. you can add a Set Spline Type node near the beginning to change the type of curve used to display the "text" - not saying you'll use anything other than Bezier, but each has a unique look (although poly is probably closest to what you're trying to avoid):

Hey thanks, this does it! The subdivision also makes it a lot more accurate. Is there a way to "decimate" it afterwards so there's not a lot of geometry where there need not be, like on the parts where the curve path is completely straight?

That's a good question. The only thing I can think of art the moment is to apply the geometry nodes modifier and then use a decimate modifier - however, that is a destructive solution which may or may not work for you depending on your usage needs.

Why to apply GN modifier? You can use Decimate modifier just after GN modifier in stack ... I'm more curious if there is an option to generate outline and keep it as curve :) with GN.


text:
Can shortcuts be accessed through python script 2.8?
Can shortcuts be accessed through python script 2.8? I'm referring here at box select, tweak, cursor.
I know that is not best practice but I just curious how to access those left window buttons.

Hi. What do you mean by "access" the shortcuts? Are you just trying to activate the tools or do you want to do something with the shortcut, like edit it?

@RayMairlot to activate/deactivate them.


text:
Generating logic bricks with python in state 2
I'm unable to create any logic bricks in state 2 or any other state except the main one.
How can I create a brick that will appear only in state 2?

you have to click on that little arrow here:

then it will look like this:

if you then click on another visible block there, you will see only the bricks for that state. And if you add controllers or whatever there, they will only be visible in that state.


text:
How can I store the name of selected objects in a text file?
I would like to create an automatic list of the objects that have been selected with the mouse click.
So for example I have cube1, cube2, cube3, cube4.
I select them in the following order cube3, cube2, cube4, cube1 then a list on a text file shoud be generated in the order that they have been selected 3,2,4,1.

So the answer to this question is not as straight forward as you would expect. Blender is not storing the selection order for objects. It only stores the active object and a sorted list of all other objects. So what you really need is a way to catch all selection events. One way to do that is using a modal operator like this:
import bpy

class OBJECT_OT_record_selection(bpy.types.Operator):
    """Records the selection order while running and when finished with ESC saves it to //order.txt"""
    bl_idname = "object.record_selection"
    bl_label = "Record Selection"

    origSel: None
    selOrder: None

    @classmethod
    def poll(cls, context):
        return context.mode == 'OBJECT'

    def modal(self, context, event):
        # Update selection
        curSel = context.object

        # On selecting new object
        if curSel is not self.origSel:
            self.report({'INFO'}, 'Selection was changed')
            self.origSel = curSel
            self.selOrder.append(context.object)
        elif event.type in {'RIGHTMOUSE', 'ESC'}:
            # Use this to save to an internal text data block
            if "order.txt" not in bpy.data.texts:
                bpy.data.texts.new("order.txt")
            bpy.data.texts["order.txt"].clear()
            bpy.data.texts["order.txt"].write('\n'.join([obj.name for obj in self.selOrder]))

            # Use this for saving to a text file
            #try:
            #    with open(bpy.path.abspath("//order.txt"), 'w+') as f:
            #        for obj in self.selOrder:
            #            f.write("%s\n" % obj.name)
            #    self.report({'INFO'}, 'Saved order to file at ./order.txt')
            #except Exception:
            #    self.report({'ERROR'}, 'Error while writing to file at ./order.txt')
            return {'CANCELLED'}

        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        self.origSel = context.object
        self.selOrder = []
        if context.object is not None:
            self.selOrder.append(context.object)
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

def add_object_button(self, context):
    self.layout.operator(
        OBJECT_OT_record_selection.bl_idname,
        text="Record Selection",
        icon='RESTRICT_SELECT_OFF')

def register():
    bpy.utils.register_class(OBJECT_OT_record_selection)
    bpy.types.VIEW3D_MT_select_object.append(add_object_button)

def unregister():
    bpy.utils.unregister_class(OBJECT_OT_record_selection)
    bpy.types.VIEW3D_MT_select_object.remove(add_object_button)

if __name__ == "__main__":
    register()

Hello, I've tried the script in 2.8 and is not working. How should I use it?

did you copy the accidental marks in the last row? (I just removed them) It should work by opening it in a blender text editor and pressing "Run Script" Then it should make the modal operator available in the search menu and in Viewport > Select > Record Selection

Can confirm that the script works fine.

Thank you @HenrikD, is perfect. Can I use it in my add-on?

sure thing. How is it called?

@HenrikD Is not something finished is just a draft. Something like "Name Selector". One more question how can I generate the txt file inside blender text editor? I've tried to modify that absolute path with '''bpy.data.texts.new(new.txt)''' but is not working.

I updated the code to include a section for both cases

@HenrikD Thank you.

Hi @HenrikD I know it sounds stupid but how can I add the objects between " " I'm able to add the coma.

Found the answer: ' " ' +obj.name+' " '

'"%s"'%obj.name would also work well


text:
Create empty through script using a cube as origin (0)
It is possible to create an empty through a script but will have a fixed distance to a selected cube?
So lets say my cube is  at [3,5,6] I want to be able to select it run the script an the generated empty to always be 2 units away on +Y from my selection.
So in this case the empty will be at [3,7,6] in the world.
If for example a sphere is at [0, 11,0] generated empty using it as origin will be at [0,13,0].

See if this is what you want.
import bpy

#Get active(selected) object
act_obj = bpy.context.active_object

#Get active object location
act_loc = act_obj.location

#Add empty and set location based off active object
bpy.ops.object.empty_add(type='PLAIN_AXES', location=(act_loc.x, act_loc.y + 2, act_loc.z))

you are a star. I the meantime four a similar thing with obj.matrix_world.translation.y. But your code is perfect, thank you.


text:
Generating hooked curve through "n" number of points with python
It is possible to generate a curve in python through n number of points and the curve to be hooked to the points?
Extrapolating I want to be able to generate curve through center of cubes curve that will stay hooked with the cubes so any update to the cubes will update the curve.

import bpy
from mathutils import Vector
cubes = [ob for ob in bpy.context.scene.objects if ob.name.startswith('Cube')]
spline = bpy.context.active_object
length = len(spline.data.splines[0].points)
for i in range(length):
    bpy.ops.curve.select_all(action='DESELECT')
    point = spline.data.splines[0].points[i]
    cube = cubes[i]
    point.select = True
    point.co = Vector((cube.location.x, cube.location.y, cube.location.z, 1))
    cube.select_set(True)
    bpy.ops.object.hook_add_selob(use_bone=False)
    cube.select_set(False)

It's a bit quick and dirty, so here are the preparations you need to do:

The scripts selects the cubes by name, in alphabetical order. If any object in your scene starts with 'Cube' (e.g. Cube.001), it will be added to the cube array. There are more elegant ways to select a group of objects, but this was the simplest one.
You need at least as many cubes as the spline has points.
You need to select the curve and go into Edit Mode before running the script.


text:
Assembly process video
I'm new to Blender and I'll really appreciate it if anyone can give me advice on a project I'm working on right now.
I doing an assembly process video for a DIY product (step by step).
The product itself is a complex product with hundreds of parts (greenhouse) so I would need to have the parts appear only at the stage where they are supposed to be assembled. Unfortunately, I didn't find such an option in Blender, maybe someone know or can give me a tip that can help me with this project.
See reference:
https://youtu.be/rfA2q9Prstw
Thanks

You can keyframe every property by hovering over it and pressing the I key. You could make transparent materials, then fade in their opacity with keyframes. You could also keyframe their Rendering and Viewport visibility in the outliner with keyframes (the eye and the camera icons).

...and don't forget the flexibility which might be offered by splitting the action into shots, and simply cross-fading in an edit to introduce new components. That might split the project up into more manageable parts, letting you defer decisions about timing. etc..

Can you refer me to good video tutorial?


text:
How can I get or calculcate the acceleration of animated rigid bodies in an animation?
I'm trying to simulate IMU sensors in a Blender animation in order to generate data.
Specifically, I've parented (using 3-vertex parenting) mesh cubes to a human body mesh, which I've animated using IK bones. The cubes are supposed to represent the IMU sensors. I've made them active rigid bodies, but they're currently controlled by the animation. Here are a couple of example screenshots, the red box on the left thigh is the "sensor":

I would like to get the orientation and acceleration of these cubes for every frame.
I'm already getting the orientation using the object.matrix_world.to_quaternion() API call for objects. I would like to know if there's a similar API call or approach for getting or deriving the acceleration.
I've already read this post, as well as this one, but I'd like to know if there's a more accurate approach, or even an idiomatic or conventional way this is done in Blender.

I think rigid bodies are not necessary, they serve no purpose. You can get locations using matrix_world.to_translation() and then calculate the derivatives from that data as post-process. You can also get acceleration like this: A way to get Rate of Change in translation or rotation into a shader node. Using Animation Nodes plugin to calculate stuff is also a very good way.


text:
Rendering particles only inside an object?
So Im trying to render a ship inside a bottle with ocean and foam.

The particles in this project are supposed to be foam on the ocean. To only render the fluid inside the bottle I used an boolean modifier. I tried to do the same for the particles but I guess as there are 440k particles it takes way to much resources and blender crashes trying to calculate it. So my question is: is there another way to render particles only inside a particular object? I couldnt really find an answer anywhere online or in the documentation of blender.

You can give a mask in the layers tab. Please share your blend file so that I can take a look at it? You can do this by uploading the blend file on this site - https://blend-exchange.giantcowfilms.com and copy + pasting the generated url here.

I cant really get the blend to be under 60 mb so I cant upload it.. Can you explain what you mean? I have never worked with masks before


text:
White pixels on layer edges in compositing
I'm trying to composite a scene from multiple layers that I have previously rendered. Then, in compositing, some white (and sometimes colored) pixels are appearing on the edges of those layers, but I can't see them when I'm looking at the layer png alone. Does someone have experienced a similar situation?

Try these compositing nodes - defocus, despeckle, and dilate/erode.  Cryptomatte may also work better for some individual objects but it has to be enabled in render passes and can be difficult to work with if you haven't used it before.

Thanks for your help, looks like Despeckle did the trick ! But do you have any idea why those pixels appeared ?

without knowing more about your workflow I couldn't really say, it could be alpha artifacts from png file format, or something about the alpha over node

Ooooh yeah I think I figured it out, I rendered the image sequence as PNGs instead of EXRs, probably came from here. Thanks for your help !


text:
Is there any way to remove keyframes but maintain the curves of other frames as though they're still affected by the deleted frames? - for looping

As stated above in the question.
I'm basically looking for ways to maintain an animation "loop" within a set of key frames so that the loop is confined to the set amount of keyframes when using NLA.
This can obviously be done manually but with lots of moving parts it would quickly become an extremely arduous task.
Thanks in advance.

There is an option to remove unnecessary keyframes.  If you apply it to an F-curve, then every keyframe that remains affects the shape of the curve.

Thanks for the reply. I'm assuming you're talking about the clean frames option?
Not quite what I'm after unfortunately. I'm looking for a way to maintain the bezier curve of a frame when other frames (that influence the shape of the curve) are removed.

I wasn't clear.  I'm trying to say that if a keyframe remains after you've cleaned frames then it is necessary.  Removing it will change the shape of the curve.  What you're looking for can't be done.

Ah okay, thank you for the clarification. Thats a shame.

Okay I've actually figured out how to do it. Basically if you had a loop from 0 - 20, you'd create keyframes at the start and end point of the loop, change the curve handles on those to free, then delete keyframes that fall outside of your loop. This would allow you to have a clean (loop duration) NLA frame.


text:
Blender 3: Resize to exact dimensions without affecting scale
I'm struggling to figure out how to resize an object (a cube, a plane) to an exact size wthout its scale also changing.
tl;dr: I want to add a cube, and set its dimensions to exactly 400x300x40 cm while keeping the scale at exactly 0.01
Requirements: Unreal Engine :)
Unreal Engine's units are centimeters, and Blender's are meters. A common solution to this seems to be: set scale in Blender to 0.01, and then resize the objects as needed:

However, if I want to create an object with exact dimensions on the same scale from scratch, I struggle.
Problem
Let's say I want to create a wall, 4x3x0.4 meters (400x300x40 cm).

The default cube will have a scale of 1.0, which is expected.
When I set the scale to 0.01, it becomes very small, which is also expected.

Now:
If I change cube dimensions in `Object Mode, its scale changes (this is also expected, I think)
Right after setting the scale

Right after setting dimensions

If I switch to Edit Mode, and use `Scale...

there's no way to see object dimensions except to switch back to Object Mode?
there's no way to set exact dimensions? Numeric input resizes by that number, doesn't set the size to this number

So the question is: How do I set an object's scale exactly without changing the scale?
Thank you!

Have you tried using exact dimensions in Blender with scale at 1.0 and then adjusting the scale on export? There are also plenty of tools for measuring in edit mode with the ruler and MeasureIt add-on.

maybe use one of the methods I cite here? https://blender.stackexchange.com/questions/262065/scaling-an-object-using-a-single-face-or-edge/262070#262070

@RobertGützkow Ah, thank you for MeasureIt, I wouldn't have discovered it myself. I have't tried changing scale on export yet (partly because I already have some reference models in 0.01, and didn't think of changing their scale)

@moonboots Thanks! I found the steps a bit too advanced for me so far, but MeasurIt will serve me so far. Thank you!

@Mamut you can always apply the scale with CTRL + A > Scale to get it back to 1.0.

@RobertGützkow The thing is, I want the scale to stay at 0.01 for later export to Unreal Engine :)

@Mamut Yes, but you can keep all objects at scale 1.0 within Blender and then just adjust  the scale once in the exporters settings. Applying the scale for your reference models would help to ensure a consistent scale rather than having to adjust each one individually.

@RobertGützkow ah! Thank you, I'll try that!


text:
How to disable ACES in Blender 3.2 (further question)
I'm struggling to disable ACES even after installing the depository by Ginurx, linked in this thread: How to disable ACES?
Please, if anyone here could give me a hand, this would be an immense relief. I need to enable the default profiles of Blender for a collaborative project that needs to be finished very soon and switching to ACES isn't possible for this case. However, I can't figure out how to edit the batch file for starting Blender 3.2 without ACES. I even tested putting a config.ocio file into the colormanagement folder, that a friend of mine shared with me, who doesn't have ACES installed at all, and my Blender 3.2 still launched with ACES as the color profile. I read the whole documentation here, but I still can't make it work: https://github.com/Ginurx/Blender-ACES-Config
I followed the installation Method 1.
Thank you for any tips and help in advance.

If you still have a backup copy of the original "colormanagement" folder, then you could simply rename the current one to, e.g. "colormanagement-ginurx" and copy the original "colormanagement" into the "datafiles" folder. If you do not have a backup copy, the simplest solution is probably to download the portable version of Blender (blender-3.2.1-windows-x64.zip) as a separate copy without the modifications. What particular part are you having trouble with?

My colormanagement folder already contained ACES so the backup I have is kind of useless I guess. I will try to pull it form the portable version you sent. Thank you!

Even after replacing it with the one from the portable installation, my Blender still launches with ACES.
I'm not sure this plays any role in it. I also have Octane for Blender installed. But I'm not using it in this project.

It seems like another OCIO file over-writes it.
https://imgur.com/a/5y2sHUp

You probably have the OCIO environment variable set. You can open a command prompt in Blender's folder by typing cmd into the path bar of the Windows Explorer and pressing enter. Run set OCIO= and then .\blender.exe. Does that work?

Dear Robert, these replies mean a lot. We agreed that I will do my part in ACES and I already started recalculating the the rgb values of shaders etc, so now I need to manage it with ACES. I will however return to this in a week and try to make it work so that my Blender version would allow me to choose in the future. So if you don't mind, I will write back here in case it was still not working after the last tip from you. If there will be silence, it means I managed thanks to your advice. Be well!

If you restored the colormanagement folder, Blender still works in ACES mode. It's much likely that your OCIO environment variable has been set, as Robert Gützkow
 mentioned.
You could open cmd and type echo %OCIO%.
If a path were to be printed, you have to delete the OCIO environment variable in system settings.


text:
UV mapping: fit image to cylinder projection
I want to map a beach panorama.jpg to the inside of a cylinder such that it makes a room with a circular beach wall in my virtual environment.  I've gotten this far.

I need to either mold the image to the shape of the map or straighten out the map so that it fits the rectangular image.  I'm still fairly new to blender so this might be an easy solution -- any assistance is appreciated!

Related https://blender.stackexchange.com/questions/74041/how-to-perfectly-align-uv-coordinates-automatically and https://blender.stackexchange.com/questions/92812/how-can-i-assign-an-image-texture-on-a-circle/ or https://blender.stackexchange.com/questions/78358/how-to-straighten-curved-uvs-into-straight-belt

Possible duplicate of Help with smart UV

Awesome! The map looks great now. This might be a naive question, but now when I add my panorama in the UV editor it only fills one of the quads. How can I make it fill all the quads or shorten the quads symmetrically to the image?  Thank you!!

You can use the scale and translate controls in the UV editor to make the image match the layout of the UV unwrap.


text:
How to change the position of the skeleton in all frames with a script?
There is animation. For example 40 frames. It is required using a script to change the position of the skeleton along the Z axis in all frames. For example, raise the skeleton in all frames by + 2 along the Z axis. Please tell me how to do this or where can I read about it?
Regards. Thank you for your help!

Make an Empty.
Make the Empty a parent to the skeleton.
Move the Empty to where needed, the skeleton will move with it.

Thank you! A good idea. But exporting to BVH in the game engine does not change anything. The animation position is above the ground. The character is in the air. It doesn't stand on the ground.


text:
Internal "get/set" function of property?
Here is my test code and picture:
import bpy

# Simple property reading/writing from ID properties.
# This is what the RNA would do internally.
def get_float(self):
    return self["testprop"]

def set_float(self, value):
    self["testprop"] = value

#bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float,set=set_float)
bpy.types.Scene.test_float = bpy.props.FloatProperty()

bpy.context.scene.test_float = 12.34

When I don't explicitly set the "get/set" function for my property, after assigning the value, I can get the property value by 'scene["test_float"]', but if I explicitly set the "get/set" function, then if I try to type in the same commands, I will receive a error "KeyError: 'bpy_struct[key]: key "test_float" not found'" . So what should I do to get the same results by using explicitly
"get/set" function?

you could simply retrieve the value using bpy.context.scene.test_float instead of looking it up with the bpy.context.scene["test_float"] syntax. This works in both cases for me.

It's named "testprop" not "test_float"
When a property defined via
bpy.types.Scene.test_float = bpy.props.FloatProperty(...)

is assigned a value scene.test_float = value  it is stored. "behind the scenes" as a custom property scene["test_float"]  ("second time above")
In the get / set example ("first time above") it is instead stored in a custom property named "testprop".
Instead, had  the custom property been named "test_float" in the getter and setter, it would emulate the behaviour of the float property without a getter and setter, and be reflected in the value and existence of scene["test_float"] when set.
Perhaps this needs to be an edit in docs re what RNA would do internally.
Note if the getter is defined thus
def get_float(self):
    return self.get("test_float", 0.0)

def set_float(self, value):
    self["test_float"] = value

bpy.types.Scene.test_float = bpy.props.FloatProperty(get=get_float,set=set_float)

it will return a default value, in this case 0.0 even if the property has not been set.

use self.testprop. the property exists this is just if you use self['testprop'] the self is refering to the local context and is not able to update the dict further. I guess the dict should be passed in argument to use self['testprop']


text:
Civic art project: 5'H x 5'W 3D heart shape sculpture. Can Blender map a 12" grid on it? From photos?
Please forgive my intrusion into your amazing Blender world, I downloaded Blender in the hope it might help but, as a artist in the physical world it's all Greek to me so I am hoping someone here can help me out with this project.
The photos show the problem, I hope. Our city has installed a number of these 5' high by 5' wide fiberglass 3D hearts around the city and asked local artists and art related businesses to decorate them. My colleagues and I will be covering one in mosaic. We are at the planning stage...
The mosaic will be applied to 12" squares of thin mesh first and then those squares of mesh will all be attached to the heart later, all on the same day.
My hope was/is that Blender can work with photos of the heart sculpture, dividing the heart into 12" squares so we can plan the design to fit the heart as accurately as possible in advance. I've attached one compilation photo showing the sculpture from several angles but I had to downsize it drastically to be able to attach it here and I have no idea if it's enough to work with.
My question ... Can Blender wrap the heart with a 12" square grid and then allow us to flatten the grid out, so we can add a mosaic design over that and make sure it will fit around the surface of the heart?
Or, if we came up with a basic design, can Blender then wrap that design around the heart, and let us add a 12" grid pattern over that, then flatten that out so we can see how to lay out design on the pieces of mesh.
Either way we can definitely tweak the edges of the various mosaiced sections around the edges to make it fit when the time comes, but if we can use Blender to reduce the amount of 'in situ' work required to a minimum we would love to do that.

Related

Yes.
You will first have to model the heart which shouldn't be a problem considering you can get all the dimensions you need.
It may take a lot of tweaking to get precise measurements but you can get very close with little difficulty.
Blender has an option to change units. This includes Inches :D
Once you have created the model, look into UV unwrapping in Blender. There is plenty of tutorials on it. You can paint the object in Blender without exporting but I recommend exporting it and using a program like Gimp or Photoshop for better results. You could also print the UV and draw over it, then scan it back into the program.
You should be able to find tutorial videos on all the things you wish to do.
Some other helpful tools you may want to look into would include:

Grease pencil
Mirror Modifier

Helpfull Links:

Units in Blender
Blender for Beginners
UV Unwrapping

Though it won't make much of a difference when modelling, if you want to render a design picture, I recommend using cycles engine.
Good luck with your project and I hope I helped,
BFB

Thanks for the ideas and advice, much appreciated! :)


text:
Addon BLAM - Lines doesn't line up
I have a strange problem with addon called BLAM. I watched a lot of tutorials about using BLAM, but I can't figure out what is the problem. It isn't first time when I'm trying to recreate a real scene into Blender and lines just doesn't line up.
Here are some screenshots from Blender.

Of course I'm trying to best match perspective lines to image. In this case it's not actually that bad, but still it makes harder to fully recreate our scene without dimentions.

Am I doing something wrong ?
Sorry for English, Matt


text:
Color Management "Look" setting VS controlling via environment
Just wanted to know if the contrast options in the "look" dropdown of Color Management settings do the same thing as just manipulating the environment, lights, materials, etc. basically, is the same result achievable using either method?
For instance, could you get deeper blues, or more saturated yellows using the Look settings vs just adjusting materials/environment lights/etc?
Any info is appreciated, thanks!

You can control contrast to a degree by how you set up lighting and film exposure, so most of the contrast options can be simulated by carefully doing those things.  The difference is that the contrast "look" can be changed without changing those things, so you can quickly switch between the two.
The trade-off is that the look applies globally, while lighting changes can adjust some areas of a scene without affecting others.


text:
How can i make a texture/material of this kind of fabric that looks realistic?
I'd like to have a material or texture that looks like a patchwork fabric kind of like these images here, with checkered decorations, do you have any advice/nodes to make it look at least semi realistic? It doesn't need to have such elaborate decorations but ti should still look similar

Hi :). What have you tried so far and where exactly are you stuck? Such material has multiple tricky aspects.

You might want to check out Knittr - Procedural Knitwear Shader by Simon Thommes


text:
Hair particles from the vertex groups inserting into mesh instead of extruding away from mesh

i tested the function on a sphere with proper vertex group and it works just fine, but i assigned different weight to scalps for a head manually with caution but it keeps inserting from the vertex group inside out.

Are your normals all facing outwards? I'd imagine hair particles emit in the same direction as your normals...

ya, select the whole head mesh and then push Shift+N to recalculate normals.


text:
How to get a disparity map from depth map in Blender?
I am trying to convert the depth map to a disparity map but I got some problems. Here is my setting in compositing nodes.

I use these two equations:
(1) focal_length(pixel) = focal_length(mm) * resolution_x(pixel) / sensor_size_width(mm)
(2) disparity = baseline(m) * focal_length(pixel) / depth(m)
The result is weird, as you can see. The output(disparity map) is totally bright. What's more, I can't use it to train my stereo match network, something must be wrong. Could anyone tell me how to fix it? Thanks.
One more question, in order to train my network, I have to convert disparity map files(.exr) to .pfm format. What tools can I use to complete this task?

My setup follows the same formulas you described:

This should be enough if you want to save your disparity to file (possibly in OpenEXR format since it is the only format able to handle floating point values).
If you want to render it as well, you should add some visualization nodes:
In particular you should divide the disparity (which in the previous image would be the output of the last divide node) by the width of the image (or more in general for your disparity range, if you have a minimum disparity value before dividing you should also subtract it from the disparity).
One more suggestion to make your life easier: instead of hardcoding the camera / stereo rig parameters directly in the value nodes, you should add the values using drivers. I'll show you an example with the stereo rig's baseline:

Add a value node:

Paste the copied driver on the value node:

EDIT:
I forgot to answer the last question about the conversion from .exr to .pfm:
I think the quickest way to achieve this is to do it in Python: open the .exr file using OpenCV in the following way:
os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1"
import cv2

...

img = cv2.imread("filename.exr",  cv2.IMREAD_ANYCOLOR | cv2.IMREAD_ANYDEPTH)
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

and either save it in .pfm using OpenCV:
cv2.imwrite("filename.pfm", img)

or do so by using a script belonging to one of the many disparity estimation deep learning's repositories you can find on GitHub (you can find some of those here: https://www.programcreek.com/python/?CodeExample=write+pfm)


text:
What's the fastest method to output grease pencil line art images?
I'm using line art modifiers to generate stylized outlines for some meshes.  I'd like to be able to do this process with some improvements:

Simplicity:  The output images I want are just the line art (with other Grease Pencil modifiers stacked on top) over a monochromatic background.  No meshes, lighting, textures, effects, etc.
Speed:  I'd like to make lots of small changes to the base object positions, and get the output images fast.
Runs in the Background:  Ideally, this would be automated blender process running through the command line with --background option.

My current workflow is:

Transform the base object.
Set the world surface to the desired background color.
Bake the line art.
Render and save the output image.  The base Grease Pencil object is the only visible object during rendering.

Baking is the most expensive part of that process by far.  I'm using a moderately complex mesh to do rough testing.  It takes 10-20 seconds to bake a grease pencil object with ~100 strokes / ~10-50 points per stroke.  I got those numbers by applying the line art modifier.
However, if Viewport Shading is set to SOLID and I haven't applied the modifier yet, the real time line art preview takes 1 second max to update.  That has me thinking there should be a way to side-step the baking and rendering for speed.
Left to my caveman brain, I'd consider coding something to hide everything but the line art, then take a screenshot of the Viewport.  However, even if that weren't a terrible hack, I don't think it'd work while Blender's running in the background anyways.
Does anyone know of a way to get those Viewport images or speed up the process elsewhere?

Alright, on the slim chance someone else needs the same thing I did.
All I needed to do was rephrase my search.  A Viewport render can be done manually from the View tab in the upper left (next to the Mode selection menu).  That corresponds with the Python API command: bpy.ops.render.opengl().


text:
Cloth simulator, but with different densities
I have a need... to throw some clothes on the ground, simply put.
Normally I'd do a cloth simulation, but now I'm dealing with clothes that have elements that, unlike the rest of the dress need to stay rigid.
I'll give an example: a bra.
Of course, the straps must be able to go all over the place, but the cups must remain rigid, during the simulation.
Or, more trivially, pants with a metal zipper. This must remain rigid... affecting the fabric around it, I might add.
How can I do?

you can use the property weights for that behaviour:

define a vertex group, choose it e.g. as bending group and change the max bending.
I did this in this example and colored it red and blue so you can hopefully better see the difference between the behaviour / bending.


text:
HoSt model with broken texture
So I exported a Alextrasza's dragon model from HoST but for some reason the textures are broken/distorted. I tried UV unwrapp and Smart UV but it just go worst. Any idea how to fix it?

Have you checked the UV map(s)? If it is a textured game model with an existing image texture, then UV unwrap will not help without manual adjustments because the UV map has most likely been edited.

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

Can you add your blend file to your question? (How to add a blend file) Also, I don't recognize "HoST", could you explain in more detail how you got the model?


text:
How do I make a stylized procedural tree texture?
I'm trying to recreate this tree texture from genshin impact with procedural nodes:

This is what I have and it looks nothing like it:

Any ideas how I can get it a little more similar? Or some resources I could look for? Thanks!
This is the blender file:
https://drive.google.com/file/d/1F8Jw_H1wxgR6rdGN9AtDGxXbL-F2Wa6k/view?usp=sharing

That looks like it has custom high poly detail sculpted and baked down.

Or maybe a baked cavity map from a high-poly sculpt. But this is also not procedural and requires baked textures.

Dang it, I knew it'd be too easy otherwise lol, thank you both.


text:
What's the easiest way to contract and expand folded patterns?
I'm trying to create a folding paper thing like shown in this video https://bramfritz.nl/wp-content/uploads/2024/05/paravent_base_grid_1-1.mp4
It goes from being somewhat flat, to scrunched up into a design, just like how paper would work IRL if you scrunched it up.

I'm thinking about doing rigid body physics, but is that the best way to go about it?


text:
How can I make something fold, but have specific parts be foldable and others leave unfolded?
When I look at methods to create a folding door or something similar, there is always one parent node that rotates and rotates the rest of the panels/paper to fold, how do I make it so I can fold a segment while keeping some of it flat?
This video for example shows a paper folding in the center it's flat and on the edges they are being folded without being streched.
https://bramfritz.nl/wp-content/uploads/2024/05/paravent_reader_16-9.mp4
Right now I'm using a method where it folds properly with copy rotation and add parent keep transformation such that when I rotate my left most panel, all the other panels update, but how do I make it so I can rotate any panel and have it only affect without it affect the sizing/strecthing of the other panels?


text:
What's the easiest way to evenly distribute a mesh around a circle/cylinder mesh?
I have a cylinder mesh like this:

And I want to distribute a bunch of rectangular meshes around it evenly. This isn't evenly distributed because I manually duplicated and rotated my rectangular meshes around the cylinder.

How do I make it even around the cylinder mesh and match the rotation?
Thank you!

Put the 3D cursor at the center of the cylinder (probably the center of your scene so you can simply press ShiftC), choose Transform Pivot Point > 3D Cursor:

Then select the rectangle mesh, press ShiftDR30 (if you need 12 duplications) Enter and then ShiftR (repeat) as many times as needed:

if you are not sure how many cylinders you need or if you want to have that dynamically/procedurally, you can use this node setup in geometry nodes:


text:
How do I make a cartoonish material in Blender Cycles?
I'm trying to make a stylized material like this:

I want to bake it eventually so I can only do it in cycles, but I can't seem to get anything close, this is my closest render but the shadows are so soft (unlike the picture) and the material doesn't feel the same.

These are the materials I'm using ->

Here's my blender file:

I think this question is poorly worded or at least focusing on the wrong part of the problem. This doesn't seem to be much about materials, if at all. The main issue seems to be shadows and lighting which has been covered extensively https://blender.stackexchange.com/questions/44719/meaning-of-sun-lamp-size https://blender.stackexchange.com/questions/33871/is-there-really-a-way-to-make-a-true-toon-shader-material-in-cycles/ https://blender.stackexchange.com/questions/38918/making-very-hard-shadows-softer

@DuarteFarrajotaRamos Sorry I didn't know lighting was the biggest issue, and thank you I will look into those posts.

No problem, if non of those solve the issue, please edit your question with further details of what went wrong

when you think about it, shadows come from light in real life, surface will only have a small influence on them ;)

Per help from the comments, I did not have to change my materials, just my lighting. I used a sun light and a power of 12 and now it looks very cartoonish as I wanted with solid shadows.


text:
Is it possible to make an array modifier "fan out"?

In this picture the first row has 5 and the last row has 15 seats. Is it possible to use two array modifiers to accomplish this task?

I don't think there is a way to do that with just Array modifiers, but it should be possible with geometry nodes. I put together an example with making a grid and removing values to far away from an empty:

Additional details on technique I used: "how do I delete geometry with proximity?"

If only the array mod were a node that could be driven with values. ;)  Maybe someday...


text:
How do I unwrap a mesh after using the Boolean tool?
I used two rectangle meshes and the boolean modifier to cut out holes for my house, but it left me with some geometry like this:

How do I unwrap this? Even my best attempt (shown below) still has stretching.

Here is the file
https://drive.google.com/file/d/16swON_OrqXkMk9nR01ZXSvMkO9rzHpOA/view?usp=sharing

Your question is too vague, the way you need to unwrap completely depends on how you want to put your textures on the object afterwards. But I see at least 2 ways to do it from your current object, and in both cases the UVs will be orthogonal:
Unwrap with seams: to create seams (seams are where the unwrap will cut off separate parts), select the edges you want and press U > Mark Seam:

Then unwrap with the first option (Unwrap), here is what it will give:

Unwrap with Smart UV Project: This time you'll let Blender unwrap automatically, the UVs will be separate according to the angles of the faces (you can set the angle you want in the Operator box but the default setting, 66°, is ok):

Thank you so much I love you moonboots. Do you have a donation box I can donate to?

thanks, you're welcome, I don't have any donation box actually  ;)

you should consider having one (if you want of course) and post a link in your bio, I've seen a lot of people do it.


text:
What's the easiest way to make a tater tot/hashbrown texture/bumps in blender?
I'm trying to make a tater tot but have no idea how to start. I've got a cube with a subdivision surface modifier on it, but don't know where to go from here. I'm assuming there must be a way to simulate the edges of a tater tot/hash brown texture but I don't know how I would do that.

Tater tots look like this:

https://blender.stackexchange.com/questions/214004/how-to-create-a-realistic-shader-for-french-fries  https://blender.stackexchange.com/questions/84745/create-irregularly-shaped-gaps-in-cube

Sounds good, thanks!

If you're going to model/ sculpt the bumps of the tater tots, that will not only be tedious, but is on top of that time consuming, as well as much more demanding in computing and rendering time.
I'd suggest you make the rest just with shaders.
I got something like this from that method:

It is completely procedural, is quickly set up and everything about it (coloring, softness, Displacement/Bump) can be changed without any effort.
But first you have to make sure your render engine is set to cycles, as well as to "experimental" instead of "supported". Further more, you have to add another subdivision surface modifier to the cube and tick the little box next to Adaptive Subdivision.
Here's the node tree and last but not least, make sure to change the Displacement Method (Material > Settings > Surface) to Displacement and Bump, just like in the blue marked area in the picture.
After that everything should work just fine:

Alter the settings of the Nodes to adjust the appearence. If you want to, you could switch the Subsurface Scattering Node for a Principled BSDF one.
Hope it helps

Great now I'm hungry! Didn't know you could make tater tots in a Blender

Tell me about something you can't make in blender :)

@NiklasFriedrichs Gravity that affects light paths. Cycles doesn't simulate that :( Although you can make it look like it's doing something for, say, black holes, with a refraction BSDF.

Well...what shall I say about this xD. Your right...maybe i should've limited it to objects


text:
HDRI backgrounds are different brightness and i can't figure out why!
So i have a scene i'm happy with using an HDRI from blenbderkit. But strangely enough if i open up the same HDRI on a new file, its a lot brighter and does not look right. I've checked all nodes & render / viewport settings between the 2 files and everything looks to be the same! Please see examples below.
Can anyone advise how i can get a new project to look the same ? instead of this super bright HDRI
New Project Example:

My Old Project:

Any Help greatly Appreciated!

Please use screenshots instead of photos of the screen, especially when comparing color, photos are more difficult to work with.  You've also cut off the Outliner, which hopefully would show any non-HDRI lighting used.  A screenshot of your World shader would be helpful.  Is this Cycles or EEVEE?  And it can be a good idea to post your blend file, or a truncated version of it that has the problem, and the HDRI packed (if feasible, if not a link to which Blenderkit HDRI you're using). The Blender StackExchange has its own service to share blend files: blend-exchange.com/help

If it's the same HDRI, and the same render engine, then you can adjust its Strength setting in the World Properties panel of the Properties editor.  If both projects use the same version of blender, that shouldn't be necessary; but the units for Strength have changed from time to time.

Often, blender uses "Linear" as the default color space for Environment (HDRI) Textures - however, some HDRI images are built to work in sRGB color space - try changing it. If that doesn't work, try changing the View Transform from "Filmic" to "Standard" under Render Properties > Color Management.

These examples use the included HDRI sunset.exr in Blender 3.1.2.  Although you said “I've checked all nodes & render / viewport settings between the 2 files and everything looks to be the same” there are a few things that could've been missed.  One is if in both your files your World Shader has the HDRI in an Image Texture Node:

Or (as should be for an HDRI) an Environment Texture Node:

The above examples were rendered in Cycles, are both of yours?  Or is one in EEVEE:

And (thanks to Marty Fouts comment above) are you sure the Background node's Strength is the same in each file?

I will re post when i get home showing the Nodes, Both images are Cycles GPU rendering and both HDRI's are at strength 1


text:
No fluid simulation anymore
I needed to free up my data to re-bake it, and now my domain is stuck at the solid square box even after baking data and mesh. If someone can help me out, that would be amazing. I have attached the blender file through the dropbox link. Thank you so much. I even put it in bounds viewport to see if I could see the particles, and nothing.
Blender file: https://www.dropbox.com/s/r2t7o0jjr3z9oev/can%20blend.blend%20fix%20copy%20.blend?dl=0

you obviously deleted your fluid. You just have a domain and effectors in your scene, but no fluid of type liquid at all.

@Chris hey Chris thank you lol, it wasn’t obvious at 7 this morning, so not sure where my fluid went I just rendered them. but thank you so much!! :)


text:
Completely different render image from viewport Cycles

Hello below I have what is supposed to be the rendered image, and the second image is what is being rendered. I am not sure why this is happening, assuming a certain setting in my render properties. But, I can't seem to figure it out. Thank you!

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

@moonboots I ended up figuring it out! I had my displacement modifier set to view in render but not viewport. just in case anyone else has an issue!

Ok I was wondering if it was that or a Displacement node, you can answer to yourself actually

My displacement modifier was set to only show in render instead of viewport.


text:
Boolean Difference - how to remove the "cutter" without having the effects disappear
My boolean difference disappears when I delete the placeholder object that I created just for the difference.  Here are my steps.

Create a simple cube (Cube1).
Create another (Cube2), make it a bit smaller and move it so that part of it intersects the original cube.
Select Cube1 > Modifier Properties > Add Modifier > Boolean
Make sure the modifier is set to "Difference" and under "Object" associate it with Cube2.

The works as I would expect - in that the original cube has a section cut out of it... but I have to hide Cube2 to see it.  If I delete Cube2 the effect of the modifier on Cube1 gets deleted with it.
I can understand why - but I've seen videos where people can delete the "cutter" objects (Cube2 in this case) and the effects remain.  How do I make that happen?

Just apply the modifier

I don't have an "Apply" option... I'm using Blender 3.

Check this: https://blender.stackexchange.com/a/255821/86978

Also if you want to keep the modifier in an unapplied state, you can set it's Viewport Display mode to "Bounds" like this.
It also makes sense to enable the "Bool Tool" addon, which comes with Blender by default and does all this for you automatically. Enable that and then you can just select the cutter, select the receiving object and then push "Ctrl" and then "Numpad +" for union, "Num -" for difference, and "Num /" for intersection.

To apply a modifier in Blender 3x, just select it in the modifier panel so that it's outlined in blue and press CTRL - A. You can also click the down-facing arrow to the right of the line of icons in the modifier panel and select 'Apply'.


text:
Python script creates Panel/Buttons in scripting workspace using the play button, but not when installed as add-on
So I created my first blender python script (yay), and the script works pretty well! Sure learning python by using it against grease pencil is probably a madmans desire to go insane, but I've already crossed that bridge.
The issue I am having is that when I go in and add the script as an add-on, the panel and two associated buttons do not appear. If I am in the scripting workspace and click play, it works normally.
I'm sure I'm missing something obvious but I was wondering if someone could guide me in the right direction.
I stripped out everything I think is not relevant, with the below barebones setup, I am able to simulate the issue. In script editor, pressing play creates the MISC section in the N panel (forgot the actual name but the thing that opens up when you press N), but importing it as an add-on does nothing.
#Import Necassary Modules
import bpy
#stuff goes her

###### GENERIC INTRO

bl_info = {
    'name': 'Creating a Perspective Grid for Grease Pencil',
    'category': 'All'
}

#########Variables
#stuff goes here

###############PANEL FOR UI###############

class PerspectiveGridPanel(bpy.types.Panel):
    bl_idname = "PerspectiveGridPanel.panel1"
    bl_label = "Perspective Grid Panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    ###Draw the VP Button
    def draw(self, context):
        self.layout.operator("perspectivegrid.gp", icon='MESH_CUBE', text="Create Greapse Pencil Object")
        self.layout.operator("perspectivegrid.vp", icon='MESH_CUBE', text="Create VP")

##########################################

############### THE BUTTON THAT DOES STUFF###############

class GPOBJECT_OT_vp(bpy.types.Operator):
    bl_idname = "perspectivegrid.gp"
    bl_label ="Perspective Grid Vanishing Point Genration"
    def execute(self, context):

        #######Grease Pencil Object Creation
        #stuff goes here
        return {'FINISHED'}

############### THE BUTTON THAT DOES STUFF###############

class PERSPECTIVEGRID_OT_vp(bpy.types.Operator):
    bl_idname = "perspectivegrid.vp"
    bl_label ="Perspective Grid Vanishing Point Genration"

    def execute(self, context):
        #stuff goes her
        return {'FINISHED'}

        ###########################################

#####################REGISTER / UNREGISTER######################

def register():
    bpy.utils.register_class(PerspectiveGridPanel)
    bpy.utils.register_class(GPOBJECT_OT_vp)
    bpy.utils.register_class(PERSPECTIVEGRID_OT_vp)

def unregister():
    bpy.utils.unregister_class(PerspectiveGridPanel)
    bpy.utils.register_class(GPOBJECT_OT_vp)
    bpy.utils.unregister_class(PERSPECTIVEGRID_OT_vp)

if __name__ == '__main__':
    register()

Your panel class needs bl_category so that Blender will know which tab to add it to in the side panel.  I tend to put mine in their own tab and use
    bl_category = "TLA"

but some people prefer to add their panesl to the "Tool" tab.

Hi, so I added a bl_category, and can confirm that rather than creating a MISC tab it now creates a tab with TLA or whatever I type in there when I press Play from scripting, but it still does not load when I go to preferences and install it as an add-on.

Thanks to the kind folk over at blenderartists.org, I was able to get a resolution, there are multiple fields in bl_info that need to be filled out. The example provided for me was
bl_info = {
    'name': 'TimeTracker',
    'category': 'All',
    'author': 'Joseph Hansen',
    'version': (1, 0, 0),
    'blender': (3, 0, 0),
    'location': '',
    'description': 'Keep track of your time working in Blender'
}

https://blenderartists.org/t/unable-to-get-self-made-python-script-to-work-as-add-on-works-fine-in-scripting-workspace/1389576/2


text:
PropertyGroup Properties do not exist until value is changed in panel
I am having some trouble. Basically, when I load up this script, I see a panel drawn with a simple value that can be changed.
The value shows as expected in the UI, and the propertygroup I see exists as expected under bpy.data.scenes['Scene']['PerspectiveSettings'], but not the LineCount value. My expectation is that when the PropertyGroup is registered, it would register the properties with their default values (not sure if this is a correct expectation or not)
Is there anything I can do to initialize the LineCount property under bpy.data.scenes['Scene']['PerspectiveSettings'].['LineCount'] on startup?
    import bpy
    from bpy.props import PointerProperty, EnumProperty

    class PERSPECTIVETOOLSPANEL_PT_main(bpy.types.Panel):
        bl_idname = "PERSPECTIVEGRID_PT_main.panel"
        bl_label = "Dummy Panel"
        bl_space_type = "VIEW_3D"
        bl_region_type = "UI"
        bl_category = "DummyTest"

    def draw(self, context):

        scene = context.scene
        layout = self.layout
        PerspectiveSettings = context.scene.PerspectiveSettings
        row1 = layout.row()
        row1.prop(PerspectiveSettings, "LineCount", text="Line Count")

class PerspectiveSettings(bpy.types.PropertyGroup):
    LineCount : bpy.props.IntProperty(
        name = "LineCount",
        description = "",
        default = 20,
        min = 1,
        max = 100
        )

def register():
    bpy.utils.register_class(PerspectiveSettings)
    bpy.types.Scene.PerspectiveSettings = bpy.props.PointerProperty(type=PerspectiveSettings)
    bpy.utils.register_class(PERSPECTIVETOOLSPANEL_PT_main)

def unregister():
    bpy.utils.unregister_class(PerspectiveSettings)
    del bpy.types.Scene.PerspectiveSettings
    bpy.utils.unregister_class(PERSPECTIVETOOLSPANEL_PT_main)

if __name__ == '__main__':
    register()

This may help ? https://blender.stackexchange.com/a/227679/86891

Unfortunately I don't think so, everything is drawn in the UI correctly, it just doesn't exist in blenders "insides" until the values are changed in the UI.

Apparently this should be chalked up to my general lack of Python knowledge. After poking around in the Python Console I noticed that while
bpy.data.scenes['Scene']['PerspectiveSettings']['LineCount']

does not exist until the UI is modified. But,
bpy.data.scenes['Scene'].PerspectiveSettings.LineCount

DOES exist.
Why, no idea, but this appears to be it.


text:
What is the alternative for point separate node in blender 3.1?
Point separate node which was available in 2.93 version is not available in 3.1 version. What should I use instead of point separate node to get the same output?

it is call "separate geometry":

Thank you so much

You are welcome!


text:
Rigging cloth to follow only part of a mesh
I'm trying to create a character that has a blanket over its legs. I want to be able to move the feet underneath the blanket to make the blanket move, however I'm having a hard time achieving this. I've tried following other tutorials on rigging clothes but they make the blanket stand up straight and not move correctly, or completely deform depending on how I did it. I was thinking it had to do something with weight painting but I wasn't sure. I messed around with it a bit but still couldn't get it to do what I wanted. I feel like I'm missing something obvious. I'm a complete novice at blender so any help is much appreciated!!

You don't provide a lot of information so that people can help you.  I would not focus on weight painting, however.  It appears that the cloth "collides" properly against you character and gurney in the first picture.  You may want to edit your question to add what the second picture is about -- is it a later frame where the character moves?

If you move your leg left or right under a blanket it won't go that way. The blanket will move up and down according where the leg rise it. So you can't solve this with rigging, you have to use only simulation.

Yes, the cloth collides fine when the character is still, but when the animation starts the blanket doesn't react at all. So when I tried parenting it to the bones in the feet, the blanket stands up straight and is kind of deformed. Then any movement of the feet affect the whole blanket instead of just a little part. If there's anything else I can add to make it clearer please let me know! @james_t

I would not parent to any other object, especially armature.  You want pure cloth simulation with your two Collision objects.  Try adjusting the Collision objects Cloth Thickness.  I usually reduce the default inner to be the same as the outer of 0.02.  If you can get a small enough test-case file.  Look at https://youtu.be/NQLdrXndnQU


text:
Sculpt mode remesh settings
I have ran into a problem when sculpting. While sculpting I would hit the "Shift R" buttons to bring up a grid to see what size of remeshing I would do before I would "Ctrl R". Now when I "Shift R" it's blank until I go to 1.0 and turns it to a solid white square.
I can get the Grid to come back when I go back to factory settings, so What did I mess with? I would like to know so I don't do this again. I got projects that are so high in vertices that it crashes my computer as soon as I hit "Ctrl R".

The new shortcut is just  R in Sculpt Mode to adjust the voxel size.