Unselectable Rig in Solid mode This is weird, i'm animating a character using the 2.79's rigify and all of the sudden i'm unable to select the control bones in solid shading method .Only in wireframe and bounding box shade that i'm able to select them.

Also it's not possible to see the rig Object mode while in Solid shading.

The problem was that the rig's maximum draw type was solid. changing it back to wire solves the issue.


Python: Make an Operator update UI after executed Example: I want to press a button in the UI and have a label/list change to display below the button. Not on the Operator's F6/Redo panel, but once the Operator has been appended somewhere else in the UI.

So perhaps the question would be if it's possible to use the Operator's draw function somewhere else in the UI (appended or on it's own Panel).

I know it can be done updating a global variable, then using it from the UI code, but I know globals a no-no in general.

Thanks!

You can use static members (class variables) to store information in the operator.

Here's an example that adds a panel and an operator. The operator increases a class variable to reflect how often it has been called. This number is drawn in a panel in the Scene tab of the Properties Edtior:

import bpy

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

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

        layout.operator(SimpleOperator.bl_idname)
        layout.label(str(SimpleOperator.run))

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    run = 0

    def execute(self, context):
        self.__class__.run += 1
        self.report({'INFO'}, str(self.__class__.run))
        return {'FINISHED'}

def register():
    bpy.utils.register_module(__name__)

def unregister():
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()


UV unwrap doesn't show faces in UV image editor I am following this tutorial, however for some reason the mesh isn't appearing in the UV image editor.

According to the tutorial, it should look like this:

However in my blender, it looks like this:

Obviously I tried to show the UV texture coordinates by pressing U and selecting "Unwrap".

I have tried looking at this Blender StackExchange question, however the answer there says "only selected faces will be unwrapped", and I think I have them all unwrapped.

You have several objects selected and then you have gone into edit mode on one object, the active one. This is evident by the fact that the entire ship appears to be selected (from the orange outline) yet it's vertex data is not shown. This may be misleading you if you expect the entire ship to show in the UV editor.

Only the selected faces of the active object will show in the UV editor, in your screen shot you only have 2 vertices selected, which is why no UV faces of the object are shown. Press AA to de-select the two vertices and then select all of the vertices in the active object, then unwrap and then they will show spread out in the UV editor.

You will need to repeat this for each object unless you wish to join them together into one.


Making a Mobile "Roadblock" So I'm making this danmakufu game in Blender as a school project, and it's due by the end of May.
I have this little rocket:

And I have this... TIE fighter-like thing:

So I'm trying to make the TIE fighter's y-pos match with the player's y-pos, but not make it too fast otherwise the TIE fighter's just going to run into the storm of bullets produced by the player, but I also don't want him to go too fast (or else his bullets would be way out of synch.)
The problem is, however, is that it's decidedly NOT MIT AppInventor or Scratch. You can't just stick in a data block saying "glide to co-ords (objectx+100,objecty)" or "always repeat [wait 5 ticks] [create object "Doop" with (parentx,parenty) and (direction=playerhitbox)]" in Blender. How can such a function be attained in Blender?
Question 1 answered. onto the next one!
Also, how does one actually get the bullet to aim at the player, but not seek?

P.S. the person with the best answer gets to be mentioned in the credits!

to keep the Tie moving in front of the player you can add some random motion on the Y axis with a constraint to keep it in the view, and to keep the Tie moving in front of the object on the X-axis you add some motion on the x axis:

to make a bullet be fired at a position without traking an object you can add another object that will track the hitBox and fire the bullets, when the box move the bullets will not track it


Running Track, painted material, right way to do it? I'm doing a running track with painted lanes and numbers. It it easy to do base material itself (eg. sand or black rubber) using the principled shader and correct material setup and I have also png-texture with orange lanes with white stripes and numbers + alpha channel to broke uniform color.
The problem is how to mix them together to make a realistic outcome?

I try to add the lane texture to "Subsurface Color" input but I'm not sure if this is the right way.

I would like to get something like this:

Final:

You can make this with procedural texture mixed by alpha image (lines/numbers).

Node overview:

Base procedural textures. Voronoi for main bumps and Noise to make it less uniform.
Color Ramps for fine control over textures intensity.
Mixed base textures and Color Ramp for Base Color input.
Brightness/Contrast to tweak Roughness.
Bump node to feed Normal inputs.
Image Texture with only white shapes and transparent background mixed with base textures. Color Ramp controls how much wear there is on shapes (how much orange color is visible trough them, based on Voronoi texture).


Is UV Island Overlap OK? I'm pretty new to 3D modelling and texturing, so when I do a UV unwrap in Blender, I notice that it automatically places the UV islands in a manner that fills the UV bounds without any of the islands overlapping each other, and I typically see everyone else do it this way.

However, for the stuff I'm messing around with in Unreal Engine, I often want my one texture applied over the entire object so I'll grab all the faces from one side of my mesh, Project From View to get those faces on one island (I know I should probably be doing some mark seam stuff instead of this convoluted method, right?), then scale that individual UV island to fit the entire UV bounds, thus getting a "higher resolution" look for that particular set of faces.

I feel like I'm probably doing something deathly wrong by taking that approach, but my models turn out fine in the engine so I'm wondering what I'm missing, especially since leaving them all without any overlap means the UVs have to be very small and often look grainy on my model. What gives? I'd say my three main questions are:

1) Is UV overlap a problem for game assets, or texturing in general?

2) Is there a way more obvious, better way of accomplishing what I'm doing? I often have trouble with unwrapping cylinders and more complex objects with my method, so I'm guessing I need to invest some time into learning to mark seams better.

3) Bonus question if you're feeling generous: Will I need to be taking things a step further with things like baking textures for my uses in Unreal later on?

There's nothing wrong with UV maps overlapping. While it is difficult to say so for certain with all game engines, all of the game engines I have used have always been comfortable with overlapping UV maps.

Depending on what you're looking to unwrap, you may wish to use Cube Projection, Sphere Projection or Cylinder Projection instead of simply UV unwrapping by default. You can find these options below "Unwrap" in the "UV" dropdown.

You may also wish to use Smart UV Unwrap. All of these settings can be found in the "UV Editing" tab.

Of course, overlapping UVs could potentially be messy to work with, so some people choose to simply duplicate a part of the texture for a duplicate UV island in a different location.

For adding your textures into Unreal Engine, you will need to duplicate any pipeline you have in Blender. If you have multiple nodes running into a shader (e.g. Image Texture into Base Color & Noise Texture + Bump into Normal), you will need to replicate the same nodes using Unreal Engine shaders.

It is possible that you could bake the texture - however, keep in mind that you are baking the lighting as well, so this would likely only be useful for static objects with similar lighting to your UE4 project.


Python set active face/batch unwrap Follow Active Quads TL;DR: How do I set a bmesh face as active through Python?

Long Version: I got this random pre-made complex mesh of a tree, it is well modeled, but it came with garbled UV coordinates, without properly unwrapping it, it is pretty much useless.

Manually unwrapping seems out of the question (too many hundred leaves). They are all quad based though, so I started trying to create a very basic script to loop through visible faces > select all linked > unwrap it using Follow Active Quads.

If it helps this is the average leaf appearance

It works for the most part for single selections, however I always get RuntimeError: Error: No active face is not selected, when I try to loop over all faces.

According to this answer adding it to selection history should do the trick and set a vertex (face also?) as active, but it is not working for me.

This is what I cobbled up copy pasting from here and there.

import bpy
import bmesh

# Get the active object
obj = bpy.context.object
# Get the active mesh
me = bpy.context.object.data

#get bmesh (Object needs to be in Edit mode)
bm = bmesh.from_edit_mesh(me)
faces = bm.faces[:]

for face in faces:
    #Select a face
    bm.select_history.add(face)
    #Select linked geometry
    bpy.ops.mesh.select_linked(delimit={'SEAM'})
    #Unwrap using Follow Active Quads
    bpy.ops.uv.follow_active_quads()
    #Hide when done
    bpy.ops.mesh.hide(unselected=False)

My coding skills are admittedly weak at best, so if anyone has a better suggestion with or without scripting, please shoot

You can set the active face in your loop with bm.faces.active = face.

With what you have so far, you are looping through every face and doing select linked, even if you may have already unwrapped and hidden the face.

The following script seems to do what you are trying to accomplish.

import bpy
import bmesh

obj = bpy.context.object
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_mode(type='FACE')
bpy.ops.mesh.select_all(action='DESELECT')
bm = bmesh.from_edit_mesh(obj.data)

for face in bm.faces:
    if not face.hide:
        face.select = True
        bm.faces.active = face
        bpy.ops.mesh.select_linked(delimit={'SEAM'})
        bpy.ops.uv.follow_active_quads(mode='EVEN')
        bpy.ops.mesh.hide(unselected=False)

bpy.ops.mesh.reveal()
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.uv.unwrap()
bpy.ops.object.mode_set(mode='OBJECT')
bm.free()


Is the Glass BSDF shader in Blender PBR accurate? So I was wondering whether or not the glass shader present within Blender is already PBR accurate. The only reason this sparks my attention is that I'm working on a watch at the moment in Blender, and I just want to ensure that the glass for the watch is PBR accurate.

Any information about this would be greatly appreciated.

No, but you can get true PBR using the new Principled BSDF, which is available in the 2.79 RC 2 build.

To learn how to use the Principled BSDF I recommend watching this video by Blender Guru.


UV Editor - It's selecting multiple vertices How do I select only one vert/edge/face at a time without it selecting all the corresponding ones? It was working fine before and I must have hit a hotkey or something that has changed it.

I've tried turning off UV sync selection (the parallel lines button in the top left) but it doesn't help. It was working with this on before.

Has anyone had this problem before and is which button/hot key allows me to select just one?

Thanks in advance :) Also this is Blender 2.82.

May be you have accidentally turned on Sticky selection mode. Turn off UV Sync selection and change it as follows:


Can I bake the animation of a mesh and get rid of its armature? Bare with me since I am not so familiar with the baking animation process.

I have a mesh, where its vertices (and so its faces) get moved as a result of its armature.

There is an animation based on some different poses.

I wanna take this animation to use it in unity. But I don't want to drag the armature with me.

So is it possible to just "bake" the translation (motion) -animation- of the mesh and just drag the object along with its mesh and an animation only?

The word for that kind of thing is "vertex animation". Blender supports shape keys that can be imported into unity via FBX. They are typically used for cloth animation and facial animations that are difficult to do with bones - if you're looking for movement in general then you'd generally want to stick to the armature and use an armature in Unity as well. You could also try to use a different armature in Unity and retarget the animations with Mechanim - if the armatures are compatible Mechanim usually works great.

If you just converted the keyframed poses to shape keys you might get an animation that looks roughly like the armature-based animation, but shape keys don't interpolate the same way that bones do. If you have to use shape keys you might have to create a shape key for every frame and change the blend shape in Unity in every frame.

You can create a shape key by selecting "Apply as Shape Key" in the armature modifier of the mesh that's controlled by the armature:

This thread might be of intererest to you:
https://blenderartists.org/forum/showthread.php?300572-Is-it-possible-to-bake-armature-poses-into-shape-keys-morph-targets


Improve render time for Grass/ Forest? (Eevee) Is there any way to improve the render time, when you have grass and a forest? Because i make animations, i have now a problem. With only one tree and without grass, the render time pro frame are about 30 to 40 seconds. But now with a forest and grass, i take the computer 2mins. This means, the pc need around 14 hours for 28 seconds of animation with the camera. There are no animals or anything else yet.
Is there a way to say Blender should only render 1 to 3 trees and copy the information of this to every other tree and grass?

That what you refer to with

copy the information of this to every other tree

is called "instancing". If you use a particle system or arrays to distribute your trees and grass, you are already making implicit use of instancing.
If you however use manually placed copies for your trees, you might want to use the option "duplicate linked" (Shortcut: Alt+D), to keep the scene more efficient to store and to render.
Also, generated trees tend to have a LOT of polygons, most of which do not really contribute to the perceived detail (especially if the trees are in the background!).
So it may pay off to use the "decimate" modifier quite drastically on background trees.


How to define actuators using loop I have several objects in my scene and each of them has an actuator (type Motion). The object1 has the actuator Motion1, the object2 has the actuator Motion2 and so on. My problem is that I have 95 objects and I would like to define them in the code in a efficient way.

I've tried this:

import bge
import bpy
cont = bge.logic.getCurrentController()
own = cont.owner

m = []
for k in range (1, 95):
    m[k] = cont.actuators["Motion"+ str(k)]

But it doesn't work.

This can be done with bpy.ops.logic.actuator_add

import bge
import bpy
cont = bge.logic.getCurrentController()
own = cont.owner

m = []
for k in range (1, 95):
    bpy.ops.logic.actuator_add(type='MOTION', name="Motion"+str(k), object="Cube")

Where type must be in ('ACTION', 'CAMERA', 'CONSTRAINT', 'EDIT_OBJECT', 'FILTER_2D', 'GAME', 'MESSAGE', 'MOTION', 'PARENT', 'PROPERTY', 'RANDOM', 'SCENE', 'STEERING', 'SOUND', 'STATE', 'VISIBILITY')

This was tested in the BGE using default scene with "Cube"


Understanding Displacement Maps I am having a problem understanding displacement maps. I'm starting to think that I don't understand them at all.

Clarifying My Understanding

My understanding (which might be completely wrong), is that a displacement map is a gray-scale image whereby a value of 0.5 produces no displacement, >0.5 produces displacement in the positive direction, and <0.5 produces displacement in the negative direction. This, however, does not seem to match my actual observations in Blender.

I am using a displacement map within Cycles, plugging it into the Displacement socket on the Material Output node (I am also using the new experimental adaptive subdivision and micro-vertex displacement). I note that a value of 0.5 actually produces a displacement in the positive direction, causing the whole mesh to jump up slightly, as well as creating the peaks and valleys that you would expect for >0.5 and <0.5 values respectively.

This affects my entire understanding of displacement maps. Why is this happening? Why is a value of exactly 0.5 creating displacement? Further, how are you supposed to arrange and line up objects in your scene when, in rendered view, the displacement maps will push them out of position, even if those maps are only supposed to create displacement in specific areas.

The Problem in Practice

This is the problem I am having at the moment. I have a plane which is supposed to be a snowy field, and I am using a displacement map to give some depth to the snow. In rendered view, my plane jumps up significantly. This is what lead me to investigate my understanding of displacement maps, and to this question.

Additionally, what is the correct way to increase and decrease the strength of a displacement map? At the moment, I will run them through a Math node set to multiply, however, as you might imagine, this exaggerates the issue that I am complaining about above.

To be clear, however, I am not using a math node when experiencing the "jump up" for 0.5 values. This is not the source of my problem, but another aspect to it.

The Displacement input of the Material Output node treats 0.0 as no displacement - rather than 0.5 as you expect. If you are using a Gray-scale image for your displacement you will need to adjust the values (0.0 to 1.0) to be centred around 0.0 rather than 0.5 and youcan achieve this by simply subtracting 0.5 using a Math node. You may also want to feed the output of that through a Multiply node so that you can adjust the magnitude of the displacement.


How to make child collide I want to make a tree which is made of segments connected via parenting, i want the children have collision with the environment, atm the children will simply pass throught them.

How can i make it.

edit: described what i want in image

Found this answer in Mike Pan's and Dalai Felinto's marvellous book Game Development in blender (cengage learning, 2014). I will re-word it to avoid any copyright infringement.

This can be solved with the Compound option for collision bounds.
Make sure all the objects you have are collision bound enabled and then check the "Compound" box, described as "Add children to form a compound collision object". If you check this option on not only the parent, but all the children as well you get a parent object that dynamically adds the children to the parents collision bounds.

young parents, remember this as a way to control your children.


Why is Eevee giving low res animation output? First off, I wanted to make a HUD in blender. I thought it was better to use Eevee for its bloom effect. I can get single frames render at high res but IDK why the animation looks all pixeled..

This is the rendered image and it looks pretty good. But the animation video is really low res
If you noticed you can see the pixelated retro sort of look. The rendered image at first is 1.08MBs. But the rendered video is 0.88MBs. I don't why this is happening..

They are the exact frame but why does the rendered video looks so crappy?? Anyone please help, thank you!!

Set your video quality to high or lossless. A Bloom effect with dark and redbackground is really bad for image compressing method. Which tend to output a bad resolution or the image if the size of the file did not change.

If you want to make video like a professional artist, you might want to check out how image are stored in each format like jpeg, png, bmp, gif, h.264, h.265 and so on. (Notice that I did not mention mkv and mpeg(mp4) because they are container which work as a directory.)

And you might want to save your video in "Image" format to preserve the best quality while editing video sequence.


How can I convert multiple faces of an object to light? I have create this spiral LED lamp.

The cylindrical part of spiral has six faces.

Four of them (back) are the non-transparent part and the rest two (front) supposed to be the plastic cap of the LED strip.

At those front faces I have add a material with an emission surface so to look like lit LED strip.

What I want to do is to make all those front faces to shed light to my scene. But not just to look glowed like first image. Is that possible?

Yes it is possible, you just assign a material with emission shader to the faces that you want to emit light and they will(in Cycles render).


Is there a way to fill in hollow objects? I am trying to make a mold of the human airway.  To do so I need to subtract the airway components from a block, then 3D print the mold.  It appears that all components are hollow, is there a way to fill them in?

If i understand you, you have the airways components as one object and a cube that you placed around it.

If so, then i would believe all you need to do is the following:

Select the airway components and go in edit mode
Press A to select all elements
Press Alt+N and select "Flip" to flip the normals. (the outsides become the insides and vice versa)
Now go back in object mode and select the cube/block and the airways components
Press Ctrl+J and you will have an object that considers the empty area the inside of the airways components as outside while the area between the outside of the cube/block and the airways components are considered inside and will be filled.
There might be small parts that you will have to adjust, depending on where and how many outlets/openings you need for the airways components. That part should be easy to deal with if you loop cut or inset faces to generate enough vertices to connect the airways components outlets to the outside of the cube. Using "X-Ray" Alt+Z it should look something like this "very" simplified version.

To finish it, make sure to check the "Face Orientation" once more.

The outside of the cube/block should be blue and the connections from outside to the hollow airways components needs to be blue inside of their hollow parts, while if you go through the cube/block with the camera, it should show all red as you would move through the area considered inside the object where the 3D software (slicer) would give you the options to fill.

It's important to make sure that no surface has red and blue colored faces on the same side! But the "Solid" check of the "3D-Print Toolbox" add-on  will test for that.

Happy Blending.


Problem at Selecting Points after Extruding I am very new to Blender and googled my Problem now over 2 hours, but didnt found anything. That's my Problem:

I extruded my Mesh and want to Merge to Points. When i am about to select my two Points, the Program selects all Points along the extruding Path.

How can i change this setting and just select only the two Points?

There are several things to keep in mind in your case.

First, it seems you're holding Ctrl while selecting vertices. This means you select these vertices and every vertice located along the shortest path between them.

To select only 2 vertices you should hold Shift while clicking on the vertices.

Second, you have double vertices in your mesh, at least those which are selected. Select all, use W and in the menu choose Remove Doubles. Read similar question here.


one object is not rendering now I went on and created my eye balls, then in the process of setting them I pressed Shift + Z to render to see what it looked like, only to see that my head is no longer showing up in Cycles Render.

What did I screw up now?

You need to check all of the Ray Visibility: settings under Properties panel > Object tab > Cycles Settings dropdown.

The fixed .blend file:


Shrinkwrapped eyelid showing glare like outer eye glass material I'm still working on my first character and followed a tut that showed me how to shrinkwrap the eyelids over the eyes which I would be very happy with except as you can see, now the eyelids have changed color which I can live with but also they show the glare that is a material property I gave the outer eyeballs. Skin obviously shouldnt be showing this glare. I really want to keep it shrinkwrapped but how can I get rid of the glare on the eyelids but keep it on the outer eye??

The Shrinkwrap modifier includes a Distance property that allows you to control how far off the surface the mesh is wrapped - higher values give a larger separation. Increase the distance until your ‘outer eyeball’ no longer shows through.


How to draw edges on a sphere to make parts that fit into each other I am trying to make sphere shaped designs with moving parts like spaceship doors & windows for 3d printing. However, the doors/windows don't always follow the edges on the UV sphere.
Is there a way to "draw" edges on the surface of the sphere that I can use to cut certain shapes out of it? The best example I can think of are the classic flying saucer spaceships with the lowering door in older movies.
Below are my two objects: the sphere (orange) & the shape I want to trace about the surface of the sphere to eventually cut them into two separate meshes that can fit into each other.
NOTE : I have tried using the knife projection approach and the shape does not follow the curve of the sphere. (2nd image). The third animation is the closest example I can think of for my goal.

You work with too many polygons and you should think another way. If we try something like your last picture:

Create a UV sphere, stretch it on the Z axis, keep only 1/32 that you mirror on the X and Z axis:

Cut the hole with a knife:

Extrude inwards:

Use an Array in Object Offset mode to make the mesh rotate around an empty, work on the mesh as long as necessary before applying the Mirror and Array modifiers:


Why are all weights set to zero when linking my armature to my character with automatic weights? I'm trying to animate my golem and to do this I obviously created an armature. The problem is when I link my armature to the golem with the automatic weight settings, it sets the weight to 0 (blue) everywhere.

I think it's because my golem is a little like Rayman in style (I mean he has no real limbs and is just some rock animated together but not touching each other).

I tried to paint it in weight paint mode but it's damn long and kinda frustrating because some parts are really close to each other and I can't really paint where I want exactly.

Here is my golem:

Make sure your bones have the checkbox marked: DEFORMER in the properties of the bone. Also, when you ctrl+P make sure you choose with "automatic weights". If you see no vertex assigned colors, chances are your armature bones are not setup to deform.


Turn weight paint(vertex groups) into vertex paint? Can I turn weight paint(vertex group data) into vertex paint? I would like to take the weight paint value and convert it into a black and white grey scale vertex paint map.

I think you will still have to do a bit of scripting to get the following to work but it does most of what you want.  A while back, someone posted a question about how to convert an existing script that turns Weight Paint to Vertex Color Paint, he posted the script link and there are a couple reasons why I decided to post this as an answer instead of only directing you to the link.
First, there is an important step necessary to get this to work properly.
Second, I'd like to also post the script here directly in case the link to the external site goes down, this way it will still be available here.

To start with, Vertex Color Paint starts off as all white and if you try to use the Addon with the Vertex Colors as all White then it fails weirdly.  The first results I got looked like the following.  It transitions from white to grey then back to white.  It's not black where the blue is in Weight Paint mode.

However, if you first add a Color vertex group and then make that group black, the Addon works fine.  Just set the brush color to black and use the Set Vertex Color shift +k

Now you will have all black vertex colors.

So now you can enter weight paint mode and use the Addon which can be found in the spacebar search menu under Weight2VertexCol

You should get results something like the following.

Now the fun part, you have to modify the Addon to invert black and white.  Fortunately, the math for this is easy, unfortunately I don't know Python scripting very well and I'm mediocre with math.  Now if I think correctly(which I don't always do) you can use (x*-1.0)+1.0 to invert black and white.  So I assume if we find the place in the script that writes the Vertex Colors and we place that variable where the x is in the above formula then the script should do what you want.

I'll just post the script for now and then maybe someone can figure this last part out. I'll be really surprised if that code works without some indentation reformatting using a program like PyCharm CE since the code window here botched the copy and paste and I had to do a bunch of manual indentation.  Anyways, here is the link to the script on the external site so people can just use this copy as a last resort.

https://bitbucket.org/kursad/blender_addons_weight2vertcolortransfer/src/42070d95e0063df441b4f2d617492669b690592c/src/vertex_color_weight_transfer.py?at=master

The script has the filename -> vertex_color_weight_transfer.py in case anyone from the future wants to Google it.  His name is listed in the script below.

I put some notes after the script about how I think you can modify it to make Red = 0.0 and Blue = 1.0 instead of what it does now(Unless I'm confused and it already does.)

import bpy
from mathutils import Color
import random
from bpy.props import *

import bmesh

bl_info = {
    "name": "Weight2VertexCol",
    "author": "Kursad Karatas",
    "version": (0, 1, 0),
    "blender": (2, 6 ,6),
    "location": "View3D > UI panel >CopyWeightColors",
    "description": "Transfers Weights as Vertex Colors",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "3D View"}

class Weight2VertexCol(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.weight2vertexcol"
    bl_label = "Weight2VertexCol"
    bl_space_type = "VIEW_3D"
    bl_options = {'REGISTER', 'UNDO'}

    method=bpy.props.BoolProperty(name="Color", description="Choose the coloring method", default=False)

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

def execute(self, context):
    transferWeight2VertexCol(context, self.method)
    context.active_object.data.update()
    return {'FINISHED'}

def transferWeight2VertexCol(context, method):
    me=context.active_object
    verts=me.data.vertices

    col=Color()
   col.h=0
    col.s=1
col.v=1

#vcolgrp=bpy.context.active_object.data.vertex_colors.keys()

try:
    assert bpy.context.active_object.vertex_groups
    assert bpy.context.active_object.data.vertex_colors

except AssertionError:
    bpy.ops.error.message('INVOKE_DEFAULT',
            type = "Error",
            message = 'you need at least one vertex group and one color group')
    return

vgrp=bpy.context.active_object.vertex_groups.keys()

vcolgrp=bpy.context.active_object.data.vertex_colors

#Check to see if we have at least one vertex group and one vertex color group
if len(vgrp) > 0 and len(vcolgrp) > 0:
    print ("enough parameters")

    #Colored
    if method:
        for poly in me.data.polygons:
            for loop in poly.loop_indices:
                vertindex=me.data.loops[loop].vertex_index

                #Check to see if the vertex has any geoup association
                try:
                    weight=me.vertex_groups.active.weight(vertindex)
                except:
                   continue

                #col=Color ((r, g, b ))
                col.h=0.66*weight
                col.s=1
                col.v=1
                me.data.vertex_colors.active.data[loop].color = (col.b, col.g, col.r)

    if not method:
        for poly in me.data.polygons:
            for loop in poly.loop_indices:
                vertindex=me.data.loops[loop].vertex_index
                #weight=me.vertex_groups['Group'].weight(vertindex)

                #Check to see if the vertex has any geoup association
                try:
                    weight=me.vertex_groups.active.weight(vertindex)
                except:
                    continue

                col.r=weight
                col.g=col.r
                col.b=col.r
                me.data.vertex_colors.active.data[loop].color = (col.b, col.g, col.r)

class MessageOperator(bpy.types.Operator):
    bl_idname = "error.message"
    bl_label = "Message"
    type = StringProperty()
    message = StringProperty()

    def execute(self, context):
        self.report({'INFO'}, self.message)
        print(self.message)
        return {'FINISHED'}

    def invoke(self, context, event):
        wm = context.window_manager
        return wm.invoke_popup(self, width=800, height=200)

    def draw(self, context):
        self.layout.label("A message has arrived")
        row = self.layout.split(0.25)
        row.prop(self, "type")
        row.prop(self, "message")
        row = self.layout.split(0.80)
        row.label("")
        row.operator("error.ok")

#
#   The OK button in the error dialog
#
class OkOperator(bpy.types.Operator):
    bl_idname = "error.ok"
    bl_label = "OK"
    def execute(self, context):
        return {'FINISHED'}

def menu_draw(self, context):
    self.layout.operator_context = 'INVOKE_REGION_WIN'
    self.layout.operator(Bevel.bl_idname, "Weight2VertexCol")

def register():
    bpy.utils.register_class(Weight2VertexCol)
    bpy.types.VIEW3D_MT_edit_mesh_specials.prepend(menu_draw)

    #error window
    bpy.utils.register_class(OkOperator)
    bpy.utils.register_class(MessageOperator)

def unregister():
    bpy.types.VIEW3D_MT_edit_mesh_specials.remove(menu_draw)
    bpy.utils.unregister_class(Weight2VertexCol)

if __name__ == "Weight2VertexCol":
    register()

The following lines look like where the Red and Blue are being transferred to Black and White.
The col.r = weight is a pretty good indication.  So is the fact that all three color channels are being assigned the same information. That is how you make a grey scale color which is what we are looking for here.

col.r=weight

col.g=col.r

col.b=col.r

So, as a starting point, I would modify the first line of that snippet to be

col.r= (weight*-1.0)+1.0

and then I would test it.  It should do what you want I think.

What would be even better is if you were to find a way to modify the code so that it automatically makes the Vertex Colors all black for you as part of the script which will save you a few steps.

UPDATE:  I tested the invert formula and now the script seems to do what you want, here is the result.  Also, with the greyscale inversion added, the initial Vertex Colors should start off white instead of black so this saves a bit of setup for you.


What are the differences between preview render hair and rendered hair? Preview render is showing the hair like so:

But, the rendered hair just completely destroys the beauty lower formation and instead smooths it out so it looks ugly like this

The only differences as far as I can tell is the confusing steps variable in the render subcategory and the steps variable in the display category.
Once I make both of them two, the renders turn out exactly the same.


Changing camera axis I'm making a game in blender but as you know when I rotate a camera the Y axis becomes the vertical and the Z becomes the forward/back. Is there a way to rotate it but keep the axis like Z is vertical and Y is forward/back?

What you can do is parent the rotated camera to an unrotated empty using Ctrl+P. Now you can animate or manipulate the empty and the camera will follow it exactly, while retaining it's rotation.


How to add driver to Action? I'm learning to use Blenrig 5 Add-on and i've found some feature that i really like it but I don't know how to make one.
That's about how to add driver to Action.
As you see, by scale hand_close_L bone, the zrig_hand_close is animated, but i can't find where to config the driver of how to create one.

This is the zrig_hand_close action.

Thank you for taking your time.

Because of wrong keyword so i couldn't find the answer on google before.
But i just found out that it's all about Action Constraint.
More information and simple tutorial here


Messed up Topology (Shading?) due to the usage of the Knife Project Tool Dear Blender Stack Exchange Community,

After trying to model a sword (after a concept art) I did run into some issues after using the Knife Project Tool. I am trying to add some Screws using the Extrude, Subdivide Command and Proportional Editing. However, after applying the Knife Project, weird Shadings started appearing.

I fixed the middle indent by connecting it to the rest of the geometry. The screw holes were done by keeping the produced geometry (Knife Project) selected and applying the transformation once, for all of them.

Now I did ask myself, whether I'd have to manually connect my screw holes to the rest of the mesh,or whether there is another, smarter way. Because by using this method I lose the accessibility of using efficient and clean loop cuts. I certainly do want to avoid ngons and poles as much as possible.

By the way, never mind my weird Subdivisions in the screw hole, I was going to fix it after solving this Problem.

I have had the same problem with shading after using the knife / knife project tool. Unfortunately, I believe there is no sure-fire way to fix this.  One way that may work is to slightly bevel all the edges.  Another is to set the shading of the faces to flat, and leave the shading of the others at smooth.


How to move or slide an image in VSE I would like to know if there is a way to make an image move or slide to another point using the video editor.

Select the video strip you want to move, then press ShiftA and look for Effect Srip->Transform.

Select the newly created transform strip and press N to revel the control panel.
You can move and rescale the image using Position and Scale.

Those values are keyframemable. To add a keyframe hover over the value and press I


Blender 2.83.2 - Only half of the icing's sprinkles are added to the icing While following a tutorial by BlenderGuru, I ran into an issue where only half of the sprinkles were selected (as shown below).

I really don't know what could be causing this because I followed the tutorial step for step, and did exactly what the tutorial said.
If I make any change to the sprinkle object, like add a material, they all get effected, but if I do something like apply random colors to the sprinkles, only the selected half get effected. I have my model provided below if you need it.
The tutorial: https://www.youtube.com/watch?v=jNmnPXY9UQA
My model:

I had the same problem- I got the sprinkles part down but when I add the random colors, it seems like only half get affected (especially if we're adding more than 2 colors). I was trying to figure out the problem by remaking my sprinkle and messing around with the nodes... but it turns out nothing is wrong with it, it only looks like half is getting affected because we're looking at in through materials preview. If you go to rendered view, the sprinkle colors should be distributed more evenly according to your ColorRamp.


How to I get rid of these flippin' edges? I'm trying to fill a complex face created with via an SVG, my workflow is as follows :

Import SVG
convert to mesh
simplify mesh
fill
----------this is where I'm stuck

By filling the face it's creating additional edges by splitting the faces, not the end of the world but i want to inset the (one) face so that I can bevel the edge slightly. Having these extra faces in there causes them to overlap, and creates a mess.

I've tried dissolving the problem edges, but this doesn't do anything
I've tried deleting the vertices attached to the edges, but this removes the face too, and filling the hole created just puts me back to square one.

Stumped! Please help and thanks in advance]1

You cant dissolve those edges. Some polygons simply have too many sides. I fought this many times importing project from Autocad and applying wireframe modifier for cool looking render. Anyway in case of the ring how do you imagine polygon data saved without edge going through the ring? It is simply not doeable to make one face polygon ring without edge going this way.


Cant get glossy material in Unity? Ok, so trying everything I can here but seeing as I cant get exporters like B2U to work, I am relying on Unity's shaders and other answers on here trying to achieve this glossy material (see the white shine) from Blender to Unity:

Right now Ive applied diffuse, specular, and standard shaders in Unity, all just look like this -

No shine, very flat. Is this a lighting problem? Or how can I preserve Blender's glossy look in Unity?

You need a Specular map for best results, a Reflection Probe also. Substance Painter is a fast and easy way to create these maps for Unity.


All UV info is collapsed into a single point I have recently purchased a package for unreal engine which contains lots of low poly models. I have some light-map issues with unreal engine. I guess that (based on the warnings within the engine) the problem is caused by the texture UV-mapping. Here is a shot of the UV map inside blender:

And here is the 3d Model:

As you can see all the UVs for leaves(and other parts) are gathered in a single point, and I think that is the source of my problem. I tried to separate the vertices but its an extremely time consuming process since there are hundred of vertices and tens of models.

It's quite common to have 2 UV maps (or UV channels) on the same object, one for the texture maps (the one you show in your question is for the color map), and one for the lightmap.

When importing the model into UE, check the box "Generate Lightmap UV" and UE will create this second UV for you.

If you want to have more control on this map, you can create it manually into Blender :

In Object Data/UVMaps, hit the + button to create a New UVMap, and name it something like "Lightmap UV".
Make sure it is selected, then do your unwrapping as usual. Make sure no face is overlapping another, it's really important for a lightmap. The "Lightmap Pack" unwrap method give nice results (feel free to bump up the "Margin" parameter, it's quite low by default).
Import your model without checking "Generate Lightmap UV". Then refer to UE documentation to assign the correct UV channel to the lightmap : https://docs.unrealengine.com/en-US/Engine/Content/Types/StaticMeshes/LightmapUnwrapping/index.html


Can I cut a hole in a mesh using only a subsurf modifier? In the Blender reference manual page "Subdivision Surface Modifier", in the "Combination" section, there's a file called WoodBlock.blend that apparently shows that you can use the subsurf modifier only to make a hole in a mesh. Can it be done with only a subsurf modifier? I tried to do it myself using my own mesh and with mean creases, but it's not turning out as I expected.

The edges of the hole I made aren't round like the ends of the mesh are (and like they are in Woodblock.blend).

I see that there's a similar question to this one, but I don't know if that person used a boolean modifier to make the hole itself or used a subsurf modifier.

What you see in the manual example is currently (2.75) still achievable (and probably will be for long time..).

If your test has not the same result, maybe you should check the mesh. Notice in the image below how the presence of an additional vertex near the cursor led to a non-rounded edge (as like a loopcut would do) while in the other side the edge is rounded.

You may want to remove doubles, look for hidden vertices/edge/faces, check topology in general...


Workflow automatization question (macro recorder/command playback) I have a cube. I select a face of it, and do the following 3 steps:

Insert face
Extrude face
Resize face

Is there a way to save these 3 actions to be able to use on any other faces? Like a hotkey/macro to improve the workflow. What keywords to search for this?
Thanks for your help!

I use the free command recorder addon for this very thing and it works well.  It has apparently been changed to action recorder and is developed by the same author.  I haven't tried this new version yet though.  You can find details here.
Action recorder


Non-smooth curve and taper I would like to make a bent cylinder with varying radius. Taper and Bevel seem like a good way to do this, however, I would prefer that the Taper curve is not a spline but a polyline, so that I can make sharp edges.
Ideally I would like it to be a profile function R(t).
EDIT: Below is an example of what I'm not really interested in. It should be a lot more... edgy...

You can use a "screw modifier" instead of a taper object.

The first shape above is the selected edges with a screw on it.
Then it is curved (second and third objects below it).
Depending on what you want:

The second also has a bevel and subdivision to keep sharp edges but follow the curve smoothly.

The third only has a curve.


Binding the vertices of one object to the vertices of another object? So I have three separate mesh objects here. There's the gray one on the left, the red one in the middle, and the gray one on the right.

I need to make it so that if I move the object on the left, the corresponding vertices in the middle object with follow the vertices that they are on top of now.

The end result that I am trying for is to be able to move either of the gray objects, and have the red bit in the middle stretch so that it will always be going from the left gray object to the right gray object. I'm hoping there is some way to do this that is easier than writing a complex script.

You could use an armature. A simple rig with two bones is all you need. The left bone will move the left side of the red object and the left outer object while the right bone does the opposite. You could either use weight painting or manually create the vertex groups in the centre object, with the side objects you can parent them to a bone instead of using an armature modifier.


Using volumetrics in Cycles I have to have the light strength super high I have to have a spot lamp strength VERY VERY high to have these light rays come through 300000.0 and look good.  Sounds crazy doesn't it.  Maybe it doesn't matter but it doesn't feel right.  Will I start to have problems if add other elements?

Lamp Size: .2
Lamp Strength: 300000.0
World Volume: Volume Scatter World Volume Density: .05
World Volume: Homogeneous: True
Render Sampling Settings Clamp Indirect: 3.0
Rendering No Caustics: True

There are several considerations here:

Spot lamps and sun lamps are quite different (I suspect you are using a spot lamp to simulate a sun lamp, as sun lamps are not yet supported with world volumetrics).

Spot lamps must be placed far away in order to simulate a sun lamp, as spot lamps diverge, while sun lamps do not. Sun lamps do not have a fallof, while spot lamps do.
This means that using a spot lamp like a sun lamp will either require big strength values, or constant falloff (which you can do with the Light Falloff node):

The World shader fills the entire scene. The manual explains why this problem nicely:

. . . the world surface shader or sun lamps will have no effect if a volume
shader is used. This is because the world background is assumed to be
infinitely far away, which is accurate enough for the sun for example.
However for modelling effects such as fog or atmospheric scattering,
it is not a good assumption that the volume fills the entire space, as
most of the distance between the sun and the earth is empty space. For
such effects it is be better to create a volume object surrounding the
scene. The size of this object will determine how much light is
scattered or absorbed.

This means that the light from the spot lamp is being absorbed before it even gets to the scene, and since the spot lamp is probably rather far away from the scene if it is being used to simulate a sun lamp, this will have a very significant impact on the amount of light reaching the model.

No ambient illumination with world volumes, for the same reasons as with sun lamps. This means your lamp is having to provide all the illumination for your scene.

#The solution
A solution to these issues is to use a object surrounding the part of your scene which you want to be dusty/foggy/whatever instead of the world volumetrics. In this case, you probably only want the inside of your hallway to be dusty, so create an object surrounding that portion:

And disable world volumetrics (by editing the world material node setup).
This means that we can use sun lamps (of course, you can still use spot lamps too), and the surface output of the world shader will contribute to the scene again.
There is one problem, putting the camera inside a volume object is not currently supported. Update: camera in volume is now supported as of this commit. This will be in 2.73 or any recent build.
Until then, this can be worked around by placing the camera inside a cube or sphere and using a difference boolean modifier on the volume object to subtract the cube from it (you can also parent the "camera case" to the camera, so that it goes where the camera goes). Also be sure to hide the the "camera case", so that it does not show up in the render:

#Result
For comparison, here is the scene rendered with a spot lamp (with constant falloff):

And a normal sun lamp:

Also see:

The manual on volume rendering

Correct way to render crepuscular rays in cycles?

All that said, in the end it comes down to what looks good ;)
If world volumes + a very powerful spot lamp is working for you, than there is no reason not to do that.


cannot draw on texture Im new and I am currently making the donut. For some reasons I can't paint on it, does anyone know how I can solve this problem?

From what I'm seeing, you need to add a texture paint slot, found under the tools tab at the very top. Just click the part that says "add texture paint slot" pick "base color" set the resolution and I ASSUME that will fix your problem.


Morph Text from Horizontal to Curve above How is the best way to morph text from a Horizontal to an Arc above it?  When I add the Curve Modifier to my Text it instantly get transformed.  Thus, I am unable to lock (keyframe) the start.  Can someone please guide me in the right direction?

Thank you

Shape Keys!

I discovered the Shape Keys for the Curve and used them to animate my Curve.

Here is a more complete answer: How to animate A curve segment?


Why are there gaps in my object? I would like to know what went wrong here. I'm learning with tutorials and it seems I did something different.

When I started sculpting it appeared that there is a gap without texture around the top. I do not have the gap problem on the second picture because there are the 2 holes missing on the upper side. For the holes I did it with separate loop cuts and then extruded and again some loop cuts for smoothing the edges.

But why do I have the gap? Can anyone tell me what I did wrong?

I think it has to do with the sculpting engine. What is happening is the faces are being smoothed or deflated, etc. (basically shrunk) and one will go into another. you can see this if you deflate a default sphere or something. To fix it, smooth, inflate, flatten until it appears to be fixed again.


making a blender addon (in python) that has a keyboard shortcut and works in edit mode (not object mode as per example) I am trying to make a blender addon using this template (last example on page):
https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html

I have successfully got my addon to work with a shortcut (I override the plus and minus keys), but when flicking to edit mode, the shortcut no longer works.

The example only shows how to make a shortcut for object mode.

How can I make a shortcut for edit mode?

i found you can use the keymap word "Screen Editing" instead of "Object Mode"

object_mode_keys = wm.keyconfigs.addon.keymaps.new(name='Screen Editing', space_type='EMPTY')


Slide selected verticles along an edge I am trying to move a selected portion of my model along an edge which is not parallel to any of the axis. I have to do this multiple times and I was wondering if there is a smart way of doing it.
Green is the edge on which I want to move the selected vertices up in the arrow direction .

Select an edge you want to move along, then expand Transform Orientations combo-box and click on a + sign to add a new orientation. Now select the vertices you want to move and move them along green Y axis (G, then Y shortcuts)


Looking for suggestions on ways to animate images in a 3 dimensional matrix of cubes I want to create a 3 dimensional matrix of cubes and have each of those cubes represent a pixel. I'm looking for an easier way to animate those pixels. For example I would like to create a low resolution figure walking through the matrix, that figure being made out of the pixels. The pixels would not move, only the material color on the pixels would change as the figure moved. It would be like a very low resolution monitor in 3 dimensions. For simple shapes I could just do it mathematically through scripting but wondering the best way to do it with other shapes. For example I was wondering if there is a way I could animate an armature and then map that movement onto the 3 dimensional pixels. Anyone have any creative ways that may simplify this rather than animating each pixel or doing it mathematically. I am new to animation so may be missing something simple here.
Thanks

I have the same exact questions a few years back ago. You can perhaps use Blender Modifier to achieve that, see REMESH modifier.

Actually you can do it today a lot easier using Add-On like Sverchok or Animation Nodes.

The key answer is: VOXEL GRID. Imagine you have 3 dimensional empty point matrix, it can be in any resolution, but remember 10x10x10 is equal to 1000 and that 1000 matrix position will be replaced with geometry.

I think the most efficient way to do this is by using Particle Instancing, but you can set it up using Sverchok pretty easy.

Now for 3 dimensional empty point matrix, you either have it ON or OFF. ON means draw the Voxel. OFF means do not draw it, leave it empty. (In a more complex setup, you can have Voxel in different sizes.)

You can "fill" and draw the actual voxel box using all kind of methods. Whether using 3D Texture, or using animated deformed mesh using Armature that draw the points when it is inside (see BVHTree of Blender).

There is no simple one answer to this. You can perhaps use Cycles Material to draw Voxel Volume Grid.


How do i select an object that is separated from other objects I was watching a tutorial on texturing. There was shown a way to separate the glass part of the windows so you won't keep on clicking on them while you're texturing which I admit made things a lot easier.

Now I want to work on texturing my windows but I have no idea on how to select them. They aren't on a different layer. If there is a clip board option on here I haven't found it yet.

Because you mention the object is separate from other objects, I am thinking that selection may have been disabled on the object you can't select.

In order to enable/ disable selection on an object you can click on the arrow next to the objects name in the outliner.


Creating a Stereoscopic video from a Movie Clip using Blender Compositor I am trying to use the blender compositor to perform this conversion process to create a SBS video for use on Google Cardboard.

In principle it works by manipulating each individual frame in a movie clip (1280x720 resolution). I basically sample two images from each frame with one image offset horizontally 26.9% to the right of the other. Both these samples together constitute one SBS frame in the VR movie file.

This is my current node setup within Blender. However, the second region of the SBS frame doesn't render correctly. How do I fix this? I also need to render straight to the video file in mp4 format.

Ok with a few modifications finally have the frames displaying correctly but cant find a way to output directly to the video file. The still images are not of high quality especially with HD cameras alot of screen tearing. MP4 work better.VLC media player does a much better job extracting stills but cant get this outputting every single frame.


Anti-Aliasing in GPU shader Module(OpenGL) How to smooth the bound of the shape?
If you run the following script in blender,
you can see the Jagged Edge in that shape.
import bpy, gpu, bgl
from gpu_extras.batch import batch_for_shader

vertices = [[150, 41.52], [150, 71.52], [56, 234.39],
    [30.0, 249.4], [270, 249.4], [244.02, 234.39]]
indices = ((0, 1, 2), (0, 2, 3), (2, 3, 4), (2, 4, 5), (0, 1, 4), (1, 5, 4))

shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR')
batch = batch_for_shader(shader, 'TRIS', {"pos": vertices}, indices=indices)

def draw():
    # bgl.glHint(bgl.GL_POLYGON_SMOOTH_HINT, bgl.GL_NICEST)
    # bgl.glEnable(bgl.GL_BLEND)
    # bgl.glEnable(bgl.GL_POLYGON_SMOOTH)

    shader.bind()
    shader.uniform_float("color", (0, 0.5, 0.5, 1.0))
    batch.draw(shader)

bpy.types.SpaceView3D.draw_handler_add(draw, (), 'WINDOW', 'POST_PIXEL')

So, I try some code to smooth the bound.
bgl.glHint(bgl.GL_POLYGON_SMOOTH_HINT, bgl.GL_NICEST)
bgl.glEnable(bgl.GL_BLEND)
bgl.glEnable(bgl.GL_POLYGON_SMOOTH)

But it has some gap inside. I am no idea how to fix it.

You don't actually need any code to make the edges curved or smooth. Go to edit mode and select all the edges of the cube. Then select bevel, which is this option

And then you will see a yellow line with a circle on top of it. Pull it to the extent you want. You may see it becoming flat. But there's an easy solution. At the bottom left, there would be a bevel option with a dropbox. Click on the triangle near it and select segments and set it to ten. Below's the image of how the bevel segment looks like. Make sure to be in edges and not vertices.


Help for wall pattern Anyone knows how to do that type of wall pattern please ?

Best regards

You could:

Create a plane, subdivide:

Give it a Decimate modifier / Collapse mode, with a ratio of 0.5, apply:

Select all in Edit mode and CtrlT to triangulate:

Then CtrlF > Poke Faces:

Bring a bit more chaos with some vertices move if you want, then select one triangle center and ShiftG > Amount of connecting edges to select all the triangle centers:

Move them up:


How to fix the connected edge problem? The picture on the right should be the right result. I am following a tutorial.
Mine is on the left. There are gaps on the top and bottom, they would not close up. Can anyone help?

I used Array modifier and use an Arrow empty to make the circle closed.

You have to check "Merge" And also "First and Last" in the array modifier. You can tweak the merge distance if there is still a gap. Your relative distance should be 1.00 on the array axis for it to work out of the box.

Alternatively, with Blender 2.82 and onward, you can use the weld modifier and set the distance threshold accordingly. This modifier merges vertices which are closer than the threshold.


Compositor Time Node Cap Trying to set the end of my Time node to a big number but blender won't let me stopping at 32,767. After some suspicious poking it turns out that is also 2^15-1. Is this a bug in Blender or a limitation in the language Blender was written in? Any workarounds in the meantime <edit>like with a script or something<edit>?

Specs:
Blender 2.80.74
2015 MacBook Pro (buy necessity not by choice)

This is not a bug, it's simply the current limit because the underlying data type is short. You can retrieve the upper and lower limit for the property through

bpy.context.scene.node_tree.nodes["Time"].bl_rna.properties["frame_end"].hard_max

and

bpy.context.scene.node_tree.nodes["Time"].bl_rna.properties["frame_end"].hard_min

which are 32767 and -32768 respectively.

The reason for this is because Blender uses two variables custom1 and custom2 of type short declared in DNA_node_types.h for various node properties. This includes the start and end frame of the Time node as can be seen in static void def_time(StructRNA *srna) from rna_nodetree.c.


How do I disable texture filtering? I have a model that is simple and uses low-resolution textures. I'd like to be able to disable the texture filtering so that the textures look sharp and pixels stand out.

An ideal answer would explain how to do this in not only the regular 3d view, but also in renders and preferably also in texture previews.

For the 3D view go to:

User preferences > System.
Then under the OpenGL sub header, you will find "MipMaps" make sure that box is unchecked.

For Blender-Internal go to:

Texture Buttons.
Image Sampling Panel.
Toggle MIP Map button.

Update

As of blender 2.71 texture nodes now have an option to change the interpolation method:

Using Closest will keep the pixels sharp.

Old Answer

For cycles, this is a needed feature. Here's a workaround (32 is the size of the texture) :


Why are some edges not visible/ covered by mesh? So i am watching a blenderguru tutorial (Blender Beginner Modelling Tutorial - Part 4: Final Touches), but some edges are not visible. I am at a point where i seems to affect the workflow and i´m making mistakes.
I followed the tutorial accuratly, but i can´t explain why this doesn´t appear in it/ isn´t an issue.

Try enabling the "Ajust edit cage ..."  button in the subsurf modifier header


How to properly paste Python function block into python console? Hi i have some questions :

i want to paste block of function into the python console and got a lot of indentation error. Is this a bug or do i miss something ? i'm using 2.79.
I'm new in coding. What is the best IDE for doing interactive debugging regarding building python code/function for Blender ?

Anyone can help ?

class VIEW3D_MT_edit_mesh_looptools(bpy.types.Menu):
    """    LOOPTOOLS    """
    bl_idname = "loop.tools"
    bl_label = "LoopTools"

    def draw(self, context):
        layout = self.layout
        layout.operator("mesh.looptools_bridge", text="Bridge").loft = False
        layout.operator("mesh.looptools_circle")
        layout.operator("mesh.looptools_curve")
        layout.operator("mesh.looptools_flatten")
        layout.operator("mesh.looptools_gstretch")
        layout.operator("mesh.looptools_bridge", text="Loft").loft = True
        layout.operator("mesh.looptools_relax")
        layout.operator("mesh.looptools_space")

There is a solution, usually when I encounter this problem, I replace "TAB"'s with spaces. Here is the interesting thing, you can replace a "TAB" with any number of spaces. You could replace a TAB with a single space, or multiple spaces.

Now, for the second part of your question, any text editor that allows you to set "TAB" to spaces, so in "sublime text 3" which I use you would go to "view"->"indentation"->"Indent Using Spaces".

Here is the fun part, "TAB" with in a python file is not a problem for the python interpreter, it works fine. Its just an issue when you pasting to the command line.

Also, I don't know what your question has to do with Blender, this should be an S O question.


Is there any way to save different Startup Files? So, I like to change, create and edit the Screen Layouts according to what I am going to do in Blender. But recently I had some problems because I have to much Layouts and it is hard to change between Motion Tracking and 3D View (for example).
Is there some way to save different startup files and when I want to do some VFX I open a type of Blender with only some screen layouts that I set and when I want to just model something I open a different startup file with just screen layouts for modelling?

Not currently natively supported, but it is planned for future 2.8 versions.

However nothing stops you from having several template files saved somewhere safe in your computer, and opening them as startup templates.

Create a "Startup Files Library" somewhere in your hard drive, and save all your desired startup files there.

You can add the folder as favorite to Blender's built in file manager, and readily open any file from there whenever you require a specific task.

If you open them frequently they may even get listed in the splash screen at startup for easier access.

One other neat trick you may use is to manually lock your recent-files.txtas read only, and manually edit it to include only your desired startup files, if you don't mind loosing the convenience of having other recently opened projects readily accessible that is.

It is just a simple plain-text file with one file path per line, so you can edit it externally with any notepad like or programmer's plain-text editor editor.

If you know how to code you can also use the Python API or create an addon for your convenience.

You may also create several desktop shortcuts (or Start Menu or saved them anywhere else you like) each with a different command line parameter, specifying a passed file for Blender to open, effectively starting it as a template. All you have to do then is Save-As to the desired location.


Surface cannot be created with nurbs curves by pressing F key I followed several tutorial to create a nurbs curve, and duplicate it in edit mode. Of course I pressed A key to select all points and F key to create surface. But there was no surface be created, a start point of one curve and an end point of another point were connected instead.

Is there anybody get any idea about this case?

You simply need to use one of the Nurbs Surface types. Add > Surface > Nurbs Curve

A Curve, whether a nurbs or bezier is only a stroke. It can not have volume, it is only ever a line.
A Surface is a full 3D solid that can have volume. All the expected commands will work: Fill F, Extrude E etc.


Help with modelling rocket fin I'm trying to model a simple rocket but got stuck at the fins.
I've made the rocket body, then proceeded to extract two faces from the place I want the fins to be attached to and converted the faces to a path. There's another path that show the path I want the fin to follow, like in the following picture:

The problem is that when I select the fin guide and select the fin profile as bevel target, I get:

What I was expecting is that the fin begin at the path selected in the first image, and be face to face with the rocket body, something like in this 2d sketch:

How do I achieve what I want?

Personally I would do this with simple mesh modeling.

Start with one vertex and Extrude it to create faces. F2 add-on (bundled with Blender) could be your friend here.

After making the shape you will need to snap it to selected edge on Rocket body.

At the end you can use this method: How to make a circular array using offset object as center? to position your fins and add Solidify modifier.


Node wrangler not appearing even when enabled in User Preferences Screenshot here:

Here you can see:

Node Wrangler is enabled
Node Wrangler is not appearing in the panel
I'm using v2.77

How can I fix this?

Looks like in this version, it's simply in the left-hand panel rather than the right-hand one (not sure what their proper names are):


Is it possible to reset the render view zoom level to 1:1? After I have rendered an image I often want to zoom in and out to get a good look at it and check for problems etc. However, I don't know how to reset the zoom level back to 1:1 (1 image pixel = 1 display pixel). I know I can just save the render and look at it in an image viewing application, but I was wondering if there is a shortcut or toolbar button somewhere that will reset the zoom?

You use Numpad 1 to get a 1:1 zoom ratio in the Image editor. If you go to View in the header, you can see all the options there.


Motion blur still showing after particles hit a sticky plane Here is a simple particle system hitting a plane with the collision on and also with a high stickiness.

The objects marked with red have already landed and still have motion blur. The orange has just landed.

For comparison motion blur vs turned off:

How can I fix this?

Edited:

If this is really a bug, as commented on @Yann Masoch's answer, is there a workaround? probably converting the particles to rigid bodies, a mesh, a compositing trick, etc.

In your case, you will have better results with the following Motion Blur settings:

Position: End on Frame
Shutter curve: 1st curve or 3rd curve (sharpest image)

Just play with the Position and the Shutter curve to adjust the Motion Blur effect.


How can i apply a PNG logo on my material? I have a project with a material I want to add to my sphere. I want to add this logo onto the sphere. I have tried various ways of uv mapping but I keep messing up :/

This is my current material setup:

And here is what I would like to have:

EDIT:

I have now changed my setup like the answer stated, but my material still changes with the PNG, so it becomes black although my material is red

MY SETUP (NEW):

Something (probably a small setting) is stil wrong, but I can't figure it out.

you need a "Transparent BSDF node (see image). PM if you get stuck


Resetting location doesn't work alt + r, g doesn't reset. after in and out in edit mode same weird rotation problem occurs.

You have keyframes on your bones. You can examine them in the action editor, which you have opened on the left side.

After resetting the transformations, you are entering edit mode, then entering pose mode. On reentering pose mode, the fcurves are reevaluated. Since the keyframes are extrapolated horizontally your pose bones have values.

Remove the keyframes to completely reset the transformation. Or reset the transformations and create new keyframes with I.


my huge file size is causing blender to freeze every few seconds this is not normal and its a fairly simple low poly scene as well with no textures and materials yet. i have multi res for some sculpts but even when its off it lags like crazy. i have done far more complicated projects that took up a fraction of the file space. i have compress files enabled by default, looked through the outliner and see nothing unusual, even tried appending everything into a new file and it was still the same. please help because working on it is almost impossible and i need to finish it for my assignment.

https://1drv.ms/u/s!AlP6LHpiuaPjgR1yBwVETzMm23nc

The scene takes up almost 2 GB RAM, if you are indeed using an old laptop, this might be the bottleneck, especially if you have a web browser open with a few tabs, too.
In windows you should always have an eye on the task manager, especially the performance tab.

As Anders, I would not call this low poly aswell, with almost 50k polygons. That is why rob suggested to delete the heads, as they are making up the majority of those. You could however dissolve a lot of edges, too...


why there are just 4 options for rendering animation? I need to render animation and there are only 4 options to render.
I select png. at the output and then are only AVI raw, AVI jpeg, frame server and FFmpeg video options. I want QuickTime or another format.

what shall I do? I have the latest version installed.
it runs on an iMac with graphics Radeon Pro 580 8192 MB and

Those settings actually exist under FFmpeg video. The options for containers and codecs are under the encoding options just under the output options


Prevent texture deformation when mesh deforms I have a plane, which has a texture UV mapped to it.  Let's say this plane is square and the texture is square.

I am trying to make a mouth (basically an opening in the plane which will have teeth, tongue, etc. that goes "down into" the plane) in this plane, but not deform the image on the plane.  Now this mouth will change shape, particularly when speaking (which I will do using shapekeys), and I don't know how to prevent the texture from getting deformed when the mouth is getting deformed due to speaking.

Now, I have found a modifier called UV Project, however, that does not work in Cycles, which is what I'm using.

So the main question is: How can I prevent a texture from deforming due to the mesh moving?

Edit  Added a .blend file, it should have the texture packed into it (a 1000x1000 pixel png).  I have made some vertex groups on the "Face" object, with the teeth.  Shapekeys and inside mouth color not finalized yet, so they are not in this .blend.

So I took Todd McIntosh's advice on messing with the mesh to try to prevent it from deforming, and I have (IMO) good results:

This image has the top and bottom of the mouth not closed at all, but the sides "fully" (only partially due to how my texture will work) closed using shapekeys.

Basically loop cut and slide a ring around the edge, then from the loop extrude and scale in.  Make sure to only scale in on the X and Y axes, or whatever two axes you want to prevent the surface from bowing in.

I have the shapekeys set up so that the sides of the mouth can't come more than halfway to the center, but the top and bottom can go all the way.  There is a little bit of intersection if you have the top mostly closed, and the sides all the way in, but for my purposes, I can work around that.

And here is a blend file with some shapekeys and vertex groups if you want to test.


Blender 2.8 Objects move when Export to Unity I'm hoping I don't have to start over, but I am pretty new to blender and I am not sure if I set up the rig correctly. I have been unable to find a solution, or the proper set up for objects that move based on an IK arm in Unity. I tried baking the animations but that did not work either. Any ideas how I can fix this? Thanks.

You need to export in your T pose or your rest pose, should be found in blender on your first IK animation frame.


What do these build warnings mean? Whenever I build blender from source (2.8), I get a number of these build warnings. What do they really mean? And will it affect the performance of the built binary in anyway?

This warning stays on screen for a long time before the build proceeds and again stops on a similar warning with just the numbers updated. What do they mean?

Don't worry about it.

Compiler Warning (level 1) C4005
'identifier' : macro redefinition
The macro identifier is defined twice. The compiler uses the second macro definition.

In most of the programming language, warning often mean bad code structure that might let the compile process work in a bad situation. But most of the time it just indicate the programmer that there might be a better way to implement the code.
And in this warning (C4005). It is fine for any performance issue since the compile should handle it correctly by ignore it or replace it. And in the source code they should be the same value and it's a minor thing in my opinion.
Only if you try the build and find out there are something wrong, you should check back if there is some bug in source code. And most of the time those bug will raise an error and halt the compile process.
Advise
If you care about those thing, you can search those warning in google or something else. With the key word after your code path, e.g. warning integer conversion resulted in a change of sign


How can I check face selection in edit mode How can I check if the mesh in edit mode has polygons (Faces) selected or not via Python? I use Blender v2.79.

I am working on a face selection check for a tool. If no polygons are selected in the mesh, the output console should print('No Faces Selected'), if polygons are selected in mesh, print('Faces are Selected') instead.

Polygons can be accessed in Python from the object data. So we start at bpy.context.object.data.polygons to retrieve the polygons of the active object. Note that I assume the object is in Edit Mode. This yields a list of polygons, which then can be checked for selection by accessing the select attribute.

To check the first polygon in the mesh for selection state, use:

bpy.context.object.data.polygons[0].select
# this returns True if the first polygon is selected,
# or False in case it is not

To get the selection state for all mesh polygons, you can use list accumulation:

print([x.select for x in bpy.context.object.data.polygons])
# for the Default Cube, this should yield:
# [True, True, True, True, True, True]
# IF all faces are selected. Play with selection to see the change,
# but remember to tab in and out of Edit Mode to make Blender aware of the
# selection change before running the code again

Now, if you just want to know if there is at least one polygon selected, you can query if True is in that list:

print(True in [x.select for x in bpy.context.object.data.polygons])
# this prints True if at least one polygon is selected

An IF-statement now could be:

if True in [x.select for x in bpy.context.object.data.polygons]:
    print('Faces are Selected')
else:
    print('No Faces Selected')


Weird reflection on glass from specific angle I am having a really hard time finding what could be wrong here. I need to have a basic transparent glass, with some light reflections but still transparent. Just how the glass is in the real world. It seems great to me finally but in some angles (from which I also need renders) there is a weird reflection that is not transparent at all so it looks like a mirror. I searched a lot, but I could not find anyone having a similar issue.
I tried glass materials from blenderkit/youtube/mine and it is a thing with every glass material so I guess there is a problem somewhere else. It is even weirdly deformed right where the reflection starts. I am not sure, how to attach the project here so I tried to screenshot everything.
I would really appreciate any help, thank you very much in advance.

Check that your normals are pointing in the right direction and that your glass has 'thickness' rather than being just a single face. Reflection like that which your are seeing would indicate that the normals are pointing in the wrong direction, resulting in "total internal reflection" when light is incident at above the critical angle.


Im trying to import an stl file to edit for 3d printing, however, when i import it, the file loads as a single point I thought it was a problem with the file, but it loads into my slicer and windows 3d viewer just fine. i tryed upscaling the model to see if it was just tiny, but nothing happened is when I realized it spawned it as a dot. other files are importing the same way. anyone know how to fix this?

scale down to 0.001 and you will see your model. you can apply transforms by hitting Ctrl+A and selecting scale.
point: if you check dimension values you will see big values. It means blender has imported vertices but they are not in our view.


Is Backface culling possible in render mode? Let's say I have an 3D object (semitransparent) which contains another object in it. To make it more visible I used backface culling which really works fine in the solid display.
When I try to switch my view of the object from solid into rendered it seems like the backface-culling doesn't work in render mode.
Is it possible to keep backface-culling in rendered view?

Thanks for the answers!

Select the material that you want to be with Backface Culling and enable Use Shader Nodes.

Open Node Editor and select the material you are using in the Material Node.
Add Geometry Node and connect Front/Back socket to Alpha socket in the Output Node.


Using Scripted Expressions for Shape Key Drivers I am having trouble finding an example of how to use python scripts to drive shape keys, as opposed to using python scripts to move bones which animate the characters mesh through Bone Driven Shape Key animations. In other words - is there a way of changing the shape key values in the BGE during game play that is simper than accessing the bones which are tied (using Drivers) to the shape keys values?
Here is an example of Bone Driven Shape Key animations http://vimeo.com/21357304 if it is not clear what I am referring to (go to 15:20 on-wards).
Thanks guys!

I don't see a way of accessing the shape key value from within the game engine. A mesh object is copied to a KX_MeshProxy for use in the game engine, which only gives access to the mesh and materials. This would mean that we need to use either drivers or actions to animate shape keys within the game engine.

If you have a driver setup that uses the bone position to control the shape key then you need to move the bone to control the shape key. You can create an action that moves the bone and can easily be played in the game engine.

Without using a driver you can create an action that keyframes the shape key value and then play that action in the game engine. Use the Shape Key Editor instead of the Action Editor (both are subtypes of the Dope Sheet). Shape Key actions show up in the same list as normal actions.

If you don't want to play an action from start to finish then you will want to have a driver that simply sets the shape key value to an object's X location. You can add an empty just for this purpose and move it in small increments to set the shape key value to the value you want at the time you want it there.


Import 3D XML in Blender or convert it with another tool I would like to find a way to import 3D XML (zipped file with XML Data and textures) files into Blender or find a workaround without using 3dvia, or AutoDesk to convert it.

I know there is a python script for Blender 2.49. But I can't get it to work (http://kiwi6.com/file/6u3rxha3zw).

Free 3D XML files of Rotterdam are available here: http://rotterdamopendata.nl/dataset/rotterdam-3d-bestanden

It's cool that they have put these models online, but to work with them...

PS: I know XML isn't a 3D format, but a Markup Language.

Import Citygml Model

Textures applied to Zuidplein model.

I've merged all the scripts into 1 for convenience, would envisage splitting them up if made into an addon.

import bpy

from mathutils import Vector

##### Refactor to own file citygml.py
class Texture:
    def __init__(self, id=None, path="", map=""):
        def unflatten(coords):
            return [Vector(float(x) for x in coords[i:i+2]) for i in range(0, len(coords), 2)]
        self.id = id
        self.path = path
        self.map = unflatten(map.split())

class PolyGon:
    def __init__(self, id=None, pts=""):
        def unflatten(coords):
            return [Vector(float(x) for x in coords[i:i+3]) for i in range(0, len(coords), 3)]
        self.id = id
        self.verts = unflatten(pts.split())

class Building:
    def __init__(self, id="", name="", surfaces={}, textures={}):
        self.id = id
        self.name = name
        self.surfaces = {s.id: s for s in surfaces}
        self.textures = {t.id: t for t in textures}

class CityModel:

    def __init__(self, name="", upper_corner="", lower_corner=""):
        self.lower_corner = Vector(float(x) for x in lower_corner.split())
        self.upper_corner = Vector(float(x) for x in upper_corner.split())
        self.name = name
        self.buildings = {}
        self.images = {}

    def add_building(self, building):
        self.buildings[building.id] = building

    def build(self, scene, filepath, scale):
        import bmesh
        import os

        for k, b in self.buildings.items():
            keep_verts = []
            bm = bmesh.new()
            bm.verts.ensure_lookup_table()
            mesh = bpy.data.meshes.new(b.id)

            for sid, s in b.surfaces.items():
                verts = [bm.verts.new(scale * (v - self.lower_corner)) for v in s.verts]
                face = bm.faces.new(verts)
                texture = b.textures.get("#%s" % s.id)

                if texture:
                    uv_layer = bm.loops.layers.uv.verify()
                    tex = bm.faces.layers.tex.verify()
                    bm.faces.ensure_lookup_table()
                    for i,l in enumerate(bm.faces[-1].loops):
                        uv = l[uv_layer].uv
                        (uv.x, uv.y) = texture.map[i]

                    path = os.path.join(filepath, texture.path).replace("\\", "/")
                    image = bpy.data.images.get(os.path.basename(path))
                    if not image:
                        image = bpy.data.images.load(path)
                        image.use_fake_user = True

                    bm.faces[-1][tex].image = image
                    dubs = bmesh.ops.find_doubles(bm,
                              verts=verts,
                              dist=0.001)['targetmap']
                    if len(dubs.keys()) > 2:
                        keep_verts.extend(dubs.values())
            verts = list(set(bm.verts) - set(keep_verts))
            bmesh.ops.remove_doubles(bm, verts=verts, dist=0.001)
            #bmesh.ops.automerge(bm, verts=bm.verts, dist=0.000001)
            bm.to_mesh(mesh)
            building = bpy.data.objects.new("building", mesh)
            scene.objects.link(building)
            bm.free()

def read_some_data2(context, filepath, directory, use_some_setting, scale):
    scene = context.scene
    from xml.etree import ElementTree as ET
    cityxml = ET.parse(filepath)
    citymodelnode = cityxml.getroot()
    print("Importing citygml city")
    namespaces = {
           "citygml":"http://www.opengis.net/citygml/1.0",
           "core":"http://www.opengis.net/citygml/base/1.0" ,
           "tex":"http://www.opengis.net/citygml/textures/1.0",
           "gml":"http://www.opengis.net/gml",
           "bldg":"http://www.opengis.net/citygml/building/1.0",
           "app":"http://www.opengis.net/citygml/appearance/1.0",
           "dem":"http://www.opengis.net/citygml/relief/1.0",
           "tran":"http://www.opengis.net/citygml/transportation/1.0",
           "gen":"http://www.opengis.net/citygml/generics/1.0",
           "frn":"http://www.opengis.net/citygml/cityfurniture/1.0",
           "wtr":"http://www.opengis.net/citygml/waterbody/1.0",
           "luse":"http://www.opengis.net/citygml/landuse/1.0",
           "veg":"http://www.opengis.net/citygml/vegetation/1.0",
           "xAL":"urn:oasis:names:tc:ciq:xsdschema:xAL:2.0",
           }
    '''
    for prefix, uri in namespaces.items():
        ET.register_namespace(prefix, uri)
    '''
    bbox = cityxml.find("gml:boundedBy", namespaces=namespaces)

    name = bbox.find(".//gml:Envelope", namespaces=namespaces).attrib["srsName"]
    print("name: %s" % name)
    uc = bbox.find(".//gml:upperCorner", namespaces=namespaces).text
    lc = bbox.find(".//gml:lowerCorner", namespaces=namespaces).text

    city = CityModel(name=name, upper_corner=uc, lower_corner=lc)

    cityobjects = cityxml.findall("citygml:cityObjectMember",
                                namespaces=namespaces)

    print("importing %d city objects (#:buildings, X:non-building)" % len(cityobjects))

    for cityobject in cityobjects:

        building = cityobject.find("bldg:Building", namespaces=namespaces)
        if building is None:
            # ugly hack do for now.
            groundsurface = cityobject.find("bldg:GroundSurface", namespaces=namespaces)
            print("X", end="")
            if groundsurface is None:
                continue
            building = groundsurface
        else:

            print("#", end="")
        building_id = building.attrib["{%s}id" % namespaces["gml"]]

        rings = cityobject.findall(".//gml:Polygon//gml:LinearRing", namespaces=namespaces)
        surfaces = []
        for ring in rings:
            ring_id = ring.attrib["{%s}id" % namespaces["gml"]]
            poslist = ring.find("gml:posList", namespaces=namespaces).text
            surfaces.append(PolyGon(id=ring_id, pts=poslist))

        textures = []
        sdms = cityobject.findall(".//app:surfaceDataMember", namespaces=namespaces)
        for sdm in sdms:
            coords = sdm.find(".//app:textureCoordinates", namespaces=namespaces)
            if coords is None:
                continue
            sdm_ring = coords.attrib["ring"]
            path = r"%s" % sdm.find(".//app:imageURI", namespaces=namespaces).text
            textures.append(Texture(id=sdm_ring, map=coords.text, path=path))

        building = Building(id=building_id, surfaces=surfaces, textures=textures)
        city.add_building(building)
    print()
    print("finished importing, building...")
    city.build(scene, directory, scale)
    print("done")
    return {'FINISHED'}

from bpy_extras.io_utils import ImportHelper
from bpy.props import StringProperty, BoolProperty, FloatProperty
from bpy.types import Operator

class ImportCityGML(Operator, ImportHelper):
    """Import CityGML"""
    bl_idname = "import_dem.city_gml"  # important since its how bpy.ops.import_test.some_data is constructed
    bl_label = "Load City"

    # ImportHelper mixin class uses this
    filename_ext = ".xml"

    filter_glob = StringProperty(
            default="*.xml",
            options={'HIDDEN'},
            )
    directory = StringProperty()
    filepath = StringProperty(name="File Path", description="Filepath used for importing txt files", maxlen= 1024, default= "")

    use_setting = BoolProperty(
            name="Save to Text Editor",
            description="Make a copy of generated script in text editor",
            default=False,
            )
    scale = FloatProperty(
            name="Scale",
            description="Scale the model",
            default=0.05,
            min=0.01,
            max=10.0
            )

    def draw(self, context):
        layout = self.layout
        layout.prop(self, "scale")

    def execute(self, context):
        return read_some_data2(context, self.filepath, self.directory, self.use_setting, self.scale)

# Only needed if you want to add into a dynamic menu
def menu_func_import(self, context):
    self.layout.operator(ImportCityGML.bl_idname, text="Import CityGML")

def register():
    bpy.utils.register_class(ImportCityGML)
    bpy.types.INFO_MT_file_import.append(menu_func_import)

def unregister():
    bpy.utils.unregister_class(ImportCityGML)
    bpy.types.INFO_MT_file_import.remove(menu_func_import)

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.import_dem.city_gml('INVOKE_DEFAULT')

3-28-WITTE-DORP.xml

Witt Dorp with textures.

EDIT:

This is a non lxml version and works with the xml.etree version from blender.  The remove doubles code from Removing doubles on imported 3DXML ngon mesh has been added which greatly reduces the amount of verts.  Might post the lxml version on my github page if anyone is interested.


Bisect / Cut Along Vertices That Are Selected? Is there a way to select a group of vertices and perform a bisect/cut along them?  For instance if I drew a car's body, but want to then cut out the door so that it can open, what do I need to do to accomplish that?  Should I just select all the vertices and hit "P" to make them their own object or something?

There is a Bisect Operator that might do what you want it to.

3D View > Mesh > Bisect, requires a Face Selection

This allows you to split the mesh along a plane you can define by dragging, or numerically. If your Operator Panel is not open, hit F6 to show it. It come with a bunch of useful options, like

Fill, which fills the cut edges with faces
Clear Inner/Outer which remove one or both sides of the cut
Axis Threshold that gives the cut adge some fuzzines in where the cut-off happens.

If your vertices are already defining you cutting edge, it would be more efficient to simply separate the part into its own mesh by selecting it and hitting P to do Separate > Selection


How to make a transparent reflective surface with transparent film I want to make a mirror surface that is invisible, but still shows reflections. I found this nearly identical question but the only answer didn't work for me. It works great normally, but when I set the film to be transparent, the reflections disappear along with it:

The weird thing is that it looks fine in the 3D view:

My materials set up is exactly the same as in the question I linked above, with a transparent and glossy shader added together:

So is it possible to have both a transparent background and a transparent reflective surface in cycles at the same time? Should I work around it with some compositing?

In the end, I went with compositing an opaque background image underneath the transparent layer and that worked alright, but before that I used this node setup to set the alpha value based on the value of each pixel.

The Subtract node is used as a minimum threshhold. You might have to tweak that depending on your setup.

The first Multiply is just a messy way to get a definite 1 or 0 on whether or not the pixel should be visible or not.

The second Multiply is used to set the final alpha value for the partially transparent pixels.

The Add node at the end is just to make sure that no previously-opaque pixels become transparent.

In my case it ended up looking like this:


Move vertices to center of mirror modifier to join with other side I have this model and I would like to join the 3 vertices selected by moving them to the center of the mirror modifier.

How can I join up vertices with the other side of the mirror modifier?

Found out there is an option in the mirror modifier settings called clipping that lets me drag the verts right to the center and they will stop when they meet


How to know the name of the an active preset dropdown? Hello i created a custom operator preset system.

i'd like to know how to have acces to the name of an active preset. i think an example from any preset in blender could help me in my research.

There's no info about this anywhere.

Here is my set up

This is the code i was able to collect so far

#this is the correct code mut within blender ! no with my addon
bpy.data.window_managers["WinMan"].preset_name = "New Preset"
#call preset menu of nlender ! not my addon
bpy.ops.wm.call_panel(name="CYCLES_PT_sampling_presets")

#add a new preset
bpy.ops.scatter.custom_slot_preset_add_operator(name="Wow", remove_name=False, remove_active=False)
#execute a preset from my addon
bpy.ops.script.execute_preset(filepath="filepathofthepreset", menu_idname="Scatter_MT_C_Slots_PresetMenu")
#call preset menu
bpy.ops.wm.call_menu(name="Scatter_MT_C_Slots_PresetMenu")

i need to find the
bpy.data.window_managers["WinMan"].preset_name = "New Preset"
for my addon menu. i don't know how this is possible ?

Thanks to @AFWS

print(bpy.types.CYCLES_PT_integrator_presets.bl_label)

active preset is in fact the name of the bl_label


Why is snapping to the Grid in Blender 2.8 not (always) reliable for precision for centimeters? I've modeled objects that I wanted to adjust some vertices for so that way the edges would have an even measurement. (I use the Measure it tool to determine the distance between vertices.) However, I found that when I would use Absolute Grid snap to snap the vertices to the grid it wouldn't always give me a precise measurement despite the fact that I would have set the units I wanted (my units are set to centimeters).
For some reason the measurements work much better with meters, but for centimeters specifically, it seems like there's a slight margin of error.
I'll show what I mean.
The first 2 images are the same picture. One is just zoomed in a little more. As you can see both decimal points are on the squares of the grid and I made sure it was snapped to them.For some reason though the units aren't exact. It seemed a lot more exact with Meter measurements, but no so much with centimeter measurements. I then went back in and checked with the measure tool and snapped it to the 2 vertices shown on the picture and got similar results. I don't know why it's like this. Perhaps it's just something about Blender measuring the centimeters after you've transformed an object a certain amount of times. That's why I was wondering if there was a solution or work around to this.

A few things to note about 'Snap to Increment'

In Object Mode, it snaps the mean position of the pivot points of selected object(s), in Edit Mode, the mean position of directly or implicitly selected vertices.
It snaps to the grid increments you can see. (If you're zoomed in, the increments may be subdivisions of the increments when zoomed out)
If Absolute Grid Alignment is switched off, you are constrained to move elements by units of the smallest increment you can see. If switched on, you are constrained to move elements to the nearest grid point. (In the first case, elements won't necessarily wind up on a grid point)
Whatever your view, the snap is to an orthogonal projection down onto the grid you can see. If you're viewing at an angle, or in perspective, the snapped element won't necessarily appear to coincide with the grid you can see, until you adopt an orthogonal view straight down onto it.
If using in an orthogonal view, it will also snap in the dimension you can't see. (So for example, you're looking straight down Z, snapping in XY, starting off-grid in Z, there may be some unwanted movement to the nearest Z grid-point, unless you constrain the movement. (GShiftZ)

A few of these things might give you the impression the increment snapping 'isn't reliable', and can make it counter-intuitive to begin with . But it works as expected.

EDIT: This answer doesn't really answer the question, since it has become one about precision.. but I'll leave it up..


Filmic color management not installing getting this error when trying to install filmic color management:

I looked inside my color management folder and saw there was filmic files all over:
enter image description here

Any way it is downloaded but maybe not displaying or something?
I followed this tutorial precisely: https://www.youtube.com/watch?v=4nYGJI0r2-0

Blender 2.79 is bundled with Filmic already. Just download that and use it, no need to install anything else.

The error is caused by Blender trying to write to a write-protected directory. You can solve that by changing the directory permissions or running Blender as admin, but you should probably do neither and just use 2.79.