how do I bake an animated sky box using cycles? I would like to turn a specific blender scene into an animated sky box I can use in other animations.

This old tutorial is the top google search result for "blender sky box", but it's for an old version of blender, and some of the buttons it references no longer exist.

There are several tutorials on how to set the sky box if you already have an image, but I have yet to find a modern HOWTO that lays out how to create the sky box image from a scene.  How do I accomplish this?  Keep in mind I want it to be animated, so I'll need to bake a hundred frames or so.

In newer builds of blender, there is a third option in the camera tab for Panoramic. In cycles there is an option for Equirectangular mapping. The output render can then be used as any other sky dome would be used.

Here are the settings:


Sapling tree addon - improper leaves I am using Blender 2.78c and trying to make a tree. When I decide the size, shape, variation of my tree, I add the leaves. Everything looks fine, but when I add the leaf material, the leaves get detached from the branch and some leaves go through the branch.

Did I miss something or the Sapling addon is not polished?

When you created your leaf from a plane, the planes origin default to dead center. Sapling assumes your leaf's origins is at the base of the stem. Since your origin is in the center, you'll get the misplaced leaves shown in your image.
To fix this.
- Put Focus on plane/Leaf
- Set "Pivot Point" (it's found at the bottom of your blender screen" to  "3D Cursor"
- Click your cursor to bottom of the leaf stalk
- On left side of screen, select "Set Origin" >> "Origin to 3D Cursor".

That should take care of your problem.


Why do faces appear transparent when exported to a game engine? I created a low poly tree, and it's what I see in the editor:

But, in my 3D game engine (Godot Engine), this is how the tree looks:

(On the left, this is an icosphere created with Blender).

I don't know what part I missed, or what I done wrong for having this result with the 3D engine.

I started with a simple cube, cutting it and extruded it for this result, and I created manually near all the faces (except for the trunk). Then I exported the object in the Wavefront format (.obj).

Is my method wrong? Need I to recreate the whole object? How can I fix it?

Did you try switching the normals?
If not, select the entire object whilst in Edit Mode. And press Crtl + N


How to get rid of subtle white pixel border on Eevee How can i get rid of white pixels borders on Eevee?
These are just appearing on the preview and render image.
The imported image sequence does not have these little white pixels on it.
If i move the threshold parameter (third image) it works like a fix, but what is the correct way to import/export the image to skip these white pixels?

I suggest you using openEXR instead of png. go on your image texture node and try to change linear to closest or to cubic
Then try putting color ramp in between and choose constant interpolation.
btw if you want to make a cirlce procedurally, here is the tree:


How to decrease perspective distortion of vertical lines in a camera? I took a photo of a church and processed it with fSpy. It gave me some camera, but unfortunately, I can't match any Blender shapes with an image.
Apparently vertical lines on a photo remain vertical, while Blender's are evidently converging somewhere in zenith.

Why? Is it possible to make camera to distort lines less? Which parameters I can play?

Wide lenses tend to distort things a bit, it easier to make parallel lines point towards a vanishing point. Using longer lenses will help keeping parallel lines parallel. It is evident that the lens used in the original picture is longer than the one used for the reconstruction in blender.
But changing the lens is not the problem (that is very easy in blender just select the camera and change the lens), the problem is determining what lens to use, so that reconstructed geometry, matches the photo correctly.
It is not a trivial issue, or will take you a lot of trial and error to find the correct values, as the size of objects, and distance to the camera, is only valid for a single point in space, given the perspective of a particular lens.
Because of the complexity of those many different variables, it is preferable to do find the lens value and camera placement in fSpy. That is exactly what that program is designed to do. It uses the very same idea of vanishing points to calculate the lens used, and the camera placement in 3D space.
To help you better, you show a screen capture of the fspy project and how you found the lens size there. Don't be stingy with the information
How can I recreate geometry using a photograph?
How to find the best place to set up the vanishing point axes in fSpy?


parent with autmatic weights giving wierd reults i cant animate that well and i ran across a pre-made animation that i want to apply to my model, it was made for this specific model to the the bones and the vertex groups have the same corresponding names. i just can get the armature with the key framed data to apply to the model.
the model comes with its own skeleton (but its an identical one) and since the model comes in parts it has a skeleton for each part e.g hands, torso, head, ect. but they are all the exact same skeleton

the way that i go about it is i import the meshes and delete the skeletons.

i then import the fbx of the armature with the animation data and it shows that it indeed has key frames for the animations and if i play it i can see the bones moving but that all.

i then set the scale of the armature to 1 as for some reason it imports at a .01 scale so i set that to zero.

i then apply the scale to both the group of meshes and the armature separately by using the old ctrl+a.

i select all and then select the armature and parent with automatic weights and it moves the meshes but it give a weird result.

i know im doing something wrong but im too no at this to know what, any thoughts?

This is a "think outside the box" kind of approach, but consider giving it a try, just to see what happens. No guarantees, of course (and truly, I'm sorry that I wasn't able to address the specifics of your problem more directly). Consider taking the source file, and NOT exporting anything. Start with that file, and instead of trying to extract anything from it, consider using it as is, BUT import your preferred model INTO that file. Once your model is in the source file, with the source file model selected, go into the object data tab in the Properties Panel and change the mesh data block to the one from your newly imported mesh. It MAY replace the source file's mesh with your desired mesh. If it does, then you would essentially have what you want, without doing a lot of work. You could then hide or delete your imported version of the mesh. Please let me know if this works. If not, maybe someone could tell us both why, and how to do what I'm suggesting properly.


How to clean up a mesh in order to export a freestyle vector for a 3D engraved lamp? I'm trying to create meshes for a 3D illusion lamp that is made through laser engraving acrylic. Like the one on the below picture.

As I'm new to 3D modelling and I mostly do architecture stuff or furniture, I really struggle with organic shapes, which are most of the requests that I get now. As an example, I downloaded this model and as you can see below, the mesh is way too dense for my purpose.

I tried to decimate the mesh but the result I get is not what I'm after as it ends up being triangles rather than a tidy mesh like the shark above.

Is there a way to get a similar result cleaning up the mesh? Or is the only way modelling it from the scratch (in which case I would have to give up as I can't model such a complex shape).
All the freestyle  vector export I can handle. It's the mesh that's my problem. I would greatly appreciate any suggestion.
Thanks!

Go to the Object Data Properties tab, and under Remesh, set the mode to Quad and click Quadriflow Remesh

Set the target number of faces (I set 20,000 - eventually you will lose an undesired amount of mesh resolution, so don't go too low) and click the Ok button.

The result (at 20,000) looks like this:

The mesh looks even better at 10,000, but you will begin to get some artefacts if you get too low, so I suggest somewhere between 12,000 and 20,000 for your final result.


How to label vertex/line within mesh I'm exporting to my own format, and there's a few special vertices (not necessarily part of any triangles) but should move with the other vertices when the bones are posed and otherwise behave as part of the mesh. For example a few such vertices around the palm of the hand would keep track of where held items would be anchored to the mesh, or even a few unattached points within the torso representing the location of various internal organs. Probably one between the eyes where the camera is mounted, or for testing what is within it's field of vision. That sort of thing.

My problem is 1) how to uniquely identify certain vertices, preferably with a string of text, and 2) how to identify these vertices within the python export script.

The ability to name lines or triangles would be even better, but naming vertices would be sufficient.

The only method I can think of is adding specially named bones and treating them as vertices in the export script.

Is there a cleaner way?

Vertices can be added to named groups. This information is available to the export script.


How do I extrude only a small portion of a face? I have a cylinder and I want to extrude only a small portion of one of its faces inwards. How would I do this?

Let's assume you want the extrude a small portion of the plan(a).
plan(a) is 1m*1m . We will extrude 0.5m*0.5m know as plan(b):

Select plan(a),
(1)use the extrude fonction but do not extrude yet

(2)change to scale fonction and now you can extrude. You have now the plan(b) inside the plan(a). With both plan perfectily aligned.

(3)Now you can extrude plan(b)

In the picture attached the you can see the face and profile view so it will be more clear.


can I animate colors on materials the way falloffs are animated? I'm thinking of a large matrix of splines that should have a delayed animation on their color.

Press "I" while your mouse is over the color in your material settings. It will add a keyframe. Then go into the Graph Editor to edit the curve:


What is relation between edit_bone roll and and pose.bone rotation_quaternion? I have two slightly different rigs (two armatures from different sources) and trying to transfer rotations between corresponding bones, from one armature to another (retarget current pose at some degree). Everything is fine except one thing - some bones has different rolls in edit mode, and simple cloning of rotation_quaternion shifts final positions.

The quiestion is: How i can account for roll difference, when applying rotation_quaternion from donor bone to target one? I don`t wish to reset roll on target bones, instead i with to recalculate quaternion for different roll,
so target roll will stay the same, but quaternion will account for the difference instead. Imho this is possible, since rotation_quaternion is able to completely define bone rotation, but... how? How i can translate quaternion from one bone-local coordinate system to another?

I already tryed to calculate something like this: "donor rotation_quaternion" - "donor roll" + "target roll" to get "target rotation_quaternion". For example i tryed to create "donor roll" - "target roll" rotation matrix and apply it to rotate quaternion around target bone Z axis (to undo roll difference), but no luck.

So... How roll is applyed to final bone orientation? Is there the way to remove/undo it from rotation_quaternion?

Any help really appreciated

I managed to overcome roll differences by resetting roll on all bones to zero without affect final pose (much). Procedure is little hackish but it works:

create armature clone in same place as donor one
add rotation constraint in WORLD coordinates on each bone of clone
reset roll to 0 on all edit bones of clone (bones will do thier best to stay intact due constraint)
execute "Apply Visual Transform to Pose" - bpy.ops.pose.visual_transform_apply() - on clone bones to flush contraints into real bone properties
remember clone rotation_quaternions and delete clone
set roll=0 and rotation_quaternion to remembered values on original armature.

That is all. After that we have almost the same pose, but all roll values on each bone are zeroed out

Code: https://gist.github.com/IPv6/0209f6ff4e013c575ca69ef0fbc0fe14


Cannot assign material to an object or object face I'm a newbie, I'm using Blender 2.80 on Devuan Ceres Linux.
I'd like to create a sign object, which is super simple: an extruded cube makes up the pole section and another extruded cube is the sign portion. I try to assign material as I see it on various tutorials, but pressing the Assign button has no effect whatsoever.

I select a mesh face in Edit mode
On the material panel the right material is selected
I press Assign -> this should result in the material assigned to the face but nothing happens. Accordingly a render shows blacked out objects on the scene.

Video of the issue

The project file


How can I create a custom button from copied python text of completed actions such as selecting multiple objects? In Maya, a while ago, I had a character rig with many grips that I needed to select for one action, like keying, or moving the object. I opened the python script window, then I began selecting all of the grips I wanted. I copied the script that was created after selecting each grip. Then I copied it into the script editor and created a custom shelf button. Now I had a button that allowed me to select about 20-30 grips, and move, or key them all at once. (The button selected them all.)

In blender I have been trying to figure this out. I have a simple hand rig. I need to constantly move the hand, and key it in. In order to do this, I must select all visible grips, pan out of camera view in order to find the ones off screen, select them, then move the hand, and key in each grip by selecting them individually, and pressing I followed by O.

I was wondering if there is a way for me to create a button that would select all 6 grips on the hand, and that's it. This way I could select them by pressing the custom button, saving me tons of time. Also if there was a way to create another button that would select, and key all six grips as well. I had one of those in Maya. Just wondering if Blender had any similar capabilities.

In blender actions are performed by operators. We can use python to create custom operators that perform (almost?) any custom task that we want. An operator can be run by attaching it to a keyboard shortcut, a button within the UI or by searching for the operator by name in the search menu available by pressing space.

Different parts of blender's interface are separated into panels - which are the UI blocks that can be expanded/collapsed. We can create custom panels to display what we want and specify where we want the panel to be displayed, such as object properties, 3DView toolshelf or properties region...

By defining a custom operator and/or a custom panel you can customize any task as well as provide a custom interface to access the tasks. While you can run a python script to add these it is usually preferred to create an addon that defines each component which can be cleanly enabled and disabled. There is a tutorial in blender's python API docs on creating an addon as well as example templates within blender's text editor.

It is also common to create a custom panel that is specific to a rig, often buttons are used to show/hide parts of the rig as well as control IK/FK etc. One example is the rigify addon included with blender, it creates the following panels for the generated rig, as it is specific to the rig it uses a script that gets run when the blend file containing the rig is opened.


Select vertices by their indices (by vertex id) I want to select vertices by their indices (by vertex id)
Like a python script,so that i can write the vertex id into it, and run the script,and it would automatically select those vertices

there is already an answer (python script) ,but it only works with one vertex
when i tried with more than 2 vertices,it does not work :
How Could I Select a vertex by its ID?

I have modified the code from this answer to solve the problem, where I have replaced  if vert.index == index: to if vert.index in indices: where indices= [1, 2, ...]

example :

import bpy
import bmesh

indices = [1, 3, 4, 7, 8]

obj = bpy.context.object
me = obj.data
bm = bmesh.from_edit_mesh(me)

vertices= [e for e in bm.verts]
oa = bpy.context.active_object

for vert in vertices:
    if vert.index in indices:
        vert.select = True
    else:
        vert.select = False

bmesh.update_edit_mesh(me, True)


Half a Diffuse texture comes out as white in render Tried rendering out my model but half of the ground renders out as white. All the texture is, is a green diffuse texture. In the Rendered View its normal but when I actually render its half green half white.

Rendered View

Render

.Blend File

If anyone has any solution to this, it would really help. Thanks.

There was a hidden layer that was over it. I just ALt + H and it popped up


Workflow: Cloth simulation without disabling armature The typical workflow for cloth is to have areas that are attached to the body be Pinned, and influenced by an armature limited to the Pinned group. The rest of the garment would not be influenced by the armature. An example of this would be a skirt or baggy pants with a pinned waistband, but the rest unpinned and uninfluenced by the armature.

If you have the full garment rigged to the armature and run the cloth as well, then you get the movements of the cloth AND the armature adding together, which makes problems and is not accurate.

This presents the limitation that you cannot put the character into any poses without running the simulation to get them there. This means that before the start of every animation, you need to add extra frames to get the character from their rest pose into the pose for the start of the animation. It would be nice if you could pose the character with the armature into the start pose (granted this may deform the cloth in bad ways, but it often won't matter) and then run the rest of the animation from that start point. But to do this right now, you need to apply the armature as a shapekey or something and then disable it because if you leave the armature active during the rest of the animation, then you'll mess up the cloth sim as described above.

Is there a way around this issue? Is it possible to have the cloth sim start from the posed mesh, but ignore the armature for the rest of the animation (except in pinned areas)? Or some other workaround?

Option A: Cache and export to Alembic. But still have to wait 50+ frames for the collision to happen. There´s no instant "anything" on 3D. Never fall for that trap.

Option B: To my understanding that "pre-simulation" until the cloth is calculated and "rest" to the collisions, HAS ALWAYS BEEN LIKE SO IN ANY 3D APPLICATION. Yes, you need to let some previous frames to calculate, rest, and then get the character to pose. EVEN MARVELOUS DESIGNER works like that. So comparing it to Blender, you´ll have to wait to frame 75 or so, until the cloth "rests" to the collision.


Strange seams on a normal map I have a problem with a normal map.

There are 2 models: low-poly and high-poly. I've baked a normalmap from highpoly to lowpoly model, and this normal map looks perfect. But when I use it (a Normal Map node of Cycles render), I have these seams.

The smooth shading is enabled both in low-poly and high-poly model. As I've said before, the normal map looks good, there are no any seams on it.

Some guys say, that it's impossible to fix it on Cycles render. So, what do you think? Can I solve this problem?

P.S. Triangulation didn't help. Subsurf can make the problem less noticeable, but not fix it fully.

Your UV islands are too close together. Give each UV island enough space for the baking process to expand the colors beyond UV islands bounds.


Screw modifier to individual vertices I am beginner to blender

I have only two vertices in 3d viewport of blender
I need to apply screw modifier to only one vertex without modifying the other

Please help me out in this regard

Thanks in advance

You need only one vertex for it. Select this vertex. In the Screw modifier tab make an empty your AxisOb, select an axis and set the remaining params as required. By the way, you can apply this modifier to any object, such as a  circle.


AMD RX550 (4GB) GPU - OpenCL not available in Cycles Rendering Compute I recently purchased a new GPU, and AMD RX550 (4GB), but in Blender OpenCL does not appear as a choice.  Would this have to do with the fact that AMDGPU-PRO drivers include AMD's OpenCL?  I don't think xserv is running with the public OpenCL - How do I test that?

Specs:

Processor: AMD FX on a Gigabyte 970A MB with 16 GB of Ram (GPU not integrated)

GPU: AMD XFX Radeon RX550 (Polaris 12)

OS: Ubuntu 16.04

Blender: 2.78c

Initially I installed version 2.76b (2.76.b+dfsg0-3build1) from the Ubuntu Software Center.  I would see similar to the above screenshot only I would also see "CPU" as a choice.

The bummer is that I haven't seen or been able to utilize my GPU for rendering.

After reading a bunch of threads on this problem, I thought maybe it was my setup not working in that version (some had success with installing a direct package from the Blender.org website).

So, I downloaded and unpacked 2.78c from the website.  When I ran blender it looks like the above screenshot. When it renders, it renders using the CPU (obviously as default), because I can see with my System Monitor the CPUs being pegged.

I'm still bummed though, because I can't use my GPU to render.  Any ideas on how to get my system and blender to communicate? (that's my hypothesis...)

I (re-)downloaded and installed the latest drivers from AMD: AMDGPU-PRO  Everything appears to have installed correctly - AMDGPU-PRO, OpenCL, etc...

However after install, I still have no choices

Also, lspci | grep VGA returns Advanced Micro Devices, Inc. [AMD/ATI] Device 699f (rev c7) - the name is a bit different, but it should be available, yes??

Any ideas on next steps?

Thanks for any help!
--Dave

I know this isn't the answer you're looking for (it's not one I'm happy with either), but, at the moment—even two months after you first asked…

You either need a different video card or a different OS.

OpenCL support is currently broken in the official AMD drivers for the RX 550 specifically {1}. This is still true as of the 17.30-465504 AMDGPU-PRO drivers and Ubuntu 16.04.3 (which they finally support).

While the card supports OpenCL natively and works in Windows, it is unclear when fully working (i.e. including OpenCL) Linux drivers will be released.

A comment on the AMD Community boards suggests that there is a working internal build that has been tested against the RX 550 as of August 11th, 2017. When this will be publicly released is unclear as of now. In addition to the evidence I've linked to supporting this conclusion, I've personally confirmed that the issue is specific to the RX 550 by dropping an RX 580 into a Ubuntu 16.04.3 system with identical drivers without any issue: the RX 580 shows up and works fine with OpenCL, the RX 550 continues to not be seen as an OpenCL device.

I've also personally tried the oibaf open source drivers, but have not been able to get OpenCL working on the RX 550 with them. This weekend I will give that another try using Ubuntu Zesty instead of the 16.04 LTS, now that I have an RX 580 to help act as a control comparison case.

I would suggest posting in the above linked thread or contacting AMD directly, referencing the linked comment, and asking for the internal build that is working for OpenCL on the RX 550. Otherwise the only available options seem to be either waiting for them to be released publicly, getting a different graphics card, or not using Linux with the RX 550 for now.

{1}: Supporting evidence (in addition to the thread linked in the second paragraph):

https://community.amd.com/thread/217469
https://github.com/ethereum-mining/ethminer/issues/88
https://community.amd.com/message/2804598


How to make things stay on animated character How do you make it so something like a pair of glasses stays on a rigged character model in cycles? Whenever I move my character I want the glasses to stay on them. I have tried parenting the object but it just makes it disappear and do a bunch of weird stuff like that.

You have to parent the glasses to the Head Bone. So then, when the animated character moves, the glasses move with the head.
So first, select the Glasses, then  Shift+RMBto select the armature. Then go into Pose mode of the armature and select only the head bone. After that, press Ctrl+P to parent the Object to Selected Bone


Bevel object: disproportionate I use a bevel object to contour the shape of a bezier curve - why
is the bevel object disproportionate compared to the final shape?

When scaling your bezier curve, you wont affect the bevel object. If you want to control the shape of your curve geometry you can scale the bevel object.


Can I render to a custom output file format? I have a custom file format that can contain (among other data) videos and still images, along with per-frame and global metadata (like e.g. the camera transformation matrix per frame or the camera FOV).

This custom file format is implemented behind a C API, which in turn is wrapped in a Python class.

Is there a way to implement a custom render output format, preferably using the python environment (in other words, are these formats available in the python environment somehow)?

The only other alternative I see is forking the Blender source code and implementing it straight in C++.

Note: I've already looked at using handlers (http://www.blender.org/api/blender_python_api_2_61_0/bpy.app.handlers.html) and that seems like a possible alternate course.

Unfortunately that requires an operator which I try to avoid, and I also prefer to see my file format next to the PNGs and AVI's in the output format list.

I don't think that's possible, without adding this to the source and compile it. As workaround you can try to create a custom render engine class and create property to add a path to your application like this:

The following script creates a discription scene file (text) for every frame you've selected in the scene and uses custom application to render it:

import bpy
import mathutils
from mathutils import Vector

# LOGIC
class CustomRenderEngine(bpy.types.RenderEngine):

    # These three members are used by blender to set up the
    # RenderEngine; define its internal name, visible name and capabilities.
    bl_idname = 'custom_renderer'
    bl_label = 'Application Name'
    bl_use_preview = True

    def formatNumbers(self, number):
        return '%0*d' % (4, number)

    def get_allObjectsInSceneByType(self, type_string):
        objects = []
        for objs in bpy.data.objects: # searches for type in the selection
            if (objs.type == type_string):
                if objs.hide == True:
                    pass
                else:
                    objects.append(objs)
        return objects

    # Return Object Transformations
    def get_objectLocation(self, object):
        return bpy.data.objects[object.name].location

    def get_objectRotation(self, object):
        return bpy.data.objects[object.name].rotation_euler

    def get_objectScale(self, object):
        return bpy.data.objects[object.name].scale

    # Return Geo Type
    def get_geoType(self, object):
        verticies = []
        for vertex in object.data.vertices:
            verticies.append(vertex.co)
        if len(verticies) == 8:
            return "CUBE"
        else:
            return "SPHERE"

    # Return verticies of Object
    def get_objectVerts(self, object):
        verticies = []
        for vertex in object.data.vertices:
            verticies.append(vertex.co)
            #print (vertex.co)
        return verticies

    # Return Geo Center
    def get_GeometryCenter(self,obj):

        sumWCoord = [0,0,0]
        numbVert = 0
        if obj.type == 'MESH':
            for vert in obj.data.vertices:
                wmtx = obj.matrix_world
                worldCoord = vert.co * wmtx
                sumWCoord[0] += worldCoord[0]
                sumWCoord[1] += worldCoord[1]
                sumWCoord[2] += worldCoord[2]
                numbVert += 1
            sumWCoord[0] = sumWCoord[0]/numbVert
            sumWCoord[1] = sumWCoord[1]/numbVert
            sumWCoord[2] = sumWCoord[2]/numbVert
        return sumWCoord

    # Return max vert distance
    def max_vertDistance(self, ob):

        verts = ob.data.vertices
        centre = Vector([0,0,0])
        for vert in verts:
            centre += vert.co

        centre = centre / len(verts)
        distanceFromCentre = 0.0

        for vert in verts:
            vecFromCentre = vert.co - centre
            vertDistanceFromCentre = vecFromCentre.length
            if vertDistanceFromCentre > distanceFromCentre:
                distanceFromCentre = vertDistanceFromCentre
                vert1 = vert

        distance = 0.0
        for vert in verts:
            vec = vert.co - vert1.co
            vertsDistance = vec.length
            if vertsDistance > distance:
                distance = vertsDistance
                vert2 = vert

        #return vert1, vert2, distance
        print ("vert:", vert1.co)
        return vert1.co, vert2.co

    # Return max vert distance NEW
    def max_vertDistance2(self, ob):

        verts = ob.data.vertices
        centre = Vector([0,0,0])
        for vert in verts:
            centre += vert.co

        centre = centre / len(verts)
        distanceFromCentre = 0.0

        for vert in verts:
            vecFromCentre = vert.co - centre
            vertDistanceFromCentre = vecFromCentre.length
            if vertDistanceFromCentre > distanceFromCentre:
                distanceFromCentre = vertDistanceFromCentre
                vert1 = vert

        distance = 0.0
        for vert in verts:
            vec = vert.co - vert1.co
            vertsDistance = vec.length
            if vertsDistance > distance:
                distance = vertsDistance
                vert2 = vert

        twoVerts = [vert1, vert2]

        newTwo = []
        wm = ob.matrix_world
        for v in twoVerts:
            world = wm * v.co
            #print(world)
            newTwo.append(world)

        #return vert1.co, vert2.co
        return newTwo

    # Calculate Raduis of sphere
    def get_radiusSphere(self, obj):
        return (obj.dimensions[0] / 2)

    # Return Materials of Geo
    def get_material(self, object):

        mat_diff = bpy.data.objects[object.name].active_material.diffuse_color
        mat_diff_int = bpy.data.objects[object.name].active_material.diffuse_intensity
        mat_spec = bpy.data.objects[object.name].active_material.specular_color
        mat_spec_int = bpy.data.objects[object.name].active_material.specular_intensity
        mat_amb = bpy.data.worlds["World"].ambient_color
        mat_amb_int = bpy.data.worlds["World"].custom.world_amount

        return mat_diff, mat_diff_int, mat_spec, mat_spec_int, mat_amb_int

    def diff_dimensions(self, dimensions):
        dimList = [round(dimensions.x, 3), round(dimensions.y, 3), round(dimensions.z, 3)]
        return [i for i in dimList if dimList.count(i) > 1]

    # Return Material List
    def get_materialList(self):
        materialNames = []
        for material in bpy.data.materials:
            materialNames.append(material.name)
        return materialNames

    def app_materials(self):
        string = ""

        amb_r = bpy.context.scene.world.ambient_color.r
        amb_g = bpy.context.scene.world.ambient_color.g
        amb_b = bpy.context.scene.world.ambient_color.b
        ambient_int = bpy.context.scene.world.custom.world_amount

        for i in bpy.data.materials:
            diff_r = bpy.data.materials[i.name].diffuse_color.r
            diff_g = bpy.data.materials[i.name].diffuse_color.g
            diff_b = bpy.data.materials[i.name].diffuse_color.b
            diff_int = bpy.data.materials[i.name].diffuse_intensity

            spec_r = bpy.data.materials[i.name].specular_color.r
            spec_b = bpy.data.materials[i.name].specular_color.b
            spec_g = bpy.data.materials[i.name].specular_color.g
            spec_int = bpy.data.materials[i.name].specular_intensity
            spec_hardness = bpy.data.materials[i.name].specular_hardness

            string += ("define material ") + i.name + " "

            # ambient
            string += str(amb_r * ambient_int)[:5] + " "
            string += str(amb_b * ambient_int)[:5] + " "
            string += str(amb_g * ambient_int)[:5] + " "

            # diffuse
            string += str(diff_r * diff_int)[:5] + " "
            string += str(diff_g * diff_int)[:5] + " "
            string += str(diff_b * diff_int)[:5] + " "

            # specular
            string += str(spec_r * spec_int)[:5] + " "
            string += str(spec_g * spec_int)[:5] + " "
            string += str(spec_b* spec_int)[:5] + " "
            string += str(spec_hardness)

            string += "\n"

        return string

    # This is the only method called by blender, in this example
    # we use it to detect preview rendering and call the implementation
    # in another method.
    def render(self, scene):
        scale = scene.render.resolution_percentage / 100.0
        self.size_x = int(scene.render.resolution_x * scale)
        self.size_y = int(scene.render.resolution_y * scale)

        if scene.name == 'preview':
            self.render_preview(scene)
        else:
            self.render_scene(scene)

    # In this example, we fill the preview renders with a flat green color.
    def render_preview(self, scene):
        pixel_count = self.size_x * self.size_y

        # The framebuffer is defined as a list of pixels, each pixel
        # itself being a list of R,G,B,A values
        green_rect = [[0.0, 1.0, 0.0, 1.0]] * pixel_count

        # Here we write the pixel values to the RenderResult
        result = self.begin_result(0, 0, self.size_x, self.size_y)
        layer = result.layers[0]
        layer.rect = green_rect
        self.end_result(result)

    # In this example, we fill the full renders with a flat blue color.
    def render_scene(self, scene):
        pixel_count = self.size_x * self.size_y

        materialstring = self.app_materials()

        # collect geometry
        geo = self.get_allObjectsInSceneByType("MESH")
        geostring = ""
        transformstring = ""

        for item in geo:

            if (self.get_geoType(item) == "CUBE"):

                #print ("Location:", self.get_objectLocation(item))
                #print ("CENTER IS:", self.get_GeometryCenter(item))
                #print ("dimensions:", item.dimensions)
                #self.get_objectVerts(item)

                geostring += "define shape box "
                geostring += item.name + " "

                # first point
                geostring += str(self.max_vertDistance2(item)[0][0])[:5] + " "
                geostring += str(self.max_vertDistance2(item)[0][3])[:5] + " "
                geostring += str(self.max_vertDistance2(item)[0][4])[:5] + " "

                # second point
                geostring += str(self.max_vertDistance2(item)[1][0])[:5] + " "
                geostring += str(self.max_vertDistance2(item)[1][5])[:5] + " "
                geostring += str(self.max_vertDistance2(item)[1][6])[:5] + " "

                # material
                geostring += " " + bpy.data.objects[item.name].active_material.name
                geostring += "\n"

            else:

                geostring += "define shape sphere "
                geostring += item.name + " "

                # center
                geostring += str(self.get_objectLocation(item)[0])[:5] + " "
                geostring += str(self.get_objectLocation(item)[2])[:5] + " "
                geostring += str(self.get_objectLocation(item)[1])[:5] + " "

                # radius
                geostring += str(self.get_radiusSphere(item))[:5]

                geostring += " " + bpy.data.objects[item.name].active_material.name
                geostring += "\n"

                # check for transformation
                dims = bpy.data.objects[item.name].dimensions
                #print (round(dims.x, 3), round(dims.y, 3), round(dims.z, 3))
                #print (self.diff_dimensions(dims))

                if len(self.diff_dimensions(dims)) < 3:
                    #print ("Transformation found!", item.name)
                    scle = bpy.data.objects[item.name].scale
                    transformstring += "transform "
                    transformstring += item.name + " scale " + str(round(scle.x,3)) + " " + str(round(scle.z,3)) + " " + str(round(scle.y,3)) + "\n"
                    transformstring += "transform " + item.name + " translate 0 0 0\n"
                '''
                print (scene.custom.app_path)
                print (scene.custom.scene_name)
                print (bpy.data.worlds["World"].ambient_color)
                print (bpy.context.scene.world.ambient_color)
                print (self.get_materialList())
                '''

        # collect lamps
        lamps = self.get_allObjectsInSceneByType("LAMP")
        lampstring = ""

        amb_r = bpy.context.scene.world.ambient_color.r
        amb_g = bpy.context.scene.world.ambient_color.g
        amb_b = bpy.context.scene.world.ambient_color.b

        for i in lamps:
            lampstring += "define light " + i.name + " "

            # position
            lampstring += str(self.get_objectLocation(i)[0])[:5] + " "
            lampstring += str(self.get_objectLocation(i)[2])[:5] + " "
            lampstring += str(self.get_objectLocation(i)[1])[:5] + " "

            # light ambient
            lampstring += str(amb_r)[:5] + " "
            lampstring += str(amb_g)[:5] + " "
            lampstring += str(amb_b)[:5] + " "

            # light diffuse
            lamp_energy = bpy.data.lamps[i.name].energy
            lampstring += str(bpy.data.lamps[i.name].color[0] * lamp_energy)[:5] + " "
            lampstring += str(bpy.data.lamps[i.name].color[1] * lamp_energy)[:5] + " "
            lampstring += str(bpy.data.lamps[i.name].color[2] * lamp_energy)[:5] + " "

            lampstring += "\n"

            #print ("Lamp energy:", bpy.data.lamps[i.name].energy)
            #print ("Lamp color:", bpy.data.lamps[i.name].color)
            #print ("Lamp location:", self.get_objectLocation(i))

        # get active camera

        obj_camera = bpy.context.scene.camera
        cameraName = obj_camera.name
        camerastring = "define camera " + cameraName + " "
        camerastring += str(bpy.data.cameras[cameraName].lens)[:5] + " "
        #camerastring += "35" + " "
        camerastring += str(self.get_objectLocation(obj_camera)[0])[:5] + " "
        camerastring += str(self.get_objectLocation(obj_camera)[2])[:5] + " "
        camerastring += str(self.get_objectLocation(obj_camera)[1])[:5] + " "

        # calculate up and direction vector
        cam = bpy.data.objects[obj_camera.name]
        #up = cam.matrix_world * Vector((0.0, 1.0, 0.0))
        #up = cam.matrix_world.to_3x3() * Vector((0.0, 1.0, 0.0))

        up = cam.matrix_world.to_quaternion() * Vector((0.0, 1.0, 0.0))
        #up = Vector((0.0, 1.0, 0.0))
        print ("UPVECTOR:", up)

        #cam_direction = cam.matrix_world * Vector((0.0, 0.0, -1.0))
        #cam_direction = cam.matrix_world.to_3x3() * Vector((0.0, 0.0, -1.0))

        cam_direction = cam.matrix_world.to_quaternion() * Vector((0.0, -1.0, -1.0))

        #cam_direction = Vector((0.0, 0.0, -1.0))
        #cam_direction.normalize()
        #up.normalize()

        camerastring += str(cam_direction[0])[:5] + " "
        camerastring += str(cam_direction[1])[:5] + " "
        camerastring += str(cam_direction[2])[:5] + " "

        camerastring += str(up[0])[:5] + " "
        camerastring += str(up[1])[:5] + " "
        camerastring += str(up[2])[:5] + " "

        camerastring += "\n"

        #camerastring = "define camera auge 60.0 1.0 1.0 3 0 -0.1 -1.0 0 1 0\n"

        # background color

        bgColor = bpy.data.worlds["World"].ambient_color
        bgColorstring = "define background-color " + str(bgColor[0]) + " " + str(bgColor[1]) + " " + str(bgColor[2]) + "\n"

        # ------------------------------------------------------------------------
        # render settings
        # ------------------------------------------------------------------------

        renderer = bpy.path.abspath(scene.custom.app_path)
        frameNumber = bpy.data.scenes["Scene"].frame_current

        scenename = scene.custom.scene_name
        scale = scene.render.resolution_percentage / 100.0
        size_x = int(scene.render.resolution_x * scale)
        size_y = int(scene.render.resolution_y * scale)

        if not scenename:
            scenename = "AppScene"

        outfile_ppm = bpy.data.scenes["Scene"].render.filepath + scenename + "_" + str(self.formatNumbers(frameNumber)) + ".ppm"
        outfile_custom = bpy.data.scenes["Scene"].render.filepath + scenename + "_" + str(self.formatNumbers(frameNumber)) + ".sdf"

        rendersettingstring = "render " + obj_camera.name + " "
        rendersettingstring += outfile_ppm + " "
        rendersettingstring += str(size_x) + " "
        rendersettingstring += str(size_y) + " "
        rendersettingstring += "\n"

        file_content = bgColorstring + materialstring + geostring + transformstring + lampstring + camerastring + rendersettingstring

        # write custom file
        f = open(outfile_custom,'w')
        f.write(file_content)
        f.close()

        import signal
        import subprocess, time

        # for single image
        single_frame = subprocess.call([renderer, outfile_sdf])

        # for animation
        '''
        app_animation = subprocess.Popen([renderer, outfile_sdf])
        print ('app_animation\'s pid = ',app_animation.pid)
        time.sleep(170)
        app_animation.terminate()
        '''
        print (materialstring + geostring + lampstring + camerastring + rendersettingstring)

        # The framebuffer is defined as a list of pixels, each pixel
        # itself being a list of R,G,B,A values
        blue_rect = [[0.0, 0.0, 1.0, 1.0]] * pixel_count

        # Here we write the pixel values to the RenderResult
        result = self.begin_result(0, 0, self.size_x, self.size_y)
        layer = result.layers[0]
        layer.rect = blue_rect
        self.end_result(result)

# Register the RenderEngine
bpy.utils.register_class(CustomRenderEngine)

# ======================================================================================
# UI
# ======================================================================================

from bpy.types import (AddonPreferences,
                       PropertyGroup,
                       Operator,
                       )
from bpy.props import (StringProperty,
                       BoolProperty,
                       IntProperty,
                       FloatProperty,
                       FloatVectorProperty,
                       EnumProperty,
                       PointerProperty,
                       )

# -----------------------------------------------------------------------------------
# Render properties
# example: https://github.com/meta-androcto/blenderpython/blob/master/scripts/archive/game_gamekit/ui.py
# -----------------------------------------------------------------------------------

from bl_ui import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('custom_renderer')
properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('custom_renderer')
#properties_render.RENDER_PT_antialiasing.COMPAT_ENGINES.add('custom_renderer')
#properties_render.RENDER_PT_shading.COMPAT_ENGINES.add('custom_renderer')
properties_render.RENDER_PT_output.COMPAT_ENGINES.add('custom_renderer')
del properties_render

class RenderButtonsPanel():
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "render"
    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here

    @classmethod
    def poll(cls, context):
        rd = context.scene.render
        return (rd.use_game_engine is False) and (rd.engine in cls.COMPAT_ENGINES)

class RenderCustomSettingsScene(PropertyGroup):

    deletefiles_enable = BoolProperty(
            name="Delete files",
            description="Delete files after rendering.",
            default=True)
    scene_name = StringProperty(
            name="Scene Name",
            description="Name of sdf scene to create.",
            maxlen=1024)
    app_path = StringProperty(
            name="Export scene path",
            # description="Path to directory where the exported scene is created"
            description="Path to Custom Engine",
            maxlen=1024, subtype="FILE_PATH")

class RENDER_PT_custom_export_settings(RenderButtonsPanel, bpy.types.Panel):
    bl_label = "Render Connection"
    COMPAT_ENGINES = {'custom_renderer'}

    def draw_header(self, context):
        self.layout.label(icon='CONSOLE')
    def draw(self, context):
        layout = self.layout
        scene = context.scene

        row = layout.row()
        row.column().prop(scene.custom, "app_path", text="Path to App")
        row = layout.row()
        row.column().prop(scene.custom, "scene_name", text="Scene Name")
        #row = layout.row()
        #row.column().prop(scene.custom, "deletefiles_enable", text="Delete files after Rendering")

# -----------------------------------------------------------------------------------
# Material properties
# -----------------------------------------------------------------------------------

from bl_ui import properties_material
properties_material.MATERIAL_PT_context_material.COMPAT_ENGINES.add('custom_renderer')
properties_material.MATERIAL_PT_diffuse.COMPAT_ENGINES.add('custom_renderer')
#properties_material.MATERIAL_PT_preview.COMPAT_ENGINES.add('custom_renderer')
#properties_material.MATERIAL_PT_shading.COMPAT_ENGINES.add('custom_renderer')
#properties_material.MATERIAL_PT_shadow.COMPAT_ENGINES.add('custom_renderer')
properties_material.MATERIAL_PT_specular.COMPAT_ENGINES.add('custom_renderer')
#properties_material.MATERIAL_PT_transp.COMPAT_ENGINES.add('custom_renderer')
del properties_material

class MaterialButtonsPanel():
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "material"
    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here

    @classmethod
    def poll(cls, context):
        mat = context.material
        rd = context.scene.render
        return mat and (rd.use_game_engine is False) and (rd.engine in cls.COMPAT_ENGINES)

class RenderCustomSettingsMaterial(PropertyGroup):

    test_enable = BoolProperty(
        name="Enable",
        description="test enabler",
        default=False)

    test_amount = FloatProperty(
        name="amount",
        description="test",
        min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=0.25)

# -----------------------------------------------------------------------------------
# Camera properties
# -----------------------------------------------------------------------------------

from bl_ui import properties_data_camera
properties_data_camera.DATA_PT_lens.COMPAT_ENGINES.add('custom_renderer')
del properties_data_camera

# -----------------------------------------------------------------------------------
# Lamp properties
# -----------------------------------------------------------------------------------

from bl_ui import properties_data_lamp
properties_data_lamp.DATA_PT_lamp.COMPAT_ENGINES.add('custom_renderer')
properties_data_lamp.DATA_PT_preview.COMPAT_ENGINES.add('custom_renderer')
del properties_data_lamp

# -----------------------------------------------------------------------------------
# World properties
# -----------------------------------------------------------------------------------

from bl_ui import properties_world
class WorldButtonsPanel():
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "world"
    # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here

    @classmethod
    def poll(cls, context):
        wld = context.world
        rd = context.scene.render
        return wld and (rd.use_game_engine is False) and (rd.engine in cls.COMPAT_ENGINES)

class RenderCustomSettingsWorld(PropertyGroup):

    world_amount = FloatProperty(
        name="amount",
        description="test",
        min=0.0, max=1.0, soft_min=0.01, soft_max=1.0, default=0.25)

class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel):
    bl_label = "World"
    COMPAT_ENGINES = {'custom_renderer'}

    def draw(self, context):
        layout = self.layout
        wld = context.world

        row = layout.row()
        row.column().prop(wld, "ambient_color")
        #row = layout.row()
        #row.column().prop(wld, "world_amount")
        row = layout.row()
        row.column().prop(wld.custom, "world_amount", slider=True)

#bpy.utils.register_class(WORLD_PT_world)

# ======================================================================================
# Register
# ======================================================================================

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.custom = PointerProperty(type=RenderCustomSettingsScene)
    #bpy.types.Material.custom = PointerProperty(type=RenderCustomSettingsMaterial)
    bpy.types.World.custom = PointerProperty(type=RenderCustomSettingsWorld)

def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Scene.custom
    del bpy.types.Material.custom
    del bpy.types.World.custom
    del bpy.types.Scene.custom

if __name__ == "__main__":
    register()

Note: The script was written a while ago, it is a bit messy but I hope you get the idea.

For a simpler approach you can also extend the render panel. Best practice is to take a look into the templates that are shipped with blender:

To define your custom file output you can create a custom file property like this:

app_path = StringProperty(
            name="Export files to:",
            description=""
            description="Path",
            maxlen=1024, subtype="DIR_PATH")

or use scn.render.filepath. For this case here you can find a working example: Is it possible to render only keyframes from Dope-sheet?


Make materials colors show on textured solid? In solid mode with textured solid checked, A model will show the material color until any face on the model is "attached to an image" (have the face selected, and open an image in the UV image editor). The model will then turn white. Is there any way to revert this? I'm using internal.

Here we are in textured solid mode. The green cube has a green material. I selected the green cube, enter edit mode, select a face, then change the image in the UV image editor. A UV map that I never created appears, and the cube  turns white:

How can I make it green again while still showing the texture on the checkered cube

Consider Delete the UV Map
Add a new UV Map if desired
Assuming the first UV Map was a quick and easy inspection
Please note that the Blender User can have multiple 3D View type windows.  Not all windows are simultaneously affected by this inconvenience.


Why doesn't extruding from some edges make a face while usually it does? The first picture is when I extruded after selecting two vertices and it gave me an additional face, three edges and two vertices as you can see.
But the second picture is when I extruded after selecting (some)two vertices and it gave me no faces and only additional two edges.

It seems like if I select one already extruded vertex and one that I didn't, the second scenario happens.
Why? And how do I make a new face in the latter case?

Can you confirm that you select the connected vertices rather than a duplicated one?
You can use indices indicator to show the vertices. Than you should check which vertex you choose to extrude. If you select two separated vertices, they won't automatically connected with face and edge since it is impossible and unusual.

You might accidentally exit the extrude mode with RMB, it will create the vertices in the same place. Causing extra vertices that user might not noticed.


My Blender duplicates the render I'm new in Blender. I have a problem. When I hit F12 to render my project with Cycles Render, the Blender duplicates the image. I think it will increases my render time.

So I just don't want this happen. Anyone can help? Thanks for the reply

To disable tiled render display, use N button in Render window to show properties panel, then in Display section disable Repeat. If the image is offscreen use F button to center it.


What is the significance of this traceback? I tried to use the add-ons to export elements from a Blender file to the ~.dxf format, and after attempting the export, I tried to re-import the ~.dxf file to make certain that it was working properly. It was apparently was not. Looking at the console window, the export appeared to work fine, but the re-import failed, giving me this traceback:

[

I know what the traceback is, but I don't know how to understand what it means.

I still don't know how to interpret the traceback, but I found out what triggered it. I exported the elements of the original ~.blend file to ~.dxf format one by one, with all but one of them exporting successfully. The problem triggering the failure of the import turned out to be in one portion of export, where there was one duplicate vertex, which I removed by using the "remove doubles" special menu option. After removing the stray vertex, the formerly misbehaving element exported normally, with no error and no traceback.


Mesh is deformation is mirroring very strangely, how do I fix this? I am rigging a crossbow to be exported to Unity3D. It is currently just a model of a bow, and I am trying to perfect the rig as much as possible before I model the stock. I have been trying to fix a problem where the bow deforms the opposite way it should along the mirror axis, even though I have already applied the mirror modifier. It looks (mostly) fine before deforming,
but when it deforms, it is absolutely horrible when it crosses over the y-axis
I don't think this has much to do with it, but I am using inverse kinematics, TrackTo, rigify, and, as stated earlier, a mirror modifier, but it was applied earlier. In the first picture, you can see that only one half is rigged, and the other should be mirroring it, I have checked vertex weights, bone constraints, all of the modifiers, and everything I currently know that can go wrong, but have found no indication of what could be happening. I am fairly new to armatures and rigging, so I am sorry if this has a very simple fix that I am not aware of. If anyone knows how to fix this, I would appreciate it if you could answer.

Thanks in advance.

You'll need to create a symmetrical armature first, rig it properly, and then assign proper weights to the mesh. What you get is partially logical. Think about it: The vertices of the right hand side of your crossbow are parented to the left bone. That bone, when it deforms, rotates counter-clockwise. Since the vertices have no idea yet that they should behave like they were mirrored, they just inherit this rotation, and everything becomes distorted. Without having your model in hand, it's impossible to judge what's causing the middle section to deform in such a strange manner. But in your screenshot, some bones under the large deformation bone are visible, so I'd suggest looking there.

To tell the right hand side to behave mirrored, they need bones which behave like so. So your rig should in top view look like this:

I've created the left hand side, setup the constraints in Pose Mode, and when I was done I mirrored the deformation bones using the Cursor as the mirroring center. To mirror, select the bones in Edit Mode, Shift + D to duplicate, RMB click to Cancel translation. Then, Ctrl + M to activate mirroring, and type in the axis:

The weighting for this example is easier, as you can take advantage of the mirror modifier, which creates the right half for you automatically. Important: You need to stick to a naming convention for this to work. Name your bones Bone.L, Bone002.L for the left side, and Bone.R, Bone001.R for the right side, so Blender knows its way. There is a nice tool in the Specials Menu, keybinding W, in Edit Mode, which helps you in this:

Paint your weights now before you add a mirror modifier, make sure there are EMPTY Bone.R, Bone001.R vertex groups present, and then add and apply the mirror modifier afterwards. Alternatively, you can of course use the Automatic Weights Binding and fix the weights later.

Here is an example Blend file:

Use it like this:


2.79 Noob question: copying and creating materials in Cycles As a beginner to Blender I wanted to practice working with materials.
I made a cube and created two materials for the cube, one for the sides, one for top and bottom.
I repeated this twice (making cube, creating materials) and got annoyed with

adding new material
selecting nodes output
deleting DiffuseBDSF and substituting with Principle
adding two Image Textures and assigning to them a texture and a normal map

So I thought to speed up things a little and decided to copy an existing material, with the goal of just deleting the OLD images linked to the Image Texture and substituting the NEW images.
And since all of my materials have the very similar name structure of material.png and material_n.png for texture and normal respectively, I had the even better idea to just type the new name over the old one in the Image Texture. Yes, I was too lazy to scroll through my 50+ materials.
(In every other dialog window, I can quick-jump while pressing T if looking for a file starting with T. Not in Blender?)

So, that way I learned that you can retype the image name in Image Texture, but obviously you are just changing a kind of "internal name", because the referenced file will still be the same. True?

The correct way to "recycle" a material may be:

click on "new", choose any existing material
click on "number of users" to make an unlinked copy
by clicking on the "open" tab in Image Texture choose your new texture.

Am I right in this? If not, what IS the correct way when you are trying to keep your build-up nodes and just want to change the linked files?

(And why do I now have a cube which insists of showing me the normal map in Texture View, even with having the correct texture linked to "Base Color" in the Principled BDSF?)

Any help would be very much appreciated

It seems that when typing the name it is referencing the previous same image with new name (not referencing external image).
So to refer external image you have to press open image and select the image.
Actually it very simple, Because blender had thumbnails display function, search filter function and many filters to show only specific formats and also options to show sub directory levels. So play with them they can be useful in many occasions.

All refereed images ( or old materials) can be selected (by browse button in left side ) till you close blender file. After closing blender file, Blender flushes all unused images (/unused materials have zero before name) and keep references to only used images(/materials). If you want to refer unused images later press fake user button. This is ubiquitous concept in all, like materials, particle systems, world materials, where ever you can browse.

You can also pack image ( image is saved with-in .blend file, it facilitates to use file in other than your system). Thus material is renderable even if original image destination is changed. But it increases blend file size and it is redundant (copies of same image). I hope these is help full for beginners.


2.9 render Animation Rendering only some of the animation I've made an animation, but when I go to render out an image sequence or video file all I get is SOME of my animation. So for example one arm is animating and the other is not animating in the render. My viewport animation works just fine though.

Welp. I'm an idiot.... turns out I was loading blender 2.8 and when the file was last saved working in 2.9. My render is working normally now in 2.9


Get texture image dpi I'm trying to get the dpi of the material textures via scripting, but I could not find any information on this.

You can assume that my UV-mapping is un-stretched, each polygon will be covered by the same amount of pixels in relation to the polygon area.

Do I need to use external library?

DPI of a texture/image will depend on how many pixels are mapped onto a polygon and the real-world area of that polygon. Now your question is more exact (homogeneous uv - no stretching), some parts of this answer aren't directed at you but hope to describe the notion of DPI and that it won't always be a single figure per model.

The following only works if your image-texture is square. width px is the same as height px

factors that decide DPI

You can use the same texture on large polygons and on small polygons, you can also scale the uv coordinates so a small polygon could contain many pixels (effectively high 'dpi'). The DPI therefor is not a property of the texture, but of each polygon and uv mapping.

If you have no such stretching going on and each uvmapped face is covered by the same amount of pixels relative to its real-world area, then you can calculate the DPI once.

Variable DPI vs Homogeneous DPI

The effective DPI of a texture is often variable, but not always. Indeed for certain kinds of texturing it is desirable to have no stretching at all. In either scenario the formula is the same, but when you speak of homogeneous uv-mapping you only need to calculate it once.

Finding UV coordinates

Code to help with this can be found in TextEditor -> Templates -> Python -> Operator Mesh UV. Below i've stripped out the template to make sure it just prints the 2d coordinates of each .uv (a 2D .uv corresponds to a 3D vertex.co). This would give you the 2d coordinate in the UVmap of each vertex per polygon:

import bpy
import bmesh

obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)

uv_layer = bm.loops.layers.uv.verify()
bm.faces.layers.tex.verify()

for f in bm.faces:
    for l in f.loops:
        luv = l[uv_layer]
        print(luv.uv)

Here's the formula used to calculate the area given a list of coordinates, here's the same formula stated in Python. From the Area you can extract a hypothetical side length.

import math

import bpy
import bmesh
from mathutils import Vector

def texture_dpi(polygon_area, uv_area, image_dim):
    """
    polygon_area:   in (meters or BU)
    uv_area:        in ratio (0..1)
    image_dim:      either width or height of image, this assumes
                    square images anyway, else none of this makes sense
    """

    l1 = math.sqrt(polygon_area)
    l2 = math.sqrt(uv_area)

    # assume the units are BU or meter.
    inches = l1 * 39.3701
    pixels = int(l2 * image_dim)
    return int(pixels / inches)

def calc_area_from_2d_vectorlist(v):
    # http://www.mathopenref.com/coordpolygonarea.html
    sum = 0
    n = len(v)
    for i in range(n - 1):
        sum += ((v[i].x * v[i + 1].y) - (v[i].y * v[i + 1].x))
    sum += ((v[n - 1].x * v[0].y) - (v[n - 1].y * v[0].x))
    return abs(sum / 2)

def get_bm_from_edit_object(image_name):
    obj = bpy.context.edit_object
    me = obj.data
    bm = bmesh.from_edit_mesh(me)

    uv_layer = bm.loops.layers.uv.verify()
    bm.faces.layers.tex.verify()

    totals = []
    for f in bm.faces:
        vl = [l[uv_layer].uv for l in f.loops]
        fa = calc_area_from_2d_vectorlist(vl)  # 2d area of uv loop
        totals.append([f.calc_area(), fa])     # 2d area of face (local size)
        break  # if homogeneous  , else comment it out.

    image_dim = bpy.data.images[image_name].size[0]
    for polygon_area, uv_area in totals:
        dpi = texture_dpi(polygon_area, uv_area, image_dim)
        print(dpi)

get_bm_from_edit_object('some_texture.png')


Blender 2.8 - Cycles - Math (Sign) I have worked on plenty of Math operations within Cycles without the need to use GLSL.  The only operation/function so far that I Can't figure out however, is Sign.

Basically, this operation will take in a value x, and return:
if (x < 0): x = -1
if (x > 0): x = 1
if (x = 0): x = 0

I want to do this using existing cycles Nodes from 2.8 without having to download extensions/add-ons.  Any help would be Greatly Appreciated!

Edit:
This is the closest I can come up with, but I need the math worked out.

I'm a little unsure how Blender handles a Vec3 to a Scalar.  The idea behind this is that the top to values of the Greater/Less Than's are inputs, Using the 2 Middle Mixes as booleans, the final Mix will hold the values needed.
Please correct me if I am wrong or if there is a better way.

Your node tree almost worked, it just required a different approach at the end. Let me show you a working example here:

for clarity's sake I have added value nodes to give the inputs a caption. There is the Test Value, which is basically the number you input, and a Tolerance, which circumvents the problem that there is no real a == b node. So if the value you feed is inbetween +Tolerance and -Tolerance, the node tree outputs 0.

Besides that, the only change is the Multiply and Add node at the end of the tree. Why that? Let's walk through a few sample values:

TestValue = 5.333
GreatherThan will be +1
LessThan will be 0
-> Multiply will be 0 too
-> Add will do 1 + 0 = 1, which is what you want

Let's change TestValue to something negative:

TestValue = -2
GreatherThan will be 0
LessThan will be +1
-> Multiply will be -1, as 1 * -1 = -1
-> Add will do 0 + -1 = -1, which is what you want

And finally, something lower than Tolerance:

TestValue = 0.000001
GreatherThan will be 0
LessThan will be 0
-> Multiply will be 0 too
-> Add will do 0 + 0 = 0, which is what you want

To make this a bit more visible, I have added this node setup at the end of the tree:

The Add and `Multiply basically bring the -1 to +1 range to a 0 to 1 range. The Color Ramp has three slots, if the input value is 0, the output is red, if input is 0.5, output is green, and if input is 1, output is blue. See it in action here:

Here is the file for testing:


How to Change the Colors in Info Menu I've been able to use the User Preferences, Themes to change colors in my Blender inferface but I can't find the place to change the menu text color in the info bar.

I need to change "File," "Render," "Window" etc.. so that I can see them more easily. Perhaps to white or perhaps by changing the background to a lighter color.

Thank you for your help!

Sabi

It is in the "pulldown" part:

But it will affect all the pull down menus.


Extrude Manifold making extra vertices I want to extrude this face using Extrude Manifold tool

but when i do that , its leave the vertices that on the bottom face ;

so is there any thing to do to dissolve the vertices directly without any further to do?

An easy way to get rid of a random vertex in the middle of an edge.
Select the offending vert and double tap G to do a vertex slide.  Move it all the way over to where it is in the same position as one of the vertices on the end.  Enable x-ray view and box select both of the vertices and do a Mesh -> Merge -> By Distance.
Extrude Manifold doesn't automatically generate good topology, unfortunately.  You have several faces here with more than 4 verts even getting rid of those two extra vertices.


Precisely move the 3D cursor The 3D cursor can be moved by simply LMB  clicking anywhere in the viewport. Is there a faster and easier way to position the 3D cursor?

An updated 2.8 answer can be found here

In both edit mode and object mode; press N to open the Properties. Scroll down to the 3D cursor. There are three number fields one each for the X, Y, and Z axes.
For finer control use Alt or Ctrl while dragging the mouse. Also see the Manual.

Note the coordinates are always in Global, how the transform orientation is set makes no difference.


How to get precision when rotating / positioning textures? I am modeling a coin where heads and tails are the same image, and imported an image for the heads/tails faces.
I created a new Emission material for the faces, then gave it an Image texture and assigned it.

However, my image is slightly rotated:

So in the UV/Image Editor window, I rotated the face to align it vertically (R), I also scaled it a bit:

However, now that I would like to apply the same rotation / scaling values to the other face of the coin, I cannot find the rotation values that I just created anywhere.
Do these values get applied automatically? Are they written in one of the panels? And what about the scaling info?

I couldn't find a similar question. This is the opposite of what I want to do, since I am rotating in the Image editor for visual comfort, not in a Mapping node (therefore, even if I add Mapping Nodes, rotating the texture in the Image editor doesn't change the Mapping Nodes value).

Edit1:
For conveniance I build a Group-Node that does the centering, and also allows to plug in Rot_Vectors.
This was done by combining the help from:
    Cycles mapping node - rotation pivot
    How to add a socket for mapping node?
    Can I make a custom node from a group and have that available in other projects?

This is how the node is used:

This is the inside of the node, with the Translate and Rotate node from gandalf3:

And here an optional Driver Setup to controll your rotation with an gameobject in the scene. Maby you could build yourselfe a GameObject that Visualizes your Rotation in the Viewport if you want to go further.

Edit_0:
If there are no other reasons you dont want to use a mapping node i would recomend the material view for visual comfort.

The reason you dont get any rotation value in a panel as you get in Object-Mode is that there are no objects, just verts in the u-v-coordinate system those are represented as vector2 -> u and v. Its the same in Edit-Mode, there the vers are also just points as Vector3. Rotation can be done as an operation but to store those blender oughta be node-based and also produce temporary objects of specifiec groups of verts that had been rotated.

I would recomend you to unwrap you upper and lower face together so they are exacly ontop each other and "rotated" the same and use a mapping node in Material View.

maby an option: orthogonal upsidedown camera to your coin and "Project from View" as unrwaping so your uv is axis-aligned


Exact meaning of Free Bake In the Blender Manual "Free Bake" is defined as

  Mark the baked cache as temporary. The data will still exist, but will
  be removed with the next object modification and frame change. This
  button is only available when the physics system has been baked.

What is exactly meant with Object Modification and Frame Change ?

It basically means your bake has been cleared, but will remain visible until you change a parameter of the simulation and then change the frame and it will clear away the cached bake data.

For example, if you have baked a cloth simulation, and you free the bake, you've set it up to be cleared.  Once you change a parameter like the cloth stiffness, and then change the frame, all the baked data is then cleared from the cache.  However, if you've chosen to bake to disk, the bake information is still stored on the hard drive and can be relinked.


Certain animations not recording I'm banging my head up against the proverbial brick wall here. I'm doing an animation which is a spoof on a 1960s kids show from UK called Camberwick Green, this starts with a six sided box which rotates for a short time, and then the top slides open to make way for one of the shows characters to slide up through the top. The first pic is of the first frame which is how the box is first shown with the top closed.

The second pic shows, in my own description, how the top opens. the white dots being the pivot points for each individual triangle and the purple arrows which i hope will convey to you the direction/rotation of the triangles so it should open up iris fashion.

The third pic shows the end result of the top sliding open.

Which result I'm pleased with as far as it goes, but the issue arises when i scrub back to the first frame, it shows the box as in the third pic with the lids open rather than closed like it should. when i play the animation, the main box rotates as expected but with the lids totally open all the way through, thereby missing the opening altogether. Here are some details of how i animated: I first inserted a keyframe on frame one, then rotated the whole box -18 degrees at 12 frame intervals for my keyframes. When i hit keyframe 240, i started rotating the triangles -10 degrees on their pivot points as well as the regular rotation of the box as previously stated, so for example at frame 252, i would rotate the box at -18 and this would automatically keyframe at that point, then staying at that frame, i would individually rotate the triangles, with the thinking that I would be keeping the movements on the frame, but the result is a constantly open lid throughout. I've tried manually inserting keyframes with location/rotation/scale etc but the result has always been the same. I would have thought that once a keyframe is recorded, that would be how it should be. Sorry if this is long winded, I've only been learning this for about 4 months. Here is a link to the opening of the show if it's allowed... Many thanks in advance.
https://www.youtube.com/watch?v=DWNR-08Ff0w

It seems i made a rookie error with this, everything else i was animating in object mode, and i was going into edit mode to set up my pivot points to rotate my top pieces and rotating them there, instead of going back to object mode to move them. This resulted in the pieces being in the fully open position from frame 1 to finish instead of opening during the animation. So if anybody stumbles on this question with the same problem, then note...ALWAYS animate in object mode.


Map pixels to a grid of faces New user here. I am using Blender to create meshes for an MMO which allows you to import .3ds files to its native designer. That designer has a very limited and low-resolution texture palette, with no unwrapper.

I would like to be able to emulate textures using geometry, for certain situations, by the following or an equivalent process:

Take an image of a given size.
Create a plane in blender such that it has a grid of faces equal to the resolution of the image.
Map the colour value of each pixel onto the corresponding face, as a material.
"Reverse-unwrap" the result, mapping the coloured grid onto a guide object.
(Separate by material, export as 3ds and recolour in the native designer.)

Can I achieve this efficiently, and if so, how? I have tried tracing images using Inkscape, but the resulting geometry is too messy to work with.

EDIT:
1. Take an image:

Create a plane and colour the faces:

That was a 4x4 image so I copied it by hand, but I'm looking for an automated method that could generate meshes for 1024x1024 textures.

Here is the Add-On: https://github.com/benkl/pixeler

  I will try to make it a plugin but for now this should help you. Open
  the source image in blender and replace the "test_file =" image
  variable (then run with open system console to see the progress). It
  will create a set of planes colored with the pixel values. You can
  then switch to edit mode and "Remove Doubles" to make it a consistent
  mesh (or seperate by loose/materials). It will slow down with bigger
  images (64*64 is quite fast - 1000*1000 takes a while). As a bonus
  pixels with alpha 0 will be skipped - so you can recreate icons eg (i
  tested single frame jpg and png). I am a designer and code is probably
  terrible - but it works  (feel free to improve it).

#pixeler v0.1 by BK for Blender 2.79 21/01/2018

import bpy

# Set Data Path
D = bpy.data

# Set File Name
test_file = 'blender.png'

# Set img
img = D.images[test_file]

# Get and set image width and height
w = img.size[0]
h = img.size[1]
tfac = img.pixels[:]

# Set basemesh
bpy.ops.mesh.primitive_plane_add(location=(-2.0, -2.0, 0.0))
basemesh = bpy.context.object
dmat = bpy.data.materials.new(name="origin")
basemesh.data.materials.append(dmat)

#Create Grid from Image
z = 0
y = 0
for index in range(0,h):
    x = 0
    for index in range(0,w):
        x = x+1

        # Get pixel position in flat array
        colar = (x+(y*w))*4

        # Set color values at current Pixel
        r = tfac[colar-4]
        g = tfac[colar-3]
        b = tfac[colar-2]

        # Alpha Check
        if tfac[colar-1]>0:

            # Add object at Pixel Location
            # bpy.ops.mesh.primitive_plane_add(location=(x*2, y*2, z))
            basemeshi = basemesh.copy()
            basemeshi.data = basemesh.data.copy()
            basemeshi.location.x = x*2
            basemeshi.location.y = y*2
            bpy.context.scene.objects.link(basemeshi)

            # Get material
            matname = "Mat" + str(r) + str(g) + str(b)
            mat = bpy.data.materials.get(matname)
            if mat is None:

                # create material
                mat = bpy.data.materials.new(name=matname)
                mat.use_nodes = True
                prinode = mat.node_tree.nodes.new(type = "ShaderNodeBsdfPrincipled")
                dif = mat.node_tree.nodes["Diffuse BSDF"]
                outshad = mat.node_tree.nodes["Material Output"]
                mat.node_tree.nodes.remove(dif)
                mat.node_tree.links.new(prinode.outputs[0], outshad.inputs[0])
                #rgb = mat.node_tree.nodes.new(type = "ShaderNodeRGB")

                # PBR Color
                prin = mat.node_tree.nodes["Principled BSDF"]
                prin.inputs[0].default_value = [r, g, b, 1]
                prin.inputs[7].default_value = 0.6

                # Set editor color from pixel value
                bpy.data.materials[matname].diffuse_color = (r, g, b)

            # assign to 1st material slot
            basemeshi.data.materials[0] = mat

            # Join newly creatd meshes
            basemeshi.select = True
            bpy.context.scene.objects.active = basemeshi
            basemesh.select = False

            # Print Pixel placement confirmation
            print("Placed object @ x " + str(x) + " y " + str(y))

    # Join line
    bpy.ops.object.join()

    # Incerement y last
    y = y+1
    #bpy.ops.object.select_all(action='DESELECT')

bpy.context.scene.update()
print("pixels to planes is done")


issue with grease pencil and tablet pressure After creating a new 2d animation project i started drawing with my tablet (xp-pen artist 12) and i noticed this:

as you can see the newer line is covered by the older path.
I don't know if this is just a default setting or a bug but i couldn't find anything about it.

This happens with the tablet pressure strength option enabled in the brush settings, without it the stroke has the same color and this isn't noticeable.

With the same tablet i don't get this using other drawing apps like photoshop.
How can i solve this?

For those Who are interested i submitted a bug report and got a solution:
It is a stencil setting in the stroke panel, to disable this the feature Is "self overlap".
Blender stencil setting

Credits antoniov developer for clarification.


Smoothing/blending a joint between two meshes I'm modeling a car, but I don't want to add any polygons. I don't need to (I'm trying to have a nicer mesh) so I've got two separate pieces here. Unfortunately this doesn't give me the curved effect, as in the picture below.

I was thinking to fix this in a normal map, but I'm sure I've seen tools for doing this specific thing, and I just can't recall how I saw it done (whether it was in a texture map or not).

I wasn't really big on the solutions, I did find for this here.

Here's a picture of the wireframe.

I could model this, I just don't want to do it that way, I'm sure there's an alternate way.

As it turns out I can make this piece into a 'plug' with MeshMachine and place it on my mesh with the additional smoothing in the corner modeled onto that plug.

Example https://youtu.be/2DpjEHxjh2s?t=61

Just waiting for the 2.8 version


Why are my UV islands splitting apart when I move them? When UV mapping I have been running into issues with not everything in an island being connected. I have marked the seams and all the vertices are connected but when I go and try to move an island only part of the selected object in the seam moves.

How do I link the whole island up so that it moves as one?

It looks like this is a coincidence of a few things. When trying this on my machine, I can replicate the behavior if I do the following things at the same time:

I am in UV Sync Selection Mode
I have select UV islands enabled
I try to move the UVs not by using g, but by click-dragging with the mouse instead

check the five icons on the bottom right of this screenshot:

the one on the very right is the UV islands selection mode, it is enabled. You only see this if the fifth icon from the right, the one that looks like an arrow over a cube, is disabled. This icon toggles the UV sync option. If it is off like now, you only see UVs for vertices which are selected in the 3D viewport. So make sure that in 3D View, all vertices are selected.

Now the crucial part:

The click-dragging actually updates your selection before the moving starts in the UV editor, and selects (in this case) only the one island under the mouse cursor. This behavior is sometimes called 'tweak mode'. If you select first, and then hit g to go to translation mode, the whole stuff translates, no matter if it is connected or not.


Ungroup a node group while keeping parameters? I have created a nodegroup but now I want to ungroup it but when I did I found that all my parameters have gone and I have to put it again,
so is there is any way I can ungroup a nodegroup while keeping the parameters?

some more explination:

what I have here is some node groups in the compositor which have some inputs connected to values which when ungrouping it stay connected but the problem is not in the connected values . the problem is in the value which is not connected to anything like this value

and when I ungroup the the node group this values return to its default value that I set when I made the node group,notice the image below the red one is the sockets connected which is fine and no problem in that but the values which was 155 become 0.5 which is the default value

so what I need now is to have the value that I set before ungrouping to be the same after ungrouping

I think you can't solve this problem inside the nodeGroup itself, but you can add a value Node (for gray input factor values, RGB/vector for yellow/blue) outside of your group, plug it (from outside) to the factor input of your group and use it for tweaking and the when you ungroup, it'll keep it plugged and the value will be the same as before.

inside group

values lost when ungrouped, default values applied

values linked from outside

values saved and linked after ungrouping

As far as I know, it's not a bug, it's the normal behavior of node groups. Values are stored in the group, not in individual nodes inside the group. So when you ungroup (delete the group) all stored infos are deleted too.


Or controller problem in GE This is a very small question, and there is not much to explain; let me jump into it: I have my character with WSAD controls. When triggering any part of WSAD (using or controller), my animation plays. When I press A  and D, W and S, all the keys together, or any odd combo where you should not be moving (e.g. you move left and right using A and D, so you don't move), the walk animation plays. When you are not moving, you should not look like you are. How can I pass this? Should I just use an and controller for all the combos? I, for those of you who need my question in a sentence rather than context, just basically want my character to play his walk animation only when moving. Thanks!

This can be best solved with a Xor controller. You need two of them. one for W and S, and one for A and D.
Here is an example of a Xor gate.

Here is a .blend example.


Archimesh: Undoing bad topology with the walls: How? Alright, allow me to specify. There is an add-on in Blender named Archimesh. It allows you to create rooms, including walls. You can add depth to those walls.
Previously, putting in windows meant cutting the holes into the walls you made with Archimesh. At the current time, I was unable to find out how. Now, Archimesh has a feature to fix that: Auto-holes. The windows spawn with a bound box. That bound box acts as the cookie cutter for the walls. This works wonders, except for a tiny problem I ran into:
I am not sure if this applies to a point before adding depth to the walls or even after, but if you check edit mode, you will notice you are unable to even touch the part of the wall created with the depth slider, though the initial wall is fine. This was not a problem until I added a few windows, but then I checked edit mode to make sure the topology was correct. Much like last time, I was right: It was not. Last time, I did not ask about this here. This time, I am:
Is there any way to edit the topology or somehow interact with it in order to?
Maybe I have to finalize it, but I have no idea how to.
This is about editing the topology of the wall where the topology goes wrong. (See inset below; images not embedded for sake of readability and remaining concise.)
Seems fine in Object and edit mode.:

...until I turn on the x-ray vision.:

If this keeps up, auto-holes will stop working properly, as sooner or later, the cuts are bound to fail in some way, much like it did, last time I recall.
Is there any way to fix the topology here? I fear I will have to be very careful with how many windows I put into the building wall.

If you want to edit freely with archimesh objects, you'd have to convert them to meshes (select your object then click object > convert to > mesh from curve/meta/surf/text) but it may compromise your archimesh tools with more complex models. Archimesh objects don't give you freedom in edit mode and most edits affect the whole mesh and/or aren't flexible at all, so I personally found that converting objects to a mesh and making most doors from scratch was a lot better for me because I prefer more freedom and flexibility.

And for the auto holes to work properly in general, the doors/windows need to be thinner than the walls which makes sense but also takes some time playing around with. And the minute you make even the slightest change, the hole disappears and you have to check "Auto holes" again and again.

If you want to create your own doors/holes with the same archimesh walls without converting it to a mesh, the Bisect tool works best. Loops and knife cuts cause too much complication with archimesh objects due to the lack of freedom so Bisect tool is your best choice.


Cleaning up 3d scanned models I'm scanning real life compositions of my own (just books and things) using an app on my phone called 123D Catch.

Once scanned I have the option of downloading these files in .obj, .3dp and .stl formats.

The files need a lot of cleaning up with a lot of background interference being included in the result and the odd hole needing to be filled in and a base to be put on the scan.

I'm completely new to this software and I'm wondering if there's an easy 'delete' tool where I can delete all the parts of the .stl file on the screen which have shown up around my scan? And also a tool or way of going about (in quite a rudamentary way is fine) filling in a couple of holes which have shown up on the walls of my scan where it hasn't captured completely and also of fitting a base to the model? It just needs to be fit to be sent to the printer and I don't think it is quite yet.

Thanks in advance!

Rob

In edit mode in the mesh menu, there is a mesh cleanup submenu. One of the options is fill holes.


How to keep relaxed water at start of simulation Im trying to make a lava sim but as soon as i start the sim the liquid just splashes all over and takes like 2 full secs to settle down. Is there any way to make it settle immediately then react to objects inside the domain. Im trying to have something rise from the lava but simulating is very long since the lava goes all over the place and takes like 5 full seconds to settle down.

Set Flow object to XY dimension of Domain at a bottom so there are not a gaps between Domain boundary and Flow. Like the liquid (Flow) is in a rest shape.

Note: Previously I thought, liquid explosion can be caused by objects intersecting, but it doesn't matter, even with Effector inside - no movement on a surface before Effector starts to "raise", as you can see in frames 0-30.


Square room, walls to bend to create round celling angles I created walls from 2D plans. In reality, the ceiling angles are rounded. The roundings are quite marked. The ceiling corresponds to a luminous square (in yellow).
1. can the red and blue vertices be glued together again to recreate the rounding?
2. Is there a simpler method? Connect to the ceiling square for example? on delete te top of the walls to recreate the round-angle celling ?

Depending a bit on your other requirements, perhaps the simplest way would be to reduce the corners to a cube. and then CtrlShiftB bevel the vertices at the corners.

If you want to leave yourself some flexibility, you could do this with a Bevel Modifier, set to 'Only Vertices' and 'Weight' adjusting the Vertex Bevel Weight of the corners you want rounded, and the profile, segments, etc., whenever you like...


Python: Selecting vertices and separating them into new object I have a mesh with millions of densely packed vertices, and I what I want to do is be able to bisect them into separate objects. What I struggle with is selecting the vertices I want to be separated from the original mesh.

Trying with the solution given to this question gives me odd results, with either selected vertices not being within the given coordinates or selecting no vertices at all. Naturally, when I then separate the selected vertices I only separate the ones still selected from when I bisected the original object.

What am I missing here? Is there another way of selecting vertices that works better with my intentions or have I just slipped somewhere and can't see it myself?

This is the current structure of my code:

# centers the median point to center of mesh
def CenterMedianPoint():
    filepath = bpy.path.abspath("//space_view3d_move_origin.py")
    exec(compile(open(filepath).read(), filepath, 'exec'))

# deselects all objects
def DeselectObjects():
    for obj in bpy.data.objects:
        obj.select = False

# bisects object based on coordinates and direction
def BisectObject(coX, coY, coZ, noX, noY, noZ):
    bpy.ops.mesh.bisect(plane_co=(coX, coY, coZ), plane_no=(noX, noY, noZ))

# get the dimensions of active object
dimensionX, dimensionY, dimensionZ = bpy.context.active_object.dimensions

# calculate dimensions and cell structure
cutObjectDimensionX = dimensionX / 5
cutObjectDimensionY = dimensionY / 5
cutObjectDimensionZ = dimensionZ / 5
objectStartX = (dimensionX * (-1)) / 2
objectStartY = (dimensionY * (-1)) / 2
objectStartZ = (dimensionZ * (-1)) / 2
objectEndX = dimensionX / 2
objectEndY = dimensionY / 2
objectEndZ = dimensionZ / 2

cellCount = 1
parentCellCount = 1

# first cut iteration
for i in range(0, 4):
    # selects object, enters EDIT mode and centers median point for easier coordinate calculation
    bpy.context.scene.objects.active = bpy.data.objects['objectToBisect']
    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.mesh.select_all(action='TOGGLE')
    CenterMedianPoint()
    # bisects objcet and selects bisected vertices
    BisectObject(0, (cutObjectDimensionZ-(cutObjectDimensionZ*i)), 0, 0, 1, 0)
    SelectVerticesInBound(bpy.data.objects['objectToBisect'], Vector((objectStartX, (cutObjectDimensionY-(cutObjectDimensionY*i)), objectStartZ)), Vector((objectEndX, objectEndY, objectEndZ)))
    # separates selected vertices into new object
    bpy.ops.mesh.separate(type='SELECTED')
    bpy.ops.object.mode_set(mode = 'OBJECT')
    DeselectObjects()

CenterMedianPoint script can be found here

Just found out through testing that there is nothing faulty with my code, nor any of the methods I'm using. Instead, there was some issue with the coordinate system that formed during or after I had imported the .obj file that I used to test with, resulting in the code not having the same effect as it normally would have.


Difference between bpy.data.objects['Armature'] and bpy.data.armatures['Armature'] Can someone please explain me what is the difference between:

bpy.data.objects['Armature']
bpy.data.armatures['Armature']

I can see they have different types and properties:
>>> type(bpy.data.objects['Armature'])
<class 'bpy_types.Object'>

>>> type(bpy.data.armatures['Armature'])
<class 'bpy.types.Armature'>

bpy.data.objects['Armature'].pose is a valid object but bpy.data.armatures['Armature'].pose returns an error, why?
I also noticed bpy.data.objects['Armature'].data returns bpy.data.armatures['Armature']
What is their respective definition and for which purpose shall one be used vs the other?

Document here
bpy_types.Object is a container wrapper for inner data to communicate with Blender Scene and other stuff.
You can rename your bone and armature:

>>> C.object
bpy.data.objects['Obj Armature']

>>> C.object.data
bpy.data.armatures['Real Armature']

And with the tree display in outliner, that should be clear that Object has Pose properties and the armature itself doesn't.


Objects not appearing when I render my model Objects do not appear when I render my model in blender 2.71. All objects are set to appear when rendered. Pressing W and clicking Clear all Restrict Render doesn't work, either. I only get a background when I render.

Edit: There are no strips in the VSE and all correct layers are set to view when rendered.

Blend file: http://www.mediafire.com/download/f5y51klyo9otdd1/Cycles_render_room_in_aero_apartments_elevator_lobby.blend

You don't have light in your scene.

The hemi lamp in the middle of the room won't work, as cycles doesn't support hemi lamps yet. It will be treated like a sun lamp.

Sun lamps provide a uniform amount light from infinitely far away in a specific direction with no falloff. Because of this, the position of the lamp doesn't have any effect.
Since the room is completely closed and light has no way to get in from outside, everything renders as black.

If you change the lamp to a point lamp and increase the strength to something like 1000, you get something like this:


Blender 2.79b model export to Collada I am trying to export from Blender to Collada .dae and seems that textures are not exported

Here it is a video with the steps

https://drive.google.com/file/d/11ELOeZovAhHoxm92P1poLjDk5EUdXZ8l/view?usp=sharing

What am I missing?

The default Blender Exporter does not seem to be able to embed textures into Collada *.dae files (as of 2.79b).

It can however save textures alongside Collada files. To do that it has two sources of texture files.

Materials as texture source

See this video if you want to see it in action.

This is used when you select Materials in the Texture Options section of the Collada Export dialog.

The steps you need to make sure the texure is set, do the following:

Be sure that you are in Blender Render or Blender Game mode (you can switch back to another renderer after you set the texture)
1a. Select your object and go into the textures tab of the Properties Panel
make sure that you are editing the textures of the material
add at least one texture of type Image (you can add multiple textures and all will get saved)
set the image for the texture

UV Texture as texture source

See this video if you want to see it in action.

This is used when you select UV Textures in the Texture Options section of the Collada Export dialog.

The steps you need to make sure the texure is set, do the following:

Be sure that you are in Blender Render or Blender Game mode (you can switch back to another renderer after you set the texture)
Select your object and go into edit mode
open a UV/Image Editor panel and set the image you want to export as the texuture (you can switch back into object mode and this image will persist as the one that will be exported).


Inverting Particle Textuies So, I posted a little earlier on my project trying to make a grassy field. Well, I'm trying to follow along this youtube tutorial: https://www.youtube.com/watch?v=eshOzshjt90

Now, I'm stuck on step 5, and I'm not sure if it's because of the changes between 2.69 and 2.79 which I am using, but I can't get the particle texture to invert. No matter how I change the slider, or work with nodes, my particles only post to the same spot they were assigned on the original system.

I can't get it to invert like his at 2:34 in the video.

Above is my current state of work, though I can't seem to make the second type of grass, meant to be dry grass, fill in the spaces where the green isn't. Instead, it just lays itself differently beneath the original particle system.

2 options i can think of to solve your problem.
1. after the color-ramp use an invert node
2. in the color-ramp move the white to where the black is by copying the values and drag the black all the way to the left


Baking vs texture image I am trying to understand baking in cycles and was wondering if I use a texture image with emission as input for material output, isn't it the same as baking? DO I need to bake this setup as well and then use that image instead of using the original texture image? My understanding is that baking is for all the material shaders and effects, but if I use a texture image already, then baking is not going to speed up rendering? Sorry if this sounds stupid, but I can't get my head around it.

If you use an image texture alone for your object, plugged into a diffuse or emission shader - that is as simple as it can be already. Baking is done to get complex information from a shader tree and multiple textures summed up in a few textures that can then be plugged into a Principled Shader.

If you are only needing the color information from the image texture you already have, baking isn't necessary.