How can I simulate cloth between one static object and one moving object? I'm trying to replicate stretchy canvas between two ribs for an architecture project, and I need to animate the movement of one of the ribs - so the canvas would stretch as it moves. I've tried pinning vertex groups in the cloth sim but it either a) only moves the edge vertices, or b) moves the entire group.
I basically just want one rib moving, one rib static, and the cloth sim between them.
Here's the effect I want to achieve (from Rhino 6), but with cloth sim panels instead:

Here's the problems I'm running into in Blender:

You can do it this way:

Create your sail and a create a bone that you call Bone1:

Give your sail a vertex group that will be the cloth pin (call this group Pin), it must be all around the border:

Give your sail a vertex group for the bone control (call this group Bone1) that must have a decreasing influence:

Give your sail a Cloth physic simulation. In the Cloth panel > Shape, choose the group you've created as Pin Group, enable Self Collisions. Select the vail, shift select the bone, switch it to Pose mode, and press CtrlP > Set Parent To > Armature Deform so that the bone will control the vertex group that has its name. Create the rest of the object, give it Collision physic if it is supposed to interact with the vail:


How to use one object to cut a hole into another one My issue is that I have 2 objects in edit mode, I want to use the second object to cut the first one to make a hole.

I hope the image can make what I want a little clear because I don't find the right words to explain that.

Thank you~

Use the Knife Project tool.

  Blender Manual
  To use Knife Project, first while in Object Mode, select the “cutting object” then select the “object to be cut”. Now, enter Edit Mode and press Knife Project (found in the Mesh > Knife Project).

When you're done, just delete the "cutting object" and also any unwanted faces from the cut object.


Make points more linear I'm beginner on Blender and I don't find how make points more linear like that red line (We can see points up and down the line) :

Goal is not to make a beautiful render, but a beautiful 3D print.
I know I can set them at the good place one by one but there is a function to help to do that?
I've try the "Smooth" tool (Cube 2x2x2 icon) but the result isn't very good
3D View :

One option could be to go to sculpting mode and use Flatten  tool.

A little silly to not suggest the smooth  tool first:


How do you move the 3d cursor along an edge? I have my 3D cursor snapped to a vertice.
What is the best way to move the cursor n units along a given edge?

Bmesh helper script

For those interested in a scripting solution, here is a little helper script to place the cursor on an edge.

Test run on default cube

Test script.

Run in edit mode
Have an edge as active element.
Place the 3d cursor close to one end, this will be the zero location
Edit the pc variable to how far in percent along edge from one end to another. 0 will snap the cursor to closest end. One third will move it one third of the way to other end.
The global length of the edge is written to system console.

Test script.

import bpy
import bmesh

pc = 1 / 3

context = bpy.context
scene = context.scene
ob = context.edit_object
mw = ob.matrix_world
me = ob.data
bm = bmesh.from_edit_mesh(me)
e = bm.select_history.active
assert(type(e) == bmesh.types.BMEdge)

v1, v2 = sorted((v.co for v in e.verts), key=lambda o: (scene.cursor_location - o).length)
scene.cursor_location = v1 + pc * (v2 - v1)
print("Global Edge Length: ", (v2 - v1).length)

Notes:

Could extend this to have a UI by making an operator.


Rigid Body Box Flaps So... I have a cube I am making into a cardboard box, and i have 2 flaps on the sides.

Well, how would I get the flaps to bounce around/move when the object hits the ground?

EDIT: would I have to use different objects and parent them, or could I keep it as one object?

You can achieve this using Rigid Body Physics and Rigid Body Constraints to form a hinge between the box and each of the flaps.

Create the box and flaps as separate objects and enable 'Active' Rigid Body Physics to each. For more realistic physics you should also set the Mass on each of the objects appropriately (in the Physics tab in the Tool panel (T) select 'Calculate Mass' and then select Cardboard).

Create Empties to act as the hinges. It's a good idea to use the 'Single Arrow' form of empty as the 'hinge' will act around the Z axis of the empty and the single arrow points along the Z axis (so the arrow will lay along the length of the hinge). Position the empties pointing along the edge between the flap and box where you require the hinge.

Parent each of the flaps and each of the empties to the box. This way, when you move the box around in the scene the hinges and flaps will follow.

Select each hinge empty in turn and in the Physics properties window enable Rigid Body Constraint. Set the Type to 'Hinge', Object 1 to the box, Object 2 to the flap, enable Z Angle limits and set the Lower and Upper limits appropriate to that flap (the angle it's allowed to bend from its initial 'at rest' position. Since the flap is already in the 'closed' position, one of the limits should be 0 degrees to prevent the flap from closing inside the box. The other limit should be a suitable angle to prevent the flap bending too far outside the box (I chose +/-250 degrees (so limits -250,0 for one and 0,250 for the other) so that it would stop at 20 degrees off the side of the box).

Running the rigid body simulation should now produce something like this :


Denoising not working with GPU I have this problem, when I try to enable denoising when rendering with my GPU only I get a completely black rendering.
When I render with CPU+GPU I get black tiles.
I´m running Blender on an iMac with a Radeon Pro 560 4GB GPU, and Intel Core i5 3.4 Ghz.

anyone experiencing similar problems ?

I did a little testing on the new egpu I have for my imac and there is definitely an incompatibility on my system between the board and the denoiser.

The incompatibility seems to make everything black with the Glossy Direct turned on.

With Glossy Direct turned off, everything is wicked contrasty after denoising.

With the glossy indirect turned off, everything is extremely dark after Denoising.

Playing with the different denoising levels doesn't change any of that.

I am running an AMD Radeon R9 in an Akitio enclosure, with a 2015 imac. Renders are faster but I definitely wish I could run the denoise to cut down on samples.

Hopefully, the incompatibility will get fixed in the next version.


Why can't I access the 'name' of an object when looping through the scene's objects? I am trying to delete all the objects that start with 'LTR' but am getting the following error:  'tuple' object has no attribute 'name'

Any suggestions are much appreciated!

for obj in enumerate(bpy.context.scene.objects):
    namestr=obj.name #this throws the error
    if len(namestr)>=3:
        name2=namestr[3:]
        if name2=='LTR':
            delete_object(namestr) #this is a function that deletes the object

enumerate(iterable, start=0) returns a tuple for each element from any given iterable and its position based on the actual iteration. Proof using the Console:

>>> for i in enumerate(["Hello","World"]):
>>>     print (i)
(0, "Hello")
(1, "World")

A tuple is a composite data type, composed out of two elements (item1, item2). If you want to access its individual components (left, right) you can either use the index operator [] or create 2 variables for the actual return value (tuple) on the fly: left, right = ("Hello", "World"):

>>> my_tuple = ("Hello", "World")
>>> my_tuple[0]
"Hello"

left, right = ("Hello", "World")
>>> left
"Hello"

Means in your case that you can't access the object and its name this way because the returned tuple by the enumerate() function in your loop has no name property. Proof using the Console again:

>>> for ob in enumerate(C.scene.objects):
...     print (ob)
(0, bpy.data.objects['Cube'])
(1, bpy.data.objects['Light'])
(2, bpy.data.objects['Camera'])

In summary: you have to find a way splitting the components of the tuple if you want to access each element separately which basically leads into the following pattern:

>>> for left, right in enumerate(C.scene.objects):
...     print (left, right, "Name:", right.name)
0 <bpy_struct, Object("Cube")>, Name: Cube
1 <bpy_struct, Object("Light")> Name: Light
2 <bpy_struct, Object("Camera")> Name: Camera

Also notice that python has a lot of awesome tools dealing with strings. In order to determine whether a string is part of a another string (substring), you could use the in operator to test its "membership":

>>> "ell" in "HelloWorld"
True

To remove the objects, you might want to create some kind of black list before removing it. The following example removes all objects in the scene that have "Cam" in their name (substring):

import bpy

objects_to_remove = []

for ob in bpy.context.scene.objects:
    if "Cam" in ob.name:
        objects_to_remove.append(ob)

bpy.ops.object.delete({"selected_objects": objects_to_remove})

There is also str.startswith(prefix) returning True if the string begins with the prefix passed:

>>> "Hello World".startswith("Hell")
True

The following example removes all found objects whose names begin with "Cam":

import bpy

objects_to_remove = []

for ob in bpy.context.scene.objects:
    if ob.name.startswith("Cam"):
        objects_to_remove.append(ob)

bpy.ops.object.delete({"selected_objects": objects_to_remove})


How to establish the best texture resolution? What are the benefits of a 4k texture compared to a 2k? Sometimes I use very large textures, weighing down the work, but without perceiving the benefit.
How can i choose which resolution fits my job best?

Thanks

There is no one rule. In my opinion it all depends on how big those textures will be presented on the screen in the final product.

3D rendering can be very demanding in terms of computing power. Large textures will use more resources than smaller ones. In order to succesfully create and manipulate scenes, all tricks that can yield acceptable outputs using less resources should be used. In other words: optimize the scene as much as you can, to fit within a realistic use of resources to get a satisfying outcome.

For starters, think that 4k image use 4 times more resources than a 2k one. If you can't perceive the benefit, then you probably don't need the extra resolution.

If you have an object with a 4k texture that will only use a couple hundred pixels on the screen in the final product, you are indeed wasting resources.

Use large resolutions only for things that are going to be presented up close, or that will use a large section of the screen in the final product.


How do I load a UV map onto a 3d mesh in 3d View I was editing my UV map and it suddenly disappeared from the character model I was working on. How do I make it reappear on the model? I am new to blender so I don't really know what is going on.

Gyazo: https://gyazo.com/429358278e2083d4058166dc6d32b51b

Try adding in a material using nodes for the object then, use my example here:
*I recommend pressing Cltr + T on the image for a better time editing.

If you don't known how to get there, there are loads of tutorial online for you to use


How can I call and edit animation keys from the Dope Sheet in Python? I have an animation in which a forcefield blows a bunch of chunks apart using the standard physics engine. This animation was then cached for each object, and from within the dope I selected all of them and scaled by "-1", invertng them and reversing the animation. I then manually re-alligned them to 0, and I had a perfect animation of all the pieces coming together.
I am now trying to create an addon that can do this automatically (not new to Python but new to doing it in Blender) and so I want to know what it is I have to call, a property of the object I assume, to get the keyframes in the dope sheet, so I can then scale them by -1.
Step 1: An object with two keyframes 100 frames apart

Step 2: Using "Bake Action", all the key frames from the first to the last are baked.

Step 3: As you can see, all keyframes are now in the Dope Sheet

Step 4: These are then scaled by -1

Step 5: Finally, they are then moved ("g") the total number of frames, in this case 100, in order to realign them.

This is an overview just for useful insights, but the core part I want to know is what I have to call to access the keyframes FROM the Dope Sheet, since IIRC the scaling doesn't work anywhere else.
This is just a basic mockup from what I understand the barebones to be (I found the context.object.animation_data.action line online and am just using it as a sub-in for what I am looking for:
import bpy

class ReverseAnimationOperator(bpy.types.Operator):
    """Reverse Animation Operator"""
    bl_idname = "object.animationReverse_operator"
    bl_label = "Reverse Animation"

    def execute(self, context):
        context.object.animation_data.action = context.object.animation_data.action * -1
        return {'FINISHED'}

def add_object_button(self, context):
    self.layout.operator(
        ReverseAnimationOperator.bl_idname,
        text=ReverseAnimationOperator.__doc__,
        icon='PLUGIN')

def register():
    bpy.utils.register_class(ReverseAnimationOperator)
    bpy.types.VIEW3D_MT_object.append(add_object_button)

if __name__ == "__main__":
    register()

Blender throws up the error of "-1" being an invalid location.
Thank you in advance!

Action is a read-only object that contains a lot more than just location attributes that can be modified by arithmetic.

The first tool you should know about (if you don't already) is dir(). Print the result of dir(an object) (ex: print(dir(context.object.animation_data.action))) to get a list of related members and methods. This isn't a list of everything you can do with an object but just its members. There's also help(a method) which will print some text that may or may not be helpful in describing the usage of a method.

This information might be useful, if only barely: https://docs.blender.org/manual/en/dev/animation/actions.html

As you can see, the relationships are a bit more complex. You MIGHT be able to get to "XLocation" and "YLocation" and modify them directly, but I'd be surprised if that's the intended approach.

This documentation might also help you explore the relationships between these various objects (note that animation_data contains an action object in that list, which you can drill into, to see its members):
https://docs.blender.org/api/blender_python_api_2_77_release/bpy.types.Object.html?highlight=animation_data#bpy.types.Object.animation_data

I suspect that you'll have more success transforming the fcurve object belonging to that action: https://docs.blender.org/api/blender_python_api_2_77_release/bpy.types.FCurve.html?highlight=fcurve

I'm not finding any clear clues, but it's likely that your process will look like the following:
 - for a given Object -> animation_data -> action -> ActionFCurves
 - select the keyframes in the fcurve that you care about (all of them)
 - perform some kind of transformation on them

I hope that helps!

EDIT: Unfortunately, it looks like ActionFCurves is also read-only, meaning that Blender likely intends for you to transform the keyframes belonging to it, using a different approach.

I'm not sure what that approach might be, at this point, but I hope that at least gets you closer.


Cycles Render grainy despite many samples? So I'm pretty new to the cycles rendering engine, but decided to give it a shot. However the image seems to come out rather grainy whatever I do.

I've tried with up to 700 samples, which already seem like waaay too many, but with no effect.

Any help would meen a lot!

The Blender file can be downloaded here.

Check "Square Samples", otherwise Blender will use -exactly- the number of AA samples as you type in. 700 unsquare AA samples is around 27 square samples.

The blend file you provided has it set at 100 AA samples, which is barely preview quality.

Additionally, you have some REALLY strange material shaders. Theres a fresnel node plugged directly into a color node. A ray path node directly in an add shader node. You mix glossy and glass shaders.
Its really strange, i've never seen shader setups like this.

Last thing: you built a closed box and put objects inside with indirect light, this gives you huge amounts of bounce light, which creates loads of noise. If you get a HDR instead you can get better results with way less bounce and noise than this approach.


Springs affected by force!? (not sure how to ask) So I am creating an animation that will show an invisible force (such as a thumb) pushing down on the gold contacts to show that they are set on a spring. I need the gold contact to be slightly pushed in as the force is moving over it. The springs do not need to compress but I think it will add to the realism of the animation. So if this can easily be done I would like to add that feature as well.

I have tried force fields and magnetic field, that didn't seem to do anything (probably using it wrong).

I am not even sure the path I should go down, Do I set the gold contacts as rigid body and get a force field to move them or is it better done as a weight proximity modifier? I just don't know what my next step should be.

Just to clarify:

In the below GIF, imagine the sphere is invisible but everywhere it touches the gold contacts it should slightly push them in, causing the springs to compress. And they should pop back to their original position once the force passes it.

This isn't too hard with Animation Nodes. Once you've installed the add-on, check a couple of things on your pins. First, make sure the "head" has an object origin in the object:

Second, make sure that the spring's object origin is at it's base:

Now, let's open up a Node Editor panel and create a new Animation Nodes tree.

Let's create our array of pegs, like this (you can search for nodes with Ctrl + A):

Explanation: The Distribute Matrices node creates a the locations of a grid of objects with the properties we set, the Object Instancer node creates the objects, then the Object Matrix Output node puts the objects into the scene. You should now have this lovely grid:

Now, lets create our "force sphere". Create a Sphere empty and give it a radius of 4. (You may need to adjust to your scene's scaling).

Now, to make the pins interact, add these nodes:

Explanation: The Object Matrix Input node gets the transformation attributes of the Empty. Decompose Matrix gets the location vector. The Point Distance Falloff node creates a 3D "gradient" radiating from the set origin (the location of the Empty). The Offset Matrix node applies the transformation of (0,0,-1) at the value determined by the Falloff.

It should look like this:

Next, we need to create the springs. Create another Object Instancer node for all the springs:

We want to offset the springs' matrices differently, though:

In the N panel of the second Offset Matrix node, under Advanced Settings, change Rotation: to Local Axis - Local Pivot:

Here is the final result:

Edit:

I've gotten better results with the Empty size set to 1, and the following node setup:

This way, it also responds to scaling the Empty.

Blend file:

(Requires Animation Nodes)


Texture baking noise reduction with filmic-blender, clamping does not work? I have a house interior model which I want to use both for high-quality renders and for converting to a web viewer. I've been experimenting with filmic-blender, and love the effect on the renders. My sun lamp is at strength 300, background at 25.

I now want to bake diffuse lightmap textures (cycles bake diffuse direct+indirect). The textures are very bright, which is expected since blender does not apply the logarithmic tone mapping on baking. There are also a lot of fireflies though, even at insane sample settings (16000)

I have tried to set Clamp Direct and Clamp Indirect, but these don't seem to have any effect on bakes. Does anybody know the reason for this, and better yet, does anyone have other ideas for reducing the noise?

Applying simple 2D image filters for lightmap textures does not work for many reasons, primarily because it will ignore things like adjacent faces, edges, difference of shapes between faces, and other features of the 3D mesh.

But you can use the Batch Bake Blender Addon, it can use a texture noise reduction ("denoising") solution that consider the mesh geometry of the texture:

It's available at
https://noevu.com/#batch-bake

Blender Artists post: https://blenderartists.org/forum/showthread.php?443843


Blender Cycles viewport preview adjust resolution I am using Blender for daily work on 2540x1440 external display.
I usually work in full screen layout and sometimes i want to preview scene in cycles. Problem is that working area is over 2000px wide and it totaly waste of time to wait for each sampling iteration. My question is: Is there any kind of method to decrease the resolution on preview. Something like quality switcher in After Effects (25%,50% full etc.)
For preview purposes it could reduce the pixels like 2x 4x or 8 times. This way instead of rendering full resolution the "pixels" could be bigger allowing user to preview faster.
Thanks For Your reply!

There's an option under Render -> Performance -> Viewport

You can also define a render region with Ctrl + B, to keep your resolution detail but only render a portion of the viewport.


Bokeh - From Horizontal to Vertical Hi guys I want my camera to display vertical bokeh stretch instead of horizontal. The rotation option in DOF settings of camera, doesnt rotate the bokeh.

Horizontal stretched bokeh (low res render just to illustrate)

What I want:

Maybe there is a simple solution to rotate it?

You can simulate the ellipsoidal bokeh created by anamporphic lenses by changing the ratio on the depth of field settings.

The defalut value for ratio of 1:1 will give you a circular shape, while a larger or smaller number will make the defocused elements deform in an ellipsoidal shape.

A value higher than 1 will deform the defocused areas on vertical ellipsoids (the most common anamorphic lenses will compress the image on a 2:1 aspect)

Conversely to deform horizontally use numbers smaller than 1

To create custom shapes for the bokeh (As described in this link: http://www.diyphotography.net/can-you-make-computerized-shaped-bokeh/):

Create a plane with a hole that has the shape of the bokeh you want.

Place the plane really close in front of the camera (adjust the clipping distance if necessary, so that the camera can see the object)..

Set the depth of field on the camera, and render.

Click on the image to enlarge

Click on the image to enlarge


Can I make a sim where "water" breaks a "glass window"? So I want to make a sim where the camera starts in a hallway and moves towards a window at the end of it where a room is filling with water. When the room gets about halfway full or so i want the window to shatter, starting with small fractures and slowly getting bigger till it breaks. Letting out all the water in the room. Is something like that possible?
.blend file if that helps at all.

Cell Fracture

You can use object, particle system or Annotation Tool to initiate break structure. Directly in add-on specify Collection to store parts.
Select shards, search Rigid Body > Add Active
To protect shards from falling you would have to search Rigid Body > Connect
or in this case could be enough just select border shards and set them under Physics Properties > Rigid Body > Type > Passive*. On right-click Copy to Selected.
Add Sphere, search Rigid Body > Add Passive, check Animated, add two anim keyframes

Since glass is freaked from beginning ... for animation you would have to render glass and hide generated shards for render (Outliner > Render Visibility - Camera icon that can be keyframed) up to break moment, at this frame switch Render Visibility for glass and shards.
Fracture Modifier
There exist also great Fracture Modifier in special blender build (https://blender.community/c/graphicall) that keeps glass uncracked until collider breaks a glass.
Fluid Sim
Then run Fluid Sim

Tip:

To let fluid collide with all shards - in 3D viewport select one shard enable Fluid > Effector, Select Similar Shift+G > Collection, when all shards selected Make Links Ctrl+L > Modifiers
To keep shards frozen in initial position you can (in this case) change under Scene Properties > Rigid Body World > Cache change Simulation Start Frame


Why my blender layout area appears a mark like hourglass? and how to close it I don't know what function I pressed, suddenly, the blender layout area appears a mark that looks like "hourglass"(see the picture below), and it does no effect but just a little bit annoying. I try to close it, but still can't.
If anyone knows how to close it and what function did I press accidentally, please help me to fix it. thanks a lot.

Just tap W again and it disappears.
With W you just change the selection mode.


Image in compositor is rendering white (or just a small portion of the original) I am trying to add an image to a scene to be rendered. I am able to add the image in the compositor, but when I try and render the scene the image is mostly white with a few random pink and purple colors. I am using blender 2.79

This is a screen shot from cycles:

This is a screen shot from what gets rendered:

This is a screen shot from the 3D View camera view:

What is causing the render to be mostly white?

The image you are loading and the blender scene are not the same size (in pixels)
Blender will not auto-size your images to fit within the compostion.
To know how big your image is press N in the UV/Image editor to bring out the side panel.

If you load an image that is larger than the composition, you will only see a portion of the image.

If you add a scale node and set it to fit, then your image will be scaled to fit within your composition.

Note that if the images are a different aspect ratio than the output, you have three choices:
stretch: deform the image to match within the aspect ratio of the container)
Fit: keep the images proportions but fill the remaining either with a transparent background or with black (if the "Use Alpha" option is unchecked)
or Crop Not stretching the image, resizing to fit vertically center cropping horizontally.


Fast question about Circle problem How to deal with this mess to make this mesh smooth. I was using circle to make it

The subdivision modifier won't produce good results with triangles in the geometry. (Carlo mentioned this answer, which showcases how the modifier works on topology.)

To solve this, use quads only.

Delete the center vertice, select the edge loop and do the Grid Fill operation.

Recreate the sperical shape. Set the Cursor as Pivot (.). Place it in the imaginary center of the spherical shape. Select the flat grid geometry and press ⇧ Shift⎇ AltS to scale to sphere.


How to install molecular 1.1.2 Addon at Linux Blender 2.91 In Blender 2.91 on Ubuntu 20.04 (Kernel 5.10.6-051006-generic) I can not install the Addon Molecular from: https://github.com/scorpion81/Blender-Molecular-Script/releases
It works fine in Windows 10 with Blender 2.91.
The problem might be something missig in python, but I don't know how to fix it.
I found this line migh be giving a hint on the problem: https://github.com/scorpion81/Blender-Molecular-Script/blob/60385f589d3d31261cfb51802a915dd0355d500c/make_release.py#L29

#TODO, blenders (or a compatible) python bin needs to be in $PATH, and if you use blender's you need to copy the python includes from SVN
#into the include folder of blenders python, too

The Blender system info says Python 3.7 is in place:
=====================================

= Blender 2.91.0 System Information =
Blender:
version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862b8, type: Release
build date: 2020-11-25, 08:51:08
platform: Linux
binary path: '/home/p/3d/blender/blender-2.91.0-linux64/blender'
build cflags:  -Wall -Wcast-align -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -Wimplicit-fallthrough=5  -fuse-ld=gold -std=gnu11   -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -msse2 -D_GLIBCXX_USE_CXX11_ABI=0
build cxxflags:  -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wformat-signedness -Wrestrict -Wuninitialized -Wundef -Wmissing-declarations -Wimplicit-fallthrough=5  -fuse-ld=gold -std=c++17   -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -msse2 -D_GLIBCXX_USE_CXX11_ABI=0
build linkflags:  -Wl,--version-script='/home/sources/buildbot-worker-linux_centos7/linux_291/blender.git/source/creator/blender.map'
build system: CMake

Python:
version: 3.7.7 (default, Jul  9 2020, 12:52:49)  [GCC 9.3.1 20200408 (Red Hat 9.3.1-2)]
file system encoding: utf-8:surrogateescape
paths:
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/scripts/startup'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/scripts/modules'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/python/lib/python37.zip'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/python/lib/python3.7'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/python/lib/python3.7/lib-dynload'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/python/lib/python3.7/site-packages'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/scripts/freestyle/modules'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/scripts/addons/modules'
    '/home/p/.config/blender/2.91/scripts/addons/modules'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/scripts/addons'
    '/home/p/.config/blender/2.91/scripts/addons'

Python (External Binary):
=====================================

binary path: '/home/p/3d/blender/blender-2.91.0-linux64/2.91/python/bin/python3.7m'
version: Python 3.7.7

Directories:
scripts:
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/scripts/modules'
    '/home/p/3d/blender/blender-2.91.0-linux64/2.91/scripts'
    '/home/p/.config/blender/2.91/scripts'
user scripts: '/home/p/.config/blender/2.91/scripts'
pref scripts: None
datafiles: '/home/p/.config/blender/2.91/datafiles'
config: '/home/p/.config/blender/2.91/config'
scripts : '/home/p/.config/blender/2.91/scripts'
autosave: '/home/p/.config/blender/2.91/autosave'
tempdir: '/tmp/blender_Yjx2oy/'

scorpion81 did a new build local and uploaded a new version. Now I can install the addon and it works as expected.
link to the github page


getting problem in point weighting in blender I set strength to 1 in weight paint mode, but I am getting green and yellow colors also at the edges along with red color.

This is caused by the "curve" parameter of the brush (in Photoshop is called "hardness").

In my example I've used 3 different curves, maybe you're looking for the second one (wich is the last preset on the right).

In the curve editor x axis is the distance from the center of the brush, y axis is the strenght of the stroke.


Join bones in a armature? I have a simple armature that has three loose bones that I would like to join at one joint. Is there a way I can join these 3 into a single joint?

You can join multiple bones together. You will need to flip one of the bones around (AltF) so that there is a bone tail in the correct spot. Then just set the other two bones' parent to the flipped bone; and enable Connected.


Convert CSV Latitude longtitude to Blender coordinates I have a table of Earthquake data in CSV, that includes Lat Long coordinates.
CSV file download I want to convert them to Blender coordinates (on sphere or flat it doesn't matter as I can fit them to a map later).
I hope to place an object at each location that references the magnitude value. Then I will make them appear in order over time, which is the other column of data.

I can import the CSV and convert to text objects for the magnitude with

import bpy # THIS IS A MUST TO IMPORT ALL BLENDER PYTHON MODULE
import csv # IMPORT CSV MODULE

# READ INPUT FILE

file = csv.reader(open('\\Users\mcsweend2c\Desktop\Bearthquakes 6-9.csv', newline=''), delimiter=',')

curRow = [] #empty placeholder for current row

for idx, row in enumerate(file):
    if idx<40: # this is hard coded at the moment

        curRow = row

        # display first data index as string
        bpy.ops.object.text_add(location=(0,idx,0), rotation=(0,0,0))
        bpy.ops.object.editmode_toggle()
        bpy.ops.font.delete()
        bpy.ops.font.text_insert(text=curRow[0])
        bpy.ops.object.editmode_toggle()

But I'm not sure how to separate and use the rest?

Here's how you read the CSV, reformat the dates, sort the quakes by date, convert lat/long to x/y/z then output each row as a text object on the outside of a hypothetical sphere (with the object name set to the date of the quake in YYYY-MM-DD format) with the text oriented so that it sits flat on the surface. Fonts and materials and other tweaks to be supplied by you. :)

Based this off https://stackoverflow.com/questions/10473852/convert-latitude-and-longitude-to-point-in-3d-space

# imports to make all the things work
from math import sin, cos, radians, pi, atan, tan
import csv
import bpy

# define some helpful functions for later

# a function to make, scale and rotate text objects into place
def makeathing(coords, scale, lat, long, date):
    rotation = (radians(lat - 270), pi, radians(long - 90))
    bpy.ops.object.text_add(location=(coords), rotation=(rotation))
    ob = bpy.context.object
    # set object properties here
    ob.data.body = "{:.1f}".format(float(scale))
    ob.data.align = 'CENTER'
    ob.rotation_mode = 'YXZ'
    ob.data.size = 0.03
    ob.data.extrude = 0.002
    ob.data.name = date
    ob.name = date

# a function to turn 3D polar coordinates into 3D cartesian coordinates
def latlonger(lat_deg, lon_deg):
    lat = radians(lat_deg)
    lon = radians(lon_deg)
    # see: http://www.mathworks.de/help/toolbox/aeroblks/llatoecefposition.html
    alt = 0.01
    rad = 2                                     # radius of sphere in BUs
    f  = 0.0                                    # flattening
    ls = atan((1 - f)**2 * tan(lat))  # lambda
    x = rad * cos(lat) * cos(lon) + alt * cos(lat) * cos(lon)
    y = rad * cos(lat) * sin(lon) + alt * cos(lat) * sin(lon)
    z = rad * sin(lat) + alt * sin(lat)
    return (x, y, z)

# NB: no code has executed yet, we're just setting up functions we use further down

# read in the CSV file containing quake data
file = csv.reader(open('\\Users\mcsweend2c\Desktop\Bearthquakes 6-9.csv', newline=''), delimiter=',')

# make a blank dict variable to put quake data into
quakes = {}

# iterate through the CSV row by row and pull the data into variables
# then put the variables into a tuple and use a corrected date as the dict key
# see the last line of the for block for data order
# NB: could have used a dict instead of a tuple
# would have meant looking up e.g. quakes[x]['scale'] instead of quakes[x][0]
for idx, (scale, date, lat, lon) in enumerate(file):
    (yd, m, dy) = date.split("/")
    if int(yd) > int(dy):
        year = yd
        day = dy
    else:
        year = dy
        day = yd
    key = "{}-{:02g}-{:02g}".format( year, int(m), int(day) )
    quakes[key] = (scale, lat, lon)

# go through the sorted dates in the quakes dict
# get latitude and longitude and turn into x/y/z coords with latlonger function
# then send x/y/z coordinates to makeathing function to create them in 3D space
for k in sorted(quakes.keys()):
    latitude = float(quakes[k][1])
    longitude = float(quakes[k][2])
    coords = latlonger(latitude, longitude)
    makeathing(coords, quakes[k][0], latitude, longitude, k)

You may need to offset the X of the world map texture to align the letters to their correct positions on the globe, e.g. using this texture map I had to offset X by 0.25.


how is it possible to set alpha over as default for strip Is it possible to set "alpha over" as default in strip? It's pretty annoying to have to change this setting for every strip...
and if yes, how? ;)

You can't change the add/import settings, but you can batch change settings by selecting all strips needed, right click and select Copy to Selection.

Many properties will add values to full selection with +alt pressed, but it doesn't seem to be implemented for the blend modes.


Correct way to define "DATA" for object.material_slots in a single bpy call I am quite happy with how the UI works now by calling a function I created for assigning the material to object or data:

class ApplyMaterialTo(bpy.types.Operator):
    bl_idname = "material.data"
    bl_label = "Material Data"
    bl_options = {'REGISTER'}

    def execute(self, context):
        bpy.context.object.material_slots[0].link = 'DATA'
        return{'FINISHED'}

    row = layout.row()
    row.operator("material.object", text="Set Object Material")
    row.operator("material.data", text="Set Data Material")

But I feel my approach is pretty convoluted. SO I tried to apply what I learned to day but this does not work:

row.operator("object.material_slots[0]").link=DATA

The resulting error message is:

Traceback (most recent call last):
  File "C:\Users\info\Desktop\Claas UI.blend\Claas_UI_2.py", line 174, in draw
NameError: name 'DATA' is not defined

The first error is that you are passing DATA a variable instead of string "DATA", hence you get DATA is not defined.

The second thing is object.material_slots[0] is not an operator, all operators resides in bpy.ops. ...  it is a variable,  when you write row.operator("object.material_slots[0]") it will try to call bpy.ops.object.material_slots[0] which doesn't exist.

you may want to make your own operator ( if there's none that can do this) and use it instead.

For this case it would be easier to let prop() handle this easily :

row.prop(object.material_slots[0], "link")

and it will display a combobox that you can chose from


Set initial rotation on branches I am trying to generate a Norwegian spruce with the sapling addon. I have achieved this result:

The problem is that the secondary branches have the wrong starting direction. The rotation between each branch is 180 deg, so that the first branches always is in on plane. However, to get the correct result, the initial angle needs to be set to 90 degrees relative to the default value, so that the first branches is parallell to the xy-plane. Is that possible? Note: It should be easy to add a parameter to the add-on, so I could manage to do that, and also make a pull request upstream, but I may need some input on where the rotation angle is computed and so on.

I found the line in add_curve_sapling.py:

--- bRotate = oldRotate + uniform(-rotateV[n], rotateV[n])
+++ bRotate = oldRotate + uniform(-rotateV[n], rotateV[n]) + pi / 2

Should make the suggestion to add the angle as a third parameter.


Spherical gradient texture on plane not working I'm trying to find the most simple way to put a spherical gradient texture on a plane (square) so that the circle of the gradient and the plane are aligned center to center and the circle fits the plane.
I can do it with the gradient texture but the circle of the gradient just never fits the plane. I read somewhere that the center of the gradient will be where the origin of the geometry is, but I have the origin of the plane in its center, yet the gradient is always off. I could play with the mapping node settings and scale and translate until it more or less fits, but I just can't imagine I need to do it manually, that there isn't a more simple and exact way?
I'm using cycles render.
Using the node setup posted by LukeD in his answer, I do get the desired result starting from scratch, using the startup blend file. But with my project file, using the same node setup, the plane remains just black. Then I noticed a tiny little dot of a gradient circle in the middle of the plane, when rendered close up. It's very tiny and even pushing the colour ramp handles extreme to the edge just barely makes it bigger. I have my units setting on metric, with a scale of 0,01 because I work with centimeters. Changing the units to "none" and the scale to "1" did not seem to have any effect on the result. (see screenshot)
I added a mapping node with the "texture" tab clicked and a scale of x1000 to all 3 axes and this fixed the problem, giving the expected result (see screenshot)
So is this a bug? Why is a x1000 scale factor needed (not x100) to make up for a 0,01 scaling?

Connect Texture > Gradient Texture (spherical) to Diffuse color node, as a vector choose Object and add Color Ramp to play with colors and color blends.

Edit:

For transparency you can choose Color Ramp as factor for Mix Shader.

Edit 2:

I have created scene with the same unit settings as yours and here is what we have:

Plane, scaled to 2x2m.

And this very same setup but with applied scale (CTRL + A).

Edit 3:

I have checked it in Blender 2.77a and 2.78 RC1 and it looks all the same. So my guess (as Blender docs doesn't cover much about Texture Coordinates > Object) it's not a bug but this is how those calculations works. Other textures behave the same. You can 'fix' texture scaling in Texture tab without setting Mapping node and calculations there are correct - scale 100.

Edit 4:

Good catch with other dimensions. Now I'm totally stuned about it.
But here is a method that is working with every dimension scale (applied or not). Don't ask me why it is working, but it is working :)

You need to change Texture Coordinates to Generated then in Texture tab change Location to X > 5mm and Y > 5mm (this is part that I don't know why 5mm is ok for 2, 20 and 200m, this was my lucky guess) and Scale to 0.5.


How to make a file "non local-specific" for sheep-it render farm? What does making a blender file non local-specific mean when using sheep it render farm? AND How do I in convention make this happen?

This just means that you need to make all file paths relative, instead of absolute. If you understand what that means, that's great. If not, I'll provide some explanation below (I don't intend to be insulting, if you already understand).

Relative and absolute paths are a bit beyond the scope of this site, but I can give a brief explanation.

If you have a Blender file that uses an image texture which is located at H:\Users\Node's Stuff\Blender Awesomeness\Sweet_Render\ReadyForSheepIt\Textures\FinalGroundTexture.png then Sheep-It won't know where to find it, because no such folder exists on their server.

That is called an "absolute path." No matter where you are on the machine, that path gives you everything you need to know in order to find FinalGroundTexture.png.

Alternatively, you can say "I don't care what hard drive you're on, and I don't care what higher folder you're in, just look in the folder next-door." This would be a relative path. If you had a Blender file in ReadyForSheepIt you could tell the Blender file that the texture is in \Textures\FinalGroundTexture.png. In this way, you tell Blender that it doesn't matter where the Blend file is located, it can find the texture by looking in whatever folder the Blend file is currently in, and finding a folder called Textures.

Regardless, there is a tool in Blender that will do a lot of the work for you.

From the Manual:

  If it is necessary to relocate a blend-file relative to its linked resources, use Blender’s File Save As function which has an option to Remap Relative file links.

You can just "Save As..." without changing the file name, and that'll give you the chance to "Remap Relative" to make sure you don't have any absolute paths.


Object exported as Obj looses textures in Unity So I recently got into blender/unity in order to create 3D Models. I'm still learning the ropes and have started to run into some issues that I'm unsure how to fix.

Here's what's going on. I have a model that I imported into Blender that I ripped off an N64 Game (Banjo Kazooie). I have textured the model, rigged the model, and weight-painted the model. All is well so far. Here's where the issue comes. When I try to import it into Unity as an .obj file, it loses all texture.

That's fine because I've re-textured .obj's before and kinda expected it to happen. However, when trying to re-texture it, this happens: https://gfycat.com/IcyWillingAcornwoodpecker

How would I go about fixing this issue? Here's a screenshot of what I have in blender currently:

As I stated, I'm still quite new, so if you could be as precise in your answer as possible, that would be very much appreciated. Thanks!

I'm a newbie too.  Almost all tutorials I've seen using Blender and Unity together use fbx files.  I don't know why and I don't know the relative advantages or .obj and .fbx, but maybe try exporting as an fbx (on the save screen, enable mesh, armature and material only).  This should at least export the material with the mesh, making it more likely they will be compatible...maybe.

Unity Result


How to UV unwrap with repeating texture? I have a problem with baking in blender cycles: I have an interior model and every part of it uses repeating texture (the floor for example uses a 256x256 texture which repeats itself). My aim is to bake the texture so it includes shadows and lighting. As soon as I UV unwrap e.g. the floor, the UV grid only uses the 256x256 texture one(!) time.
I can scale the selection in the UV editor so it looks good on the object editor but this seems to only affect the view. I also tried checking the repeat option, but after baking, the baked texture gets repeated as well (when scaled, only a part of it).

before UV unwrapping

after UV unwrapping

scaling in the UV editor makes the texture look alright in the object viewer but it only bakes the initial smaller area

Hope this seems understandable, I’m relatively new to blender.
Thanks in andvance.

You can use two different UV Maps for the floor: the first for the wood texture and the second for baking shadows and lights.

Moreover, since the wood texture is seamless, you can scale the islands of the wood UV Map in the UV editor to get the size you prefer (i.e. the islands can be bigger than the 0-1 UV space). Contrariwise, all the islands of the shadows UV Map must be placed in the 0-1 UV space. Make sure you have selected the correct UV Map before baking (use the camera icon), and save externally the baked map.

When you deal with two (or even more) UV Maps, your shader is a bit more complicated. Just create a group of nodes to control the repetition of the main wood texture, and another to control the baked map. To do this, use the Input > UV Map node in the shader editor, and type the right UV Map's name.

This image shows a simple idea to create a shader which manage the two UV Maps:

Of course, your shader can be more complex, but the idea here is how to separate the nodes that control the shadows and the nodes that control the wood texture.

P.S.: I suggest to save the baked map in PNG format with transparency, so you can use it as a mask to blend the two main node groups.


My model has flickering weird shadows? I started working on this model you can see below. I noticed there are these weird flickering shadows. So I tried googling it, but I didn't find anything (I googled "Blender Flickering shadows on model") I also tried to switch my render engine to Eevee or Cycles but that didnt help either, they are still there, just less visible. Other than that I did not try anything else, so any help would be appreciated. I am using Blender 2.92
Thank you for any answer

Looks like you have view clipping issues. In your properties panel on the right-hand side of the viewport (N) you should see a 'View' section. I suspect you have set the 'Clip Start' and/or 'Clip End' to an extreme value. Try adjusting those to something realistic to your scene (eg, 0.001m Start, 1000m End).
Blender uses the Clip Start and Clip End in calculating distances but only has a limited precision for holding and calculating values. If you use extreme ranges Blender is unable to calculate intersections and edges accurately and you see artifacts such as what you are seeing. By choosing a more reasonable range Blender can apply suitable precision and the artifacts are no longer visible.


Is there a way to make a gradient based on an object or a image texture? I made this image with a monkey head and I want to be able to make something like the second image with nodes procedurally [i made this just by duplicating a cutout]

I want to be able to take a spherical gradient, or the result of the vector math length function, then use an object or a image like the first one above and make a gradient that has a value of zero at the center and 1 at the edge of the object/mask image. Making the rainbow pattern procedurally is not part of the question btw that's just easier then trying to draw the gradient.

You can use the Dilate / Erode node in the Compositor Editor. Link to the docs
First setup your Object as needed and render the image.

Now you can play with several dilate / erode nodes to get the desired effect. It basically creates a dilated mask for each subsequent dilation and we're adding them , then dividing by the number of dilations, then plugging it into a Combine HSVA node to get rainbow colors. You can tweak it to get desired colors too.

There is a Distance and a Step mode in the Dilate / Erode node. I found the Distance mode to be more pleasing, but the compositing time will skyrocket on high values.


Animate propellers on helicopters without having to reposition them every time the helicopter moves We are trying to animate a simple scene of the helicopter flying around a large city area. Is there was a way to make the already moving animated propeller stick to the helicopter moving around, without having to reposition it every time the helicopter flyies around?

Is there an option to add the propeller animation to a folder so that we can animate multiple things at once?

Select the rotor (airplanes have propellers), then shift select the helicopter, then press CTRLP to parent them together. Now the rotor moves with the helicopter whenever the helicopter moves. Just don't animate the rotor position anymore.


How to overlay image on extruded SVG? So I just got into blender because I need a 3D object to animate in AE. I am having trouble adding a texture to my object. I don't know the terminology all that well, but I tried making a mesh and that didn't seem to work well. Also tried unwrapping, but it didn't work also. The model on the right is a extruded and beveled SVG.

What I'd like to do (as shown in the image below) is to put the image files (on the left) on either sides of the model (on the right). Is there a simpler way I can go about this? Like the image and 3D model are the same exact shape so why couldn't I just paste the images on either side?

Been researching for hours with no return so any feedback helps!

Thanks!

Easy approach is to use texture mask inside material.

Here I'm using local Z axis to separate sides of an object. Then plug it as factor to control textures visibility.

Why Z, because in my case it is facing texures (see gizmo in Local mode).


Is the w-coordinate of the UV coordinate system supported by Volumetric materials? I want to calculate the density of a volumetric Emission material using the distance inward from the mesh surface. I've been able to do this with a cube and several coordinate systems: generated, object, I can display the u,v-coordinates as colors on the surface of a uv-mapped mesh. I can use the Mapping Node to rotate these coordinates around the X- or Y-axis and see the w-coordinate in shades of blue.

Within the Blender manual pages for Input Nodes, the description of the Texture Coordinate Node makes no mention of unsupported coordinate systems for volume materials. But the description of the Geometry Node states "For volume shaders, only the position and incoming vector are available."

Is the w-coordinate of the UV coordinate system supported for volume materials? I fear that the w-coordinate cannot be defined within a mesh of arbitrary shape because each interior point can be projected back to the mesh along many normal vectors. But I'm not sure I understand the w-coordinate well.

If by UV you mean unwrapped coordinates then no, volumetrics can not use UV coordinates.  This is for the exact reason you stated in your question, by unwrapping a mesh you are only assigning coordinates to the surface of your mesh, not the volume.

Here are the texture coordinates that work for volumetrics (i.e. not calculated based on the surface of the mesh).
Texture coordinate node:

Generated:  Generated coordinates are based on the bounding box of the object.  The left, bottom, front corner is (0, 0, 0) and the right, top, back corner is (1, 1, 1); the volume of the bounding box is interpolated linearly between these.  By default all procedural textures use generated coordinates.
Object: The coordinates in local-space of the specified object on the texture coordinate node.

Camera: The position in camera-space.

Other nodes:

Position (geometry node): The position in world-space.
Location (object info node): The object's position in world-space.  Note: Unlike object, camera, and position this is the position of the origin of the object possessing the material, not the point within the object.  (This one probably isn't that useful for your purposes.)

For more on texture coordinates see my explanation of texture coordinates here.


In edit mode, there is an origin located off the side of it's face. It ends up clumping everything together when subdivided. How do I fix this please? The meshes clump together when subdivided:

The origin is off of the face:

This is most likely because of the face at the bottom that is not visible to us. Subdivision Surface modifier divides concave face like that - this is normal. If you wish to avoid that you should divide the bottom face so it consists of a few convex faces instead of one concave face.


How to bake alpha in Cycles? I'm preparing to re-model a Table Mat (like a Tatami Mat) tomorrow. I will need to do some baking from geometry onto a plane-texture. I know how to do that, except I don't know how to bake the alpha? I don't see alpha in the list of what I can bake in Cycles. There is transmission, but I think it's not the same. Is there a way to bake alpha? I'm pretty sure I will need it to compose materials in the Compositor. Would it help if I set world color to transparent in the Film tab in the Render properties? Will it then bake with transparent alpha?

I don't think it's possible to bake alpha directly, but you can try making a new shader mixing a white and a black emit shader together using the alpha of your textures as mask, then bake that into a new texture.

It will be a bit tedious if your scene is too complex, but I don't know of any other way. If you have too many objects it's probably a good idea to try to automate that using python.


Is there a way to switch UV checker on and off fast while working with UV editor? So as it said in the title, is there any way to turn on and off the checker fast, without going to the material editor and replacing the texture each time I am fixing or simply checking the UVs of the objects?

You can use the Node Wrangler addon to preview the checker texture

Enable Node Wrangler addon in Preferences > Addons
Use Ctrl + Shift + Leftclick to quickly preview the checker texture in the Shader editor
You can change the texture type in the UV editor


Joining an Cutting Objects If I have two object like the two planes in the image below.
And I join these two planes (CTRL+J). How can I cut off the part that sticks out of the bottom of the bigger plane, so this would be level on the ground, without holes. Ideally the bottom part would be one Face (or as minimal as possible). Also the internal edges/faces/vertices where the plane cut through would be ideally not be represented in the model anymore. Only the parts that you can see outside. I know I can clean it up step by step, but I was looking for a more easier, professional way. Since I would have to do this very often.

In the edit mode select the face selection mode, select the part of the mesh you want to remove, if it selects both the upper and lower parts, subdivide the selected face after its been subdivided select the part below ground level and click on P key to seperate you'll see an option that comes out click on 'selection' then you can delete the seperated Part if you want


Saving brushes into the pallete in 2.8 just wondering how to import brushes into 2.8 and have them be there when I open a new file.

I downloaded a .blend file with some cool brushes that are in the file and are categorized with the existing brushes, but then they disappear when I go to open one of my designs.

Let me know if you have the solution!

-MC

you have to append the files of the brushes that are in brush folder of that blend file that contains it. and if you want to use them every time,open a new blender file and do what i told above and then go to file, save startup file and you are done. happy sculpting!.


Multiple Textures with Mirror Modifier I would like to use multiple textures to paint both sides of a mirror modifier. The idea is to paint one side of the mirror modifier, and duplicate it with the text flipped.

The problem is that when I apply my mirror modifier, the texture is still mirrored with no indication of where the other half of the texture is getting its data from.

How can I use two different images to texture the object? Is there a better way, such as mirroring the entire object EXCEPT for the text? If so, how would that be done?

You can adjust the Mirror Texture Settings by checking U or V, or both

The texture won't be mirrored, and when you apply the mirror modifier you will be able to see all the parts clearly ( in the UV editor )


How to Bake a Metallic and Smoothness Map for Unity in Blender 2.91 I have a set of models in Blender with materials that are mostly metallic. There is a hi-poly and a low-poly version of each model. I need to transfer these models over to Unity for the project I am working on. I plan to use a standard URP/Lit shader in Unity for these models.
I have unwrapped the low-poly models as a group so that they can each share the same material maps. I know how to bake the Diffuse and Normal maps for these models. I know I can bake out the metallic and roughness maps in greyscale using an emit node, but this would give me two RGB maps.
Per Unity's Reference Manual, Unity wants Metallic in the Red channel, and Smoothness (inverted roughness) in the Alpha channel. How do I get Blender to bake a map like this (without purchasing addons or third-party software)?
Given the popularity of Unity, I would expect there to be some good explanations on how to do this. I spent several hours trying to lookup how to create this kind of map, but I came up empty.
I could probably write a script in Unity to insert greyscale maps into individual channels on a new map (and optionally invert them), but I would prefer to use built in methods in either Blender or Unity.
Any help would be much appreciated.

I ended up writing a custom Unity script to convert maps generated in Blender. I will share the script below.
With regards to generating the individual maps. The Smoothness map is fairly straight forward. I generated a Roughness map, then inverted it using my script. The Metallic map is a little more of a hassle. Blender does not appear to have a bake option for it. The closest is a Glossy option, which seems to bake shadows into it. The only useful advise I found online was to copy the metallic values over to a field that you can bake out like the Roughness, then bake out the "Roughness" and call it the Metallic map. This worked for my needs. Just remember to revert the Blender file back to what it was before setting up for the metallic bake.
Here is the Unity script I wrote that will merge the individual maps into a single map and invert the maps that need inverting. Feel free to use/modify this code for your own needs:
public class TextureChannelPacker : EditorWindow
{
    private Texture2D redTexture,
                    greenTexture,
                    blueTexture,
                    alphaTexture;

    private bool redInvert,
                 greenInvert,
                 blueInvert,
                 alphaInvert;

    private channel redChannel = channel.Red,
                    greenChannel = channel.Green,
                    blueChannel = channel.Blue,
                    alphaChannel = channel.Alpha;

    private enum channel
    {
        Red,
        Green,
        Blue,
        Alpha,
        RGB
    }

    private GUILayoutOption channelLabelWidth,
                            channelTextureWidth;

    private float labelWidth = 80f;

    [MenuItem("Edit/Texture Channel Packer")]
    [MenuItem("Custom Tools/Texture Channel Packer")]
    public static void ShowWindow()
    {
        EditorWindow.GetWindow(typeof(TextureChannelPacker));
    }

    void OnGUI()
    {
        UpdateLayoutWidth();

        CreateChannelHeaderRow();
        CreateChannelRow("Red", ref redTexture, ref redChannel, ref redInvert);
        CreateChannelRow("Green", ref greenTexture, ref greenChannel, ref greenInvert);
        CreateChannelRow("Blue", ref blueTexture, ref blueChannel, ref blueInvert);
        CreateChannelRow("Alpha", ref alphaTexture, ref alphaChannel, ref alphaInvert);

        CreateSaveButton();
    }

    private void SaveToFile()
    {
        var path = EditorUtility.SaveFilePanel(
            "Save Composite Texture as PNG",
            "",
            "New Composite Texture.png",
            "png");

        Texture2D texture = CreateNewTexture2D();

        CompositeTextures(ref texture);

        if (path.Length != 0)
        {
            var pngData = texture.EncodeToPNG();
            if (pngData != null)
                File.WriteAllBytes(path, pngData);
            else
                Debug.Log("Unable to save, no texture data to save.");
        }
    }

    private bool AreTexturesReadable()
    {
        bool result = true;
        string errorText = "Please set 'Read/Write Enabled' to 'true' on the following textures:";

        if (redTexture)
            if (!redTexture.isReadable)
            {
                errorText += "\n\t" + redTexture.name.ToString();
                result = false;
            }
        if (greenTexture)
            if (!greenTexture.isReadable)
            {
                errorText += "\n\t" + greenTexture.name.ToString();
                result = false;
            }
        if (blueTexture)
            if (!blueTexture.isReadable)
            {
                errorText += "\n\t" + blueTexture.name.ToString();
                result = false;
            }
        if (alphaTexture)
            if (!alphaTexture.isReadable)
            {
                errorText += "\n\t" + alphaTexture.name.ToString();
                result = false;
            }

        if (result) return true;

        Debug.Log(errorText);
        EditorUtility.DisplayDialog("Error", errorText, "Okay");

        return false;
    }

    private void CompositeTextures(ref Texture2D compositeTexture)
    {
        float u, v;

        for (int x = 0; x < compositeTexture.width; x++)
        {
            u = (float)x / (float)compositeTexture.width;

            for(int y = 0; y < compositeTexture.height; y++)
            {
                v = (float)y / (float)compositeTexture.height;

                Color pixelColor = new Color(GetColorForChannel(redTexture, redChannel, redInvert, u, v),
                                             GetColorForChannel(greenTexture, greenChannel, greenInvert, u, v),
                                             GetColorForChannel(blueTexture, blueChannel, blueInvert, u, v),
                                             GetColorForChannel(alphaTexture, alphaChannel, alphaInvert, u, v, true));

                compositeTexture.SetPixel(x, y, pixelColor);
            }

            EditorUtility.DisplayProgressBar("Compositing Texture...",
                                             "Progress: " + Mathf.Round(u * 1000) / 10 + "%",
                                             u);
        }

        compositeTexture.Apply();
        EditorUtility.ClearProgressBar();
    }

    private float GetColorForChannel(Texture2D texture, channel textureChannel, bool invert, float u, float v, bool isAlphaChannel = false)
    {
        if (!texture)
        {
            if (isAlphaChannel)
                return 1f;
            else
                return 0f;
        }

        int x = Mathf.FloorToInt(texture.width * u),
            y = Mathf.FloorToInt(texture.height * v);

        Color color = texture.GetPixel(x, y);

        float value = 0f;

        switch(textureChannel)
        {
            case channel.Red:
                value = color.r;
                break;
            case channel.Green:
                value = color.g;
                break;
            case channel.Blue:
                value = color.b;
                break;
            case channel.Alpha:
                value = color.a;
                break;
            case channel.RGB:
                value = (color.r + color.g + color.b) / 3f; // average value of channels
                break;
        }

        if (invert) value = 1 - value;

        return Mathf.Clamp01(value);
    }

    private Texture2D CreateNewTexture2D()
    {
        Vector2Int size = new Vector2Int();

        if (redTexture != null)
        {
            if (size.x < redTexture.width) size.x = redTexture.width;
            if (size.y < redTexture.height) size.y = redTexture.height;
        }

        if (greenTexture != null)
        {
            if (size.x < greenTexture.width) size.x = greenTexture.width;
            if (size.y < greenTexture.height) size.y = greenTexture.height;
        }

        if (blueTexture != null)
        {
            if (size.x < blueTexture.width) size.x = blueTexture.width;
            if (size.y < blueTexture.height) size.y = blueTexture.height;
        }

        if (alphaTexture != null)
        {
            if (size.x < alphaTexture.width) size.x = alphaTexture.width;
            if (size.y < alphaTexture.height) size.y = alphaTexture.height;
        }

        return new Texture2D(size.x, size.y);

    }

    private bool WasATextureProvided()
    {
        bool result = redTexture ||
                      greenTexture ||
                      blueTexture ||
                      alphaTexture;

        if(!result)
        {
            Debug.LogWarning("Unable to Save. No input textures selected.");
            EditorUtility.DisplayDialog("Error", "Unable to Save. No input textures selected.", "Okay");
        }

        return result;
    }

    private void UpdateLayoutWidth()
    {
        float remainingWidth = EditorGUIUtility.currentViewWidth;

        remainingWidth -= labelWidth;
        channelLabelWidth = GUILayout.Width(labelWidth);

        remainingWidth /= 2f;
        channelTextureWidth = GUILayout.Width(remainingWidth);
    }

    private void CreateChannelHeaderRow()
    {
        EditorGUILayout.BeginHorizontal();

        EditorGUILayout.BeginVertical(channelLabelWidth);
        EditorGUILayout.LabelField("Channel", channelLabelWidth);
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical(channelTextureWidth);
        EditorGUILayout.LabelField("Input Texture");
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical();
        EditorGUILayout.LabelField("Settings");
        EditorGUILayout.EndVertical();

        EditorGUILayout.EndHorizontal();
    }

    private void CreateChannelRow(string label, ref Texture2D inputTexture, ref channel channel, ref bool invert)
    {

        EditorGUILayout.BeginHorizontal();

        EditorGUILayout.BeginVertical(channelLabelWidth);
        EditorGUILayout.LabelField(label, channelLabelWidth);
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical(channelTextureWidth);
        inputTexture = (Texture2D)EditorGUILayout.ObjectField(inputTexture, typeof(Texture), false);
        EditorGUILayout.EndVertical();

        EditorGUILayout.BeginVertical();
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Extract:", GUILayout.MaxWidth(60f));
        channel = (channel)EditorGUILayout.EnumPopup(channel);
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Invert:", GUILayout.MaxWidth(60f));
        invert = EditorGUILayout.Toggle(invert);
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.EndVertical();
        EditorGUILayout.EndHorizontal();
    }

    private void CreateSaveButton()
    {
        EditorGUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Save to file"))
        {
            if (WasATextureProvided() && AreTexturesReadable())
                SaveToFile();
        }
        GUILayout.FlexibleSpace();
        EditorGUILayout.EndHorizontal();
    }
}


Weight painting not moving model as expected I am trying to weight paint my model but no matter what weight I paint or assign to the verts, I can't get the skin stretching effect I want. They all act as if they have full weight and only the verts next to the ones I painted stretch.

Add verts to head and then rotate to test. Only the faces next to the verts selected stretches.

I go into edit mode and assign the line of vert's bellow at a very low weight but when I go to rotate, they move as if assigned at full weight.

A weight of 1 (red) means, that your mesh will react 100% to the bone movement.
A weight of 0 (blue) means, that your mesh will not react at all.

So, if you want a more natural behavior, select the lower vertices of the head and assign a weight of 0.5 (green). These vertices will only be partially affected. You can go further and have several transition loops:
Assign it like this to the top bone.

And assign reverse weights to the bottom bone.


When I add environment texture to world node object shadow disappears When I add environment texture to world node my object shadow disappear.
Do I need to turn off background strength?
I want to make my object to look like background so I lost shadow that I wanted

It is not that the shadow dispappears, but it is not as dark... Why? Because the environment will illuminate that area. Think of the environment as a giant sphere that surrounds the scene, emitting light from every pixel of the image texture used. So the question is: if you like the shadows without the world texture, do you really need it? Else just bring down the strenght.


Why are these red dots appearing in my viewport? I'm following Andrew Price's (Blenderguru's) latest donut tutorial series but I'm a bit confused as to why I'm seeing all of these red dots in my viewport render, when Andrew's version isn't.

We're both using the Cycles render engine using GPU and both have viewport sampling of 32. The light object lightning the scene is white and there are no objects in the scene that could be adding to this reddish colour.

I have a feeling my node settings are incorrect so I've attached a picture of these at the bottom.

Here's the comparison between the two...

My Donut:

Andrew's Donut:

These are the nodes I'm using (which are the same as Andrews):

Any ideas?

The red dots are appearing because of Subsurface Scattering (SSS), or translucency. When you turn on SSS in Cycles, there will be strange colored dots unless you render at a higher sample count. Some possible ways to solve your problem are

Reduce the amount of SSS by adjusting the Subsurface slider.
Adjust the Subsurface Raduis

Because doughnuts are usually made of bread, you should have SSS values close to 0.05, and SSS Radius values close to (0.1, 0.1, 0.1)


Array of 3D circles with same center, and same distance between them, but different radio I am new at blender, and this is where I am currently:

I got an initial circle, and applied an Array modifier (with an empty object in the center as object offset), followed by the Solidify modifier so after the scale the shape will keep the thickness. But the distance between the circles is not the same. How can I keep the distance the same?

the shape of each circle should finally look like this:

Any ideas? THANKS!

Reference image of the project:

It looks as if the intervals along your radii are all the same .. so this is an option:

Order up a mesh circle, sides divisible by 4, fan fill.
CtrlShiftB Bevel the center vertex to desired diameter
Select the radial edges and  CtrlR add edge loops to the desired number.. (right-click out of the operation to leave it without sliding the loops)
Select every other face ring ...
.. and delete.


How do I only select vertices which are visible from my perspective in 3D View? I'm trying to retopologize a high poly mesh and create a low poly version out of the existing sculpt. While selecting some vertices of my low poly mesh in order to edit them, other non-visible vertices are always getting selected automatically, which is tedious to work with:

Q: How do I only select the vertices which are visible from my perspective in 3D View?
Higher Resolution video showing the issue: https://imgur.com/a/UkLViJP

Updated: The issue still happens, less often but it still happens.
I was able to solve the issue by changing the "display as" "wire" to "textured" under the view-port display under object properties.


How to get rid of vertice on the same high? I have a question. How could I get rid of the vertice that is in the same high as the other vertice?
I'm using booelan tools, but it's didn't work, because of these vertices. Thanks you.

It seems you might have overlapping geometry, so you would have to solve that somehow if you wanted to have one piece of geometry. If the vertices are between edges on the same connected plane with nice non-overlapping topology, you can select all flat connected faces with Ctrl+Alt+Shift+f when you have one of them selected and then just press f for Make Face:

You could remove vertices from separate pieces of the mesh that you have there. If you wanted to join them into one piece, that is another question. I believe there is no easy clean way to do this, I would just remodel the whole thing as one if that is needed. Booleans might not work nicely if you have overlapping surfaces.


Cycles: objects appearing in 'Render' render but not 'Animation' render I'm not really that familiar with cycles textures, so there's probably something wrong there.

Anyway, my objects appear when I hit the 'render' button:

But not when I try the 'animation' render. All I get is my grid object and my lights.

I have another file with versions of the objects with the single basic node that appears when you first add a texture, and those will render in the animation render, but not the rest of them.

What am I doing wrong? Node setups are shown. File is here: click.
All the objects are on the same render layer, and they're all set to display in the render.

EDIT:
No issue to speak of here. I just forgot that nothing is in the render area until frame 17... I'm silly.

Your scene renders fine.

You only see the background on because your text object is not in frame until frame 17...when it drops down.


2.79 How do I fix the UV image editor displaying colors improperly? Either when drawing on the UV image or the model this problem occurs.

BTW I didn't draw the square just the pink.

It doesn't always happen so when it does it is baffling. So if I make a new file for an example it may work properly other times it won't.

All new added paint shows up darker, the surrounding of the new paint is the wrong color also, it goes darker shown as the darker square. The wrong image color is only a bad display of the image editor, saving the image and opening it on a image editor displays the colors properly shown on the right side of the image.

How do I fix this problem?

Whenever Blender gets wonky like this as in, only does it with this file, the cure is simple.

Copy all assets in the outliner.

Open a new empty Blender.

Paste.

This was also the cure for when some sculpt brushes quit working so I figured this might cure it as well and it did.


How can I go straight to edit mode by choosing selection modes? That's basically it,is there a way to configure blender to go straight to edit mode when I choose a selection mode(eg; 1-for vertex,2-for edges or 3-for polygons)?

It may seem silly but I think it's bureaucratic since these shortcurts alone have no real utility.

I appreciate any help :)

I agree with you - and set up a macro on Belkin Nostromos Keypad.   So I kind of cheated to solve this (and set it up outside of Blender).    I also have been playing with this same macro with "VoiceMacro" to do the same thing.   "Vertex" is programmed to: Press ESC (make sure I'm out of circle select),
Press Tab, 6 (edit mode)
Press 1, (vertex select)


Bump node in Cycles, with an OSL script -- am I doing it wrong? I'm relatively new to Cycles, so maybe I don't understand all its finer points yet. I am trying to create a normal map from a grayscale bump map produced by an OSL script. The script seems to output the grayscale data just fine, as seen here (output through an emission shader for visibility purposes):

But when I try putting that through the bump node, I get nada in the resulting normal output:

Just to be sure I'm doing something stupid, I tried the same node setup but with a noise texture node instead of the script's output for the bump node's "height" input, and got the expected results.

I haven't been able to find much info about the bump node, but is there a reason it can't use the grayscale data from an OSL script for the height info? If so, is there any way to work around that?

Add a Texture Coordinates node, and possibly a vector Mapping node and feeding that into your scripts Vector input.

Even for generated coordinates I've seen better results using a texture input and mapping node for vector input over default coordinates received within osl scripts.


Why does the ambient occlusion pass result in a black environment? Why does the AO render pass result in a black environment?

Shouldn't this be white as default?

Also, Is it possible to get a transparent environment within the AO render pass?
White should do just fine as well.

PS: I know there's a workaround by making use of the Object/Material index to mask out parts of a layer. but this is really tedious if you've got a large complex scene.

AO render pass result in a black environment cause it doesn't contain Alpha channel.To get any AO You have to have some objects in field of view, otherwise there is nothing to cause Ambient Occlusion.

There is a very simple way to achieve AO pass with transparent background.
In the node setup You have on the attached image (assuming, that You have transparent background enabled) You just need to attach Alpha output from Render Layer Node to Alpha input in Composite or Viewer node.


Hard edges and curved surfaces I'm quite new to Blender(and 3D graphics in general) and I can see that there is only 2 kinds of 3d surfaces, meshes and NURBS, meshes only have hard edges, while NURBS have only got curved surfaces, so my question is there any type of surfaces that provides curved surfaces and hard edges?

For visual purposes it is sufficient to approximate the surface with a mesh / wire and use smooth shading afterwards to make the surface appear smooth.

Same mesh using flat shading(top) and smooth shading(below)

To create curved surfaces the common approach in blender is using catmull-clark subdivision.

Catmull-Clark subdivision using crease edges(pink)


How to make continuous movement of a windshield wiper with Logic Bricks? With Logic Bricks, how can I make my windshield wiper move back and forth until I turn it off? When I press a key to start the movement, I can move left to right, but not right to left without a different key press.
I'm in Blender 2.79, Blender Game Engine.

Animate your windshield wipers moving back and forth, just one complete cycle.

Then add an Action actuator to play it. Make sure to set the EndFrame to match the length of your animation. Change the Action Playback Type from Play to Loop Stop, and choose the name of the action (by default is is named "Object name + Action")

The trick here is you want the keyboard sensor triggering a Property actuator, not the action actuator, then the property will trigger the action.
Add a game property, a boolean named "wipers" leave it false by default (blank checkbox).

Connect the keyboard sensor to a Property actuator, set it's mode to Toggle and choose the property you just created (wipers).

Now back on the sensor side, add a Property sensor, connect it to the action actuator. Set like so: Evaluation Type to be Equal, Property to be your game property (wipers), and the Value to be "True".

The full logic setup looks like this.


Camera follows path, but is not looking the direction I want I think the easiest way to explain is the next two pictures.

Cant seem to add two pictures with the add picture option.?
If a moderator knows how to fix that ?
Edit:
The problem I am having, it's not working.
Can it be that another animation is messing things up?
I am using follow path, but were the bezier curve I am using, is going to the right the camera just moves straight on. Unless I also add a clamp to track constrain.
Here is a vid of also the weird stuff happening.
Maybe I need to upload the file so people can have a look ?
The music track made by me. I am trying to make a vid for it.
Next is a link to another video, that shows the other animation, which is working fine. But I do wonder if this one is messing the other animation up (the camera moving). https://www.youtube.com/watch?v=fbJrFz2nKls&feature=youtu.be
I have set a start frame (1) and an end frame of (6650), which matches the end of the music track.
Edit 2.
I just did a test and deleted the bezier curve.
The animation of the camera movement keeps working. (although only in a straight line off course )
For me this is proof that the second animation I have is causing this problem. (or the way I have set it up)
The first animation is the red lights reacting to my music track.
From frame 1 to frame 6650. This length matches the duration of the music track.
I also notice that although the camera movement is working I don't see any keyframes markers in the window below the scene.
After adding an empty, see what is happening, the exact same problem I have with the camera. Follow path and follow curve get ignored, and I don't understand why.

If you use a Follow Path constraint, you can simply enable the Follow Curve option, and the camera orientation should follow the curve. In that case deactivate the Clamp To constraint. If you don't want to use a Follow Path, just keyframe the camera rotation.


rigify face rigging isues I'm trying to rig the face for a character with the rigify addon but every time I try, the mouth doen't open well. I don't know if it's because of the position of the bones or the scale or the weight (I did the automatic weight). I saw some tutorials but they didn't help me. I'd really appreciate some help.

It looks like it would probably be the last bone in the chain coming up from the chin. It looks like that bone ends in the middle of the mouth which would make the automatic weights consider the mouth to be part of the chin and the face would just look elongated when rotating the jaw.
I highly recommend you to learn weight painting though since an issue like that would be very easy to detect if you would scroll through the groups.
Also, I would recommend you to use video for reference while placing the bones and try to replicate the placement when trying out new rigify rigs since they can be very delicate.


Face problem in cube, edit mode im new in blender.

I have a cube and only move the edge, one face look good but the other.....

Its a bug or im doing something wrong?

Go into edit mode, and press A to select all the vertices. Press the spacebar and type in "Triangulate Faces," and that should fix the problem.

Blender sometimes has problems calculating bent rectangles (technically known as quads), because they can be made out of two triangles bent one out of two ways. Take this plane for example:

It can be made of either these triangles:

Or these triangles:

As you can see, both versions use the same exact vertex locations, but achieve completely different effects. However, Blender doesn't know which one to choose. In your case, Blender gets confused and decides to basically fold the weird looking face in half, instead of making it concave. By using "Triangulate Faces," you are basically asking Blender to turn each face into a specific set of triangles, so that way it doesn't get confused about the possibilities. In the end, your cube should look like this:

I hope I helped you, and let me know if you have any questions.

Happy Blendering,
Graves Broderick


Math logic between camera angle and lens Camera has two properties:

bpy.data.objects['Camera'].data.angle
bpy.data.objects['Camera'].data.lens

If change one value, the other one will be changed automatically.
I am curious about the math logic.

From the table below:

$$
\begin{array}{c|c}
\text{angle }(\theta)&\text{lens}\\
\hline
30^\circ&-18.691732\\
45^\circ&28.681456\\
60^\circ&2.497919
\end{array}
$$

Sounds like the formula is: $\text{lens}=\tan{\frac{\theta}{2}}$, but what's the theory come from. I found a diagram about camera as below but not figure out how to match this formula with this diagram:

Is this logic specific to blender or it's generic for all camera's?

The angle of view for a rectilinear projection camera is calculated by:

$$a=2\arctan{\frac{d}{2f}}$$

$a$: angle of view
$d$: dimension of the sensor (horizontal or vertical)
$f$: effective focal length

horizontal and vertical angle of view differ if your camera sensor is not a perfect square.


How can I "checker deselect" vertices of a uv sphere correctly? I'd like to select every second vertex of an UV sphere using "checker deselect"

I tried it like that:

select all vertices with "A"
Chose "checker deselect" from menu

But the result looks like that:

Only the area within the 3 meridians in the middle look like how I expected.
For the the rest of the sphere whole latitudes are selected, what I don't wanted !?

Some ideas ?

You have to deselect the pole vertices before doing Checker Deselect :


Scripting - vertex won't extrude I'm trying to make a simple script that extrude vertex in random ways,
all works without extrude.

I do not know if it's good I wrote, but I do not know how to extrude vertex to the location of the cursor.
Any idea what is wrong with my code and how to fix it?
I run script in Edit mode with one vertex on the scene.

import bpy
import random

#generate random number
def RN():
    return int(random.random()*400)/20

for i in range(1,100):
#set 3d cursor to random location
    bpy.context.scene.cursor_location = (RN(),RN(),RN())
#extrude vertex to cursor location - doesn't work
    bpy.ops.mesh.dupli_extrude_cursor(rotate_source=True)

Invoking the bpy.ops.mesh.dupli_extrude_cursor(rotate_source=True)
 operator leads to this error message in the console window:

wm_operator_invoke: invalid operator call 'MESH_OT_dupli_extrude_cursor'

Although is is exactly what is printed in info header when manually extruding a vertex.

I can't tell why this doesn't work but try this:

import bpy
import random

#generate random number
def RN():
    return int(random.random()*400)/20

verts = []
edges = []
faces = []
for i in range(1,100):
#set 3d cursor to random location
    verts.append(( RN(),RN(),RN()))
    edges.append((i-1,i))
edges.pop() # remove last edge
print( verts )
print ( edges )
mesh = bpy.data.meshes.new("rand_mesh")
mesh.from_pydata(verts, edges, faces)
rand_obj = bpy.data.objects.new("rand_object", mesh)
scene = bpy.context.scene
scene.objects.link(rand_obj)

I really don't know for what something like this could be useful:

See also

http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Geometry


How to uv wrap a curve I have made a curve road and i want to unwrap the texture. Can we uv wrap texture to curve. If yes then why there is no option for uv wrap. If no then how can i wrap road texture to the curve.

Convert the Curve to Mesh (Alt+c)

Go to top view uv wrap and press u and select project from view

select one of the road and uv wrap the image of the road

After uvwrap on one of the road press u and with the Magic UV addon press U and select the copy/paste -> Copy uv -> default

The select all press A to select all Faces and deselect the face which is uvwrap and then Press U
copy/paste -> Paste uv -> default

And u have all the texture on the mesh. More than 95% it work well few issue we can set manually


boolean modifier removing the exact opposite of what i want it to? i’m trying to animate the marvel title card and i want to engrave the marvel text through the metallic box but when i apply the boolean modifier to the box it removes the box and not the text (i have converted the text to a mesh)
before:

after:

sorry if this is stupid I only started blender a few days ago and couldn't find an answer to this anywhere

You select the box, go to modifiers -> add boolean modifier.
As object you select your text mesh.
Choose intersection.
Apply.
Delete your text.
Ready.
If this was too fast, checkout my tutorial video:
https://youtu.be/Zshq7pk8Psg


How to render objects with the same color for all sides of the object? I am trying to create a label mask for these objects:

I am rendering models of the objects in Blender, but the problem is the lighting. I tried using a point lamp or a hemi lamp, but both give shadows, so that the cubes actually look 3D, which makes sense. I tried deleting the light source but then my cubes are just all black, which also makes sense, but is not what I need.

How can I render my cubes to have only one color for every side?

EDIT:
@martins answer solves my problem with the different colors, but now the edges are blurry. How could I fix that?

You can use emission shaders in Cycles:

or shadless material in Blender Render:


Pair Of Pro Duo for a Blender workstation I am building a new workstation solely for working in Blender & am wondering if Blender would recognize and utilize 2 x Pro Duo.

AMD Pro Duo description: https://pro.radeon.com/en/product/pro-series/radeon-pro-duo/

Regardless of it sounding like it may be overkill. Would it work at cutting render speed to a fraction?

And if yes, what do I need to be certain of including in order to make the most of them?

I have a Pro Duo and I don't see why two of them can't work together. With 2 cards, you'll have access to 4 compute devices since each card has 2 GPUs.

Checklist:

These cards a really long, make sure your case can fit them.
These cards are 250W each, so make sure you have a 750Watt+ power supply. Also, they require a set of 6+8pin PCIE power connectors for each GPU.

The rendering performance will scale very linearly with additional GPUs. But keep in mind that you are still limited to 16GB of video memory(per GPU), not the combined total video memory (64GB).


How to clean up almost-symmetrical vertices? I'm working with a low poly game model, and I need to fix some vertices that are symmetric by design, but somehow were made imperceptibly asymmetric by rounding error or something.

I need to fix that asymmetry so I can use tools like Select Mirror and so I have the ability to mirror shape keys.

The mesh has some intentionally asymmetric aspects in texture mapping and geometry, so I can't just delete half the model and apply a mirror modifier. Also the model is rigged and I don't want to lose the bone weights.

Is there a way to broadly fix the asymmetric vertex positions in a vertex selection?

The only way I've found to fix it by hand only works with one vertex pair at a time:

Select both vertices
Hit s Shift+x 0 Enter to eliminate Y+Z variation.
Set the median X coordinate to 0 in the Transform Properties

This works for single vertices, but I need to clean up 562 such verts, so doing it one at a time is out of the question.

'Snap to Symmetry' under Mesh in Edit mode should do it.

https://docs.blender.org/manual/de/dev/modeling/meshes/editing/basics/symmetry.html

'Symmetrize' on the same menu may also help, but note that it is quite destructive.


How to push object straight in game engine How can I push an object in a straight line with another object in the game engine? I made both objects dynamic, but when I push the object it moves in a random way. So how can I make it move straight?

Your collision bounds on both objects are a sphere. Under the Physic tab check the button for "Collision Bounds". Now assuming you two objects are cubes, the cube collision bounds will work fine.


How do cycles' emission strength values relate to real-world units? If I wanted to accurately reproduce the brightness of a real-world object in Cycles to see how Cycles rendered it, how would I convert the real-world units (like lux) into strength values?

From the documentation: "Strength input: Strength of the emitted light. For point and area lamps, the unit is Watts. For materials, a value of 1.0 will ensure that the object in the image has the exact same color as the Color input, i.e. make it ‘shadeless’."


How to move the center of scaling Hello. I'm a beginner.
In the model shown, when I select all of the top vertices and then
scale them to the center, the center of scaling is not the center of the 3d-model.

How do I move the center of scaling?
How do I move the manipulator widget where I want it after selecting?

I assume your mesh is perfectly centered at the 3d space, you could first use ShiftS --> Cursor to center to make sure the 3d cursor is at the center of the 3d space.

Then (with the mouse pointer pointing to the 3d window) you can make the center of scaling (pivot point = little white circle) to be exactly the same as the 3d cursor by:

Pressing . on the keyboard

or

Select it from the menu

By icon of coordinates I think you mean the red, green, blue arrows, sticking out of the pivot point

To show the pivot point after moving 3d cursor:

And what pivot point at active element does:

And pivot point at median point (origin is the orange dot):

(Maybe it is a little bit too detailed) :)


Why would an object be deformed by subsurf and differ from the 3D view when rendered? I am trying to render a scene that contains a bullet and an empty cartridge in Blender. However, when I render it using Cycles render it warps horribly.

Scene screenshot:

Rendered preview in the 3d View:

Rendered result:

If you have a closer look at the modifier tab in the Properties Editor (you can find explanations of the terms I use in the documetnation) you will see that modifiers have these camera and eye icons. They define if the modifier is visible in the viewport(that includes rendered preview mode) and in the final render. This makes it possible to view less complicated scene in the viewport and therefore be able to interact with it without lag and then have a lot more detail in the rendered result that might not be interactive and smooth if viewed in the viewport while working. You have one modifier that is only visible in rendered result. If you do not want to have it, you should remove it completely by pressing the x icon in the right-most end of the icon row.