What, fundamentally, is wrong with my metal texture? I've been working on a metal texture.  The key, it seems, it so mix the glossy type with the diffuse type; and of course there are various other things you can do (like bump-mapping.)  I was wondering if someone among you could be so kind as to tell me why my metal looks like shiny plastic, I just can't get it right.

Eh, this was supposed to be some sort of light-saber variant. Here is a copy of my sheet:

What I'm really asking is what to look for.  I've tried about 100 variations on this and I still can't quite nail it down.

The blend file is here.

My experience with metals has been that you need to include much less diffuse and much more glossy. I would try setting your factor value to something more around 0.05, or less.

In fact, if you're going for something more shiny I would try simply a glossy shader, with a roughness of about 0.05.

Result

Node setup

Hope this helped.


Joining Meshes to Curves HELP! I need to know how to join Bezier curves to a mesh. I am trying to make a car with curved rims and the easiest way was to use a Bezier curve and then to bevel it but I need to join it all together in order to put it in my mod.

You can do so by converting the curves to meshes (this will prevent you from making any new edit to the Bezier profile!), then joining all the meshes together.

To convert the curves, select each one, set the preferred resolutions from the Object Data (Curve) panel (these will affect how many polygons your mesh will be made of), then do Alt+C > Mesh from Curve.

Then, select all the meshes (possibly the car as the latest) and do Ctrl+J to join them.

Please note that this only assigns all the vertices/edges/faces to a single mesh object, but doesn't make smooth intersections or such.


Can't export vertex colors in edit mode I'm trying to write an export script to output vertices and vertex colors in a simple format. The script I've created appears to work fine when run during "Object" or "Vertex Paint" mode, but when I try running it during "Edit Mode" it crashes and doesn't work.

Here is the relevant code:

def do_export(context, filepath):
    obj = context.object
    mesh = obj.data
    mesh.calc_normals_split()

    with open(filepath, 'w') as f:
        for poly in mesh.polygons:
            for loop_index in poly.loop_indices:
                loop = mesh.loops[loop_index]
                vert = mesh.vertices[loop.vertex_index]

                f.write("v %.4f %.4f %.4f\n" % vert.co[:])
                f.write("c %i " % (mesh.vertex_colors.active.data[loop_index].color[0] * 255))
                f.write("%i " % (mesh.vertex_colors.active.data[loop_index].color[1] * 255))
                f.write("%i\n" % (mesh.vertex_colors.active.data[loop_index].color[2] * 255))
                f.write("\n")

And the error I get:

location: <unknown location>:-1

Traceback (most recent call last):
  File "/home/pubby/.config/blender/2.78/scripts/addons/export.py", line 62, in execute
    exported = do_export(context,  filepath)
  File "/home/pubby/.config/blender/2.78/scripts/addons/export.py", line 39, in do_export
    f.write("c %i " % (mesh.vertex_colors.active.data[loop_index].color[0] * 255))
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

location: <unknown location>:-1

Any idea how to fix this?

Set it to Object mode before you begin:

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

...
I tried running your code.  It doesn't do anything over here in any mode.

import bpy
def export(filepath):
  obj = bpy.context.object
  mesh = bpy.data.objects[obj.name]
  obj.data.calc_normals_split()

  with open(filepath, 'w') as f:
    for poly in obj.data.polygons:
      for loop_index in poly.loop_indices:
        loop = poly.loop_indices[loop_index]
        vert = mesh.data.vertices[loop]

        f.write("v %.4f %.4f %.4f\n" % vert.co[:])
        f.write("c %i " % (mesh.data.vertex_colors.active.data[loop_index].color[0] * 255))
        f.write("%i " % (mesh.data.vertex_colors.active.data[loop_index].color[1] * 255))
        f.write("%i\n" % (mesh.data.vertex_colors.active.data[loop_index].color[2] * 255))
        f.write("\n")

It throws: IndexError: range object index out of range
I don't think mesh.data.vertices is pointing to the right number though.


What's the best way build surface around vertices? I find it very time consuming to select vertices one by one and use bridge or fill tool to create faces.

Is there a better way to fill things similar to the one in the screenshot? Such as creating a plane then cut it with the pattern to be filled around?

Try the F2 addon. It's already built into Blender, but isn't enabled by default. When it's active, pressing the 'f' key with a vertex selected extrudes an entire face from it instantly and allows you to continue adjusting its position afterwards. Really speeds up modeling and retopology efforts.


My donut project can no longer render, computer freezes. Cannot fix! I was following blender gurus tutorials and got to the part where I textured the cake area of the donut and when I try to render it, nothing shows up and it freezes my computer and I have to turn my computer off and on again.
I have no idea what settings I should lower in order for it to render better and I've already tried the decimation option, doesn't seem to work. The only other thing I can think May be the issue is the graphics card I have right now. I have a GeForce GTX 1660 SUPER. I am not extremely tech savvy, just a well-seasoned artist trying to understand 3D better.

go to your modifiers and delete the subdivision surface modifiers. I even don't know why you had 3 of them...


Copied and pasted a working fluid simulation objects and settings to another blender file but it does not work I'm again here that I'm trying to understand how works the water simulation. I've been able to create a realistic water simulation,but probably I haven't understood how I reached the result because I done the same thing for the second time but this time it didn't work. I copied and pasted the objects from the working blender file to another blender project,so objects and settings should be identical,but I haven't obtained the same result. The water does not flow correctly. After 3 days of full work,I resigned,I'm tired and I want to be helped. I attach two blender files,the working one and the not working one.

After looking at your files, I think I found the main problem: In the working.blend, you don't have any units specified in the scene tab. In the not_working.blend you use metric units. If you change that back to none, the water will leave the tap again. Simulations depend heavily on the scale of the environment, so be sure to not touch these settings after successful simulations.
But some things still seem to be off, compared to the working.blend. If you want to be sure, I'd recommend to make the final simulation in the working file. After the simulation is done, select your domain and choose File > Export > Alembic (.abc). Specify the frame-range, check "Selectet Objects only" and click export alembic.
You can now import the resulting .abc file in any other scene. Alembic only exports the fluid mesh itself, you won't have any chance to alter the simulation.


issue with mirrior modifier Look at this screenshot why this will happen i absolute beginner in blender and use this blueprints link i want mirror other side of object not down

It seems like you need to go into the object mode and apply the rotation. Go into the object mode, select your object and press CtrlA and then apply rotation.


How can I remove the lines around the edge of an object? I got a Minecraft rig which I want to have as a transparent image for a thumbnail. I always get these weird lines around the head (and sometimes on the rest of the rig as well), but I want to get rid of them as they don't look nice. I tried removing the lines in Photoshop, but that takes a lot of time.

Please have a look at the screenshot which has been attached to this post. How do I get rid of the lines around my Blender Minecraft rig? I'm a Blender beginner, so please send very clear and detailed instructions if you know the answer! :)

Thanks!

Problem occurs with:
- Windows 7 Pro 32-bits
- Windows 10 Pro 64-bits
- Blender 2.75a (also had the problem in previous versions)

Download link for .blend file:
https://mega.nz/#!LV4zAJ6a!SYgFytB9C92YXd5gNaH8C7m2fWys2e0AetcRpmFeTwc

It appears to be a UV layout problem - not enough margin between the UV islands, so color data is bleeding over. From what I can see of the UV texture on the right everything is just packed way to closely together. But maybe you can fix this by scaling the UV islands in a little, one-by-one.

Instead of this...

More like this:

Also, to fix triangles like that one on the arm, enable Auto Smooth in the Mesh Context.

Update:

I looked at your .blend and it does appear that the UV layout is the problem.

Note how there is no margin between the islands.

In addition to that, there are parts of the layout that are doubled-up. This may or may not be intentional, but it means a texture in that region will show up on more than one place on the mesh.


Maya to blender pivot point location changes I am new at Blender and I am trying to import a file that has multiple objects and some of them have the pivot point set at a specific place for them to rotate properly (car doors, windows, etc.)
The problem is that when I export with FBX, all the pivot points go to the origin and I can not find a way to make them import properly.
I also tried exporting from Maya as DAE.fbx but even though the file seems to export fine (I can re-import it into Maya without problem) when I try in Blender, nothing gets imported.
I hope I am missing something simple and there is an easy fix for that.
Thanks a lot for any help!

Leo

I had a similar issue and I noticed that the objects causing trouble had their transformations frozen in Maya. Once I unfroze objects transformations & exported to Blender again, everything was working as expected. I found this handy script to unfreeze objects transformations in Maya. Hope this helps anyone going through the same issue in the future.


Cant render image with transparent background after motion track? So i motion tracked a footage setup a scene did compositing and stuff so now i want only the 3d stuff without the video as a background. so i turned off the video, even tried turning off compositing in post processing, transperency is on in cycles,... but no matter what i do the renderer would render an image with transparency but when i save it as a png the background comes black. i have been banging my head for the past hour and just cannot fix this.

I beleive its because its rendering the foreground and then the background... i cant get it to render only one layer like it normally does on a new blender file. Even tried deleting the background layer and asking it to render a single layer.

Make sure to use RGBA (A as in Alpha) for your PNG output


How to structure modal operator correctly with macro like step by step execution? I struggle with understanding the modal operator concept. Below is a chain of commands I would like to step by step to execute, while during translate the following steps should wait till translate is done. So a modal operator structure is needed here.

        bpy.ops.object.select_all(action='DESELECT')
        bpy.ops.object.empty_add()
        bpy.ops.transform.translate('INVOKE_DEFAULT')
        bpy.ops.view3d.snap_cursor_to_selected()
        bpy.ops.object.delete()

This is the template I found and understand.
I select one object, execute the command which will then get the location and the modal takes over. But I failed to implement my commands into this structure. How can I make the modal aware of that I added the empty and jump into translate.

I understand the confirm and cancel being the states where I can execute the rest after transform or even undo the initial empty generation if need needed.

import bpy

class ModalOperator(bpy.types.Operator):
    bl_idname = "object.modal_operator"
    bl_label = "Simple Modal Operator"

    def __init__(self):
        print("Start")

    def __del__(self):
        print("End")

    def execute(self, context):
       # bpy.ops.object.empty_new()
        context.object.location.x = self.value / 1000.0
        return {'FINISHED'}

    def modal(self, context, event):
        if event.type == 'MOUSEMOVE':  # Apply
            self.value = event.mouse_x
            self.execute(context)
        elif event.type == 'LEFTMOUSE':  # Confirm
            bpy.ops.view3d.snap_cursor_to_selected()
           x bpy.ops.object.delete()
            return {'FINISHED'}
        elif event.type in {'RIGHTMOUSE', 'ESC'}:  # Cancel
            bpy.ops.object.delete(use_global=False)
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.init_loc_x = context.object.location.x
        self.value = event.mouse_x
        self.execute(context)

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

class ObjectData(bpy.types.Panel):
    bl_label = "Object + Mesh Data"
    bl_idname = "ObjectData"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "Modeling Toolbox"

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

        obj = context.object

        row = layout.row()
        self.layout.operator("object.modal_operator")

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

if __name__ == "__main__":
    register()

Your operator is not a modal operator and you are calling a modal operator inside it ,  SnapOriginObject will exit and leave transform.translate('INVOKE_DEFAULT') running behind ( it won't wait as you expect ) , you have to create a modal operator ( see the templates ) where you catch the mouse events ( movements, clicks, position ) to move the empty and delete it when you are done.


Script for exporting objects to VRML Does anyone know how to export objects to VRML by using a script?

Blender includes a vrml exporter, you just need to enable it.

Unless you specifically need the vrml format you might be better off using the newer X3D exporter (X3D is the successor to vrml).

If you need to automate the export with a script you can use the export operator once the addon is enabled.

import bpy
bpy.ops.export_scene.vrml2(filepath='myscene.vrml')


How to I create swirls of dust? I made this using other software:
https://youtu.be/yS1SEQP11o0

I want the dust to look like it was blown by the propellers as it swirls in the turbulence to eventually settle.

There is this exact question that ended up in the chat rooms but that doesn't help me any.

Creating dust deflated by wind

In this tutorial you will see exactly what is needed to learn do to to get something similar as described.

https://youtu.be/k8lHVnQdtSA


Index material in 2.8 (Cryptomatte) I have a lamp. Behind the glass is a source of light. I want to apply effects to the light source in the composer. Previously, this was done using a material index. In 2.8 this isn't possible, there is Cryptomatte. But the source of light is behind glass, so I can't pick it to get a number. What can I do?

This is not exactly how to do it, but you can try to reduce alpha transparency of your glass object and adjust your Alpha Threshold value on View Layer settings. Just after that you can use cryptomatte object to pick the light.


What are the differences between Orthographic and Perspective views? In risk of being off topic for broadness and discussioness... but I think in the end it's a question that can't be avoided.

Can someone please finally explain the difference and why we need both?

Orthographic is (according to Wikipedia):

  ... a means of representing a three-dimensional object in two dimensions...

Bascially, Orthographic is a fixed depth. You can't zoom in or out. There is no distance from the camera.

Perspective has depth. You can zoom in and out. You can judge distances. Cameras can be distanced from the scene.

Simply put, orthographic is what would happen if you squished everything in the scene (along the cameras view axis) and stuck it right against the camera.

Perspective on the left, Orthographic  on the right


Creating a space dome? Is that how that works? I'm currently working on a storyboard type music video where most of the shots take place in space. I've been getting away with creating that illusion of space using after effects with certain backgrounds and I believe I've got decent results give the drawing type styled nature of it. But there's a few upcoming shots where the camera is suppose to pan beyond what I'm able to recreate in after effects.

I figured that my best possible bet to improve that would be to create a "space playground" in blender where I would indeed be able to move the camera in any direction I wish. What would be the best way to go about this? One thing that comes to mind is that menu screen from Halo 1 for PC. Where its apparent that the camera is inside a "dome" / Sphere looking around and there's stars in every direction. All the YouTube tutorials that I've seen barely cover what I'm talking about. They mainly show how to create a space "picture" using the particle system. I want to be able to pan that cam in any direction like the movie Gravity. Any help with this would be greatly appreciated.

You can make a star field by shooting a panorama in one scene, then using the resulting image in another scene as a world texture. You won't have to render the particles all the time and you can pan anywhere.

Make a cube with only static particles
Place the camera at the center of the particle cube (emitter) and
remember to turn off the emitter object (so that it doesn't render).

Use a simple icosphere as the star object and hide it on another
layer.

Set the camera to the center and make it Equirectangular Panoramic.

Make sure that the scene you render is high resolution and square. In this case 3000 x 3000 pixels. I have set the samples very low to render faster. As all the stars use emission materials there is no noise.

Nb. I have accidentaly left the particle object on the same layer and you can see it as the largest star in the sky (bottom left corner).

Make a new Scene with only a camera in it. Then make a World material using the star field that you just created.

You will be able to pan or tilt anywhere in this world, even fly towards the stars but never reach them.

Usefully you could also write names in the stars as modified particles and have them display in your world as well.


Autosave don’t work in 2.8 About three months ago, auto save in Blender 2.8 stopped working
Since then, I downloaded 10 new builds and nothing has changed.
Blender 2.79 makes autosave fine, but 2.8 doesn’t

I checked on other computers, everything works, but on mine it doesn't, and I do not know how to fix it.

What is the problem?

In Preferences > Save and Load > Auto Save,  do you have the Auto Save Temporary Files option checked ?

Next check in Preferences > File Paths > Data > Temporary Files, left click the folder icon to see if you have any .blender files saved at this location.

This is what i have in my Temp folder:

Note that holding down the Alt key and left clicking that little folder icon will take you directly to the location on your hard drive from where you can drag one of the saved  .bland files onto your desktop and then open it again in Blender.


How do I make this sphere follow this bezier curve Please help I cant find how to move the ball along the path! any help would be huge thanks!

use the clamp to constraint.
look at my example gif


How can I export a model with its textures applied? I have a blender model that is 7Mb, a laptop with 4 image textures applied to it. I am trying to export it to use in Google Poly.
When I follow this tutorial to export as a .fbx, the resulting .fbx file is 28Kb and doesn't display textures once I upload it to Poly.
I tried using the gITF 2.0 export, but again, the resulting file was 16Kb.
As a last resort, I exported as .obj (the last format Blender can export to that Poly accepts), but the resulting .obj and /mtl files were 1Kb and 5Kb.
The other questions or tutorials I found did not apply to my situation, since I am using UV photographic textures in Cycles.
Is there a way to export a model and its UV textures to .obj, .gITF, .glb or .fbx from Blender?

The most likely explanations for why your textures are not exporting would be that (a) the textures are not in an image format supported by the export format, or (b) the material is not configured in a way that the export format's addon understands.
In the case of glTF 2.0 (I can't comment on FBX or OBJ), images must be in PNG or JPG format to be exported. The material should typically use the Principled BSDF material — arbitrary material node graphs cannot be exported from Blender to any format.
For full details on how to configure your materials for correct export from Blender, see the documentation of the Blender glTF exporter. In particular, this is a standard material setup with a base color texture:


How do I get this odd geometric hole in smooth surface right? Ok I have started over 100 times trying to figure out how to model this efficiently.  I have what I consider passable meshes using different techniques but I'm very new to Blender and know there's something I just don't know that I'm missing.

Here's a render of my current model...

Here's the mesh for the cutout geometry...

This seems terribly inefficient, modeling it using a background image and sliding edge loops all day.

If you look in the upper left corner there's a contour that doesn't belong there, among other problems like too many verts, etc.

What guidance would you offer?  How would you model this?  How would you keep the geometric cutout tight while keeping the number of verts down?  Do you use subsurf?  Shrink Wrap?

Thanks in advance for any guidance you could provide.  I've attached the .Blend file so you can take a look at it if that helps!

Pete

Nintendo Controller .Blend File

There are any number of correct solutions depending on your needs. I propose this one, because it keeps the element in a four sided square that can be edited quickly and incorporated into the rest of the mesh without difficulty:

And I would advise using a bevel modifier rather than a subsurf modifier in this situation. It gives those nice rounded edges while leaving you free to to structure your topology for ease of use, and you can use Ngons if you like. I like to use the "Angle" limiting method to only bevel sharp corners. But you can be as specific as you like using bevel weights.

If you must use a subsurf modifier, I recommend using the "Edge Crease" tool (SHIFT + E) where possible instead of adding loop cuts to sharpen corners. It makes the mesh shape far easier to edit.


Certain verticies arent registering for weight paint I'm trying to weight paint a model and it works for the most part but at random vertices or faces, it will refuse to paint over or change. I'm still relatively new, so I don't know if there's something I'm missing in the settings or something like that, or if that's not how weight paints work, I really don't know.
edit: here's a screenshot, I'm trying to set the weights to 0, but on the corner closest and the bottom of the far side won't paint

Just from the screenshot, my guess is that you need to add geometry to your mesh. I would add a bunch of subdivisions or apply a subsurface modifier. This will allow it to have enough faces for your weight painting to take on more complex characteristics.


why are my cloth objects not acting properly my cloth objects were fine when all of the sudden today they started going crazy halfway through my animation. does anyone know what is happening? also I cant get the cloth to go past 250 frames.

After I investigated this scene, I found that your mesh was not properly baked.  All you need to do is select the waving yellow flags, go to the cloth settings in the physics tab, scroll down, and click on bake.  (see image below)

After it is done baking, your simulation should work fine.  If you encounter further problems, let me know and I'll be happy to help!  Hope I've been helpful to you! : )
(PS, if this answer worked, please mark it as accepted)


Why is my wood looking like army camo? I'm very new to blender, and I want to create a Tabletop. I followed the tutorial on https://www.youtube.com/watch?v=ghyktnK0sAs, but my output was like so:
Why is this happening and how may I make it look like wood?

Why is this happening and how may I make it look like wood?

There aren't many reasons for this other than you didn't follow the tutorial correctly, because the wood in the tutorial looks completely different.
Tutorials are meant to be watched and re-watched until you get how the stuff works, so this is normal. It is completely normal not to understand everything straight away, I believe this happens to everyone who tries to learn CG and it's OK. You just need to redo it. ...and then possibly re-do it once more, and once more after that, and maybe even after that and so on. This is how learning 3d goes - there is lots of re-doing at first. Watch the tutorial again as many times as you need to and follow it more thoroughly until you understand everything that is done in it and get good results. If you want a more in-depth answer about it than this, you need to share your file so people can see what exactly you did.


I need to turn one side of a cylinder into a square a leave the other side round Is it possible to make one side of a cylinder square while leaving the other alone? If so how would I go about it? I have a tree branch that I need to connect to a trunk. The number of edges on the cylindrical branch will not connect up with the square hole on my trunk...Any ideas?

Don't know if this is what you wanted, but you may just bridge the vertices between square and circle to create this kind of shape. Add a plane and subdivide it as many times as you want. Then add a circle with the number of vertices matching the number of the vertices on the edges of the square/plane. Finally select them as pictured below, press Spacebar and type Bridge-->Bridge Edge Loops.

NOTE: There is similar answer about this here on BSE, but I can't find it.


Solid primitive cube in script I am writing a script for applying a particle system on Blender. In the options I want to set a solid primitive cube as the duplicate object, however I can't figure out how to do it without creating a cube in the scene first. Is there a way to do this or must I create the cube as well? If so, I want to be able to delete it after applying the transformation. This is the code I have that does not work:

settings.dupli_object = bpy.data.objects.get("Cube")

If there is no "Cube" to reference in blender's database, what would the syntax be for creating it with the name "Cube" and then deleting it after the transformation is applied?

# create solid primitive cube to use as duplicate object
bpyscene = bpy.context.scene

# Create an empty mesh and the object.
mesh = bpy.data.meshes.new('Cube')
basic_cube = bpy.data.objects.new("Cube", mesh)

# Add the object into the scene.
bpyscene.objects.link(basic_cube)
bpyscene.objects.active = basic_cube
basic_cube.select = True

# Construct the bmesh cube and assign it to the blender mesh.
bm = bmesh.new()
bmesh.ops.create_cube(bm, size=1.0)
bm.to_mesh(mesh)
bm.free()

and then delete

bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Cube'].select = True
bpy.ops.object.delete()


How to use pointcloud_write(...) and pointcloud_search(...) ? (Open Shading Language) I am learning Open Shading Language these days,
but I don't know how to use pointcloud_write(...) and pointcloud_search(...),
what does pointcloud actually mean ?
how to create a pointcloud in blender ?
how to use pointcloud_write(...) and pointcloud_search(...),?

I was quite intrigued by these functions and tried to following the code examples in the OSL language specification but without success. On digging into the Cycles code, however, it becomes clear why this was not working :

int OSLRenderServices::pointcloud_search(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &center,
                                         float radius, int max_points, bool sort,
                                         size_t *out_indices, float *out_distances, int derivs_offset)
{
    return 0;
}

int OSLRenderServices::pointcloud_get(OSL::ShaderGlobals *sg, ustring filename, size_t *indices, int count,
                                      ustring attr_name, TypeDesc attr_type, void *out_data)
{
    return 0;
}

bool OSLRenderServices::pointcloud_write(OSL::ShaderGlobals *sg,
                                         ustring filename, const OSL::Vec3 &pos,
                                         int nattribs, const ustring *names,
                                         const TypeDesc *types,
                                         const void **data)
{
    return false;
}

The functions merely return 0 or false and perform no action. Therefore, it appears that this functionality has not yet been implemented in the current version of Cycles.

The source can be found in the Blender GIT Cycles repository at https://git.blender.org/gitweb/gitweb.cgi/cycles.git/blob/HEAD:/src/kernel/osl/osl_services.cpp


Bliniking shadow on rendering result I am making walking robot and get a weird blinking shadow on the robot's body.
This shadow lasts only one frame and then disappears.

Blender: 2.77
Renderer: BI

Frame 3 is similar to 1st (without shadow).

If any details help to fix this just ask.
I don't know what information might be useful for it.

Response to Sonace:

It doesn't help.

And the robot doesn't have any duplicates under its body.

Well since nothing works im posting something that may work. sellect the object you have this problem apply a smooth shader in it and then add a subdivision modifier change it to simple from catmull-clark.Then change subdivisions to something big like 4-5.
And check again to see if it works.If this still doesnt work add one more subdivision modifier but not simple this time.And check again.
This wont work for sure*


Camera behavior ..broken? I've got something weird. I added a third camera to my scene and all of a sudden, when i press '0' to shift the view to the camera, i get a weird view on my scene, and io am not able to change it (f.e. i cannot zoom or rotate the view when i have 'Lock Camera to view' unchecked). When i do check 'Lock camera to view', and i try to change the position, i get very weird clipping and behavior.

I was using the 2.79 RC2 release. But the problem persists when opening the scene with 2.78.

Anyone know what could be the problem? Maybe i pressed some buttom unknowingly?

Thnx anyway, Casper.

I have a solution, but i still do not know what caused this problem.

When i create an extra Screen Layout (opened the '3D view Full' and pressed the '+' to make it a new one, named it 'Default_2'), and reconstructed my preferred screenview, the problem is gone. The original Default screenview is still broken. Dunno why.

Found this solution in another topic:

Original posted solution to the same problem


How does the Cloth Stiffness Scaling option work? I'd like to know how the Cloth Stiffness Scaling option works. It can be found in the Cloth Modifier's Physics Panel; however, the manual doesn't mention this feature at all. How does the Cloth Stiffness Scaling option work?

More specifically, I'd like to use cloth simulation to model a shirt with a stiffish collar. I tried weight painting the collar and setting stiffness scaling to use said vertex group; however, I didn't see any change in the simulation. Additionally, the simulation doesn't prevent the intersection of itself and the collision mesh. Are there any tricks to improving this result?

Cloth Stiffness Scaling

Q: How does Cloth Stiffness Scaling work?

A: Basically, you just (1) Create a Vector Group from the Plane, (2) Weight Paint each half of the Plane red/blue, (3) Then set the min&max values for Bending stiffness to 0.0001&1000.0. You can test it with a cloth falling over a collision sphere. The following post aims to elaborate on this explanation.

Feature Functionality

According to the Documentation for Blender 2.4, the Stiffness Scaling feature allows a vertex group to have a different bending/structural stiffness value for each vertex within the vertex group (as opposed to the same bending/structural stiffness value for each vertex). This requires working with "Vertex Groups" and "Weight Paint" features.

Blender 2.4 Docs:
http://wiki.blender.org/index.php/Doc:2.4/Reference/Panels/Object/Physics/Cloth#Stiffness_Scaling

Same Stiffness Values

The usual way to apply (bending/structural) stiffness values to a vertex group (or a plane mesh), is to apply a "Cloth" Modifier to a Plane Mesh (hopefully, well subdivided) via the "Modifiers > Add Modifier" Panel. Once the Cloth Modifier is applied to the Plane Mesh, then you can set the "Structural" and "Bending" stiffness values via the "Physics > Cloth" Panel. For example, you can set "Bending" to 0.0001 to be very silky, or you can set "Bending" to 1000.00 to be very leathery. Now all of the vertices within the Plane Mesh will have the same stiffness values.

Different Stiffness Values

Now, let's say that we want each of the vertices (of the Plane Mesh) to have a different structural/bending stiffness value. In this example, we want the left half of the cloth to have 1000.0 "Bending" stiffness and the right half of the cloth to have 0.0001 "Bending" stiffness (aka, leathery on the left and silky on the right). To do this, we will need to work with the "Vertex Groups", "Weight Paint", and "Cloth Stiffness Scaling" features.

First, we want to group all of the vertices from the Plane Mesh into a Vertex Group. To do this, we "add a new vertex group to the active object" via the "Data > Vertex Groups" panel (in this case, the active object should be the Plane Mesh). Once the new Vertex Group is created, it should have a default name of "Group". Feel free to re-name it to anything you want -- I will rename it to "Cloth_Group_001". Now, we've created our Vertex Group! Great Job!

Second, we need to Weight Paint the Vertex Group of the Plane Mesh (aka, "Cloth_Group_001"). Weight Paint controls can be accessed by changing "Object Mode" (or "Edit Mode") to "Weight Paint". Now, you will be controlling an interactive brush with a "Weight" between 0.000 to 1.000, a "Radius" between 1 to 200 pixels, and a "Strength" between 0.000 and 1.000. Paint the left half of the Plane Mesh to Red (aka, Weight=1.0), and paint the right half of the Plane Mesh to Blue (aka, Weight=0.0). ((I suggest using a Strength of 1.0, and choosing an Radius Size that is comfortable for you)). Now, you should see the left half colored Red and the right half colored Blue. You've just Weight Painted the vertices in your Vertex Group (of the Plane Mesh)! Great job!

Finally, we can go back to our "Physics > Cloth" and "Physics > Cloth Stiffness Scaling" panels. Using these Cloth panels, we are going to set the minimum value for "Stiffness Scaling" and we are going to set the maximum value for "Stiffness Scaling". We first need to enable "Cloth Stiffness Scaling" via "Physics > Cloth Stiffness Scaling" panel. Now that stiffness scaling is enabled, we want to set a minimum and maximum value for our "Bending" stiffness values for "Cloth_Group_001" (note: we can do the same thing for our "Structural" stiffness values, but this example will only demonstrate the min and max for "Bending" stiffness values). To set the maximum value for our "Bending" stiffness, we need to select "Cloth_Group_001" from the dropdown-menu under "Physics > Cloth Stiffness Scaling > Bending Stiffness:" and then set the max-value for the "Bending Stiffness" to be 1000.0 (you can set this to anything you want, we will use 1000.0 in this example). At this point, be sure that you did both: set the Vertex Group and set the Bending Stiffness "Max:". The last thing you need to do in this section is set the minimum value. To do this, we need go to the "Physics > Cloth" panel and set "Bending:" to 0.0001 (this will serve as the minimum bending value, whenever "Cloth Stiffness Scaling" is enabled --  which you already enabled earlier). You have now set the min and max values for the Vertex Group's Bending Stiffness (Remember that the Vertex Group of your Plane Mesh is re-named to "Cloth_Group_001" for this example). Great job!

To conclude, let's try to understand what we just did. We basically set the Red-Painted vertices to 1000.0 and the Blue-Painted to 0.0001. This is because 1000.0 (maximum) maps to the "Weight"=1.0 from the "Weight Paint" earlier; similarly, 0.0001 (minimum) maps to the "Weight"=0.0. Note that anything that is painted between Red or Blue (e.g., Green/Yellow/Orange) has a Weight in between 0.0 and 1.0; this means that Green/Yellow/Orange will have a Bending Stiffness between 0.0001 (minimum) and 1000.0 (maximum). In our case, we should only have the left half of the vertices painted Red and the right half of the vertices painted Blue; this means that the left half of the vertices have a Bending Stiffness of 1000.0 and the right half of the vertices have a Bending Stiffness of 0.0001.

That's it! Now you have each vertex with a different stiffness value.

(Note: If you want to change the stiffness for every single vertex in your cloth, just use a different Weight value for each vertex while "Weight Painting".)

Testing

You can take my word that this works, but I'm sure you're eager to see it work for yourself. I would add a Sphere under the Cloth, and add a Collision Modifier to it. Have the Cloth (aka, Plane Mesh) above the Sphere so that when you begin Simulating/Animating it will fall under the force of Gravity and drape the Sphere. Remember to have "Cloth Collision" enabled via the "Physics > Cloth Collision" panel (optional: feel free to enable "Self Collision" as well).

Now, you can press the "Play Animation" button (towards the bottom of the Blender UI) and see the results of the Cloth falling over a Sphere and draping it. You will notice two (2) things:

The right half of the cloth will want to hug/engulf/fit the sphere, since the right half of the Vertex Group is silkier ("Bending"=0.0001).
The left half of the cloth will want to try to "spring" back into a planar shape and definitely NOT hug/engulf/fit the sphere as tightly as the other half. (Aka, the cloth will be very stiff in this half; "Bending"=1000.0).

(Note: I've tested Cloth Stiffness Scaling with Blender 2.74, and it works perfectly.)

Conclusion

In conclusion, you will have a very stiff left half (due to the RED paint) and an extremely low stiffness on the right half (due to the BLUE paint).

Does this make sense? Any questions, comments, or feedback are welcome.

References

This link explains one user's struggle and eventual understanding of the Stiffness Scaling feature: https://developer.blender.org/T39371 . Feel free to open the "ClothStiffness2.blend" file referenced in the link, so that you can see a Blender Scene similar to the one example referred to above.


Why parented to bone object has offset in local space? Sphere empty is a bone's Сhild (origin is not cleared for it).
Cube empty has CopyLocation constraint set to local space of Sphere empty.

Now Cube has some offset, it is equal to bone's length. But why is it here, if Sphere empty stays right in the world origin

To remove offset from relation:

Clear origin for child object, ALT O (translation only) or clear parent inverse, ALT P (translation+rotation)
In bone's options enable Relative Parenting


Distorted mesh when I use a bevel object on Nurbs curve vs. Bezier curve I have a series of objects that I have procedurally generated use Bezier or Nurbs curves for which I then attached a Bevel and Taper object.

When I use a Bezier curve the objects come out correctly. See below (ignore the color)

However, when I use a Nurbs curve, with the same exact Bevel and Taper object, they come out very distorted. See below:

Even when I reduce the size of the bevel object the mesh is still very inconsistent. However, ideally, I shouldn't need to adjust the size at all.

One other point that may be important. When I generated the objects using Bezier curves I would insert a curve and then randomize things like curvature and size to get the final object. Then I would apply the bevel and tapers. However, I created the nurbs curves from a list of 3D coordinates (5994 points) loaded from a CSV(doing something similar to this thread: Poly / Bezier curve from a list of coordinates).

Does anyone know what the cause of the distortion is? Ideally, the objects created from the nurbs curves would look exactly the same as the bezier curve.

Here I've uploaded the files with the Nurbs curves that I'm having trouble with:

And this is the file with Bezier curves that works as it should.

These files are exactly the same except one uses a Nurbs curve and the other uses the Bezier curve.

Your bezier curve based balloon object does not have its scale applied, it scaled 0.25 on all axis, that is why the bevel is not at its true size compared to the bevel object. The NURBS based one is the correct one here.

If you do apply the scale Blender will try to compensate automatically by changing vertex bevel radius to keep the same size so applying scale alone won't fix your issue.

You then have to enter Edit Mode, select all curve vertex and explicitly set the bevel radius back to 1 as described in my answer

A a side note, also have in mind that your NURBS curve made from many points is too dense, and will invariably lead to self intersections and rendering and display artifacts caused by the large bevel section relative to point density.

It will also lead to an unnecessarily heavy geometry which is too dense with no discernible advantage. I'd strongly advise severe cleanup or using a cleaner modelling method. See my answer about cleaning up curves for some tips


I made a custom shape with the knife tool but I cant use the subsurf of it for sculpting So I used a cube and the knife tool to make a custom shape for a sword pommel. The pommel has engravings on it that I want to sculpt but the subsurf looks awful. This awful looking subsurf makes odd artefacts when you try to sculpt on it

An n-gon is face with more than 4 sides. 3 sides = tri,  4 sides = quad, 5+ sides = n-gon. Although the use of tris and n-gons are sometimes a common part of modelling, both of them can be responsible for shading artifacts, especially near edges that are shaded smooth. More importantly to your scenario, is that blender calculates subdivisions best based on quad-only based geometry. See the example images below. The first images shows 2 planes - one with quad topology and the other with tris and n-gons. The second shows what happens to each of them (topology wise) when a subsurf modifier is added.

See the difference? This is one reason why people argue that you should keep your geometry as quad based as possible. A MULTI-RESOLUTION MODIFIER is a tool that aids in this pursuit. It is a modifier that can quickly reduce whatever geometry you have to being quad based (among other things) without loosing too much detail. Once the surface of your pommel is quad only, you can then subdivide and get the results you are looking for.


How to do retopology? So this seems to be an essential skill in blender when you sculpted something and it has to many vertices. I have tried to figure it out but all my attempts have either taken days to do some or ended in it still having way to many points. I have tried watching videos but the people doing just start doing it without without explaining anything and I can't seem to copy them just by visuals only I'm also heavily auditory.
So can you guys give me a few some tips or point me somewhere that can help me?
And please don't just type retopology into google or Youtube and post the first video that comes up. I tried that many times, so please make sure they are good first or you have used them before.

Maybe you don't say enough about what your object looks like. Also, retopology is not the same as simplifying a mesh with deleting edge loops etc. But if you're talking about retopology, here is the basic way to begin in my opinion:

Create a plane over the high-poly object you are supposed to retopologize. This plane will be your low-poly version.

If your high-poly is symmetrical, give your low-poly a Mirror modifier. Enable the Clipping option.

On the horizontal menu bar, disable the Limit Selection to Visible option, enable the Snap, choose the Face mode, enable all the snap options.

Begin to move the vertices of your plane, you'll see that they will stick to the high-poly surface. Extrude edges, try to follow the main shapes and angles of the high-poly. About good topology and topology tricks, you can find some good advices here, it would take too long to summarize everything here.


How do I focus on an object's center (Numpad period not working) I'm running through the donut tutorial, and when I click on the torus and press Numpad period, it focuses me on the side of the object.

I have the center set to: "Geometry to Origin" and it's not rotating about the origin either. I found a way to fix this the other day, but I'm new to blender and haven't touched it in a week and forgot the fix. Can't seem to find it again.

To fix the . shortcut, press N to bring a sidebar, go to View > View Lock and disable Lock to 3D Cursor

As for the rotating pivot point problem, you can change that at the middle top of the 3D Viewport.


How do I make a weapon shoot at the center of the screen? I've been researching this for weeks and only found bad results. I think its time for a good answer. I have a rocket launcher, so I can't "fake" the bullet. There is no way to fake a rocket. I need it to shoot from the front of the gun and fly to the center of the screen. Of course I could just make the weapon slanted to the center, but if you look at far targets, it will miss; and if you look at close targets it will also miss. Can I have an empty in the center of the screen that just collides with obstacles, and the gun just adds the projectile to make it always hit center? If that's the case, I would kindly ask for help on how to do that. If there is a better technique, please state it, it would help a lot!

-People said they are confused, let me explain more thoroughly.

I want to have a line in front of the camera that collides with obstacles(for example, and object with property "obstacle" set to 1), that is stopping at infinity, but there is will obviously always be an obstacle to hit, such as a roof if you look up(indoor). The empty will always track to the very end of the line, so if you aim somewhere close, the rocket will hit center of screen and hit the close object, and if you hit far, on the other hand, the rocket will fly to center of screen and hit the obstacle still. So you will basically always hit the center of the screen no matter what.

You can use a bit of Python to get started, without knowing your exact implementation of the weapon system, i can't give you the full code.

# get vector from centre of screen
cam = logic.getCurrentScene().active_camera
# vector in world space
vect = cam.getScreenVect(0.5, 0.5)
# get length of vect
length = -cam.position[2]/vect[2]
p = vect * length
# position of p (somewhat ahead of camera)
pos = cam.position + p

With that, you should be able to either ray cast the bullet, or have it go toward that direction.


How to make cube A size following cube B size? (boolean for window/door) ie; I have cube001 for boolean, and cube002 for window frame/leaf, so when I resize high/length of cube002(window mesh) the boolean cube (cube001) is changed too, how to do this?

If you freeze the scale, it's not like

else
http://take.ms/CTUFw


Cursor is set to move by increments. how to reset to normal? My cursor is moving by every selection by large increments!

Normally when I use Blender, I am able to select and move objects to any coordinate. Now, all of the sudden, when I select an object or mesh the selection moves by an inch or so in each direction.

How do I reset it to normal?

It sounds like you may have accidentally enabled Transform Snapping (⇧ Shift↹ Tab).

By default transform snapping will snap objects to fixed increments as they are being transformed.

  Transform snapping:
  The ability to snap Objects and Mesh element to various types of scene
  elements during a transformation is available by toggling the magnet
  icon (which will turn red) in the 3D view's header buttons.

  Increment:
      Snap to grid points. When in Orthographic view, the snapping increment changes depending on zoom level.

You can disable it by clicking the magnet icon in 3D view > Header, or by pressing Shift+Tab:

Enabled

Disabled

For Version 2.8.


Stereoscopic camera: how to see objects visible only from the right and left camera Previously, I've asked this question: How can I see if an object is inside the volume rendering of the camera? and I had found the solution thanks to this post: Does Camera.view_frame() return the correct size of near clip plane?

The line code x, y, z = world_to_camera_view(sce, cam, mat * v.co) is perfect for found the objects are visible from the central camera but it excludes items that are only visible from a single camera (camera L or R). I want to find the objects visible only from the right camera and objects visible only from the left camera.

A possible solution would be:

Delete stereoscopy
Move the camera to the right of intercular distance / 2
Incline the camera to the z-axis of angle of convergence (easy calculation)
Check the visible item with world_to_camera_view
Repeat for simulate the left camera (move to right and rotate z -angle)
Set True the stereoscopy

But how to eliminate the stereoscopy and have a camera equal to that of the left and right?

I solved my issue by following the steps I listed. Now I have this problem:

If I place the camera on the right of a value (even higher) and then use world_to_camera_view the result I get is the same. That tells me that the camera always sees the same objects.

Code

import bpy
from bpy_extras.object_utils import world_to_camera_view

context = bpy.context
scene = bpy.context.scene
scene.update

def checkIfIsInCameraView(cam, obj):
    for v in obj.data.vertices:
        x, y, z = world_to_camera_view(context.scene, cam, obj.matrix_world * v.co)
        if (0.0 <= x <= 1.0 and 0.0 <= y <= 1.0):
            return True

    return False

#set off stereo
scene.render.use_multiview = False

#creo nuova camera per simulare camera laterale
cameraNormal = scene.camera

#change camera position
cameraNormal.location.x = cameraNormal.location.x - 50.0

for obj in scene.objects:
    if obj.type == 'MESH':
        #print if in camera view
        if checkIfIsInCameraView(cameraNormal, obj):
            print(obj)

#change camera position
cameraNormal.location.x = cameraNormal.location.x + 100.0

for obj in scene.objects:
    if obj.type == 'MESH':
        #print if in camera view
        if checkIfIsInCameraView(cameraNormal, obj):
            print(obj)

#set on stereo
scene.render.use_multiview = True
scene.update

Some tips?

Sometimes, you need to use scene.update() once you've modified some properties (location, rotation) of the objects. When the scene is updated, you can use the new values.
You forgot the parentheses after the function call :)


All drawings move together in Blender? Is there a way to turn this off? I've been trying to work on a new animation. I'm new to Blender so i'm still learning it. I was drawing my character but then I ran into a problem where when I click one object like the character's head. It selects literally every single drawing in the software so now I can't move anything separately for the animation to work. Does anyone know how to fix this problem? (Oh sorry I forgot and by the way this is for 2D Animation)

In Grease Pencil edit mode: select the strokes you want to split from the rest and then (menu)Stoke -> Separate -> Selected Strokes. The Separate menu has the shortcut "P". You will then have the selected strokes as separate Grease Pencil objects. You can also move them in edit mode, after you select, as you see fit.


Scale the Skin Modifier on a Specific Axis I'm trying to learn how to use the skin modifier effectively, and realized that it would be beneficial to understand how to scale the modifier on specific axis, instead of in general, without having to select the radius properties in the N menu. I know that it can be done, based on what I've seen in videos floating around, but I don't quite understand how to do so.
Ive tried doing Ctrl+A + X (or Y) but neither of those had any affect
How do I scale the skin modifier on a specific axis with hotkeys?

Hiserod in the comments was able to help me
My issue is that I was pressing ctrl+a+x all at the same time, not pressing ctrl+a and then pressing x/y/z separately from that.


Blender Cyles render not rendering I have made an animation that does not render properly, it will start to render the first couple of tiles and then just stop completely, not progressing any further. I have visited this other question: Came back to a blender file, now not rendering, and tried that solution but to no avail. My issue is practically identical to that question though.

File: https://drive.google.com/file/d/0Bwc5svs--7yVeXpYWkF2Ry12Q1k/view?usp=sharing

I tried to render your scene and I have no issues. I noticed "Square sample" was checked so you had to much sample to render. Try to render with "Square sample" unchecked (Properties panel -> render -> sampling).

And just for advise, if you are rendering with the CPU, set the tiles to 16*16 instead of 64*64 it sould be a little bit quicker


Difference in layout panel / menu ? difference in set property in operator / menu? I am trying to make a panel and a menu .
But using the same code have different result.
I am trying to make a row with 3 operators, The panel Works fine , The menu Dont resize the element and act weird.
Here a screenshot and a question about it ::::
blenderartists.org/t/layout-error/1279457
I am also trying to set a property in the menu,
I thought that that could be done in the same way i did for operators, but no.
Here a screenshot and a question about it :::
blenderartists.org/t/using-button-to-set-property-in-operators-menu-panels-b-290/1284432
Thanks for your time

1_conscience_0_dimen Answered me a solution.
Basically the layout work differently but
we can call the menu in this different way to keep the right layout.
He posted me this script that show the behaviour.
You can see it in the link above too
import bpy

###Panel
class PANEL_PT_Menu(bpy.types.Panel):
    bl_label = "panel menu"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "0data"  # to hide it. bl_context = "object" to show it in props
    bl_options = {'DEFAULT_CLOSED'}

    def draw(self, context):
        layout = self.layout
        layout.label(text="The Menu you want as a panel")

####call as an operator
class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    def execute(self, context):
        bpy.ops.wm.call_panel(name='PANEL_PT_Menu', keep_open=True)
        return {'FINISHED'}

addon_keymaps = []

def register():
    bpy.utils.register_class(PANEL_PT_Menu)
    bpy.utils.register_class(SimpleOperator)

    wm = bpy.context.window_manager

    if wm.keyconfigs.addon: #### call it from a key

        km = wm.keyconfigs.addon.keymaps.new(name = '3D View Generic', space_type = 'VIEW_3D')
        kmi = km.keymap_items.new(idname='wm.call_panel', type='Q', value='PRESS', alt=True)
        kmi.properties.name = "PANEL_PT_Menu"
        addon_keymaps.append((km, kmi))

def unregister():
    bpy.utils.unregister_class(PANEL_PT_Menu)
    bpy.utils.unregister_class(SimpleOperator)

    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()

    # test call
    bpy.ops.object.simple_operator()


How do I make bevel equal on both sides of the edge? I am new to Blender and learning little as I go. I notice that when I bevel on a cube's edge with n-segments, the effect is a nice even bevel (quarter circle). However, if I make a rectangle (as shown on the picture) the bevel is longer on the longest face and almost non-existent on the shorter face. Is there a way to make a nice round bevel that creates quarter circle on the edge? I would like to make a rounded rectangle.
Thanks.

It's because your object has non-uniform scale.

First, go to the object mode. Then press Ctrl + A -> Rotation & scale (object-apply)

Then try again


Final render looks different than preview render I am working on a tutorial for a snow globe and when I finished and went to render, the outer transparent globe object I made is darker than the preview. I want it to look like it does for the preview version. I'm not sure why it is doing this and any help would be appreciated. Refer to the photos below for what it looks like rendered vs. the preview render. Thank you

Yeah, usually that type of darkness is caused by the volume scatter or volume absorption being too dense. As mentioned, I don't know why the view is different from the render, but altering the settings of the volume absorption and scatter will help correct it.


Access Mapping node with python Have problem similar to this but that workaround does not work for me.
Empty bpy.data.node_groups

I need to access mapping node with Python so I can change values. This code worked for several times I used script but suddenly it does not work anymore.

bpy.data.node_groups["NodeGroup"].nodes["Mapping"].rotation[2] = math.radians(180)

Also looking at python output when changing values manually and looking at tooltip path output I should use something like this.

bpy.data.node_groups["Shader NodeTree"].nodes["Mapping"].rotation[2] = math.radians(180)

But I get error that Shader Nodetree does not exist.

Can anyone explain what is going on here, am I missing something here?

Since Mapping is a shader tree node, a 'material reference' is required:

import bpy
import math

# get the material
mat = bpy.data.materials['Material']

# get all material nodes
nodes = mat.node_tree.nodes

# get the mapping node
map_node = nodes.get("Mapping")

# set the rotation z component
map_node.rotation[2] = math.radians(180)

Direct access:

rot_z = math.radians(180)
bpy.data.materials['Material'].node_tree.nodes['Mapping'].rotation[2] = rot_z

Result:

Other properties

# set the vector type to 'TEXTURE'`, 'POINT', 'VECTOR' or 'NORMAL'
map_node.vector_type = "NORMAL"

# set the location components
map_node.translation = (0, 1, 3)

# set scale values
map_node.scale = (1, 0.5, 1)

# use minimum clipping value
map_node.use_min = True
map_node.min = (1,1,1)

# use max clipping value
map_node.use_max = True
map_node.max = (0,0,1)

Result:

For the world environment it's basically the same:

# get the world
world = bpy.data.worlds['World']

# get all material nodes
nodes = world.node_tree.nodes

# get the mapping node
map_node = nodes.get("Mapping")

# set the rotation z component
map_node.rotation[2] = math.radians(180)

Direct access:

rot_z = math.radians(180)
bpy.data.worlds['World'].node_tree.nodes["Mapping"].rotation[2] = rot_z

Result:


Getting rid of theses overlapping edges to form a solid shape? How would I go about cleaning this up and creating this into just one unified solid shape?

You can select the vertices that you want to merge and press Alt-M.  Select to center.


Show addon tab panel in just the Compositor, not in Shader Editor How can I only place the panel in the compositor NOT the shader editor as doing bl_space_type = 'NODE_EDITOR' doesn't specify a specific node editor and places it in both?
Relevant code portion:
class ExamplePanel(bpy.types.Panel):
    """Creates a Panel in the Node Compositing window"""
    bl_label = "MyTab"
    bl_idname = "OBJECT_PT_my_tab_pnl"
    bl_space_type = 'NODE_EDITOR'
    bl_region_type = 'UI'
    bl_context = "View"
    bl_category = "My Panel"

You can add a poll function:
@classmethod
def poll(cls, context):
    snode = context.space_data
    return snode.tree_type == 'CompositorNodeTree'


How do I extrude an imported svg along the z axis without clipping the original shapes? I have imported an svg and I am using the tutorials here: http://spolearninglab.com/curriculum/software/3d_modeling/blender/blender_02.html

and here:
https://studiogreenleaf.wordpress.com/2013/11/23/inkscape-to-blender/

It seems pretty straightforward, and I even got it to work with one shape, but other shapes are truncated or clipped in strange ways.

For instance, this original svg is simple:

But then when I import it into blender using the above method I get this:

Another one I have is even more strange.  Original:

But then in blender using import svg and extrusion:

Would love to know what I am doing wrong here!  I have gone over both articles several times and not really sure what else to try.

Thanks!

EDIT:  Here are the svg files for reference -

http://elephantlaboratories.com/svg/sol-energy-node.svg

http://elephantlaboratories.com/svg/sol-transmit-tower.svg

This sort of thing can happen when your object has a very extreme scale.

To fix it, apply the scale with ⎈ CtrlA> Apply Scale.

When you scale an object in object mode the mesh data is not changed, but it will be distorted according to the scale in a non-destructive way (like a modifier). Since your object was scaled up by such a huge amount, it caused some distortion; probably due to precision error.


Add a glow effect around the Earth I created this earth using cycles can anybody tell me how to add a glow effects to it and also if anything could be done to make it better.

Disclaimer: I just learned this myself, so @NoviceInDisguise can edit it if needed.

1

Create a bright point of light in your scene. This would be planet earth- already created in your case. Glare can't happen without a target.

Render the image.

2

At the top of your screen, change the screen layout mode to be compositing. Once done, you may need to check a little box in the node editor that says use nodes.

3

Add a glare filter between the image input and the finished output. Optionally you may add a viewer node at the end of the string so you can see the image in the node editor. In order for a viewer node to be active, you need to check Backdrop. It's located near use nodes.

Set the glare mode to fog glow.

4

Mess with the settings on the glare node until you have a perfectly glowing planet.


Texture Paint not working right? I made a model in Blender, and went into Texture Paint mode to give it some color and whatnot. When I painted it, though, not only does the paint appear where I want it to, it appears almost everywhere else! I turned off symmetry and it still does this, can anyone help?

Texture paint means to hand paint with color, brushes etc over a texture applied to a UV mapped surface.

So, you must have a UV map, and then assign the texture to the UV map. This gives you a lot of choice to wht part of the texture is assigned to which UV face. You could also decide (or get) to have the same texture over all the UV faces (eg: a cube with a logo on all faces). If you have this or similar situation, when uyou paint in the viewport over the faces, you paint over a texture that is also mapped to other faces, so, you paint goes everywhere...

see this

or a simple cube

Try to see your UV map in the UV/image editor, and check which UV face is mapped to which texture part, berfore painting. Practice with a simple cuve first, and try what happens by

just creating a new uvmap in the object data panel on the right, "plus" button
instead, pressing u over the object in edit mode, all faces selected, and choosing different options

eg: selecting smart UV projection

you get something that behaves probably more as you intend...


Blender VSE Driver deleted when strip is copied or duplicated I need some insight or solution. In Blender VSE I have some transform strips with driver linked with another strip. Now I need to duplicate the transform strip with the driver. When I duplicate it, the driver is gone. How to resolve it or what is actually causing it? Is there any script or addon to deal with it?
Thanks in advance!

Observation: It creates new object and not instance while duplicating.

The driver is not copied as the f-curve would have to be copied and the devs don't like to duplicate f-curves (as that gets quite messy).

Instead simply hover over the driver value in the first strip, right click and select "copy driver".
Go to the same value in the copied strip and right click then select "paste driver".

Remember that to see drivers update in the VSE you must either hit play or the button labeled "Update Sequencer" in the VSE timeline.


Cloth simulation pulling skirt upward I wish I was joking. I have this skirt that I want to make it look more like a skirt using the cloth simulation thing but instead of pulling it downwards and giving it some folds, it pulls it upwards and is spiky. Using the cloth presets (silk, leather, etc) don't really change anything. I tried erasing the weight paint at the top and it still didn't work.
I'm wondering if some of the settings I used is making it this way?

EDIT: Added screenshots of the geometry

For cloth collision (and, indeed, any collision in Blender) it is important to ensure that the simulation starts without the meshes overlapping - otherwise they will instantly repel and can cause unpredicted results.

With cloth, if the ‘garments’ are intended to be quite tightly fitting you can use sewing springs or cloth shrinking to bring the garment together around the model once the simulation starts. Those options are found within the Cloth Sewing Springs panel.


How do I make this render look better? I cant manage to get the right render settings for this image.

if you look at the render closely you cant see the poor quality. The denoiser in blender makes the image look smudged.

Here's the project file. You can mess around with it and see the results you get. Let me know what you did so I can make my render better.

https://www.dropbox.com/s/bs1pcaw78af2rvo/forest2.blend?dl=0

To get rid of the noise in the volumetric you would need to increase the number of samples considerably and this is probably not practical as it already takes a considerable amount of time to render.

There are things you could do to improve the render times.

The volumetric domain is quite a bit larger than it needs to be. You could scale it down in the X dimension to that it is sufficiently around the lightening but not too far towards the camera or too far behind. This will reduce the volume that rays need to pass through it, considerably improving render times
The trees are very high detail with many polygons and transparency - you could simplify the trees to reduce the number of faces. Possibly even rendering a small set of trees and adding them to the scene as an image plane, layering multiple trees to get the complexity.
The lightening seems to be very high poly - with 6 levels of subdivision. You could re-model the lightening with better geometry to considerably reduce the polygon count.

However, you would still require a large number of samples to resolve the noise - you're already rendering at 800 samples and may need to increase that by a factor of 10 or more to start to resolve the noise to satisfactory levels.

An alternative is to remove the volumetrics entirely and, instead, use the compositor to add the effect of the scatter using Blur and Fog Glow effects.

To demonstrate, I rendered out your image as two separate layers - the lightening :

And the trees (but note that the trees have not rendered with the same detail as your sample image - I believe this is due to your images for the pine needle leaves not being packed into the Blend file). It should be sufficient for the demonstration though :

The 'brightness' of the lightening is actually due to two distinct effects - the 'scattering' in the atmosphere (which makes the sky appear brighter around the flash) and the 'glare' in the lens (whether camera lens or the eye). The main distinction being that the 'scattering' light will be behind the trees while the 'glare' is in the lens and so can appear in front of the trees.

This can be achieved with the following compositor nodes :

This is a fairly simple setup and some additional tweaks could produce better results (such as feathering the edges of the mask with a blur and shrink/grow for better transition between trees and sky).

Essentially, this setup uses the Depth pass of the trees to generate a mask that can be used to separate sky from trees. A Blur node spreads the light from the lightening to mimic the scattering (the Darken node cuts down the amount of light since the emission is too strong and would 'white out' the entire sky). The mask is then used to mix in the lightening behind the trees and glare added and the brightening of the sky (when unmasked) is added in.

You can adjust the Factor of the Darken node, the Threshold of the Glare and the dimensions of the Blur to tweak the effects.

This produces the following result :


How to check if all my faces on mesh are all quads using a script I was keen on finding a python script that checks if all my meshes faces are quads.

pseudocode:

nonquad = 0
for i in selected_facelist:
    if count(selected_facelist.verts) > 4:
       nonquad +=1
print "Found :",nonquad,"Non Quads"

I dont know the API for THE CURRENT Blender 2.8. Any help is much appreciated

or if there is a pre-built button in blender.

I suppose your goal here is not for the script, as you say "or if there is a pre-build button".

So in edit mode, set the selection mode to 'face', select any quad and use the menu "Select/Select similar/Polygon Sides".

Once done you have all the quads, simply invert the selection with CtrlI to obtain non quad polygons.

The selection operators are dependent on the selection mode (vertex, edge, face), have a look at the menu for each case.

You may also want to select 'all by traits' to know if there is non manifold parts or loose geometry in your model.

If needed a commented script:

import bpy

# Go to object mode so that we can select
bpy.ops.object.mode_set(mode = 'OBJECT')

# Get active object
obj = bpy.context.active_object

# Select non quad faces (polygons)
for p in obj.data.polygons:
    p.select = len(p.vertices) != 4

# Go in edit mode to show the result
bpy.ops.object.mode_set(mode = 'EDIT')


Help unbind all materials from selected object i hope someone can help me, is it possible in python to give object e.g. "Sphere" its own materials? (single-user option)
I hope someone can help me.
(Blender 2.92.0)

Try this, it affects all selected objects.
import bpy
for ob in bpy.context.selected_objects:
    for ms in ob.material_slots:
        if ms.material and ms.material.users > 1:
            ms.material = ms.material.copy()

Note that it may not do what you expect if an object has two slots with the same material.


Cutting *only* existing geometry with a circle Is it possible to cut only the existing geometry of an object using a particular shape (for instance the circle in red) to add vertices only where the shape bisects an existing edge?

I will assume that you know how to use the Knife Project tool but if not, there are plenty of tutorials on BSE that can show you.

Here's a simple technique that might help you achieve what you're after:

Get everything ready to use the Knife Project tool but just before you do, select all of the vertices of the shape you want cut, and add them to a Vertex Group.  Once you do that, cut your shape out with the Knife Project tool.  You can then Deselect the vertices from your original Vertex Group and use the Dissolve Vertices feature to get rid of the unwanted vertices that you added with Knife Project:


How can I rig multiple identical legs efficiently? I need to rig a robot with 6 identical and symmetrical limbs. Is there some a more efficient way of accomplishing this than going through the trouble of going in and setting all the vertex groups individually? Ideally I'd rig one limb, then duplicate that to the other 5 limbs.

(Furthermore, I can't seem to get the bones to rotate properly as there is no Manipulate center points option in edit mode, so those angles seem to be off as well, which should end up falling out of whatever better method is here.)

Here is a link to the blend file:

Sadly the array modifier is not able to do this like it would be with the mirror modifier (copy Vertex Groups automatic) but I would make one Leg perfect (I would prefer the one on the X Axis) with a perfect Armature just for one leg and then duplicate and rotate the rig and the leg (together) to make the full robot. Try to join the armature and meshes together but I dont know if that works.
For the pivot point Problem move the start point of the bone to control the "center point".


Animate the parenting of an object let's say we have a magazine, a gun, and hands.

The magazine is parented with the gun. When I make an animation of reloading, I want the Magazine to be a parent of the hand, then after the magazine goes back into the gun I want the magazine to be parented with the gun again.

You can use two Child of constraint with an animated influences:

In the above gif, there are two animated empties. The cube follows Empty first, then switches to Empty.001.


Is it possible to scale F-Curves linearly? In the graph edutor, I press S then Y then 2. It doesn't multiply the x location of the key frames by 2. Instead, it multiplies every single key frame by a factor and I don't know what is this factor or what the equation is.
I added the generator modifier to an F-Curve. The original value of the X location = 1 (at a specific key frame). According to the equation in the modifier (Y = 1 X + 0). The, X location should not be changed (remains 1). But now it’s 201 and I don’t know why. I just would like to scale my F-Curve by a linear factor. How can I do this? I tried Factorized and Expanded polynomial but they are the same. Their equations give very high output numbers.

What scaling does depends on your pivot point for that graph editor viewport.  Try this: set your pivot point to 2D cursor.  Open a sidebar in the graph editor.  On the "view" tab, set the cursor location to 0,0.  Then select all and scale by 2.0 in the Y axis.  This will scale all the points about 0,0, which means multiplying all values by 2.  Is that what you want?
(Not at all clear what you expect to happen with your generator.  Again, the x in question here is frame count.  The X is an input, and if it's 201, it's because you're currently looking at frame 201.)


Everything is white in texture and material mode I cant see my textures in texture or material mode. Everything is white in the view port. Just recently did this start to happen. I dont even have a hemi light in the scene or any lights for that matter. I tried adding one with no luck. When Im in the rendered view port Everything shows up red. When I go into edit mode On an object I can FINALLY see its texture.
Am I doing something obviously wrong?

UPDATE: All of a sudden, Textured mode works normally with a single hemi as a light source, but material mode is still All white.

To Anyone who has this same problem, check your world ambient color. Mine got set to white somehow (I rarely use that tab) and after setting it to black everything went back to normal.


Organize imported objects by auto-generating similar named Collections and sorting So I'm importing an obj file that comes in as hundreds of separate meshes in the default collection.

Many of the meshes are imported with a similar name, but with a different ID number added in brackets at the end.

I would like to cycle through the default collection to find meshes with these similar names and add them to a new collection named after them.

My end goal would be to have these separated collections and be able to edit one objects materials and the ability to link all at once without scrolling through the long list that is default with the import.

    import bpy

"""
Input: Objects in Collection named "Collection"

Output: Like Named objects in separate collections with the same name

"""

"Initial setup; gets number of objects in Collection to cycle through"

Object_number=500;

"Compares one selected object from the outliner to another next to it"

for i in range(0,Object_number+1):
    a=bpy.context.object.name[0:10]

    bpy.ops.collection.objects_remove(collection="Collection")
    bpy.ops.outliner.select_walk(direction='DOWN')
    bpy.ops.outliner.item_activate(extend=False, deselect_all=True)
    b=bpy.context.object.name[0:10]
    bpy.ops.collection.objects_remove(collection="Collection")
    print(a)
    print(b)
    if a = b:
        bpy.ops.collection.create(name = a)
        bpy.ops.outliner.select_walk(direction='UP')
        bpy.ops.collection.object_add_active(collection = a)
    else
    i=i+1

My initial code scrolled through the outliner and compared the names of two adjacent objects. If the first 10 characters of the string were the same then it would attempt to add both to the collection of the same 10 character name.

Incredibly new to all this and would appreciate the knowledge behind scripting in blender!

You can do it this way. The code is fully commented but ask if something is not clear enough.

import bpy

#Get the collection the objects are
original_collection = bpy.data.collections['Collection']

#Get the root collection
scene_collection = bpy.context.scene.collection

#This dictionary will contain the collections that will be created
#The key is the object's name
dictionary = {}

#Loop over the objects
for obj in original_collection.objects:
    name = obj.name[0:10] # Get the root name (the way you need to)
    collection = dictionary.get(name) #Look if there is already a collection
    if not collection:
        #If not create it
        collection = bpy.data.collections.new(name)
        #Link it to the scene
        scene_collection.children.link(collection)
        #Keep it in the dictionary
        dictionary[name] = collection
    #Link the object to the new collection
    collection.objects.link(obj)
    #Unlink it from the original one
    original_collection.objects.unlink(obj)


How to flatten surface? my problem is the following: I am making Blender Guru's Chair Tutorial Series and I want to have a flat edge, but it makes this round shape and messes up my surface.
Thanks in advance,
Tobi

It looks like an inverted normal to me. Go into edit mode, hit A to select everything then hit Shift+N to recalculate the normals.


I would like to generate a particle star field that I could keep as static background I've tried the particle system to generate a star field and it works fine for single frame renders.  Now I'm working on a 10 second film logo splash and I cannot get the star field to remain static while the camera moves.  I've searched and read many posts including a prior posts here about baking but I cannot figure out how to grab a single frame instance of the falling particle objects and make it static for a full 10 vid.

I have gotten a static field but the mesh is in the way and I cannot see through the object, just the outside and the emitted objects on the outside of the mesh. When I move the mesh with key frames the star field moves also.   Any ideas.

I have gotten a static field but the mesh is in the way and I cannot see through the object, ...

To hide the emitter uncheck the Emitter option in the render panel:

Unfortunatley it is not possible to fully freeze the physic simulation. The minimum timestep is 0.001/frame.

If you're using objects for your particles you can press CTRLSHIFTA or search Make Duplicates Real from the search menu (SPACE in the viewport) to create static duplicates.

If you're not using objects you could still

Create an object with a single vertex at (0.0,0.0,0.0) and use it for the particles.
Duplicate these vertices with CTRLSHIFTA
Apply a halo material to the single vertex object and remove the particle system.

To simpify this, you may use this script

import bpy
#creates a mesh object
#from the selected particle system
#from the current frame

obj=bpy.context.active_object

ps=obj.particle_systems[0]

count=0
for pl in ps.particles:
    if pl.alive_state=='ALIVE':
        count+=1

mesh=bpy.data.meshes.new('point_cloud')
mesh.vertices.add(count)

for i in range(count):
    mesh.vertices[i].co=ps.particles[i].location

dupli=bpy.data.objects.new('point_cloud',mesh)
bpy.context.scene.objects.link(dupli)

You could also write the cache to disk by enabling the option Disk Cache in the Cache panel and baking the simulation afterwards. With the default options a folder named blendcache_blendname will be created in the folder where the .blend-file is located.

In this folder the data for each frame is stored. The template/scheme is filename_frame_subframe. Just copy your frame you want to be frozen and replace the following frames. The amount of particles should be constant in this time period. No particle should be born or die.

Afterwards enable the External option and choose blendcache_blendname as folder and filename as filename.


Interpolate movement by incremental steps I have a question for which I can't find an answer: I would like to move an object from one point to another along an axis, and I would like the movement to interpolate by increments (in my case the increment is 2). As an example, let's say that on frame 1, my object has Location X = 0, and on frame 10 it has Location X = 8. I would like it to interpolate its movement like this:
Frame 1 & 2: Location X constant at 0
Frame 3 & 4: Location X constant at 2
Frame 5 & 6: Location X constant at 4
Frame 7 & 8: Location X constant at 6
Frame 9 & 10: Location X constant at 8
That would create an interpolation curve that looks like stairs. Do you know any way to do this?

Select your keyframes in the Graph Editor and you can use Shift + Ctrl + M or use the menu Key -> Add F-Curve Modifier -> Stepped Interpolation.

The options for the modifier are in the N-panel.


change selection type for left click-drag So in blender 2.8 you can just click and drag to select multiple objects (a bit like box-select). I really like this because it just feels natural. However, at first this was as I described: click and drag would be like box-select, but after a while it changed to lasso-select in the Edit mode (in object mode it is still box-select) and now it even became something really different: if I now click and drag in edit mode, it will grab a vertex and drag it as if I pressed g.

I'm guessing that I somehow pressed a key-combination to change this setting. But I don't know what key I would have pressed and I really can't live with this. Does anyone know how to change this so I can go back to the box-select or lasso-select by clicking and dragging the cursor?

Thanks!

On the off-chance anyone still wants to know the answer to this: Blender's selection tool now supports four different selection modes, which are accessed from the top icon in the new Tools menu, on the left side of the screen. The click-and-drag option is the new default setting, and is just called "Select"; the tool can also be set to box selection, lasso selection and circle selection modes. There is, iirc, a keyboard shortcut to cycle through the options — which is presumably what Wohe1 pressed accidentally — but I can't remember it off the top of my head. However, if you run up against the same problem he/she did, you can rectify it by restoring your preferred setting, which you can do by clicking and holding on the Select tool icon and waiting until a little menu pops up with the four options.


Rigify N menu options missing, reloading the rig_ui.py doesn't help. Solution? I'm having the issue where the rifigy properties and layers are missing, however the normal solution mentioned here does not work:

Rigify rig main properties and rig layers disappeared

I was editing bone constraints and perhaps i accidentally altered the constraint on a rig which i undid. But i recall that being one of the last things i did before i noticed the problem.

Here's the file with just the rig in it. No model needed to demonstrate the problem.

>>Problem Rig file<<

How could i get the menus back while keeping my current rig intact?

This particular problem was caused by deleting the rig_ui.py file and replacing it with the rig_ui.py file generated in a different file. The rigify plugin creates and executes the script which is partly specific to the rigify rig that it's generated with. It's found in the scripting tab.

The problem is solved by going to the scripting tab, and checking a specific line in the 'rig_ui.py' script.
On line 6, where it says 'rig_id =' there should be within quotes, a specific code that should match the code found on your rig.

To find your rig's ID, select your rig and check the rig properties. Underneath 'Custom properties' copy the 'rig_id' code. Check to see whether it matches the code mentioned in the rig_ui.py script. If it doesn't match, that's the problem, so delete the code inside of the quotes. Paste in your rig's ACTUAL id in the code, inside of the quotes next to 'rig_id ='.

Now hit 'Run script' on the toolbar below and the buttons on the N menu should return.


Alternative to deepcopy for bpy_struct? I'm writing a script to animate tex characters morphing from one character to another. To make it look smooth, I want to sort the splines in the spline collection within curve data. I'm running into trouble because bpy_struct (the parent class of spline) is read-only, and the copy methods also don't work on bpy_struct.

A test case that shows the error I get:

import bpy
from copy import deepcopy

obj = bpy.context.object

copied_obj = deepcopy(obj)

The error is bpy_struct.__new__(type): expected a single argument.

If this can't be done easily, it would also help me if there were a way to use list methods on bpy_prop_collection instances, specifically sorting.

My plan right now is to create my own classes that mimic the classes I want to sort/copy, then deal directly with the basic data types. But I would... prefer not to do that if possible.

Deepcopy is not supported as the Blender objects are optimized for performance.
Most objects have the option, to create a copy by using .copy method

obj = bpy.context.object
copied_obj = obj.copy()

Please note that .copy will also create a new object in the scene (same as duplicate).
Making a fully detached copy of an object, you need to do yourself. as you will by then make a local copy of everything in the python interpreter.

In these cases it is best to do it manual and only select the data you need so the performance can be controlled better.


How can I create an object that fits in the gap of another object? I decided I wanted slots in the checkpoints for a number plate to
slide through and it to hold. It is a checkpoint for a mini drone
race I am doing. I basically want the "T" looking piece to be a gap
in the circle and I will need to create a plate that will fit in the
gap. Can anyone help me figure out how to join the 2 rectangles and
make them a gap inside the circle.

Also, someone mentioned the print would be too small. I could scale
it in simplify 3d, but is there a way to scale it using blender?
Also, Is there any way to measure the gap so the sliding in pieces
fit tight? I downloaded the plug-in "Measure it" but am having
issues figuring it out. It's a lot to take in, but with some
previous help I am learning a lot and hopefully one day be able to
help someone else out with a problem! Thanks

This type of cutting actually doesn't require doing a boolean. You can use Knife Project instead.

First, using your T-shaped piece as a starting point, model a flat piece that is the same shape when viewed from the side. You can snap to verts while constraining the axes to do this.

Then, separate this into its own object. This object will cut into your circular one, so first select the cutter object and then Shift-select the circular one that will be cut (order of selection matters).

Tab into Edit Mode and Hide the parts of the mesh you won't be cutting (the T-shaped piece).

Select All, view from the side, and click Knife Project. Enable the Cut Through option in the Operator Panel.

You will end up with a nice clean cut in your mesh.

You can then delete these faces and fill them in however you like.


How can I recreate this diamond cut texture surface like on certain flashlights? I was wondering if there was a way to recreate this sort of texture on a cylinder.
I don't know if it's an actual texture or an actual surface.

You can do it both ways by model or faking the geometry by using a texture.

Starting with a plane extrude two edges so that you get a model like:

Add two Array Modifiers to create a grid:

Apply the modifiers and cut out the part you want to use, then scale it so that the tiles get the diamond shape. I've also selected the faces (by similar area) and beveled them Ctrl-B:

Add again an Array modifier and a Curve modifier:

Now you can decide to use it as geometry or bake it to a texture.


How do I rig a game asset for a state change? (Armoured/Normal/Damaged) I'm looking for a workflow...
I have a small tank mesh that I'm about to rig.
The game I'd like to create with it (in Unity) will require it to be either Armoured, normal, or damaged.  It may also require LODs.
What I'd like is to hide or unhide the different states of the tank, but still use the minimum number of bones.  For example: The turret that turns uses one bone, but has the normal mesh unhidden, and the armoured and damaged meshes hidden, with all turret's different mesh states using the same bone.
I'm planning that the meshes can be unhidden or hidden when needed in Unity depending on the situation.
With all that in mind I'd like to rig this tank properly in Blender so that it's Unity-ready.
Does anyone know a way to do this?
Here's what I understand already:

Unity only imports bones and blend shapes from a rig. All other modifiers are ignored, so don't use them.
LODs require a name change for Unity to automatically register them.

I'd say (without knowing fizzle about Unity) that your best shot would be shape keys, but...
If I had to do it with a bone in blender animating, I'd try driving object visibility or material transparency by a bone's position/rotation with a greater-than statement.
Working from my knowledge of the BGE which may or may not be similar to Unity (I have a DeLorion), I'd say you should have a script switch out the meshes based on the bone.
Cute tank BTW.


Polygonal darkness appearing in render I am following this BlenderGuru tutorial on making an asteroid and when it comes to rendering the scene I get an unwanted "shadow". The shadow starts to appear in frame 36 of the render (but is clearer in frame 40) and i do not know what i have done wrong. Here is the blend file.

The effect described here is clearly visible in the right top corner, like a polygonal darkness.

Two ways to solve this

1  scale down the space_backdrop sphere so it fits inside the camera clipping bounds

2
Set the viewing mode to shaded (press Z again), and you can clearly see it's not a shadow but a feature of the clipping plane. Modify the Clipping End parameter (In Properties > Camera Settings) to be large enough to fit the whole scene.

it's difficult to see in wireframe mode:

to visualize the clipping plane, you enable 'limits' in the Display panel of the camera. View the scene from the side and zoom out to see how the limits indicator behaves as you adjust the End value


How to run a python script at regular intervals? Is it possible to run a script every few seconds or so, while letting the interface update in the meantime?

How can I do this?

See the Operator Modal Timer template in the Text Editor:

import bpy

class ModalTimerOperator(bpy.types.Operator):
    """Operator which runs its self from a timer"""
    bl_idname = "wm.modal_timer_operator"
    bl_label = "Modal Timer Operator"

    _timer = None

    def modal(self, context, event):
        if event.type == 'ESC':
            return self.cancel(context)

        if event.type == 'TIMER':
            # change theme color, silly!
            color = context.user_preferences.themes[0].view_3d.space.gradients.high_gradient
            color.s = 1.0
            color.h += 0.01

        return {'PASS_THROUGH'}

    def execute(self, context):
        self._timer = context.window_manager.event_timer_add(0.1, context.window)
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        context.window_manager.event_timer_remove(self._timer)
        return {'CANCELLED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.wm.modal_timer_operator()

You can specify the interval for the 'TIMER' event, but note that all active timers will be caught (there is no way to distinguish them).

The timer class also comes with some handy attributes:

if event.type == 'TIMER':
    print (self._timer.time_duration) # elapsed time since the operator call
    print (self._timer.time_delta)    # elapsed time since the last step
    ...

Beware of using threads, they can crash Blender.


Clear saved filepath I am writing an addon that uses linked libraries. In order to refresh the linked node groups you need to close and reopen blender. I am using some code from the Amaranth addon that I modified. Normally Amaranth prompts the user to save if they haven't yet. I would rather the the file be auto saved in a temp file, closed, then reopened. I have all of this functionality done.

My problem lies with the fact that now when the user goes to save it will save the temp file. I want to know if there is a way to clear the location it will save in?

I found bpy.data.filepath but it is read-only. I need a way to clear this so when a user presses CTRL + S it doesn't save in a weird location.

My operator is here:

class NGLRefresh(Operator):
    bl_label = "Refresh"
    bl_idname = "ngl.refresh"
    bl_description = "Relinks the nodes from the library file (saves and reloads)"

    temp_path = bpy.utils.script_path_user() + os.sep + "NGL_TEMP_FILE.blend"

    # A huge thanks to Pablo Vazquez
    # for the code from Amaranth (https://github.com/venomgfx/amaranth)

    def save_reload(self, context, path):
        if not path:
            bpy.ops.wm.save_as_mainfile(filepath=self.temp_path)
            bpy.ops.wm.open_mainfile(filepath=self.temp_path)
            return
        bpy.ops.wm.save_mainfile()
        self.report({"INFO"}, "Saved & Reloaded")
        bpy.ops.wm.open_mainfile("EXEC_DEFAULT", filepath=path)

    def execute(self, context):
        path = bpy.data.filepath
        self.save_reload(context, path)

        # Remove temp file if necessary
        if os.path.exists(self.temp_path):
            os.remove(self.temp_path)

        return {"FINISHED"}

You need to save the original path so you can use it later. This can be done by adding a StringProperty to store it.

bpy.types.Scene.orig_path = bpy.props.StringProperty()

As you can't alter the filepath, you could try setting up an app.handler.save_pre to check this property before saving a blend file, if it is there then use save_as_mainfile() to save it using the old path name. The gotcha here is that you could be interfering with the user choosing 'save as'.

The drawback to this approach is the user will see the tmp path in between your operator and choosing to save, so you may want to stick with having to save before your operator is run.

I think a better approach would be to create an addon preference that allows the user to enable saving the blend file before your operator runs, then if enabled you can simply save the blendfile and reload without any issues. If the user has not enabled it then prompt them to save and reload.


How to Automatically copy keyframe from one object to other with one step I am struggling about a week figuring out how to do this.
For example i have 5 objects, for the object1 I put visibility on 1 frame and invisible on 2 frame.
then i need all other objects to have the same keyframes but with the 1 framestep from previous
1-frame we see object 1, 2-frame we see object 2 and further.

ok, here is a python solution:
result looks like this: https://youtu.be/HsVNCyuWyDY
what you have to do:
Create a collection with the name "Automatic_frame_visibility" and put all your objects in there.
After running the script and starting your animation, each object will be visible in the order of the collection with one frame visibility.

python script:
import bpy

def frame_handler(scene, depsgraph):
    counter = 0

    for eachObject in list:
        if scene.frame_current - 1 == counter:
            eachObject.hide_render = False
            eachObject.hide_viewport = False
        else:
            eachObject.hide_render = True
            eachObject.hide_viewport = True
        counter += 1

print ("-------- Script started")

bpy.app.handlers.frame_change_pre.clear()
bpy.app.handlers.frame_change_pre.append(frame_handler)

list = []

for eachObject in bpy.data.collections['Automatic_frame_visibility'].objects:
   list.append(eachObject)


How Do I Create a self drawing 2D Shape? Major Noob Question here but I want to create a 2d shape that seems to draw itself like in this video below:
https://www.youtube.com/watch?v=YLNmtk67unY

I saw in KaptainKrisitan's videos and wanted to replicate in blender, but I don't have a clue how.

Here is a simple way to make a drawing... draw itself:

draw a curve as your handwritten shape, or use Grease Pencil to draw your word, and then convert the drawing to a curve. See here:

Then you have (at least) two ways:

Use a mesh to create the writing depth, through arrays (fit length) and other modifiers: curve follow, subsurf. Then animating the "fit length" array parameter you can make it draw itself...

Here's how:

Use another (curve) shape as bevel object for the first curve. Then animating the bevel "end factor" you can make it draw itself...

Like this:

This becomes a 3D writing because the bevel object is a 2D curve circle, but you can also get a 2D animated writing using a 1D curve as bevel object, like this: