Python - Orient light to polygon (face normal as direction) I am currently trying to write a script that creates a light at every polygon oriented to each polygon. The script takes as an input the active mesh. It iterates over the polygons of the mesh and gets their global position. It then creates a light at that position. The problem is that I cannot get the light to be rotated so that they are perpendicular to the face, is the same as the normal. I tired using the function polygon.normal but this does not give me a vector I can apply as a rotation. Instead .normal gives me a local position vector. It is local in the sense that it sees the polygon center as 0, 0, 0, basically the .normal function is no good for me in this case.

Here is what my script currently does:

Here is what I want it to do:
I do not care about the yaw of the light only the orientations matters to me atm.

part of the script or download here also included in the blend file
The code is well documented I think, let me know if anything is unclear. The function for creating the lights starts at line 47.

def create_light_at_face():
    """
    layers: tuple. 20 booleans where exaclty one boolen is True
    return: None
    creates an area light the has the same orientation as the normal at the center of each face
    """
    for poly in mesh.polygons:
        loc = get_global_poly_pos(poly)
        normal = get_normal(poly)  # this is probably needed somehow

        # get the rotation needed for each polygon face, idk how
        # default values in RADIANS, actual values will be computed somehow
        rot_x = 0
        rot_y = 0
        rot_z = 0
        bpy.ops.object.lamp_add(type='AREA', view_align=False, location=(loc[0], loc[1], loc[2]), rotation=(rot_x, rot_y, rot_z), layers=get_layers())
        # scale lamp up a little fo we can see the area
        bpy.context.object.data.size = 3

There's probably a cleaner solution, but for the time being, you can use:

import bpy
from math import radians
from mathutils import Vector, Matrix

obj = bpy.context.active_object
mesh = obj.data

def get_layers():
    """
    return: tuple of 20 booleans. True if layer is active layer,False if not
    Allows the mesh to be created on the active layer. There is only 1 active layer
    """
    active_layer = bpy.context.scene.active_layer
    layers = [False] * 20
    layers[active_layer] = True
    return tuple(layers)

def create_light_at_face():
    """
    layers: tuple. 20 booleans where exaclty one boolen is True
    return: None
    creates an area light the has the same orientation as the normal at the center of each face
    """
    mat_world = obj.matrix_world
    up = Vector((0,0,1))

    for poly in mesh.polygons:
        co = mat_world * Vector(poly.center)

        forward = poly.normal.copy()
        forward.rotate(mat_world)
        right = forward.cross(up).normalized() # Vector.length closer to 1.0
        up = right.cross(forward)

        rot = Matrix((right, up, -forward)).transposed().normalized().to_4x4()
        mat = Matrix.Translation(co) * rot

        bpy.ops.object.lamp_add(type='AREA', view_align=False, location=co, layers=get_layers())
        # scale lamp up a little fo we can see the area
        bpy.context.object.data.size = 3
        bpy.context.object.matrix_world = mat

create_light_at_face()

Also tried eulers, but did not work reliably (some lamps pointing inwards).

As ideasman_42, suggested, to_track_quat() can be used to do the job, too:

        quat = poly.normal.to_track_quat('-Z', 'Y')
        loc = Matrix.Translation(poly.center)
        mat = mat_world * loc * quat.to_matrix().to_4x4()
        bpy.context.object.matrix_world = mat

It's not much code less, but more understandable I hope.

Another variant:

        loc = mat_world * Vector(poly.center)
        # use loc as co for lamp_add operator here
        quat = poly.normal.to_track_quat('-Z', 'Y')
        quat.rotate(mat_world)
        bpy.context.object.matrix_world *= quat.to_matrix().to_4x4()


cloth simulation penetrates thorugh the collider I am recently trying to make pants, therefore I set my human mesh as

collider, but the pants still go through the legs.

how can I fix it?

Setting up the pants as Cloth, acticating its ClothCollision and setting the legs as Collision, it should work immediately. Note that the pants can still penetrate at some spots if

resolution of your pants is too low
forces (e.g. sewing) are too high
cloth collision distance is set too low
they intersect at the beginning of the calculation already


There is no sound in 2.80 but was ok in 2.79 I have started using 2.80
Opening a 2.79 project I have no sound in 2.80 (was ok in 2.79)
What do I do wrong?
Any suggestions?

I found the problem.
In my preference setting (go to Edit>Preference...) for Audio Device it was by default selected "SDL".
I have changed it now to OpenAl and have the audio working fine.


How to make the Wireframes for these lights? I am trying to reproduce on my CNC a wireframe skull that was etched on acrylic and put into an LED base. It is made by a company called Bulbing; I found it on Youtube. I was hoping that some one might be able help me with this project.
Useful article about these lamps.

-from Google Images.

Edit: To clarify what the original asker is looking for, How do you take a 3d model and give it a wireframe appearance then output it as a 2d image (preferably vector)?  The objects in the picture are flat pieces of clear acrylic with LEDs at the bottom.  The light reflects off the engraved areas, and if a 2d view of a 3d wireframe is engraved it has the 3d effect shown in the image.

This is actually really quite straightforward by using Freestyle and the Freestyle SVG Exporter add-on.

Start by enabling the Freestyle SVG Exporter add-on.

The add-on gives you an additional panel in the Render settings that allow you to configure the generation of SVG files. Whenever a frame is rendered, the add-on will also generate an SVG file containing the freestyle layer only.

Setup your mesh and mark the desired edges as 'Freestyle Edge'. Configure Freestyle to render just those edges and render the result.

Once rendered you should find an SVG file alongside the rendered image containing just the freestyle edges.


How do you animate material transitions (switching mesh object materials in animation)? I'm not using nodes, just two materials with two  different EVmap texture to it.
I want to assign material A at frame 1 and material B at frame 2
Pressing I on scene don't give me any option to animate material

Great opportunity for you to start learning how to use nodes then!
Because the only way I know for animating a transition between two materials is with nodes.

In the node editor, add the two shaders you want (Shift + A --> Shader), then from the same menu also add a "Mix Shader". Plug in both shader nodes into the mix shader, and animate the Factor to control the transition between the two.

A value of 0 means only the first shader plugged in takes effect, while a value of 1 shows only the 2nd shader. Any value in between is a mixture of the two.

Here's how to do this in Cycles:

In Blender Internal it's a similar thing, only using the Material nodes and the Mix RGB node (preview during animation isn't as good, but when you pause the animation you see the transition):


Exporting OBJ missing map_Kd I am using Blender 2.76. I have a cube with a texture I would like to export as an OBJ. But each time I do so the path to the texture is not included in the MTL file, but the texture coords are included in the OBJ file. How can I fix this? I am pretty new to Blender so sorry if I gave not enough information.

In the export window verify the checkbox "Write materials" is checked. Also ensure you have all the textures as external files (not packed in the blend file itself).
Also ensure you have created the material. In Blender, it's possible to see a textured object in the viewport after unwrapping it, but without creating a material at all. If the material isn't created, you might see it in the viewport, but it won't be "real." =)


proportional weight paint deformation I am trying to deform a flat coil for an animation:

The bone rotates around its own axis (z) and the coil-mesh should rotate and get closer to the bone depending on the distance to the center. So basically the "density" should be increased in the process.

My first thought was using weighted painting in radial fashion. Unfortunately this didn't work at all.

My second thought was using shape keys or key framing. Before I try that I wanted to ask if weighted painting is the way to go and not a dead end.

Edit: Trying atomicbezierslinger's answer results into this mess (probably my fault):

Consider a Curve Deform modifier.

The curve modifier is applied to a long strip with high density as in the original question.  Plane scaled  into a strip.  Plane moved along the X axis in the example below.  The bone is not used in the images below.

Create a Spiral Curve manually or use the add on  Add Curve Extra Objects.
The dense vertex strip will be moved in the X direction to travel along the spiral.
Consider scaling in two dimensions the spiral. Scale Not Z axis.
The curve modifier is specified along the X axis in this example.  So scaling the strip along the X axis is easy and provides a movement.

Image above shows a shape key created with a proportional edit smooth from center of spiral

Lastly

Consider scaling the bone, not recommended, and a one minute experiment might be interesting.


How to avoid operator `collection_instance_add`? How to create a instance of a collection from a Python Script/addon
without using the collection_instance_add  operator?
With the operator I use something like:
bpy.ops.object.collection_instance_add(
    collection=the_name_of_the_collection_to_use,
    align='WORLD',
    location=(0, 0, 0),
    rotation=(0, 0, 0),
)

With this I get no reference to the resulting object, and also don't know how it is named (automatic name wrangling).

Just do all necessary steps

Create a new Empty object
Set instance_collection to the collection you want
Set instance_type to 'COLLECTION'
Link the resulting object to the place you want to have it in
(reference: Basic Object Operations Example)

source_collection = bpy.data.collections["the_name_of_the_collection_to_use"]
instance_obj = bpy.data.objects.new(
    name="my_new__obj_instance_name",
    object_data=None
)
instance_obj.instance_collection = source_collection
instance_obj.instance_type = 'COLLECTION'
parent_collection = bpy.context.view_layer.active_layer_collection
parent_collection.collection.objects.link(instance_obj)


Only half of the object is getting texture, the other half is dark I have a cube and I want to apply a concrete texture to the inside of it but, when i do, it only applies the texture to half of it on the inside and then the other half on the outside of the cube. Why?

Incorrect, corrected after the first image

The issue is with your material's bump node. Change it to a Normal Map and everything works fine.

I don't know why the Bump node doesn't like hollow shapes, but every replica mesh I created and plugged into the material always ended up with those black surfaces. When I unplugged that Bump node, the problem went away.

Edit:

Seems like I finally found the source at the same time as HelloHiHola. You probably meant to plug in your normal image into the Strength input, not the Normal input.


Replicating the behaviour of SketchUp's plugin "Soap Skin Bubble" in Blender I wish to use Blender to replicate the way one of SketchUp plugins work, as closely as possible.
I exactly mean the part described in 1:22-1:48 of this video:
https://www.youtube.com/watch?v=YQGTGAJ7p_w
He creates a complex outline, then fills it with mesh and "inflates" the mesh. The topology doesn't have to be in quads, nor it has to be very regular. I don't care much about topology, just about the silhouette.
Is this possible to do in Blender?
I first took a look at some tutorials covering balloon cloth simulation, but it won't work because the boundary edges must not be moved in my case. They have to stay in place. This is crucial.
I appreciate any suggestions.

Cloth simulation can work very nicely as a modelling tool in Blender.
Some differences from the Sketchup add-on you refer to:

Blender Cloth is more general, so there are more settings. They can be saved as presets, though, once you've got them sorted out.
The Sketchup add-on assumes the boundary of the shape is pinned. In Blender, you have to pin vertices explicitly. Create a 'Pin' vertex group, allocate it with weight 1,  and declare it pinned in the 'Shape' panel of the Cloth settings. (Name the group whatever you like)

Blender Cloth Pressure (one of the 'Physical Properties' panels)requires a a closed manifold mesh, otherwise it 'leaks' So, as you see, your shape has been extruded downwards, and the bottom face filled. The rim and base can be discarded after applying the Cloth modifier.
I also added a 'Tension' vertex group to control the shape of inflation.. to give the inflated shape a thinner waist:

Unlike the add-on, the Blender simulation runs as an animation. This one stabilized in about 20 frames.


Using a computer on another side of the planet Good day Blender community!

I got a question Is it possible to use a PC on the side of the planet to render? Is there a way to connect them through the internet and use them as slaves?
So my online friend got a PC and she is willing to let me render on it. The problem is I can't keep sending her a file every time I want to render something and she doesn't use Blender. However she is willing to let it run for me while she goes away.

Is there a way to use a PC as slave that is not on the same network?

TL;DR Don't connect your friend's computer directly to the internet. Please use the service provided by a render farm instead.

It is possible to establish a connection between two computer that are in separate private networks through the internet. However, creating a render farm like this is technically difficult and not advisable for lay-person.

In order to understand why this not easy to achieve, consider the following problems:

Network address translation

Your computer at home is in a private network. In order to communicate with other computers on the internet you need a public IP address. Your internet service provider likely only provides a single public IP address for you and your family. Since you want to connect more than one device at a time to the internet, your router supports Network Address Translation (NAT). Essentially the NAT remembers when you start a connection from a computer from inside your local network to another computer on the internet, e.g. a webserver. When the webserver sends a reply, the NAT knows which computer should get the response. In your example both your computers are behind a NAT, which make establishing a connection difficult. This issue is known as the NAT traversal problem. While not impossible to solve, this may require a proxy/relay server besides your two computers.

Dynamic IP address

Internet service providers (ISP) may assign the public IP addresses to their customers dynamically. This means that the public IP address of your router and that of your friends changes after some some time. Once in a while you need to re-establish the connection. This may affect long running render jobs.

Network Security

Depending on how you intend to establish the connection between the two computers, there may be severe security implications for your friend's computer and network. Please do not persuade your friend to let you configure their firewall, install a remote desktop solution or VPN software on their router. While there may be tempting solutions for your idea, improper configuration could leave your friend's network open to attacks from the internet. Bots regularly scan IP address ranges for vulnerable or badly configured services that respond to their probing requests. Your friend also shouldn't simply hand you the access to their network, since they should be able to decide who gets access and who doesn't. If for some reason they no longer agree with your remote rendering arrangement, they should be able to block your access. Authentication and authorization is required, since only people that have the permission by your friend should be able to render on their computer.

Free Software

A software that solves all the listed problems would have to exist. Based on your comments it would also have to be easy to install and configure. Reading between the lines, it should ideally be free of charge.

Unfortunately trade-offs are necessary, since there is no free software/service that would simply allow to use your friend's computer for rendering. The following solutions exist:

Blender Cloud and Flamenco

Flamenco is an open source software for creating your own render farm. The problem is that setting this up yourself requires a significant know-how and since your two computers are in separate private networks you would also need to rent and host your own server. Luckily this service is already provided by the Blender Cloud and they have a Blender add-on that is easy to install. The downside is that Blender Cloud requires a paid subscription. The upside is that you also get access to tutorials, 3D assets from the open movies, HDRI, textures, characters and more.

Render Farm

Instead of using your friend's computer at all, you can also use the service provided by a render farm. The following render farms support Blender.

RenderStreet
blendergrid
Sheep IT (free, but everybody contributes their resources for rendering)

Note that I haven't used any of these render farms, therefore I can't say anything about the quality/value of the provided service.


What Are The Disadvantages Of Using JPEG Image For Texturing I'm new to texturing so I just wanted to know what the disadvantages are of just using JPEG image or taking a high resolution picture from your phone for texturing cloth , then adding bump or displacement nodes instead of buying textures from websites with colour maps and normal maps

It depends on what you want to achieve.
Basically, JPEGs are not all bad, especially for photographed image textures they work just fine.
Typical disadvantages of the JPEG format are:

Compression artifacts (should only be a problem if you have low quality or need very high detail)
No transparency channel (can be a problem if you want multiple overlaid textures or stencils)
Limited colordepth (for height- or bumpmaps or environment textures, the number of colors and/or brightness levels can be insufficient)

As advantages, I'd name the following:

It's usually the most readily available format for images (if you take or download a photo in JPEG format, you won't gain anything by converting it into another format)
For typical photographic images, it uses comparatively little space on your hard drive


how do I join two meshes without leaving a gap? i'm fairly new to the blender. I have these two meshes, the ragged one i need for the ground surface where the grass will be, the straight one i need for a road, how do i join them together without leaving a gap? Or is there a better way to make it out of a single mesh?

Possibly you can use Ctrl-R to cut loops in the plane on the right to match the number you have on the left.(I subdivided mine because I was dealing with a full plane that was square, yours is probably not needing that)

Then you can use Looptools add-on to Bridge the edge loops once you select them both at the gap between the two parts.


How to deform a 2d shape to make a 3d object? I have a 2d flat mesh that i would like to manipulate without any distortion to create a 3D shape. Typically for the pie below, joining the 2 edges together would make a 3D cone. Do you have any idea of which modifier to use ?

Using a script to make the two shape keys.  Change the r and h of result cone.

Example of radius 1, height 2, 1 and 0.5 cones.

import bpy
import bmesh
from mathutils import Vector
from math import radians, sin, cos, sqrt

from bpy import context # for testing

r = 1 # radius of cone
h = 1 # height of cone
sectors = 16
l = sqrt(r**2 + h**2) # hypotenuse
# sector will have angle

theta = radians(360) * r / l
dtheta = theta / sectors

# build the base

bm = bmesh.new()

verts = []
for i in range(sectors + 1):
    a = i * dtheta
    verts.append(bm.verts.new((l * cos(a), l * sin(a), 0)))

topvert = bm.verts.new((0, 0, 0))
for i in range(sectors):
    bm.faces.new([verts[i + 1], topvert, verts[i]])

cone_mesh = bpy.data.meshes.new("Cone")
cone = bpy.data.objects.new("Cone", cone_mesh)
bm.to_mesh(cone_mesh)

# add base as basis shape key
basis_shape_key = cone.shape_key_add("Basis")

# add second shape key

cone_shape_key = cone.shape_key_add("Cone")
offset = (radians(360) - theta) / 2
dtheta = radians(360) / sectors
for v in verts:
    a = v.index * dtheta - offset
    cone_shape_key.data[v.index].co = ((r * cos(a), r * sin(a), 0))
cone_shape_key.data[topvert.index].co = (0, 0, h)

# link to scene

scene = context.scene
scene.objects.link(cone)
scene.objects.active = cone
cone.select = True


How to register custom math function? I need to create a script to define certain math functions. This script will not directly modify or create any objects. I will simply use them with the XYZ Math surface and/or the Z Math surface. Among other functions, I need a sgn() function (why on Earth it isn't part of python I cannot fathom) and an a^b function that can handle non-integer b for negative a.

Creating these functions isn't a problem. I already have, for use with drivers, and I know I need to register them there by

bpy.app.driver_namespace['<functionname>'] = <functionname>

But how and where do I register them to be able to use them. My guess would be

bpy.app.foo['<functionname>'] = <functionname>

But what should I substitute for foo here?

This is simply amazing. I've googled for days about this, and the answer is nowhere to be found. Everything is about modifying meshes and creating classes to extend blender's functionality with new addons.. I have no need for that. I may at a later time, but I don't know. Is there really no way to implement a standalone mathematical function and register it in a way that it's available to all aspects of the program?

You first example line bpy.app.driver_namespace['<functionname>'] = <functionname> registers the function within the driver namespace and makes it available as <functionname> within any driver expressions.

From other areas of blender you can access it with it's full data path - bpy.app.driver_namespace['<functionname>'](3) calls that function passing a value of 3.

But that isn't the issue you have with the math object creation -

The XYZ math surface object allows you to enter an arbitrary string to define the surface of the object. As this also allows any python to be run it implements a security feature that prevents any functions not listed in it's safe_list from being run.

To get around this you need to do two steps, add your functions as a module and then import them into the addon and add the names to the safe list. Or you can adjust the usage of the safe list to allow any functions. You may want to duplicate the addon and adjust it so you have your own custom addon that suites your needs. You may also find it easier to define the calculations used and just input a few variables.

For a sign function in a on-line script you can use 1 if x>0 else 0

For a^b I don't see an issue -2**3.5 returns -11.31370849898476


How do I calculate how far an object has travelled in a specific time? I can't find any reference to calculate an object travelled distance along a time range. I think it could be done by using Matrix difference from frame to frame.  I need distance travelled on each frame. I am expecting a cumulative value for each frame.

Any ideas?

Object distance between frames and total movement length can be done. Set frame_start and frame_end variables.
It calculates selected object distance.

import bpy

o = bpy.context.object
total = 0
frame_start = 0
frame_end = 10
bpy.context.scene.frame_set(frame_start)

for frame in range(frame_start+1,frame_end+1):

    loc1 = o.matrix_world.to_translation()
    bpy.context.scene.frame_set(frame)
    loc2 = o.matrix_world.to_translation()
    dist = (loc1-loc2).length
    print ("Frames:", frame-1,"-", frame,"distance:", dist)
    total += dist

print ("Total distance:", total)


What is the correct HDR mapping with blender internal (native) render? I downloaded HDR image from https://hdri-skies.com. And added it to world texture. There seems to be some problem in maping.

What is the correct HDR mapping with blender internal (native) render?

The problem was not in the maping.

Equirectangular is the correct mapping method.

Problem was in World

In properties>World Paper Sky was checked and i had to un check this

Note: I also unchecked Blend Sky as it was giving a dull sublte lighting.


View point shading strength slider missing? I am following a tutorial, and I have been instructed to reduce the strength of the viewpoint shading. The slider for strength is not there?

Found it! You need to update Blender from 2.80 to 2.81 (I downloaded the old version to check).


Texture view works, but render is without texture I have this bogie:

It's textured with UV Map in a dark grey as you can see in texture view. However when rendering, it's nicely rendered, but no texture is to be seen:

I checked this question/answer already: Render not showing UV texture

EDIT:
I did all the steps mentioned in various tutorials and in the Blender wiki:

I added a material, then a texture. I created seams, unwrapped my mesh, saved the UV layout, changed its colour to dark grey and assigned the image back to the texture. In texture view you can see the result:

The frame is just plain dark grey, the wheel set has a light grey tread.

In render view it's just the default untextured grey.

Frame and wheels are different objects with different Materials, different Textures and different texture images.

Here is the blend.

Go to the setting of render layers. You have selected material that overwrites all materials. Remove this material and it will work.


Having a photorealistic earth in the background of an animation I have created a model of a satellite and created an animation for its tumbling, but it just occured to me that I'd need to have it be more realisitc mainly by having earth in the background at some parts.

I tried to add an earth model in the background with lighting and everything but it slows down everything drastically.

Is there a way to have an effect similar to that seen in the video?

This video shows exactly what I have in mind

First, know that the physical phenomenons that come in place in the Earth's atmosphere (including those that come at the edge between day and night) are rather complicated. So if you want to do realistic "GRAVITY-style" CGI, you have a lot of work, certainly much more than what you did with your satellite.
If for some reason you don't want to simply use a single high-res photo of a low orbit view as the background and want to make it with as much CG as possible here's what you can start with :

the Earth's texture has to be focused on a particular area, or else you will waste a ton of memory or simply have a pixelated result.
I suggest using OpenTopography to generate color and heightmap, because at this zoom level you should also see the displacement of the mountains.
for the clouds layer I don't know of a better way than using an image like this, although it will not give very realistic results, since again at this zoom level you should see them in 3D and very sharp. You could even see the projection of their shadow in the atmosphere itself, which if you want to do that using volume scattering will explode your render time.
for the day-night shift, you'd have to simulate the red twilight in some way.
Unfortunately I don't think there's any tutorial on that but if you know your nodes you can get something close.


How to model separate parts and re-use them? I am a new user and trying to determine if Blender can perform the 3D tasks I need for my projects.  I have 4 years experience with other 3D systems.

The questions are:

In creating complex models with many unique parts (2000 part transmission), can separate parts be modeled and then joined to the main part? (Housings, gears, shafts, tubes, etc.)?
Where common parts are used repeatably, can those parts be modeled and saved in a Resource folder?

You can store and re-use parts. Just save the re-usable part in a separate file. Then, whenever you want to use it, push Shift+F1, navigate to the .blend file with the part in it, open it, select the objects folder, and select your object. It will then import that object and all its data into your scene. Hope that helps!


How to colour entire object based on its height I have a bunch eg 5,000 extruded objects (think columns) each of different height. All off these exist as a single object, ie they are grouped together rather than individual layer objects. I want to apply a colour ramp so that each of the individual columns are coloured based on their height value, rather than the entire group.

This doesn't mean that the colour ramp is applied against the z axis resulting in the object having a colour fade as is gets taller, but more like the entire coumn is coloured based on its maximum height, and therefore corresponding colour on the colour ramp.

The columns are "hex bins" of a 2km geographic area. Their individual height represents the urban density. See image attached.

Hope that makes sense. If you are able to post the script / specific setup for this then I would be grateful - I'm very, very new to Blender so please bear with me!

Achieving this with material nodes
I thought Generated and Object texture spaces differ and that can be used for this. Thanks to Robin Betts for figuring out the correct math.
Object's texture space goes from 0 to one in every direction on every axis from the origin of the object to the end of its bounding box in that axis, however Generated texture space matches the scale of global world space. If the origins of all objects are at their bottoms, their heights can be calculated by dividing the Z value of the object's texture space by the Z value of Generated texture space. The values can then be compressed to the desired range by dividing them by the height of the highest object. A Color Ramp node then can be used to remap the height values to colors:


Subdivide only showing in sculpt and render not in layout I'm new to blender so sorry if this is obvious but after creating a material onto a subdivided cube it will render with both and in layout it (mostly) does both as seen here:

This also seems to not apply the image overlay just the base colour and reflections from lights. Now in layout where it would be convenient to add other objects to this it is still a cube as seen here:

It has all of the material yet is not rounded making it hard to tell where other objects will clip through it in a render. I tried searching this on my own but only found how to make subdivided cubes and alike however I have found a case of use here:

This is a screenshot of what I am describing being used (from YouTube) e.g the this is a subdivided cube with its texture and shape being shown in layout. So how would I be able to enable such a view?

in the first image post checkout the modifier multi res, there for the viewport its set to zero.
The idea here is that you can set different levels, ea while you work you can set it to low values, but when you render (or sculpt) you set it to high. so the memory load and speed of your pc is not harmed while working on your scene.


Is there a way to calculate the volume difference between two objects? I'm relatively new to Blender so apologies in advance in case this is too basic of a question.
Trying to come up with a way to compare two files and identify a volumetric difference between them.
For example, if I get a 3D scan of an apple and then scan it again after a bite has been taken, can I overlay them in Blender and calculate the volume of the difference between those two scans?
Thanks to all in advance

If you go to edit>properties>Addons and enable the 3d print toolbox add-on then click on the 3d-print tab on the right side of your viewport you can click volume to get a numerical value for the volume of the object. From there you can either get both volumes and do the math yourself or you can bool the 2 objects and use the 3d-print tools to get the volume of the result.


How to scale an object relative to a moving Empty's coordinate system? I'm trying scale an object relative to a moving Empty's coordinate system.

I tried applying the "child of"-constraint to the object and scaling the Empty.

If I tick both the scaling and location options, the scaling happens as desired but when I move the Empty, the object moves along with it. I want the object to stay in place.

If I tick only the scaling option, it will no longer move with the Empty but now the scaling happens relative to the object's local coordinate system. Not what i want.

You were right with your initial intuition about using a Child-of Constraint.

Here is the somewhat limited method of sucking in an object by scaling an Empty that the Child-of Constraint is using:

The limitation with the method described above is that moving the Empty also relocates the object, even when the "suck-in" effect is not being used.

The solution to this is to keep the Empty scaled down to zero all the time and instead use the Influence Slider to control the effect. The Influence Slider can of course be keyframed for animation.

Tip: Enabling "Display: All Object Origins", and also using the Outliner can be helpful for selecting objects in their scaled-to-zero state.

Download the .blend here:

https://blend-exchange.giantcowfilms.com/b/2892/


Boolean to cut a hole in a face does not appear to be working I am trying to add a boolean modifier to a cube, cut a hole in a face but it does not appear to be working.

Even though I'm a newbie I'm sure I'm using the modifier correctly.

You can't see the result of the boolean operation because both meshes are visible. If you disable the visibility of the cutting object you can see the result of the boolean operation.

But you should really try to avoid using booleans for simple operations like this. Booleans will create very messy topology that will give you headaches down the line. There is a indeed a time and a place for booleans, but if you are starting with blender, start on a more solid footing by learning other ways that will yield proper topology.

Watch https://www.youtube.com/watch?v=Bc52fcrHvAA


What is the relation between Time Remapping, FPS, and the number of frames? I just needed my animation to be a little bit faster so I set the time remapping options to be:
Old = 100
New = 125
I need my output video to be 24 fps. Do I need to change the number of frames in the timeline (the end value)?

A ratio of 100/125 means you want to stretch your action by a quarter, it keeps the exact same action but plays it 1/4 slower (and not faster!).
Note that the Time Remapping values dont affect the duration of the rendered movie, the Timeline still does it.
Let say your action finishes at the end of your Timeline. In the case of a slowed action, if you want to see the full action, and don't want it to be cut off by a quarter, you'll also need to increase the Timeline length by a quarter.
If you want to speed up your action by a quarter you need to set a ratio of 100/75, in that case your action will be finished at 75% of the rendered movie, you can either let it as it is (the last quarter will be still), or cut off 1/4 of your timeline, or cut off the last 1/4 of the rendered movie.
In both case you don't have to change the fps, Time Remapping precisely allows you to ignore the fps!


reconfigure roll of bones without losing waightpaint I need to change roll of some bones in my rig and would like to save my weight paint so I does not need to re-do it again. Is this possible. I know that I can change roll of finger bones with out deforming mesh but I cant to the same on legs :) Any thoughts :)

Changing the roll of bones will not effect your weight painting and your model in rest-position will be exactly the same.

What will change is your bones pose transformations -> your armature in pose mode will look different. That's because such transformations are in local space and changing the roll of bones changes the bone's coordinate system base around it's Y axis.


"Moving Property" function? I have a character who plays his walk animation when he walks, but what if he is behind a wall? He would look sort of goofy walking when hes in place. Is there a way I can have a property ("Moving") be toggled to 1 when hes changing his position (not rotation) in 3d space? Any helps is appreciated; I would like to have this in logic bricks if it is simple. Thanks!

You already answered your question by your own:

Behavior:
When moving play walk animation

This implies:
When not walking -> do not play walk animation.

As you do not explicitly told the character to stop (e.g. by command) you need to detect any events that stop it from moving.

There are many options to detect such events:

no movement requests from user
getting other requests from user (e.g. jump, run, stand, crouch)
hitting a wall
floating (e.g. when falling, jumping)
speed below a limit

I guess you want to know the last option. This is not possible with logic bricks. You need Python to activate actuators when the object does not move anymore:

import bge
controller = bge.logic.getCurrentController()
owner = controller.owner

limit = owner.get("limit", 0.001)

lastPosition = owner.get("_lastPosition")
position = owner.worldPosition.copy()
owner["_lastPosition"] = position

if lastPosition is not None:
    travelledDistance = (lastPosition-position).length
    if travelledDistance <= limit:
        for actuator in controller.actuators:
            controller.activate(actuator)

This needs to be activated all the time (enable True Level Triggering).

Attention

this is inefficient and should be used at a very limited number of occurrences
this does not differentiate between other situations when the character is not moving (e.g. sitting, sleeping)
you can tweak the limit by setting a float property limit


How to add a text object? I want to change a text dynamically using the game engine, that is, the bge module. I want to do it through a text box and I found a question about it. The problem is that in a part of it says to add a text object. I do not know how to do it, because I can not find the option "text object" in the "add" button of the "Logic Editor" bar.
The code I´m using is this:

# import game engine modules
from bge import render, logic
# import stand alone modules
import bgl, blf

# create a new font object, use external ttf file
font_path = logic.expandPath('C://Documents and Settings//Guillermo//Mis documentos//Google Drive//Gproyectos//Proyectos con Blender//Zeyada.ttf')
# store the font indice - to use later
font_id = blf.load(font_path)
chain = 'this is the message'

def write():
    """write on screen"""
    width = render.getWindowWidth()
    height = render.getWindowHeight()
    # OpenGL setup
    bgl.glMatrixMode(bgl.GL_PROJECTION)
    bgl.glLoadIdentity()
    bgl.gluOrtho2D(0, width, 0, height)
    bgl.glMatrixMode(bgl.GL_MODELVIEW)
    bgl.glLoadIdentity()

    # BLF drawing routine
    blf.position(font_id, (width * 0.2), (height * 0.3), 0)
    blf.size(font_id, 50, 72)
    bgl.glColor4f(1.0, 0.0, 0.0, 1.0)
    blf.draw(font_id,chain)

def update(cont):
    own = cont.owner
    chain = own['msg']

# set the font drawing routine to run every frame
scene = logic.getCurrentScene()
scene.post_draw = [write]

I call to this piece of code, drawtext.py.
In the scripting window this is the code I have written:

import drawtext
drawtext.chain = 'Hello Mind Maps!'

But I suspect that drawtext.chain must be linked to a text box from which you can enter text in real time.

you can edit written text via string game property but you need to assign it to your drawing property in this method, here is the code.

# import game engine modules
from bge import render, logic
# import stand alone modules
import bgl, blf

# create a new font object, use external ttf file
font_path = logic.expandPath('//C://Documents and Settings//Guillermo//Mis
documentos//Google Drive//Gproyectos//Proyectos con Blender//Zeyada.ttf')
# store the font indice - to use later
font_id = blf.load(font_path)
# we get the game property and assign it before drawing so we can change it always
cont = logic.getCurrentController()
chain = cont.owner['msg']

def write():
    """write on screen"""
    width = render.getWindowWidth()
    height = render.getWindowHeight()
    # OpenGL setup
    bgl.glMatrixMode(bgl.GL_PROJECTION)
    bgl.glLoadIdentity()
    bgl.gluOrtho2D(0, width, 0, height)
    bgl.glMatrixMode(bgl.GL_MODELVIEW)
    bgl.glLoadIdentity()

    # BLF drawing routine
    blf.position(font_id, (width * 0.2), (height * 0.3), 0)
    blf.size(font_id, 50, 72)
    bgl.glColor4f(1.0, 0.0, 0.0, 1.0)
    blf.draw(font_id,chain)

# set the font drawing routine to run every frame
scene = logic.getCurrentScene()
scene.post_draw = [write]

all you have to do is changing the owner property "msg" it will be drawn, you can also put a keyboard sensor and set the "msg" string as keystrokes log property so it will receive the keystrokes and display, them you don't need to connect it to the python controller but make sure that the code is always running, the code should be with the object that has the property "msg".


albedo, height, roughness? Texture download included a bunch of files. How do I properly use them? I have downloaded a seamless concrete texture, but I'm not sure what to do with each file.

From what I understand, each texture is used to apply a certain effect on the object, but no tuturial has given a clear pathway on what each one means and how it needs to be used. The folder included these 5 files: albedo, ao (ambient occlusion?), height, normal, roughness. How do I properly utilize this?

It seems like there's no right answer at this point, so any help is appreciated!

I struggle with this as well, but I found that activating Node Wrangler in the add-on gave me access to a great shortcut for creating principled shaders.  If you go to the node editor and change the diffuse node created when you make a new cycles material to principled then while it is selected  hit ctrl, shift, T it opens a screen to let you select your images.  Highlight all and then click the open button and it will build a proper principled shader tree putting them into the right spots.  I haven't tried it with an AO file though because I'm not sure what that's for and I was under the impression Blender didn't use them, but I could be wrong about that.  Hope this helps you out a little bit.


Question on tapering a bezier curve I'm trying to model this medieval wall sconce, in particular this vertical strap component:

So far I have a 3D Bezier curve with depth and extrude applied:

I have added a second Bezier curve with which I intend to taper the strap:

I select the main strap object and assign the taper object to be the second curve:

I cannot seem to adjust the taper curve in such a way as to achieve the desired effect.

Is this a good approach for this situation and if so, what can I do to get a proper taper on the strap? Are there other, "better" methods for this effect?

I would convert the curve to a mesh object with Alt+C> Mesh from curve/meta/ surf/ text.

Next,  Tab into edit mode and enable proportional editing with O.

Finally, select just the top few edge loops of the new object and scale while adjusting the proportional edit radius of influence with your mouse wheel until satisfied with the result.


How to make edge length to always be multiple of a certain number? I want to make a model whose edges' length (all of them) are always multiples of a certain number.

Later on I want to apply a pixel-art texture and I need to have a 1:1 relationship between the texture and the model so there is consistency in the size of the pixel across all faces on the model.

You can use the snapping features and align all your vertices to the grid.
If your edges are not aligned to the grid you can set the edge length in different ways like described here.


Shading issue's with bevel For a model I used a bevel to get nice and smooth edges, but since the bottom right side is slightly angled* I need to add some extra geometry to maintain a quad only design. But this makes it that the shading gives weird results. Is there any way to fix this?
*I can't get rid of this angle since this is needed in the model

It looks to me like you might try LoopTools -> Relax on that curved edge.


Why isn't the rendered image a readable file? When I try to render this animation the file is a file I am not familiar with and it's not an image file as I was expecting. I attached some images.

Check the file extension box or type in the file extension manually (.jpg .png etc.)


Why is shrinkwrap not applied? .blend file
Why is the shrinkwrap not applied?
Tutorial: grow faces over single axis
From:

To:

I'm a bit lost with the axis but you can fix it this way:

In Object mode, rotate the vertex 180° on the X axis
Give your Solidify a negative Thickness value
Remove the Group from the Shrinkwrap modifier (or assign the only vertex to this group)


How do I smooth a subdivided surface? I do not know why it curl. What is happening is clearly visible in the photo. It's a simple thing, but I do not know a dream board.! I'd like to smoothly cut off.

I think the best way is to build this mesh again. Here is my solution on how to do it properly:

Add a low poly (8 vertices for example) cylinder and subdivide it as many times you like verticaly/ horizontaly.

Select single edge and press Shift+S--> Cursor to Selected.

Press Alt+Shift+S and move the cursor from left to right (or input a value 1). It will make the edge spherical.

Repeat the proces with other edge loops. Select the next one and press Shift+R. Make all of them spherical and then cut the holes.

Delete half of the cylinder and scale it in y axis using proportional editing. Now all look super smooth.


Why does my textured object appear black in the viewport in 2.8? Does anyone know how to solve?
I can no longer apply texture.

Check the alpha of the material. If it's on opaque but with alpha value 0, it appears black.
This happened to me when imported models with materials already applied.
Another possibility is trying to delete the material and create a new one again.


Why my rigging doesn't work? I just begin in Blender, so be indulgent.
So my problem is that when I want to move my bones in pose mode, my mesh become slack and react just like I deplace one edge in edit mode. What should I do ? Did I do some mistakes ? I don't know if it is important but my mesh come from Makehuman with the armature.

Just look stupid...

Problem with the weight Paint, probably a to low resolution, give it a subsurf modifier (just in Addition) and then, because you are making something natural ( a Body) I would always use weight paint to tell the bones which area they should affect (just optimizing the weight paint should actually work already)


armature deforms body I'm very new to Blender and I made a guy made out of blocks for a Game I'm working on in Unity. I made the armature and made it Parent with automated weights, now my Problem: When I for example move my right arm, it deforms the right side of my torso like it's glued to the arm, I dont know what to do please help.

You need to modify the weights of the side torso.  Select the mesh, hit Ctrl+Tab and get into Weight painting mode.  For more information about weight-painting, please see:https://www.blender.org/manual/painting_sculpting/painting/weight_paint/introduction.html#weight-paint-in-a-nutshell


My texture doesn't apply on a surface but does on an other My problem is a bit curious ! I've got 2 simple planes. And on them I apply a texture, exactly the same. But on one of them, the texture is not showing. Can you explain me why ?
One precision : the surface in which the texture is not apply is an import of Sketchup, but I flattened it to have a very simple plane, I recalculate normal, I verified there is no double faces... so I don't understand why I have this problem.
Thx for your help !

Thanks @lemon ! You're right, there is no UV map for the bad plane. Question solved. Thanks again for you very fast help !!


What are the intentions of the different forms of Armature/Bone Parent/Child relationships? Hello to every blender user,

AFAIK I can parent a bone to a part of the mesh (in the specific case the teeth.t bone and the upper_teeth_boy) in two ways :

1) I go under the object tab and I chose rig.boy on the parent field and teeth.T bone under the bone field. But it didn't work,because the upper_teeth_boy takes a strange angle

2) instead,if I select the upper_teeth_boy first and teeth.T for second and then I press CTRL P and then set parent to bone,it works.

In the attached video,I have parented upper_teeth_boy and teeth.T using the procedure explained on point 2) and then I removed the parent and I did the same but using the procedure explained on the point 1) but it didn't work. Why ? Thanks.

demonstration video 1

blender file

I didn't use the "Keep transform" option. This behaviour appears also if parent has default loc/rot/scale,as you can see from this video : demonstration video 2

Parent Child Relationship and Keep Transform

There are different ways to create a Parent/Child relationship in Blender or parent.
Keep Transform stealthily does the appropriate math with matrices to preserve child placement.
Some ways have [immediate] effect in placement, others (Keep Transform) [delayed].

In the two object parent and armature parent menus above we see (Keep Transform) as a valuable option.
The [Keep Transform] genre intentionally preserve child placement at the time of parent assignment, then you move the Parent for different results.
You should choose the one the best suits your context.  If the [immediate] effect is not what you want today, then the suggestion is to view it as a feature that you may use in the future for a positive Blender User experience.
Both parent menus above have many different options so you may expect this as a feature.  All of those options may be useful to Blender Users in some particular cases.
Via Control-P use Keep Transform for the case in question.  Manually filling in Parent does not necessarily [Keep Transform].  If the parent has any (non default) Scale, Rotations, or Translation the new Child will be transformed accordingly.  Expect this designed behavior.  It is a feature not a defect.
This was intended as a short explanation.  See more here at BSE or the online Blender Manual


how to export out keymaps? I need to save out keymaps as I update shortcuts. In case I make a mistake, I want revert back to a previous update and not the default settings.
I'm in the Export Key Configuration area in the Preferences window, and I don't know what I'm looking at, some sort of windows explorer system, with no save option.
It says I have to save a Python Script file...
I'm not sure what that means, I'm not sure what that should look like, I can't tell what custom explorer file system does or how to save a file with it.

Blender stores the keymaps in a python script file, hence the .py extension. What you are looking at is Blender's internal file browser. Just give your keymap a name and browse to where you want to export the keymap and press "Export Key Configuration..."

If you ever want to revert back to that exported keymap, simply press the Import... and browse to the .py file you previously saved. Voila.


Setting camera to position where it can render a seamless repetable orthographic scene I'm using 3d to speed up production of 2d graphics of machines and structures (which have a lot of straight lines, objects and little details repeated all over the place).

The goal is to have an isometric background image that repeats seamless.
I set the camera with orthographic projection and 45° of rotation.

And manually cut the vertical borders in an image editor in the position where it repeats. Then I can do something like this:

Instead of cutting it manually every time I do a test, I would like to set the camera view position and height from Blender. Then I can render an already seamless repeated image.

Those two Empty objects in the boundaries are where the camera borders should be. However I have no clue how to accurately set up the camera in this case.
How can I do this?

The trick with Orthographic cameras in Blender is that they use a specific scale system, such that 1 Blender unit always matches the largest dimension of the render output.

That means if you are rendering an image of $1920\times1080$ with a scale factor of $1$ then $1920$ pixels in your image will match exactly one Blender scene unit.

If the image is say $2048\times4096$ with a scale of $2$ that means that $4096$ pixels will match exactly two Blender units.

That being said in your case you need to do some math.

Place you camera such that it points exactly at the center point C midway between your two marker empties $A$ and $B$, while being rotated exactly an angle of $45°$ in the X axis. Distance is unimportant.

You can select both empties $A$ and $B$ and easily place the 3D cursor to the selection with Cursor to Selected, and then use the operator Center View to Cursor to center the camera between the two.

Now determine the distance between the two empties $[AB]$. Since it forms a right-angled triangle, with the distance being its hypotenuse, then the exact scale of the camera will be the square root of this distance. In my example above they dist exactly two units apart, so $\sqrt{2} = 1,4142$ will be exactly the scale factor you must place in the orthographic camera.


Micro Displacement how to make it to look better, or is there a better solution (5 questions) Recently I've been working on personal projects so I decided to give displacement map a go [I am trying to take images of wall carving, ornaments, or patterns and make it 3d, but I have so far encountered a few problems.

1.The surface is inacurate

What should have been smooth is too rough, and looks like a rocky mountain instead of a smooth sculpture

2.The original plane gemometry didn't seem to go away

I pressed subdivide in edit mode 1 time , add ten cuts
, then added a subsuf modifier pressed Adaptive, but still getting these result, and adding more loop cuts just seems to worsen the geometry and the mental state of my computer

3.Trying to figure a way to change textures

So this is the texture map and the displacement map

Since the displacement map has to be blured out in photoshop, the geometry added in isn't enough for the details, but then it seems to heavily depend on on the texture map to give details, is there a way that I can save the details and change the photo textures from stone to wood or something else? (The bump map only gives me details but since the geometry is not enough to start with without the texture map it looks horrible)

4.Is there a way I can apply the TRUE displacement, see and edit it in the edit mode?

5.Is there an another way to approach the same effect

I have watched some videos on youtube such as
https://www.youtube.com/watch?v=Tsaa_D6CcSo
I think this is hard surface modeling(not sure), though some projects can be done by this method but when it comes to wall carving, the geometry won;t be that simple, sculpting may be a solution,

but it takes time and skill to reach the decent level and look like the reference image, which is something I don't have as a programmer background lowlife freshmen peseant , and I don't know how to retropology yet.

Lets go from big issues to small ones.

1.The rocky, jagged surface you're experiencing is a the fact that your displacement is too strong. Add a Math node, set it to multiply and put it between the displacement texture and the displacement output in the node editor. You can then adjust the second value to decrease the height, to make the displacement more subtle and thus convincing.

2.The original plane geometry doesn't go away, it just gets subdivided more when you hit render. What you're encountering is the preview mode - in a render preview, the mesh is subdivided less to improve performance. That is the "Dicing scale" option in the subdivision surface modifier. The smaller it is the more detailed the mesh will be - both for rendering and preview. Decrease the dicing scale if the issue persists during rendering.

3.The thing with textures is that they always add surface detail. By that I mean that certain surface imperfections are just in the Albedo, but not in the displacement. Those will dissappear if you use a different texture.  If you go too detailed with your displacement texture you'll eventually encounter the limits of whatever image format you're using. The basic displacement can stay the same, and you can slap a different texture on top without issues. Keep in mind tho that the displacement and Albedo textures tend to go hand in hand tho. Out of curiosity, why did you blur the displacement texture?

4.This feature is coming to blender, but not there yet. You can refresh the mesh by tabbing into edit mode and out again when you've made changes.

5.You can definitly sculpt such detailed wall ornaments, although sculpting is quite different. It will certainly take more time to sculpt it, a micropolygondisplacement will definitly be faster to implement. Depending on your final sculpting implementation it might be more ressource intensive as well.


ignore a BoolProperty from Undo? i created a custom blender ui.
i know that normally we should register multiple panel and sub-panel but i decided to do things differently.

my UI is based on bool properties, like this below

prop stored in addon preferences

class SCATTER_AddonPref(AddonPreferences):
    bl_idname = __name__
    addon_prefs = bpy.context.preferences.addons[__name__].preferences

    scatter_sliders_display          : BoolProperty(name="",description="",default=False)
    scatter_sliders_vgroup           : BoolProperty(name="",description="",default=False)
    scatter_sliders_curv_is_open     : BoolProperty(name="",description="",default=False)
    scatter_sliders_curv_adv_is_open : BoolProperty(name="",description="",default=False)
    scatter_proxy_is_open            : BoolProperty(name="",description="",default=False)

and this is how i use it in the ui

layout.prop(addon_prefs,'scatter_camera_is_open',text="bla category",emboss=False,icon='BLENDER')
if addon_prefs.scatter_camera_is_open:
    layout.label(text="blablabla")

i think it is a really nice method. i already saw this used in many many case, but the problem as we saw in the gif is that it leave a trace in the undo history.

so is there's a way to avoid this or am i screwed ?
anyhow i could ignore ctrl z with this specific property ?
for example, is it possible to create an operator that will toggle thoses addon pref on/off and will not show up in the history at all ?

if i wisely use an operator that dont have 'UNDO' in its bl_option it can work easely.

class SCATTER_OT_panel_toggle(bpy.types.Operator):
    bl_idname      = "scatter.test"
    bl_label       = ""
    bl_description = ""

    pref : bpy.props.StringProperty()
    def execute(self, context):
        pref=self.pref

        addon_prefs = bpy.context.preferences.addons[__name__].preferences

        if eval("addon_prefs."+pref)== True:
            exec("addon_prefs."+pref +"= False")
        else:
            exec("addon_prefs."+pref +"= True")
        return {'FINISHED'}

example in code ui

        row.operator(SCATTER_OT_panel_toggle.bl_idname,text=na,emboss=False,icon=ixon).pref = "scatter_radar_is_open"


Vertex weights and vertex indices for Blender Python API I'm trying to write an importer addon for blender using the python api. And the documentation has been less than "helpful" so far. In threejs you have a page like this: https://threejs.org/docs/index.html#api/objects/SkinnedMesh

for ( var i = 0; i < geometry.vertices.length; i ++ ) {

    // Imaginary functions to calculate the indices and weights
    // This part will need to be changed depending your skeleton and model
    var skinIndex = calculateSkinIndex( geometry.vertices, i );
    var skinWeight = calculateSkinWeight( geometry.vertices, i );

    // Ease between each bone
    geometry.skinIndices.push( new THREE.Vector4( skinIndex, skinIndex + 1, 0, 0 ) );
    geometry.skinWeights.push( new THREE.Vector4( 1 - skinWeight, skinWeight, 0, 0 ) );

}

I'm trying to find the equivalent code or examples for the Blender Python API. After I create a mesh, how do I then go about setting weights and indices for each index?

mesh = bpy.data.meshes.new('Mesh')
mesh.from_pydata(self.verts, [], self.faces)
mesh_object = bpy.data.objects.new('Mesh_Object', mesh)
bpy.context.scene.objects.link(mesh_object)
# How to add in vertex weights and indices?

Okay, after posting on the blender forums, I was able to find an answer. To add vertex weights to a mesh you have to do the following:

Create a Mesh
Create an Armature
Create a list of vertex groups (the index of the vertex group is the bone index)
Set the parent of the mesh to the Armature
Add an Armature modifier to the mesh (so it know to deform by vertex group)

The code is kind of long, but it's one function so hopefully it's easier to trace through that the entire import plugin.

# Create Armature

armature = bpy.data.armatures.new('Armature')
armature_object=bpy.data.objects.new('Armature_object', armature)
armature_object.show_x_ray=True
armature.show_names=True
armature.draw_type = "STICK"

bpy.context.scene.objects.link(armature_object)
bpy.context.scene.objects.active = armature_object
bpy.context.scene.update()

bpy.ops.object.mode_set(mode='EDIT')

print("Creating bones")

for bone in self.bones:
    id = bone['id']
    pid = bone['parent_id']
    mtx = bone['matrix']

    joint = armature.edit_bones.new("bone_%03d" % id)
    joint.head = Vector( (0,0,0) )

    if pid != -1:
        joint.parent = armature.edit_bones[pid]
        joint.head = joint.parent.tail

    tail = Vector( (mtx[12], mtx[14], mtx[13]) )
    joint.tail = joint.head + tail

# Create Mesh

bm = bmesh.new()
mesh = bpy.data.meshes.new('Mesh')

for vertex in self.verts:
    pos = vertex['pos']
    x = pos[0]
    y = pos[1]
    z = pos[2]
    vert = bm.verts.new( (x, z, y) )

bm.verts.ensure_lookup_table()

for group in self.faces:
    for i in range(0, group['faceCount']):
        a = bm.verts[group['indices'][i * 3 + 0]['index']]
        b = bm.verts[group['indices'][i * 3 + 1]['index']]
        c = bm.verts[group['indices'][i * 3 + 2]['index']]
        face = bm.faces.new( (a, b, c) )
        face.material_index = group['materialIndex']
        # face.loop bmloop sequence to add uv

bm.to_mesh(mesh)
bm.free()

mesh_object = bpy.data.objects.new('Mesh_Object', mesh)

# For Vertex Weights, first we create a group for each bone
for i in range(0, len(self.bones)):
    mesh_object.vertex_groups.new("bone_%03d" % i)

#Loop over all of the vertices
for vertex in self.verts:
    index = vertex['index']
    indices = vertex['indices']
    weights = vertex['weights']
    mesh_object.vertex_groups[indices[0]].add([index], 1.0, "REPLACE")

bpy.ops.object.mode_set(mode='OBJECT')

mesh_object.parent = armature_object
modifier = mesh_object.modifiers.new(type='ARMATURE', name="Armature")
modifier.object = armature_object

bpy.context.scene.objects.link(mesh_object)
bpy.context.scene.objects.active = mesh_object


GPU Rendering in Cycles crashing blender (Mac) I've been experiencing loads of crashing while rendering lately, and after doing some testing I've finally isolated it to the GPU rendering. As soon as I change to that from CPU, blender goes down. This is odd, because I did a whole project (cgmastersnet Corvette course) with it on and had zero crashes. I have not updated Blender since then.

I found a thread about this on blender.org ->
https://developer.blender.org/T53945

They seem to be saying it could be an issue with MacOS High Sierra  (I am not running High Sierra, I am running Mojave 10.14.) This is my system:

Model Name: iMac
Model Identifier:   iMac14,2
Processor Name: Intel Core i5
Processor Speed:    3.2 GHz
Number of Processors:   1
Total Number of Cores:  4
L2 Cache (per Core):    256 KB
L3 Cache:   6 MB
Memory: 32 GB
Boot ROM Version:   IM142.0130.B00
SMC Version (system):   2.15f7
Graphics card: GeForce GT 755M

And this is my Blender

2.79 - 2017-9-11

I'm wondering if others have solved this issue. I'm confused on what might have changed (other than the project - which is far simpler than a corvette).

I tried removing any recent add-ons I have used in the past few weeks, saved prefs and restarted, but the crash still happens.

Not sure what other info I can provide, please let me know. For now seems I am stuck with CPU rendering, which is a bummer.

Starting with MacOS 10.14 Mojave, Apple is discontinuing support for OpenCL and OpenGL, in favor of their Metal 2 technology. Maybe this has something to do with your problems.


Names of bones in Dope Sheet have very faint text color and yellow background color I have this problem as described in the title. It might be a dumb question but is this issue common? And how to fix it? I know I can change the text color but I think that probably will be the last move.

I think you can find your culprit in here, in Blender Preferences -> Themes -> Dope Sheet.


Actuator sensor never has positive pulse While I was working with the actuator sensor I had a problem where it would not send a positive pulse to the controller even when the corresponding actuator was activated. Below is some terminal output produced by a python controller and a .blend file.

DEBUG:0: Actuator is False
DEBUG:1: Actuator is False
DEBUG:2: Actuator is False
DEBUG:3: Actuator is False
DEBUG:4: Keyboard.003 is True
DEBUG:5: Keyboard.003 is False
DEBUG:6: Keyboard.003 is True
DEBUG:7: Keyboard.003 is False
DEBUG:8: Keyboard.003 is True
DEBUG:9: Keyboard.003 is False
DEBUG:10: Actuator is False
DEBUG:11: Actuator is False
DEBUG:12: Actuator is False
DEBUG:13: Actuator is False
DEBUG:14: Actuator is False

This has been problematic. Why has this happening? Is it supposed too? How can I fix it.

There are no positive pulses on sensors. This term is a leftover from an incorrect documentation.

A sensor has two outputs:

an evaluation result (sensor.positive) witch is either positive or not positive and gets calculated once at each single frame
a trigger which marks all connected controllers to be executed on sensor execution (which happens after sensor evaluation)

The actuator sensor senses a specific actuator of the same object. It evaluates positive when the actuator is active and it evaluates not positive when the actuator is not active.

Be aware there are sensors that deactivate themselves within the same frame they got activated (such as property actuator, action actuator in property mode, motion actuator and state actuator).

Processing

t

The sensor detects the actuator is not active. As it was not active before it will evaluate not positive.

The actuator gets activated by a controller

The actuator runs and deactivates itself

t+1

The sensor detects the actuator is not active. As it was not active before (see t) it will evaluate not positive.

...

Conclusion

You can't measure that an actuator that immediately deactivates was running. You need other ways to detect this situation (e.g. by activating a property sensor that actually changes a property).


Joining two object in Blender Continuing on my previous question.  Here below is the result of my first try at joining 2 objects in one.  A sword hand grip and a pommel.

I wanted a smooth seamless result as in my reference so I decided to join the objects and then merge the vertices between the two objects together.

All went well except for the small dents you see where the joint lines where.  I know there is something wrong with the mesh.  In the examples below I joined one side where I even subdivided the Handel mesh adding a vertice to have a vertice merging point.  This produced the following result.

The second pic is the result where I have not yet joined the vertices.

I have uploaded a file as well if you could help in removing those 2 final dents.

I think I may have solved the problem by connecting the vertices you marked below to the middle one.  Here is the result. A smooth surface.

Ronin,

I've taken a look at the model, you have a simple vertice problem which is solved like this:

Select vertice 1 and then select vertice 2

Hit Alt + M and select "At Last" to merge at the second vertice

Do this for both of these, and your problem should be solved

I would also recommend deleting these faces as they are only taking up vertice count and can potentially mess up the model.

Before

After


Texture Painting issue - colour randomly showing on wrong faces I've sculpted a basic human and I'm now trying to paint it but when I paint an area sometimes the colour appears elsewhere instead of where my cursor is. The face normals are all correct and I've tried playing around with different Island Margin values for the Smart UV unwrap. Even a value of 1 doesn't help. Any other ideas? I've attached a photo of where I've painted around his eye and there are specks of color in other places.
Thanks
Amy

You need to:

Unwrap again, your islands are probably overlapping, choose the Smart UV Project option with a bit of Island Margin (0.03).
Put a bit of bleeding in the N panel > Tool > Options so that the paint correctly covers the islands.
Your image is currently 1024 pixels large, depending on what kind of shots you want to do it might be a bit too small, so maybe increase the size


How can viewport shading functionality be used to preview render result in Blender 2.80? I could make a glass cube in Blender 2.79b in Cycles Render. Also, I could use the Viewport Shading feature in Blender 2.79b to see my desired result.

But in Blender 2.8, it didn't seem to do anything like that. When I tried the same process in creating a simple glass cube in 2.8, it didn't seem to have the desired result. I mean, I tried using 2.8's Viewport Shading part and set it to Cycles in 2.8, but it doesn't seem to do anything.

2.8 is a little new to me. Does anyone understand my situation here? If so, how did you guys overcome this?

I just feel like 2.8 is not well-developed yet and that I should probably use 2.79b at this moment for now.

Switch to Cycles, Add a glass shader, press Z and set the viewport to rendered:


Blender 2.8 Evee - weird Shadow/Outline? On any other object shadows and outlines look soft and normal. Why is it that this object has these black outlines? And on the bottom there are white outlines.

You chose a wrong method to make sharp edges with the subdivision surface modifier. Don't make new edge loops near the geometry edge, use the edge creasing to earn it.
Increase the "Mean Crease" on the outer edges then dissolve the inner ones. Select them then hit "x" and select dissolve edges.


My Blender Object is "see-through" in Unity I made an object. It looks good in Blender, but if I export it into Unity, it is transparent, and I can see the parts of the Object that I should not see.

For Example
In Blender:

In Unity:

How can I solve this problem?

To see faces which face the wrong way inside Blender go to the Shading top in the top right corner of the vieport and enable Backface Culling:

This is what it looks like:

Now select the faces which are facing the wrong way, press Alt N and choose either recalculate Outside or recalculate Inside depending on what you need:


How to copy animation keyframes from one skeleton to an identical? I need to paste all of the 18 keyframes from each bone to the other skeleton which has an identical stance at frame 1.

You need to create at least one keyframe to be able to paste, so copy the pose you want on the character on the right, select all the bones of the character on the left, create one pose, then paste. Or you could also select the same action, duplicate it and delete all the keyframes you don't want.


Bridge tool creating abomination instead of connected edges Increasing number of cuts works horribly wrong. I was expecting somewhat a connected pipe or something. Is this a bug?

First, make sure that your object has scaling applied in Object Mode (Ctrl+A).

Then, use "Smoothness" to control the connection between loops.


How to roll the viewport? How do I rotate the viewport around the local (to the view port) - Z axis?

Basically what you would  get if you were to hit R with the camera selected in camera view.

You can press ⎈ Ctrl⇧ Shift ScrollWheel, or ⇧ ShiftNumpad 4 and ⇧ ShiftNumpad 6.

Currently the scrollwheel binding doesn't exist in 2.8, however you can add it back yourself. Under User Preferences > Input > 3D View > 3D View (Global), press Add New and set the operator to view3d.view_roll. Create a binding for both left and right:


How can I inspect the links between DataBlocks as a graph? For instance, how can I inspect which object instances are linked to which mesh instances in a user interface similar to the Node Editor?

While there was a feature like that up to 2.49, it was removed in blender 2.50 and has not been replaced.

While it hasn't been updated for a while blender-aid may be an option if it still works.


Exclude non-visible points from bake I'm trying to bake the window coordinates onto an object's texture. It works fine, but the coordinates are baked on all pixels of the texture, even the ones which aren't visible from the camera. Is there an easy way of excluding non-visible points from a bake, or, alternatively, of directly baking visibility from a given camera?

Blender bakes based on the objects and their surface, it has nothing to do with the camera or the visibility. If you want to exclude parts from your bake, the only quick fix I see is to duplicate your object, scale all the UVs you don't want to one px and re-bake.


A way to combine a vertex shape with a pose? I have been doing some rigging recently on a character I made, I was trying to make the fist pose and found out that the only way to having a realistic fist pose is by moving some mesh vertices around while keeping the bones at the fist pose (bone deformation almost gave me a heart attack)  is there a way to retrieve the fist pose from the pose library along with the shape key of the adjusted vertices automatically so they form a total fist shape? I dont think drivers will be of help for me, cause this involves many finger bones and the shot is not worthy of this setup.

Thank you.

Per hand Driver Approach,

Add a custom property (for example sake "prop") to the hand bones (assuming names "hand.L" and "hand.R") of your armature.  Use this property to drive your fist shape-keys.

Hunt down the hand bone as the variable target, make it a single property variable type,  with pose.bones["hand.R"]["prop"] the data_path.

Each bone custom property is saved with the pose.


I cannot add a Sqorus I tried this method.
I am able to add "Add Mesh: Extra Objects", extras pop up but there is no sqorus.
In documentation, it says that it has an "Add Sqorus" function but I am unable to find it.

Please help :).

Sqorus is a cube with a hole inside it.

Add Mesh -- Extra Objects -- Beam Builder
And apply the settings as shown below


Is there a way to do proportional editing only on specific vertices? I have split several chains of vertices into groups in an attempt to access only one chain at a time for modeling, and it seemed to work yesterday. Today I can't isolate them when I use proportional editing. Is there something I need to do differently?
Here is the situation: I am building a model of the mountain below (it's on the Moon, so there aren't any files out there with its topographic information, and only one high-resolution photo exists). I have to figure out the relative height of its ridges by judging what the lighting means. So I drag parts of the vertex chains marking the ridges up and down using proportional editing, in right ortho view. The other vertex chains I don't want to move remain visible, otherwise I can't judge their relative position, but I don't want to move them.

Edit - I see now why it sometimes works - the circle marking the edge of the proportional effect is actually a sphere. If it doesn't touch adjacent vertex chains, then it works the way I want.

You can change the proportional editing type to 'Connected' to only affect the vertices connected to the ones you are moving:

This can also be enabled with Alt+O.


Rig shoes composed of multiple parts I am relatively new too blender and finished a model i want to animate now.

The rig is working (i used rigify) and i managed to rig/parent the clothing as well (pants/tshirt).

But i am struggling to find a way to rig the shoes so they can deform with the rig, as the are composed of multiple objetcs (rivtes, laces, mesh etc)

I tried to join all the objects before parenting with auto weight and it still does not work.
The differents object behave independently (see screenshot)
I tried the data transfer method and nothing moves.

Whats would be the ideal worflow to achieve this?

Thanks in advance.

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


Boolean on two simple bmesh I'm a newbie in blender and I'm trying to play around with the boolean difference modifier.

I have two concentric disks and I want to perform the boolean differece between them. I'm using the python API.

Here is an example:

import bpy
import bmesh

c1mesh = bpy.data.meshes.new("Disk1")
c1object = bpy.data.objects.new("Disk1", c1mesh)
bpy.context.scene.objects.link(c1object)
bm = bmesh.new()
bm.from_mesh(c1mesh)
bmesh.ops.create_circle(bm, cap_ends=True, diameter=2, segments=128)
bm.to_mesh(c1mesh)
bm.free()

c2mesh = bpy.data.meshes.new("Disk2")
c2object = bpy.data.objects.new("Disk2", c2mesh)
bpy.context.scene.objects.link(c2object)
bm = bmesh.new()
bm.from_mesh(c2mesh)
bmesh.ops.create_circle(bm, cap_ends=True, diameter=1, segments=128)
bm.to_mesh(c2mesh)
bm.free()

bool = c1object.modifiers.new(type='BOOLEAN', name = "diff1")
bool.operation = 'DIFFERENCE'
bool.object = c2object
c2object.hide = True

This has no effect (besides hiding the second disk). When I try to apply the modifier from the gui I get no result (besides some weird lines over the disk 1).

I guess that the problem is just my poor initial knowledge of blender (and general 3D modelling).

Thanks in advance.

Hope this helps:

import bpy

# initialize the variables to work with, in this case two selected objects, in yours c1mesh and c2mesh
first_object = bpy.context.selected_objects[0]
second_object = bpy.context.selected_objects[1]

# add the modifier and change settings
first_object.modifiers.new(name = "Boolean", type = 'BOOLEAN')
first_object.modifiers.get("Boolean").operation = "DIFFERENCE"
first_object.modifiers.get("Boolean").object = second_object

# just cosmetic hiding of second object so you can instantly see the result
second_object.hide_viewport = True


How can I create a single image texture from several different, overlapping image textures? I have a bit of a specialized problem to solve.

I have a mesh model, created from laser scanning data. Also from that data are 10 different equirectangular images of the scene being scanned. Here's an example of one:

I've erased some tripods and added a transparent buffer at the bottom to make the image properly equirectangular. I also already know the UV maps to align my scanner mesh with all of the different images.

The trouble is that when I try to add all of these images to the material for my mesh, Blender slows down and eventually crashes well before I add all 10. I think it has to do with the fact that each one is a very large image texture (8168x4085 pixels). Also, probably due to the many different UV maps, the render of the mesh looks pretty awful. Here's an example using 4 image textures:

Clearly, there's something wrong, but I haven't any idea what it would be.

I think a good solution to these problems may be to bake a new texture that contains all the colour information of my ten textures, but I don't know how I would do that without loading all 10 textures at once. I'd need to do it sequentially, one after the other. I'd also like to consider the alpha values in each texture, to accommodate for the fact that some portions of the textures are transparent.

Any advice on this would be helpful, I'm really stuck here.

I would create low res versions of the image textures, then bring them all into Blender and apply them to the object material with the various UV maps. (If you bake out the combined low res image you'll have a starting point for after the next step when you have all your high res texture bakes.)

Then bring in the high res image textures (one at a time) and bake out the high res UV texture as applied to the image.

Once you've baked out all the applied high res textures, you should be able to combine them all in an external image editor (alphas included if baked out properly). You can use the previous combined low res bake as a reference.

Then you'll have a single high res image texture. If Blender still cannot handle working with this single high res texture image, you'll have to lower the resolution until Blender can work with it. It should be fine on shots that are not too close to the object in your scene.


Cycles outline objects I want to add the outline effect in all, not only border.

How and can do this in Cycles fast?

I've searched for many pages, but all the methods did not work because I did something wrong.

Consider using freestyle.  Please search freestyle. There are many video tutorials on freestyle. Then show your work.  You may want to use freestyle with Blender Render to reduce time during your learning experience.  You can use the compositor to combine lines with a regular rendered image.

Also you can use the compositor put lines around objects all by itself.  The line can be a glow.  This is possible because Blender can reveal contrast between a transparent background or object id and the surrounding image.


Rendering objects in the same scene with different sampling? I'm rendering a crystal like object and another with a single planar texture, the first one needs to be rendered at high sampling and the second one doesnt, yet i need to render them both together, is it possible to give an object a number/quantity for sampling while for the others another number/quantity?

Put both objects on separate render layers
Override the number of samples:


Bursted bubble like details on material I'm trying to generate a material somewhat similar to what I got on a picture I took, just to develop material/texture creation skills, but I cannot get the details that appear to be tiny busted bubbles on the real photo.

I'm guessing this should be achievable using voronoi textures, but I cannot get even close to it. Can I get some tips to help me acheive that look here?

You were pretty close.

I've used Voronoi for the bubbles and mixed it with some Noise.
First Color Ramps are for tweaking "contrast" of the textures and the last one is to give proper colours to the bubbles.


UV Mapping to Imported svg Problems I'm having a very difficult time properly texturing a tile floor mesh that I created from an imported SVG file.

There are several points in the mesh where there appears to be a seam where there shouldn't be one. I've created seams along the perimeter of the mesh and it appears correct in the image/uv editor so I don't know why this is happening. I'm relatively new to Blender so I'm hoping there is an easy solution I'm not aware of.

When the .svg was imported the mesh was a complete disaster so I deleted all edges aside from the perimeter and created quads manually by selecting 4 vertices and making a face "F". But for some reason selecting the edge loops of the perimeter only selects a small portion of the edges. Not sure if that is related to my problem.

You need to unwrap UVs again.

Select the top faces, got to top orthogonal view, press U to unwrap and select project form view.


How to change hair location? How can I make the hair particles show on right side instead of the left without going onto Particle Edit?

I want the exact same hair amount and style but on the opposite side.

Or you can use your head object directly.

Select faces, go to Data Properties > add Vertex Group > Assign
Add Particle system and under Vertex Groups > Density > choose created Group
(now particle will grouw from this red faces)

To let them grow only on one side, move Particle modifier above Mirror modifier in stack


Mesh Analysis does not display anything I'm trying to use the mesh analysis in the properties panel to inspect my model for the thickness, I want the visual tools rather than the plain selection from the Print3D add-on. However when I check it on, it does nothing. Am I missing something here?

Thanks, Matthew

I use 2.69. I resolved my problem of the Mesh Analysis not functioning when I deleted or, less drastic, switched off the Mirror Modifier. ie, clicked the Eye icon to off.


Toggle button to occlude geometry missing I cannot see this button anymore, even though I am in edit mode.

Is it possible to hide or delete it accidentally? I need this button back pretty badly, since I dont want to select nearby geometry that would normally be hidden.

Do you mean this button?

It only shows up when you are in Solid View or higher. If you are in wireframe mode, it will not show up because it cannot compute the occlusion.


Linking multiple pivot points with object constraints This seems quite simple but I just can't work it out. I essentially need to make the image attached function as a single object, so that if I grab either end and move or rotate it the entire structure moves whilst pivoting in the appropriate places (the small circles). I'm thinking that maybe empties are required but I just can't get them to link to each other correctly using object constraints.

Any help would be much appreciated. Many thanks.

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


Fake user in UV Editor. What is it for? I wonder what is the Fake User in UV Editor for. Since I know you can't restore the render result after closing Blender (without saving). Any ideas?

Why is it there?

It's basically because of Object Oriented Programming. In OOP, for matter of coding efficiency, you tend to create sub-classes of classes to re-use some or all of their properties. Since Image Textures and the Render Result slot derive from the same parent class, they inherit all those properties. The fake user property is already part of the parent, so there is actually no way for the child class NOT to have it.

Keep in mind that you're not setting a fake user on the render result itself, but on the datablock displaying it. Think of it as a container. This container inherits from ID, which holds the use_fake_user property.

How could it make sense?

Well, there is a case where you can make use of it. The Render Result slot isn't just the pixels, it's a whole datablock with properties attatched. One of those properties is a Render Slot name per slot. If you set the fake user, names you give to render slots will be preserved upon file save. In the example below, I created a render slot named Demo. When saving and reloading, the named slot is kept. If you don't set a fake user, you lose that data.


Play multiple videos in EEVEE starting at different time I have to planes with different video files in each one. I want to play the videos in EEVEE in both planes but starting a different time.

Now, with "play animation" both videos start at same time, how can play them independently under EEVEE?.

Change "Offset" in the image input. To have one show black before starting, use the Mix RGB node with black as one of the inputs, and animate the factor to change from 1 to 0 (or vice versa) right when the video starts.


Lighting preview does not work in Blender 2.78? It seems that the OpenGL light previews are not available in the material preview mode (neither cycles nor internal edit: only in cycles) with the most recent blender version.
Was this intended or is it a glitch on my side? I really miss this feature.

edit: here is an example of what I Mean:

It is not currently supported, it's a known limitation of the current system.

Cycles OpenGL material preview has vey limited functionality, until recently (before 2.78) it didn't even have proper texture preview

It is currently planned to be substancially improved for Blender 2.8 project with a new viewport rendering system supporting PBR and improved performance


Particle Emitter - Emit Hair from Skin Modifier Faces I'm modelling a Hibiscus flower, a reference can be seen below.

The issue is that I'm trying to use a particle emitter to emit the anthers from the filament (nontechnical terms: the yellow stuff in the top photo). I understand how to use collections for the emitter objects, but the objects are only being emitted straight up/down from the source mesh.

I believe the problem is originating from the modifiers and source mesh. As shown below, the source mesh is just a couple lines, which I then used the Skin and Subsurf modifiers to create the stalk.

So in short: is there any way to have the particle emitter be used after the modifiers (so that the particles can be emitted from the surface) without applying the modifiers?

Yes there is a way, you said you used a skin and subdivision modifier.

Then the following should work:

Make sure to add the particle system at the end of the modifier stack
In the particle settings look for the "Source" Tab
Select "Faces" should be default, and check the "Use Modifier Stack" option.

That should look like this:

You can use a vertex group to limit which edge(between 2 vertices) you want to grow the hair.

Deactivate the modifiers
Go in Edit Mode
Select the 2 vertices that limit the area of the later hair growth
Create the vertex group and assigning it with the weight of 1.0.
Go in Object Mode
Reactivate all modifiers
Go in the particle tab and under "Vertex Groups" select the new created group in the density slot
Smile

Happy blending:)


Blender is running too slow First it longs about 20 min only showing the terminal window.
Then when blender starts, if i want to import a file, or save a file, it lasts another ~20 mins showing "blender (no responde)"(Blender is not responding) before doing what I asked.

My OS is Windows 7 (64 bit) and i'm running Blender in Spanish. I first downloaded the installer and installed it, then uninstalled and then downloaded the ZIP version. In both versions the result is the same.

Not long ago since I format the pc. And when i first installed Blender (about a month ago) it ran ok.

This monday was the first time i noticed that behavior...

(sorry for my english :) )

8 cores (4+4HT). No antivirus installed.
No process that consumes more than 1% of the CPU.
The CPU is at 1%-7% of use.
Anyway, now i think this is not Blender's failure because now Firefox ( ^^U ) is doing something like that.
I'm going to reinstall Windows today.
Thank you anyway.

(sorry for my english again)


Debugging Memory Usage I'm writing a script that imports an FBX with an animation, and exports frames of the animation as OBJ files. However, I noticed that regardless of how I delete my objects, Blender's memory usage increases every time I run the script. I looked at the memory statistics and this is what I got:

total memory len: 299.712 MB
peak memory len: 301.169 MB
slop memory len: 11.298 MB
ITEMS TOTAL-MiB AVERAGE-KiB TYPE
1203 ( 146.366   124.588) Chunk buffer
45252 ( 145.037     3.282) Data from AC
1109 (   2.189     2.022) BLI_Mempool Chunk
4633 (   1.128     0.249) PropertyRNA
3151 (   0.601     0.195) StructRNA
 1 (   0.532   544.750) TaskScheduler task threads
3417 (   0.417     0.125) IDProperty array dup
2542 (   0.371     0.149) dupli_mapalloc
1987 (   0.349     0.180) keymap entry
1888 (   0.346     0.188) operatortype
2017 (   0.246     0.125) IDProperty group

I understand that "Chunk buffer" refers to the memory used by the Undo function, but what is "Data from AC"? This is the memory usage just after opening the file, and there are currently no objects in the scene.

EDIT: Here is my delete function:

def clearScene():
for i in range(20):
    bpy.data.scenes['Scene'].layers[i] = True
print("All layers selected")
bpy.ops.object.select_all(action='SELECT')
print("All objects selected")

bpy.ops.object.delete(use_global=True)
print("All objects deleted")
bpy_data = [bpy.data.actions,
         bpy.data.armatures,
         bpy.data.brushes,
         bpy.data.cache_files,
         bpy.data.cameras,
         bpy.data.curves,
         bpy.data.fonts,
         bpy.data.grease_pencil,
         bpy.data.groups,
         bpy.data.images,
         bpy.data.lamps,
         bpy.data.lattices,
         bpy.data.libraries,
         bpy.data.linestyles,
         bpy.data.masks,
         bpy.data.materials,
         bpy.data.meshes,
         bpy.data.metaballs,
         bpy.data.movieclips,
         bpy.data.node_groups,
         bpy.data.objects,
         bpy.data.paint_curves,
         bpy.data.palettes,
         bpy.data.particles,
         bpy.data.rna_type,
         bpy.data.scenes,
         bpy.data.screens,
         bpy.data.shape_keys,
         bpy.data.sounds,
         bpy.data.speakers,
         bpy.data.texts,
         bpy.data.textures,
         bpy.data.worlds]

for bpy_data_iter in bpy_data:
    for data in bpy_data_iter:
        bpy_data_iter.remove(data)

I realized an error in my delete function, but now with these last three lines, I get an error saying the BlendData data type is not iterable. Is there a better way to remove all data?

Okay, figured it out. Thanks to batFINGER for the link to readfile.c

I thought I was deleting actions, but it turns out a few things in bpy_data shouldn't have been in there, and were causing errors that led to Actions NOT being deleted. Once I cut the bpy_data list down to what it is below, everything deleted properly and I am now left with about 10M of memory usage. Here is the working delete function:

def clearScene():
   for i in range(20):
       bpy.data.scenes['Scene'].layers[i] = True
   print("All layers selected")
   bpy.ops.object.select_all(action='SELECT')
   print("All objects selected")
   bpy_data = [bpy.data.actions,
         bpy.data.armatures,
         bpy.data.brushes,
         bpy.data.cameras,
         bpy.data.materials,
         bpy.data.meshes,
         bpy.data.objects,
         bpy.data.shape_keys,
         bpy.data.textures]

   for bpy_data_iter in bpy_data:
      for data in bpy_data_iter:
          bpy_data_iter.remove(data)

   bpy.ops.wm.save_mainfile()


Where is the redo function in Blender? I have had several occasions where I went astray with my Blender work and had to undo my work or start over.  When I undid my work today that took several hours, I went too far.  Oops!  Now I have to redo that work.

I come to Blender from CAD, specifically AutoCAD and Inventor.  Both of those packages have a redo function in them.

I would really like to see one of you smart programmers work on that.  Or, tell me that it is available and I just don't see it.

There is!:

Ctrl+Z is Undo

Ctrl+Shift+Z is Redo.

And Ctrl+Alt+Z is to show and select Undo History.


Maximizing Render Field of View in Interior Scene I'm new to Blender and love most things about it, but the camera is hard to work with, especially in tightly enclosed interior settings.

When I've positioned the camera where I want it and bring up the camera view (Ctrl + Alt + 0), it only captures a small portion (maybe 50 percent) of what's in the viewport. When I try resizing the window, it doesn't go all the way to the edges, so the only way to get everything in the shot is to zoom out... but that's often not an option with an interior scene, because I end up going through a wall. Changing the focal length distorts the image.

Are there any other options to solve this problem? In most other 3d apps I've used, you can simply resize the render window to fit what you're seeing, and even go beyond the field of view. Is there anything like this in Blender? Are there some camera constraints I can turn off for this?

You can change the sensor size in the camera settings. Or you can change the focal length. But what about distortion for a wide lens - it's physics, you cannot cheat it. If you want, you can use orthographic, or panoramic camera (the latter seems to work in cycles only). If you want an impossible camera shot, you also can make some of your walls to be transparent for camera rays from outside, and make the shot through the wall with the lens focal length you want.