You just want the flow of your holding edges to go in the right direction not to interfere with the outside curvature:

Often, you can avoid hand-work by Beveling with segments 2, profile 1, or to leave adjustments in play, you could use a Bevel modifier .. If so, you could look into controlling bevel-widths by edge Bevel Weight.

Even if you're not going to keep the Bevel modifier alive, (you're going to apply it,)  the modifier can still make selection more practical. It's often important to bevel crossing edges simultaneously. The result of beveling one edge, and then a crossing edge, is different. So accumulating the right selection to go off in one shot can be a pain. Assigning Bevel weights, applying the modifier, and then setting all the weights back to 0 can make that easier.


how i disable this in dyntopo sculpting?

Turn on Constant Detail and the brush should behave the same zoomed in and zoomed out, same detail size but unfortunately the brush size will still increase and decrease by design.
edit: Found it, hit that lock there on theleft of the radius and you can zoom in and out and the brush stays the same size :D


AN separate text object - separate to words?

The best thing you can do is to compute the distance recursively inside a loop like this:

I get the width of each word using the dimensions vector, by adding all the width of all the words before each word, I know the location of my word with some space in between.


How can I make the animation to be loop without starting from the first frame but from the last frame?

Your question is not clear, do you want the object to come back to the center or do you want it to continue further to the left after frame 120 ?
For the first case, see Vklidu's answer.
If you want the object to continue further and indefinitely to the left, go in the Dopesheet press ShiftE > Linear Extrapolation (or Channel menu > Extrapolation mode > Linear Extrapolation)


It sounds like your render engine is set to Blender Render (also known as Blender Internal or BI) in the Info panel at the top of the window.

Try setting it to Cycles instead:


Bending a road at 90 degrees for a modular road system?

hatinacat2000's solution is great, but this was really bugging me and I had to find out what I was doing wrong.

My main mistake was having the centre of my road at 0,0 and also the minor mistake of having doubles in there from the array.

It's easier just to show an image of where the road should be. The empty axis is at 0,0.


This looks like typical Z-fighting. You seem to have doubles (i.e. two faces that are in the same space and overlap)
To remove doubles, go into edit mode, select all faces/vertices, press W and select "remove doubles".


How to apply single material but to different and multiple objects?

Put the material you want on one object that is the active object and while having ALL the objects you want the material on selected you press Ctrl+L (Make Links) and select "Materials".


How can i update my changes in the UI scripts?

One option is to run the altered script while it is in blender's text editor. There is a button in the text editor header for this.

Another option is to save the changes to disk and press F8. This will have blender re-run all the interface and addon scripts similar to having re-started blender, which is also an option.

Having said that it isn't recommended to alter the scripts that come with blender. You can create an addon that alters or adds to existing menus and lets you easily turn it on/off as well as use it again in the next version after you update.

If you look at some existing addons you can easily work out that you can add to the object specials menu with a line such as bpy.types.VIEW3D_MT_object_specials.append(MyMenu)


Animation Node (Vertex color) and Cycles Node (Gradient)

You are using the local texture coordinates to color the objects, thus the colors are local and identical for all arrows. What you want to do is color the objects solely based on their locations. In Cycles, the Object Info node can be employed as follows:

Where the value controls the radius of the gradient.


How could I set the dataType of a value in group input/output geometry node?

Like node group inputs / outputs in the shader editor, the value type is defined at the time of creation, and can't be changed afterwards.
You have to first create a dummy link to force the type you want in the node socket. You can then relink the socket to where you want it to be linked to.
If there is an automatic cast available between the two types (for example a boolean True / False is equivalent to an integer 1 / 0), it will be converted automatically for you. Beware though at the moment I don't think there is a warning message if you try to link incompatible types (Example : link an integer to an object socket).
See :

Note that you can change the default, min and max value of the sockets in the right hand side panel.


Rotoscope mask has different shape after rendering

If I render your file I get no problems with the mask being misaligned:

As for the rough edges by the armpit, those are part of the key from the green screen, they are not part of mask you are using as garbage matte.
The keying needs to be refined, so that you get better separation.

You might want to try blender.2.92 so that you don't have to convert from straight to premultiplied.
Read: How to put animated background to keyed video?
I suspect the issue could related to the kind of video compression, or how the image is being decoded by blender. Sometimes, depending on the codec used, blender fails to read the correct frame, and reads one frame ahead or one frame late.
Try prefetching the video, or rendering the video to an image sequence first, and use that image sequence to generate the key.
Please report back if the issue persists
See: Render is duplicating random frames when loaded into 3D tracker


You have to construct a Line Set by including/excluding characteristics of the object in the view.. the default is not serving your purpose, here. If necessary, you can explicitly select edges to be stroked by CtrlE : Edge Menu > Edge Data > Mark Freestyle Edge.

Here, I've just increased the Crease Angle ( a threshold value ) in the Freestyle settings....

but there are no end of options. I'd recommend playing with them using the Blender Internal renderer, so you get immediate feedback in the viewport. The settings will still be available when you switch back to Cycles.


How to set the weight of an entire mesh?

Go into edit mode on the mesh. Press A to select everything, then go to the object data tab to the right. It looks like an upside down pyramid. Under vertex groups, you should see a group named the same as your bone. Press assign with everything selected. That should work.


What does scene.objects.unlink really do?

It removes the object from that scene.

The reason the method is not called remove is that the object its self is not removed. Objects can exist in multiple scenes and groups. So scenes link to objects but don't store them (this is why you have bpy.data.objects).

The object-base is freed, mostly object-base is not exposed to the api, but in some cases accessing is important.


the best way to place crowds of animated objects

Maybe something like this?
All the particles are oriented towards the center of the emitter using Advanced Rotation settings for Hair particles:

I made a subdivided plane circular using a Simple Deform modifier.
Since the particles are emitted from the faces, I subdivided the faces in the back for a more even distribution.

I sloped the plane a bit and adjusted the rotation of the source objects of the particles accordingly and now it's like I'm in a stadium : )

EDIT:
It doesn't have to be Hairs; it can be Emitter.

I have no experience randomizing starting time of particle animations, though.

I'm not sure using Lifetime Randomness (which I assume you're referring to in your comment) can get the desired result.
I think you'd have to use something like this Animation Nodes add-onn
If you can do it without an add-on, I'd be interested to know how you do that. : )


Custom Layer Access

Suggest adding a custom layer. Example of adding an int layer.

id_int_layer = bm.verts.layers.int.new("id")

Vertex groups could also be considered a custom layer, it's the deform layer.

>>> bm.verts.layers.
                bevel_weight
                deform
                float
                int
                paint_mask
                shape
                skin
                string

Example of adding an int layer with values assigned to vertex index.

import bpy
import bmesh
obj = bpy.context.object

bm = bmesh.new()
bm.from_mesh(obj.data)

#get or create custom verts int layer
my_id = bm.verts.layers.int.get("id") or bm.verts.layers.int.new("id")

for v in bm.verts:
    v[my_id] = v.index  # assign value
    #print(v.index, v[my_id])

bm.to_mesh(obj.data)

Also see examples here, for tagging specific vertex using this method.  Custom data of vertices, Vertex Layers

After setting the layer on default cube, extruding one face, saving then reopening and printing v.index, v[my_id]

0 0
1 1
...
7 7
8 0
9 1
10 4
11 5

New verts 8 to 11 have the layer value of the original they were extruded from.


Linking multiple pivot points with object constraints

You need to use armature. There is no simpler way. Empties are more complex and I don't think they'll allow you to grab a child object to move the whole thing.


Sequence of Bones rotate One by One - Controlled by One Bone

Use self in drivers.

Similarly to @joshsanfelici have set the bones to XYZ Euler and driven the rotation z property of each bone via the target bone.
The ability to use self in drivers let's us get away with having one common driver and feed into it object properties.
In this case if one of our pose bones is self and the target bone is named "Bone" and is in the same armature then
self.id_data.pose.bones["Bone"]

is the target bone, and
self.id_data.pose.bones["Bone"].rotation_euler.z

is its $Z$ axis Euler rotation.
If we add a custom property to each bone, eg "prop" it can be used as the start rotation, eg
self["prop"] = 0.0

Rotations are in Eulers, as explained in other answer. So for example sake, if "prop2" is $\pi / 2$ can drive the bone using the target bone using a pretty long an inelegant expression that is the maximum of the minimum between 0 and the target rotation subtract the start range, and the range between our props...
Instead I have written a little script to add some props, make a simple UI, and a driver expression.  The UI is appended to the Pose Mode options panel in the 3D view N Tools Panel.
import bpy
from bpy.props import FloatVectorProperty, StringProperty
from math import radians

## properties

bpy.types.PoseBone.copy_range = FloatVectorProperty(
        size=2,
        unit='ROTATION',
        default=(0.0,radians(90)),
        )

bpy.types.PoseBone.target = StringProperty(
        )

# UI

def draw(self, context):
    ob = context.object
    pb = context.active_pose_bone
    self.layout.label(text="Bone Switch Test")
    self.layout.prop(pb, "rotation_euler", index=2)
    self.layout.prop(pb, "copy_range")
    self.layout.prop_search(pb, "target", ob.pose, "bones")

bpy.types.VIEW3D_PT_tools_posemode_options.append(draw)

## driver expression

def rotate_switch(self):
    target = self.id_data.pose.bones.get(self.target)
    if target:
        rz = self.copy_range
        range = rz[1] - rz[0]
        # map to 0 : range
        trz = target.rotation_euler.z
        return min(max(0, trz - rz[0]), range)

    return 0.0

bpy.app.driver_namespace["rotate_switch"] = rotate_switch

See the driver expression is
min(max(0, trz - rz[0]), range)

where trz is the target $Z$ rotation, rz[0] is at which rotation of target our bone starts, and range is the end minus the start of our bones rotation.
Easily extendable.
The idea here is to make it as easy to extend as possible. Can copy any of the driven bones and change their rotation range and the name of the driving bone on the fly.
Can edit the driver function and re-run the script, for example this simple change, (dividing the target rot by 4)
    trz = target.rotation_euler.z / 4

to make the "hammers" fall 90 degrees for each revolution of target bone.

Also here is a little helper script to convert all selected pose bones to XYZ euler rotation, and add a driver to all selected bar the active. (assumed the active is the driving bone)
import bpy

context = bpy.context

for pb in context.selected_pose_bones:
    pb.rotation_mode = 'XYZ'
    if pb is context.active_pose_bone:
        continue
    fcurve = pb.driver_add("rotation_euler", 2)
    driver = fcurve.driver
    driver.use_self = True
    driver.expression = "rotate_switch(self)"


Always assign to the property itself not a copy of it :

import bge
from bge import logic

def property(cont):
    own = cont.owner

    if 'Speed' in own and 'Recoil_Level' in own and 'Proportion_Size' in own:

        speed = own['Speed']
        level = own['Recoil_Level']
        size = own['Proportion_Size']

    else:
        print('No properties found in Weapon_Recoil_Level_Determiner')
        return

    own['Recoil_Level']= speed / size
        print("recoil level: ", own['Recoil_Level'])

cont = logic.getCurrentController()
property(cont)

level is just a copy ( not exactly but this how you should see it ) when you write  level = speed / size then level will change but  own['Recoil_Level'] won't change


Color objects based on distance in Animation Nodes

You can use the Set Vertex Color Node to color the objects, I will compute the distance between an empty and some objects, then loop over the objects, create a color based on the distance and set it:

The previous tree uses the distance as the hue, which produces:

But we can use it as the value for instance:

To use the vertex color as the color in a material, we check Vertex Color Paint in the material options:

Lastly, if you are using the Object Instancer Node to make the objects, make sure to check Deep Copy making each of the meshes independent. And of course, give the source object the required material.


Ok, I found out I can move every (point?) of my curve and snap it by Z axis to the closest face of terrain. Seems like it works.


How to mark edges on flat plane after shade smooth/auto smooth?

There is no way around this geometry wise, however you might use a custom normal map via image texture. That is perfect for this type of situation, and is often used in game assets for that reason.


How can i create the same smoke and light effects as in this Bob Ross canvas ? (see image)

Go in to blender. Go to "scene" on your right menues bar. Go to color management and under "view" select: "Filmic Log Encoding Base", then the image will turn ugly, but below exposure and gamma, there is a drop-down menu that says "None" right now. Select that and select the look you want to use. (usually I use medium_high Contrast, but it depends on the scene and how you want it to look.

You would need to add some "volume Scatter" in the scene, and a big smoke simulator to the scene aswell. I think the the smoke in the bob ross image is pretty dense, and would require som work to get it right. But the Volume scatter would add some fog effect to the background without having to use a awful lot of simulated smoke to the scene. The volume scatter is in the "world" tap, where you apply the effect under Volume. Then set the color to all white, and the density to like 0.001.

The "Filmic Log Encoding Base" makes the light react natural, instead of you inserting 1 million lights into the scene, so you get what you want.
Hope this helped a bit. :)


How to change the inherited F-curve independently from the original one ?

You could also try to use F-Curve-Modifiers. To do so:

Go to frame 0 and add a keyframe on the rotation Axes you want
In the Graph Editor bring up that sidebar by pressing N. Add a Modifier > Generator. This will give you the polinominal tools to create a Graph as in y=mx+b as you might remember from school.

This value controls the ascent of the curve. By default it's 1, so we have y=0+1x, so y=x meaning that for each 1 frame (one unit on the x axis), the curve ascends 1 unit on the y axis as well (it actually goes up to 57,296 because 1 rad= 57,296°).

So if you want to have a second object that rotates half of that speed, you just enter half of the value you entered at (3), 0.5 in my example.


There is no way to currently do this in Blender, as it takes a lot of RAM and computing time. In the future there may be support for this kind of thing in later versions of Blender. However, you can fake achieve a similar effect by subdividing the fluid a substantial amount, and using a dynamic paint modifier to produce waves on the surface. Add a dynamic canvas to the fluid (domain), and set the dynamic paint type to waves.Faked particle interaction

Then set the particle emitter to have a dynamic brush. Set the paint source to your particle system like in this picture:Hope this helps!


No. Larger sample numbers make the image more accurate. If images appear to lack variation and imperfections, (I assume that's what you mean by clean) you can manually add them. This may include

Particle systems in the air for dust
Manually added light 'shafts'
scratches on surfaces
fading, or slightly different shades of colors
high amounts of randomness (not weirdness, RANDOMNESS)

All of these can go to make sure your picture look less 'perfect' although most of the time, you don't need to add them.
It all depends on how closely the final will be observed, and how critical your audience is. (or how dirty, being the opposite of clean, you feel comfortable with.


Problems with particle hair in 2.72 (cycles)

I struggled with the same problem. Here is my example:

In my case I set up the hair settings, and then realized that the mesh isn't perfect. Then I tried to remove doubles, and change the geometry.
Every time you change geometry (actions like: deleting, separating, ripping vertices) with the hair settings set up, you may see this problem appear.

My advice is to (before setting up the hair):

Apply rotation, location and scale. Ctrl A
Remove doubles.
Apply mirror modifier.
Recalculate normals. Ctrl N
Check the mesh using "mesh lint addon" and make sure the mesh is 'clear' (has no ngons and interior faces).

After applying all the things mentioned above my problem was solved.


You're in LookDev view, which applies some preset environment maps by default. To view your material as it will appear in your scene, switch to Render view, e.g. via the buttons in the 3D view header:


Workflow Question: How to get from a 3D scan to Aurasma Augmented Reality

Decimate modifier doesn't take in account UV maps.

With the collapse option enabled it:

  ...merge (s) vertices together progressively, taking the shape of the mesh into account

While mergin vertex, it likely happens that the UV mess up. You should create a new UV map for the decimated object and stick the original texture to it.

Start from duplicate (Shift+D) your mesh. Rename the source object
"Highpoly"    and the duplicated one "Lowpoly" (keep them in place,
overlayed)
Add and apply a Decimate modifier with the wanted settings on the Lowpoly object
The UVmap of the Lowpoly has now been destroyed in the decimation, you must re-unwrap your model.
Bake the original texture from the Highpoly to the Lowpoly as shown for example in this video (the only difference is that you should bake "textures" instead of "normals")


How to create an image with transparency

It depends on what you are actually asking:

If you need ot create an RGBA image, so an image that also has the Alpha Channel. (So a RGBA type instead of the normal RGB). Just Check ALPHA when you create it via UI or in code:

bpy.data.images.new("albedo", width=1024, height=1024, alpha = True)
If you want the default color to be instead of black any other color so even one with some transparency, this is the fastest way I found:

im = bpy.data.images.new("albedo", width=1024, height=1024, alpha = True)
im.generated_color = (1,0,0,0.5)

This code actually generates a Red image half transparent.


There are many strategies to animate high poly meshes.
The "professional" way is to retopologize the character, baking all small details into a normal map, so to be able to animate and export a low or mid poly mesh.
Another way is to create a low poly proxy, to be used for programming the animation, and then use the high poly version only for render.
In the render properties panel you can enable the "simplify" option, to allow only a low or null level of subsurf (and let it operate only during render).
You can add a decimate modifier to the mesh to reduce the amount of vertices, and disable it for render.
You can split the mesh into pieces and turn them off when you don't need to look at them.


How to Offset\Distribute EVENLY with PBR in Blender 2.8x?

You need to map the UVs of your mesh so that they are spaced evenly according to their dimensions. Since your mesh will map nicely onto a 2D plane. Blender can do this for you very easily.

What you had was close, but not mathematically perfect.

The best way to do it would first be to mark a seam on your mesh that will tell blender where it can start mapping, then a normal U unwrap will work (keeping the dimensions of the faces consistent). See GIF


You need to delete all faces that are going to be hidden by the Array modifier (selected on the screenshot, delete them on both sides of the object). Then enable the "merge" option in the modifier settings.

Normally, this is the way I'd be going for. Sadly, I can't tell you why the subsurf modifier messes up in this mesh. But if you put a fairly high Crease amount on most of the edges (except those that should be smoothed) it works fine.

If you are looking from your object from a distance, the Edge split modifier will do the trick. If you have some spare render time, go for a Subsurf and eventually then a Bevel modifier.


How to change canvas size in 2D Animator

Pixel size depends on your render resolution and camera, not your canvas.

You can change canvas proportions in Viewport Display > Canvas
And you can also adjust the subdivisions.


How to change alpha value of all material in a single go?

Try running this script
import bpy
for mat in bpy.data.materials:
    if not mat.use_nodes: continue
    for n in mat.node_tree.nodes:
        if n.type == 'BSDF_PRINCIPLED':
            n.inputs["Alpha"].default_value = 1


Gradient colors ramp Shader Node - Vertical and static (animated object)

As @Allen Simpson has commented:
If you use a single cyclic Bezier curve, given thickness with its native Bevel, (set in its  Data tab > Geometry panel,) it is automatically mapped 0->1 in U along its length.
So a node arrangement like this can set the color-ramp's range of colors along its length:

The Add and Wrap nodes are optional: changing the 'Add' value shifts the whole range along the curve.


How to import obj and convert and export as fbx from command line in Python

The link @HikariTw should give you an answer; for example on my system the path to Blender is /Applications/Blender.app/Contents/MacOS/Blender.  The error you're getting is because the Blender binary isn't in your path.
As for importing/exporting; your script should be pretty simple, just remove the default cube, call bpy.ops.import_mesh.stl to import and bpy.ops.export_scene.fbx to export.


To start with, I will just mention that the biggest issue in the current game market is not theft, it is the opposite: trying to get people to play your game out of the thousands of others.

My suggestion is to:

Provide a basic template to everyone (so who would steal it?)
Provide good documentation on what objects you can add that do what.

OR
Take a completely alternate approach, such as having a blend file called 'LevelParts.blend' with groups of objects people can append to their custom levels.


I tried an approach that often works for me in recovering from blender trickery ;-)
I started a new blend app session, "File :: Append" the old file, and things started working again.   As I had only a lowly 16 GB RAM, I set 3d-view to solid (not Material Preview) as compiling the Material renders would blow my memory limit.
With this workaround, there's no telling how many times you may need to recover, as you'll need to report this bug to the Archipack community.


How to achieve "simple" deformation of a plane?

You can use an armature to deform a sub-divided plane.  Select the plane and shift select the Armature to make it the primary selection with the plane as the secondary selection.

Press Ctrlp to parent the plane to the armature.  I selected Armature Deform with Automatic Weights.

There is a color picker available to select colors from other areas visible in the UI.
If you hover over the color field of a node and press the e key you can then click on an image that has has been drag 'n dropped into the UV Image Editor.  Now you can pick the various colors of the image to use for the Material and Sky colors.

You can use Freestyle to add the edge highlighting.

The setup is shown in the following two images.
(i)Activate Freestyle in the Render tab
(ii)Add a Lineset
(iii)Change the color to match.

The color of the paper is multiplied by 3.0 to brighten it up.

To get the exact shape of the reference image, you can try a more detailed Armature.

Another option is to add a sphere and use the Snap tool(magnet icon).

Snapping activates when you select one or more vertices and press g and then enter to set the movement.


Render specific meridians/parallels of a sphere

Start with an UVSphere.

Select the edge loops you want (Equator, Parallels, Meridians)

Press P to separate the selected edges.

Select the newly created object and press AltC to Convert the object to Curves:

Give the curve some bevel or extrusion:


When you subdivide an object, the degree to which an edge gets smoothed out depends on how far away the next edge is. You'll notice that the right side of your cutaway is completely devoid of edges, so this edge is getting pulled a long way off. Meanwhile the edge at the back of the cutaway has another edge loop close behind (where the selected vertex is in the first screenshot), and is therefore much sharper in the subdivided mesh.

Here's a simpler example to illustrate what's happening:

Plain mesh before subdivision:

After subdivision. Notice how the edge is more rounded on the right side of the cutaway.

If you want all the edges to have the same amount of rounding, add edge loops at a constant distance from both side of each edge in the existing mesh (by hitting ControlR in Edit mode)

Here's the same mesh in edit mode with extra edge loops:

And this it what it looks like after subdivision:

If you want the edges to be more rounded, move the additional edge loops further away from the existing edges. And if you want sharper edges, move them closer in.

Alternatively, try using the Bevel tool instead of a subdivision modifier.


This can be done using the Displace modifier.

Subdivide the circle a few times to ensure it has enough polygons to displace
UV unwrap the circle and apply the texture to it, ensuring it fits nicely to the circle
Add a Displace modifier, using the texture, and selecting the correct UV map in the modifier settings, this should give you something like this (I used your example image, but the original will probably look better)

Apply all modifiers and go into edit mode, then select all vertices that are not on the ground plane and delete them. (press B to select vertices and then press Numpad 1 to go into side view, also you'll want to turn Limit selection to visible off, which can be found on the header of the 3d view at the bottom)

Cleanup the result by selecting all vertices and pressing S Z 0 Enter to make all resulting vertices flat to the ground. Also you could add  a Decimate modifier, or cleanup a bit manually.


You just need the dimensions of the sensor.

Put those on the sensor width or height.

Then use the plus button (+) on the right of the preset to create a new one, and name it whatever you wish.

To delete the presets you don't need, use the minus button.

Presets are a .py file located in the Scripts folder within the blender progra's folder. In windows they would be in

C:\Program Files\Blender Foundation\Blender\2.78\scripts\presets\camera.

As an example, this is the preset for a Full Frame camera:

Full_Frame_35mm_Camera.py

import bpy

bpy.context.camera.sensor_width = 36

bpy.context.camera.sensor_height = 24

bpy.context.camera.sensor_fit = 'HORIZONTAL'


The problem was to do with the Ray Distance setting. I dont know how it works exactly but it happened to the parts of the leg that were facing each other and sitting close to each other. turning the ray distance down to .1 instead of 1 made the normal render perfect.


Quads are not always necessary, but are usually preferred when deforming a mesh for animation &/OR Rigging. If you are creating a static model (eg. a sculpture of a statue, etc...) Then it can be acceptable to use Triangulated faces, as there is no reason to worry about the integrity of the deformations.

Notice the deformation smoothness when we bend a cylinder.

As for my version of face Definitions:

NGon technically a face with vertices > 3, but because we have names for 3 vert, and 4 vert faces, this is commonly reserved to describe a face >= 5.

Quad = 4 vertices.

Triangulated is just the primitive minimum for a face to exist, as the vertices that make it up = 3.

Two vertices make an edge with no area.

One is just a single point (Vertex).


On your Timeline, you've enabled Scaling in the Active Keying Set Used to Create/Delete Keyframe field, so whatever you do with your bones, except scaling, it won't be recorded. So choose LocRotScale, or even disable this option and use i to insert keyframes manually.


How can I convert an image to JPEG from the active material node with Python?

Try
image.file_format = 'JPEG'
image.filepath_raw = your_new_filepath_here
image.save()


Why is this fluid being stretched into a line?

Have you tried the following things:

-Change the volume initialization's volume/shell/both settings on the obstacles the fluid interacts with, and seeing how they interact in a scene?

-Checked where the normals are set for objects, especially obstacles, to make sure they aren't projecting weird spaces into the domain?

-Looked at the initial trajectory of the inflow object?

I had similar issues with the fluid sim acting up (found here - Fluid sim is not working right; water forms a flat table with an object, creates a large gap ). The issues were a combination of objects needing their volume init changed, and the re-setting the normals to be inside. Took about an hour of debugging, but since it was my first fluid sim it taught me a lot about how tempermental the fluid sim calculations can be. The fluid sim is certainly a cross between "art" and "science", and you'll need some experimentation to understand how it operates. There's no easy fix, it just takes practice and time.

As I said though, if you can't figure it out after an hour or so, post back. It should be resolved with a bit of parameter spelunking though.


How can I make a tile-able polygon background?

Step 1: Modeling:

Start with a flat plane. Next, add some modifiers, first a sub surf (set the division to 6 or 8 & set the mode to simple), then a displace with a default cloud texture (set the strength to taste - you may want to adjust it after the next step), and finally, a decimate modifier. Adjust the ratio until the poly-gon pattern looks right:

Next it is time to define the edge that will be tiled.

First, apply all the modifiers, and then make any adjustments to the polygons (make ones that are too small and thin etc. the right shape).

Finally, grab all the vertices along the edges you wish to tile, and delete them:

Now we will need to cut an edge. Any spot works, I pick one near the left edge. Go into top view Numpad7, Then use the kinfe tool K, locked on an axis C. Click and drag up, and then hit enter.

Now we need to split the mesh along this edge. To do this, hit V and drag to the side, so that the edge comes away. Use RMB to put it back into place. Del-select everything with A, and hover over one of the halfs and hit L to select it.

Drag it over to the other side, and fill in the seem. The two opposing edges will now be contiguous when lined up.

Step 2: Shading

See this answer for details. This answer other may also be found useful.


How to put similar named objects into collection in python?

I would do the same in python that I could do in the UI, which is to use Select Pattern, and then move these selected items to a Collection.
In python:
bpy.ops.object.select_all( action='DESELECT' ) # Deselect all objects
bpy.ops.object.select_pattern(pattern="Sphere*")

# if collection Sphere does not yet exist:
bpy.ops.object.move_to_collection( collection_index=0, is_new=True, new_collection_name='Sphere' ) # new collection
# else if collection Sphere does exist:
bpy.ops.object.move_to_collection( collection_index=2 ) # need collection index


Select the faces in Edit Mode, then select the menu option: Mesh/Faces/Shade smooth


It looks like you have some coincident geometry, but it's hard to tell what's causing it. It's quite possible that you have two copies of the same thing there, one of which is getting the material you want, and the other is covering it up. Right-click and drag on that model to make sure there's not another one underneath it.

Make sure that you're doing your selection in wireframe mode (not shaded), so that you're certain you're getting all the vertices. Keep in mind that you'll have to DEselect any vertices on the opposite side of the model, that you don't want to use that material.

I hope this helps!


Output vs Format vs Codec: what is the right combination?

1 - Explanation of why with MP3 output the WAV sound is missing but the AAC sound is audible
this could be a problem with that particular file, try converting it to mp3 using an external program like ffmpeg or audacity or even an online tool.
or try a matroska container with x264 video codec and mp3 audio codec.

2 - Understanding the differences between selections in Output section: MPEG vs H.264 since these seem to be the most common. Other formats are welcome :) (Frame server, XVid, AVI Raw|JPEG).

3 - Explanation of Encoding > Format and Encoding > Codec options, in relation to point 2. For example, why are you able to choose MPEG output and non-MPEG format and non-MPEG-non-<format> codec? This is VERY confusing.

a container like (mp4,mkv) contains n video streams and n audio streams encoded in a given format with a given codec,a codec is a coder and decoder.
think of a container like a .zip or .rar file
some containers don't allow certain combination of those codecs (like .webm can't have a video stream encoded in h.264 but allows a vp9).

blender offers you presets to make your life easier.
a mpeg-4 (.mp4) with h.264 and mp3 like in your screenshot is a valid combination and the reason h264 is common is because it produces better video quality with small sizes and is well supported by browsers and Operating systems.


How do I completely remove an image from my .blend file?

If you have an image (or other piece of data, such as a material) you can force remove all users by Shift clicking on the X next to it's name. This will "mark" the data for removal upon closing the file.

After you force remove the data, you'll need to reopen the file in order for the data to be removed. You can do this quickly by saving the file with CtrlS and then opening it with CtrlShiftO and selecting the file.


Is it possible to blur an Input value in the Cycles material node editor?

Unfortunately you can't. The answer you linked works by adjusting the mapping coordinates, but this isn't possible with the fresnel node.

Perhaps if we knew more about what kind of effect you were trying to get we could think of an alternate approach..


FBX export operator - How can I change the scaling mode?

oh sorry for this stupid question
as Robert Gützkow and brockmann mentioned I didn't set the path
import bpy

#example path to store files
path = os.path.expanduser("~/Desktop")

#export fbx
filename = path + 'Test.fbx'
bpy.ops.export_scene.fbx(filepath=filename, use_selection=True,apply_scale_options='FBX_SCALE_UNITS',apply_unit_scale=True)

os.path.join() method in Python join one or more path components
intelligently. This method concatenates various path components with
exactly one directory separator (‘/’) following each non-empty part
except the last path component. If the last path component to be
joined is empty then a directory seperator (‘/’) is put at the end.

import bpy

# importing os module
import os

#example path to store files
path = os.path.expanduser("~/Desktop")

# Join various path components
filename = os.path.join(path, 'Test.fbx')

bpy.ops.export_scene.fbx(filepath=filename, use_selection=True,apply_scale_options='FBX_SCALE_UNITS',apply_unit_scale=True)

Instead of setting path manually, I use this solution


Can you fade in and out particles in blender eevee?

Here is an example of one way to do it in EEVEE. The idea is to use an object as the base for a particle instance, then to give that object a material that fades in and out over time.
The setup for the material is this - The primary factor of this is that you can type #frame into the field of a value node, and it will then provide the value of the frame position at any given point. I used some math to make it oscillate, and to slow it down a little. The idea is to use the sine of the frame number as a Mix Factor between the regular material (particle color) and a Transparent Shader, thus making it fade in and out. You can adjust the division number to speed up or slow down the fade. Lastly, don't forget to change the Blend Mode.


Deleting an object part of a collection does not remove it from the collection

I fixed my problem by creating new collections (which obviously don't contain the deleted object), selecting an empty which shall receive the new collection as the instancing property and using a simple script

import bpy

bpy.ops.object.select_linked(type='DUPGROUP')
for obj in bpy.context.selected_objects:
    obj.instance_collection = bpy.data.collections["newCollection"]

Afterward I found out I could have done the same via Select Linked (Shift+L) \ Instanced Collection and editing the property while holding Alt (to apply it to all selected objects).

I still have the now unused collections in the blend-file and can't seem to get rid of them plus I was searching for a way to edit the original collections so I see this as a workaround and leave the question open for additional answers.


Alpha not showing up in renders for textures painted with transparent png

Thanks to @brockmann's hint I was able to resolve this issue. It was just a matter of connecting the alpha channel of the image node (got to shading tab) to the alpha input of the material node as such:
before:

after:

Apparently Evee does not render this correctly, so I needed to switch to cycles to see how it looks!


If you want it to look like lighting, you could just use colored lights?

But to shade the surface, you could use an arrangement something like this ..

.. which is quite tweakable .. It would depend.. how do you want the colors to be combined.. as @moonboots asked, do you want the colors to be stuck to the surface?


Using shaders (Eevee here but works for Cycles too).

Top part:
Presuming Z is facing the camera, we take X and Y as base for the calculation.
Artan2 gives the angle between -pi and pi for each X and Y position.
Bottom part:
Now from 2 values the current frame and the amount of frames, translate that in order to have a value between 0 and pi.
Then translate it between 0 and -pi (for the left part) and between pi and 0 for the right part.
Transparency:
We compare that to the effective X Y angle and if OK (one or other into the good interval), set alpha to 1 (no transparency).

Another way, that can be considered less maths and/or more flexible is to use a gradient texture with radial mode:


Unfortunally there's a bit less Information in your question and - AFAIS - not any object in your uploaded file?
So a real general answer...

If you are starting with parenting, maybe you're looking for Parenting with armatures?
Creating Bones for Rigging in Blender

Maybe the problem is cutting in cloths in ellbow and popliteal?
Then IMHO the better solution is using Cloth physics.
A workaround will be using additional bones for sensitive parts.

You can learn much about using weight paint on different bones, if you import a Make Human character (I'm using collada to import) and study the dependicies...

I hope it helps.


look this! will help you
https://youtu.be/1WS8b1Ww8Ys
if your model has a foot attached to the rest of the body ... you can do the same procedure, and use the data transfer on the deformation object


How to toggle renderable on/off for objects in the 3D View

You can do this by selecting the objects in the 3D Viewport and pressing Ctrl+H. This will hide the selected objects during render operations. To clear the restricted render property from objects, simply press Ctrl+Alt+H.


How can i keep deformed skinned mesh and rigged bones after scaling them?

Pose your model as wanted, select your mesh, in the properties panel - object mode  - apply the armature modifier, select the armature in pose mode, select all bones, Ctrl+A
 "Apply pose as rest pose", then select the mesh and readd an armature modifier, choose your rig as "object".

Be aware that the new rig will not execute old animations properly.


Object Constraint - Object won't make a 360º rotation

This is happening because that's how the Transformation constraint works w/r/t to rotation.
From the Blender Manual:

When using the rotation transform properties of the target as input, whatever the real values are, the constraint will always “take them back” into the (-180 to 180) range. E.g. if the target has a rotation of 420 degrees around its X axis, the values used as X input by the constraint will be:
((420+180)modulo360)−180=60−...
This is why this constraint is not really suited for gears!

You can use rigid body simulation to animate these properly, but that's beyond the scope of this answer.


how to change user preference in blender version 2.81

The preferences can be edited within Blender. For 2.8x they are located in Edit > Preferences. More information can be found in the manual.


Is there documentation for the Industry Compatible Hotkeys?

I found the function for industry compatible hotkeys in Blender.
Go to the top left tab of the window and click on preferences> edit:

In the blender preferences, go to "Keymap".
Click on the "Blender" space at the top of the window for the preferences when on the keymap settings, and you will see more options:

"Blender"

"2.7X"

"Industry Compatible"

Select industry compatible. I don't know the hotkeys for Maya, but this should do the trick.


Eevee treats transparent objects differently than Cycles. They are sorted from front-to-back per object and do not receive any screen space effects.

This is fast and works fine for many cases, but it is only approximate and gives incorrect results for some object shapes. For more accurate results, enable Alpha Hashed transparency in the material. With a sufficient number of samples to resolve the noise, this gives accurate transparency.


How to find number of animated frames in a scene via python?

If the duration of the scene is known, simply use bpy.context.scene.frame_end and assign a custom duration value to it - this will overwrite the current playback/rendering range:

import bpy

# get the current scene
scn = bpy.context.scene

# assign new duration value
scn.frame_end = 880

In order to adjust the scene duration dynamically (based on the included animations) you'll need to iterate through all the relevant objects in the scene  and read their keyframes by using either Animation Data or Actions.

Keyframes via Animation Data

Use animation_data to get the keyframes of an object. Following example reads the keyframes of the selected objects and prints the first and the last keyframe to the console.

import bpy
import math

# get keyframes of object list
def get_keyframes(obj_list):
    keyframes = []
    for obj in obj_list:
        anim = obj.animation_data
        if anim is not None and anim.action is not None:
            for fcu in anim.action.fcurves:
                for keyframe in fcu.keyframe_points:
                    x, y = keyframe.co
                    if x not in keyframes:
                        keyframes.append((math.ceil(x)))
    return keyframes

# get all selected objects
selection = bpy.context.selected_objects

# check if selection is not empty
if selection:

    # get all frames with assigned keyframes
    keys = get_keyframes(selection)

    # print all keyframes
    print (keys)

    # print first and last keyframe
    print ("{} {}".format("first keyframe:", keys[0]))
    print ("{} {}".format("last keyframe:", keys[-1]))

else:
    print ('nothing selected')

Keyframes via Actions

Use bpy.data.actions to get a list of actions in the scene, but actions are not associated with objects, scenes or nodes. Following example reads the frame range of all F-Curves within the actions of the file and prints the first and the last keyframe to the console.

import bpy

# check if actions is empty
if bpy.data.actions:

    # get all actions
    action_list = [action.frame_range for action in bpy.data.actions]

    # sort, remove doubles and create a set
    keys = (sorted(set([item for sublist in action_list for item in sublist])))

    # print all keyframes
    print (keys)

    # print first and last keyframe
    print ("{} {}".format("first keyframe:", keys[0]))
    print ("{} {}".format("last keyframe:", keys[-1]))

else:
    print ("no actions")

Test scene

Console Output of both methods:

[1, 5, 7, 18, 21, 30, 47, 49, 67, 69, 75, 84, 100]
first keyframe: 1
last keyframe: 100

Speed comparison

Animation Data method takes 0.000446319580078125 sec.
Action method takes 0.00011038780212402344 sec.

Adjusting the timeline

As mentioned above, in order to set the beginning and end of the scene, you can assign the calculated values to bpy.context.scene.frame_start and bpy.context.scene.frame_end:

# get the current scene
scn = bpy.context.scene

# assign new starting frame
scn.frame_start = keys[0]

# assign new end frame
scn.frame_end = keys[-1]

Final Note

It really depends on what you want to achieve. Using animation_data is slower, but using action.frame_range can be dangerous, because if you have to delete an object during the process, the actions of the objects remain until the blend file is saved again. See: https://blender.stackexchange.com/a/27235/3710


Modeling a circular shape with round extrusions along the edge

Start with a mesh->circle with a lot of vertices.

Estrude and Scale:

With all of the edges/faces selected Press I to activate the Inset Tool and enable Indivdual.

By controling thethickness and depth you should be able to get something like this:

Smooth and subsurf:


There are a couple ways of doing this. Here's one way in cycles as your question didn't specify which engine you are using.

Start by adding an input>geometry node using the normal output.
Next, add a Separate XYZ node, you will be using the Z output.
A color ramp will be next, this will control the mix between the
dust layer and the rest of the material. Plug this and the preceding 2 nodes into the Fac of
the mix shader as shown below.
You can either use a diffuse shader colored as you want your dust, or
use a suitable image for your dust, it will go in the bottom input of
a mix shader.

Here is the node setup with an image texture, to use without, simply don't use it.

This is a suzanne with the above material:


Is it possible to get rid of n-gons/poles when using face loops?

You can use a knife tool using K button in Edit Mode, then position the knife cursor over the vertices, when the knife tool snaps to the vertices you will see the knife icon green square outlined with red color, then left click with the mouse and continue cutting like in the image below. When youre finished cutting hit Enter button to apply. You can use E button while cutting to continue cuts in different locations.


How can I have a split column inside a box?

you can stack layouts, as each of the container layout elements can host other containers:

    layout = self.layout
    box = layout.box()

    # put a column layout into the box
    col = box.column(align = True)

    # also separators work
    col.separator()

    # add a row layout into the column, which is inside the box, which is inside a panel,.....
    row = col.row(align = True)
    row.operator(**example**)
    row.operator(**example**)


My image texture displays correctly in material preview but not in 3D viewport

I am closing this request for any further comments since no more suggestions have been forthcoming and nothing I tried made any difference to the lack of display in the viewport. I reluctantly deleted the eyes and made new ones applying the same image texture, in the same way and they work perfectly well.
I guess I will never know what the problem was.
Thanks for looking.


Simple Addon 50 lines - Crash blender - what I do bad?

Is it as simple as it could be?.
A TL;DR comment turned into answer:
Doesn't crash for me... but does throw errors. Some of the issues as I see them.
Sure it's a simple little addon, but.. appears to be some added and IMO unnecessary complexity added too. (bling).
Is there really any need to type hint the usual suspects  and  familiar arguments of  self, context ?
def execute( self : bpy.types.Operator , context : bpy.types.Context )

Let's look at  Text Editor > Templates > Python > Operator Simple and make a small change
def execute(self, context):
    print(type(self))
    main(context)
    return {'FINISHED'}

output
<class '__main__.SimpleOperator'>
<bpy_struct, Object("Armature") at 0x7f1e0c715008>

ie the operator type is not an instance of  bpy.types.Operator
Any need to toggle the active object?
There is no need to toggle the active object with
context.view_layer.objects.active = None
context.view_layer.objects.active = obj

and  since context is an argument of method there is never any need to see bpy.context
Dynamic Paint Modifier.
Once a dynamic paint modifier is added to an object, it cannot be added again.  If you try and do so again it will not add a modifier and return None. (NoneType) is not an instance of bpy.types.DynamicPaintModifier
Main thread.
Any benefit in using if not __package__ vs if __name__ == "__main__" ?  Will it always equate?


How would you sculpt/model absimple character like this one?

Is that all the references you got?:) It’s ok, it looks like the character is symmetrical enough. My advice is to analyze the form.

To give a few examples, the head is just an elongate sphere (not cylinder), the hat is basically a section of that sphere. The eyes are squashed spheres with the eyelid being squashed sphere sections. The teeth are a combination of a cylinder stretched in one axis with a spherical end. The mouth is a cut of irregular contour that sits on the top of the spherical head. You have to learn to obtain those forms from simpler forms.

I think the most important parts are the textures and the rendering.


How can I change the hover color of tools in the UI?

In the user settings there is a "themes" tab. Use it to change any colors you see fit!

You can also look around - there are many color schemes to be had!


how to use a texture on each side of the same face

Same as above but using Blender Render - it has to use nodes, there isn't a way without it. By using the Geometry node, I plug the Front/Back input to the Factor of the color mix node that is sent to the material color node. At this stage, you can then plug your image textures into the two colors of the color mix node, and indicate the UV Map name there in the Geometry node.


It is possible. I have the similar case as yours. I've got a model, which consists of multiple separate parts. Each part has its own single material and own textures.

First join the meshes together with Ctrl+J.

Next create a new UV Map (press the '+' button in the UV Maps panel of the Mesh Data header and add a new image in the UV Editor window.

Unwrap your mesh with U-->Unwrap.

Go to Render header, set the bake mode to Textures and hit the BAKE button. It will create one big color texture map from the all textures you've apllied.

EDIT:
Here's a case, where object has one material and multiple textures applied to each face of the cube (via Unwrap-->Project from View(Bounds)). Every face has its own UV Map slot.

I then marked seams for the cube, unwraped it and created new UV Map for it (called 'all'). Then baked the Textures. And here's the result:

Hope it'll help you.


Why does the simple deform modifier not bend when created or strechted on the Y axis?

There are two axes to take into account when using the Simple Deform modifier.

The axis of deformation, set in the modifier, around which, in 'Twist' and 'Bend', vertices rotate.
The axis of extent, which determines, according to the fraction of the object's bounding box along it, either side of the origin, how much the vertices are rotated.

The examples below have their 'Bend' deformation axes set to X, Y and Z:

as you can see, the axes of extent are Z,Z, and X.
I wish you could set both axes in the modifier. Personally, I always wind up using an Empty as an axis/origin object, and fiddle with it until it works.


Just the good old fashioned import I'm afraid. If you have a lot of STL's, I believe you can batch import them via. Python scripting. I have found this thread, this however is OBJ's and on Mac, but perhaps it cna point you in the right direction:-)

Drag and drop importing of .OBJ files


Use your phone camera, and hold it as far away as possible to reduce lens deformation. Hold the camera so the lens is at eye's height, as centered as possible. Cut the photo in two using gimp or other 2D software, and mirror it. Even professional taken photos have some non symmetricsl details.

Also take a shot in profile, at the same distance and height, and adjust to keep as close as possible the proportions between the two shoots.

Use the reference just as it is: a reference not a sharp point-to-point grid.


How to Set Transparency to One Specific Color in EEVEE

Oh my actually it's simple, I use wrong shader. It should be principled BSDF, not emission. So what actually to do is:
 - Set black color of color ramp to alpha. Decrease alpha value to zero should work
 - Color output of color ramp must be connected to color of Principled BSDF, and alpha output to alpha input.


Anyone know a technique for blending these two smoothly? It's a sword handle attaching to guard

For something like this, I would recommend a progressive reduction in the number of faces by using extrude and merge operations (Provided your starting cylinder has an even number of faces).
Start by extruding a section of the cylinder. From here, select neighboring pairs of points around the perimeter, and merge them to their midpoint by pressing M and selecting "at center".

Once all the pairs are merged, extrude the bottom face and do it again.

Do this as many times as is necessary until the bottom face only has 4 points. Note - by this point the bottom face will have "shrunk" a bit relative to the rest due to the merge operations. You may take this opportunity to scale it back until it's closer to the size of the mesh above it.

From here, you can extrude the bottom face again, and then scale it to fit the piece you are trying to connect it to.


Maybe what you need to do is create a root bone that will allow you to move your robot up and down while its spine will rotate:

In Edit mode, create a root bone. Make it the parent of the spine basis (and also of all the IK controllers, pole targets, etc...).
In the Properties panel > Bone > disable the Deform option so that this kind of bone (like IK controllers, pole targets...) won't have any influence on the mesh.
Now you can independently rotate the spine basis and move the root up and down.

Another way could be to move the armature in Object mode, but the best, if your robot stay rather still on the scene, is to create a root bone so that the armature (as an object) remains not animated.

But when you'll make your robot move along a path, most of the time you'll use this second option, though.


How do I rotate the viewport, without leaving the x/y-plane?

Updated based on the comment:

The option you look for is the "Orbit left" using the Numpad 4 and "Orbit Right" using Numpad 6 respectively. At least in my logic that is the only way to rotate the viewport(as in the title of the question) and is not leaving the xy-plane. Not sure how "Roll and Orbit is different here as the result seems to be the same.

The increase or decrease in angle is set default to 15 degree in the preferences here:

Setting the Rotation Angle to 1.0, would result in the "Orbiting" to be a lot smoother.

Here a little visual demonstration:

Happy Blending


how to add siding to exterior of building

In edit mode select the ominous faces and assign material for them.


How do I animate a rotation with 3D cursor as pivot point?

The object's position is based on the rotation and location of its origin. When you change an object's rotation property, the origin's rotation is changed and the entire mesh is rotated around that point.

If the origin is somewhere in the middle of the object, and you apply rotation keyframes to it, this happens.

But since you want your bell to rotate about a point near its top, you just need to move the object's origin to the rotation point, resulting in something like this:

To move the origin, you can move your 3D cursor to the point where you want the origin, select the object, right-click, and go to Set Origin > Origin to 3D Cursor.

Alternatively, while in Object mode, you can go to the Active Tool and Workspace Settings tab and under Options > Transform > Affect only, select Origins.

This will cause any transformations you do to only affect the object's origin, allowing you to move it to the top of your bell.

Another method to change an object's pivot point in animations is to create an Empty Axis at the desired pivot point, parent the object (your bell in this case), to the empty, and animate the axis instead.


is there a way to automate render file names and avoid accidental overwrites?

The following add-on generates a unique file path from a given directory and the current timestamp. It modifies both the output path (Output Properties > Output) and every base path of File Output nodes.

For instance, if the directory (Output Properties > Auto-Filename > Directory) is set to C:\tmp\ and the current timestamp is 2020-03-22_01_10_43_857754 then the output path is C:\tmp\2020-03-22_01_10_43_857754\#### and the base path of the File Output nodes are C:\tmp\2020-03-22_01_10_43_857754\[name of the file output node].
bl_info = {
    "name": "Auto-Filepath",
    "author": "Robert Guetzkow",
    "version": (1, 0, 2),
    "blender": (2, 80, 0),
    "location": "Output Properties > Auto-filepath",
    "description": "Automatically sets a unique filepath for each frame based on the current timestamp.",
    "warning": "",
    "wiki_url": "",
    "category": "Render"}

import bpy
import datetime
from pathlib import Path
from bpy.app.handlers import persistent

@persistent
def update_filepath(self):
    if not bpy.context.scene.auto_filepath_settings.use_auto_filepath:
        return
    now = datetime.datetime.now()
    path = Path(bpy.context.scene.auto_filepath_settings.directory)
    base_path = path / now.strftime('%Y-%m-%d_%H_%M_%S_%f')
    bpy.context.scene.render.filepath = str(base_path / "####")
    bpy.context.scene.render.use_file_extension = True
    bpy.context.scene.render.use_overwrite = False
    if bpy.context.scene.use_nodes:
        for node in bpy.context.scene.node_tree.nodes:
            if node.type == "OUTPUT_FILE":
                node.base_path = str(base_path / node.name)

def set_directory(self, value):
    path = Path(value)
    if path.is_dir():
        self["directory"] = value

def get_directory(self):
    return self.get("directory", bpy.context.scene.auto_filepath_settings.bl_rna.properties["directory"].default)

class AutoFilepathSettings(bpy.types.PropertyGroup):
    use_auto_filepath: bpy.props.BoolProperty(name="Automatic filepath generation.",
                                              description="Enable/disable automatic filepath generation. When enabled, "
                                                          "this will overwrite the output path and the base path of "
                                                          "all File Output nodes.",
                                              default=False)

    directory: bpy.props.StringProperty(name="Directory",
                                        description="Directory where files shall be stored.",
                                        default="/",
                                        maxlen=4096,
                                        subtype="DIR_PATH",
                                        set=set_directory,
                                        get=get_directory)

class AUTOFILEPATH_PT_panel(bpy.types.Panel):
    bl_label = "Auto-Filepath"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    bl_context = "output"
    bl_options = {"DEFAULT_CLOSED"}

    def draw_header(self, context):
        self.layout.prop(context.scene.auto_filepath_settings, "use_auto_filepath", text="")

    def draw(self, context):
        layout = self.layout
        layout.prop(context.scene.auto_filepath_settings, "directory")

classes = (AutoFilepathSettings, AUTOFILEPATH_PT_panel)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.auto_filepath_settings = bpy.props.PointerProperty(type=AutoFilepathSettings)
    if update_filepath not in bpy.app.handlers.render_pre:
        bpy.app.handlers.render_pre.append(update_filepath)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    del bpy.types.Scene.auto_filepath_settings
    if update_filepath in bpy.app.handlers.render_pre:
        bpy.app.handlers.render_pre.remove(update_filepath)

if __name__ == "__main__":
    register()

The add-on can also be downloaded from GitHub Gist.


Python script to make all adjacent keyframes have constant interpolation

I don't think you need to write a script for that... If you want to set them to constant, just select them, press T and select "constant".
However, when you work with motion blur (and multiple shots overall), you should always create multiple cameras and switch between them: to do so, duplicate you active camera and place it in the spot you  want, in the timeline select the frame you want your cut to occur, press M to create a new marker (you can rename the marker if you like), then select the second camera and press CTRL-B, so that from that marker ahead the second camera will be the active one.
This way you can have different settings between the 2 cameras without having to create useless keyframes and you won't have motion blur, because the camera doesn't jump in space to reach the new location (the blur you see is linked to the camera velocity, so even if the interpolation is constant you will always have some blurred frames when the camera jumps)


Getting BMesh Face Index from UV Face Index

Each Bmesh Face has it's loop of vertices. You get to the UV coords through them:

uv_layer = bm.loops.layers.uv.active
for face in bm.faces:
    for loop in face.loops:
        print(loop[uv_layer].uv)

There is no UV Face Index, this is all that is exposed from python API. You don't get access to what is displayed in UV editor.

You can make your own class of UV_Face and populate an array with it. Each UV_Face will carry the index of Bmesh face and UV coordinates of its vertices. Then you can calculate a median center for each UV_Face and sort the array based on that to have it in left-right top-down order if you need.

If you need UV islands, you will have to match UV coordinates of same values, see what UV_Faces touch at least in an edge, and construct the islands from there.


To prevent the bones from mirroring , you just have to uncheck "X-Axis Mirror" in the tool panel, while in armature edit mode.


Where is the 'selected to active' bake option in new version?

I'm just posting this so I can post this pic. This is taken from blender 2.83 in Cycles. If you're setup doesn't look like this, there's likely something wrong with your version of blender.


How to get rid of purple lines-crease on an object?

To get rid of the crease, first select the purple edges. Then, in the sidebar (with the cursor in the 3D Viewport, press N to toggle it), set the Mean Crease value to zero.

Thats it!


In Edit Mode select all A, press W > Remove Doubles.


Expand / Collapse all hierarchy in Outliner

Simply click on expand arrow with Shift key.
It will expand/collapse everything under it. So if you need ...

expand all (under collection) - click on Collection
expand only specific bone chain - click on Armature

Example with and without Shift key:

Or use "+" / "-" key (with cursor in Outliner Editor) to open / close one level.

More details in Blender Manual.


How to calculate a difference between current and previous location vectors using animation nodes?

This answer is based on my other answer about passing data between executions in Animation Nodes.

We store the vector list received from the sensor in memory by storing it in an attribute in the AN python module using this command:

AN.sensorLocations = sensorLocations

At the next execution, if we get the data at AN.sensorLocations it will be that of the last execution. And thus, if we subtract it from the data received from the sensor we will get the information we want. So, the node tree is as follows.

Where the output of the subtract node is the output we require. To avoid any confusion due to order of execution of nodes, we use the output of the subtract node as a dummy variable (A non used variable) _ in the expression node that stores the data. This ensures the subtract node executes before the expression node.

The initial execution will face an error due to the fact that there is no data in AN.sensorLocations, but this error disappear at later executions which is fine in our case because the sensor provide an up-to-date information about the location.


Render multiple Layers, how to mix/combine them, it's not working here

It worked. I rendered 3 layers and in the node editor I checked use nodes and backlog.
And then using alpha over I combined them and the result was shown :


I am unfamiliar with this function in Blender. But suggest possibilities I can! :)

You say, "As far as I know, none of my sculpt settings should depend on the position from which the model is viewed in the 3D viewport (I am using a brush set to Area Plane)"

That may be, except for one point: the last place that was clicked. Why else have a parameter named "ignore_background_click"??? When you changed viewports, maybe you changed the last place that was clicked? If not, maybe it changes the relative position of that click (if not the absolute position)??

Have you tried setting that parameter to True? In other words you do want to ignore that click position… That's the way I take that parameter name and limited documentation here:
https://docs.blender.org/api/2.79/bpy.ops.sculpt.html?highlight=bpy%20ops%20sculpt%20brush_stroke#bpy.ops.sculpt.brush_stroke

I expect that you have tried that, so the other possibility is that you could programmatically set that click position (and pass False, as you are).

Why, the possibilities are rampant! :D


how to move face along an axis without affecting other faces?

Each edge is defined by 2 vertices, and each face is defined by at least 3 vertices. On the screenshot below, moving selected face is moving 4 vertices it is defined by. Since this face shares 1 vertex with the edge marked as (1) and 1 vertex with the edge marked as (2), moving this face, will warp those edges, because you will move half of the vertices defined by them:

You can see which edges a vertex is a part of, by selecting it, and looking for gradient lines:

If, while having the same face selected as on pic. 1, you right-click and choose Split, then the vertices of the selection will be duplicated, without any connections to vertices outside of the selection. Selecting a vertex again should make the difference obvious:

Selecting all duplicates (or just everything), pressing M, B, will merge the vertices, by removing all but one vertex at each spot and moving all links of those vertices to that one.
However, you probably never used Split. What you did use was Extrude, which takes a face A and duplicates it to face B, but also (unlike Split) for each vertex of face B it creates a link to the original vertex it duplicated in face A (as well as it creates faces between edges created this way). Then the new face is being moved along its normal. And what you probably did was Extrude, but then right-click, leaving the new face in the same spot as the old one, but no longer directly connected to edges (1) and (2) on the first picture. This is why you could move that face without warping those edges, and this is why so many people advised to simply extrude the other face - if you want to keep the consistency with the other face, but it is not the correct way to build "proper" topology.
Moving the original face:

Extruding the original face:

Extruding the original face, but right-clicking to leave it at original coordinates; deselecting it, selecting it and then moving it:


How do you apply colormanagement settings to EXR files?

Correct.

Due to a very unfortunate design decision, no matter whatever your view transforms are set to, the EXR will always be the unadjusted, scene referred values from the Cycles render buffer.

In order to perform colour transforms from an OCIO configuration, you would need to perform this task externally using a tool such as ocioconvert from the OCIO package.

Note that while an EXR can contain any type of data, with regards to imagery and visual energy, it is a standard convention to store that data with linear visual energy ratios. That is, in terms of colour space transforms, you would want to avoid storing nonlinear encodings in an EXR file via baking in a transfer function curve.


How to Export a BoxCutter mesh into a renderer?

I have found a solution. Modus Destructive not Non destructive. Export as .stl file.


(SOLVED) UV Unwrapping does not work properly

As you can see if I select these faces and hide, I can see some "floating" edge loops here, they are creating these artifacts we see. You could delete them manually but if you select all and merge the vertices (AltM) you will probably get rid of them:

As for the unwrap, the method you need to use depends on what you want to do, if you don't plan to use an Image Texture you don't even need to unwrap actually. If you want to paint on your object in the 3D view, you can simply unwrap with the Smart UV Project option. If you plan to use an already made image and you need to make the UV match, mark some seams on you topology then unwrap with the Unwrap option.


You are storing your transparency information in vertex colors layers. Some modifiers—including the boolean modifier—are destructive when it comes to mesh data such as vertex color layers. So upon applying a boolean modifier carrying vertex color data, the data is destroyed.

You have two ways to fix this, you either use another medium to pass the transparency information to cycles, or you dispense the boolean modifier in favour of another approach to achieve the same effect.

Dispense The Boolean Modifier

A more efficient approach would be to write a shader that changes the transparency of the fragments dynamically. Use the object space texture coordinates of an empty as the vector input of a Quadratic Sphere Gradient node and get the fragments that their gradient value is larger than zero. Use the output as a transparency mask and animate the empty location and scale to get the effect you had before:


Found the issue. Somehow a bunch of vertexes got duplicated, and that made an indent in the mesh.


The OSL documentation states the fprintf function for already a long time. but the actual commit has been done last summer. The OSL version blender is using (1.7.5) does not have the code for fprintf. The fprintf function is supposed to be released in OSL version 1.9.1 1

It is unclear when blender will update their current OSL version to this version. Developers of Blender are still planning on this subject, and I have found several commits to support OSL 1.9 in cycles.


How do I make a molecular "cloth" which I can drop some objects onto?

Emitter sounds a little like over complicating things. Here was my process.

Create a plane with ~20 subdivisions. Add vertices that will be pinned to a vertex group.
Enable cloth physics for plane and enable pinning with the vertex group that was created as option.
Animate an object moving or add a rigid body that will collide with the cloth and enable collision in the physics tab.
Create the molecular object (Smoothed sphere in our case) and parent it to the cloth plane object.
In the Object tab of the properties find duplication. Choose verts or faces. Make sure both objects are in the same layer as it will only display if they are.


How can I find out what kind of relationship between a parent bone and the child, using python?

Edit mode, relations panel

As is displayed in the relations panel of a bone in edit mode, can look at the properties in the python console.
Simple armatrure, active and in edit mode. List each edit bones EditBone.parent and EditBone.use_connect properties.
>>> C.object
bpy.data.objects['Armature']

>>> bpy.ops.object.mode_set(mode='EDIT')
{'FINISHED'}

>>> for b in C.object.data.edit_bones:
...     b.name, b.parent, b.use_connect
...
('Bone.002', None, False)
('Bone', bpy.data.armatures['Armature']...EditBone, False)
('Bone.001', bpy.data.armatures['Armature']...EditBone, True)

Pose / Object Mode
or similarly in Object or pose mode by looking at the armature objects  pose bones collection.
>>> for pb in C.object.pose.bones:
...     pb.name, getattr(pb.parent, "name", None), pb.bone.use_connect
...
('Bone', 'Bone.002', False)
('Bone.002', None, False)
('Bone.001', 'Bone', True)

>>>


I can't add a New library in Blender 2.8

Why?
When you try to  create a new library with the add-on, it tries to create a new .blend file and since the add-on's directory is in Program Files folder(if you are on Windows) it does not have permissions to do so and fails.
Solutions
You could run Blender with administrative privileges by right-clicking it and choosing Run as administrator. This way it gains permissions to write the file in the current add-on's folder.
Or even better solotion
You could move the add-on from
C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons
to
C:\Users\[Your User Name]\AppData\Roaming\Blender Foundation\Blender\2.81\scripts\addons\
where it will be able to write the files when started normally. Note that you have to move the add-on's folder (in this case C:\Program Files\Blender Foundation\Blender 2.81\2.81\scripts\addons\materials_library_vx\), and not copy it since if you had it in both places you would have a conflict.


How to cast shadow onto image planes with alpha?

..my bad, forgot to plug-in DiffuseBSDF. It's working now.


How modeling a complex object into a shape draw by a sharp line?

I think i found something, not really easy.

Create an armature, enter Edit mode, make it flat and subdivide the bone (W, subdivide and choose the number)

In pose mode (Ctrl+Tab), rotate and scale your bones to fit the shape you need

Select all your bones and store the pose in the pose library, we'll use it later. Now cancel the rotation of your bones and apply the pose as the rest pose.

Now add a cube, in edit mode, move the faces to fit the armature and add an edge loops for each bone joint. back in object mode, parent the mesh to the armature (select mesh 1st then armature, Ctrl+P, choose automatic weights)

Now select your bone object (the thing that you'll cut) duplicate it with Shift+D, move the duplicate to the armature and parent it to the 1st bone (select the mesh then the bone, Ctrl+P, choose bone). Do as much duplicates as you have bones and parent them the same way.

Now select all your bones (armature) and apply the pose your stored earlier and clear the scale (menu or Alt+S)

If the cube mesh needs it, correct the vertex groups. This should be simple with a lowpoly mesh and few bones.

Now apply the armature modifier on the cube and in edit mode separate the elements (select and P). Add faces to close them.

Now you have 3 cubes usable as booleans to cut the 3 bone objects where you need. You can easily move the bone objects along their local coordinates for minor adjustments.


It's because you have a different aspect ratio in image and final render. You can do 2 things:

1) set render size equal to video demissions

2) tune  aspect ratio of image in display settings in movie clip editor


Scripting: separating selection results in edgeless mesh

Instead of selecting vertices of the bmesh, one should additionally select the corresponding edges and faces to create a new mesh containing them. It seems that when programmatically operating on a bmesh blender is a bit more literal on what you select than it is when selecting manually in edit mode.


So i solved my question. Turns out I needed to subdivide the mesh on the arms as they were too simple, it seems.


Create island mesh grid with drawn vertices?

There are several ways to make that profile with more or less even topology suitable for further landscape editing; one is to use curve's 2D type to fill the outline and then once converted to mesh edit the topology.

On the image below, from left to right:

original outline created as mesh;
outline converted to curve, its Z axis is clamped because it's set up as 2D curve but it's filled with faces;
outline converted to mesh and has 2 modifiers - Solidify and Remesh. The first one to give thickness to the outline as Remesh doesn't work with meshes without any thickness, the second one to generate new topology. Adding thickness is possible without modifier, e.g by extruding curve in the Geometry scroll.

Note that those tiny quads in the corners might not be desired as they can cause problems especially with any kind of subdivisions; it's best to change them before giving outline any thickness.


Here's an approach which you may be able to vary according to your needs.

I'm assuming you would like the steps to be of equal depth .. so first, scale your curve to 0 in Z.
Ensure the Preview U setting on the curve, times the number of segments in the curve, is twice the number of steps you will need
In Object Mode, Alt C convert the curve to a mesh, and use the Loop Tools add-on > Space to space the vertices evenly along the mesh.

With Proportional Editing switched on to 'Connected' and 'Linear' move the topmost vertex back up to where it belongs. Set the radius of the proportional Edit large enough just to see some movement in the bottom-most vertex. As soon as the Z-dimension is significantly greater than 0, you can switch off proportional, and adjust by scaling/moving all in Z.
Use Select > Checker Deselect to select every other vertex, (Ctrl I invert the selection if necessary, to make the bottom vertex unselected.)

G G slide the selected vertices down their edges, until they meet the vertex below. (Do not have Automatic Merge switched on)
With Snap set to 'Vertex' and 'Active', with the existing selection, make a convenient vertex active, and (G Z) move it vertically until it snaps in Z to the vertex above it.

In the N sidebar of the 3D view > Mesh Display, show edge length, and take a note of the depth of your steps
Assign an Array Modifier, with Constant Z Offset of that length, and the Count set to more than the number of steps - 'Merge' switched on.
With all doubles removed, F fill the faces.

Select all the faces, and AltE > Extrude by Vertex Normals
As you can see, because of the boundary effect on vertex normals, the top layer of steps is wonky. I've tried a ton of things to get round this-if anyone can make a suggestion I'd really appreciate it -
So it's necessary to GG slide down the top  layer onto the one below twice, CtrlV > R removing doubles as you go, and X dissolving the surplus diagonal edge.

But in the end, you get this.

I'm really hoping someone will come along and improve this.


How is real-time rendering different in blender from game engines?

Well, Blender isn't a game engine, and it's not designed to perform final animation renders in real-time the way a game engine does.  The design goal of the EEVEE renderer is to provide real-time or near-real-time previews and fast (but not real-time!) high-quality final renders.  As mentioned on the development page, it uses gaming rasterizer techniques to render quickly, but it is not a gaming renderer itself, and it targets high quality final renders that aren't subject to a fixed frame rate.
So, for the soft-body example above, you should be able to easily achieve a 30 FPS render in preview mode (with full PBR-like materials and lightning, even without baking the physics, since the physics aren't very complicated), demonstrating that EEVEE can, in fact, render animations in real-time by cutting various corners, but the final render with default settings will be higher quality and quite a bit slower (1-2 FPS seems about right).  I don't think Blender exposes a sufficient number of settings that would allow you to perform the final render at the same speed as the preview.
You could request such a feature (basically a checkbox to reduce the final render quality to the preview-level quality), but I don't think there would be much interest, because most Blender users aren't looking for real-time final renders; they just want fast previews.  That's because they're either using Blender to develop assets for true real-time game engines (and so just need a fast preview to see what they're doing and have no intention of using Blender for the final render), or they're planning to render a high-quality still image or fixed animation and want to prioritize render quality over render speed.


Particles don't behave like rigid bodies

Set anything you want the particles to interact with as a collision object.


when is it necessary to have a continuous mesh over separate pieces?

To be clear: First you say

  Everywhere I look people say that animated models need to be one continuous mesh with quads.

Then you say

  A lot of tutorials of people who are doing hard surface modeling via poly modeling vs sculpting often model there final object with several different pieces.

Simply understand that it's not necessarily a contradiction for people to be saying these two different things, because not all modeling projects have the same goal. I suspect that many of those you've been hearing are simply making assumptions about what other people are going to be doing with their models, and so maybe they are not entirely clear about their own goals when explaining their methods, so that others will understand what those methods are best suited to accomplish. Sometimes we take too much for granted.

Hard surface modeling can use various separated parts, just as you say--and even boolean them together without worry--because the end result will not need deformations. When you hear people say that models need to be one continuous mesh with quads, they are likely assuming the goal of organic modeling, such as for characters.

Once this is understood, the course becomes rather clear, and there's no need for concern. For a helmet, you could probably do whatever you wanted. The only real issue I can foresee might arise from the fact that you want this model for 3D printing. That is going to require you to take more care than might otherwise be necessary, but I can't say in exactly what way, as I am not an expert on modeling for printing purposes. It might be a good idea to research this topic specifically, since the cost of physical material is at stake.


insetting multiple faces with continuous borders

Press the i key while the inset tool is currently active. It stands for "individual," and can be toggled to switch back and forth between scaling the newly insetted face centered on the old one, versus scaling it while connected to at least one edge. You can also look at the top of your viewport while the tool is active to see which of these two modes the "individual" feature is in currently.


Blender running out of memory in renders, but having no problem in previews

preview is not the same as rendering..
you can run out of memory buy a heavier GPU card if your out of memory.
or use a renderfarm or split up the work in layer scenes


Problem with recalculating normals in a complex mesh

Part of your problem, and this is what's likely making Blender a little confused on how you want it calculated, is you have faces intersecting other faces. Blender doesn't really calculate that scenario well, because it can't tell which faces are inside and which are outside. However, you do have options available to you, if editing your mesh is either too much hassle or you absolutely must have it done this way. Your first option is to simply add a thickness modifier with a low value, apply, and recalculate it again. However, this is going to, at minimum, double your vertex count. It could play nicely without applying the modifier, but it's never done that for me (I hope you prove to be an exception). As well, you'll still have intersecting geometry, which is the crux of your problem.

Next option: Duplicate your problematic model in object mode. DON'T MOVE IT. Add a Boolean modifier and change the setting to union. Select you original object from the drop down. Apply the modifier. Now hold shift and select your original model via the outliner window (the one at the top right that lists your objects). Join them together by using CTRL + J. Now go into edit mode of your new object and select everything. Finally, remove doubles by either searching for the function or using the option on the toolshelf (the same general area of the screen where you find the flip and recalculate normals options). You might should still add a very slight thickness to it to help with light calculation, but this should at least make it easier to fix your normal facing issue.


Procedural polka dot pattern with cycles

OSL is nice but does not run on GPU which limits performance. The Polka pattern is not that hard to construct procedurally using nodes:

Start with a simple dot - a spherical gradient with Color Ramp:

With the ColorRamp you can control the size of the dot.

Next create tiling for procedural textures, but staggered. Extra is a Mapping node to control the size of the whole pattern:

That's it. You can also map it with Cylindrical or Spherical projection.


Is there a way to display the framerate in the BGE standalone runtime/EXE?

Have a look at the blenderplayer arguments

blenderplayer.exe

usage:   blenderplayer.exe [--options] filename.blend

Available options are: [-w [w h l t]] [-f [fw fh fb ff]] [-c] [-g gamengineoptions] [-s stereomode] [-m aasamples]
Optional parameters must be passed in order.
Default values are set in the blend file.
...
  -g: game engine options:

       Name                       Default      Description
       ------------------------------------------------------------------------
...
       show_framerate                 0         Show the frame rate
...
example: blenderplayer.exe -w 320 200 10 10 -g noaudio c:\filename.blend
example: blenderplayer.exe -g show_framerate = 0 c:\filename.blend
example: blenderplayer.exe -i 232421 -m 16 c:\filename.blend


Is there a way to set depth of field to the _closest_ point on a focus object, or do it via nodes?

You can add a single bone armature object, set it as child of your mesh. Bone lenght 1 meter. Then create an empty in the same location of the tail of the bone and parent it to the bone (Ctrl P - bone). Then set a damped track constraint to the bone, targeting the camera. Then set the empty as focus of the camera DOF.


Selecting a face in a script so that you can edit eg resize it?

It might seem counter-intuitive, but you need to be in Object mode to change the selection when using .mesh.  I changed a few more things, like you can use the 'DESELECT' action in mesh.select_all else edges are still selected when you try to un-select faces

import bpy

bpy.ops.mesh.primitive_cylinder_add(radius=1, depth=2, enter_editmode=True)
ob = bpy.context.object  # gets a reference to the newly created object
ob.name = 'NewCylinder'
mesh = ob.data

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

bpy.ops.object.mode_set(mode = 'OBJECT')
n = 0
for face in mesh.polygons:
    if len(face.vertices) > 4:
        n += 1
        if n == 2:
            face.select = True

bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.transform.resize(value=(0.33, 0.33, 0.33))


Important Blender shorcuts for object modeling

Important short are obviously biased.
G - Grab
R - Rotate
S - Scale
↹ Tab - Toggle Object/Edit Mode
E - Extrude
F - Make Face/Edge
X - Delete
⎈ CtrlR - Loop Cut
GG - Vertex / Edge Slide
I - Inset
W - Specials Menu
⎈ CtrlV - Vertex Menu
⎈ CtrlE - Vertex Menu
⎈ CtrlF - Vertex Menu
⎈ Ctrl↹ Tab - Switch Vertex/EdgeFace mode
⎇ Alt RMB - Edge Loop select
G, R or S followed by X, Y or Z - Constrain the grab/rotate/scale action to a specific axis.
[The above] followed by ShiftX, ShiftY or ShiftZ - Constrain the grab/rotate/scale action to a specific plane.
Space- Search for a command
Hotkey Maps by mrdeyo

Interactive Hotkey Map
Currently for 2.78, but there aren't many modeling changes.
How to find all hotkeys
In Blender, press ⎈ Ctrl⎇ AltU to open up the settings menu. Locate the Input rider and go to the 3d View section. The operations and hotkey for modeling will be found under Object Mode and Mesh.

How to find a specific hotkey
Open up the menu and locate the desired operation, the hotkey is written to the right of it.


Using Operator override

Here are a couple of examples.  This one finds all the mesh objects in the scene, sorts them alphabetically by name, then groups them by if they start with the first.

meshobs ['Cone', 'Cone.001', 'Cone.002', 'Cube', 'Cube.001', 'Cube.002', 'Cylinder', 'Cylinder.001', 'Cylinder.002']
Join ['Cone', 'Cone.001', 'Cone.002']
Join ['Cube', 'Cube.001', 'Cube.002']
Join ['Cylinder', 'Cylinder.001', 'Cylinder.002']

This is only a proof of concept and relies on "Cube" being in scene to match "Cube.nnn", add string partitioning etc as required.

The names of the matching objects are sent to the join method, which calls the operator with a context override dictionary, for active object and selected objects.

Note this Uses only the join operator which will greatly reduce the amount of operator calls from question code

Python performance with Blender operators

import bpy

context = bpy.context
scene = context.scene

def join(names):
    obs = list(filter(None, (scene.objects.get(n) for n in names)))
    print(obs)

    obs[0].select_set(True)
    bpy.ops.object.join(
            {"active_object" : obs[0],
             "object" : obs[0],
             "selected_objects" : obs,
             "selected_editable_objects" : obs
             })

meshobs = [o.name for o in scene.objects if o.type == 'MESH']
meshobs.sort()

while meshobs:
    n0 = meshobs[0]
    x = [n for n in meshobs if n.startswith(n0)]
    print("Joining", x)
    join(x)
    meshobs = meshobs[len(x):]

Alternatively using bmesh and  no operators

Can use bmesh to read in first mesh, then convert each other mesh into object space of first, and write back to first, then remove others.

This will keep only the materials of the first, etc etc, and may have to be altered accordingly.

import bpy
import bmesh

context = bpy.context
scene = context.scene

def bmesh_join(names):
    obs = list(filter(None, (scene.objects.get(n) for n in names)))
    print(obs)
    bm = bmesh.new()
    ob = obs.pop(0)
    mwi = ob.matrix_world.inverted()
    me = ob.data
    bm.from_mesh(me)
    for o in obs:
        o.data.transform(mwi @ o.matrix_world)
        bm.from_mesh(o.data)
        bpy.data.objects.remove(o)
    bm.to_mesh(me)
    bm.free()
    me.update()

meshobs = [o.name for o in scene.objects if o.type == 'MESH']
meshobs.sort()

while meshobs:
    n0 = meshobs[0] # fix for lpart on . : etc
    x = [n for n in meshobs if n.startswith(n0)]
    print("Join", x)
    bmesh_join(x)
    meshobs = meshobs[len(x):]


Rotating an object can make the mirror axis un-intuitive. You can see current rotation in the transform panel, which is opened with N in the 3D viewport . You should apply rotation with Ctrl + A and then it will behave like you expect.


How to set Import Units when importing a collada file with python script?

WM_OT_collada_import is the bl_idname of the Collada Import Operator in the C-code notation (in Python it's wm.collada_import, but the importer is a C operator).

import_units is an operator property.

If you want to set this property to True in an operator call, give it a keyword-argument:

bpy.ops.wm.collada_import(filepath=..., import_units=True)


Boolean cuts on one side but adds to the other

This behavior is correct, this is how the Boolean modifier works.

The Boolean modifier works better with manifold meshes (which, looking at your pictures, your mesh is not). If the mesh is not manifold, it does some guesswork which is inconsistent sometimes. I would recommend making your mesh manifold first by completing it.

If you wish to create a cut and not an incision, duplicate the front faces of the object you used to cut the model, separate it from the cutting object to make a new object, select both the new object and the object to be cut into, go into Edit Mode, hit A  to select all faces of both objects, and go to Mesh > Knife Project.

You should now have a hole without the supporting geometry.


You also have to change the path to the textures. Else the computer don't know where to find them.


How do I export material preview scene data so I can render it with my own engine?

Two options:

If you really wanted to go the route of exporting the material preview scene, which would allow for forward compatibility in case the preview scene should ever change in blender, the only option would probably be to create a temporary scene, copy all the data from the scene received in the render_preview function and then export that.

But this is probably not worth the hassle, so I recommend to anybody who needs something like this:

Get the material preview scene as a .blend from the blender code repository and export that once. Finally in the render_preview method, just manually serialize the material properties to get those into your custom engine.

I hope this helps somebody else struggling with this.


adjusting the value of a mask is accomplished by adding a math node in multiply mode. The second value acts as a multiplier for the alpha.

.


You can override the delete function to achieve this :

add protected boolean property for the object type
set this property to true to prevent the object from deletion
the new delete function will only delete unprotected objects

this is the new delete operator no other changes are needed just include it in your addon and it will override the default delete function :

import bpy
from bpy.props import BoolProperty

bpy.types.Object.protected = BoolProperty(name = 'protected', default = False)
def main(context):
    for obj in context.selected_objects:
        if not obj.protected :
            bpy.context.scene.objects.unlink(obj)
            bpy.data.objects.remove(obj)
        else :
            print(obj.name +' is protected')

class delete_override(bpy.types.Operator):
    """delete unprotected objects"""
    bl_idname = "object.delete"
    bl_label = "Object Delete Operator"

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

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

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

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

if __name__ == "__main__":
    register()


My mesh is deforming strangely when I move it in Pose Mode

More details would be helpful..
But I think that top bone some how got unchecked for deforming. Just check in bone section in edit mode.
If I am not wrong then It should work.


That setting is now located in the Tool Shelf T under Grease Pencil.


Firstly I'd like to thank you both very much for spending the time reading my question.

I continued to blunder around trying to solve my problem when I had a light bulb moment and noticed that in the 'sampling' section of the render panel it was set at  Render :10 and Preview:10,  obviously the default setting! And being new to blender I hadn't noticed. Anyway, I whacked up the Render value to 100, then 500 & finally 1000 and low & behold I got the razor sharp image I wanted, and spent the rest of the day feeling very pleased with myself.

So this is a case of self help, but thank you so much for reading my question!


In addition to using bevel (@RobinBetts answer), you can also use Inset.

In face selection select all your geometry minus the ring of faces inside the hole, then inset I. This gives you loops on both sides of the hole.


Blender undesiredly merges objects into single object at export

I got it.

I unticked "Objects as OBJ Objects", and I unticked "Objects as OBJ Groups".
Also, I ticked "Write Materials" and "Write Material Groups".

Here is a screenshot of the entire settings:


How do I set the bone length after setting a new bone matrix?

I am looking for a similar answer, but I may be able to help.

The "forward" (or "backward" if you see moving from head to tail as moving backward) vector direction is +Z (0,0,1), try setting head to (0,0,0), tail to (0,0,1) and then set length and matrix in that specific order.

The problem I am having is that the custom matrix I set, does not remain the same:

IOW: bone.matrix = custom.matrix, bone.matrix ~= custom.matrix BUT bone.matrix != custom.matrix

my current guess is that my custom matrix coming from a left hand coordinate system is something Blender "fixes" behind the scenes to an equivalent matrix, this however makes it hard to import a model and export to the exact same file that was imported on the first place.