Camera Rotation in World Coordinates? Are the coordinates of the camera in the world coordinate system?
If they are not, how can I change to the world coordinate?

The transform properties display LOCAL coordinates.

The values for location, rotation and scale are local coordinates.

They will also be the global coordinates if camera has no parent, or all its ancestors have Identity  matrix world (0 loc and rot unit scale) (and there are no constraints involved)

To display the global location of an object snap the 3d cursor to the object. (ShiftS Cursor to active) The 3d cursor is always in global coordinates.

In cases where you can set the global location of camera, move the 3d cursor and (ShiftS Active to Cursor)  Note if there are constraints (for example copy location) then these will override any transform property settings.

Can get the global rotation from the console with

>>> C.object.matrix_world.to_euler()
Euler((0.7297371029853821, -0.4792802035808563, -0.5616455078125), 'XYZ')

that's in radians. In degrees

>>> [degrees(a) for a in C.object.matrix_world.to_euler()]
[41.8108561551659, -27.460732869353954, -32.179917180138155]

Displaying in the UI.

Cube rotated locally in y 45 degrees. Parented to empty.  The global rotation is displayed below the local. (The Cube is pinned to properties, as the empty  parent is rotated)

Bare bones example script for 2.8 to put  global rotation euler 'XYZ' on transform panel.  Didn't add a setter, hence the disabled look.

import bpy
from mathutils import Vector
from bpy.props import PointerProperty, FloatVectorProperty, IntProperty
def global_rotation_euler(self):
    ob = self.id_data
    return ob.matrix_world.to_euler() # ob.rotation_type

from bpy.types import PropertyGroup
class GlobalCoords(PropertyGroup):
    x : IntProperty()
    rotation_euler : FloatVectorProperty(name="Rotation",
            default=(0, 0, 0),
            size=3,
            subtype='EULER',
            precision=3,
            get=global_rotation_euler)

bpy.utils.register_class(GlobalCoords)

bpy.types.Object.global_coords = PointerProperty(type=GlobalCoords)

def draw_global_coords(self, context):
    ob = context.object
    layout = self.layout
    col = layout.column()
    col.prop(ob.global_coords, "rotation_euler")

bpy.types.OBJECT_PT_transform.append(draw_global_coords)


How to create a custom UI script that toggles a specific Object's Render and Viewport visibility while being a bool property (toggle or checkbox)? Blender Python (overall Python) noob here. I simply want to make a Custom UI that toggles my models accessories by enabling and disabling their viewport and render visibility. Generally, I want to know how to make customizeable input for operators but I simply can't wrap my head around it. I'm trying to avoid using Custom Drivers since I need a more user friendly input and not just a float property.

I don't exactly have a full script since I'm not sure how to approach it.

Here's a script that toggles the visibility of both the viewport and render but isn't a toggle:

import bpy

class UiPanel(bpy.types.Panel):
    bl_label = "Custom UI Visibility Toggles"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = 'Item'

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

        layout.operator("cube.button")

class CubeVisibility(bpy.types.Operator):
    bl_idname = "cube.button"
    bl_label = "Cube Visibility"

    def execute(self, context):
        if bpy.data.objects['Cube'].hide_viewport == True:
            bpy.data.objects['Cube'].hide_viewport = False
        else:
            bpy.data.objects['Cube'].hide_viewport = True

        if bpy.data.objects['Cube'].hide_render == True:
            bpy.data.objects['Cube'].hide_render = False
        else:
            bpy.data.objects['Cube'].hide_render = True

        return{'FINISHED'}

def register():
    bpy.utils.register_class(UiPanel)
    bpy.utils.register_class(CubeVisibility)

def unregister():
    bpy.utils.unregister_class(UiPanel)
    bpy.utils.unregister_class(CubeVisibility)

if __name__ == "__main__":
    register()

This one has the toggle feature but are on separate buttons (needs to be only one):

import bpy

class customMenu(bpy.types.Panel):
    """Sample Toggle"""
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_label = "Toggle"
    bl_idname = "custom_ui"
    bl_category = 'Item'

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

        row = layout.row(align=True)
        row.prop(bpy.data.objects['Cube'], "hide_viewport",text="Viewport")
        row.prop(bpy.context.object, "hide_render",text="View")

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

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

if __name__ == "__main__":
    register()

Syncing both properties and controlling them by another BoolProperty, takes a lot effort to manage situations like the User disables one of the properties in the Outliner: Is your custom (single) property in this case False or True?

One simple approach is using an operator to set the state of both properties and also store the name of the object (unique). In case the string property is not empty, the operator "resets" all the values:

import bpy

from bpy.props import (StringProperty,
                       PointerProperty,
                       )

from bpy.types import (Panel,
                       Operator,
                       PropertyGroup,
                       )

class MySettings(PropertyGroup):

    my_obj: StringProperty(
        name="Object Name",
        description="Helper property to store an object name",
        )

# ------------------------------------------------------------------------
#    Operators
# ------------------------------------------------------------------------

class SimpleOperator(Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Disable in Viewports and Renders"

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

    def execute(self, context):
        scene = context.scene
        mytool = scene.my_tool

        if not mytool.my_obj:
            # Disable both properties and store the name
            mytool.my_obj = context.active_object.name
            context.active_object.hide_render = True
            context.active_object.hide_viewport = True

        else:
            # enable both properties
            obj = context.scene.objects.get(mytool.my_obj)
            mytool.my_obj = "" # Set the string to None
            if obj:
                obj.hide_viewport = False
                obj.hide_render = False
                obj.select_set(True)

            # Set the active_object:
            # https://blender.stackexchange.com/a/132829/3710
            #bpy.context.view_layer.objects.active = obj

        return {'FINISHED'}

# ------------------------------------------------------------------------
#    Panel in Object Mode
# ------------------------------------------------------------------------

class OBJECT_PT_CustomPanel(Panel):
    bl_label = "My Panel"
    bl_idname = "OBJECT_PT_custom_panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Tools"
    bl_context = "objectmode"

    @classmethod
    def poll(self,context):
        return context.object is not None

    def draw(self, context):
        layout = self.layout
        scene = context.scene
        mytool = scene.my_tool

        layout.label(text="Object Properties")
        row = layout.row(align=True)
        row.prop(context.object, "hide_viewport")
        row.prop(context.object, "hide_render")

        layout.label(text="Toggle Operator")
        layout.operator(SimpleOperator.bl_idname)
        layout.separator()

# ------------------------------------------------------------------------
#    Registration
# ------------------------------------------------------------------------

classes = (
    MySettings,
    SimpleOperator,
    OBJECT_PT_CustomPanel
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

    bpy.types.Scene.my_tool = PointerProperty(type=MySettings)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)
    del bpy.types.Scene.my_tool

if __name__ == "__main__":
    register()

Layout code from: How to create a custom UI?


shrink_fatten on GPencilStrokePoints I am trying to run bpy.ops.transform.shrink_fatten(value=0.3) while I have a point on a grease pencil stroke selected (in edit mode), but I am getting the error: "Operator bpy.ops.transform.shrink_fatten.poll() failed, context is incorrect"
Is there no way to shrink_fatten a grease pencil point with Python? Or am I missing something?

Your have a context issue because you might be running your script from text editor while shrink_fatten.poll method checks if you're in the 3D view.
Overriding context can be painful especially in edit mode, so you should avoid using ops whenever you can.
About the shrink_fatten ops, i noticed that it simply change the pressure value of each point. So i would try :
#set frame as the current active frame
frame = bpy.context.object.data.layers.active.active_frame

#set amount of pressure to add or remove
amount = 0.3

#apply this to selected points
for stroke in frame.strokes :
    for point in stroke.points :
        if point.select :
            point.pressure += amount


Assigning vertex groups to bones precisely I've looked at several answers to this question and none of the responses are giving me what I need.

Vertex groups are selected in the armature options, the vertex group names  correspond to the bones I want them to be attached to, and I parented the armature to the mesh with the 'armature deform' option (I tried automatic weights and the result was even worse).

I would have thought that the vertex groups would be influenced 100% by the bones sharing the same name as the vertex group, and 0% by the bones that do not have the same name.

This is not what is happening, as can be seen here:

The 'base' bone influences the 'base' vertex group fine, but also influences the 'lid' vertex group -which I don't want. Furthermore, the lid vertex group looks like it is only 50% influenced by the lid bone, as shown here:

I know there is an obvious remedy to this, but it's one I don't like using. Weight painting is not precise and very fiddly.

Fast and easy way to do it is in edit mode, select the part of the mesh that you want to be effected buy one bone, then in vertex groups select the group of related bone and assign weight with value of 1.

Then select other other vertex group and hit remove button.

Then repeat the same process on the other part of the mesh assigning or removing weight that you want to be associated with that part of the mesh.


How to make procedural Powder Coat material? i am Industrial designer and i need a powder coated material, im trying to make it procedural but i cant achieve a realistic solution.
Has anyone had any experience with trying to make a material like this?

You could probably accomplish this pretty easily with a Noise Texture. I just scaled it to 60 and upped the detail and roughness a bit. I mixed it with white before running through a Bump Node to make the effect less jarring, and mixed the main color with an Ambient Occlusion Node to highlight the dimples. I also increased the metallic value to try and make it match the image you posted. Don't forget to enable Ambient Occlusion in the render properties panel:


How do I make a curved arrow? I have a simple arrow like this:

I want to make it curved about the Z axis like this:

In this image it is a texture applied with transparent background to a plane. But I want to make it a 3D model and apply a special material.

I tried adding a curve modifier and ended up with this:

What is the best method to use?

As others have stated, I need to add more geometry to deform around the curve:


Is it possible to have separate animations, with independent timelines? I've a scene with several objects that have (keyframe) animations attached to them. For clarity, think of a house with different doors and windows that can open and close independently of each other.

Right now, I've a single timeline that opens all the 'doors and windows' one by one. But I would like to be able to change when which animation plays when, independently of each other. I would like to, for example, open two doors at once, while all others stay closed.

Is this possible?

Yeah, open the timeline and the dope sheet:

On the bottom bar of the dope sheet windon change the "mode" from "Dope sheet" to "Action". Select a door, add an action and call it like "Door 1" and animate it from frame 0 the door opening.

Repeat until you have all doors and windows opening at the same time (only the beggining, you can have different ending times).

Then change the Dope Sheet window to the NLA Editor where you can see all actions:

Press the icon of the down arrows and you'll see that it creates a box, repeat for every object and then, choosing a box and pressing "g" you can move the box freely.


How to convert follow path to object How to convert follow path to object I have made a add object constraint follow path and given the path. I dont want to animated it. I want that mesh to be used. How can i delete the path and used the mesh that is created. An image i have attached with the follow path i have made the sphere a shape and i dont want that path just the sphere i want with that path shape. I want to convert to a single object. ctrl+j not working and if i delete the path ever thing disappear
blend file ...

Select all your meshes, Ctrl+A to open the Apply menu, select Visual Transform. This will apply the constraints, but you still need to remove them (they're applied AND active) with Ctrl+Alt+C.
Then you can join them with Ctrl+J.


Can you auto-pack a selected group of islands in UV view? I'm trying to figure out ways of optimizing my UV Layout creation workflow. Here's what I do so far:

mark seams on the mesh
select the mesh and press u u to auto unwrap it
if the UVMap image ("checkers" view) looks too distorted on the mesh, go back to step 1 (mark more seams).
Once satisfied, select the logical parts of the mesh in 3D View so only those corresponding islands show in the UV view. Due to auto-unwrap, these islands are dispersed throughout the UV layout.
Move each of these islands one-by-one close to each other so they are all in the same location in the UV layout
Repeat steps 5/6 for every part of the mesh

Is there an easier way to do step 5? Like some kind of command in UV mode like "auto-pack the selected islands" using the same underlying layout algorithm used for the initial unwrapping?

Also, if there are any tricks worth knowing that could speed up this process, please let me know! Thanks.

Use Pack Islands command to automatically organize all your islands so that they fill the UV space:

  The Pack Islands tool will uniformly scale, then individually transform each Island so that they fill up the UV space as much as possible.


Is it possible to export just the keyframes of an animated model into COLLADA in Blender 2.8 (unbaked animation)? I'm trying to export a rigged model into a COLLADA file. However, it seems to bake (bake may not be the right word - I'm new to Blender) the animation in the sense that it exports every frame's joint positions / rotations (so, if the animation is playing at 30fps, and the animation is 5 seconds long, then it exports 150 different positions / rotations for each joint). I would just like to export the keyframe poses (so if there are 5 keyframes over 5 seconds, just export those 5 keyframe poses).

It seems that in Blender 2.7, the keyframes were getting exported the way that I want.

Just to illustrate my point:
I'm exporting a rigged animated model, in which the animation has 5 keyframes.
In the Blender 2.7 export, in the input section of each bone (library_animations tag), there are 5 floats (corresponding to the time value of each keyframe) and therefore 5 output matrices.

In the Blender 2.8 export, there are 250 input floats (corresponding to the time in the animation) and therefore 250 output matrices.

Is it possible to just export the keyframe poses like in Blender 2.7?


Pack UV islands with their same scale? Is there a way or add-on that allow for UV packing without re-scaling the islands? like 'Pack together' in 3ds Max.

Thanks in advance.

After searching for some time I found that there is no such function in blender, so I tried to make an add-on that provide this function.

https://www.youtube.com/watch?v=IwE1PQiqCb0

Thanks for the help :)


Is it possible to hide particle emitters in the viewport without hiding particles? Is it possible to hide a particle emitter object in the 3D view while keeping particles visible?
I know you can do this in the render with the Render Emitter setting, but this does not affect the viewport.

Sometimes the emitter can get in the way, though it's still useful to know where it is. The ideal solution then is to make it drawn as a wireframe, but setting the Maximum draw type to Wire or Bounds causes all the particles to be rendered as wireframes or bounding boxes too.

Setting the emitter object's draw type would work, except it also changes the way the particles for that emitter are drawn:

Is there anyway to make particle emitters hidden or less distracting while keeping the actual particles unaffected (still rendered as solid or textured)?

Another way (similar to Michal's answer) is to use a Mask modifier:

Add an empty vertex group to the particle emitter by pressing the + button in Object Data > Vertex Groups:

Add a mask modifier after the particle system with the empty vertex group:

There was a bug in 2.69; in order for the mask modifier to work you had to assign and remove some geometry to the vertex group. It has since been fixed.


Bone selection in edit mode is no longer working I can no longer select a complete bone from its body in edit mode. It only selects the bone end points. I have to use the outliner to select a complete bone.

This only happens on my main computer, both version 2.77 and 2.78. I have installed blender 2.78 on a second computer and things work fine. Has anybody else experienced this? Been looking around in console and input short cuts but I'm lost.

Check in the inspector that you haven't deselected the mouse icon on the bone as this stops objects from being selected.

Hope it helps.


Stitching Meshes Together For a game project I'm working on, I want to "stitch" together several grid-like meshes:

Each mesh is sculpted starting from a regular grid to give more depth and detail to its texture. But the individual meshes have to seamlessly connect to their neighboring mesh.

Currently I'm achieving this by selecting each vertex pair and merging the vertices. Which is a lot of dull work. "Remove Doubles" with a big tolerance setting won't work because sometimes the vertices are closer to another vertex than they are to the one they should be joined with.

Can anyone think of an efficient way to join such meshes at their borders?

I'd write a python script that just sorts all selected vertices along an axis and then merges each odd+even pair, but I'm not fluent with Python or the Blender API yet :)

In the time since I asked my question, another question + answer pair has appeared that does what I originally intended to do (merge the edge loop instead of bridging it):

How to Merge Two Edge Loops

Newer Blender releases have Bridge Edge Loops tool for exactly that purpose. Select two edge loops with exactly the same vertex count, then execute the operator. The tool is accessible through the Space menu, or Specials W menu.

There is also an addon included with Blender named LoopTools, containing Bridge tool with the same usage as Blender's built-in tool I described above.


Shadow Catcher, Shadow Rendering Behind Tracked Camera Scene I asked a question before but I think the problem has changed enough to ask it in a new way.

I tracked some footage using the setup tracking scene button, and had issues with the rendering.  I switched over to Cycles from Blender Render , and used Shadow Catcher. This seemed to work until I exported the render, which I think is placing the shadow below the tracked camera scene.  When rendering, the image viewer shows the shadow background layer being rendered, but the final image doesn't have it.

Is there a way to bring it forward above the camera scene and below the object casting the shadow?  This is a screenshot of my workspace.

OKAY!  I've done some work and gotten pretty good results.  I believe my issue before was that I had objects on the wrong layers.

Well, I'd like to be more explicit in how I fixed it but basically, I went around and figured out that I had objects on the wrong layers.  After I switched from Blender Render to Cycles I was still having issues, even though Shadow Catcher was a much simpler option.  Even though the composite was working in Blender, it wasn't until I moved things to the proper layers that the shadow would show up. Now everything looks right and I'm on to my next challenge!


Ideal camera settings to approximate human eye? As far as things such as Focal Length, Sensor Size, etc., what are the ideal camera settings in blender that most closely approximate the human eye?  Right now, everything in my scene seems like it is way smaller than it should be at the default settings.  I believe this is because the defaults assume a scale of 1BU = 1cm or 1mm, whereas I am using a scale of 1BU = 1 meter.  I am doing so largely because I will be constructing large indoor and outdoor scenes (including an entire city) where working with a scale of 1cm or 1mm would be too unwieldy, and possibly run into internal software limits.

Now, I realize that because blender's camera uses monocular imaging instead of binocular imaging (like the human eye) it cannot perfectly match how a human would view the scene.  However, I'm not looking for perfection: I'm looking for a close approximation that is "good enough".

The default in Blender assumes 1 Blender unit = 1 meter, so you're actually on the right track there.

As for the question regarding a match on the human eye, that's a tough one. Not just because of the monocular/binocular thing, but also because your retina is curved and most cameras and digital approximations assume a flat sensor.

That said, I've done a bit of my own research on this (reading advice from photographers is interesting... not always accurate, but interesting :) recently and landed on the following settings that seem to work reasonably well:

Camera Sensor - 35mm
Camera Focal Length - 45mm

Clipping distances, you'll need to adjust to taste.


How to append with logic bricks? Basically I want to make a game where a user can add their own levels by making a blend file with an object in called a certain thing, so for example you would have to call the level "Object.001" or something for it to work. Then when you start the level, it plays that level. And no I do NOT want to make it just open the blend file, because then I would have to make a template but people would just steal the template and use it for themselves and claim it.

To start with, I will just mention that the biggest issue in the current game market is not theft, it is the opposite: trying to get people to play your game out of the thousands of others.

My suggestion is to:

Provide a basic template to everyone (so who would steal it?)
Provide good documentation on what objects you can add that do what.

OR
Take a completely alternate approach, such as having a blend file called 'LevelParts.blend' with groups of objects people can append to their custom levels.


Rendering one pass only to avoid unnecessary computations in Cycles Using Cycles, I only need to render one pass (depth map and surface Normals) of a 3D shape in the scene. I do not need the RGB rendering at all although most of the computation is spent on rendering RGBs. Un-checking Combined in Render Layers --> Passes seems to do nothing. Using nodes, connecting either depth map or Normal to the composite node will also do nothing as mentioned here too. I tried setting bpy.context.scene.cycles.samples to a pretty low number as the depth map quality seem not to change. But I need to set it to a higher number in order to get accurate surface Normals and this causes the computation become more heavy.

Although I do not fully understand the solution posted here, but I think it does not apply to my problem (or I don't know how to do it properly. So I wonder how I can do this?

Cycles works by tracing many light paths through your scene and gathering information (depth, normals, color, etc) from the interactions of those paths with stuff in the scene. Simply ignoring the color information won't give you any significant performance gain.

All you can do1 is limit the number of paths you have to trace as much as possible; set the bounces to 1 and the samples as low as you care to go. You probably still want a few samples in order to retain a bit of anti-aliasing (16 should be plenty). If you have lots of motion blur or DoF (or any other situation where a path straight out of the camera will not always give the same value), then you may need more.

1: Without switching to a different engine which might better suit your needs, that is.


How can I project text around a sphere using shrinkwrap modifier? text object doesn't project correctly to my mesh sphere, and often (but not always) blender crashes when I try "Mode project".
I can't get the text to wrap correctly around the mesh.
So, why doesn't "project mode" Do anything? (except crashing blender) - When i am able to apply it, nothing happens.

Thanks in advance, / Dan

Check this Blend file:

For the Shwinkwrap modifier to generate a smooth result in a situation like this, more geometry is needed. You need to subdivide the Text Object first to provide the necessary detail. Luckily, this can be done dynamically using modifiers:

Setup a Subsurf Modifier on the Text object. Set its mode to Simple instead of Catmull-Clark to avoid distorting your Text object. Subdivide as many times as needed, but try to stay on the lower end (I chose 2 for Display and render):

Now, to use Projected as a mode, you'll need to setup the Axis correctly as well as which direction Blender is supposed to look for the other object to wrap on: I chose my sphere as a Target, then set the Axis using the check boxes (note that for the modifier the LOCAL Axis of the object counts. In the first screenshot you can see that the blue arrow correlates with the direction I want to go in, so that's the Z direction). The direction field now lets you choose the direction in which Blender looks for the Sphere. Again, look at the first screenshot: the Blue Arrow points AWAY from the sphere. That means, to make the Text wrap towards it, the Direction needs to be set to 'negative'.


Use shrinkwrap on certain vertices? By default when you use shrinkwrap, it takes the whole mesh of the selected object and wraps it to the target object. What I want to know is if I can get this result using certain vertices, so that they can wrap closer to his wrists, ankles and waist like cuffs on clothing, without making the entire mesh look skintight.

In your object, in Edit or in Weight Paint mode, you just have to create the vertex group that is supposed to stick to the Target object, then add your Shrinkwrap modifier and choose this group in Vertex Group.

Also note that the more your vertice will be part of the group (i.e. from 0 to 100% weight), the more it will stick to its Target object


How can I create an animation within a cloth simulation? I have been trying to create an animation (in which an avatar moves her arms) and I want it to run while a cloth simulation is happenning. I have tried this, but the cloth disappears in the simulation because of the animation, which is running at the same time. How can I make this work?

I have solved it: I created the skeletal animation as if there was no cloth simulation happening at the same time. After that, I created the cloth simulation and applied the collision modifier to the avatar. After baking the cloth simulation, I played the animation and it worked: the cloth responded to the skeletal animation and did not disappear.


Objects appear in the viewport and preview render, but not in the outliner or final render I don't understand what happened. Before when I saved the file it worked fine, but when I came back and reopened it, this problem started happening. (It is most visible with the character's eyes.)

The object is visible in the viewport, but it appears nowhere in the outliner. (Yes, I have scrolled down through the entire outliner to check.)
The objects even appear in the preview render and work fine there,(Sorry I couldn't post more than 2 pictures.) but once I press F12 for the final render the objects completely disappear.

I am using cycles render. I am hoping someone might be able to help me, I have searched a lot, but have not been able to find an answer to my problem anywhere.

As mentioned in the comments, you most likely have the eyes set as not visible in the render. This is shown in the outliner with the camera to the right of the object, the eye is for viewport visibility, which also effects viewport preview rendering while the camera only affects the final render.

To find an item in the outliner you have a few options, if they are named well you can search for them -

If you haven't named things, you can select it in the viewport and the item will be highlighted in the outliner, with a large list of items press . with the mouse over the outliner to zoom to the item, this will expand any parent objects to show the item.

Once you locate the object in the outliner, click the camera to make it visible in the render.


Texture/material mapping changes from viewport to render (p) I am making a room in the blender game engine. I created corner, side and middle pieces. With linked copies of those pieces I assembled a room. The floors in the corner, side and middle pieces are exactly the same texture and material (seamless tiles image file) and in the viewport the floor of all pieces looks exactly the same. However, when I go into game mode ('p') suddenly the floor texture of the middle pieces shifts a little. How is this possible? Since they all use the same material and they are linked copies, the floor should look the same in all pieces right? GLSL is enabled.
In response to Monster's comment, I hereby add images:
Picture of Viewport: http://s1180.photobucket.com/user/knyntje/media/Work-related/game_mode_zpsabit55gz.jpg.html and of game mode: http://s1180.photobucket.com/user/knyntje/media/Work-related/3Dviewport_zpszy8j3ue0.jpg.html
Best, Nynke

In response to Monster's comment I have tweaked some settings regarding UV. I found out that when I unwrapped the floors of all three types of pieces and I set the texture coordinate to UV that it looks the same for all floorpieces and also the same in the 3D view and the rendered view.
Why it only went wrong with 1 type I still do not know (because I had not unwrapped any of the pieces earlier) but luckily the problem is solved now.


Align an array of vertices to vectors with python I have an array filled with points that should be aligned to a random coordinate system. The direction vectors of the coordinate system are known, as well as the direction vectors that form the points together.

My approach was to calculate the respective angle, from each point to the appropriate direction vector and then to rotate each point by this angle. The  centre of rotation is the origin of all vertices together.

vert_array = [vert_1, vert_2, ..., vert_x]

def dotproduct(v1, v2):
    return sum((a*b) for a, b in zip(v1, v2))

def length(v):
    return math.sqrt(dotproduct(v, v))

def angle(v1, v2):
    return math.acos(dotproduct(v1, v2) / (length(v1) * length(v2)))

angle_x = angle(x_axis_vec_coordinatesys, direction_vec_x_array)

for vert in vert_array:
     mat_rot = mathutils.Matrix.Rotation(angle, 4, direction_vec_x_array)

     new_point= mat_rot * (vert - origin) + origin

     vert_array_new.append(new_point)

#And so on for all axis.....

Unfortunately, that doesn't really work. If I had the vertices in an object, I would know how to adjust the object using DirectionVector.to_track_quat('X', 'Z'). However, it is not possible for me to save the points in an object here. These must remain independent of each other in an array.

I know i have somehow to use the rotation matrix and translation matrix, but i don't know how.

Edit:
I've added a blend file for a better understanding. My current code is included there. The emptys in this file should simulate the coordinate axes. I've also added the translation of the new coordinate system, not like before.

My new coordinate system and the incorrectly placed points:

Edit: My desired result

Blenderfile

Advice, suggestions, questions, or assistance are all welcome.

The question is equivalent to say:

vert_array is a set of coordinates in world space
a coordinate system is given by its 3 vectors also in world space
how to convert vert_array so that it has in world space the coordinates it should have in this coordinate system

So, the point is to find how to do that.

To convert from 1 coordinate system A(X, Y, Z) to another B knowing X', Y', Z' of B in A, you can use a matrix like the following composed of 3 columns which are respectively the coordinates of X', Y' and Z'.

Once the matrix defined, as it allows to convert from A to B, we need to get the inverted matrix to have the result.

Here is an example in Python:

import bpy
from mathutils import Vector, Matrix

# Coordinates system: enter your own values there
x = Vector( (0.70711, -0.70711, 0 ) )
y = Vector( (0, 0, -1 ) )
z = Vector( (0.70711, 0.70711, 0 ) )

# The matrix to go from world to the coordinates system
# It is defined by rows
m = Matrix( ((x[0], y[0], z[0], 0 ), (x[1], y[1], z[1], 0 ), (x[2], y[2], z[2], 0 ), (0, 0, 0, 1 )) )
m.normalize() # mainly because values are approximated above

m_inv = m.inverted() # as we need to go from the coo system to world

objects =bpy.context.selected_objects #get some objects (or take your vector array)

for o in objects:
    o.location = m_inv * o.location #apply the transformation


Rendered image background has strange stripes I have created a little scene. However, the right half of the image produced has white/grey stripes in the background. What is causing this? I am using the Workbench render engine.

I believe this is caused by a plane which is flat with the grid (hidden in the image).

Must be a glitch, but deleting the plane flat with the grid and adding it again fixed the issue.


Lock the camera's Y position in BGE? I am making a 2D platformer. I parented the camera to the player so that the camera follows the player.
However, whenever the player jumps, the camera also jumps.

How can I get the camera to not jump with the player?
Can I lock camera's Y position?

Instead of parenting the Camera to the Player, use this code to copy the location of the Player to the location of the Camera:

import bge
import GameLogic as g
cont = g.getCurrentController()
own = cont.owner
scene = g.getCurrentScene()

player = scene.objects["Player"]
camera = scene.objects["Camera"]

loc = player.position
x = loc[0]
y = loc[1]
z = loc[2]

own.worldPosition = [x, y, z]

Since you don't want it to move on every axis along with the Camera, i would simply fill in each axis in the own.worldPosition = [x, y, z] line that you dont want to be changed with the camera's actual location. For example my line reads own.worldPosition = [x, -30, 5.8]. This keeps the Camera locked on the y and z axes while copying the x location of the Player. Hope this helped. :)


Edit a rigged mesh in pose position? I'd like to edit my mesh in the pose position so that the wire frame is in the pose position as well.

I have "view in edit mode" enabled for the armature modifier, but it only shows the mesh in reset position.

In Armature Modifier panel enable both Display modifier in Edit Mode and Adjust edit cage to modifier result buttons.


Smooth or merge the hand and the forearm I have made a model in Sculptris which is a 3d sculpting program from the Zbrush team. And I have separated my whole character body from hand, feet and eyes. I exported it to .obj and what I'm trying to do is to "merge" all the separated parts I have sculpted.

But my problem is that it was exported as a single object so there's a clear separation between forearm and hands, feets and legs. And i don't know how I have to proceed in Blender to "merge" them together. Here's an image to illustrate my problem.

I have never used blender. (it's my first time with sculptris too :p). So please be as precise as you can if you know how i can fix this. Thank you.

Since user hawkenfox suggested it, I will post my comment as an answer:

You need to Tab into Edit Mode, RClick to select a vertex on the hand, press Ctrl L to select all the connected (Linked) geometry, then H to Hide the hand geometry. This will let you see what's going on with the arm underneath and you can select then delete the faces of the arm stump. Then Alt H to un-Hide. Repeat this for the arm and delete the faces on the wrist of the hand geometry. Then you can use Merge (Alt M) or Fill (F) to connect the hand to the forearm. Whether modeling in Blender or Sculptris, it's better if you can sculpt all as one piece in the future and avoid this extra work.


Crumpled Paper Cycles Texture I'm trying create a crumpled paper material in Blender Internal. It's pretty easy, here's my result just using Voronoi texture with little setting:

But when I've moved to Cycles, it is not getting close in material nodes using Voronoi, Noise & Musgrave textures.

Just give me little step to make this crumpled paper in Cycles, I'll do the rest...

What I needed exactly:

Option 1

In my opinion you'll bet better control using a displacement modifier instead of using the displacement on the material nodes.

The controls for the voronoi texture are much more detailed for textures.

Add a plane, subdivide it a lot (I did 100 subdivisions on this example)
then add a displace modifier and use a voronoi texture to control the displacement. Play with the feature weights, scale, intensity,brightness and contrast as well as with the strength of the displacement for the modifier.

For more nuanced textures you can use different displacement maps with different settings. Note that the quality of the displacement is related with the amount of vertices on your mesh. For a nice looking paper you might need a lot of vertices. In this case I added a subsurf modifier before the displacement to further subdivide the mesh.

Option 2

If what you are after is to create a bump map (with no real geometry displacement just plug in a voronoi texture to the displacement socket of the material output.

Note that this will give you just the illusion of relief.

Note also how very little control you have on the voronoi texture.

You can combine more than one texture to create the larger and smaller folds.

Otpion 3

To create real displacement you need to enable the experimental features on the render settings.

Then set the displacement control on the material settings to true displacement.

Then the textures connected to the displacement socket will affect the geometry of the object.

For a detailed and more random looking displacement combine several textures.

Note that you will not see the displacement in wireframe, solid or texture shading, only on material or rendered shading. Also render shading will not update when making changes, only material shading will update in real time.


Subsurf modifier creating mesh irregularities I'm working on an armchair, and I recently applied the Subsurf modifier to it. All was well until I noticed an irregularity that I simply cannot fix, here's a picture with and without the subsurf:

So I was wondering how I could take it away? Here's a link to the .blend file.

first steps are always: Remove Doubles, Recalc Normals. Then look around the mesh in Object mode without modifiers on to see if you have any double edges (they will show up as wires even in Object mode).

But here another problem is you have a whopping non-planar Ngon, a polygon with more than 4 verts, for the side. The ngon isn't flat, if you look carefully it tapers away into the back-rest (visible on the bottom left view).

Ngons as best avoided with subsurf, and especially avoid using them on areas that are non-planar. Why avoid them? Because you have no control over the underlying triangles, the ngon has abstracted away the real geometry.

Under the hood the real geometry of that ngon might look something like  this, and that is a problem for subsurf.

If you don't quite know what "planar" is, then imagine a sheet of paper, placed on a table. it is perfectly flat. now if you make one fold in it, and try to press it back into place - you know the fold will stay visible for a very long time, maybe forever. The sheet of paper has a discontinuity, the corner of that fold no longer lies on the same plane as the other corners. There will always be a bend. In geometry imagine something similar is happening when you join an edgeloop which isn't planar.

You need to guide your geometry at the back and maybe make an extra edge-loop. Fill this gap a different way. But exactly how depends a lot on the final shape you want.

assert some control over the underlying geometry of that side, and remove doubles, and you'll get reasonable results. adjust to taste of course.


override object color on Linked Group I have a linked library I am creating with a bunch of assets.  Example.  A modular house sections ie. types of roofs and so on, each section made of multiple meshes.

I need to quickly make houses and building with this modular system and then be able to edit the color ramp and/or material. I use a random node with a color ramp to make the meshes different colors. But each scene will need the colors modified without effect the original mesh in the library.

I have gotten as far as to be able to change a material color with a simple script, typing in the diffuse colors.  Which make me think as long as the material is on the object not the data it should be able to be overridden some how.  I have seen several posts around about similar issues but so far not any working solutions.

Thoughts?

Thanks

Amanda

This is a common issue that will be resolved when overrides arrive in Blender.

However, a possible solution for your problem right now could be the following:
Drivers.

You can add drivers to the parameters in the node tree that you want to influence. E.g. attach the Factor of a Mix node to the x-Position of an Empty.
Make sure the Empty is in the same collection that you link.

Then, when you link the collection in a new blend file, you can create a proxy of the Empty and consequently use it to change the material.

I hope this helps point you to a working solution.


How to save custom view of 3D viewport? While sculpting, or animating i would have zoomed in rotated and panned to got to a correct view to sculpt or pose. But if i rotate by accident or by need there is no way to go back to that view i had got previously. Are there any script or add on to save custon view of 3D viewport.

There are addons available to do this. Such as the one available here: http://blenderartists.org/forum/showthread.php?218403. But the functionality is not available by default.


Python: Change the texture resolution limit individually ? Per Material? in simplify (propreties) we have the option to reduce every textures size that are higher that 2k, for example, to this same resolution. Is it possible to simplify individually an image texture? or every image texture from a material? via python of course.

you mean independently from the simplify ? just by changing image size ? If you are looking in to this I have a small experience since I did something similar before few years in order to bake textures and export them for webgl (DAE) with the minimum res I could afford for online apps.

there is a scale property in bpy.data.image object, according to this thread it must be relatively easy to implement it, although from a quick search I found out that this is only for new made images created in blender.

Thus for you will need an external module to accomplish it, so take a closer look on the second response which is mentioned also as the solution.

How to change image dimensions of a generated image from Python?


'Context' object has no attribute 'view_layer' in Python Script I'd like to run the script here
but hit an error on the 2nd line:

view_layer = bpy.context.view_layer
Traceback (most recent call last):
  File "/usr/lib/python3.6/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<blender_console>", line 1, in <module>
AttributeError: 'Context' object has no attribute 'view_layer'

Autcompleting the bpy.context object does show there's no view_layer property...maybe the docs are outdated?

The manual page you've linked is for Blender 2.81 and is up-to-date. If you're using an older version of Blender you'll have to consult the matching version of the manual. The documentation of bpy.types.Object in Blender 2.79 can be found here.


Different gpu without sli.how will it work in terms of memory I want to use gpu without sli to render.so how will this work? Example if i have a 8 gb and 11 gb card....will my system bottle neck and only use 8gb when rendering or will total of 19 gb of memory be available.

The cards are completely separate, they do not share memory. Whatever the lowest amount  of vram (in your case 8gb) will be the limit in blender.

The reason being that the whole scene is loaded onto each card. They are very likely rendering at different speeds, meaning your stronger card will be rendering more tiles then the weaker card.
(Think of it as if each graphics card is a computer in a render farm.)


Can Blender be used to create a physics based game without programming? My question is this, I want to create a dirt bike game that is more physics based then animation based.  I am brand new to the engine, and I am more of a graphic designer and not a coder, would it be possible to set physics without knowing coding?  Thanks again guys this is really awesome!

Blender's game engine uses a node concept for "wiring" game functionality which are called logic bricks. You can get more advanced functionality with programming in Python, but the logic bricks can do what you want if you want to avoid the programming. So yes, you can create a game without programming knowledge using Blender's game engine.

The Intro to BGE on the BlenderWiki ( http://wiki.blender.org/index.php/User:Sculptorjim/Game_Engine ) is pretty detailed on how to work with BGE and logic bricks. Blendswap also has an example with physics that you could start off with: http://www.blendswap.com/blends/view/73536

I know of one person, SolarLune, that has been working with the BGE for quite a while, and he's got quite a few videos up concerning it if you want some tips and tricks. He just did a recent video on why he uses BGE:
youtube.com/watch?v=8ZJEupWdf30

Unity would require programming in C# (or Javascript).


How to add sound to sequencer using python I want to add music via python.
I tried:

bpy.ops.sequencer.sound_strip_add(bpy.ops.sequencer.sound_strip_add(filepath="//mymusic.mp3", frame_start=0, channel=1)

but somehow it gives me the error:

drop file blabla
Traceback (most recent call last):
  File "blabla", line 60, in <module>
  File "C:\Program Files\Blender Foundation\Blender\2.77\scripts\modules\bpy\ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.sequencer.sound_strip_add.poll() failed, context is incorrect

Error: Python script fail, look in the console for now...

Any ideas?

import bpy
from bpy import context

scene = context.scene

if not scene.sequence_editor:
    scene.sequence_editor_create()

#Sequences.new_sound(name, filepath, channel, frame_start)
soundstrip = scene.sequence_editor.sequences.new_sound("toad", "~/toad_sound.mp3", 3, 1)


How to constrain an object's motion with the Simple Motion Actuator I've defined a Logic Bricks Simple Motion Actuator which responds to keyboard input to move an object along the Z axis. It works fine, but I want the object to be limited to move from 0.0 to 5.0 along the Z axis. Once it reaches one of those limits I don't want it to move anymore.

I tried adding an Object Constraint, which limits my ability to move it in the editor, but that constraint is not imposed by the game engine.

What do I need to do to impose that constraint on the game engine?

Constraints in game engine are defined using logic bricks or Python.

See the example file using the Constraint actuator: http://pasteall.org/blend/index.php?id=48429

BGE Manual: https://docs.blender.org/manual/en/dev/game_engine/logic/actuators/types/constraint.html#location-constraint


Convert physics to animation keyframe (Actions) in Blender Problem:

I am trying to create a character in Blender and import it to unity. The character is like a blob, who has no bones for animation. I create any Entry animation like this using Physics in blender:

The blob is made of softbody. Now I want to convert the physics to an animation (Action) in Blender so that I can export this blob to unity with animation.

Things tried so far:

I exported the physics as an MDD file and then tried importing it again. Keyframes got created, I can see it in the Dope Sheet, but the action editor has nothing in it.
Also tried Object -> Animation -> Bake Action. It created Action, But there is no animation at all when I import in unity.

Download my blend file

I am new two both unity as well as Blender, Please help me on this.

Thanks in advance.

EDIT:

I exported .MDD file and used it on a different object using Mesh Cache Modifier. Now animation is playing and it's not based on softbody. I don't know how to convert the motion to keyframe.

Here are the steps you need to follow:

Let's say you created a simulation of physics on softbody
Select your object and export the file as MDD (This will export the keyframe as data to .MDD file)
Keep the object selected, Import the .MDD file you've exported.
Now if you see the Dope sheet there should be some keyframes on it. But you cannot see anything on Action Editor.
Remove the softbody modifier on your Object. (Hit Space, you should be able to see your simulation without the modifier)
Here is the key part, Now you have to convert the body to Rigid body to bake the keyframe to Animation(Action). Apply the rigid body modifier to the Object.
Make the Rigid body type as Active and animated (Checkbox). (Now Hit space, you should be able to see the simulation without the object falling down, Even though you applied Rigid Body modifier)
Now, go to Object -> Bake to Keyframe, I will take some time according to your mesh and simulation. But after finishing you should be able to see the keyframes on Action Editor.
As the last step simply import the .blend file to unity.


I'm so frustrated with uv image/editor. I can't get my decal to show in render after editing the decal in gimp All I did was edit the texture in GIMP and now the decal texture won't show in my render.  I tried renaming... no go.  I spent half a day now trying to get it back.

Any help would be greatly appreciated.  Here is my blend....

https://drive.google.com/open?id=1T8I2Y8ZTdtWhvcV6k1s5m96fAVsQl4Nt

EDIT:  I'm an idiot.  I was working on an alternate node setup in the node editor that wasn't connected to a material output.  I didn't realize until I zoomed out and saw the real node setup.  It works as expected now.

I got it to show by simplifying the material and making sure I had a material output node. The use of the alpha here is a little confusing, but I suppose if you can get one showing and then use the alpha to set a separate shader of another color then you might work it out.


Blender 2.8 Focus view on selection When i press . view goes to center (no matter which object i selected) and not to selected face/object. Is it bug or what?

Appending collection from broken file to new did the trick. Everything works fine now


no material are showing instead it takes a still color of the background in viewport I didn't use blender for quite some time then I loaded a saved file and saw that there were no material. I checked the material properties and they were all there but the viewport couldn't display them. I created new things and no matter what there were no material in the viewport in rendered view or material preview mode instead I see weird behavior when I zoom in and out it's as if there's a black thing of the same shape as the object that isn't affected by the zoom. and in the material properties menu the small balls that display the color of the material left of the material name disappear.

Could be that your normals are going wrong direction and the Backface cooling option is turned on. Check it


Is there any tree structure document which tells about how blender is structured? there is any detailed tree structure on what comes under what?

What is accessible from where and what is not accessible?

A clear tree structure idea of blender data blocks, scene window hierarchy

Basically giving the logic of how blender is designed.

Use the Datablocks view option in Outliner:


How do I stop Blender from adding numbers to end of object names? I'm not sure how this happened (as its been working fine up till now) but just tonight Blender has started adding numbers to the end of object names.

If I manually remove them, and then export FBX, Blender will throw them back on.

Any clues how I can disable this behaviour?

This is normal. Blender has been doing this for a very long time and this is what it should be doing. Every object name needs to be unique in Blender so when it encounters an object being named with something that already is a name of another object, it automatically fixes this by adding the numbers and this way making the names unique. If you do not wish to have the numbers there, you can give unique names to all of your objects in the first place.


Looping background (png image) in Blender for a car chase scene While animating a car chase scene I need to have a background image (that includes trees, buildings etc) which moves from right to left and gets repeated in loops. I Couldn't find any driver or interpolation to create such a dynamic effect. Can someone post an example on how to do this?

That's not too hard actually:

I just move the UV coordinates around.

Create a seamless background image. Left and right borders should match.
UV-Map it on a plane that fills your background.
Use the Node Editor for the material and create this node setup:

The texture coordinates are provided to a Vector Math node. There, I am adding both vectors together, animating the yellow, formerly static one. Just click the button, set the X value, exist and set a key frame. It simply creates an offset for your UV coordinates, shifting the image around the plane.

As many frames as you want later, crank the value up and set another key frame. With the node selected, go into the Graph Editor and set the interpolation to linear in order to get a nice and smooth motion.

I deleted the other two channels since the motion is only in one axis.

Only drawback is that motion blur won't work with Cycles. You could blur the texture though.


How to animate proportional editing effect? how should i go like if i want to replicate this effect in an animation? i'm open to use animation nodes too but maybe this can be done on vanilla blender?
effect as shown

You could set up a grid, instance your cubes on its vertices, and then deform the grid using a Hook modifier...
The hook:

.. here, to an Empty. (Assignment of hooked vertices has to be done in Edit mode.)
This lets you keyframe the position of the hook, and the radius and strength of its influence. Much like Proportional Editing.
Here, one of the faces has been copied from the undistorted grid, and P separated to a new object. That has been parented to the grid, and instanced on each of its vertices by setting 'Vertices' in the grid's Object Properties tab > Instancing panel.


Trouble with __init__.py loading addon with multple files I've written a custom addon for a few Pie menus but can't figure out how to load them together from a __init.py
Currently they are all split into these four files:
PIE_context.py, PIE_mode.py, PIE_uvcontext.py, PIE_uvmode.py
They all work when installed on their own, register shortcuts and everything. Despite reading around I can't figure out how to import them together from the __init__.py file below.
The shortest of the four PIE_uvcontext.pyis below that:
bl_info = {
    "name": "Context Pie",
    "blender": (2, 80, 0),
    "category": "User Interface",
    "version": (0, 1, 0, 0),
    "location": "UV Editor, View3D, Mesh, Curve",
}

# Blender imports
import bpy

#from bpy.props import *
from . import PIE_context
from . import PIE_mode
from . import PIE_uvcontext
from . import PIE_uvmode

addon_keymaps = []

def register():

    PIE_context.register()
    PIE_mode.register()
    PIE_uvcontext.register()
    PIE_uvmode.register()

def unregister():

    PIE_context.unregister()
    PIE_mode.unregister()
    PIE_uvcontext.unregister()
    PIE_uvmode.unregister()

if __name__ == "__main__":
    register()

bl_info = {
    "name": "UV Pie: 'Shift + Right Mouse'",
    "description": "UV Pie Menu",
    "version": (0, 1, 2),
    "blender": (2, 80, 0),
    "location": "UV Editor",
    "category": "Pie Menu"}

import bpy
from bpy.types import (
    Header,
    Menu,
    Panel,
)
from bpy.app.translations import contexts as i18n_contexts

# Reference context menu: IMAGE_MT_uvs_context_menu
class IMAGE_PIE_MT_uvContext(Menu):
    bl_label    = ""

    def draw(self, context):
        layout = self.layout
        layout.operator_context = 'INVOKE_REGION_WIN'
        pie = layout.menu_pie()

        # WEST
        pie.operator("uv.pin").clear = False
        # EAST
        pie.operator("uv.pin", text='Unpin').clear = True
        # SOUTH
        pie.operator("uv.minimize_stretch")
        # NORTH
        pie.operator("uv.unwrap")
        # NORTH-WEST
        pie.operator("uv.pack_islands")
        # NORTH-EAST
        pie.operator("uv.average_islands_scale")
        # SOUTH-WEST
        pie.operator("mesh.mark_seam", text='Mark Seam').clear = False
        # SOUTH-EAST
        pie.operator("mesh.mark_seam", text='Clear Seam').clear = True

        # Static face menu
        pie.separator()
        pie.separator()

        dropdown = pie.column()
        gap = dropdown.column()
        gap.separator()
        gap.scale_y = 8

        dropdown_menu = dropdown.box().column()
        dropdown_menu.scale_y=1

        dropdown_menu.operator("uv.stitch")
        dropdown_menu.operator("uv.weld")
        dropdown_menu.operator("uv.remove_doubles")

classes = [
    IMAGE_PIE_MT_uvContext]

addon_keymaps = []

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

    wm = bpy.context.window_manager
    if wm.keyconfigs.addon:
        km = wm.keyconfigs.addon.keymaps.new(name='UV Editor')
        kmi = km.keymap_items.new('wm.call_menu_pie', 'RIGHTMOUSE', 'PRESS', shift=True)
        kmi.properties.name = "IMAGE_PIE_MT_uvContext"
        addon_keymaps.append((km, kmi))

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)

    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        for km, kmi in addon_keymaps:
            km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()

Thanks!

Answered by @batFINGER in comment:
Just had to zip the folder with files in!
Trying to make a menu using multiple modules


How to move an Arduino's servo motors using Blender? Noob here. I am trying to get Blender 2.6 to communicate to an Arduino Mega board via USB serial comms. I cannot find a nice summary of how to write Python script to get Blender to send serial data to the Arduino. I found this guys project: http://justindailey.blogspot.com/2011/03/real-time-controlled-robotic-arm.html  -> which is similar to what I want to do, but there are no details on how to establish serial communications to a specified USB port.Plus I am using Blender 2.6.
Thanks!

Try looking at this video.  The gentlemen explains, step by step how to control an sevo with python and arduino I think this is what you want.

This isn't actually a blender specific question, if blender uses fully featured python!  The difference between this and "regular" python, (if I'm not mistaken) is that python "here" knows how to talk to blender.

You might want to move this to Stack Overflow, there are a likely a lot more users with these kind of skills there - it's part of the same network of question and answer sites as this.

Remember, once you get this working, you will have to be clever enough to make the python algorithm:

A.) Get the information from blender
B.) Figure out what it means for the servo
C.) Optionally but preferably, do this at an appropriate time!  (ie, whenever a relevant part is moved)

Always Remember: In Engineering, it is important to break problems into their component parts.

If it were me, I would follow the video by itself first - that way, you can actually move the servo, blender or not.  Then make sure a python script that can talk to blender will do this.... it doesn't matter if you have to run the script by hand, at least it will work!

Then once you can make blender move the arm, - even if it doesn't care what is on your screen in blender! - do step "A".  Now you're cooking!  Figure out what the screen means for the server, and make it happen!

Finally, once you can make everything, see if you can work on "C"!  This is the cool part.  Remember everything that look "cool" has had a lot of backround effort put into it.

Inspiring Question! Good luck!


Fill Spline based curves efficently As you can see on the image below, I got a lot of vertices after converting the splines to a mesh. The splines a drawn manualy from an old map.

I already started with the filling process. Selecting two edges and fill them with Fwas not a solution, since it causes weird looking artifacts.So my second attempt is to select "nearest" vertices manualy and fill a edge between. This seems a bit tedious and a lot of work.
Does anybody have a good approach to this?
I have a silly Idea in mind: Using a clothing simulation to fall down on my splines and use the fianl result as my shape. Does this sounds like a good Idea?

You can select 2 vertices and create an edge as shown on your screenshot.
Then active edge selection mode (2), and spam F which creates faces until the end of the spline is reached. Select the whole spline by pressing L (Select Linked), then remove all faces (X, Only Faces)


Connecting node trees using blender api I am terribly confused why this is not working. I have followed similar examples and failed (i.e. Blender scripting connect nodes)
bpy.context.active_object.active_material.node_tree.links.new(bpy.data.materials["Material.001"].node_tree.nodes["Principled BSDF"].inputs[0], bpy.data.materials["Material.001"].node_tree.nodes["ShaderNodeTexCoord"].outputs[0])
If my code is too difficult to decipher, here's a summary: I am just trying to link the Texture Coordinate node output to the Base Color input of the Principled BSDF.
I wrote out the whole line above without using any variables in the aid of clarity/searchability.
Thank you all!

make sure your name is set to right value, not just the label.
"


Can't fix this color glitch when joining objects I have this problem with my modelling, I am in the middle of modelling and I am on a time limit. After modelling my hand as a separate object from the body I cannot join the hand and body without running into this color problem. Whenever I join the two objects the object that I select first turns a darker shade.
For example, if I select the hand first and then body second when I press join the hand will lose its modifiers (Which I actually don't mind, I want it to have the body's modifiers) and will turn a darker shade. Same vice versa. I've attached images to give an example.

I'm not sure what may have caused this or how to fix it. Is there way I can possibly fix this?

Apply the scale at both objects: in Object mode Ctrl+A then Scale
join them Ctrl+J
if the issue persists: go to edit mode Tab, select all A and hit Normals Recalculate in the Shading/UV tab of the toolbox (Shortcut would be Ctrl+N)


Combining two different material in to one in node editor I liked to combine two different materials in to one material in nodes, so that
I could create mountain like structures.

I try to use the noise as the base of the mountain structure, and add a different snow like material to the top of the hills where the normal height is high in the noise texture.

How do I combine two different material on top of each other, so that the height decides what material is used?

For your mountain example, you can use position attribute in geometry input node as a factor for high in Mix Shader or MixRGB (depend on using shader or using  texture).

In the other way, you can use weight paint for highlighting the area you want, and then use Layer Weight node as a factor.


Volume scatter has no shadow on clouds I am trying to make clouds. I watched "Clouds Tutorial for Blender Cycles - YouTube" but in render result, no shadow on clouds.

The sun strength is 16.000 and I also tried several different strengths and sizes.

Where is the problem?

Im going through same tutorial and have same issue. After couple hours I think I found solution. It has nothing to do with a light. U r using volume material for flat mesh, so the effect is strange. Just add another modifier - SOLIDIFY, and set thickness for about 5 or more. This way u will get simmilar effect as Andrew. I guess the diffrece is Andrew was using older blender version.


Offset Transform on top of Alembic Transform Cache I have a Blender scene in which it has Alembic Transform Cache constraining the object. Somewhat the constraint is locking all transform and I wanted to be able to offset the transform like rotating, scaling or even reposition the object. Is there a way to do this?

Thanks beforehand.

The only way to do this at the moment is to  add a Copy Transform constraint, check its Offset checkbox, and let it target an Empty. The Empty can then control the offset.


How to join the bones? (I'm new AF I started this morning by watching tutorials and stuff but they are at 90% outdated)

So, a model I got from the internet misses the rig for the hand/fingers so they stay like that and doesn't do much else (apart from one being the wrist), which makes the hands seem dumb, I saw Darrin Lile video (4 years ago) where he rigs his character and at a point, he Shifts right click on the bones (hand and Pinky) and blender highlights the two, but for me it just doesnt work, it does some weird stuff and I tried connecting them but it doesn't work, so i'm searching how to connect them, but Offseted, or whatever it's called, thanks!

You have two separate objects. To join them you have to enter the object mode first. On the screenshot, the selected bone (and it's armature) is in edit mode. Press ↹ Tab to go into object mode or choose Object Mode from the footer menu of the 3D view.

When you are in object mode you should be able to select both of the armatures by ⇧ Shift RMB clicking. When both are selected (and highlighted) you can join them by pressing ⎈ CtrlJ. All objects of the same type can be joined in object mode with ⎈ CtrlJ. Now you can enter edit mode again (↹ Tab) and select both bones.


Unable to use API to call bpy.ops.render.opengl() Ubuntu 18.04 with Blender 2.79

The goal is to load a 3D Model into Blender and create/save a .PNG file.

Here is my script:

def preprocess(file):

    # remove mesh Cube
    if "Cube" in bpy.data.meshes:
        mesh = bpy.data.meshes["Cube"]
        print("removing mesh", mesh)
        bpy.data.meshes.remove(mesh)

    # import the 3D object
    imported_object = bpy.ops.import_scene.obj(filepath=file)

    # change the view to make certain the entire 3D object is viewable
    for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
            for region in area.regions:
                if region.type == 'WINDOW':
                    override = {'area': area, 'region': region}
                    bpy.ops.view3d.view_all(override)

    # Deselect all so selection highlights are not passed to .png
    bpy.ops.object.select_all(action='TOGGLE')

    bpy.ops.render.opengl()

    bpy.data.images['Render Result'].save_render(filepath="scripted.png")

This script works until I get to the line:

bpy.ops.render.opengl()

This line appears to have no effect whatsoever.

When I am run the above command from the console manually by going to the Render -> OpenGL Render Image menu, Blender renders the object as expected and the console view is updated with a 'Render Result' view.

From what I have learned about the API, some commands must be executed within a certain context.  It seems like I need to let the script know which viewport is the active viewport, but this is purely speculation on my part.

Any advice on how to render this 3D object via script would be appreciated.

The operator works correctly and will render your image. However with the default arguments it won't switch to the UV/Image Editor. If you intend to replicate the behavior of Render > OpenGL Render Image then you will have to change the execution context. In general buttons in the user interface use 'INVOKE_DEFAULT' as execution context.

bpy.ops.render.opengl('INVOKE_DEFAULT')

Additionally you can use the write_still=True argument to save the file. It will write the file to the path specified in bpy.context.scene.render.filepath. The last line in your script could then be removed.


Why is my UV mapped texture dissapearing when I start blender game engine All I want is to add a single texture to a plane which will display in the game engine. To do this, I

unwrap a mesh in edit mode
open UV image editor
open image... its a pgn. but ive tried with jpeg as well with no luck.
In materials, add new material and click plane
In texture, add new texture and use the Image or movie and then under Image, I select my image file.
I change the view port from solid to textured.

With this process, I can see the image projected onto the plane. I can also see it when I hit f12 to render. My problem is, that when I start the game engine, the image texture does not show on the plane. All I get is the original grey plan that I started with.

I've already tried switching to GLSL mode. Any suggestions would be greatly appreciated. I've meticulously tried all of the suggestions offered on the forums and haven't had any success. Thank you.

Here is the blend file reference

My computer's graphics card.

Display Devices

      Card name: Intel(R) G41 Express Chipset (Microsoft Corporation - WDDM 1.1)
   Manufacturer: Intel Corporation
      Chip type: Intel(R) 4 Series Express Chipset Family
       DAC type: Internal
    Device Type: Full Device
     Device Key: Enum\PCI\VEN_8086&DEV_2E32&SUBSYS_2A9D103C&REV_03
 Display Memory: 1582 MB

Dedicated Memory: 64 MB
      Shared Memory: 1518 MB
       Current Mode: 1600 x 900 (32 bit) (60Hz)

I have downloaded and test the file which you have attached.
Pressing P does reveal the image in the game engine on my screen.

I suspect you user preferences setting were different from mine.

Now that I see your graphics card, I am suspecting it could be a hardware/software limitation. I went on the internet and search for OpenGL driver for the card. And it seems that you have to download a package to enable OpenGL support. Maybe you could read up here and download the appropriate OpenGL package for your card?

Link here https://downloadcenter.intel.com/download/20046/OpenGL-Support-Web-Link

Link to the G41 Express Chipset here https://downloadcenter.intel.com/product/81517/Graphics-Drivers-for-Intel-G41-Express-Chipset

Hope this will resolve your issue, good luck.


How can I create a cylinder linking two points with Python? I want to position a cylinder such that the center of one end is at (x0, y0, z0) and the center of the other end is at (x1, y1, z1) using the Python API.

The intention is that there will be two spheres centered at those coordinates and the cylinder will act as a spoke or connector between them.

I guess I will create the cylinder then translate, scale, rotate it. I am struggling mainly with the rotate part.

i wrote my own script, as there is no way to do it with blender API direcly:

def cylinder_between(x1, y1, z1, x2, y2, z2, r):

  dx = x2 - x1
  dy = y2 - y1
  dz = z2 - z1
  dist = math.sqrt(dx**2 + dy**2 + dz**2)

  bpy.ops.mesh.primitive_cylinder_add(
      radius = r,
      depth = dist,
      location = (dx/2 + x1, dy/2 + y1, dz/2 + z1)
  )

  phi = math.atan2(dy, dx)
  theta = math.acos(dz/dist)

  bpy.context.object.rotation_euler[1] = theta
  bpy.context.object.rotation_euler[2] = phi

enjoy :-)


Glass shader. How can I get rid of the reflection in the glass? I have two planes with a glass shader one after another, and the object is reflected in the glass, how can I get rid of the reflection in the glass?
https://disk.yandex.kz/i/5t71DmYOupy7jQ

Glass is reflective, so if you want to completely get rid of the reflections it won't look like glass anymore.  This can be done by using a refraction shader which only passes light through and does not reflect any rays.  If you want to just tone down the reflections you can mix a refraction shader with a glossy shader sharing the same parameters.

Below is shown an example of 100% glass, 20% glass and 0% glass respectively.

This may make your render look undesirable in other manners however as it will no longer be very physically accurate.  If this is the case, I suggest playing with the angle of your camera and/or whatever is being reflected in order to have it not block your view (as you may sometimes do in real life to look through a glaring object).


Changing the distance between vanishing points I'm trying to teach myself two-point perspective in drawing, and to do so, I want to create different cube-like objects in a 3D modeling program, and see how they related to the vanishing points. I downloaded and installed Blender, essentially yesterday, just for this project.

However, when I try to render a cube, the vanishing points are spaced so far apart, opposite edges are nearly parallel. Is there a way to somehow adjust the vanishing points, to make the parallel-line convergence effect stronger?

This is what I've got going for myself so far:

Set the Focal Length to a smaller value to adjust the perspective.

The Focal Length can be set separately for any Camera as well as for the Viewport. To adjust the Viewport, simply open the Properties panel of the 3D Viewport (press N) and scroll down to View as shown and change the 'Lens' setting.

For the Camera, select the Camera and open the Camera properties panel and change the Focal Length as desired.


Bevel Modifier is Not Showing in Object Mode I've applied a bevel modifier, and set the edge data to "weight". As you can see in the upcoming image, the modifier is working; but only in edit mode:

When I go back into edit mode, it looks like this:

Does anyone know why this might be happening? I've made sure all of my faces were quads, and I also made sure I didn't have any double vertices.Thank you for any help in advance!

The reason this was not working was because my boolean was above the bevel in my modifier stack. As soon as I moved it down, it worked.


How to cause the texture through the glass? I would like to engrave some letter behind the glass, and then just put the light behind the glass to project the letter throughout the glass as a magnifier . I tried it by transparent shader ,but seems like only got the pure light can through the glass, and all the roughness and color can’t through the glass. Please help me to do that.

You mean something like this? The text is engraved into back side of a scaled cube. Make sure to change the blend mode (highlighted on the right):


Can the mesh select mode menu converted to a pie menu in Blender 2.72? The release notes mention that it is possible to add pie menus. But I'm not sure how to do it.

How could I convert the mesh select mode menu's appearance:

to this?

Some Basics are documented in the Blender Wiki, see:

Creating Pie Menus
Coding Pie Menus

Below you find a complete, briefly commented and fully working mini example addon. Just place the code below into a file named

whatever_name_you_like.py

and then Install/Enable this python file as a regular Addon.

Notes:

The name of the file is not important, however the appendix '.py' is essential to mark this as a python file.
You do not need to enable the "Pie Menus Official" Addon in order to get your own Pie menus to work properly!

Begin of the code:

bl_info = {
    "name": "My Pies",
    "author": "My Name",
    "version": (1, 1, 0),
    "blender": (2, 72, 0),
    "description": "My Pie menu",
    "category": "Object" }

import bpy
from bpy.types import Menu

# Implements an edit mode selection pie

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label  = "Select Mode" # Appears as Pie title
    bl_idname = "mesh.mypie"  # Used to refer (see below)

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

        pie = layout.menu_pie()
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator_enum("mesh.select_mode", "type")

addon_keymaps = [] # Store keymaps to use in unregister()

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

    # Define a keyboard shortcut (for Mesh Edit mode)
    wm = bpy.context.window_manager
    km = wm.keyconfigs.addon.keymaps.new(name="Mesh")

    # Open the pie when you press CTRL SHIFT E:
    kmi = km.keymap_items.new("wm.call_menu_pie", 'E', 'PRESS', shift=True, ctrl=True)
    kmi.properties.name="mesh.mypie"
    addon_keymaps.append((km,kmi)) # Store keymap

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

    #use stored keymaps to unregister
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()


How exactly should I set surface normals for a sculpture? I am building, with Python scripting, a sculpture by creating many plane meshes and joining them together. I have full control of the planes' surface normals, but I'm confused how to set them. As of now, I'm setting them arbitrarily, and the render seems fine.

My intuitions about surface normals are that neighboring faces should have smoothly varying surface normals so that there's no shading discontinuity. Also, when a surface's normal points away from the camera, it appears dark. Are my intuitions correct?

In my case, it's a 3D sculpture that's supposed to be ready for view from all angles, so I can't really set the surface normals w.r.t. a fixed camera. Can I then just set them arbitrarily?

Also, what is an easy of  ensuring "neighboring surface normals are smooth" with Python? Maybe some post processing that smoothes over the mesh?

Here is my model.

In Edit Mode, you can display normals, to see exactly which dir they are facing (N > Mesh Display).

You might be able to simply call normals_make_consistent() operator:

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all()
bpy.ops.mesh.normals_make_consistent()

Some models don't always import with consistent normals, because they weren't consistent with the order of their vertex arrangement (clockwise sometimes, counter-clockwise elsewhere, within the same model)


image texture not showing in final render but does in 3d view? So i've modelled a bottle with a label and cap, i am using an image texture on the label which works fine in the render but the one on the cap shows in the 3d view (in live render mode), but not in the final render (as in when i click the "render" button). It just shows the colour of the cap. anyone know why this is? will include pics.
not enough rep to add multiple images so link to imgur: imgur

EDIT: thanks for replies, added pictures of settings, let me know if you need anything else.
EDIT2: tried re uploading the image file, renaming it etc, still not showing in final render.

Somehow the cap label image got moved from the original location. (meaning, the image was on your desktop and moved into a folder for example)

It still shows up in the viewport because it put a "thumbnail" or quick load version of it but it is not accessing the original file.

I would reload the original file again and it should work.


Modify the visibility of collections locally to the viewport with python We have a project with 2 viewports in the same interface. We need an operator that can click on one of the viewports and change the visibility of some collections locally in the viewport that has been clicked.

We have find the following code for set the view of the viewport in local mode:

bpy.context.space_data.use_local_collections = True

And the only method we have found to change the visibility of a collection:

bpy.ops.object.hide_collection(context, collection_index=i, toggle=True)

That inverts the visibility of the current collection.

The problem is, that this method changes visibility globally and we want to change it locally.

We know that the execution context is important, but since we are executing it from an operator in the tools window of the viewport, we believe that we are doing that correctly.

Other variables as disabled in viewport, have a direct access to the variable via python, example:

bpy.data.collections["Collection"].hide_viewport = False

But the variable that we need in local does not have it.

Manually, in the interface, it is simple to do, as seen in the image

The final question is: "Is there any way to edit via python, the visibility of the collections locally to the viewport?"

We have been reviewing it and we have realized that the problem was in the context overwrite. Although we have already done this, we did it by selecting the wrong area

ctx_override = context.copy()
ctx_override['area'] = get_area(context, 'VIEW_3D')

The function get_area (…) returned the area of the viewport in which to make the changes, but did not select the correct viewport, since having two in the interface always takes the first one located in the vector, which was a viewport with local visibility of collections deactivated.

Now we differentiate the viewports by their width to make the changes in the correct viewport


Animation node addon overwrite keyframes standard animation I've just installed the animation node addon in Blender 2.83 and I've found that the animation result overwrite every other previous animation of the object while rendering but not in the viewport.
Here's an example:
let's say you have a text object with an animated transformation on the Z axis made with standard keyframe method.
You want that text to be the actual frame number.
So you use animation node to input in the text object the actual frame number (pretty straightforward).
Now hit play and see the result. Nice! It works!
So you hit render/animation and... ooops! The text object stay still as long as the node animation is running.

Do you guys have a solution? Is it intended to work like this?

Thank you in advance!

I'm not 100% what I had was the what you're asking ^ but I had a similar thing where i had keyframed location and used animation nodes for rotation. even though i never enabled Transform output for location it still became 0 location when rendering even though in the viewport it looked like it moved perfectly.
my solution was to take the object transform input node and plug it's location into the object transform output node.
which seems weird but hey it worked for me and maybe it'll work for whoever reads this in the future.


Animating chain driven vehicle with rigid bodies I want to simulate a chain driven vehicle, which responds to the ground or obstacles by the usage of rigid bodies.
I've tried to create one chain part and let it follow a bezier curve or even tried to follow this tutorial:
https://www.youtube.com/watch?v=ftiFE9gnTyc
What ever I do, although setting the chain part to active, the whole chain doesnt respond to the ground. Only the wheels respond, which are driving the chain.
Does anybody has a hint for me or has even modeled something like this?

I did it finally by hand:
Create one chain link. Calculate length of chain link by rigid number of elements around one wheel, e.g. 180° + 6 elements = rotate each element by 30°. Length = sin(30)*wheel_radius. Build it for both wheels, only for the outer half-circle.  Connect the open ends with chain-links between. Set all active (rigid body). Connect them with constraints. Use hinges (beware of direction -> hinge uses z-axis).

It is an easy way, but a little bit annoying for big chains.


How can I solve a far away stacking Freestyle line Im a beginner to use blender for comic

i try a way to make line on faraway object to be small but it still have a result like this. their are the way or some easy method to make a stacking line look doesn't black like this?

I'm not sure if you're already doing this, apologies if so.

You can assign a Distance from Camera modifier to the line thickness in the View Layer Properties tab > Line Style panel.

Before:

After:

You might have to use separate Line Sets for other features whose
detail you want to preserve in the distance.
You can assign the same modifier to Alpha, making the lines more transparent in the distance -  a possible alternative.
As you can see, depending on the resolution of your rendered image, at some thickness, sampling/antialiasing takes over. This might be before your set 0 point; you'll have to tweak the curve / base thickness accordingly.


cannot import .obj into blender 2.8, but works in 2.79 i am getting this error. i've tried multiple versions of blender 2.8 but none work.

You stumbled upon a curious problem with filename handling in the .obj format, that isn't well defined in the specification. I will discuss this with the Blender devs, perhaps the importer needs small adjustments to parse the file correctly under these specific circumstances. Since it worked in 2.79b it can be considered a regression.

TL;DR The handling for filenames with blanks isn't well defined in the .obj format specification and Blender expected a different format than what was provided in your file.

The Problem

The .obj is a text format for storing 3D models. The format contains various attributes that describe the geometry of the model. Typically the .obj is accompanied by a .mtl which describes the material and textures applied to the model. In order to keep track which files belong together, the .obj may contain a mtllib attribute followed by the filename of the .mtl.

Usually the beginning of an .obj would look something like this:

# Blender v2.80 (sub 74) OBJ File: ''
# www.blender.org
mtllib test.mtl
o Cube
v 1.000000 1.000000 -1.000000
v 1.000000 -1.000000 -1.000000

In case of your file it is:

#
mtllib "tree stump1 original model.mtl"
usemtl tree_stump1_original_model
v 4.136163 -1.200306 -10.798826 0.113725 0.152941 0.141176
v 4.140683 -1.205297 -10.794383 0.117647 0.156863 0.145098

Notice that the filename contains quotations marks. This is causing the problem. The software you used to export this model quoted the filename to avoid confusion on how to interpret the filename. While this is common practice in other file formats the specification for .obj doesn't mention quoting filenames and says specifically:

  Blank space and blank lines can be freely added to the file to aid in formatting and readability.

Which can be interpreted as blanks in filenames can be stored as is, which is precisely what Blender does. Unfortunately Blender's importer doesn't expect the quotation marks in the filename therefore misinterpreting the correct filepath. This results in the aforementioned error in your question.

The Fix

Open the .obj file in a text editor of your choice an remove the quotes and save. It should look like this:

#
mtllib tree stump1 original model.mtl
usemtl tree_stump1_original_model
v 4.136163 -1.200306 -10.798826 0.113725 0.152941 0.141176

The file can now be imported by Blender.


How to get back the 'Add ' menu after performing any other action? I would like to know how I can get back the 'Add ' menu which disappears after performing any action.

I tried F9 key, F6 key and T key which I knew after some Googling but they didn't dork.

I'm using Blender 2.80.

unfortunately not, you can just delete the object and re-add it though!


Why does Subdivide Smooth look different when compared to the Subsurf modifier? When I choose the Subdivide Smooth option in edit mode it looks different from the Subdivision Modifier. Not only is it smaller but also the shape of the one from edit mode seems distorted.

When using subdivision in edit mode, the original vertices stay at the exact same place. The rest of the mesh swells up around it.

When using the modifier, vertices and edges are more like control points of a nurbs curve. The image below illustrates it. Note that concave shapes (the thinner section of the model below) will swell outwards.

It's not possible to make a truly spherical shape when using subsurf, but the more verts you have in the original mesh, the less noticeable the irregularities will be and the more spherical it will look. You can also use a Shinkwrap modifier to "project" your mesh onto a real sphere, or a Cast modifier or the To Sphere (Alt+Shift+S) operator to warp it into shape. I often do this when wanting a mesh that can be subdivided but still have a nice equator.


Blender make driver use local bone axis I want to have a bone that drives another object's y location according to its(the bone's) local y axis.

this is the driver I'm using.
In this case the driver is working(The driver is what is making the wheels move.)
https://imgur.com/o4JPfHN
However when I rotate the bone on the Z axis ( the local y axis is supposed to have rotated too but the driver doesn't work as expected)
as seen here https://imgur.com/5w8HiWf
the driver is working on the armature's local axis. How can I make it so that it applies on the bone's local axis instead
Edit: I tried creating an empty and parented it to the bone and made the empty's local Y the driver and it still gave me the same issue.
Any ideas on how to fix this?
Edit: Added blend file. Play the animation to see what my issue is.
The driver is added to the wheel/

Bones local coordinates are coordinates in the bone rest pose space (initial location/rotation/scale before it moves in pose mode).
The difference between world and local coordinates is the parenting: world coordinates include parent chain transformation up to world.
Though, in local coordinates, moving along (say) X does not mean a movement along current X bone axis. This is still relative to its original rest position.
That's why your setting is not working.
You need to consider both X and Y (local or world won't directly matter in this case) in order to shift the arrayed meshes along the curve.
That can be this setting:

However, the turns are not good: both tracks follow the same speed even if we add the rotation around Z. We would prefer the track which is inside the curve to go slower than the other one.
... this can be handled by some driver functions (won't have time to explain it for now...).
The blend file contains the two versions (with and without speed differential when rotating).


How to load UDIM images which sequence number does not start with "1001"? In UV Editor, I can't load the UDIM images if the sequence number does not start with '1001'. Is there a way to load? Or another workaround?
This is a problem with the new UDIM workflow of Substance Painter (2020.2). It exports the texture file name as {Material Name}_{UDIM Number}.png, such as 'face_BaseColor_1001.png' or 'body_BaseColor_1002.png'.
According to the developer at Blender Developer Forum, 'There must be a file with number 1001' to detect UDIM image sequence.
⚓ T72734 UDIMs don't behave properly on imported geometry
Therefore, this is currently a Blender's specification. But I want to use SP's new UDIM workflow. It will be more useful for large projects which has many meshes and materials.
Does anyone know a good solution?
Example
In Blender, I modified Suzanne mesh as follows:

Assign 3 materials: Face, Eyes and Ears

Split into 3 UDIM tiles: Face (1001), Eyes (1002) and Ears (1003)
Then export it to .FBX format, and import into Substance Painter.

After texture painting and exporting with default settings, you'll get these files:

Face_BaseColor_1001.png
Eyes_BaseColor_1002.png
Ears_BaseColor_1003.png

Return to Blender's UV Editor, load Face_BaseColor_1001.png, it succeeds.

However, Eyes_BaseColor_1002.png and Ears_BaseColor_1003.png fail. It says 'Can't Load Image'. Maybe it's because the number doesn't start with '1001'.

So far I have come up with three solutions, but none of which are sufficient.

Assign all materials to tile '1001'. It's better to assign to a mesh that is hard to find.
Create an empty image file for each texture set that does not have a '1001' file.

e.g.: If 'eyes_BaseColor_1002.png' exists, but 'eyes_BaseColor_1001.png' does not, you should create 'eyes_BaseColor_1001.png' (2*2 px blank image).
If you use this method frequently, it's better to write a program for it.

Create individual materials only for texture that were not recognized as UDIM.

(I know, this is the worst solution)


Render of Planet Earth in Blender Render and Cycles A couple of months ago I created this image with the help of this Blenderguru tutorial. The Blender Render engine is used. Although only one sun lamp is used you may note that the shadow side of the earth is not black.

Now I have a little understanding of cycles I tried to build the planet earth in cycles with this result. Note that the shadow part is very dark / black although I used a very tiny Ambient Occlusion

I really prefer the blender render result because

1) the blender render planet is a "true blue planet" with lots of water and blue tints. In the cycles render there seems to be much less water
2) the africa continent seems very large in the cycles image
3) the clouds are very present in the cycles image and make it a more greyish image.

It looks like that the proportions are different. Did I make some mistakes with the texturing. Or is this simply the kind of differences that are normal ? I thought that Cycles was the more photorealistic render engine, but is this true and are there better engines ? Were did I go wrong with my cycles render ?

After the answer of Gandalf I applied his volume shaders to my Atmosphere and I also added subsurf modifier to the atmosphere. This is the result. I used the same shader as Gandalf. I guess I should change the distance between the atmosphere and the earth ??

Cycles is capable of utilizing physically-based rendering techniques, but that doesn't inherently make every render appear photo-realistic. See How is Cycles different from Blender Internal?

To get a nice atmospheric scattering effect in cycles, I'd suggest wrapping your earth sphere in a slightly-larger sphere with a volumetric material such as this:

Result:

Note that these values are arbitrarily hand-picked based on what I thought "looked nice". If you are after accuracy you'll probably want to do a bit more research than I did ;)

It could use some tweaking, but it does look somewhat similar to actual photographs of the earth:

Note that in the above setup the atmosphere is a constant density. The real atmosphere gets less dense higher up, creating a subtle falloff. This is pretty easy to simulate with a spherical gradient texture, but will vastly increase render time.

If you don't see the edge of the atmosphere very close up in your render, simulating this may not be necessary.

In response to the edits to the question:

To get rid of the grid-like pattern, add a subsurf modifier to the atmosphere sphere and increase the number of subdivisions until it's no longer apparent.

The reason the earths atmosphere appears bluer at the edges is because light which travels farther through the atmosphere is more likely to be scattered off air molecules. Since rays closer the edge of the atmosphere which travel farther through it, they appear bluer:

Keep in mind that thickness matters a lot with volume rendering, so another thing you can tweak (in addition to the density etc.) is the scale of the atmosphere object (adding more or less atmosphere on top of the ground)

Here's the .blend of my setup:

Textures intentionally omitted

Note that everything is just eyeballed; nothing is based on real-world data.


Rendering multiple layers, missing background I'm hoping this should be a pretty straightforward question. I need to have the purple be the color of the background, not a film overlaying the architecture. What am I doing wrong?

Your model is receiving purple colour from the world material settings. There are two ways of dealing with this.

Compositor Method - If you simply want to add a background behind your render, you could change the world colour to white or anything else, and in the Compositor, plug in the render result into the bottom input of an Alpha Over node, and simply set the colour of your background in the other input setting. In your case, this step would come after your freestyle composite so you'll be adding a second Alpha Over.

Shader Method - If you want your actual scene background to have a different colour from what's being cast onto the objects, then in your world material, add a second Background shader. Connect this into a Mix shader along with the original Background shader. Then add a Light Path node and connect its "Is Camera Ray" output into the factor of the Mix node. And voila, now basically the colour on the top input of the mix is the one that the objects will receive but is not visible to us, and the second input is the one that we see but won't affect the scene.

Hope that makes sense! :)