BGE: Basic Door & Key Logic I’m trying to create a door & key system in the BGE, but I’m struggling with the game logic.

I followed a video tutorial to understand the basics, but I found that method doesn’t scale very well since it doesn’t take into account (1)different keys being required for different doors, (2)some doors not requiring keys, or (3)the ability of non-player characters to open doors (planning to add this later).

The approach I’ve come up with is as follows.

Each door sensor listens for 3 conditions:

a player collision
an attempt by the player to open (interact) with the door.
a specific key (if required).

The door sensor is basically working. If its conditions are met it will cause the door to open.
The key is able to be picked up, and send some message (“got_key_a”).

What isn’t working is that the door sensor collision can’t seem to be set to evaluate whether property “has_key_a” is True. Instead it simply sees that the property exists on the colliding object (Player), and lets them open the door regardless of whether they’ve acquired Key A.

Another approach I tried was sending a Message rather than using a property. The problem there seemed to be the timing of when the message was sent. I guess that the message being sent once doesn’t satisfy the condition… rather the message must be sent at the same time the other conditions are checked for. Since it is never the case that a a key is acquired at the same moment the corresponding door is tried, this approach does not work.

Screenshot just in case it helps:

I am open to Python-based solutions too, as long as the code is thoroughly commented so that it can be easily understood.

Any help appreciated.

Update

I think my problem lies here. Instead of sending a signal only when has_key_a is True, it sends a signal if the property has_key_a exists.

I want has_key_a to be evaluated, but inserting expressions in the Collision Sensor is not allowed. What can I do instead?

If I use an Expression here I am unable to get it into the And controller. I must choose one or the other, but what I need is to combine them.

The door must be able to detect a collision with player who has_key_a==True and tries to interact at the same time.

A door key question deserves a dorky answer, so here goes...

I set up a Player and a Non-Player Character (NPC) which could just as easily serve as Player 2 in a 2-player game. Here I used it just for testing, although in a game it could serve as a scripted enemy or ally, or whatever. The point is that it can acquire keys just like the Player can.

Character Properties

These Boolean values go from 0 to 1 (False to True) when a key is acquired by the character.

(NPC has the same Properties as Player, except that it has the Property npc instead of player.)

Each character has its movement controls and an interaction control which can be used to (among other things) open doors when it is near them, and has the required key. Interaction from each character sends a unique message (either player_interact or npc_interact).

In order to add multi-key support, each character has a Sensor for each key, which all get fed into a Python Script Controller (keys.py).

keys.py

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

key_alpha_status = cont.sensors["GetKeyAlpha"]
if key_alpha_status.positive:
    own['has_key_alpha'] = True
    print("Alpha Key acquired!")

key_beta_status = cont.sensors["GetKeyBeta"]
if key_beta_status.positive:
    own['has_key_beta'] = True
    print("Beta Key acquired!")

key_gamma_status = cont.sensors["GetKeyGamma"]
if key_gamma_status.positive:
    own['has_key_gamma'] = True
    print("Gamma Key acquired!")

key_delta_status = cont.sensors["GetKeyDelta"]
if key_delta_status.positive:
    own['has_key_delta'] = True
    print("Delta Key acquired!")

key_epsilon_status = cont.sensors["GetKeyEpsilon"]
if key_epsilon_status.positive:
    own['has_key_epsilon'] = True
    print("Epsilon Key acquired!")

key_zeta_status = cont.sensors["GetKeyZeta"]
if key_zeta_status.positive:
    own['has_key_zeta'] = True
    print("Zeta Key acquired!")

Character Logic

The key objects themselves don't play a very active role in the logic. If touched by something having the property player or the property npc the given key will disappear.

Key Logic

Each door object animates through various States, the important thing being that animation is initiated upon receiving a Message unique to that door (open_door01, open_door02, and so on).

Each door has a corresponding sensor object that is an Invisible physics Ghost. It's just an area within which collision can be detected, as one condition that needs to be met for a door to be opened.

Door Sensor Object - Physics Settings

We don't want it to be possible for a player to open a door from across the room - unless that door is intended to be opened by a remote switch, in which case the sensor can be moved to the location of the switch instead of surrounding the door.

Each door sensor object's game logic does two things:

(1) Checks if a character is colliding with the sensor object (using two Collision Sensors that listen for player and npc Game Properties respectively), and (2) Checks if the character is attempting interaction (by listening for either a player_interact or npc_interact Message). This input gets routed to a Python Script Controller for that specific door type (door_alpha.py, door_beta.py, and so on).

Door Sensor Object Logic

Someone with better programming skills than myself could surely find a way to eliminate the need for individual scripts for each door/key type, but at least this works. It just requires preparing one .py script of each door/key type by doing a Find/Replace in a text editor to change require_key_beta and has_key_beta to require_key_gamma and has_key_gamma... if you follow what I mean. I've only prepared Alpha and Beta types for this demo, since there are only two keys. How many key types do you realistically need? (6 should be plenty?)

door_alpha.py

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

p_collision = cont.sensors["PlayerColl"]
p_interaction = cont.sensors["PlayerInteract"]

npc_collision = cont.sensors["NPCColl"]
npc_interaction = cont.sensors["NPCInteract"]

open_door = cont.actuators["OpenDoor"]

### PLAYER ###

#If this door requires a key, and player is colliding with it, and colliding player has the key, and a player interaction message is received:
if own['require_key_alpha'] == True and p_collision.positive and p_collision.hitObject['has_key_alpha'] == True and p_interaction.positive:
    print("Door unlocked")
    cont.activate(open_door)

#If this door requires a key, and player is colliding with it, and colliding player does NOT have the key, and a player interaction message is received:
if own['require_key_alpha'] == True and p_collision.positive and p_collision.hitObject['has_key_alpha'] == False and p_interaction.positive:
    print("Can't unlock this door without a key")

### NON-PLAYER CHARACTER ###

#If this door requires a key, and non-player is colliding with it, and colliding non-player has the key, and a non-player interaction message is received:
if own['require_key_alpha'] == True and npc_collision.positive and npc_collision.hitObject['has_key_alpha'] == True and npc_interaction.positive:
    print("Door unlocked")
    cont.activate(open_door)

#If this door requires a key, and non-player is colliding with it, and colliding non-player does NOT have the key, and a non-player interaction message is received:
if own['require_key_alpha'] == True and npc_collision.positive and npc_collision.hitObject['has_key_alpha'] == False and npc_interaction.positive:
    print("Can't unlock this door without a key")

The resulting output of the Python script (example:door_alpha.py) from the given door sensor object will activate a Message Actuator, which will send a Message with a subject such as open_door01, which I mentioned earlier.

Here are the parts of that code to pay attention to:

open_door = cont.actuators["OpenDoor"]

and within the IF statements:

cont.activate(open_door)

You know how the rest goes - corresponding door object receives the message, the animation of the door opening is triggered. Our player progresses and presumably has fun.

As for the animation of the doors, there are several ways to do it. Most will involve switching States. On my doors there are four States: Initial, Opening, Open, Closing. Closing loops back to Initial, in other words Initial is the same as Closed.

States can't be labeled directly, but labeling the State Actuator's destination makes it easier to keep track of what State should come next (In mine, the State Actuator of Initial is labeled "To Opening", for example).

Door Object Logic: Animating Through States

Door01 is basic, using Delay Sensors and Motion Actuators. For Door02 I wanted more control in animating individual parts of the door, so it makes use of Property Sensors (that evaluate if the Property frame is equal to a given frame, then change the State accordingly) and Action Actuators that play specific frame ranges of the animated Action and set the value of frame. Because Door02's animation is done using Actions, it is actually an Armature Object, with Mesh Objects parented to its animated Bones.

I think that covers everything. Enjoy playing with the .blend. If anyone has questions, comments, or ideas for improvement, I'm all ears.

(Made with Blender 2.79b)

Demo file screenshot:


How to to set fixed delta time for physics update? I need physics depended on FPS, not delta time. Or how to set fixed delta time, same for every frame for physics?

Blender as far as i know Blender not use delta time for physics, every frame the physics is  re-calculated.

To set the quantity of framerate per second go to Properties tab > render tab > Display > Animation frame rate.

To set the physics steps go to `Properties tab > scene tab >Physics > Physics steps``.


BGE: How to Change Active Camera with Python? While in the blender game engine, I am trying to write a code that makes it so that the player changes the active camera every time the space-bar key is pressed. This is my first time making a game with blender so I apologize if this question is "annoying for advanced users" or how "noobs shouldn't be allowed to use blender". I'm sorry I'm still learning in advance, though thank you to whoever takes the time to help me. Here's my code:

#Code to switch between 2 camera: cam1 = Camera and cam2 = Camera.003
import bpy
import bge

bge = bge.logic()
cont = bge.logic.getCurrentController()
own = cont.getOwner()

context = bpy.context
scene = bge.logic.getCurrentScene()

    if evt.type == 'SPACE': #if space is pressed

        if scene.camera == bpy.data.objects["Camera"]: #and the scene camera is cam1
            print("on camera")
            scene.active_camera = bpy.data.objects["Camera.003"] #then switch to cam2

        elif scene.camera == bpy.data.objects["Camera.003"]: #or if current scene camera is cam2 and space key is pressed
            print("new scene camera")
            scene.active_camera = bpy.data.objects["Camera"] #switch to cam1

I keep getting the error 'module' object is not callable in the console. Here are my logic nodes:

locPoint = scene.objects['EmptyPanningEnd'].worldPosition
scene = logic.getCurrentScene()
cam1 = scene.objects['panningCamera']
cam2 = scene.objects['playerCamera']

if locPoint != cam1.worldPosition:
    scene.active_camera = cam1
else:
    scene.active_camera = cam2```

https://blender.stackexchange.com/questions/90490/how-to-switch-to-another-camera-in-blender-game-engine


Embed media option for Fbx export I am currently using blender 2.78. There is no option to embed media while exporting objects as Fbx from blender. Is there a workflow or plugin to export textures along with the object, while exporting as Fbx from blender. Also will the option be available in upcoming blender release.

There is an option to do that, actually.
Make sure you're in Blender Render (internal) render mode, though, otherwise it won't work, in my experience.
In Fbx export options, under Main, look all the way down at "Path mode". Set that to "Copy" and make sure to check the little file-in-a-box button to the right (called "Embed textures").


If I press Shift + D to duplicate an object will it always be just one copy? If I press Shift + D many times and then click the Right Mouse Button, will I have many duplicated objects in the same place, or will it be only one duplicated object?

I ask because if there are many duplicated objects in the same place, how can I then select each one of them?  In object mode I can select each object by right clicking on it.

A duplicate will be created every time you press Shift + D and right or left click the mouse button.

If you only press Shift+D multiple times, but only click the mouse once, only one duplicate will be made.

If you're in Object Mode, then you can just right click each one as you said.

If you're in Edit Mode then right click to select one of the vertices and press Ctrl + L.  This will select all the geometry connected to that vertex.  Since none of the duplicates are connected, it will select each duplicated instance:


Change Display Color Of Wireframe object I made an object to act as an empty for the movement of my character.  I changed its display to wire frame, and I would also like to change the viewport color of the wire frame object to something like blue.  Is there a way I can do this without changing the color of every single wire frame object?

You can do it in Preferences > Themes > 3D Viewport > Wire


Rollercoaster Problem: Bones following Curve I'm trying to make a train mesh follow a curve path. The Curve modifier does this admirably, unfortunately I need to export the animation to a game engine so a modifier just won't do.

I tried adding bones to the mesh but it turns out making those follow a curve is not trivial. I copied the workflow outlined here by adding a second "helper" curve, making that one follow the path with the Curve modifier and putting a Spline IK constraint on the tail bone targeting the helper curve.

This works perfectly as long as my path is flat. Unfortunately, even the tiniest hill causes my train to flip over and do a full 360 (in direction of travel) around the track in one specific location, and I can't figure out why.

I tried all sorts of settings on both curves. Handles are aligned, twisting is set to Z-Up on both curves, and I added multiple Limit Rotation constraints to the bones. Nothing helps. It's interesting to note that when I set the helper curve to extrude, I can see that it stays perfectly upright when following the path:

So it's only the bones rotating, presumably because of the Spline IK constraint.

Please help, I'm going bald pulling my hair out over this. Any solution that keeps the wagons upright in this setup is welcome, though I'm also open to alternate suggestions on how to get them to follow the curve in the first place. I've uploaded the .blend file so you can take a better look at what I'm doing:

I managed to find a solution, but it's a bit of a hack. Most notably, the process involves baking the animation, so it needs to be redone every time you want to change the layout of the curve.

select every bone in the chain and make sure "Inherit Rotation" is turned OFF
keyframe your "helper" IK curve to whatever you want the train to do (I wanted mine to go full circle around the curve)
Add a cube or empty somewhere high up in the scene (doesn't matter what it is)
make a copy of the armature/mesh in case we want to go back
bake action (visual keying and clear constraints)
select every bone and add a locked track constraint to each one, targeting the cube or empty or whatever you added in step 3. Fiddle with the settings until it makes your train stay upright.
bake again and export for use in Unity or other game engine.

Simple, right? Repeat steps 5-7 every time you change the curve or otherwise modify the setup. I'd much prefer adding the locked track constraints without baking in step 5 to avoid this, but I simply cannot get that to work, the Spline IK constraint overrides my Y axis rotation. So this will have to do. If anyone has a better way to do this I'd be very much interested.


How to define an object in another layer? I have a second scene and using scene2.objects["obj"] isn't working. The object is is another layer, and I cannot figure out how to define it. I've defined "scene2," and there is no problem with that. How do I define objects in different layers?

Layers are properties of the object see this snippet:

import bpy

# create layers vector with only one layer enabled
def layers(l):
    all = [False]*20
    all[l]=True
    return all

o = bpy.data.objects["Cube"]
# set object to layer 2 only (layers from 0..19)
o.layers = layers(2)

# lookup scene by name
scene = bpy.data.scenes["Scene2"]
# link object to scene
scene.objects.link(o)


Adding several textures to subdivided/leveled plane Blend file (My plane is upside down, change view to bottom to look at it from above )

I've been trying to add a texture to the vertex group 'Floor' and another texture to the inverse selection of 'Floor' but I just can't get it to work.

When I use materials, the textures are not displayed. When I just add a UV map it works for the first time.
From the moment I try to add an image to a second UV map lots of things go wrong. The selection goes black, the first texture gets replaced, the first texture gets lost, very strange behavior.

This tutorial is exactly what I'm trying to achieve. I have to be missing something that someone with more experience easily discovers.

How can I achieve the results I'm looking for?

It has been a while, but in case other people are looking for a solution:

To see UV mapped textures in the viewport set to GLSL shading and textured view.
You will also need to have some lighting in your scene or in the material setting enable 'shadeless'.

I had no light source in my blend project, which explains why everything went black. This is where enabling 'shadeless' for the material comes in handy.

credits: "Richard Marklew - blenderartists.org"


How to simulate overexposure due to bright light? (Cycles) I try to make a animation where the light of my object gets brighter until the picture is white.
I only want that the intensity of the light rises, so that it looks like the light shines directly in the camera. Then the other objects in the picture should fade to white from the lightsource.
Unfortunately I didn't find a video to show you what I want.

I had a few ideas how I can accomplish that, but none of them worked.

1.I tried to increase the gamma of the picture.
But then the whole picture getting brighter at the same time, and thats not what I want. I want that it spreads from the lightsource.

I tried it with volume scattering, but there I have the same effect because I have multiple lights and all are effected by the scattering

EDIT:

I tried to do it with glare but that effects the whole image too.
With compositing and glare I get the glow I want. But I am not able to increase it so far that the screen gets white.

So how can I get the effect I want?

And even if its not good to ask two questions (but it belongs to my first question)
Do I have to render my animation again after the composing?

Here is a file if you want to look:

Ok I think I found a solution, for now.
It doesn't look realistc but better than nothing.
With this nodesetup its possible to increase the brightness to white and then spreading out from the source.

If you increase the value of the multiply-node the light is getting brighter.


How can I link one face data to multiple faces for uv mapping? I am trying to UV map a tire. It has multiple spokes but all spokes instead of being separate objects are joined with join tool to form a single object. And I am wondering if I can copy one data of spoke to  all the spokes?

CTRL+L copies the data in the object mode but since all the spokes are part of an object, I want to copy one spoke data to all the spokes in edit mode. Or is there any other way?

Thanks!

Quick answer: No, as far as I know there is no way to copy UV data between chunks of mesh belonging to the same object.

If the spokes are all the same they should be kept as separate objects, as instances sharing the same object data.

Anyway if you still want them as one object then

Select your spokes object
Enter edit mode
Select one spoke
Separate it from the main object using P
Exit edit mode and enter edit mode on your separate spoke object
Edit it as desired, and assign it the correct UV coordinates.
Now place the 3D cursor at the center of the wheel/spokes
Press . (Period key) to rotate around the 3D cursor
Copy your spoke object with Alt + D to make instances
Press R to rotate around the 3D cursor
Adjust the angle as desired and place as many copies as necessary

You may now join them again as before, and they will all have the same UV coordinates, although I think there are better workflows.

Either keep them as separate object instances sharing the same object data and that will keep them in sync automatically, or alternatively, if you need them as a single object, use an Array Modifier.

Delete all but one instance, and add an Array Modifier to the
remaining one. Set it to object offset.
Now with the 3D cursor still in the center of the tire add a new
empty object
Rotate it the same amount of degrees you would rotate one of the spokes.
Assign this empty as object offset to the array modifier
Adjust the number of items as desired.

Now you have a single object but they all share UV data and are kept in sync.


Why can I only texture paint some parts of my model? I am not able to paint on the whole model. I tried many times but nothing worked.

There are several issues with your file, all contributing to not being able to paint on all your model:

Materials

The material that is displayed in the viewport is only applied to a few of the faces in your model (the ones you can paint on). Go into Edit Mode, select all faces in your model by pressing A once or twice, select 'Material' in the list of materials and click Assign in the material panel:

Based on your specific file, the object should now be black.

Normals

Still in Edit Mode we can address the second problem.

Some of the faces in your mesh are inside out. This is due to having internal faces inside your model, which confuses Blender into not knowing whether a face is inside your model or out. A quick fix for this is to open the Properties panel in the 3D View (press N to open it), navigate to the Mesh Display panel, turn on Face Normals (the cube icon) and increase the size a bit:

This displays the face direction in the viewport in the form of a line coming out of the centre of a face. The 'direction' a face is pointing is called its 'Normal'. Any faces that don't have a line coming out of their centre are inside out.

The faces I have selected here are inside out:

Select them, press Space and search for 'Flip Normals' and press Enter. Their 'normal' direction has been flipped and they should now have lines coming out of them showing the direction they are facing (outwards). The lines were there previously, but they were pointing inside the model.

Face Selection Masking

The third problem is that you have 'Face Selection Masking' enabled in the 3D View header, meaning only faces that are selected in Edit Mode can be painted:

Either deselect the 'Face Selection Masking' option or select all faces before starting to paint.


Rendering artifacts in blender internal I'm experimenting with drawing textures onto the model. I'm trying to render what I've got so far, but my renders come out with these strange black or white rectangles all the way down the blade edge. Anyone know a fix for this?

It all came down to a loss of precision in the depth buffer, let me explain.
You have your camera's Start Clipping set to .001, that is tiny.
If you turn on the display limits of the camera you will start to see the problem.

The camera is in the red box, and your sword is in the blue box, over 60 units away.
Now with the start clip set to 0.001 (the default is 0.1) there is a lot of wasted calculations, leading to a loss in precision.
The blender manual has a note about such behavior with a large clipping range.
This Quote from an article on MSDN explains it well.

The near plane and far plane are the final pieces required to calculate the projection matrix. The more closely together the planes are, the more precise the values in the depth buffer.
The depth buffer can be 16-bit, 24-bit, or 32-bit, with values between 0 and 1. Generally, depth buffers are fixed point, with the values close to the near plane grouped more closely together than the values close to the far plane. The degree of precision available to the depth buffer is determined by the ratio of the near plane to the far plane. Using the tightest possible near/far plane could allow use of a 16-bit depth buffer. A 16-bit depth buffer could reduce the use of memory while increasing processing speed.

So a simple fix, is to set the camera's start clipping to a bigger number, even 0.1 works, but as your scene is currently set up you could go as high as 60.

Changing the camera settings will fix the problem, however you still have a huge sword.
If you look at the dimensions (in the properties panel N) of your sword it is 31 meters tall!
Just scale down the sword with S, until it is about a meter. Then reposition the camera.
The other option is to scale down your entire scene, then change the strength of your lamps.
This has the same effect as changing the clipping on the camera, because there is now less space blender has to calculate.
So really this was a story of way too big, and way too small. Pay attention to your numbers, and even use real world units.


how do I prevent the belt from clipping my model (I've used data transfer to transfer the weights) I don't know how to fix this can anyone please help me? I'm at a beginner level. I can provide extra information if necessary.

A simple approach might be to build the belt geometry directly from selected and duplicated faces of the waist geometry, which would then be separated into a new object. However, this would need to be done only after binding the body mesh to the rig. This is because, whenever an object with modifiers is duplicated, the duplicate also has the same modifiers. In this case, your belt mesh will have an armature modifier on it as soon as it becomes a duplicate of the already bound body mesh. The belt mesh will need to have this modifier in order to be deformed by the rig. The belt mesh will automatically have the needed vertex groups for deformation, also, as well as fairly adequate starting weights for those vertices. What it won't have, is thickness. For that you can add a Solidify modifier.

You may find that you still must do some weight paint tweaking afterwards to ensure no collisions between waist mesh and belt mesh. But the work is reduced somewhat by starting this way.


Grow vertex group - withnout ops Can you help me with simplyfy this code please? I used operations, but some skillfull user wrote that is not so good idea.

def grow_sel(Aobject,num):
    Aobject.vertex_groups.active = Aobject.vertex_groups[0]
    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='DESELECT')
    bpy.ops.object.vertex_group_select()
    for i in range(1,num):
        bpy.ops.mesh.select_more()
    bpy.ops.object.vertex_group_assign()
    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.modifier_add(type='MASK')
    bpy.context.object.modifiers["Mask"].vertex_group = obj.vertex_groups[0].name
    return("growing completed")

My take on this.

Sometimes it's more trouble than it's worth to completely avoid operators. Given the nature of this method I can't imagine you will be running it in a loop hundreds of times.  Adding a modifier I would always use the API method. Selecting and assigning vertex groups using the operator is often the go, but you are constricted by the need to be in a certain mode for context.

Here's a method to do same, but with no operators. Can get the object from the vertex group, so that's all I pass to the method with: the number of times to grow the vertex group; and the name of the mask modifier so we don't end up adding modifiers endlessly to the stack.

I'm using a bmesh, for the ease of finding the linked faces for each vertex.

Test code, run in object mode with a mesh object having a vertex group,  as context object.

import bpy
import bmesh

def mask_and_grow(vg, num=1, modname="Mask"):
    ob = vg.id_data
    mod = ob.modifiers.get(modname) or ob.modifiers.new(modname, type='MASK')
    mod.vertex_group = vg.name
    me = ob.data
    bm = bmesh.new()
    bm.from_mesh(me)
    bm.verts.ensure_lookup_table()
    def ingroup(vg, v):
        vert = me.vertices[v.index] # use either bm or me
        return vg.index in [vg.group for vg in vert.groups]

    def grow(v):
        return (v for f in v.link_faces
                for v in f.verts
                if not ingroup(vg, v))

    vg_verts =  (bm.verts[v.index] for v in me.vertices
            if ingroup(vg, v))
    for i in range(num):
        # only need to look at extended next time
        vg_verts = list(set(v for g in [grow(vgv) for vgv in vg_verts] for v in g))
        vg.add([v.index for v in vg_verts],
                1.0,
                'REPLACE')
    #me.update()
    bm.free()

# test call
ob = bpy.context.object
vg = ob.vertex_groups.active
mask_and_grow(vg, num=2)


How to make a circular rainbow effect? I've played Nier Gestalt and Beyond Two Souls games recently and noticed  that in both of them the circular/half-circular rainbow effect appears.

Could somebody tell me what is this effect called and how to achieve it in Blender? I know I can create it using transparent and color ramp nodes (like in here: How to make rainbow ends fade out), but how to make it physically acurate? This effect appears when you rotate camera out from the light source. The more you rotate from it, the more the effect appears.

This is a post effect as it occurs inside the lens. I have used a mask to create the ring, then added some noise from a cloud texture, this is distorted radially to make streaks (that you could animate). Then this is coloured with a fringe using the Projector node.

Make a single mask with 2 circle shapes on their own layers:

Layer one use Add function

Layer two use a Merge Subtract function

Make sure both layers are active, tick the eye buttons

Use this mask shape with a noise texture that is distorted with a radial blend texture using a UV map node:

Here's the blend file I created for this effect:

UPDATE:
Here's the flare turned up to 11!
I duplicated the projector node for more color and added a ramp to the radial blend so that I could better control the stretch of the cloud texture.


when i turn on b-bones i don't get the blocks I am following this tutorial on how to rig and am trying to do a very basic rig for arms. Now in this tutorial he says that for the hand controller i copy the bone, scale it up and turn on b-bones. When he turns on the b-bones he gets these blocks but when i turn on the b-bones i get something more akin to sticks. i can't scale these sticks on any axis other then the y axis and don't know how to fix it.
what they are supposed to look like:

What they look like when i do it:


How to create a Boolean Vector property that is "single selection"? ☐ x
☐ y
☑ z

class MyAddon(bpy.types.Operator):
    ...
    axis =  bpy.props.BoolVectorProperty( subtype="XYZ" )
    ...

This operator is added to menu, now the BoolVectorProperty is multiple selection by default, how do I make it single selection? I want only one value to be True at one time.

I have tried getter and setter, but cannot make it right.

I managed to create a "single selection" boolean vector. It use getter and setters. An auxiliary variable is used to store the value of the property, otherwise setting the property inside the setter would recursively call setter which calls setter which calls setter...

AXIS_VALUE = [0,0,1]

class Foo(bpy.types.Operator):
    #...
    #...

    def getter(self):
        return AXIS_VALUE

    def setter(self, value):
        for i in range(3):
            AXIS_VALUE[i] = {
                (False, False) : False,
                (False, True) : True,
                (True, True) : False,
                (True, False) : False,
            }[AXIS_VALUE[i], value[i]]

    axis = BoolVectorProperty(
                subtype="XYZ",
                default=(0,0,1),
                get = getter,
                set = setter
            )
    #...
    #...


Bake normals map does not work well I have issue woth baking normals. In some reason bake does not work well. I tried a lot of ways and configs.. But my normal map is incorect.

When I'm trying to use this generated normal map in Unite or Bldender for low model I see edge of low poly model. In some reason Ray distance does not work for case when low poly sticks out a little.

I'm using Blender 2.81.

Do you have any suggestions how to bake normal map without this issue.

See below screenshots:

High model inside in the low. I generated high model from low by smooth

Last baking config

Tring to use this normal

You should make your low poly model smooth shaded and add at least one bevel in this case.

When blender bakes the normals, it ray casts from the low poly surface inwards along the interpolated normal until it hits the high poly (or not).

If you need the low poly to intersect with the high poly then you can make a copy of the low poly and scale (or shrink/fatten) it up and bake with that. It is also possible to use a Displace modifier to raise the surface a bit during the bake.


Why are materials linked to meshes by default? Over the years I've discovered that I've had much more trouble with scenes where materials were linked to the Mesh Data. This is Blender's default. Then I'll go through the arduous task of re-linking the same material(s) to the Object Data instead. I know that I can set the default on my own machine/install to have materials link to Object Data. I'm curious what's the philosophy behind linking materials to Mesh Data? What are the perceived advantages? Does anyone else have this problem?

Who knows what the original reasoning behind this ways, this default was chosen maybe 15 years ago and there has not been a good reason to change it.

To me it makes some sense to share by default. When you have a particular object that you want to give a different material than the others sharing the same mesh, then you're there in the material tab editing things anyway and you can change the linking to object at the same time.

If linking to object was the default, you might make linked duplicate objects with AltD, placing the object in different places in the scene. But now if you want to change the material you have to go and change each individual object.


how to join multiple rigged mesh and bones I rigged and weight painted a finger mesh, and now i need to connect the bones and the mesh to make the hand while maintaining the bone weights so i dont need to redo the weight paint for every finger, how do i go about doing this?

Figured it out.

select bone and mesh and duplicate them.
select individual bones of the duplicate and rename them so they have unique bone names from the original. Renaming the bones will automatically rename weight painted the vertex groups.
apply location rotation and scale to the bones in object mode, and make sure all armatures have the same origin
select the mesh and hit ctrl J
select bones in the same order as you selected the meshs and hit ctrl J


How do I bake a transparent shadow texture using Cycles bake? I'm trying to bake a transparent png image with Cycles. It drives me crazy trying to work out how to do this. Can anyone guide me how to accomplish it, or is it possible at all?

White background

Transparent background

As far as I know it's not possible to bake images with transparency in Cycles, but it's possible to figure out some workarounds, depending on what you want to achieve.

To bake a transparent shadow texture:

Set up your scene. I'll just use a simple tree in my example. Place a plane under your objects and scale it big enough to catch all the shadows.

Create a new image in the UV/Image Editor and unwrap the plane.

Create a simple diffuse material for the plane. Add an Image Texture node to the material and select the new image you just created.

In the Render Panel set Samples to a nice number (depending on your scene) and set Bake Type to Shadow.

Bake the image. You should have something like this:

Go to Compositing, select Use nodes and delete the default nodes. Then set up the nodes like this:

In the UV/Image Editor select Viewer Node from the drop down list.

Save the image as an RGBA file (*.png, *.tga - whatever you need).

Your baked transparent shadow texture is ready.


Text object alpha BGE python for fade in/out 2.79 I am working on a "display name" with a text object added from a inactive layer to the current scene.

I startet just changing the visibility, then i wanted a "scaling visibility". For that (since the base class of the text object is game object) i try texObj.meshes[0].material[0].alpha but found that there is no meshes.

Then i put a plane.color =[0,0,0] behind the text and meet the colors (text.color=[amount,amount,amount]), amount = amount + or - 0.02 between 0.0 and 1 to slowly make a "scaling visibility" of the text, But this requires the plane as background of the text which i want to not use if there is a way to do it without a background.

Also i have google "bge python text to mesh" trying to found a way to convert the text to mesh so i could add the text object then edit,remesh,show,hide, endObject but only found the bpy reference which not work in bge runtime.

And of course a dont want to convert the text to a mesh (Alt+C) since i will unable to change the text.

Animate the alpha of GameObject.color

Tested using gamelogic module template, with a mouse sensor on text object. Clicking 10 times makes the text object "fade away".

def main(cont):
    own = cont.owner
    # color vector xyzw  ~ rgba
    own.color.w -= 0.1
    own.text = str(own.color)


How to set Opacity Maps with colored tga textures? I've purchased a 3D model car with some good textures, I was doing good until I came trying to apply the opacity maps.
Usually I set the opacity maps with textures in black and white, but this time the textures have some weird colors and I'm not sure how to set these Opacity maps in cycles.

Here are some of the Opacity Maps included in the file:

Any ideas? I'm using Blender v2.79 with Cycles engine

It looks to me like the alpha is in the blue channel of those images.

To use it in cycles just add a Seperate RGB node in between the image and where you normally would plug the alpha in (probably the Fac in a mix node).

I'm guessing the other colors are kind of an id map (just other parts of the texture segregated) so you can apply different shaders to different parts. And example is the "corvete" sticker on the right side. If you wanted to make the letters less shiny then the rest of the sticker, then you have a texture to use for that.

This is really nothing more then putting mutipal black and white texture maps into one color image.


Can this even be modeled? 3D modeling of flexible spheres in contact with one another I've never used any modeling software before and just wanted to know if
what I'm envisioning can be even be modeled.  I wasn't sure where to post this question, so if this is the wrong place, please let me know.  I would be grateful for any advice you may have.  What I'd like to do is:

3D modeling of flexible (soft body?) spheres in contact with one another. The spheres are just a surface with no internal points.
There's an initial sphere (say layer 0) whose surface is covered as much as possible by non-overlapping spheres of the same size in layer 1.  Because you can't fit an integral number of equal-sized spheres around an inner sphere of the same size, some amount of a few of the layer 1 spheres will be trying to occupy the same location.  Because of this, these spheres won't be spheres but will be kind of hemispherical shapes meeting in the middle in a flat interface.
Any of the outer surfaces of the layer 1 spheres and hemispheres that are not already covered by other spheres, will also be covered by non-overlapping spheres (layer 2). Some of the layer 2 spheres will overlap if there's not a surface area that can fit an integral number of them.   Ideally, the appearance of the sphere layers (0, 1, 2, etc.) is a sequential process, but I don't think that's critical for the model.  In other words, they could all be there initially.
The overlapping hemispherical entities are  trying to achieve their natural spherical shape and thus will exert pressure on each other.  This is where the flexibility part comes in.  As the overlapping hemispheres push against each other, they will change shape and push into neighboring spheres.  All the spheres/hemispheres are trying to maintain a spherical shape, so if a sphere is bulged into, it will offer a small resistance to this.

Is it possible to make a 3d simulation of what happens when you start this running to see how the pressure waves and forces move through the spheres?

Thank you to both of you for your help.  Both your answers were very informative and
will help guide my work on my hobby!

Roger

There is nothing to model really, you can use blenders primitive spheres, and position them procedurally by using the centre of the parent sphere as the pivot point of the first layer of children and constraining them to the radius of the parent. This way they will appear on the surface of the parent.

The way you can create the spheres is creating a emitter sphere which would be at the origin of your parent sphere with a radius of:
EmitterSpereRadius = ParentRad + childrenRad

Then create a particle system using the emitter sphere as the ... emitter, and creating the desired amount of particles which you will set to be emitted from the surface of the sphere rather than the volume. Turn off all forces acting upon the particles and they should stand still.

Now you can replace this particles with instance geometry (your children spheres) and you will have a parent sphere with it's children just about touching it's surface. (Note, that if you distributed your particles randomly, some children could be overlapping).

Then as John Burrill suggested apply softbody dynamics to all spheres, make them collidable with each other and their parent, and apply a strong force filed to the children from the parent which would allow them only to encompass the parent, squashing against him and themselves...

Repeat the same process for more layers.

This would get you some results.
In the case that i haven't totally misunderstood the question, please ignore. :)


2.8 Eevee Composite Object over background lacking Transparency Can anyone provide instructions on how to composite my object over an image background in 2.8, Eevee render?  The problem is that the object is does not have transparency around it.  I set a bounding box but that only shrunk the background.  I've looked for transparency settings in the the shader and in the renderer and in the compositor but am not finding anything.  I've tried both Alpha over and Mix.  See attached screenshot.  I want just that green cube floating in the air near the dude's head (just experimenting), minus the dark gray around the green cube.

You have to tell Alpha Over what is transparent - black in the Jupiter .jpg image is set to be transparent in this example and ColorRamp helps adjust what is transparent and what is not. The Transform node is for the position and scale of it.


X Mirror and copying weight paints I'm a bit confused with the X Mirror option and how you're supposed to copy weight paints from one side to the other. Is X Mirror supposed to work by painting the opposite side automatically as you paint the other? Or am I misunderstanding how it works. Either way, it doesn't appear to do much for me. Failing that, how am I supposed to copy my weight paints from one side to the other?

Thanks

x-mirror in weight paint mode is meant to mirror your actions between mirrored groups.

Let's say you have group four your right and left arm. If you paint the weights in the left arm group, x mirror will do its job on the right arm group.

In order to paint in symmetry inside a single group, you need the purposely named symmetry tool :


PyQt5: The specified module could not be found I try to start learning PyQt5 in blender but i've got this error when i try to import a module.

ImportError: DLL load failed: The specified module could not be found

This is my import line:

import sys

sys.path.append('C:\\Users\\pistiwique\\AppData\\Local\\Programs\\Python\\Python35\\Lib\\site-packages')

from PyQt5 import QtGui

If i test these lines whith PyCharm, there is no probleme so it seems to come from Blender but why ?

I remember that i ran into this error too. I think the problem was the qwindow.dll.

For me the necessary steps were: install the correct PyQt5 version directly into the python directory of the binary. For 2.76 the PyQt folder has to be in the 2.76\python\lib\site-packages directory.Then you need to grab the qwindow.dll, put it into a folder called platforms, and put it asides the Blender exe. And you should be ready to go.


Detect if object data is associated with a scene in any way I'm making an addon for the NLA editor, and I need to know precisely which strips are selected in the NLA editor.

Unfortunately this means checking every single data object in the blend file, because there are 20 other data types with animation data to consider beside Objects - materials, nodetrees, armatures, worlds, etc...

The problem however is in telling whether or not one of these non-Objects are associated within the active scene, because if I have 5 scenes with NLA tracks in each one, I may have multiple NLA tracks selected in one scene's summary dopesheet,  but I just want to know the selected nla strips in the active scene's summary dopesheet (ignoring filters and such).

Simply put, I need to know which non-Objects (ie, material, armature, world, etc) are associated with a scene in any way.

Any ideas?

I looked at Blender's source code and realised it was quite an ordeal for the dopesheet to filter objects relevant to a context, so I gave up any hope of a simple solution and just went about doing a ersatz version of it in python.

It's a bit of a mess, but it works for detecting most non-objects (and objects) with animation data in a context:

https://gist.github.com/hedgehog90/634ea03acd2a1d87f99fbb06857e1956


Last element deformed when using Array Modifer and Bezier Curve I'm trying to make tank tracks in Blender 2.8 but whenever I use the bezier curve the last element seems deformed. I tried to close the bezier curve with F but still no joy.

I think I figured it out. @moonboots was right that the curve handle was wonky, hence it was pointing the track in a weird directly. My solution was to set the Handle Type in the Edit menu for the curve to "Vector" (Using Shift + V) and I can get straight lines and not have to deal with rotation. Here's the result:


Continuously Move Around Spline with Animation Nodes With the Evaluate Spline mode, as you move the parameter towards 1, the object moves to the end of the spline. How could you make the Suzanne continuously move around the spline, such that once it reaches the end of the spline, it starts to move the beginning, in a looping fashion?


Eyebrow not moving with head I made a simple character , rigged it . But the problem is that when i move the head in object mode . Eyebrow moves along with it . But when i do the same when using pose mode ( using bone to move head ) everything part of head moves EXCEPT eyebrows . Can anyone plz help me with it ??

https://www.dropbox.com/s/j8vkahgn2lrco0v/error%20mouth.blend?dl=0

( link to the .blend file )

Go in Pose mode, click on the head bone, and find out its name.
Go to Edit mode (on the mesh) and select the eyelashes.
select the vertex group with the same name as the head bone in the properties tab, and click on assign.


Scaling multiple rings on cylinder to the same size I am trying to scale different sized rings on a cylinder to the same size, like turning a vase into a pipe shape. I would be glad if one can tell me a shortcut, I am trying to do it one by one, and I guess there is an easier way.

Edit: I am attaching a screenshot. On the left side I have the representative model I want to modify, and on the right side I have the expected result. I am looking for a way to select all the rings and bring them to the same diameter.

Thanks

I assume you mean edge loops and not edge rings because edge loops are selected on your screenshot.

It's possible to scale edge loops one by one to the size of desired loop or to recreate them from scratch.

Scale edge loops

Activate Snap During Transform tool. Set Type of Element to Snap to Vertex and choose Closest.
Select one of edge loops of the mesh (hold Alt while clicking RMB on them).
If object is oriented along Global axes, as by default, press S to activate Scale tool, and with pressing Shift+Z restrict scaling only to 2 axes (X and Y).

3.1. If the object was rotated and is not oriented along global axes (X Y Z), then you can align view to the face perpendicular to the edge being edited or create custom transform orientation. Depending on the method choosed you'll need to change transform orientation either to View or to custom one and lock not global rather than View / custom axes.
Hover mouse cursor over vertex of the edge loop serving as loop with desired scale. Once selected edge loop is scaled as desired click with LMB / press Enter to confirm.

Recreate edge loops

There are many ways to do that (one is to dissolve them one by one), the fastest one would be to select all the edge loops, delete faces and use Bridge Edge Loops to connect the remained ones.


Move multiple faces towards single point I want to achieve similar effect to scaling multiple faces but I don't want to scale individual faces.

A way to get the result is to select one of the faces at the end you want to move and press ⎈ CtrlH and select Hook to New Object, repeat for the other faces you want to move.

Go into object mode and select the empties that were just created. Enable the manipulate pivot points option (nice if we had this in edit mode) and scale the empties until the faces are where you want them.

Once the ends are in place, apply the hook modifiers and delete the empties.


Can't find the keyboard shortcut in keymap preferences I am a Maya user and I want to move to Blender and I decided to Change the Keymap to a similar look to Maya; But couldn't find the shortcut key for ' Spacebar + W ' as Tweak tool to Remove It and use the shortcut for Move gizmo.

Can anybody Help me Please?!

Open the keymap in the preferences (Edit > Preferences > Keymap) and select Key-binding in the drop-down next to the search box. The shortcut can be found by searching for the W key-binding. The Shift + Spacebar shortcut for the toolbar popup is a separate one.

You're looking for Set Tool By Name. (*)

(*) Now that you know its name, you can also search for it directly. The approach above works for any shortcut though, in case you don't know the operator's label.


How to make an substance painter shader how can I found/use/make a shader in Blender which allows me to use the textures from Substance Painter? I would prefer to be free.

Thanks

Best solution: get a buildbot build in a week or two that will have this patch added: https://developer.blender.org/D2313 This is the same shader that Substance itself uses, and should be a 1:1 translation. Until that's available in a more accessible build, I've ported over a blog post I wrote about this below:

To start, I've given everyone's favorite monkey an interesting paint job using the default color, height, roughness, and metallic channels.

First order of business is to export these for Blender. Hit File > Export, and just use the default "Document Channels + Normal" preset.

Now let's look at our shader in Cycles. We'll start by making the simplest, most standard physical shader, a diffuse/glossy mix with fresnel.

NOTE: Some people like to use the layer weight node instead of the fresnel node. If that's you, go right ahead. I'm just using the fresnel node here for simplicity.

Base Color

Our first channel to deal with is base color. There's not much to this one. We have a base color image, we'll just load it and plug it into the diffuse BSDF's color slot.

Roughness

Our next texture if the roughness map. As you might have guessed, we're connecting it to the roughness inputs on both the diffuse and glossy nodes. However, there's a couple things we need to set to make sure Cycles interprets the map correctly. The first is to change the node from "color" to "non-color data" (as that is what the roughness map is). Any channel that is not set as "sRGB" in substance painter should be loaded as non-color data. Here we see that base color is sRGB (and thus should be loaded as color), but the rest of our channels are luminance (marked with an "L"), so they should be loaded as non-color data.

The other thing we need to do is square the roughness value to match the range between SP and Cycles. To do that, add a math node, set it to "power", connect your roughness map to the top slot, and set the bottom slot to "2.0".

Normals

Substance Painter can generate a number of "converted" texture maps. One of which is the "Normal OpenGL" channel, which generates an OpenGL-style tangent-space normal map using the height channel and the object's normal map (if it has one). We can attached it with the normal map node, like usual.

In this case, our object didn't have a baked normal map in Substance Painter. But in case it did (such as baked sculpting detail) the normal map will contain that as well as your height painting, so you don't need to do anything else to connect the two.

Metallic

Ok, one more channel. This one gets a bit complicated. Up until now, our shader has been a simple dielectric shader. We now need to introduce an alternate shading path for metal, and use the metallic map to blend between them. To do this, you are going to add a mix node at the end of the chain, attach your metallic map to the mix factor, then put an extra glossy BSDF on the second input, and attach your base color, rough (from the power node) and normal (from the normal map node) to this glossy BSDF.

I've highlighted our newly added nodes in red. Areas that are dark in the metallic map will use our diffuse/glossy fresnel mix we created earlier. Areas that are bright in the metallic map will shift over to this glossy-only shader. Since metals have colored reflections, we attach the base color to the glossy-color input here, unlike our other glossy BSDF on the dielectric side. Since roughness and normals are shared, we use the squared-roughness and normals just like on our other BSDF nodes.

And here is our final monkey!

This shader setup is just the very basic elements required to translate the shader. There are numerous other effects you can add. For example, some people like the look of metal shaders that blend two glossy BSDFs at slightly different roughness. You can add that in to your shader (use an extra math node to scale your roughness map). Some people prefer to use the layer weight node instead of fresnel. It's all up to you, feel free to experiment!


UV map transfer with Data transfer modifier gives ripped borders guys. I, a Maya user who was asked to adapt my routine to Blender, ran into the following problem:
After retopologizing a Marvelous Designer mesh in Zbrush in a way that preserves 3d placement of seams, I try to transfer the UV map from the original mesh to its retopologized version in Blender with Data transfer modifier, but I either get ripper borders (both meshes are split along seams) or messed up inner parts.

I've tried all Face corner data options, increasing Island Handling refinement, scaling meshes to real-world size + increasing Island Handling refinement. The only thing that works is splitting meshes by UV islands and transferring individually.
While I know a way around it, I am pretty certain it is possible to set this modifier to give me the results I want right away ( like in Maya)

I'm using Blender 2.78
Here's my file

Found a solution!

transfer uvs with Nearest face interpolated;
select the border edge loops and add them to a new vertex group;
transfer uvs again with the default setting but only for this vertex group.

Shown in this video starting from 22:13


Blender 2.9 Extrude by 3ft Manually Problem I've been getting back into Blender after a long time away from it. I used 2.79 a lot before, but since I'm using 2.9 right now, I'm having trouble accessing some features I use to use.
I need to extrude edges out a certain distance in my model. I did this manually before in Blender 2.79 via transformation values. In that version, when extruding an edge, I'd be able to set its distance relative to the edge it was extruded from.
However, in 2.9, when I try the same thing, the transformation values are not relative to said edge.

In this image, I want to extrude the edge 3 feet away from its parent edge. When doing so in 2.79, the values used to be set at zero, so I could easily put in "3ft", but here, it displays its median distance from what I assume is the origin.
In 2.79, I could press "G" whilst the edge is selected, and all three values would reset to zero.
Is there a way to reset these location values to zero. (without moving the edge), for when I start to extrude something? I could calculate what distance I should use, but it would flow much easier if I could just input the offset distance I want.

Doing a transform from a numeric input is still possible. After pressing G, just type the number directly into the viewport and press ⏎ Enter. Or for better control, lock it to an axis first: press G for the transform, then (X, Y, or Z) to select that axis, then type the number and press ⏎ Enter.
This also will work directly from the extrude. i.e: press E to extrude, then (X, Y, or Z) for the axis, and then type a number and press ⏎ Enter.


FBX Export: What does Forward / Up assignment do? I want to bring my object from Blender 2.8 to Unity.
I'm experiencing that the object lays on its belly in Unity.

To find what is actually happening, I'm trying to find out what the following settings actually do:

However, I didn't find this info.

Here is what my Blender scene looks like:

To me, the object looks adequately oriented, so I don't understand what Blender actually wants to know from me when it allows me to assign Forward and Up axis at fbx export.

I would like to actually understand it and not just try it until it works accidentally.

Thank you!

Each software handle axis names/orientation differently. That doesn't change anything while your working into a soft, but can be problematic when you export models and animations.

Z Up / Y Up

In Blender, the vertical axis is called Z (so X and Y define the floor plane). In many other software like Unity, the vertical axis is called Y (so X and Z define the floor plane).

Y Forward / -Y Forward

Once you know which axis means vertical, you need to determine how the two other axis are oriented.

In Blender if you turn the view so the Z axis points up, and the X Axis points right, then the Y axis points backward ; in other terms, the -Y axis points forward.

Sometime this kind of orientation is called "left-handed coordinates" :

Of course it opposes to right-handed coordinates where the "Y-finger" would point forward.

Blender / Unity

Blender is Z Up / -Y Forward

Unity is Y Up / - Z Forward

Other cases

It's quite conventional that the vertical axis points up (not down), and the X axis points right (not left). However, that's not universal, so the fbx exporter allow every valid Up/Forward combination. (an invalid combination would be something paradoxal like : Z Up, Z Forward).


Getting local rotation in python I'm using blender to visualize data from an orientation sensor, and would like to display the current rotation, but about the local axis. I can get the local axis just fine, but what I'm interested in is the actual rotation quaternion associated with the local rotation (how much the object has rotated over each local axis). I don't want to actually rotate anything, just display what the current local rotation is.

Is there a proper way to do this with bpy or mathutils? Or will I have to come up with my own method of determining the local rotation?

Blender's objects have three rotation values, rotation_euler, rotation_quaternion and rotation_axis_angle with the rotation_mode property defining which one is used.

If euler rotation is used and you want the quaternion rotation you can use to_quaternion() to convert it. Quaternion values also have to_axis_angle() and to_euler() if you need to convert the other way. The mathutils module contains some extras.

Note that euler values are stored as radians so you will want to use math.degrees() to get the degrees of each rotation. Both index and property access are available for euler and quaternion rotation values.

if 'Z' in bpy.data.objects['Cube'].rotation_mode:
    r = bpy.data.objects['Cube'].rotation_euler
    print(math.degrees(r[0])) # 0=X, 1=Y, 2=Z
    print(math.degrees(r.x))

    q = r.to_quaternion()
    print(q[0]) # 0=W, 1=X, 2=Y, 3=Z


Align complex, non-matching meshes as closely as possible in size, position and rotation I have two complex meshes that I want to align with each other as closely as possible. Not in terms of touching each other (as a lot of questions seems to cover) but actually overlapping with each other.
As an example, I want to turn this:

into this:

through a combination of moving, rotating and scaling.
Clearly I can get a rough result by hand (as above), but is there an automated method I could use that does not rely on my own judgement?
What I have tried/considered already:

The align tool will do position but not rotation or scaling, and in fact it doesn't even provide the best position since it is based only on the object origins.
The snap tool will align particular faces but doesn't take the overall shape into account.
Perhaps there is a modifier that will do it? I don't know much about the various object modifiers.
EDIT: In contrast to the simple example given here with Suzanne, my objects don't necessarily come with the same orientation relative to their local origin, so e.g. copying rotation information will not work in most cases.

I also understand that there isn't necessarily one single metric that will tell me the "best" alignment between two objects, as there will be different ways to measure this property. I don't mind that too much - the important thing is having a consistent and automated method.

Very Easy. You can use object constraints. The constraints which will help you are: Copy Location, Copy Rotation, and Copy Scale. Then just add the other object as the target in the constraint.


Blender Python Displaying UI Table with header Is it possible to create a Table using a template list that has first row as the description of the attributes the list contains.

I currently have something like this.

It is occupying way to much space and I want to actually put the cell description only on the top centered and have only values in the grid.

No, there is currently no way to do this.


Undo not working in blender 2.8 According to:

my undo doesn't work in 2.8, except in edit mode

Global undo should be enabled in order to undo operations done in the editing tab. In my case, I added faces between two edge loops created with Ctrl + R; I deleted one (it had a face with odd number of vertexes) and created one above it. Everything looked ok; faces just needing to be added in between the edges. I select both loops (Alt + click) and hit F; the result was a wavy surface that now I cannot delete by hitting Ctrl + Z. The wavy surface appears only if the face is created from the loops and not from the vertexes individually.

I was impatient; blender is pretty slow on my machine. Just close and restart every now and then.


Blender dosn't interpret the Colorspace of the imported Image in the Compositor correctly I am facing the following problem:

The imported image from the explorer, a 16bit PNG file, is not showing up in the correct colorspace (I think) in the compositor

It's a PNG, so it has sRGB colorspace, I don't understand what is wrong with this simple manipulation.

Here is a simple step to reproduce this:
Do a render in PNG16bit, import it in the compositor, compare renderlayer with imported result

Blender does not support ICC profiles - this can be a problem if the image has any ICC profile that is not sRGB.

If you have a calibrated/profiled monitor, since Blender does not support ICC profiles color would also be sent to the monitor as sRGB instead of the monitor's profile so it would differ from software displaying images correctly taking monitors profile into account.

If your color management settings are set to filmic or have any looks, the image will be changed according to that.


Enabling cloth physics for an object moves its transform position I've been following this tutorial about how to model and animate a scroll, and I've only deviated from the steps by decreasing the number of cuts when subdividing the "paper" and decreasing the vertices on the "handle", in order to make it low-poly (I also have followed the tutorial without these changes and also have had the same problem).
Whenever I apply the cloth physics modifier, however, the paper of the scroll acts weirdly. The only way I can describe it is that the paper doesn't stick to the handle and instead, it deforms, and its transform position decreases significantly in the Z-axis.
Below is what I see before the cloth modifier was applied:

And this is what I see after the modifier has been applied:

Thank you for your help!

I had the same or a similar issue right now, though I know I'm late.
I wasn't at frame 1 so the cloth simulation had basically ended - my object had already "fallen" and was therefore further down the z-axis. Going back to frame 1 solved it. If you weren't able to solve the problem, maybe this will help you too or anyone else encountering this.


How do you render background image through transparent object? I tried rendering an object that has a mixed glass and diffuse shader and also a background image but after adding a holdout shader in image 2 to make the object transparent to see the background image the glass shader becomes darker.

Image 1:

Image 2 :

Without transparent shader:

Nodes for background image:

With transparent shader :

That's because the way you have it set up, it's going to be transparent on the edges and solid in the middle. Switch the top and bottom slots, and it should fix it!

EDIT: The Holdout shader also only uses what you have set for your world background. It's going to show up as a basically a hole to show the background through, with no consideration for any other object or faces behind it. If you simply want transparency, use the Transparent node instead of Holdout.

(It's doing what you you want, this is just how it looks in preview; see how it looks in render, then switch the top and bottom slots to see if it looks better, as well as also hookup up your mix factor back into your original mix; it can hook up to more things at once!)

EDIT 10/19: By switch the slots, I mean the sections that say 'shader'. When you use a mix factor, it's telling Blender to make all the white one of the shaders and all the black the other shader. Any mix is a combination of the two. Fresnel as a mix mask looks black where it's facing the camera, and white where it's angled away, and a fairly short falloff between the two. This means if it looks funny, you might simply have it hooked up opposite from the way you want, where it's hooked into the little green dots that say 'shader'.
To further this note, you don't have the same mix factor in your addition with the holdout. You just moved it to the second mix. For better results, plug the Fresnel Fac into the the gray dot that says Fac on both mix shaders.


Blender Logic Editor Sensor Property True If Z Value Less Than Property The scene has two selection texts saying "Selection (1)" and "Selection (2)". The red circle on the left should be used to make a selection with the keys (up/down).

I tried to implement that logic in the Game Editor which I thought shouldn't be to complicated.

The logic in one sentence: "You can only press up/down if the user has pressed the opposite key before." This is the first project I'm doing with blender so I took a look at the documentation and added the Keyboard sensor which is working fine. But I struggle to implement the logic constraint. I tried to use the "Property" sensor but I don't know which values for Property are valid and the documentation on blender does not contain an example: https://docs.blender.org/manual/en/dev/game_engine/logic/sensors/types/property.html

It turned out that the properties are not the custom properties of the object - more like variables on the right side of the logic editor which I didn't see because the view was to small.


How to scale skin modifier I'm currently learning how to sculpt in Blender, and my course instructor has had me make a skin modifier basemesh. Unfortunately, he told me to use the shortcut "ctrl-a" to scale up the thickness of certain vertices/edges of my basemesh—an operation I cannot complete because I assigned (edit mode) ctrl+a to do a different operation.

Is there another way to complete this operation, and if not, how do I get my hotkey back to the default?

Another way to complete operation: hit the Space bar, start typing "skin resize"

Change your hotkey: in the User Preferences window, in the "Input" section, you can search for "skin resize" when searching by Name, that will let you assign a new (or old) keyboard shortcut for that operation.

To find what you've got assigned to Ctrl-A, search by Key Binding and type "Ctrl A", that will show everything that's bound to that combination.


I want parts of a scene to be invisible in final render but still be visible in reflections and light bounces I'm working on a scene in blender where I have recreated a corridor shot for real. In the scene, I have an object traveling down the corridor. The goal is to just get the object and not the corridor in the final render. I still want to get the reflections and light bounces of the corridor, maybe even shadows if possible!

I'm super new so I've been having a lot of problems. I've tried to use the Holdout node on the materials but that removes the light bounces. Any help is appreciated!

Use the Shadow Catcher feature available in versions 2.78.5 or higher. You don't need to do much.

Set the surrounding elements be a shadow catcher in Cycles Settings> Ray Visibility.

The rendered image will have the shadow and reflections and a transparent background.

Then just overlay the rendered image onto your background using Alpha Over:

For other ways to do this.

Using a Layer Mask.

In this example the monkey is in layer 2 and the environment in layer 1. In the layer settings Layer 1 is used as a mask layer.

Make the surrounding elements invisible to the camera using Ray Visibility.

Make the surrounding elements use a material that is transparent to Camera Ray using Light Paths.

Give the material for your object a Pass Index number, enable Material Index in the render layers, and use the Material Index as an ID mask to Set an alpha channel for the rendered image in the compositor.

(click on the image to enlarge)

Give the Object a Pass Index number, enable Object Index in the render layers, and use the IndexOB as an ID mask to set an alpha channel for the rendered image in the compositor.


Engrave Text onto an irregular surface I've searched thoroughly and while there are plenty of questions and answers on how to engrave text into an object none seem to work for me as i am using an irregular surface.
I have the following Model

And when attempting to use a boolean modifier (The text has been converted to a mesh) with difference The following is the result:

Side View:

as you can see that hasn't come out at all as I wanted it
(I hoped it would only cut away what was inside the main model and fill the bottom as other answers have shown:
Here and Here)

Some Letters do cut correctly like the very first but the colours are still messed up.

So My question is, Is there a way to cut/engrave text into an irregularly shaped surface that sits flush with that surface.

Edit: File as requested:

Your "staff" object has many duplicate vertices and all normals are inside, boolean can't work.

In Edit mode, A to select all, then press W > Remove doubles,
After fixing duplicates, select all, press Ctrl+N to fix normals
apply boolean modifier to object "staff" with type of Operation set to Difference, with object "Esvele"

In order to see the effect, hide object "Esvele" or set its "maximum draw type" to "bounds".

Adding pictures for the whole process...

I hope it is clearer now... you just have to set boolean for every other text, now, it will work and have the right color......


Any way to get a specified magnification effect? I'm trying to simulate the magnification of a rifle scope. However, I don't want it to be a random amount, as rifle scopes typically have a set range of magnification (for example anywhere from 6x to 14x).
I've done research prior to posting this, and I know having two UV Spheres scaled down from their poles and at different overall sizes would generate the effect I'm looking for, but is there a way to get a specified setting say like 4x zoom? I'm not looking to get a range to adjust from, just one level of magnification.

Also, if it helps, I'd preferably like to do this in the Cycles rendering engine if at all possible.

I made a rough model of the ACOG 4x rifle scope and studied up on the internal parts. It contains two eyepiece lenses, a roof prism and the objective lens, which I modeled. It works somewhat, most likely because I made the prism too square.

I would recommend not trying to actually model the lenses to magnify the image, but rather place a camera in front of the scope with a higher Focal Length.

Then in the compositer you can add the scope's camera view to the final image.


Material icon_value for UIList Is there a way to get the icon_value of a material for use with a UIList? When using a UIList with bpy.data.materials as the target list, the icon value seems to be passed to the draw function, but I'm not seeing a way to get the integer ID myself from bpy.data.materials.

You can get the icon value from the UILayout classmethod icon

Example using the simple panel template.

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 = "object"

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

        obj = context.object
        mat = obj.active_material
        layout.label(mat.name, icon_value = layout.icon(mat))

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

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

if __name__ == "__main__":
    register()


When I try painting a texture with the fill brush i get a weird result I'm trying something supposedly very simple which is to fill a texture with a color and I seem to get a weird result:

What am I missing here?

Umm not sure if this is a bug of blender. Because I had the same issue too,  so a workaround is using the uv image editor and painting your texture on the image editor directly, avoid painting throught the 3d viewport blender doesnt like it, dont know why. :)

To enable painting on the image editor only change the tab that says view to paint.

Goodluck


Is there a way to set the direction of the sun light on an object (without rotations)? Basically, I'm wondering if I can set the sun lamp's light direction towards a position, such as an object, with a simple command, rather than doing rotations with R which is hard to control.

One way to do this is with a Track To constraint:

Select the sun lamp
⇧ Shift select the object you wish to point the lamp at
Press ⎈ CtrlT and choose Track To Constraint.

The sun lamp will now always "look" at that object, so you can move it around with G for easy adjustment.

You can adjust the constraint (or remove it) in the Constraints tab of the Properties area when the sun lamp is active:


How to make a script run when a file is opened How can I make a script run when I open a file? This to be used with registering an handler every time the file is opened.

You can do this somewhat easily, by naming your text block *.py and checking the Register checkbox.

Then the script contained in it will be run every time you open the .blend file.  This is great for registering handlers at the startup of a file.


How to transition from plane to cylinder I'm trying to figure out the best way to have a cylinder that splits at its midpoint and and smoothly transitions/flattens out into a plane. So far I've kind of figured out one way of doing this by having a plane and cylinder joined together as a single mesh and connecting the edges of the plane to the edges of the cylinder. Turned out like this:   Thought's and suggestions appreciated!

Steps:

Enable LoopTools add-on.
Create Circle with chosen vertices count. Mine is 16.
Go to Edit Mode rotate Circle 90 degrees (X or Y axis).
Select top most vertex on the Circle and hit V to Rip selected vertex to two vertices. Now Circle has 17 vertices.
Create line with 17 vertices. I've done it by adding a Plane, deleted two vertices and CtrlR > 15 (15 cuts + 2 verts = 17).
Level line with Circle bottom. I've used snapping. And also scale it a bit.

Select All A than W > LoopTools > Bridge and set number of Segments and Strength of this bridge.
Extrude line to have a plane and extrude circle to have a tube.


GLSL mode - Is that a bug? I've selected a material view and here's what happened with the cube.
I'm sure it's not a camera max clip distance problem, because outline and grid is visible.
It is appears only when GLSL mode is active.

The only way I can get anything like what you're seeing is to reduce the viewport's "clipping" END setting (press N and open the VIEW tab) to something below the START setting then approach the cube until this happens...

Another point might be to ask where you downloaded Blender from?  I make a point of using the original/authoring site, never a third party site for any s/ware.

This is obvious I know but failing all else, you might also want to explore the possibility of it being a problem between Blender, the graphics card or it's drivers, or perhaps your operating system and/or it's version.

I see your latest comment and note that you're using Win XP?  That's pretty old isn't it?  Blender has come a long way since the older versions of Windows.  Perhaps XP can't handle what Blender is doing re - shading etc.

When all else fails, look for the things it cannot possibly be!

EDIT:  I've since found out that XP is not supported by Blender versions beyond 2.76B


Can you turn a pose into the actual geometry of the mesh? For example, I move the finger bones so it appears like a rested hand. Is it possible after that to make that pose the actual geometry of the mesh, so when I compile it and put it in game it doesn't go back to the default open hand?

What I posed it like in blender:

What it looks like when I compile:

I'm new to blender.

Yup.

Pose your armature.  Select your mesh.  Copy the armature modifier, then apply the first (topmost) copy.  Select your armature in pose mode and ctrl-a -> apply pose as resting pose.  Done.

There can be some issues if you have some constraints built around assumptions about the base pose.  It's not possible (to my knowledge) to apply a resting pose only to a single bone, so make sure your armature is in the pose you want before doing it.


Some fonts are not showing up I am trying to use a font called DIN Medium, which is a Postscript font, in Blender.

However, when I browse, I cannot see the font listed in the folder:

Are my eyes failing me, or are some font formats not supported in Blender?
I couldn't find any info on this online when I searched.

The installed fonts which are not shown in C:/windows/fonts are located at
C:/Users/USer Name/AppData/Local/Microsoft/Windows/Fonts
You can browse through and select the fonts..


How do I determine NodeTree overhead in a .blend file? Since we have the ability to save a NodeTree into the deault .blend file I'm wondering if there are any guidelines or ceilings that need to be observed before I ramp up and save lots of NoteTrees into the default file.  I find myself using some of the bwide stuff quite a bit and am thinking of dropping into the startup file but I don't want to go to the trouble of doing this if it might cause performance or other issues down the road.

Thanks for any guidance on this

@lan

This should not affect anything significantly. I have already added a few of my own nodegroups and a couple node groups from the b°wide nodepack to my startup.blend and have noticed no side effects.

Nodegroups don't really affect performance (unless they are being used), the biggest thing would be file size (which you probably don't have to worry about, because they don't take up much space).


Cannot find displacement in material panel - blender 2.83 I cannot find "displacement" in the material panel anymore in blender 2.83. I want to change my displacement type from "bump only" to "displacement and bump" but I cannot right now. When I opened my old files i can see the displacement there but not in my new file. Is that a bug or do I did something wrong?
Thanks
The new file
The old file

You need to change your Render engine, that option is only for Cycles
Go to Render Properties > Render Engine


How to do texture box mapping with blending in Blender Internal I'm trying to do box mapping of texture with blending just like the node setting in Cycles below.

This is the texture I used

I could have used box mapping option on Blender Internal too but I couldn't have found blending option.

Is there way to do it easily? or I have to do some complicated node setting to do this? I guess it's possible to do this by using nodes but I can't come up with how.

The key to this is in the node set up in the first image, the image texture node. It uses "box" projection, with the blend is set to 1.000. This was a feature added specifically for the purpose of blending the image being projected from all directions (even if that image is the same texture).
The description provided in the blender 2.79 manual is here:
https://docs.blender.org/manual/en/latest/render/cycles/nodes/types/textures/image.html

Projection
Projection to use for mapping the textures.

Box
Maps the image to the six sides of a virtual box, based on the normal, using XY, YZ and XYZ coordinates depending on the side.

Blend
For Box mapping, the amount to blend between sides of the box, to get rid of sharp transitions between the different sides. Blending is useful to map a procedural-like image texture pattern seamlessly on a model. 0.0 gives no blending; higher values give a smoother transition.


Loop Cut and Slide using Python I get this error:

  Python script failed

when I run the following code involving a loop cut  and slide:

import bpy

bpy.ops.mesh.primitive_plane_add()
bpy.context.object.dimensions[0] = 1
bpy.ops.object.editmode_toggle()
bpy.context.area.type = 'VIEW_3D'

bpy.ops.mesh.loopcut_slide(MESH_OT_loopcut={"number_cuts":2, "smoothness":0,
"falloff":'INVERSE_SQUARE', "edge_index":2, "mesh_select_mode_init":(True,
False, False)}, TRANSFORM_OT_edge_slide={"value":0, "mirror":False,
"snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0),
"snap_align":False, "snap_normal":(0, 0, 0), "correct_uv":False,
"release_confirm":False}) // ERROR IN THIS LINE

I get the error in the loop cut statement. How do I rectify this?

There were several issues with your code:

The loop cut and slide operator is supposed to be executed from the 3D viewport. To execute it from other windows (Console, text editor, etc), you need to override the context.
You used an illegal value for the "falloff" parameter (used to be "Inverse_Square", I changed it to "Smooth". You can also choose: "SHPERE", "ROOT", "SHARP" or "LINEAR" if you prefer).

Here's the code:

import bpy

bpy.ops.mesh.primitive_plane_add()
bpy.context.object.dimensions[0] = 1
bpy.ops.object.editmode_toggle()

def view3d_find( return_area = False ):
    # returns first 3d view, normally we get from context
    for area in bpy.context.window.screen.areas:
        if area.type == 'VIEW_3D':
            v3d = area.spaces[0]
            rv3d = v3d.region_3d
            for region in area.regions:
                if region.type == 'WINDOW':
                    if return_area: return region, rv3d, v3d, area
                    return region, rv3d, v3d
    return None, None

region, rv3d, v3d, area = view3d_find(True)

override = {
    'scene'  : bpy.context.scene,
    'region' : region,
    'area'   : area,
    'space'  : v3d
}

bpy.ops.mesh.loopcut_slide(
    override,
    MESH_OT_loopcut = {
        "number_cuts"           : 2,
        "smoothness"            : 0,
        "falloff"               : 'SMOOTH',  # Was 'INVERSE_SQUARE' that does not exist
        "edge_index"            : 2,
        "mesh_select_mode_init" : (True, False, False)
    },
    TRANSFORM_OT_edge_slide = {
        "value"           : 0,
        "mirror"          : False,
        "snap"            : False,
        "snap_target"     : 'CLOSEST',
        "snap_point"      : (0, 0, 0),
        "snap_align"      : False,
        "snap_normal"     : (0, 0, 0),
        "correct_uv"      : False,
        "release_confirm" : False
    }
)


Subdivision Surface Modifier partly closes holes I am trying to recreate a wireless phone charger. And the hole for the USB-C input will partly close itself when adding the subdivision surface modifier.
The hole is created using the knife tool on a sphere. And then modeled by copying the vertices with  E

When deleting the faces beside the hole, the problem is gone. But that is not a solution.

I have spend hours trying to fix this but I can't find a solution for this.

Subdivision Surface will virtually move your edges and create intermediate ones in order to smooth the whole shape. The part you show is only made of one big face with a hole in its center. In its try to smooth it, some vertices will be created in the hole area, which will give bad result. Here is what it gives with a simplified version (without and with the modifier):

If you cut your face the thing won't happen any more:

In your case you could fix it with this kind of topology:


How to extrude an SVG on a cylinder but not have it solid I have an SVG which is in the shape of a bone.
I need to have this shape wrap around a cylinder and have it extrude to have depth, however not be solid. Essentially a cookie cutter wrapped around a cylinder.
So far I've managed to import the SVG into Blender, that's as far as I've gotten. Most of the tutorials I see are about extruding a solid shape, but I'm not sure how to add thickness to the line of the bone and extrude from that.

There is no need to convert the curve to mesh.
Start with the curve you imported.

Extrusion can be done in the curve's geometry section. To add some thickness use some bevel as well

Create a lattice object, make it so the resolution on the w axis is only one segment.

Use the lattice modifier on the curve, and have the lattice be the deforming object.

and then shrinkwrap the lattice to the cylinder.


Blender 2.76 Cycles texture baking strange artifacts I am trying to learn texture baking work flow using Cycles, I checked the manual and a few forum threads on the topic.

So, I have a lowpoly and a highpoly objects, both are UV-unwrapped.

I setup some material for highpoly object with color and displacement, both objects have the same location, I use "Selected to active" option, tried cage settings etc. Tried scaling hipoly object down, so that it is completely inside the target lowpoly object. But no matter what, I get these strange maps rendered. can anyone advise what am I doing wrong?

I also noticed that objects are rendered with flat shading whether or not I select "smooth" option.

Many thanks in advance.

Usually, this happens when the two meshes are intersecting. Avoid this enabling the cage option into the bake panel and set a distance maybe 0.05 (5 cm) in your case should do fine.

A normal map has mostly a blue tint indicating the z direction that the faces are pointing towards, In your case, as the meshes are intersecting you get this strange variation of colors because sometimes the hires mesh is on one side of the low res mesh, sometimes is on the other side.

Creating a cage (and not choosing an object as a cage) is like inflating your low-resolution mesh and projecting towards inside from a certain distance to find the high res object.

If you have a complicated shape and usually the concave shapes that simply "inflating" it makes it intersect with herself might need a cage object ( with the same number of verts as the low res object).

Also, shade smooth your high-resolution object.

P.S. You might want also to give a bit more distance between the two UV islands as they might overwrite each other.


How to combine sharp and smooth edges? I have been modelling a car "Lamborghini Gallardo" with the help of a blueprint but after completing the whole model I started to smooth out all the parts but due to the edginess of the hood its not smoothing properly because it is edgy at the sides and smooth in the middle part and sub-surf modifier is not worling properly. How to solve this?? Please reply.

Try the Edge split modifier. It will duplicate any sharp edge in your model before smoothing, making it looking sharp too. Look at this image:

Top left is an object without smoothing. Top right is with smoothing. It is not looking good. I only want smoothing along the top portion that is curved.

Bottom left is where I have added the Edge split modifier. This is the normal setting. This means any edge sharper than 30 degrees will be considered sharp (not smooth).

If this angle is not suitable, you can also manually select what edges should be sharp, see bottom right. Select edges, hit Ctrl+E to bring up this menu.

Here is an image of the settings for the Edge split modifier. It is very simple. You can control the angle cutoff and if you want to use manually marked edges.


Is there any way to make the surface look smoother without subdiv or smooth shading? I need to smoothen the look of the back of this model as well as the rotating chamber, i know two ways to do so;

smooth shading, but it returns some really weird look at turns and curves.
subdiv modifier, but i dont want to have too many faces, this is supposed to be a low poly learning experiment.

Please explain in a way a complete amateur could understand, considering this is my first self learning model, as well as me having precisely zero professional education with regard to 3d modelling. Thank You!

Welcome to Blender Stack Exchange!

From the image you provided, it looks like smooth shading will be the best option. To fix the issues you mentioned, there is an option called auto smooth. It can be found under the Normals heading in the Object Data Properties panel, which is the little green triangle icon at the bottom right of your image.

If you enable smooth shading then turn on this option, it will keep edges above a certain angle sharp. You may have to adjust this angle, but the default is often pretty good. So for example the edge of the chamber will still have a nice crisp edge.

Here's a comparison that shows the difference between the different shading options. The first is flat shading, the second is smooth shading (with the issues you mention), and the third is smooth shading with auto smooth turned on.


Blender 2.79: Apply location snaps origin to the object's original location Hi, I am encountering an issue in Blender 2.79 when I try to apply the location of an object. Every time I apply the location, the origin is reset to this random point off to the side. I'm guessing that I somehow stored data for the origin somewhere, but I don't know where. As you can hopefully see, using the Set Origin function works until I apply the location again. I don't have this problem with any other object, and I'm just not sure what to do. Any ideas?

Well I think I very quickly answered my own question by just playing around with it a bit. I don't recall ever using it before, but apparently I applied the Location to Deltas for that object previously. To resolve, I repeated the process for the new origin location.

Set Origin > Origin to Geometry
CTRL+A > Location to Deltas

Hopefully this will help someone else who encounters this in the future. Cheers!


how to damage copies of 1 enemy with I have trouble with damaging system.
I have made a damage system using property(animation property to damage at specific frame) and ray detecting "dmg" property connected to enemy object hp removal actuator with enemy having "dmg" property.
When i test on 1 (original) enemy, it works but when i want to make enemies appear via add object actuator it causes only the original object take damage.i tried to put the original on other layer but still didnt do anything. any idea how to make it work?

would also accept a new system for damage

i have solved it by myself by learning python and making new system, using this script. anyway thx for  answers...

from bge import logic as GameLogic
c = GameLogic.getCurrentController()
own = c.owner

enemydetect = c.sensors["enemydetect"]
punchright = c.sensors["punchright"]
if punchright.positive and enemydetect.positive:

    obj = enemydetect.hitObject

    obj["HP"] = obj["HP"] - own["RightDamage"]


Weird blueprint render result I receive a very distorted output result when trying to render my finished blueprints. I follow a tutorial in which the instructor converts lines made of hundreds of vertices into a curve, chooses Full as Fill Type and applies some bevel to it. He then makes a material with black as diffuse color & viewport color. Before rendering, he ticks the Transparent box in Film category in Render menu and chooses RGBA and PNG. I did the same but my render is very weird. How can I fix it?

My blend file: CGIVI_test
Note: Layer 10 and 11 are original lines; layer 1 and 2 are curves.
The tutorial in case you need: https://bit.ly/2MudMeR (11:35 mark)

You've changed the camera aspect ratio on Y. Use 1 on X and Y and then change the resolution X and Y to make it look like what you want.


DirectX exporter: does the currently-selected action make a difference? Working in Blender 2.70, I've created a simple model (a box with a few loop cuts) with a simple armature (2 bones). I attached the mesh to the armature and created two animations (actions) and called them 'ArmatureAction' and 'walk'. With the 'ArmatureAction' active and the mesh and armature selected, I export the model.

Here are my export settings:

When I open up the .x file, I see two AnimationSets: both called 'ArmatureAction'. However, if I export with the 'walk' action active, I get two AnimationSets: 'ArmatureAction' followed by 'walk'. Edit: In this case, the ArmatureAction animationset is made up of 865 lines whereas the walk animationset is only 289 lines. The walk animation has fewer keyframes, but I thought that it exported every frame, regardless of whether it's a keyframe. In that case, the discrepancy might indicate an issue.

Does the currently selected action make a difference when exporting the file? I'm using Assimp to load these files into another piece of software and I'm having trouble getting the 'walk' animation to show up at all.

Short answer: Yes, it does matter.

Long answer: Yes, but not that much. Also, my file was broken for a different reason. The reason the walk action wasn't showing up in the exported file was that it was tied to the Cube mesh as well as a fake user. If the walk action had only one user (a fake one), then the "Attach Unused Actions to First Armature" option would have properly created this animation in the .x file and attached it to the Armature.

In my file, the walk action was not unused because it was tied to the mesh. The exporter created an animation for it and attached it to the mesh, not the Armature. This action took up fewer lines in the .x file because there were no keyframes on the mesh itself, so the exporter didn't export any.

The moral of the story:

Make sure your actions all have fake users
Make sure your actions don't have any extraneous users


How do I deform one object using another object as a guide? I am not too sure if I am making myself clear, but is it possible to have, say,
object A with 20 vertices and object B with 15 vertices.

Is there an automated way to deform object A to resemble object B? I'm horrible at judging shape/sculpting and was wondering if there was an easier way to shape things.

A shrinkwrap modifier can be used to deform one object to the surface of another.

Retopology is a more manual approach that uses automatic transform snapping of vertices to another surface to make a clean duplicate of an object.


Saving compositor File Output without rerendering Is it possible to save a File Output node in the compositor without rerendering the entire scene?

Best solution I have so far is to add a dummy render layer with nothing in it.  Then, I can re-render just that layer, and the compositor will output all of the File Outputs.


Particle system to individual objects with keyframes i have this animation where the particles move from the bottom to the top and i want to delete all the particles that don't make it to the top, how can i do that?

Mesh with Collision Physic can kill particles. Add a particle killer mesh and turn of it's render visibility.