How to make a centered hexagon door consisting of 6 triangles? I want to create a hexagonal airlock. It would consist of 6 triangular parts. I would like to use some tool that would allow me to edit all those parts at once. I'd also want it to animate them accordingly to this sketch:

From what I've read the best solution appeared to be using an array modifier on the triangular element with an object offset using an empty element at 0,0,0 and rotated 60' on Z axis. Instead of the hexagon, I've created something like this.

I played a little with the coordinates of the empty point and received somewhat what I wanted, but it is definitely imperfect.

How can I create the hexagon, so that all the vertices are aligned and it would be easy to animate the mentioned way?

For the modeling, here are 3 ways:

First the simplest way, if you don't need your triangles to be linked:

Create a circle (6 vertices, Fill Type > Triangle Fan).
Choose Edge Select mode, select all the concentric edges and press V to rip, then enter to validate right away. Now each triangle is independent.

If you want your triangles to be linked (so that you can continue to work its topology) you could use linked duplications:

Create a 3 vertices circle.
Put its origin on one of its vertices (or put the 3D cursor on one of its vertices and choose the 3D cursor as Pivot Center).
Duplicate your triangle with altD. Press enter to confirm right away.
Make your linked copy rotate 60° on the Z axis.
Make a second linked copy and make it rotate 120°, etc...

You could also use an Array modifier:

Create a 3 vertices circle.
Put its origin on one of its vertices.
Put an empty on the same point.
Give your triangle an Array modifier, and choose the empty as Object.
Rotate the empty 60° on the Z axis.

For the animation, you can do it this way:

Separate each triangle.
Set the origin on the geometry of each triangle with shiftctrlaltC.
Choose Pivot Point option > Median Point and enable the Manipulate Center Point option (don't forget to disable it when you'll have finished to keyframe).
In the Timeline, put your cursor at frame 0.
Select all your triangles and create a keyframe with i > LocRotScale.
In the Timeline, put your cursor at frame X.
With all your triangles selected, scale up with S. With the Manipulate Center Point option enabled the triangles will go away from each others instead of scaling.
Create a new keyframe with i > LocRotScale.


Final render not showing full node setup I am learning how to use the node editing but have come up with a problem. I have followed the instructions that were give on a tutorial but I cannot get the effect to work there are 2 effects that I want to appear in the final render but only one appears. Here is a screen shot of my node set up. If anybody knows what i have done wrong could you please tell me . Thank you. If you need any more information please just let me know. If I am asking wrong questions or asking for the wrong information i am sorry but I am new to this site and am just learning how to use the site properly. (larger image here)

Looking at your node setup, I think it is because you have the wrong socket plugged into the Composite node. It should be coming from the same Add node that the Viewer node is also plugged into. Maybe you were testing earlier and forgot to change it back?

Also, you can enable Backdrop while in the compositor to update your changes as you work, this can save you the time of rendering everytime you need to try a certain setup or see changes.

See What is the difference between a Viewer and a Compositor node? for more information.


Which GPU toPurchase? Nvidia Quadro k2200 or gtx 980? Im planning to do renders with millions of polygons. I want the most responsive view-port and fastest render times.

My friend suggested to get the gtx 980, while the employees at the computer store suggested Nvidia Quadro k2200.

Which is best for cycles?

Thnks.

Never did any actual real world testing, but from my limited experience and from what I've heard NVidia Quadros (or any "professional" grade cards) are never worth the extra money.

Besides that in Blender's specific case they are probably not worth it because they are likely not optimized, simply because most blender developers don't have testing access to Quadro card so even if they work at all, there's a good chance that there's little to no performance benefit at all. Most likely you would not get your price bump's worth in performance gain at least.

I have no benchmarks to back my theory up though,  so I advise you to do some actual investigation in this area by searching for "Cycles Cuda benchmarks"  or something along those lines.

I own a 980ti and it works very well in parallel with my older gtx580.

I'd say you are probably better off buying a regular consumer card like the 980ti or even a TitanX if you need the extra memory for complex scenes.

If you need extra performance buy multiple cards and assemble them in a non SLI configuration. Blender Cycles scales really well with parallel cards.

You may also look into the newer faster and cheaper GTX1080 which is expected to preform very well. But have in mind that because it is still a very new hardware it is not yet fully supported in Blender, this will likely change in future versions, though when that might happen is not known yet.


Why are some items not showing up in my rendered animation? I'm trying to make some graphics for a title sequence which involves some 'T's falling down. However when I render the animation the 'T's don't show up and I can't figure out why, can anybody help?

Here is my file http://www.pasteall.org/blend/28870

Thanks :)

When I open your file and play back the animation (by pressing [Alt+A]) the Ts do not move at all. They hang above the camera and never come into the picture, thus they never show up in your render.
I am not sure why the animation behaves like this, but I have found a way to resolve the problem: Set the Start frame of your animation to 1 and let it play once. The rigid bodies will fall down from their starting position. When you set it back to 250 afterwards, the Ts will behave correctly and fall down.

Edit: It looks like Blender is caching the animation. See the orange line at the bottom of the Timeline:

The part that is cached is colored in a strong orange, the uncached part is only slightly orange. I think this cache is temporary and is lost when you close blender. If you start your animation again from a point that is not the beginning, Blender does not know the current velocities / angular velocities of the rigid bodies and could not solve the rigid body motion correctly, so it shows no motion at all instead.


how to make curve bevel turning evenly? I use a square curve to be the bevel. With default settings. The result is like this.

More description:
My purpose is to make a bunch of foot line all around room. I want to use poly spline type curve to achieve this.
Without bevel object the curve geometry looks like this. The cross section is twisted at the corner which causes a shrink in the middle. Any way to prevent this?

samplefile:
https://drive.google.com/file/d/1M3i4IbUPOPmV305ooXImfbh4ZBL0aU10/view?usp=sharing


Keep texture centered while scaling Ok. In Blender Cycles, I have an Image Texture node connected with a Mapping node and the scale and offset is set so that the image is centered to the object's face(s). However, when I change the scale later in an animation it scales the image from the corner, thus I have to change the offset with the scaling to keep it center on the face(s). Is there some way of scaling the image from the center, so that I don't have to change the offset as well?

The problem you're experiencing is that the Texture space coordinates are in the range 0 to 1 on the X and Y axes and the scaling takes place from the origin - ie, 0,0. To address this you need to shift the coordinates so that the origin is in the centre of the image (0.5,0.5) before scaling. You can achieve this by splitting the Vector into its separate elements using a Separate XYZ node, manipulating the coordinates using Math nodes and re-combining as shown :

The Subtract node re-maps the range from 0 to 1 into -0.5 to 0.5 so the origin (0) is in the centre of the image. The Multiply can be adjusted to get the desired scaling (highlighted in the image). The Add re-maps the range back to 0 to 1.

Setting the Multiply nodes to '2' will give you a half-sized image. Swapping the Multiply for a Divide or using '0.5' will give the opposite effect.

EDIT : My expectation was that the above method would be quite efficient - since the nodes are performing mathematically simple calculations.
However, in my particular test case this was adding 10% onto render times.

There are other methods to create the same effect. The most efficient method I have found so far is to use Mapping nodes in place of the Subtract, Multiply and Add - this also removes the need for the Separate and Combine operations :

The Mapping nodes perform the same operations as before - offset by 0.5, scale, offset back by 0.5. This does improve efficiency.

Additionally, since the Mapping node performs the Offset, Rotation, Scale as separate operations in turn, the first two Mapping nodes can actually be combined into the following :

ie, Offset by 0.5 and Scale, offset back by 0.5.

In my test case this was only 2-3% less efficient than no scaling - a significant improvement over using separate Math nodes.


How to fix obvious connection line between meshes? I'm experiencing very strange lines on my model. How can I fix this?

First, I take the head object from another model when I combine it appears strange lines do not blend with the face model.
Here's an example.
Model:

Head model:

I tried to merge with (Alt+M> at last) but I can't separate them again.
Here is the picture where I tried to merge:

I want a separate head model like this:

It look like you use 2.79 on one screenshot.
If you want to output it then somewhere from Blender - bake normal maps from models where all parts attached and vertices merged to each separate part. This normal map will be baked with taking in to account normal differences so it will compensate it and make detached parts look similar to full head.
If use just in Blender - use Normal Edit modifier on detached parts where pick full head model with merged vertices as reference object. Like on GIF - 2 separate sphere parts, " normal Object " is full sphere.

I mean use modifier for " non destructive " things. You can also just apply this modifier and not bake any normal maps.


Generating blue normal map channel from red and green channels I have a normal map texture where the blue channel is used to store some other map of information since it is normally used in a program which calculates the blue channel from the red and green channel automatically. Now I want to use that same texture in Blender and figured it shouldn't be too hard to do the math in the node editor so it jus works regardless of which normal map I use. However, it doesn't seem to work. The result I get has shading issues quite similar to how it looks without any information in the blue channel. This is despite me having found the formula and I believe created it accurately in the node editor. Does anyone have any idea why this wouldn't create the desired results?

The formula I found to generate the blue channel is "B = sqrt(1 - ((R * R) + (G * G)))"

I managed to generate the Z channel in the normal map according to this scheme (taken from UE4). In the "normal" texture, everything is as usual, only the Blue channel, replaced by roughness.


Multiple objects in array Just wondering if there is a way to use multiple objects in an array.  For example first object would be a car, second would be a boat, etc.

UPDATE

hanks, I followed Robin' suggestion. Lukasz, thanks, but I need to modify the positions.

One more question on this. Is there anyway to assign the degree of rotation for each member of the group in the array? The five planes in the x axis are the grouped aircraft. The circle array and the plane array (vertical) are not pointed in the same direction. I'd like to be able to specify the z axis rotation of each individual of the group. I was able to get them to point in the same direction on the plane array, but that is not the objective.

Any ideas?

Any single array can only contain instances of one object. But in a sense, you can, because you can nest arrays. You can have single element arrays; arrays of arrays; the start and end caps of an array can be arrays. That's sometimes useful, but start and end caps won't merge, if that's what you need, and offsets can sometimes be a bit tricky to set up.

One way to get a variety in evenly distributed objects is to use a particle system: here, distributing a Group of objects on the vertices of a 24-vertex mesh circle.

Make a Group of your objects, give the distributing mesh a particle system, and then set it up something like the illustration. (You don't need Physics, or anything like that). If you need to order your objects, you can 'Use Count' to set up repeating sequences.


Deselecting all keyframes with Python My situation right now:
I am able to deselect all objects with Python by doing bpy.ops.object.select_all(action='DESELECT').

My goal: Deselect all Keyframes of the active object with Python.

Deselect all keyframe points and handles

Helper method to deselect all fcurves and their keyframes and handles of an objects action.

import bpy

def deselect_all_keyframes(ob):
    ob.animation_data_create()
    action = ob.animation_data.action

    if action:
        # deselect all fcurves
        action.fcurves.foreach_set)
                "select",
                (False,) * len(action.fcurves),
                )
        # deselect all keyframes
        for fc in action.fcurves:
            for select in ("select_control_point",
                           "select_left_handle",
                           "select_right_handle",
                               ):
                fc.keyframe_points.foreach_set(
                        select,
                        [False] * len(fc.keyframe_points)
                        )

# test call on context object
deselect_all_keyframes(bpy.context.object)


How to control RGB color input via python script As part of a wider script, I'm trying to build a script that will allow me to change the Hex value of an RGB node. I'm struggling though to find where to hook in to the hex value of the input node. Although not ideal, I could make do with changing the RGB value rather than the hex value, but I can't find where to get hold of this value either?

Any help is very much appreciated!

Cheers

Sam

Here is a guide to control cycles nodes with python.

So the code would look like this:

import bpy
mat = bpy.data.materials['Material_Name']
nodes = mat.node_tree.nodes
node = nodes.get("Diffuse BSDF")
# change the color
node.inputs[0].default_value = (0,1,0,1)  # green RGBA

This lets you change the value just one time and does not run in a loop like with animation nodes.


python api missing bpy.types.Cycles* In 2.81 python api the bpy.types.Cycles* classes are omitted from docs but mostly still accessible ?

Can they be found elsewhere in the docs ?

Till there is no changes you can use API reference form 2.80, for example CyclesRenderSettings

Source of Cycles types contains in Blender_installation_path\2.8*\scripts\addons\cycles\properties.py, you can use it as reference simultaneously.


How do you make a horizontal loop cut? I was watching a tutorial series on YouTube and at 5:11 he made a few loop cuts that are horizontal. How did he do this?

Video: https://www.youtube.com/watch?v=WnPkrxz4AQQ

Initiate loop-cut mode by hitting Crtl + R
While you are still in that mode, scroll your mouse wheel (up or down) / Page UP - Page Down buttons work as well. Or if you have some specific numbers of parallel running loops in your mind, you can make use of the numeric keys as well.


Create realistic collision I want to create a collision of two objects when one of them is weighted much more than the other.
In the example attached the cube is weighted 150 Kg and the sphere only 1 Kg. I expected the cube to barely move after the collision since it weights much more than the sphere but it is not the case. The friction of the plane is set to default and equal to 0.5.
How can it be done? how to make collisions look more realistic in terms of differently weighted objects interaction.

I am on Blender Version 2.81.11 and everything worked as expected
Groundplane is passive, the sphere active with mass is 1kg and Cube is active with 150kg. everyting else is set to Default.
I keyframed the first 10 frames to make an initial Velocity for the sphere as stated here
How can I add motion to a rigid body?

the sphere hits the cube but the cube does not move.
from around 30 kg for the cube a got some slightly motion after the hit.


how can i make black and white alpha video effect I mean using a real footage (not 3d)just like the "Renaissance (2006)movie"
https://www.youtube.com/watch?v=GM5KCoWNXF4

Press Shift+A - Adjustment Layer to add an  Adjustment strip, and place it above all video strips.
In N-panel find saturation value and change it down to 0
In N-panel open modifiers tab and add curves modifier. Draw a curve in the modifier like this:

Here is the result:


How to have 2 Mats w/alpha each and a base Mat on the same object? I need to have the Base.Color material on all the cube faces. With the setup I have I cannot. I have to choose between the materials with Alpha, or the Base.Color material.
I did try adding a 2nd UV map but apparently only one can be renderable at the time.
Thanks in advance guys.

Use decals to place textures over the main texture. See other answers: Setup a decal material in cycles


Mirror Modifier does not work on where ther are no faces If I open up Blender v2.73 and select the cube and delete it. Then select front view ortho and add a circle mesh and check align to view. Then add a mirror modifier the mirrored part does not appear. However if I make a face (doesn't matter how, press f or extrude and edge) then the mirrored half appears. Is this a bug? I'm new to blender so don't feel confident about reporting this. This appears to work as expected in a tutorial video that I watched (Venoms Lab2 Modelling 1).

All modifiers have several options that alter the way they are displayed. Not all modifiers have every option available. The buttons for these display choices are shown at the top of each modifier -

The first two options  are available to all modifiers and make the modifier visible in final render or viewport display. In object mode in the viewport with this enabled you will see the edges created by the mirror modifier.

When available the other two options effect what modifier data is shown in edit mode.

While in edit mode and with the third option disabled you will not see any of the mesh created by the modifier.

While in edit mode and the third option enabled you will see only faces drawn that are created by the modifier. This is the default for many modifiers.

The final option allows the full edit mesh to be displayed. With this enabled you can select parts of the mesh on the mirrored side. Be careful with this option as all movements are done on the real geometry only, as you select mirrored vertices and move them they will move 'backwards' to what you expect.

Also remember that with the mirror modifier, if your mesh is centred around the point of the mirror, the duplicated mesh may be located in the same place as existing mesh data.


Animate Soft Body Along Curve (Holding Form) I'm trying to animated a shoelace along a curve that spells out a word in cursive. I know the simplest way is to just keyframe an offset along the curve but I'd like to have the shoelace being a complete and wholly formed object rather than simply appearing out of nowhere.
My first thought was to use a soft body for the shoe lace (because if possible I'd like to keep a little jiggle and physics), and animate it along the path using hooks. I was going to put hooks at every major point along the curve and keyframe their strength so that as the soft body passed through each one, it would "switch on" and start holding that part in place until it forms the entire word.
Something tells me this isn't the most intuitive way to do it, though?

When using a [Curve Modifier] the curve can have 2 portions. That is a starting portion and a final portion.

The starting portion could be a wound up visual of the shoe lace or other artistic vision
the final portion can be the cursive words.

This may or may not suit your artistic needs.


"wings" appear when I add a subsurface modifier to some simple geometry I've got some very simple geometry (a cube with some extruded subdivisions). When I add a subsurf modifier to it these "wings" appear. They seem to be edges that connect vertices that weren't originally connected by edges. However, I can't select and/or delete them in any way.
How do I get rid of these?
I've checked the normals and they seem to be in order in the area that the wings appear in. Blender can't find any non-manifold geometry in the source.
Blend file: https://drive.google.com/file/d/1xLYRTWBchK3zBOWLDAxSLF-MlWVcGdpy/view?usp=sharing

Ngons (faces with more than 4 sides)

Join some of those vertices (manually subdivide edges where needed) so that you have at most 4 sides for each face.
You have a lot going on in this scene. Blender can highlight ngons for you.
In Edit mode, go to Select -> Select All By Trait -> Faces By Sides.
A little menu will appear in the lower-left. Choose 4 and Greater Than.
Do this with the Subdivision Surface modifier turned off, it will be easier.
Here is a .gif showing you how to isolate islands to work on (subdivision surface modifier has been turned off)


Can i duplicate this Hallway then join it on end of current hall at a 45deg angle as a continuous (short video of render in post)? Im new to Blender (and modeling), sorry if im not using the correct terminology.

Here is the render/model in question:
https://www.youtube.com/watch?v=tLf0lAGD8WM

I created this hall following Ducky 3D's https://www.youtube.com/watch?v=pwFGNNbNMvg how-to. It has a few cubes and some NurbsPath's.

I would like to make a copy of current hall and place that copy on the end at a 45deg angle (or 90deg). Ive tried this by placing the copy at the end having the outer corners touching each other so there is no gaps, then tried to use the knife tool ( K ) and cut out the over lapping inner walls. It worked to a degree, but does not seam like the correct way to do this. Also tried to add a Boolean Modifier, but could not get that to work at all.

Any help or proper keywords i can use to search with would be great...

Using Blender 2.8

Here's a link to the hallway: https://www.youtube.com/watch?v=tLf0lAGD8WM

Here's a way you could do it.

Duplicate the hallway, select the duplicate, go into edit mode, select this face:

and then press A to select all faces. This is now the active face.

Change your snap settings to Vertex and make sure Active and Move are selected.

Press G and then X or Y depending on how the hallway is aligned, then either press CTRL if snapping is disabled or enable snapping with shift+tab. Drag the duplicate hallway until it snaps to the original hallway.

Press 2 to go into edge select mode, select the edge pictured below, and press shift+s, the choose Cursor to Selected.

Change your pivot point to 3D Cursor.

Change snapping back to increment and rotate the duplicate hallway around Z by 45 or 90 or whatever degrees.

Now you have lots of options. Here are two. In object mode select both hallways and then go into edit mode. Select the inner edge loops of the hallways and select Bridge Edge Loops from the right-click menu or from the Edge menu dropdown. Do the same for the outer loops.

Alternatively, you could use the spin tool.

You could add additional offsets to the hallways to make the curve more gradual, or whatever.


Modeling based on a reference image I'm learning modeling from video tutorials. I need help and good and strong tips that need to create my reference model not this any model I make. I take the reference image and in the properties panel of the 3D view, I adjust the setting side view top bottom extra. Then I take a cube and start drawing with the vertex and loop cut and subsurface modifier.

I make the side view good way, but when I start making the other view it confuses me and my model looks odd or shapeless. I have attached my model that I made in side view, but when I come to the front view and start matching as I did with the side view its getting shapeless. Can I get strong, good tips on how to make an accurate model from a reference image.

Here is my blend file:

I cant see your reference image. If you want to pack the image with the .blend file, you need to go to
File > External data (at the bottom) > and choose "Pack all into .blend

This will stick the images into the blend file for others to see.

Now you question seems a little vague, you seem to be on the right track. There is nothing inherently wrong with your model. Stick a mirror modifier on there and keep working and you'll be done in no time.

If you don't like how your model looks compared to the image, look at the image and say, "How is my model different?" Then change it.


How to generate a cylinder with several holes except by knife tool and Boolean methods With the help in Stcak Exchange, I have known how to generate a cylinder with a hole except by knife tool and boolean methods. But all these method can not be used to generate a cylinder with several holes just like below. so please give me some examples. Thanks.

Create two inner circles
Extrude and scale a border around the inner circles
Bridge the inner circles together with two segments.  Note the number of edges in the perimeter of the resulting mesh.
Create an outer circle with a larger radius.  Use the same number vertices as the perimeter in step 3.  Extrude and scale a border.
Bridge the outer and inner circles together.
Extrude the whole mesh in Z-axis to create a cylinder.
Add supporting edge loops around hard edges.
Apply subdivision surface modifier and you're done.


Export a single frame as a new Blender model I've got a horrendously complex ship model that has two states that I wish to work with. Unfortunately I managed to produce 76 frames of animation - they looked smooth when I first did it. However I knew nothing about the origin business and I've gotten into great difficulties with Blender resetting where different objects are when I save and reopen the file.

What I wish to do is save frame 1 as a new model and frame 76 as a new model, then figure out how to reset all the geometry so all the wings and things are not everywhere.

Is there a way I can do this? I've found nothing obvious yet.

The horrendously complicated bit is the fact that it's over a million triangles - probably shouldn't be - but I didn't know how to get the detail I wanted any other way at the time.

If it's only one mesh, no matter how much poly count it has, the procedure will be quite easy.

Make a backup file of your ship.
In "on work" file, duplicate the ship.
Set timeline on 1 keyframe and delete all keyframes for original ship (this way you will get the ship in 1 frame position)
Set timeline on 76 keyframe and delete all keyframes for second ship (this way you will get second ship in 76 frame position).
You probably would want to have this ships on different layers for better performance. From this point you can proceed with whatever you want to achieve with this project.


Weird semi-transparent lines and rectangles problem in Blender Internal Render (2.79) I just made this account to see if anyone could help me on an issue I have
As the title says I have a weird issue with rendering an animation with the Blender internal render where there would be random lines and rectangles and random spots in my render and I have no clue as to what's causing this issue, some help would be very appreciated :/

Thanks if you can help!

Seems like problem comes from "Light" texture, it uses gradient to darken some shadeless materials and somehow final result has stripe artifacts.
After playing with the settings, I've found two ways to prevent it (still don't know why is it even happen):

Decrease "Light" texture's Filter size

Enable Autosmooth on the ground object:

P.S. didn't test it on other camera angles, problem might appear again.


Translation Matrix Coordinates I have been reading many of the threads here regarding translation matrices and converting.  I am still confused as to how this works to apply to my project.

I currently have a camera object that is a child of my nurbs_path. I have a constraint on the camera for follow path.  Everything is perfect.  My camera is at correct starting location.

What i have figured out so far is that

print(camera_object.location)

gives me the translated coordinates based on the parent.  I don't completely understand this but not a huge issue at the moment.

My output from print

Vector (-0.0017, -6.6515, 5.0000)
Vector (-0.0017, -6.6515, 5.0000)
Vector (58.6404, -36.0573, 3.0000)
Vector (15.9993, -53.7008, 3.0000)
Vector (58.6404, -71.3442, 7.0000)
Vector (15.9993, -88.9877, 10.0000)
Vector (58.6404, -106.6311, 5.0000)
Vector (15.9993, -124.2746, 6.0000)
Vector (58.6404, -141.9181, 7.0000)
Vector (26.6596, -159.5615, 8.0000)

What i am trying to do is keyframe this camera path to certain timings.  A guy on blender artists showed me how to do the keyframing and i can do it in UI.  I have the keyframes set up but get wierd camera behavior after applying the keyframes.  I am guessing this is because of translation based on my research.

num_points: Length of a list

camera_object and scene are defined before this loop

verts: list of postions (time_offset, X, Y, Z)
     : X, Y, Z are in global space (i think??)

for point in range(num_points):
    current_frame = //calc to get frame number from a time offset
    print(camera_object.location) # print current camera location
    scene.frame_current = current_frame_num
    camera_object.location = verts[point]
    camera_object.keyframe_insert(data_path="location", frame=current_frame)
    previous_frame = self.__user_points[point]

The keyframes are inserted at frame 1, 241, 481, +240 frames each time to frame 2160.

Here is a pic before keyframe:

Here is a pic after keyframe:

The camera is the selected object to see it easier.

These are the coordinate of the verts list:

[[-0.0017454936660825002, -6.651534000393163, 5.0],
[58.64040695838593, -36.057303922236066, 3.0],
[15.99932173602529, -53.70076587534348, 3.0],
[58.64040695838593, -71.3442278284509, 7.0],
[15.99932173602529, -88.98768978155623, 10.0],
[58.64040695838593, -106.63115173466363, 5.0],
[15.99932173602529, -124.27461368777105, 6.0],
[58.64040695838593, -141.91807564087637, 7.0],
[26.659593041615448, -159.5615375939838, 8.0],
[79.96094956956625, -165.44269157835362, 9.0]]

Any help would be appreciated.

I expect part of the issue comes from you having the camera still following the curve after you have keyframed it. Remove the follow path constraint from the camera after you have the locations for the keyframes.

For your code - don't change frame_current, you should use frame_set(), but in your example you don't need to use either as you are specifying the frame when you create the keyframe.

I would use something like -

import bpy

# each item is time_offset, x, y, z
verts = [
    [0.0, -0.0017,   -6.6515,  5.0],
    [0.1, 58.6404,  -36.0573,  3.0],
    [0.2, 15.9993,  -53.7007,  3.0],
    [0.3, 58.6404,  -71.3442,  7.0],
    [0.4, 15.9993,  -88.9876, 10.0],
    [0.5, 58.6404, -106.6311,  5.0],
    [0.6, 15.9993, -124.2746,  6.0],
    [0.7, 58.6404, -141.9180,  7.0],
    [0.8, 26.6595, -159.5615,  8.0],
    [0.9, 79.9609, -165.4426,  9.0],
]

camera_object = bpy.data.objects['Camera']

for point in range(len(verts)):
    cur_frame = 2160 * verts[point][0]
    camera_object.location = (verts[point][1],verts[point][2],verts[point][3])
    camera_object.keyframe_insert(data_path="location", frame=cur_frame)


Objects not visible in other frames/window but all the objects are in the library I'm doing a project and I mainly work with one window. (Correct me if I'm not using these terms correctly.) When I open a new window, half the objects disappear, but they're still in the library and the eye thing is selected to tell me it's visible, so the objects are still there?

I've tried rendering out the image and it has the same effect, half of the objects are not there. All the objects are still visible in the original window I was making them in, and I can edit and do whatever I wish with it as if it were normal. I'm using cycles render and that's basically all I know.

See if your objects are in different layers, and what layers are visible in those new windows.


Transparent plane working on EEVEE but not cycles I'm kind of new to Blender.
I'm trying to make a Reed and the flower ar the top is an Image plane. I've added  a transparent plane & it works fine on EEVEE render & won't work on Cycles (not 100% transparent). I've added the EEVEE Render, Cycles render & the Tree node to the page so that you can see the difference

Don't add the translucency after the transparency.
Use transparent at the very end of the chain.


Changing default bake output format and quality Working with 2.68a (r58537).

When I try to export a UV bake, I'm always presented with the format set as PNG, it would be amazing to set the default as JPG/100% quality. Also when I export to dae (Collada) it always exports them as PNG.
Is there a way to change that default setting?

When saving baking image as an external one, go to UV/Image Editor menu > Save As Image (F3), pay attention to the left hand tab, there is the place to choose the format you need.

As for the Collada export issue, I think it's because you didn't choose to use other format for saving images before that, or didn't even save to an external file. :)


Camera Specs: How change a 16/9 camera render to other ratio? New in the blender community, i've got one question about the camera settings.
Here's my problem, in order to do video mapping on stage for an event, i would like to do a render of my scene in an aspect ratio of 16/10 and not 16/9 (default).

I use the camera on blender as my video projector would stand in real at the event.

Maybe i should use an internal ratio directly on my graphic card, or maybe there is settings that i don't see in blender ?

Hope my english's fine,
Hope that you got answers

Thanks

Go to the Properties Panel and open the Render Tab.

Locate the Dimensions Panel. You can set the aspect ratio by setting the X and Y resultion of the image.

(source: blender.org)

For a 16:10 aspect ratio, you could choose the following dimensions: 1920 x 1200.


How do I switch selection method How do I switch from (for example) select Lasso to Select Box?

I've tried searching up how but I only get tutorials from pre blender 2.8

With the default Blender Keymap you can cycle the active selection tool with the W key by default, between Tweak Tool, Select Box, Select Circle and Select Lasso.


How much better would blender be if I upgraded my Ram? I currently use AMD A6 5200 APU processor, with linux (Zorin OS 15) as operating system. I have 4 GB of ram. I can run blender 2.92 at a good speed however it does slow down when I have over 4000 particles during scenes or complex node groups but I can get around that, however what I can’t get around is animation playback in viewport. It gets really slow sometimes with around 2 armatures in scenes even with less complicated animation. All I need is around 24 fps of viewport animation playback.How much better performance can I get if I upgrade to 8 gb of ram (because this is only something I would be able to afford right now so I would like to use my money wisely)

Use a System Monitor or Task Manager tool or similar (eg, ‘top’ on Linux) to see if your system is using all of its memory when you’re doing a large, slow operation. If you still have free memory then that isn’t the bottleneck. If, however, the memory runs out and the system starts swapping to disk (known as “page faults” or “virtual memory swapping”) then you would benefit from adding more memory.


Object says it's zeroed on an axis, but it's not. How do I fix? I have this object that says it is zeroed out, but it's actually not and I have a reference object to prove it. I believe it started showing this "false zero" because I joined it to another object earlier, moved it,  but then separated it. Is there a way to move this object to the "true zero"?

Coordinates are linked to origins of objects.
So, Right click in Object mode > Set Origin > Geometry to Origin will move the object to its origin which has zeroed coords.


Missing ID Keys in AN Tab I'm missing ID keys properties.. Can I show them from somewhere?

When I add new key no property bar appears.. just the names..

Image on the left shows How "ID Keys" tab looks in my current scene.
On the right - How "ID Keys" look in New scene. There is a property bar for each default and my newly created ID key.

Ok I think I've got it.. simply select 1 object (not a group) and the properties of the IDs will appear


Camera doesnt follow ball in tube (Blender Game Engine) I'm trying to make a game where a ball rolls in a tube and hits several obstacles that triggers sounds.
I vertex-parented my camera to the ball (so it doesnt spin as the ball does)
I have several problems :

The inside of the tube doesnt shows in play mode.
The camera always goes out of the tube when i move the ball (physics type is rigid body, it shouldnt)
The direction of the ball isnt fluid, it seems to block in the turns

Here's the file to understand more clearly.

If you could help... Thanks alot

I'll try to address at least something:

1) Your "tube" material has "backface" enabled, thus now you can't see it from the inside, because  tube's normals are pointing outside. Try to remove backface OR leave backface, but invert normals (in this way you can also see through the tube when looking the whole tube path from outside, to get a bird's eye view, which helps to spot how is working well and where not...

2) the current camera parenting isn't working well: moving the ball (pressing S) it goes behind it at the beginning, but then it goes around it (and something goes out of the tube), then also in front of the ball... I think you should somehow set the position  of the camera to be always behind the ball along the ball direction axis... I don't know how, unfortunately.


Extrusion along a curve: position of the profile I want to make a curved strip with smooth edges.

I have made Bezier Circle and tweaked a bit to obtain something between an ellipse and a rectangle (this is the section of the strip). Then I made the curve that describes the shape of the strip, and pressed Object Data button in Properties window. In Bezier Object slot I selected the previously mentioned "ellipse".

The problem is that the ellipse appears rotated. The greater axis of the ellipse and the other curve should be coplanar, but they are perpendicular.

I have rotated the original ellipse, but this doesn't seems to have any effect on the final surface.

Without an image of some sort it's hard to guess, but this is a common enough problem that I think I know what you're facing.

If I understand you correctly, all you need to do is rotate the profile curve in edit mode, (instead of object mode) to align the axes of the profile with the axes of the other object.

The documentation is a little obtuse, but it might be helpful.


What is the best way to make a scene look like the inner of the colon? ok this title sounds maybe a bit weird so let me explain first.
The gold standard for colon examination is the colonoscopy, so a camera inside you.
But the problem is you can't say the camera pose (location + orientation) at any time.
Thank you, there is Blender, so I try from a CT scan to simulate a colonoscopy with Blender.
It is working good so far, the CT scan is transformed in a pretty good blender-model and the animation is done.
For this a attached a spot light to my camera, it is pointing in the same direction, like in a real scenario. In generall it is fine, but I want to make it as real as possible.
So lets have a look on a real colonoscopy image and my rendered image, before we go ahead.
This is how a real image looks like, it is a random source from the internet
And here is one cycle rendered image:

Those two images will never look the same, because there are no texture informations for blender and there never will be. So please ignore texture details like veins and so on. Even the red color which is made from a simple material is not important. But my point is to get the most realistic light, shadow, reflections as possible in this image.
I am newbie and using Blender 2.79b (because of a tutorial), here are my questions:
I need to know if it's better to import the actual settings of the real fisheye camera or simulate it as close as possible wwith Blender. And currently I am using a spotlight, with a size of 2, max bounces of 50 and white color. But how go I get any specular light reflection at all (Except in the other renderers blender and blender game)? I cannot even find an option for the brightness of the spotlight.
If you have any other tipp or reference to improve the quality of my simulation, I would be pretty grateful.
BR Amgebee

To answer your question about the camera, you could do either. Try inputting the specifications of the camera you are using, and see if it looks right, otherwise I would recommend Panoramic set to Fisheye Equisolid. You can play with the aperture and FOV settings from there.
For the material/ reflections, you can try this:

Basically What I did was warp the vectors of a couple of Voronai Textures with a noise texture that I softened by mixing it heavily with light grey.  I offset one of them, and colored them red and blue respectively, to make the veins. I also attempted to cancel some of the vein continuity by mixing in another Noise Texture, but looking at it now, I think I needed to darken the noise with a ColorRamp first.

I made the wall color by connecting a ColorRamp to another noise texture, and used a Musgrave Texture to make the inner wall bumps. I softened the Musgrave and plugged it into the height input of a bump node to get some normal information. Before this, I mixed in some height information from the veins as well. I also inverted this mix and darkened the contrast to use as a roughness input - this, combined with the normal map is a large basis for the reflections.  Lastly I mixed the colors together to use as both the BaseColor and the Subsurface color.

I set my Principled  BDSF as shown below. I made this in EEVEE, but it works just as well in Cycles - just note that you may have to turn down the transmission, subsurface, and maybe even metallic to make it look correct.

The end result looks like this:

I'll upload the blend file if you want to see for yourself - Keep in mind this is for 2.83, so it will likely not work in 2.79 unfortunately due to my use of Vector Math nodes, which I think 2.79 may lack (correct me if i'm wrong). If you can obtain and use 2.83, I would heavily recommend it.
File is here -
Cheers


armature relation off center I have parented a grease pencil drawing to a bone and when I try rotating the bone they don't rotate around the same path. What am I missing? This has worked for me once but then it never worked again so I am at a loss of ideas on what might be wrong.
Starting position

After rotation

Update: Blender file can be found at

Please let me know if I need to provide the blender file too.

This issue happens because your Grease Pencil object has transform data (location).

To fix this: first, in the Stroke tab, unparent the armature from your layer, otherwise the layer will move when you apply the new position.

Then use Ctrl+A or open the object menu and apply the necessary transforms (in this case, location). After this, your location data should revert to 0 but your drawings will stay in the same position. Then, parent the layers to the armature bones again.


Is there a way to call the Modifier menu with a keyboard shortcut? I was thinking it would be nice to be able to call the Modifier menu as a contextual menu using a keyboard shortcut. However, the drop-down button doesn't have any Python name listed in its Tool Tip. It just says "Add a Modifier to the Active Object".

Is there a Python name and it's just not listed, or can this menu not be brought up contextually? Thanks.

A custom keyboard shortcut can be set up to call object.modifier_add, and that will make the menu appear. I've set mine up in the Object Mode shortcuts section, and am using F for modiFier.

And here's the result:

The Add Modifier menu will conveniently appear at your cursor location within the 3D Viewport.


Specific style using shader editing nodes I am trying to play with the shading nodes and wondering if anyone knows how I could achieve some sort of airbrushed or styled effect on my renders.
The below image is the kind of style I am after if anyone has any knowledge or insight of how I could get started I would greatly appreciate it!

For the grainy effect, well actually you could use the Cycles render engine and keep the Sampling value very low, for once you'll be glad to have grains. I don't know if it's doable in the Compositor. You can do it with an image editor (Filter > Other > Random Noise in Krita for example), or fake with your materials with some Noise nodes, like that:

I'm not sure it was part of your question but for the smoke itself, you can create a bezier curve, bevel it, play with the vertices Radius and Tilt values (shortcuts AltS and CtrlT):

Give it a mix between a Diffuse and Transparent node, use a Noise as factor, the Texture Coordinate UV output will allow you to follow the curve shape, use the Mapping node Scale values to stretch the noise along the good axis. In Eevee don't forget to choose Material > Settings > Blend Mode > Alpha Blend so that the smoke is transparent:


Using argparse in script yeilds memory error I want to get blender to work with argparse.
I found the following implementation in blender here and tried to sum it down to this:

import argparse
import sys
argv = sys.argv
if "--" not in argv:
    argv = [] # as if no args are passed
else:
    argv = argv[argv.index("--") + 1:] # get all args after "--"
usage_text = "Run blender in background mode with this script: blender --background --python " + __file__ + " -- [options]"
parser = argparse.ArgumentParser(description=usage_text)
args = parser.parse_args(argv) # In this example we wont use the args

However when executed named as argparse_blender.py like this:

blender -b -P argparse_blender.py --  -h

I get as the last line:

Error: Not freed memory blocks: 216

Is there a way to fix this?
If not, is it serious? I care about memory leaks.

I had the same issue, so I use try and except to fix this problem in python 3.3 in blender 2.69.

Solution

try:
    args = parser.parse_args(argv)
    do_something(args)
except SystemExit as e:
    print(repr(e))
# END OF FILE

Results

When we run blender like this:

blender --background --python argparse_blender.py -- -h

(Or like this blender --b --P argparse_blender.py -- -h)

We get the desired output:

usage: blender [-h]

Run blender in background mode with this script: blender --background --python argparse_blender.py -- [options]

optional arguments:
    -h, --help  show this help message and exit
SystemExit(0,)

found bundled python: [...]/blender/2.69/python

Blender quit

Suggestion

I would write the whole argparse_blender.py like this:

import do_something
import argparse
import sys

argv = sys.argv
if "--" not in argv:
    argv = []
else:
   argv = argv[argv.index("--") + 1:]

## set the prog name to match real usage
parser = argparse.ArgumentParser(
    description = 'Run blender in background mode',
    prog = "blender -b -P "+__file__+" --",
)
try:
    args = parser.parse_args(argv)
    do_something(args)
except SystemExit as e:
    print(repr(e))
# END OF FILE

Because it gives nicer output:

usage: blender -b -P argparse_blender.py -- [-h]

Run blender in background mode

optional arguments:
    -h, --help  show this help message and exit
SystemExit(0,)

found bundled python: [...]/blender/2.69/python

Blender quit


Set minimum distance between hair particles I have a mesh with a hair particle system, with mesh objects as hair particles. As you can see in the image below, some of the objects intersect with eachother.

I would like to set a minimum distance between the hair particles so they don't intersect anymore, but I can't find any way to achieve this.

After researching a bit further, it looks like this is not a built-in feature for Blender. Although there are some workarounds to sort of achieve the effect that have been mentioned in the comments, the solution seems to be an add-on:

https://blenderartists.org/forum/showthread.php?233643-Addon-Moleculars-physics

http://pyroevil.com/molecular-script-download/

Here is a quick GIF of me doing particle collision with the add-on (I am on a Mac, so I am using an older version):

This question is very similar:

How to correct collision between particles


In order to apply a design on my object, should I texture it or model it? This is my first real project on Blender. I need to create three decorative objects to a design class I have. I already done the "blocking" and texturing, but I cant solve two problems:

How to apply this tribal design over the object?
How to "engrave" the sun and moon into the objects?

Can anyone enlighten me on this topic?

Textures for Details
I suggest unwrap your object and create a black and white texture for all the details. This simple technique allows to apply different shaders to each part of the object and can be used for a normal map as well, while keeping the geometry nice and clean:

Further reading: Add different materials to different parts of a mesh?


I added bones, how do I add their vertex groups Everything is rigged and ready to animate except I want to add a couple more bones to my body mesh and clothes.

How do I add vertex groups for just those bones to the body and clothes meshes?

If you have done no weight painting for either the body or clothes and have the standard pose available simply parent again the armature.

It seems in newer versions of Blender it will replace the first armature the old armature is reused or deleted.  Make sure you do not get two armature modifiers.  You can also delete the armature modifier, and then parent again.

If you have done significant weight painting and want to keep those weights you can lock the current weights in the vertex groups panel.  Next parent again. I suggest you try this with an archived file if only to prevent some superstitious catastrophe.


Can’t position Gradient Texture on Object (eyeball) properly Every time I try to center the light in the middle of the eye like in the tutorial, it doesn't work and ends up centering around where I put the mark seam.
It's supposed to look like this:

But turns out like this:

If anyone knows what's wrong and can help me I'd really appreciate it. Thanks, tutorial's linked below if that helps.

www.youtube.com/watch?v=E0JyyWeptSA

And here's my blend file:

Your issue is position of UV map.

Tutorial (and you) are using UV texture coordinates, but your UV map is not placed in center of "UV Editor". Since you move the front part of eye in a center it matches.

BTW instead of UV I would rather use Texture Coordinates

type Generated (Loc -0.5 / -0.5 / -1)

or easier type Object (Loc 0 / 0 / -1)


How to create a moving reflection on a glass surface? Ok, I dont know whether this is an animated material or something else, but need to know how to achieve this - or even just the static look of the white glowing line on the glass surface -

https://dribbble.com/shots/3203275-Virtual-Reality-Headset-Gifographic-element

Ive gotten the reflective glass, but how to go about the rings on top? Or the animation? In cycles.

Use an object that is reflected on the surface.

Step 1: use a glossy material on the surface that you want to be reflective.

Step 2: create one or more planes with the shape you need, use an emissive material for them, and place them in a way that are visible as reflections on the surface of the reflective object.

Step 3: animate the position of the emissive plane so that it does what you need.

Read these related posts:

https://blender.stackexchange.com/a/91173/1853

and

Why does an object with a glossy shader render in black?


Background Images in Blender Will not show I'm unable to display images as background images in Blender.

I've tried it as a jpeg and a png.

I have opacity set to 1. I've tried scaling the size from 1-1000. I've tried looking at every view available. Nothing seems to work.

As TeaCrab mentioned in comment, it was because I was in perspective mode. Thank you.


Create subscript text I am creating some physics animations in Blender and looking for a way to create subscript characters in text objects (for all the indices). The only way I figured out is to place two separate Text Objects close to each other, but that's rather uncomfortable as soon as they get animated, edited, moved around etc.

Is there any better way?

method 1

The answer here shows how to add extended unicode characters to the body of a Text Object

For the subscript digits it's this range.

import bpy

obj = bpy.data.objects['Text']

start_char = ord(u'\u2080')
end_char = ord(u'\u2089') + 1
subscript = ''.join([chr(i) for i in range(start_char, end_char)])
obj.data.body = 'Regular' + subscript

The above image uses a font called "Junicode". Support for the sub/super script characters depends on the font you pick. Blender's default font (Bfont) has limited extended characters. You can find many good unicode TrueType fonts with extensive extended character sets.

For more superscript and subscript unicode sequences see the tables here:
Unicode subscript and superscript block

method 2

Add a Driver to the offset_x parameter of the superscript text object, to tell it to update its value based on the obj.dimensions[0] component of the regular script text Object.

You'll have to enable Auto Run Python Scripts from UserPreferences > File

You tweak the superscript size an offset_y to look right, and you might also include some default spacing between the regular script and superscript, here I added 0.1 to the width of the regular script to avoid getting too cramped.

Reasons not to use parenting or drivers

In quality typefaces (fonts) a lot of effort is put into the spacing between letters to make all letter combinations look as good as possible. Adjacent letters should never be too close or too far apart. Find a good font where this is implemented and you'll save yourself a lot of work.

Valid reason to use parent or drivers

If you need superscript and subscript at the same time. Blender isn't a dedicated typesetting tool for notation like LaTeX, and provides no convenient syntax for it. The suggested work-arounds might be sufficient.

wikipedia article about superscript and subscript subtleties in typesetting
The unicode chart at unicode.org


Baking procedural noise to a texture from a moderately low poly model seems to bake additional info I am currently making a decently low poly model to fit a specific style. I do not want to make a higher poly version purely for baking.
The procedural bump is just a noise texture, with vertex colors to control the intensity, to use as normal map clothing wrinkles. Procedural mat shown below.

What I expected when baking these to a texture was for it to bake just the bump from the noise texture itself. However, what baked instead was the noise texture, as well as sharp blocks of normal data that seemed to follow the angles of the low poly parts of the geometry.

When applied to the model, these normals don't look correct whatsoever, and the blocky parts are extremely visible despite not being there in the procedural version. How can I get it to bake PURELY the noise texture, and ignore the actual geometry? Do I have to find some kind of workaround or is there an easy way to fix this?

I've figured it out! Turns out, even if it doesn't show visually, apparently if the mid-level of the input to the bump node isnt 0.5, it bakes respective to that, meaning areas that should be flat are baking as if they're offset.


An animation within an animation I've created a pendulum rotating around a circle with a Follow Path constraint. I would like this animated pendulum to follow a curve in my scene, but as soon as I constraint my pendulum to this curve with a Follow Path, the pendulum goes completely crazy (because the position of the bone following the circle is relative to the center of the scene).

How can I fix this and make my animated pendulum follow my curve? In other words, how can I create a Follow Path animation within another Follow Path animation, and if it's not possible what is the right way to create a animated object like this pendulum following a path?

blend file:

thanks a lot!

I'd see two potential ways:

use an intermediate empty, plus parenting and constraints, which is a little finnicky to set up, or
use a group instance

Method 1

The idea is to use an empty, and first parent the circle (your already working path) to it. Then add a child of constraint to the main bone of your armature, and make sure to click set inverse right after that. Now both the armature and the curve follow the empty. move the empty to the scene origin, and the second curve as well. Use the follow path constraint on the empty to target the second curve and set the parameters as you like.

Method 2

Select every object which the pendulum is made of - that includes the armature object and the curve - and hit Ctrl + G to create a group around it. Name it appropriately (I chose Pendulum). Make sure to also use the Offset from Cursor function like in the GIF. Basically, this allows you to define the Origin Point of the instance relative to the current cursor position. Then, use Shift + A and add a group instance of Pendulum to the scene. Use the follow path constraint on this new instance.

Personally, I find method number 2 far less convoluted and error-prone, but what fits your situation best is up to you.


Why is driven attribute not updating? Trying to animate an object's material, by simply changing its opacity.

As there is no way to directly change the material properties in the AN node tree, I created a driver to change the value of Transparency's "Alpha".

So, the execution flow goes like:

"Object Attribute Output" creates/change a property named "alpha" within the object;
this property is used by the driver to...
set that object's material transparency.

In theory this should work, but:

it works with text objects;
it does not work with any other type of object.

Am I doing something wrong? Or is this supposed to be that way?

No sure why the driver does not update in the cube but does on the text object. This does not seem to be an Animation Nodes bug. It's more likely a dependency graph problem of Blender.

What you can do is to control the transparency of the material directly by using active_material.alpha as path in the Object Attribute Output node.


How to twist the curve I have a simple curve and i want to twist. Selected the end point and press Ctrl+T to tilt, instead the curve to be rotate the direction of the curve is rotated. With the proportional editing on i try to rotate also. For me did not work. I tried to change the handle to aligned still nothing work. Any suggestion or help how it works.

You need to add more control points in order to achieve what you are looking for, using proportional editing. Try selecting all and subdivide the curve a couple of times, or just the portion you want to twist. Then select the last control points (as you have already done in the gif) activate proportional editing and rotate.
Hope it helps.
Cheers


How create a ramp with angle with python script I am learning how to use blender with python script. I want to draw a block with ramp. until here, I can generate a block but my problem is precisely on how do the ramp. if you can help me please.

I know the point from which I must start the ramp coordinates(0, 4, 5) and (0, -4, 5). the angle is 60°
Here is the script(this script allows to draw a cube. if you help me to do a ramp with coordinates and angle known please):
import bpy, bmesh
from math import *
from mathutils import Vector
import numpy as np

def create_mesh(polygon):
    coords = []
    pos = 0
    while pos < len(polygon) - 1 :
        i = polygon[pos]

        pos_suivant = pos + 1
        if pos_suivant < len(polygon):
            j = polygon[pos_suivant]
            coords.append(i)
            coords.append(j)
            pos += 1
    return coords

def draw(zTop, polygon):
    """this function receives 2 arguments :
    * zTop of type Integr: it's the maximum height
    * polygon of type list of tuple: it's coordinates of polygon
    * this function allows to draw a cube
    """
    coords = create_mesh(polygon)
    bm = bmesh.new()
    for v in coords:
        bm.verts.new(v)
   # print(bm.verts)
    #création de la base
    base = bm.faces.new(bm.verts)

    #processus d'extrusion
    hauteur = bmesh.ops.extrude_face_region(bm, geom=[base])

    #ajout d'auteur d'extrusion
    bmesh.ops.translate(bm, vec=Vector((0,0,zTop)), verts=[v for v in hauteur["geom"] if isinstance(v,bmesh.types.BMVert)])
    bm.normal_update()

    me = bpy.data.meshes.new("Shape")
    bm.to_mesh(me)
    # ajouter à la scene
    ob = bpy.data.objects.new("Shape",me)
    bpy.context.collection.objects.link(ob)

coords = [(0,4, 0),(0,-4, 0), (4,-4, 0), (4,4, 0)]

draw(10, coords)

Add cube, resize, subdivide, move edge.

Image showing 3 test runs as in listed in code below
There are many ways to skin this cat, thought I would add a method to
Add a unit cube, scale to desired width x depth x height, and translate such that origin is as in question. (Could IMO use COG as origin and translate later)
The 4 vertical edges of cube are always the same index, will subdivide these, Insert new vertices into face using pyhton & bmesh  Notice that the subdivide percent of each edge needs to be flipped depending on vert 0 of edge.
Finally the 11th original edge of cube is moved using Pythagoras (tangent)
import bpy
import bmesh
from mathutils import Matrix
from math import radians, tan

context = bpy.context

def add_ramp(x, y, z, ramp, angle):
    bm = bmesh.new()
    bmesh.ops.create_cube(
            bm,
            size=1,
            matrix=(
                Matrix.Diagonal((x, y, z, 1)) @
                Matrix.Translation((.5, .5, .5))
                )
            )
    pc = ramp / z
    bm.edges.ensure_lookup_table()
    edge = bm.edges[11]
    edges = [bm.edges[i] for i in (1, 3, 6, 9)]
    bmesh.ops.subdivide_edges(
            bm,
            edges=edges,
            edge_percents={
                e : (pc if e.verts[1].co.z > e.verts[0].co.z else 1 - pc)
                 for e in edges},
            use_grid_fill=True,
            cuts=1,
            )
    bmesh.ops.translate(
            bm,
            verts=edge.verts,
            vec=(0, (z - ramp) * tan(angle), 0),
            )
    me = bpy.data.meshes.new("Shape")
    bm.to_mesh(me)
    ob = bpy.data.objects.new("Shape",me)
    bpy.context.collection.objects.link(ob)

add_ramp(4, 8, 10, 5, radians(30))
add_ramp(4, 8, 10, 6, radians(45))
add_ramp(4, 8, 10, 5, radians(-30))


What are the region-space combinations that can be used for button and panel registration What are the available regions, and also, which ones can have a button registered to?

While registering any panel we need to specify which space/region should be assigned to, in example: {space: VIEW_3D, region: UI}.

However not all regions are available for every space, and not all regions could have buttons/panels registered to them.

This table has all the space-region combinations that work.

Reference: Blender Space-Regions guide


How can I change the language of the blender to understand it? Help me please translate Blender into my language.

You can change to your language inside Preference Menu/Interface/Translation


Exporting trouble. Bone tail and head positions change quaternion rotation I managed to program a cute script to export animated models for Play Station Portable.

If all the bones are aligned with Y pointing up, It works perfect, But animating the models that way is a bit strange:

So I want to export models with bones not aligned like this:

But the bones rotated in edit mode, like the ones for the arms, are now rotating along their rotated Y axis, the exported quaternions are wrong when loaded in PSP and they rotate in flipped axis.

So... Is there a way to export the quaternions without the rotation added by the head-tail axis?. Like, multiply the quaternion by the head-tail vector... or something like that?

Thanks a lot!

Short Answer: No.
Long answer: it likely isn't worth it.

You can do things like this by shifting the rotational axis of the animations once you have adjusted your bones as described by this question/comment set:
Rotate a particular bone in edit mode without offsetting animation?

But, from experience, you should not make adjustments to your armature once animations are created.


Material will not assign to selected vertices My material will not assign to the selected vertices. I pressed the assigned button, but it still isn't working.

The first material is assigned to the whole object by default , to un-assign some faces from this material you'll have to :

create another material slot ( with a material )
assign these faces to the new material slot


Questions about Displacement and modeling Question 1: these lines appear after I did those dripping drops. They do not look odd in the final render, but I wondered how to remove them.

Question 2: the donut looks like made from Polyethylene. Please see the Nodes blew.

There is the final one, looks like a one-week-old donut. lol

There is the node.

Thanks for your time~

Answers found by myself.
1. there are duplicated vertices because I hit E and did not do anything then hit E again.
2. Aged donut because I forgot to give subsurface to the donut.

I hope this can help anyone who has the same problems. It is just so much to learn.


Emission Object is in front of every other object Hello. I have 2 objects here, the dark cube is a diffuse black color, the white cube is an emission. I have these objects in different layers and have set the render layers up, so I can blur the white cube only.

I try to add these 2 render layers together and the cube is always in front of the black cube. I tried using the less than math node, but using it prevents me from blurring the emission cube.

I would love to know what I am doing wrong here. Any help would be greatly appreciated.

Please consider using the [alpha over node].

For transparency in Cycles render use Panel Film Transparent.

[ Alpha over node ] respects transparency alpha.  In your example opaque black cube would be opaque over all parts of the blurred white cube.

Alpha is transparency and its effects are only visible by compositing two or more layers.

In the image above the white emission cube in layer 2 is blurred.  The sphere and yellow emission cube are in layer 1.  Yellow emission is to increase legibility of explanation.

Two render layer specifications use different visual scene layers in the image below. (Layers and Scenes have some difficult terminology in Blender which could be improved)

3D Views with object visibility in layers in the image below.

Note the checkered background for transparency. Using [object index] is a complement or replacement to layers.


Load Preset and execute Function or Operator I googled now for hours and hours, but couldn't find something near to this Task.
When I make a Preset-System like this here:
import bpy
from bpy.types import Operator, Menu
from bl_operators.presets import AddPresetBase

class OBJECT_MT_display_presets(Menu):
    bl_label = "Object Display Presets"
    preset_subdir = "object/display"
    preset_operator = "script.execute_preset"
    draw = Menu.draw_preset

class AddPresetObjectDisplay(AddPresetBase, Operator):
    '''Add a Object Display Preset'''
    bl_idname = "camera.object_display_preset_add"
    bl_label = "Add Object Display Preset"
    preset_menu = "OBJECT_MT_display_presets"

    # variable used for all preset values
    preset_defines = [
        "obj = bpy.context.object"
    ]

    # properties to store in the preset
    preset_values = [
        "obj.display_type",
        "obj.show_bounds",
        "obj.display_bounds_type",
        "obj.show_name",
        "obj.show_axis",
        "obj.show_wire",
    ]

    # where to store the preset
    preset_subdir = "object/display"

# Display into an existing panel
def panel_func(self, context):
    layout = self.layout

    row = layout.row(align=True)
    row.menu(OBJECT_MT_display_presets.__name__, text=OBJECT_MT_display_presets.bl_label)
    row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_IN')
    row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_OUT').remove_active = True

classes = (
    OBJECT_MT_display_presets,
    AddPresetObjectDisplay,
)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.OBJECT_PT_display.prepend(panel_func)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    bpy.types.OBJECT_PT_display.remove(panel_func)

if __name__ == "__main__":
    register()

I want to add an Operator or a Function that is called every time a Preset is loaded. It should not be called, when a Preset is added or removed - only when its loaded.
But because there is no execute() method in the Preset-System, I got no Idea where to put the Operator-Call in to.
I was also searching to append something to an execute-method but I didn't find anything.
Any Ideas?

If its written in python can be found with a little digging.
The key here is in the menu, you are defining which operator to use to execute presets
    preset_operator = "script.execute_preset"

If we can find it in bpy.types then it has a python module
>>> bpy.ops.script.execute_preset.idname()
'SCRIPT_OT_execute_preset'

>>> bpy.types.SCRIPT_OT_execute_preset.__module__
'bl_operators.presets'

and there it is in 2.91/scripts/startup/bl_operators/presets.py
class ExecutePreset(Operator):
    """Execute a preset"""
    bl_idname = "script.execute_preset"
    bl_label = "Execute a Python Preset"

    filepath: StringProperty(
        subtype='FILE_PATH',
        options={'SKIP_SAVE'},
    )
    menu_idname: StringProperty(
        name="Menu ID Name",
        description="ID name of the menu this was called from",
        options={'SKIP_SAVE'},
    )

    def execute(self, context):
        from os.path import basename, splitext
        filepath = self.filepath

        # change the menu title to the most recently chosen option
        preset_class = getattr(bpy.types, self.menu_idname)
        preset_class.bl_label = bpy.path.display_name(basename(filepath))

        ext = splitext(filepath)[1].lower()

        if ext not in {".py", ".xml"}:
            self.report({'ERROR'}, "unknown filetype: %r" % ext)
            return {'CANCELLED'}

        if hasattr(preset_class, "reset_cb"):
            preset_class.reset_cb(context)

        if ext == ".py":
            try:
                bpy.utils.execfile(filepath)
            except Exception as ex:
                self.report({'ERROR'}, "Failed to execute the preset: " + repr(ex))

        elif ext == ".xml":
            import rna_xml
            rna_xml.xml_file_run(context,
                                 filepath,
                                 preset_class.preset_xml_map)

        if hasattr(preset_class, "post_cb"):
            preset_class.post_cb(context)

        return {'FINISHED'}

re-write another operator, using same properties,  to do whatever floats your boat when your preset is loaded, and tell the system to use it instead
preset_operator = "script.execute_preset_float_boat_version"

Ok, since we are no longer using the default operator, we can set the defaults for the operator in the draw preset method of menu class
>>> bpy.types.Menu.draw_preset(
draw_preset(self, _context)
Define these on the subclass:
- preset_operator (string)
- preset_subdir (string)
Optionally:
- preset_add_operator (string)
- preset_extensions (set of strings)
- preset_operator_defaults (dict of keyword args)

Define the callbacks
Looking at the operator code, notice two callback functions are run, one before the preset is loaded reset_cb and one after post_cb.  Have added these two classmethods to Menu to print to console when called.
so in full
import bpy
from bpy.types import Operator, Menu
from bl_operators.presets import AddPresetBase
from bpy.props import StringProperty

class ExecutePreset(Operator):
    """Execute a preset"""
    bl_idname = "script.execute_preset_float_boat"
    bl_label = "Execute a Python Preset"

    filepath: StringProperty(
        subtype='FILE_PATH',
        options={'SKIP_SAVE'},
    )
    menu_idname: StringProperty(
        name="Menu ID Name",
        description="ID name of the menu this was called from",
        options={'SKIP_SAVE'},
    )

    def execute(self, context):
        from os.path import basename, splitext
        filepath = self.filepath

        # change the menu title to the most recently chosen option
        preset_class = getattr(bpy.types, self.menu_idname)
        preset_class.bl_label = bpy.path.display_name(basename(filepath))

        ext = splitext(filepath)[1].lower()

        if ext not in {".py", ".xml"}:
            self.report({'ERROR'}, "unknown filetype: %r" % ext)
            return {'CANCELLED'}

        if hasattr(preset_class, "reset_cb"):
            preset_class.reset_cb(context)

        if ext == ".py":
            try:
                bpy.utils.execfile(filepath)
            except Exception as ex:
                self.report({'ERROR'}, "Failed to execute the preset: " + repr(ex))

        elif ext == ".xml":
            import rna_xml
            rna_xml.xml_file_run(context,
                                 filepath,
                                 preset_class.preset_xml_map)

        if hasattr(preset_class, "post_cb"):
            preset_class.post_cb(context)

        return {'FINISHED'}

class OBJECT_MT_display_presets(Menu):
    bl_label = "Object Display Presets"
    preset_subdir = "object/display"
    preset_operator = "script.execute_preset_float_boat"
    preset_operator_defaults = {
            "menu_idname" : 'OBJECT_MT_display_presets'
            }
    draw = Menu.draw_preset
    @classmethod
    def reset_cb(self, context):
        print("Reset")
    @classmethod
    def post_cb(self, context):
        print("Post Callback")

class AddPresetObjectDisplay(AddPresetBase, Operator):
    '''Add a Object Display Preset'''
    bl_idname = "camera.object_display_preset_add"
    bl_label = "Add Object Display Preset"
    preset_menu = "OBJECT_MT_display_presets"

    # variable used for all preset values
    preset_defines = [
        "obj = bpy.context.object"
    ]

    # properties to store in the preset
    preset_values = [
        "obj.display_type",
        "obj.show_bounds",
        "obj.display_bounds_type",
        "obj.show_name",
        "obj.show_axis",
        "obj.show_wire",
    ]

    # where to store the preset
    preset_subdir = "object/display"

# Display into an existing panel
def panel_func(self, context):
    layout = self.layout

    row = layout.row(align=True)
    row.menu(OBJECT_MT_display_presets.__name__, text=OBJECT_MT_display_presets.bl_label)
    row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_IN')
    row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOM_OUT').remove_active = True

classes = (
    ExecutePreset,
    OBJECT_MT_display_presets,
    AddPresetObjectDisplay,
)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.OBJECT_PT_display.prepend(panel_func)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    bpy.types.OBJECT_PT_display.remove(panel_func)

if __name__ == "__main__":
    register()


How to move object while tracking to mouse cursor with a modal operator? I am trying to make a modal operator that can track an object to the mouse location:

https://i.imgur.com/1uujJCq.mp4

I have this example for snapping(volume) an empty within an object, it works great(by Jeacom) & would like the empty to automatically track towards the cursors direction.

Here is the modal I have at the moment:

import bpy
from bpy_extras.view3d_utils import (region_2d_to_origin_3d,
                                     region_2d_to_vector_3d)

def cursor_create(context):
    bpy.ops.object.empty_add(type="SPHERE")
    context.active_object.show_in_front = True
    return context.active_object

def mouse_ray_get(context, event):
    co = event.mouse_region_x, event.mouse_region_y
    region = context.region
    r_data = context.space_data.region_3d

    origin = region_2d_to_origin_3d(region, r_data, co)
    direction = region_2d_to_vector_3d(region, r_data, co)
    return origin, direction

class TestSnap(bpy.types.Operator):
    bl_idname = "object.test_snaping"
    bl_label = "Test Snaping"
    bl_options = {"REGISTER", "UNDO"}

    cursor = None

    def invoke(self, context, event):
        self.cursor = cursor_create(context)
        self._timer = context.window_manager.modal_handler_add(self)
        return {"RUNNING_MODAL"}

    def modal(self, context, event):

        origin, direction = mouse_ray_get(context, event)

        hit1, location1, normal, index, object, mat =\
            context.scene.ray_cast(context.view_layer, origin, direction)

        if hit1:

            hit2, location2, normal, index, object, mat =\
                context.scene.ray_cast(context.view_layer, location1 - 0.00001 * normal, -normal)

            if hit2:
                self.cursor.location = (location1 + location2) / 2
                radius = (location1 - location2).length / 2

                self.cursor.scale.x = radius
                self.cursor.scale.y = radius
                self.cursor.scale.z = radius

        if event.type == "ESC":
            return {"FINISHED"}

        return {"PASS_THROUGH"}

bpy.utils.register_class(TestSnap)

Thanks

You can get view origin and mouse location in 3D using:

self.view_point = view3d_utils.region_2d_to_origin_3d(region, region3D, self.mouse_pos)

and

self.world_loc = view3d_utils.region_2d_to_location_3d(region, region3D, self.mouse_pos, self.view_vector)

where self.view_vector is from:

self.view_vector = view3d_utils.region_2d_to_vector_3d(region, region3D, self.mouse_pos)

You can raycast on the scene from self.view_point to self.world_loc.

From that, moving an object is simply giving obj.location a value.

Here the value is either world_loc obtained above or the result of a ray cast on another object. In case of raycasting on another object coordinates are converted in this object space.

Commented script:

import bpy
import bgl
import blf

from bpy_extras import view3d_utils

def draw_callback_px(self, context):
    font_id = 0
    blf.position(font_id, 15, 100, 0)
    blf.size(font_id, 12, 72)
    blf.draw(font_id, "Mouse position: " + str(self.mouse_pos) + "/" + str(self.view_point) + "/" + str(self.view_vector) )
    blf.position(font_id, 15, 115, 0)
    blf.draw(font_id, "Location on plane " + str(self.loc_on_plane)  )
    blf.position(font_id, 15, 130, 0)
    blf.draw(font_id, "Object location " + str(self.object.location)  )

class ModalDrawOperator(bpy.types.Operator):
    """Draw a line with the mouse"""
    bl_idname = "view3d.modal_operator"
    bl_label = "Simple Modal View3D Operator"

    def modal(self, context, event):
        context.area.tag_redraw()

        if event.type == 'MOUSEMOVE':

            #Get the mouse position thanks to the event
            self.mouse_pos = event.mouse_region_x, event.mouse_region_y

            #Contextual active object, 2D and 3D regions
            self.object = bpy.context.object
            region = bpy.context.region
            region3D = bpy.context.space_data.region_3d

            #The direction indicated by the mouse position from the current view
            self.view_vector = view3d_utils.region_2d_to_vector_3d(region, region3D, self.mouse_pos)
            #The view point of the user
            self.view_point = view3d_utils.region_2d_to_origin_3d(region, region3D, self.mouse_pos)
            #The 3D location in this direction
            self.world_loc = view3d_utils.region_2d_to_location_3d(region, region3D, self.mouse_pos, self.view_vector)

            plane = bpy.data.objects['Plane']
            self.loc_on_plane = None
            if plane:
                world_mat_inv = plane.matrix_world.inverted()
                # Calculates the ray direction in the target space
                rc_origin = world_mat_inv @ self.view_point
                rc_destination = world_mat_inv @ self.world_loc
                rc_direction = (rc_destination - rc_origin).normalized()
                hit, loc, norm, index = plane.ray_cast( origin = rc_origin, direction = rc_direction )
                self.loc_on_plane = loc
                if hit:
                    self.world_loc = plane.matrix_world @ loc

            if self.object:
                self.object.location = self.world_loc

        elif event.type in {'ESC'}:
            bpy.types.SpaceView3D.draw_handler_remove(self._handle, 'WINDOW')
            return {'CANCELLED'}

        return {'PASS_THROUGH'}

    def invoke(self, context, event):
        if context.area.type == 'VIEW_3D':
            args = (self, context)
            self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_PIXEL')

            #Keeps mouse position current 3D location and current object for the draw callback
            #(not needed to make it self attribute if you don't want to use the callback)
            self.mouse_pos = [0,0]
            self.loc = [0,0,0]
            self.object = None
            self.view_point = None
            self.view_vector = None
            self.world_loc = None
            self.loc_on_plane = None

            context.window_manager.modal_handler_add(self)
            return {'RUNNING_MODAL'}
        else:
            self.report({'WARNING'}, "View3D not found, cannot run operator")
            return {'CANCELLED'}

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

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

if __name__ == "__main__":
    register()

Edit:

Little update so that the cube orientation is along the hit normal:

From the norm obtained with ray cast:

norm.rotate( plane.matrix_world.to_euler('XYZ') )
self.normal = norm.normalized()

Then apply it to the object:

self.object.rotation_euler = z.rotation_difference( self.normal ).to_euler()

Updated blend:


Cinema 4D style navigation I was using Blender with Maya configuration preset and it worked great for me, but since in 99% of Blender tutorials people are teaching using default configuration preset I've decided to switch on it.

I've bumped into a few annoying things:

Using Maya preset I could press the F key to focus on the selected item/vertex/face and zoom, pan, rotate around it. In Blender preset it's almost the same with the Del key, but I can zoom only using mouse wheel (which is extremely uncomfortably for me), if I use Ctrl+MMB zoom, the focus resets.
Sometimes I can't even zoom or pan properly, it starts behaving very slow so I have to refocus with the F on the different objects to reset this bug or whatever this is.

Is there a preset or an addon to make Blender behave like Cinema 4D. In Cinema 4D the focused object/vertex/face is always the one mouse is pointed at.

Yes your solution would be to

Go to user preference > Interface > View Manipulation ...
Turn off "Rotate Around Selection"
Turn on "Auto Depth", "Cursor Depth", "Zoom to Mouse Position".

Now when you zoom take care to place your mouse at the object where you want to zoom or rotate around. It will now no longer slow down zoom when you hit a threshold. Instead it will always trys to determine the depth relative to your mouse position to any 3d surface you point the mouse cursor at.

Rotate around Selection is deceiving ... it gives you the notion that you would be rotating around a selected element. In reality the tool only rotate around the element when you zoom to selected first. Moreover when you select your next object it will use the formal element's scene depth. This is ok for single element selection, it however proves ineffective when you need to select multiple objects which just happens to be far apart.


Can I make Blender a Y-Up world? After using other 3D Apps I have become used to Y being up, and Z being depth (Depth pass, Z pass etc).

Is there a way to make Blender a Y-up world, and if not, does anyone know why they chose to be different ?

Duplicate Question. See: Is it possible to make Blender a Y-up world?

"The standard orientation, where the xy-plane is horizontal and the z-axis points up" is part of the Right Handed Orientation coordinate system. It is not "being different" as much a choice between Left or Right Handed systems. Each design team makes there own choices when they first start coding.


How to spread/Scale Vertexes by world constant range? For example i have a tube with 2m diameter, if i select Vertexes of one end, and Scale them using Snapping \ Increment \ Absolute Grid Snap, I get 2.6m diameter on that end, but if I then scale them down, I get 2.08m, because the second scale was in % of 2.6m .
Snapping to grid get's messed up after scaling down vertexes
And another related issue, the 10% Scaling steps can't be changed by scaling the model Space (to achieve the steps that you need) .
Does anyone know how to perform such operations, such so the applied value would stay constant to world? (getting 2m after decreasing the diameter)
For example, programmatically the Absolute Grid Snap could be achieved by Snapping the closest to grid-step vertex, and range snap by auto/manually selecting a Vertex to translate it's world space modification to the scale space ("%") .

Use "push/pull" to give a distance in world units:


Complex grid patters for chair I need some help in creating a complex(might not be complex) grid pattern for the back support of a chair.
I attached the image it is based on.
Please note that I have also created the outer frame, do let me know if that's necessary or if I'm headed in the right direction.

Here is a simple and basic way I would go about it.
Made you this short video.
-Subdivide a Plane, Shape with "Proportional editing", Add wireframe mod and Subdivision surface -
enter link description here


Is it possible to wrap the original textures into the new mesh without distortion? I've been working on this mod for Fallout 4 where I intend to "restore" the damaged piece of clothing. The meshes are good but the textures within that region are all over the place:

I've searched everywhere but couldn't find an answer to this. Any way I can fix that without having to create an entirely new texture set?

And I've been using Blender for only 2 days with no previous experience whatsoever, so please bear with me.

As long as your texture has image information for the ripped out part, you can correct the UVs by hand. One quick way to do it us by using the Pin Tool in UV Editor.

Example
I have a mesh with a hole in the middle (left). After filling the hole manually I may end up with a highly distorted, but still connected UV projection (right).

When selecting the original mesh part in Edit Mode, by default only the selcted and correctly unwrapped faces are shown in UV Image Editor. Move cursor to the UV Editor, select all vertices with A and press P to pin these vertices. This means they will not be changed if the mesh is unwrapped again.

Next select all vertices, including the newly created with distorted UVs, and unwrap using the default method (in Edit Mode: select all, U -> Unwrap; in UV Editor: select all, U)

The distorted parts are automatically repaired whilst the original parts are untouched. Optionally, press Alt+P to remove the pins again.


can't find update callback for CollectionProperty I'm new to python and I encounter a problem with update callback function.
I have a UiList of items, and I'm looking for a way to display a popup window when user click on one of the items in the lists. Since it looks like i have to use CollectionProperty to use UiList, i have setup one and use an EnumProperty inside.
My problem is:  I can't find a way to callback update from the CollectionProperty; and writing the update in the EnumProperty doesn't seem to do anything in this case.
class SCENE_OT_source_populate(Operator):
    bl_idname = "scene.source_populate"
    bl_label = "Populate source"

    def execute(self,context):
        context.scene.SMSL.collection.clear()
        preset = context.scene.StrewPresetDrop.StrewPresetDropdown
        AssetList = GetAssetList.Specie(self, context, preset)
        for Asset in AssetList:
            item = context.scene.SMSL.collection.add()
            Path = Asset.split(",")
            item.name = Path[1]
            item.description = Asset
        return {'FINISHED'}

class SMSAsset(PropertyGroup):
    type = EnumProperty(
        items=(
            ('A', "Option A", ""),
            ('B', "Option B", ""),
        )
    )
    #val = IntProperty()

class SMSList(PropertyGroup):
    collection : CollectionProperty(
        name = "SMSA",
        type = SMSAsset)
    active_user_index : IntProperty()

class SMS_UL_List(UIList):
    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
        if self.layout_type in {'DEFAULT', 'COMPACT'}:
            layout.prop(item, "name", text="", emboss=False)
            #layout.prop(item, "val", text="")
            #layout.prop(item, "type", text="")
        elif self.layout_type in {'GRID'}:
            layout.alignment = 'CENTER'
            layout.label(text="", icon_value=icon)

def register():
    bpy.util.register_class(SMS_UL_Lists)
    bpy.util.register_class(SCENE_OT_source_populate)
    bpy.types.Scene.SMSL = PointerProperty(type= SMSList)

I looked in the blender doc and CollectionProperty is the only one witouth a Update callback. Is there a way to work around this please?

On the active index.

_Clicking on an item updates the index and calls splash which calls bpy.ops.wm.show_panel(...) to display the newly active item. Hovering over the "Hello World" throws up a panel popover which uses context pointer set in the draw_item method.

I'm looking for a way to display a popup window when user click on one
of the items in the lists.

The list UI changes the property set for active index when another index is chosen.
An update method on the index int property will be fired when list index changes.
Test with question code, draw method tacked onto Properties > Scene panel.
A panel is displayed by operator, and by popover.  In hindsight the UI in popover may be best seen but disabled
import bpy
from bpy.types import Operator, PropertyGroup, UIList
from bpy.props import IntProperty, EnumProperty, CollectionProperty, PointerProperty

class HelloWorldPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Hello World Panel"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"
    #bl_options = {'INSTANCED'}

    def draw(self, context):
        layout = self.layout
        smsl = context.scene.SMSL
        user = getattr(
                context,
                "active_smms_user",
                smsl.collection[smsl.active_user_index]
                )
        col = layout.column()

        col.label(text=f" {user.name}", icon='WORLD_DATA')
        col.prop(user, "val")
        col.prop(user, "type")

class SCENE_OT_source_populate(Operator):
    bl_idname = "scene.source_populate"
    bl_label = "Populate source"

    def execute(self,context):
        context.scene.SMSL.collection.clear()
        # wtf (lol)>?
        AssetList = ["Foo, foo", "Bar, bar"]
        for Asset in AssetList:
            item = context.scene.SMSL.collection.add()
            Path = Asset.split(",")
            item.name = Path[1]
            item.description = Asset
        return {'FINISHED'}

class SMSAsset(PropertyGroup):
    type : EnumProperty(
        items=(
            ('A', "Option A", ""),
            ('B', "Option B", ""),
        )
    )
    val : IntProperty()

def splash(self, context):
    # AFAICT context override does not get to panel
    bpy.ops.wm.call_panel(
            {"active_smms_user" : self.collection[self.active_user_index]},
            'INVOKE_DEFAULT',
            name="OBJECT_PT_hello",
            )
    return None

class SMSList(PropertyGroup):
    collection : CollectionProperty(
        name = "SMSA",
        type = SMSAsset)
    active_user_index : IntProperty(update=splash)

class SMS_UL_List(UIList):
    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
        layout.context_pointer_set("active_smms_user", item,)
        if self.layout_type in {'DEFAULT', 'COMPACT'}:
            layout.prop(item, "name", text="", emboss=False)
            layout.prop(item, "val", text="")
            layout.prop(item, "type", text="")
            if hasattr(bpy.types, "OBJECT_PT_hello"):

                layout.popover("OBJECT_PT_hello")
        elif self.layout_type in {'GRID'}:
            layout.alignment = 'CENTER'
            layout.label(text="", icon_value=icon)
def draw(self, context):
    layout = self.layout
    smsl = context.scene.SMSL
    layout.label(text="Test")
    layout.operator("scene.source_populate")
    layout.template_list(
            "SMS_UL_List", "",
             smsl, "collection", smsl, "active_user_index")

classes = (
        SMSAsset,
        SMS_UL_List,
        SMSList,
        HelloWorldPanel,
        SCENE_OT_source_populate,
        )

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

    bpy.types.Scene.SMSL = PointerProperty(type= SMSList)
    bpy.types.SCENE_PT_scene.append(draw)

if __name__ == "__main__":
    register()


Exporting fbx animations to ue4 I am using blender to animate a skeletal mesh and then export it in FBX format.

I exported with Z axis as up and positive X as forward

There are certain problems with it.

Importing only the mesh complains for some missing bind poses. I use t0 for bind pose.

The mesh orientation is correct but when importing with animations the warning says imported bone transform is different from original

Then when i play the animation the whole skeleton is lying down while it is standing up in blender.

what am i doing wrong?

Also I would like to choose which animations to export exclusively! how do i do that?

EDIT: When I import the animations there are some other weird animations that get imported each of them just 2 frame long, what are those?

Also please  guide me to a learning resource on NLA and actions editor.

You have three ways to control how animations are exported in FBX:

NLA Strips and All Actions disabled: only 'active' actions in scenes will be exported (i.e., actions assigned to objects/armatures/etc.).
All Actions enabled: all existing actions are exported for all compatible objects (because there is no way by default in Blender to restrain a set of actions to a specific object).
NLA Strips enabled: each strip of the NLA of each object is exported as a single action. This is the best way to get precise control over which action is exported for a given object.

As for orientation and armature issues, this is a well known issue of current code (at least with UE4, for some reason Unity seems to work much better), which is being investigated - it is still completely unclear whether issue is in UE4 reading code, or Blender writing code, or both…


Can I use weight paint in the middle of a face? I've been following along with this tutorial (you don't need to watch it). I made a plate mesh, and it's quite low-poly. The top of it is only one (1) n-gon. I was hoping to use weight paint in the middle of that n-gon, but it seems I'm only allowed to weight paint around its vertices. As the title asks, is there a way to weight paint in the middle of that face, or do I have to use triangulate or some other modifier to add vertices?

Thank you!

EDIT: Thanks, those were exactly the kind of answers I was looking for!

Welcome to Blender Stack Exchange! Weight painting specifically weights vertices, so no, there is no way to weight the middle of a face. A vertex is the most basic piece of a mesh, so in order to define how a mesh should look or behave, it needs to have vertices wherever you want there to be detail/information.


How to add a datetime object as custom property to a blender object I'm trying to add a datetime as property to an object like so:

from datetime import datetime
obj = bpy.context.active_object
obj['somedate'] = datetime.strptime('1900-01-01', '%Y-%m-%d')

...and get an runtime TypError about datetime.datetime not being supported as id-property.

Is there a simple way to add this support? (...or is it easier to work with string properties and convert as needed with strptime/strftime?)

import bpy

from datetime import datetime
obj = bpy.context.active_object
obj['somedate'] = str(datetime.strptime('1900-01-01', '%Y-%m-%d'))


Scaling Bone Joints in Envelope View I have an armature whose envelope view shows some of the joints grotesquely out of whack so as to obscure the others, and I'm trying to visually scale the joints as per a video's illustration.

While entire bones will scale in edit or pose mode, the individual joints don't seem to scale visually in edit mode with the same data tab settings even in a new project:

Am I missing something?

The shortcut to scale a bones radius is: Alt+S