text:
Cannot get File Path input to work SNLite in Sverchok addon
I am trying to write a script to use in the Sverchok addon, that utilizes a file path input, but I am having trouble making this work.
Here is my script:
"""
in path FP
out Attibute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np

path2 = path

gpd1 = gpd.read_file(path2, layer = "test shapes - polygons 1")

# call geo interface method on geodataframe
gi = gpd1.__geo_interface__

# variable to control which attribute is being extracted
variableAttribute = 'Integer'

# create empty list to add attributes to
listAttribute = []

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]

    listAttribute.append(value)

Attribute = listAttribute

Here is a screenshot of my node setup:

For some reason, the filepath input works in a basic script (see the 'test_filepath1.py' in the screenshot). But, when trying to implement this in a more complex script, I cannot make this work.
Here is a zip file with sample data, blend file, and scripts: https://drive.google.com/file/d/1GZMr7hYXxMN8YJNQ2lIls4B7O_ANEI1F/view?usp=sharing
Any ideas or info on why this isn't working? Thanks,

In your example code there is a variable-name-typo (results in an Exception; Attribute vs Attibute, but after that's fixed there's still some things to explain.
"""
in path FP
out Attribute s
"""

import geopandas as gpd
import pandas as pd
import fiona
import numpy as np

gpd1 = gpd.read_file(path, layer = "test shapes - polygons 1")
gi = gpd1.__geo_interface__
variableAttribute = 'Integer'

# loop through geointerface (gi) and extract values from the 'Integer' column, and add them to the list created above
for features in range(len(gi['features'])):
    value = [gi['features'][features]['properties'][variableAttribute]]
    Attribute.append(value)

If you have the command prompt open or the info panel, you might be able to see the nature of the error if you enable "raise error to treelevel" from the N panel of the node.

Usually this will be enough to show the error/exception right beside the node in the nodeview.

Additionally, when connected to a Filepath node, the content of the socket will be wrapped by two sets of square brackets (this is the nature of the FilePath socket stream). Something like
[["D:\my_file.txt"]]

in that case your gpd.read_file function line should read something like
gpd1 = gpd.read_file(path[0][0], layer = "test shapes - polygons 1")

Thanks for catching that typo, unfortunately fixing it did not make the script work. I tried some of your other suggestions here, but am still cannot get the file path to work.


text:
Is this face topology good for animation?

Is the topology in this image good for animation. And can I move on to professional level with this kind of modeling

Counting 2 visible Ngons and 2 visible topological errors on quads and loops

You should avoid tris and ngons in your geometry, even if its a game model (its ok for mobile game models though - depends on polycount)

The meshflow is ok, its not good around the nostrils. Here is a good edgeflow that I recommend, its from a Zbrush course:

 Source: Zbrush workshop with Ryan Kingslien
 Direct Source: Workshops with Ryan Kingslien
 Probably the Anatomy Of The Face (no guarantee)
You will know when you are ready for professional level, someone will just employ you. There are different levels among professionals too. Just practice and your confidence level will increase. You are basically ready when you know what you are doing.

Jerryno, could you please post a link to the Z-Brush course you've mentioned. Thanks.

@Gonzou I pulled this from my reference folder but I look it up.

Your answer is very encouraging. I'll do my best. Thanks.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Add-on UI won't display!
So I came across a little pickle whilst making a addon. I was making a "create object" type tool, which had a lofty number of custom properties, so I wanted both to organize it, and to figure out how to add a UI dropdown box that would allow to pick meshes from the scene, and re-use them as base meshes.
I did research as to how to make custom UI in my addons via the draw() function. I then implemented it, (The way I thought it worked.) and when I executed the custom addon, the custom tool WORKED but there were no bpy.props displayed. Here's my code at the time: (This isn't meant to have a toolbar hanging out in the 3d view all the time, but only show UI when the execute() function is called.)
#bl_info stuff here

import random
import bpy
from bpy.types import Operator, AddonPreferences

class makeamazingthing(Operator):
    bl_idname = "object.make_amazing_thing"
    bl_label = "Make Amazing Thing"
    bl_options = {'REGISTER','UNDO'}

    prop1 = bpy.props.BoolProperty(name="Cool Prop", default=True)

    def execute(self,context):
        bpy.ops.object.delete(use_global=False)
        return {'FINISHED'}

    @classmethod
    def poll(cls, context):     #  determine whether an object is active. (It's meant to replace base objects.)
        ob = context.active_object
        return ob is not None and ob.mode == 'OBJECT'

    def draw(self,context): #This is used to draw the layout.
        layout=self.layout
        box = layout.box()
        box.prop(self,'prop1')

def add_object_button(self,context):
    self.layout.operator(makeamazingthing.bl_idname, icon='PLUGIN')

def register():
    bpy.utils.register_class(makeamazingthing)
    bpy.types.INFO_MT_add.append(add_object_button)

def unregister():
    bpy.types.INFO_MT_add.remove(add_object_button)
    bpy.utils.unregister_class(makeamazingthing)

if __name__ == "__main__":
    register()

Ok, I'm sorry if that's too much information, but I put it all up there because I have no idea what the problem is!! I've been doing research all day, watching and reading tutorials, but I can't find an answer!
For one, I'm not sure what to put in box.prop(self,'something?') under the draw() func. All the tutorials seem to be referring to the actual names with underspaces, and that didn't work. Not sure if it should.
Also in the original classname I tried adding the Panel toolbox along with the Operator toolbox;
class makeamazingthing(bpy.types.Operator,bpy.types.Panel):

(I know I could've just used bpy.types, but I didn't want to redo everything in the script right away.)
Also when everything failed, I tried commenting out the whole draw() function, getting rid of bpy.types.Panel in the class declaration, and UI STILL isn't showing! I assumed I reverted it to it's original state, but I guess not, because it isn't working.
Again, this isn't supposed to hang out in the toolbar, the UI is only meant to appear beneath the 3d view toolbox whenever the tool is actually used.
So any help to get this working again, with or without the fancy UI would be much appreciated.
And... any help as to get that dropdown menu that would allow me to pick an object from the scene would be much appreciated as well, but that's a lesser priority right now.
Thanks in advance!!!!!!
EDIT: OK I figured out what's wrong, but I'm still a little stuck, and this can still be useful for others who come across the same issue!
so the problem was the poll function (after @classmethod) where it tests to see if an object is selected before allowing the execute() function to even be available.
At the end of the execute() function I was deleting the selected object.
Basically, I killed my own poll() function and caused it to collapse on itself.
So now... I need to figure out how to make a selected object contextually relevant in order to allow the tool to even be available for use in blender, and still manage to delete it near the end of execute()... without it flopping on itself.
I will continue digging, and my problem is virtually solved, but any help will still be much appreciated!

can you post your full code, because the code you posted does not run. wm_operator_invoke: invalid operator call 'OBJECT_OT_make_structure'

Sorry, I didn't repost my whole script because it's a bit long, but I fixed the posted code! And I figured out a bit from fixing it. Post has been updated.

OK, so I figured it out!
The poll() function was cutting out my UI, because it was checking if something was selected before allowing my addon to run, and I was deleting my selected object at the end of my execute() function.
Therefore, to fix it I simply selected one of the newly created objects (the original code creates several new objects) and THEN unlinked the original object. So something is always selected, therefore, poll() thinks the context is still correct, therefore letting my UI to continue displaying.

authors: Александр Скрипкин

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
How to select faces of a mesh and apply extrude using a python script
I am writing a python script to make a chair. I need to use the loopcut_slide() after that the extrude operators.  here is my code
    import bpy
import time
import mathutils
from mathutils import Vector
import numpy as np
start_time=time.time
from mathutils import *
from math import *
import random
D = bpy.data
C = bpy.context
#Clean the scene
bpy.ops.object.select_by_type(type='MESH')
#bpy.ops.object.delete()
bpy.ops.object.select_by_type(type='CAMERA')
bpy.ops.object.delete()
bpy.ops.object.select_by_type(type='LAMP')
bpy.ops.object.delete()
def view3d_find( return_area = False ):
    # returns first 3d view, normally we get from context
    for area in bpy.context.window.screen.areas:
        if area.type == 'VIEW_3D':
            v3d = area.spaces[0]
            rv3d = v3d.region_3d
            for region in area.regions:
                if region.type == 'WINDOW':
                    if return_area: return region, rv3d, v3d, area
                    return region, rv3d, v3d
    return None, None

#make a chair
D.objects["Cube"].scale[0] = .2
D.objects["Cube"].scale[1] = .2
D.objects["Cube"].scale[2] = 0.005

D.objects["Cube"].location[0] = 0
D.objects["Cube"].location[1] = 0
D.objects["Cube"].location[2] = 0

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

region, rv3d, v3d, area = view3d_find(True)
override = {
    'scene'  : bpy.context.scene,
    'region' : region,
    'area'   : area,
    'space'  : v3d
}

bpy.ops.mesh.loopcut_slide(override,MESH_OT_loopcut={"number_cuts":1, "smoothness":0, "falloff":'INVERSE_SQUARE', "edge_index":11, "mesh_select_mode_init":(True, False, False)}, TRANSFORM_OT_edge_slide={"value":-0.9, "single_side":False, "mirror":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "correct_uv":False, "release_confirm":False})
bpy.ops.mesh.loopcut_slide(override,MESH_OT_loopcut={"number_cuts":1, "smoothness":0, "falloff":'INVERSE_SQUARE', "edge_index":11, "mesh_select_mode_init":(True, False, False)}, TRANSFORM_OT_edge_slide={"value":-0.9, "single_side":False, "mirror":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "correct_uv":False, "release_confirm":False})
bpy.ops.mesh.loopcut_slide(override,MESH_OT_loopcut={"number_cuts":1, "smoothness":0, "falloff":'INVERSE_SQUARE', "edge_index":18, "mesh_select_mode_init":(True, False, False)}, TRANSFORM_OT_edge_slide={"value":-0.9, "single_side":False, "mirror":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "correct_uv":False, "release_confirm":False})
bpy.ops.mesh.loopcut_slide(override,MESH_OT_loopcut={"number_cuts":1, "smoothness":0, "falloff":'INVERSE_SQUARE', "edge_index":18, "mesh_select_mode_init":(True, False, False)}, TRANSFORM_OT_edge_slide={"value":0.9, "single_side":False, "mirror":False, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "correct_uv":False, "release_confirm":False})

bpy.ops.mesh.extrude_region_move(MESH_OT_extrude_region={"mirror":False}, TRANSFORM_OT_translate={"value":(0, 0, -0.191221), "constraint_axis":(False, False, True), "constraint_orientation":'NORMAL', "mirror":False, "proportional":'DISABLED', "proportional_edit_falloff":'SMOOTH', "proportional_size":1, "snap":False, "snap_target":'CLOSEST', "snap_point":(0, 0, 0), "snap_align":False, "snap_normal":(0, 0, 0), "gpencil_strokes":False, "texture_space":False, "remove_on_cancel":False, "release_confirm":False})

Now, I need to select faces and apply the extrude operator.

1) How to set the face select mode.
2) and how to select the 4 faces as shown in the figure below

This is not really a complete answer as it does not result in a complete chair but it covers the trickery you seem to need.
There are a few snafoos as I've copy/pasted from my own code base which treats a few features not present in your problem, it's useful code however so have at it I say.
The code is cut up so that I can describe what I'm doing but really it is a single script. So stitch it together and run it in blender then the chair button will appear at the base of the add mesh menu. Usefully I've split it up so that it may be made into a package aswell. So if you made each part into it's own file and resolved the imports as necessary you would have the start of a package. The double hash comments indicate what I'd call each file.
Imports
Imports gotta have imports. I use the bpy_extras methods as it provides you with a proper Scaling/Rotating/Translating matrix. It also does object/mesh (a.k.a data) registration within the scene. In prior question(s) of my own the more experienced guys indicated that they don't use this helper, I figure this gives the blender team some control over object creation in packages and therefore I use it. The rest of the imports are pretty standard stuff.
import bpy
import bpy_extras
import bmesh
from math      import *
from mathutils import *

Data
I do not fully utilize it here but these two methods allow for re-entrancy. That is you can edit the mesh after you've done something that breaks the history's breadcrumb trail. Usually I add an Edit Panel to facilitate this.
## utilities.py
def prop2data(prop, data) :
    """
    prop2data

    Given a PropertyGroup and ID-Data populate the latter from the former
    """
    for key in prop.rna_type.properties.keys() :
        if key in ["rna_type"] :
           continue
        if isinstance(getattr(prop, key), bpy.types.PropertyGroup) :
            if key not in data :
                data[key] = {}
            prop2data(getattr(prop, key), data[key])
        else:
            data[key] = getattr(prop, key)
            #print("{} : {} -> {}".format(key,getattr(prop, key),data[key]))

def data2prop(prop, data) :
    """
    data2prop

    Given a PropertyGroup and ID-Data populate the former from the latter
    """
    # The order of arguments matches prop2data this is deliberate and
    # indicates that the structure is traversed according to Property-
    # Group rather then ID-Data (Which should be preferred).
    for key in prop.rna_type.properties.keys() :
        if key in ["rna_type"] :
           continue
        if isinstance(getattr(prop, key), bpy.types.PropertyGroup) :
            if key in data and isinstance(data[key], dict):
                data2prop(getattr(prop, key), data[key])
        else:
            #print("{} : {} <- {}".format(key, data[key], getattr(prop, key)))
            setattr(prop, key, data[key])

Properties
I wrap all the properties for a given geometry into a pointer class for various purposes. It's helpful to pass these parameters into the data2prop and prop2data methods and to toss them into the geometry method for example.
## Properties
class chairProperties(bpy.types.PropertyGroup) :
    """Chair properties"""
    height     = bpy.props.FloatProperty(
                 name        = "Height",
                 description = "The total height",
                 default     =      1.0,
                 min         =      0.0,
                 #update      = _height_,
                 unit        = 'LENGTH')
    length     = bpy.props.FloatProperty(
                 name        = "Length",
                 description = "The total length",
                 default     =       3.5,
                 min         =       0.0,
                 unit        =  'LENGTH')
    width      = bpy.props.FloatProperty(
                 name        = "Width",
                 description = "The total width",
                 default     =       2.5,
                 min         =       0.0,
                 unit        =  'LENGTH')
    inset      = bpy.props.FloatProperty(
                 name        = "Inset depth",
                 description = "The depth of the inset",
                 default     =       0.5,
                 min         =       0.0,
                 unit        =  'LENGTH')

Geometry
This next section has quite a bit going on. Firstly we provide stock unit vectors lying along the principle axes. This is largely done so that you're not dropping plus and minus signs everywhere.
The selectPlane method does most of the magic, I wrap it into a function so I can cherry pick verts, edges or faces. One can then make sub-selections of that selection to decide what is or isn't extruded.
clearGeometry simply strips out any mesh data while preserving the object and object.data (mesh) data blocks.
chairGeometry populates the object.data with the geometry you require. Here you should note that when selectPlane is called you must use a location and normal vector that are rotated with the object's co-ordinates, the way you do this is different. For the location you're flinging a point about in 3 space. For the normal you're taking one of those principle vectors and flinging it about in 3 space, you then need to re-center it about a zero by subtracting a zero that you also flung about in 3 space. Finally the last trick is in the selections by using sets, fx and fy you can make sub-selections using set theory. fx&fy in this case selects the corner faces, 'fx|fy' would select the skirt, fx|fy-fx&fy the edges and 'go-fx|fy' would get the center. This provides quite a lot of flexibility. For the rest there is a little algebraic trickery to make the center of the object coincide with the base of the chair once everything is extruded. This is also used to select the appropriate faces.
## geometry.py
AXES = {'+X':Vector(( 1,0,0)), '+Y':Vector((0, 1,0)), '+Z':Vector((0,0, 1)),
        '-X':Vector((-1,0,0)), '-Y':Vector((0,-1,0)), '-Z':Vector((0,0,-1))}

def selectPlane(bm, normal = 'z', location = Vector((0,0,0)), feature = 'verts', tolerance = 0.1) : # bpy.context.active_object.location
    '''
    Select all the geometry within a plane described by a position and a normal
    '''
    normal = normal if isinstance(normal, Vector) else AXES[normal.upper()]
    if isinstance(feature, list) :
       return {key : planeSelect(bm, normal, feature, location, tolerance) for key in feature}
    else :
       return {'verts' : [vert for vert in bm.verts if abs(vert.co.__sub__(location).dot(normal)) < tolerance],
               'edges' : [],
               'faces' : [face for face in bm.faces if all([abs(vert.co.__sub__(location).dot(normal)) < tolerance for vert in face.verts])]}[feature]

def clearGeometry(sc, ob, me, ps):
    '''
    I understand to be the best method of clearing the mesh data
    '''
    bm = bmesh.new()
    bm.to_mesh(me)
    me.update()
    sc.update()

def chairGeometry(sc, ob, me, ps, matrix = Matrix.Identity(4)) :
    '''
    Create a Chair Shape
    '''
    bm = bmesh.new()
    # Provide Geomerty
    bmesh.ops.create_cube(bm, size=1.0, matrix=Matrix([[ps.length,       0,                   0,0],
                                                       [        0,ps.width,                   0,0],
                                                       [        0,       0,ps.height - ps.inset,0],
                                                       [        0,       0,                   0,1]]))
    # Lower Geometry
    cx = [-ps.length/2+ps.inset,ps.length/2-ps.inset]
    for x in cx :
        go = selectPlane(bm,
                         normal   = matrix*AXES['-Z'] - matrix*Vector((0,0,0)),
                         location = matrix*Vector((0, 0, -(ps.height - ps.inset)/2)),
                         feature  = 'faces')
        go = list({item for face in go for item in [face] + face.verts[:] + face.edges[:]})
        go = bmesh.ops.bisect_plane(bm, geom=go, plane_co=(x,0,0), plane_no=(1,0,0))
    cy = [-ps.width/2+ps.inset,ps.width/2-ps.inset]
    for y in cy :
        go = selectPlane(bm,
                         normal   = matrix*AXES['-Z'] - matrix*Vector((0,0,0)),
                         location = matrix*Vector((0, 0, -(ps.height - ps.inset)/2)),
                         feature  = 'faces')
        go = list({item for face in go for item in [face] + face.verts[:] + face.edges[:]})
        go = bmesh.ops.bisect_plane(bm, geom=go, plane_co=(0,y,0), plane_no=(0,1,0))
    go = selectPlane(bm,
                     normal   = matrix*AXES['+Z'] - matrix*Vector((0,0,0)),
                     location = matrix*Vector((0, 0, -(ps.height - ps.inset)/2)),
                     feature  = 'faces')
    fx = {face for face in go if any([v.co.x < min(cx) or v.co.x > max(cx) for v in face.verts])}
    fy = {face for face in go if any([v.co.y < min(cy) or v.co.y > max(cy) for v in face.verts])}
    # the next line is useful if the bmesh operator needs faces, edges and verts
    #go = [i for s in {[face] + face.edges[:] + face.verts[:] for face in fx|fy} for i in s]
    go = bmesh.ops.extrude_face_region(bm, geom=list(fx&fy))['geom']
    for v in list({item for item in go if isinstance(item,bmesh.types.BMVert)}) : v.co.z-= ps.inset
    # Update the Object
    bmesh.ops.transform(bm, matrix=Matrix.Translation((0,0,ps.height/2 + ps.inset/2))*matrix, verts=bm.verts)
    bm.to_mesh(me)
    bm.free()
    me.update()

Operator
Next we provide the operator blender will call. This really just wraps the Create/Review/Update/Delete Geometry methods in blender specific boilerplate.
## operators.py
class MESH_OT_primitive_chair_add(bpy.types.Operator, bpy_extras.object_utils.AddObjectHelper):
    """Creates and Modifies a simple Chair"""
    bl_idname      = "mesh.primitive_chair_add"
    bl_label       = "Add Chair"
    bl_description = "This operator creates a Chair"
    bl_options     = {'REGISTER', 'UNDO'}
    part           = "Furniture:Chair"

    instantiate = bpy.props.BoolProperty(   name        = "New Object",
                                            description = "Used internally to control Object Creation versus Modification. See Object Creation in the Project Readme",
                                            default     = True,
                                            options     = {'HIDDEN'})
    dimensions  = bpy.props.PointerProperty(name        = "Dimensions",
                                            type        = chairProperties)

    def execute(self, context):
        if not self.instantiate and context.active_object and 'part' in context.active_object.data.keys() :
            sc = context.scene
            ob = context.active_object
            me = ob.data
            ps = self.dimensions
            data2prop(ps, me['size'])
            clearGeometry(sc, ob, me, me['size'])
        else :
            sc = context.scene
            me = bpy.data.meshes.new(name="Chair")
            od = bpy_extras.object_utils.object_data_add(context, me, operator=self)
            ob = od.object
            ps = self.dimensions # Using either od.object.GEOMETRY (Object Registered Properties) or self.GEOMETRY (Operator Registered Properties) os sc.GEOMETRY (Scene Registered Properties)
            me['ID']   = 'Not Used'
            me['part'] = self.part,
            me['size'] = {} # Localized Data Store
        # Dimensions
        # Your would adjust the properties here to ensure the various contraints are met
        # Geometry
        prop2data(ps, me['size'])
        chairGeometry(sc, ob, me, ps)
        return {"FINISHED"}

Interface
The interface consists of a button at the end of the Add Mesh menu. This is not really the proper place for this but it'll do.
## interface.py
def addChairMenu(self, context) :
     self.layout.operator(MESH_OT_primitive_chair_add.bl_idname, text="Add Chair")

Registration
The last bit simply un/registers everything and provides the name of some one to shout at when it all goes pear shaped.
## __init__.py
bl_info = {
    "name"         : "Furniture",
    "author"       : "Carel",
    "version"      : (0, 1),
    "category"     : "User",
    "location"     : "View3D > Add > Furniture",
    "description"  : "This allows one to create various funriture, specifically a chair",
    "warning"      : "Alpha Release, may wobble",
 }

def register():
    # Properties
    bpy.utils.register_class(chairProperties)
    # Operator(s)
    bpy.utils.register_class(MESH_OT_primitive_chair_add)
    # Menu(s)
    bpy.types.INFO_MT_add.append(addChairMenu)

def unregister():
    # Menu(s)
    bpy.types.INFO_MT_add.remove(addChairMenu)
    # Operator(s)
    bpy.utils.register_class(MESH_OT_primitive_chair_add)
    # Properties
    bpy.utils.register_class(chairProperties)

if __name__ == "__main__" :
    register()

Notes
This code sort of stems from this question if you want to understand it better. There is also now a related question.


text:
My properties panel is horizontal, how do I turn it back to vertical?
I'm not entirely sure what happened, maybe a hit the wrong key. ut my properties bar is horizontal, it's playing hell with my ability to select anything that takes up a lot of vertical room (like modifiers).

How would I go about correcting this?

Rightclick in the panel, and pick Vertical

Wow, that was disgustingly simple. Thank you.

@douglasg14b i'm surprised it hasn't been asked before, not that I could find anyway


text:
Camera view pointer
how i change the pointer of camera view, i'm explain. in my blender, the camera view is vertical by default and not horizontall. as you can see the arrow is on the vertical side, it's supposed should be in horizontal side, thanks for you help!
pdta: sorry my english is not so good.

The camera gizmo just displays the ratio of Resolution X to Y.
Make X higher then Y and you'll get horizontal side
Render to print is the coolest addon to control output dimensions and it can swap layout in one click

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Gridlines doesn't show in topview anymore (np 7) in Blender 2.8 (Mac)?
How do I get gridlines shown in topview (np 7) in latest blender 2.8 for mac? I downloaded a new update and after I cant se the gridlines in topview anymore, what to do? I would be happy to be able to editing by this grids after subdivide objekt

Are you sure you didn't disable them? Check your Viewport Overlays settings, top right corner of 3D view.

Yes, Grid is checked but doesn't show anyway. Im new here and doesn't know how to add pics on the screen to the comments

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
F12 render appears pixelated
I press F12 to render the camera view, but I just get a pixelish version of the render.

Can somebody tell me how to change that?
I have already changed the object's "Render" Resolution to 100%.
Well, I have something to report now: When I use the middle mouse button to scroll out a little, the render appears a little smaller (seemingly at 100%), and it looks the way I expected. However, I wonder why that is that the render appears at like 125% for me instead of 100%.

Blender uses a very fast nearest interpolation, which sometimes looks pixelated when not viewed at 1:1. Press 1 on the numpad while viewing the render to view it at 1:1. This is the same thing which causes this in the VSE, see http://blender.stackexchange.com/q/22837/599

@gandalf3 I have changed my question and added that if I scroll out a little, it looks fine. Is your comment still valid then?

@JohannHesters Yep, my comment is saying that it looks fine at 100% (which is what it seems you discovered simultaneously)

This is an artifact of the interpolation method blender uses to display images. Image viewers which use other interpolation methods should display the image just fine.
The artifacts should disappear if you view the image at 100% (Numpad 1), so that no interpolation is needed.

authors: Cħoúroúk Děɱŏŋ


text:
Saving Blender Macro to file
I have used the Macro Recorder (http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Development/Macros_Recorder) to record some actions in Blender.
Does anybody know how I can save the macro to a file so that I can use it again even after having closed Blender?
Thank you very much!

The recorded macros are stored as small text blocks in the Text Editor as macro, Blender will incrementally add a numeric constant to these so take care to rename before saving. To execute the macro again, execute them from there.

Could you please add more info on where I find the Text Editor and how I can load it to another blender project?

@JohannHesters After saving the macro, look in the botton left corner of your screen, you will see an icon with 2 opposite arrows, click that and look for the text editor, or temporarily change your screen layout from Default to Scripting.


text:
Black window flashes then disappears when I start Blender 2.72
I've been looking for a solution to my problem for a few days without finding it, so I'm posting my question here hoping I'm in the right place.
I had Blender 2.68 working very well, and I wanted to switch to version 2.72. Because I have Windows Vista 32-bit, I downloaded the 32-bit .exe file, which installed without problems, but when I try to open Blender, a small black window opens and quickly closes and then nothing.
I don't know what might be causing this, your help would be welcome. Thanks in advance!
Cordially, Fred

Try to find help here, they might understand you (and you them): http://blenderclan.tuxfamily.org/html/modules/newbb/

Related: http://blender.stackexchange.com/q/2203/599

What happens if you download the zip version instead of the installer? To run it all you need to do is extract it somewhere and run the blender.exe file contained in the resulting directory.

It sounds like the blender Python console is opening, and encountering an error and crashing. Have you tried the classic uninstall/reinstall? Also, maybe try uninstalling 2.68 before opening 2.72 again.

Try running Blender from a command line; maybe then you'll be able to see an error of sorts.


text:
Change color with object rotation
I want to adjust the color of a material based on an object's rotation. I cannot do this with a driver, because the same material is used over a large number of objects: I would like each object to change color based on its own rotation value.
Is there a way to do this in either BI or Cycles? More generally, is there a way to change color based on an object property other than position?

I might be able to achieve this by playing with the world and object texture vectors.  I will see what I can do.

This question manipulates Normal values based on angle from another object, which could be an empty. http://blender.stackexchange.com/questions/47175/i-want-to-mix-cycles-shaders-based-on-self-shadow Not sure if it helps but could be hacked to avoid writing python?

Since blender 2.67 you can write a custom pynode or use Animation Nodes as shown below:

Note: Enable cycles first to access the color of the diffuse shader and use the expression node to get correct color values bellow 1.

Here's another much simpler solution using the Vector Transform node.

The Combine XYZ represents a vector that indicates the 'front' of the object (in this case along the -Y axis - the face of Suzanne). This passes through a Vector Transform node set to Normal (so that the Location and Scale are ignored in the transform, leaving only the Rotation). Color Mix nodes then scale by 0.5 and add 0.5 to convert the vector (ranging from -1.0 to 1.0) into color space (0.0 to 1.0).
This produces the following result.

Note that this method isn't capturing the 'true' rotation Euler values but, instead, how one particular 'face' of the object is pointed. Rotating around the direction vector (in this case, rotating Suzanne around the Y axis) will result in no change in color but any other rotation will affect the resultant color.

Is it possible to use this setup with object rotated by rig? Seems like it heavily depends on origin point

@SergeL This method won't work if the armature is used to deform the mesh - as it does depend on the object origin. However, if you rotate the object by way of parenting it to a bone of an armature then rotating that bone (in Pose mode) will affect the object rotation and therefore its color.

Here is a hack:

Read the color from object's vertex colors, this way your objects can share the same material with different colors:

Change the vertex colors on frame change with python script. This won't have real-time performance but that shouldn't matter since you don't get material preview with vertex-colors in view-port anyway (it shows only in render).
import bpy

# this is how you add vertex-color map:
obj.data.vertex_colors.new(name='Col')

# this handler function, it will be called on every frame change
def update_colors_from_rotation(scn):
    for obj in scn.objects:
        color = YOUR_FUNCTION(obj.rotation_euler)
        # color should be float array [R,G,B]
        # or you can access custom ID props here also: color = obj['base_color']
        # and do something with it

        # here is how you change the vertex-color map:
        for ipoly in range(len(obj.data.polygons)):
            for ivertex in obj.data.polygons[ipoly].loop_indices:
                obj.data.vertex_colors['Col'].data[ivertex].color.r = color[0]
                obj.data.vertex_colors['Col'].data[ivertex].color.g = color[1]
                obj.data.vertex_colors['Col'].data[ivertex].color.b = color[2]

# register the function in frame change handlers:
bpy.app.handlers.frame_change_post.append(update_colors_from_rotation)

Building on this answer, the Rotation details can be captured to an image - with each frame on a subsequent line of the image - and interfaced into the Cycles material using an Image Texture node.
The following script will run through each frame of the scene and create an image (width = number of objects, height = number of frames) containing the Rotation details encoded stored in each pixel.
import bpy
import os

width = len(bpy.data.objects)
height = bpy.context.scene.frame_end

# Create the image
image = bpy.data.images.new("object_rotations_"+str(width)+"x"+str(height), width=width, height=height,float_buffer=True)

# Create an empty array of pixel data (each will hold R, G, B, A values as floats)
pixels = [None] * width * height

# For each frame
for frame in range(0,height):
    bpy.context.scene.frame_set(frame)

    # For each object
    for x in range(0,width):
        y = frame
        object = bpy.data.objects[x]
        pixels[(y*width)+x] = [object.rotation_euler[0], object.rotation_euler[1], object.rotation_euler[2],1.0]
        object.pass_index = x

# 'flatten' the array
pixels = [chan for px in pixels for chan in px]

# Store the pixels in the image
image.pixels = pixels
image.update()

# Save image to temporary file and pack it (from answer by @sambler)
scn = bpy.data.scenes.new('img_settings')
scn.render.image_settings.file_format = 'OPEN_EXR'
scn.render.image_settings.color_mode = 'RGBA'
scn.render.image_settings.color_depth = '32'
img_path = bpy.path.abspath('//')
img_file = image.name+'.exr'
image.save_render(img_path+img_file, scene=scn)
try:
    # Remove the scene (pre-2.78)
    bpy.data.scenes.remove(scn)
except:
    # Remove the scene, (Blender 2.78+)
    bpy.data.scenes.remove(scn, do_unlink=True)

bpy.data.images.remove(image)
bpy.ops.image.open(filepath=img_path+img_file)
image = bpy.data.images[img_file]
image.pack()

os.remove(img_path+img_file)

# Add a fake user to ensure the image is retained
image.use_fake_user = True

This will capture the rotation details of each object into a row of pixels in a generated image with one row for each frame in the timeline. Each pixel's RGB values represent the XYZ Euler rotation values for the corresponding object on that particular frame.

The material can extract the rotation of each object using some relatively simple maths - set the Image Texture to point to the generated image (and set to Non-color Data).

Set keyframes on the highlighted Frame value node - to vary the frame in step with the actual timeline frame (and set Interpolation to Linear) - this is the easiest method of getting the frame number into the Cycles material. Also, ensure the highlighted Width and Height Maths Divide nodes match the Width and Height of the generated image.
This can produce the following effect, varying the color based on the object rotation.

Note that if the rotation of the objects (or the number of objects) is changed then the script will need to be re-run to re-capture the object rotations to the image.


text:
How do I extrude an object into another creating depth?

I am designing a fader and I want to have the groove be deep. I don't know how to extrude the grey long rectangle into the white face. They are two seperate meshes and I need to show some depth for when I render with light (the fader should look like it is actually sliding in a groove).

I'm almost sure this is a duplicate but I can't find the exact one. Left an answer for now.

Select the object you want to use to create the groove, Tab into Edit mode and press E and extrude it to give it some depth (as deep as you want the groove to be). Next select the panel (the white face) and add a Boolean modifier to it selecting the extruded object as the input, change the operation to Difference and then apply the modifier if you are satisfied with the results. Finally, delete the extruded object and you can enter edit mode to tweak as desired.

How do you create those keyboard references? More specifially, how to you make those boxes referencing key commands in your tutorial. This would be useful for any future answers I produce.

@TheMinecrafterandBlendmist Use <kbd></kbd> tags to surround your text. See this and this. In the future, you can click edit on the post to look at the underlying structure.

Thanks! That will be most useful. I love learning a new HTML tag now and then.


text:
Can I color the empty space between two objects?

How do I color in the space between the torus and the cylinder? I want to do this without changing the color outside the torus.

if there is a face inside the torus assign different material to that area, or create circle and scale it to fit inside the torus and give it a color, or use a texture

@Chebhou You should add that as an answer.

you have many options :

create another material with a different color
select the face you want to color and click on assign in the Material tab

OR

create another object that fits inside the torus and give it another material

OR

use a texture  and unwrap the object to map it correctly

Second choice can be shorter, just select an inner loop, duplicate and separate it as a separate object and fill it.

yes that will fit in perfectly

I don't get it, also my circles are transparent when I place them in.

@BoratSagdiyev yes they are, you should go to edit mode and hit 'F' this will create a face inside the circle; all the verticies should be selected

@BoratSagdiyev you're welcome , side note: to make this circle follows one of the other objects select it then select the other object and hit  'Ctrl'+'P'


text:
F-curve connected sound to text
I was working in my first intro and I wanted to connect audio light to the song and I miss clicked and I probably connected it to my text. anyone know how to disconnect it?

Here is the screenshot and i tried to delete it but it doesn't work

ctrl + z? could you upload a screenshot?

By connect audio are you referring to "bake sound to fcurve" ? If that's the case,  select the fcurve in graph_editor,  or dopesheet and press x (delete)

I already tried to delete it

but it doesnt work

To delete for instance the x location fcurve, click on its name (list on LHS of graph-editor) it will be highlighted (white) and the graph will be highlighted too. This means it is selected.  Then hit the x to delete.

Also you will need to unlock the fcurves by hitting the padlock next to LocRot (It will open)  Hitting a over the fcurves will select all, shift click to select more.


text:
Subdivision Surface Node in Geometry Nodes Creating Unexpected Creases After Merge by Distance
I'm experiencing an unexpected behavior with the Subdivision Surface node in Blender's Geometry Nodes. Here's my workflow:
Started with a mesh
Extruded the mesh
Joined it with the previous mesh to create bottom faces
Used a Merge by Distance node
The issue: After applying the Subdivision Surface node, it's behaving as if there's a crease attribute on the vertices that were merged by the Merge by Distance node. This results in sharp edges or unexpected creasing where the geometry was joined.

I'm looking for insights on why this might be happening and potential solutions to achieve smooth subdivision without these artificial creases. Has anyone encountered a similar issue or know of any workarounds within the Geometry Nodes setup?

Wrong face normals

The problem is the normals of the faces are pointing upwards and they get extruded upwards (or generally in the direction in which the normals are pointing).
The original faces are also pointing upwards - even after joining the geometry and merging the vertices. But this means now, the bottom face normals are pointing in the wrong direction inside the closed meshes.
These flipped faces build a natural boundary to the other correctly oriented faces, which works like a crease. To change this, you have to flip the original faces with a Flip Faces node before the Join Geometry.
Here in this example I have the Face Orientation overlays enabled and rotated one of the planes so that you can see the original face at the bottom - it shows red, so the inside is pointing outwards and the connecting edges are creased:

But if you place a Flip Faces node between the original faces and the Join Geometry node, everything turns blue and the creased edges are gone:


text:
Trying to use array with mesh going from big to small. Meshes are alternately flipping
I've been following the instructions here: Changing Size from small to big in array or duplication
It's not going well, however, and being new to this method, I cannot understand what the issue is. Any help would be immensely appreciated.

In an Object-Offset array, whatever transform would take the original array element to the Object will be repeated for each subsequent element.

So if (top row) the controlling Empty is offset in Y, and scaled by -1, then subsequent elements will have the offset from the previous element scaled by 1, -1, 1, .... . The scale multiplies.
To get shrinking elements, scale the Empty to a positive fraction of 1. (0.8 in the bottom row, with no Y offset, giving 0.8, 0.64, 0.512....)


text:
Error while exporting preset in sapling:add tree
I've created a tree on Blender but when it comes to export preset it gives me this error:

I can't understand what the problem is. Do I have to change some paths in the user settings?

Ok, I've solved this problem and it was simply a permission problem.
Blender needs to have administrator rights to write in the "presets" folder, so it won't export anything in there if you don't give the permissions.
What you have to do is to right click on the folder "presets" -> Properties -> Security and give to user the permissions to write.

Wher can I find this folder? Outside Blender or inside?

The folder is in C:\Program Files\Blender Foundation\Blender\2.73\scripts\addons\add_curve_sapling\presets
Obviously, instead of 2.73 there's the version of Blender you are using.

This is not an answer, just a workaround for a stupid bug.

I just encountered this bug on Ubuntu with Blender v2.76. The workaround is again to change permissions of the presets folder:
chmod 777 /usr/share/blender/scripts/addons/add_curve_sapling/presets

I claim this is a a bug. The script should only touch the home folder. It would have been accepted in the Win9x days, but not 2015.

this is not an answer. this complaining, take it to the blender bug site.

I have done that, and there are fixes https://developer.blender.org/T46718


text:
ambient occlusion bug?
In the latest blender versions the ambient occlusion is strange. If i activate ambient occlusion, the shadows disapears if i set ambient occlusion on low forexample 0,50, the shadows disapears, and if i taking ot on 1.0, the shadows are weak. Before, ambient occlusion was like when i set it on low, the shadows were more visible and hard, and if i took it on high, it was more unclear shadows. Is it going to be a fix for ambient occlusion like it was before, soon?
Im using a matchmove-camera imported from syntheyes.

is there something i must change in the camera object?

it happens in any camera render, it has nothing to do with syntheyes matchmoved scene, i found out right now.

Could you post a screenshot of the situation? Maybe two, one with the issue and one as example of what would have been "Before". Which versions of Blender are you referring to?

im using the last version of blender. it seems to be only when i using a solved matchmoving scene from syntheyes. is there something i must change in the camera?

i found out it has nothing to do with matchmove scene from syntheyes. it happends with any camera.

ok. now i found out i had to change from shadows and shading in shadow only to shadow only in the drop down menu. now it works.

Good! If you have exactly found our what the problem was, consider to write down and accept you own answer, so who'll fall into the same issue can easily find a solution.


text:
How to swipe transparency?
So I am making a video in blender, and it was originally an Adobe After Effects thing:
https://www.youtube.com/watch?v=kkTmU_hJbbw
So I'm using indirect lighting in the world tab, and the emit in the materials tab.
But I cant get the text/circles to disappear after it shows up.
At first I tried the mask option of the transparency option, but that showed up on the floor object.
Then I tried using the Boolean modifier, but when the circle hit the cube used to make it disappear, the cube would get the same material settings, which included the emit property.
So I really need help!
Any advice?

When using Boolean modifier, make sure the final object is going to be a closed mesh. Things like plane and cirle with zero thickness may not work well as target.
Also, it is recommened to put the "boolean masking" cube into another scene layer, and make that layer invisible.

Here is a very simple sample file, just fyi.

With the boolean on the circle set to 'Difference' I did not find that the circle lost it's material:

Note: Make sure that he circle has some volume so it isn't completely flat. Select all the faces of the circle and use 'Extrude' (E) to give the circle some volume.
The cube that is used as the masking object can then be set to not render by selecting it and pressing Ctrl+H.
Resulting in:


text:
Batch Manipulation in the VSE?
I'm working with the video editing part of Blender, and I was wanting to change the proxy video settings on all of the videos in my project in the sequencer. But I had to go to each individual video to do so. It took up a lot of time. Is there a way to do it faster?

For some toggles, you can first select multiple strips, then right click on them and choose "Copy to Selected".
For batch controls on proxy quality setting, there is a very nice VSE addon here, which can make it much easier.


text:
Keyframing emission shader colour/strength using python
I'm trying to animate the colour and strength properties of an emission shader based on external data using script. I add a cube and give it an emission shader. I can alter the strength property using:
bpy.context.active_object.active_material.node_tree.nodes['Emission'].inputs['Strength'].default_value=1

I then try to add a keyframe on the strength property using:
bpy.context.active_object.active_material.keyframe_insert(data_path="nodes[\"Emission\"].inputs[1].default_value",frame=10)

But I can't get the correct data_path. I must be missing something fundamental here. I have quite limited scripting experience in blender.
Code suggestions gratefully received.

You need to get a bit closer to what you want to keyframe. It is the socket that keyframes one of it's values, not the material. So you want to tell the input socket to insert a keyframe.
So this slight variation of what you have will work (only over two lines for clarity) -
node = bpy.context.active_object.active_material.node_tree.nodes['Emission']
node.inputs[1].keyframe_insert(data_path="default_value",frame=10)

This makes sense, I tried a variation of this but wasn't getting the data path correct; seems obvious now! Much appreciated.


text:
Translate blend file to python
How can I get equivalent python code for a created blend file from blender. I want to generate java code for corresponding python code of a blender. I am unable to get python code of blender file either inside or outside the blender.

I am not sure what you want. Do you want python code that generates the vertices and faces of a model in your .blend file? Blender has a python API, but internally it is programmed in C. And the abstract data structures Blender uses internally can not be exported directly as a python script.

Question is not a duplicate, but is related to: http://blender.stackexchange.com/questions/2410

You could elaborate on what exactly you are trying to do. Probably better solutions exist.

Blender has no facility to write a .blend file as a series of Python instructions.
For limited uses you could write your own script (Its been done before for rigify armatures for eg), but for the entire blend file this becomes a large task.

authors: Иван Назаров


text:
Modify panel's row after panel has been created
I have an addon which creates a panel with properties on Blender startup:
class OBJECT_PT_runcamera(bpy.types.Panel):
    bl_label = "Some Name"
    bl_space_type = "PROPERTIES"
    bl_region_type = "WINDOW"
    bl_context = "render"

    def draw_header(self, context):
        layout = self.layout
        layout.label(text="", icon="MESH_GRID")

    def draw(self, context):
        layout = self.layout
        row1 = layout.row()
        row1.prop(context.scene, "myCustomPropertysName")

Now, after the panel has been created, I want to change the row's enabled value when user clicks some specific button -- ie, some properties (shown in rows) in the panel will be disabled/enabled by some function called from another property/button.
I've tried different ways to write the command but nothing worked.

bpy.types.Scene.show_row = bpy.props.BoolProperty()

row1.enabled = context.scene.show_row

And your other function will just set the show_row property. Thats it.

OK, my code now:
bpy.types.Scene.show_row2 = bpy.props.BoolProperty(default=True).
Then I define a function to switch enabled:
def switchCustomProp(self, context): context.scene.show_row2 = False.
Then the switch:
bpy.types.Scene.mySwitch = bpy.props.BoolProperty(default=True, update=switchCustomProp). Then the panel is loaded where row2 gets set to some other property (myCustomProperty) and row2.enabled=context.scene.show_row2.
Now, when I click the bool property in row1, row2 does not get enabled/disabled :/

Ah, I had one extra row2.enabled=True inside the panel's code which overwrote the row2.enabled=context.scene.show_row2.
Deleted it and it works now. THX!


text:
How can I get the fill and mask options?

I have seen other people having more options in the Image paint tool menu,
just like the picture below.

I only have the options draw, soften, smear and clone while he also has fill and mask options.

I found out what was wrong after some experiments. It turned out that when i turned on 3D view: Screencast key it made me unable to use the paint tools.

Welcome to the site :) Please try and keep to one question per post (but feel free to make as many posts as you like). This helps keep posts cleaner and focused on one subject, which will help others looking for answers to the same question. That said, here's a related post: http://blender.stackexchange.com/q/6350/599

Make sure, that you have the same Blender Version used in the tutorial. Most of them announce which version they use.
The Fill Tool is not available in the 2.71 Version. This is a development of the Google Summer of code 2013 and it's planned to merge this tools in the 2.72 Version.
Currently you can download a build from http://graphicall.org/. (seach for "Paint")
For examle http://graphicall.org/1107 (tested, works)

If you want to draw a Line you can change the Stroke Stettings:

thank you very much, it was just what I where looking for :)

Even if they don't announce the version they use, it's almost always visible next to the blender logo at the top of the screen (in the info header) @kakan If this answers your question, feel free to mark it as accepted by clicking the checkmark under to the voting icons :)


text:
Why are there non-visible objects in my final render?
Have Blender on about 4 machines rendering animations.
Just spotted on one of the machines its rendering something different from the actual scene that I have setup.

Top window shows a different set of layers objects to whats actually being rendered in the rendering window below.
In my scene contents, layers objects 1-5 are not visible, but these are the ones that look like they are being rendered.
The only thing I can assume is that perhaps it might be because I did not save the document before clicking render, but I would not have expected that behaviour (you dont need to save your word document before printing it).
Can anyone confirm why this is happening?

In your screenshot, all layers are set to visible..?

The (render) visibility management in 2.81 is inconsistent, between collection visibility that has some priority on the contained object visibility (but not always), hide on render and show on render (which is not the same property). I've a case where all these properties are set to hidden and still the object is rendered.

If you parent an object to armature, it will not be visible in the render no matter what settings object has. Blender 2.90.1

If you look at the outliner, some eye-icons are faded out to indicate that certain objects are hidden.
But there's hidden and there's hidden: hidden in the viewport (eye-icon), and hidden for rendering (camera-icon).
You may paste the following code line to the Python Console (at the bottom of the Scripting view) and hit return, to make the render visibility match the viewport visibility automatically:
for ob in bpy.context.scene.objects: ob.hide_render = ob.hide

For 2.8, I had to change ob.hide to ob.hide_get(): https://blender.stackexchange.com/a/140483/15400

could it be more cryptic and confusing ?

In Blender 2.8, in Outliner editor, there is Filter icon at the right side of *Search' bar, at the top.
Open the popover, and under Restriction Toggles, select camera icon.
Then toggle this camera icon for each object or collection to enable or disable it for rendering.

This is now the best of all the options here.

Sharing this .py by Draise14 on GitHub that saves so much time and tears:
Match Render Visibility,
https://gumroad.com/l/sMNjc

I made these little entries to streamline the workflow of visibility and rendering, because when working with many objects, the render visibility sometimes is not the same as the viewport visibility. When you hit render, things are hidden or shown accidentally, ruining good renders - the final Render output is the important one. The viewport should reflect that.

Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the external resource is unreachable or goes permanently offline.

done, hope that's clearer!

To hide objects from final render, click also the camera icon next to the object. The eye is for viewport rendering, the camera is for final rendering.

in 2.8 there is no camera icon

this should be the accepted answer ;)


text:
Switch rendering engine depending on render layer?
Can I somehow link the choice of render engine to the render layer?
I want to composite cycles and freestyle.
The render layers which I use in the compositor as inputs should 'know' which render engine they are supposed to use.  Maybe there is some python renderlayer-initialization-hook which I can leverage?
I do not like the workaround of creating three scenes, as maintenance overhead does not scale well. (or I'm doing it wrong?)

You should use different scenes for each renderer. On the top toolbar next to where you select your render engine you can find to the left the scenes. Add a new scene and switch to the appropriate render engine.
1.
Rename the current scene to the render engine's name
2.
Create a Link Object Data copy of the current scene

3.
Rename it the other render engine and selected the render engine from the drop down to the right.

Like I wrote, the multiple-scenes workaround has the problem that e.g. new objects do not show up in both scenes, so one has to re-duplicate the scenes when one makes changes.  I would like to know if there is a better method?

This is a good question. THe method I posted is what I always do. Its not ideal but its what blender has to offer.


text:
Object doesn't show in render
One of my students has designed a light saber and I can't figure out why the lightsaber is not showing up in the cycle render.  Could someone help me out?
https://drive.google.com/file/d/0B6CUhZCXLU7nUHNWUHdNb1R4OVE/view?usp=sharing

Thank you

If you're going to downvote a new user's question, I think you should explain why.

I'm pretty sure the reason for your downvote is that questions should be as focussed as possible. Explain what you tried and where your problem is. You might like to take a look through the help centre (e.g. http://blender.stackexchange.com/help/dont-ask)

In the object data tab of the saber, set duplication to "None."

So, which choice is the right one?

You usually want "none" for that field


text:
Prevent quad view from resetting?
Is there a way to prevent the quad view (CTRL+ALT+Q) from resetting?
I'm using the quad view with the "Lock" option disabled. Each time I maximize and minimize a viewport in the quad view, the top right viewport gets reset and becomes the last view I was in.


text:
Auto Back Culling on export
After I created a model then export it.In other programs such as Iclone 6 or Substance painter.The Object loads up inverted or with Backing Culling set.But the thing is i did not check the box in blender under the shader tab to set Back Cull on the model.While working on the object in blender its ok but after a export to another program its inverted.How to i fix this exporting problem.Also if i export it to Maya 2013 it also looks ok.

Have you checked the normals? As far as backface culling goes, that is up to the program drawing the mesh. Is there a setting to enable/disable backface culling in the external program?

In iclone6 3dxchange there is but when i flip the mesh it dosent look right in that program.I've imported it into substance painter also and it looks the same way.But then also too im not sure yet about a setting in substance i will try tho.Other meshes i export however dont auto back cull like that.I dont know whats the problem.

The backface culling settings in the viewport don't affect how the model is exported, their effect is limited to how the model is displayed in the viewport in Blender. The normal of a face can be used to decide if a face is drawn or not, faces pointing away from view can be skipped. I suspect that's what's happening in those programs which are displaying the model in an unexpected way.
Most likely you want to recalculate the normals of your model and make then all outward facing (in editmode, select all faces, then Ctrl+N), then save, then export.
If they are all pointing inwards, press Ctrl+F to get the Faces menu, and select Flip normals, then save, then export.
The mesh display panel has an option to show you the normals (here  displayed as light blue lines, the size of which is defined in the Size slider):

THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! i will try.its my first model im going to use for my fighting game.THANK YOU!!! this has to be the problem.

@EdwardSmith if this answer fixes your problem, you should accept it (give it a green checkmark)


text:
v2.6 Primitive method Python code to add circle
I'm trying to set up a workflow which involves as many reusable parts as possible.
I've written a vecCircle module which places a circle but it's not working because the example code I used is from a 2.5 doc source and there is no equivalent in 2.6.  I'm using 2.74 and it looks like the API is a 2.6 API - I presume that's right.
The example from
http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Three_ways_to_create_objects
Includes the code
ob = bpy.context.object

which is an error in my pydev instance due to this being ro in this release. Can anyone tell me how the following should be rewritten? I'm not a python noob but blender Python noob.
def createMeshFromPrimitive(name, origin):
    bpy.ops.mesh.primitive_cone_add(
        vertices=4,
        radius=1,
        depth=1,
        cap_end=True,
        view_align=False,
        enter_editmode=False,
        location=origin,
        rotation=(0, 0, 0))

    ob = bpy.context.object
    ob.name = name
    ob.show_name = True
    me = ob.data
    me.name = name+'Mesh'
    return ob

are you sure you meant 'Circle' and not 'Cone'  ?

I want to create circles at the moment, but the code snippet I was hoping could be explained from the old API doc creates cones.

seen as you are using a much newer version of Blender than is referenced in the 2.5 cookbook, you should read the API of the current release (it has a great search feature) . I've shown you where to find the docs.

The snippet you pasted relies on old API calls, and when it is run in a recent version of Blender it will produce the following exception / Error message
TypeError: Converting py args to operator properties: :
keyword "radius" unrecognized
Error: Python script fail, look in the console for now...

Bookmark this link www.blender.org/api/250PythonDoc/, it points at the latest docs automatically. You can also use the help menu.

See the current API page for bpy.ops.mesh.primitive_cone_add, You'll see that now (September 2015) must specify radius1 or radius2, radius doesn't exist anymore. And cap_end is now end_fill_type
Parameters:

  - vertices (int in [3, 10000000], (optional)) – Vertices
  - radius1 (float in [0, inf], (optional)) – Radius 1
  - radius2 (float in [0, inf], (optional)) – Radius 2
  - depth (float in [0, inf], (optional)) – Depth
  - end_fill_type (enum in [‘NOTHING’, ‘NGON’, ‘TRIFAN’], (optional)) –
  - (....)

For the circle example you might use something like this.
import bpy

def makePrimitiveCircle(objName, v, r, f, loc, rot, layers=[0]):
    bpy.ops.mesh.primitive_circle_add(
        vertices=v,
        radius=r,
        fill_type=f,
        view_align=False,
        enter_editmode=False,
        location=loc,
        rotation=rot,
        layers=[(i in layers) for i in range(20)])
    ob = bpy.context.active_object
    ob.name = objName
    ob.show_name = True
    me = ob.data
    me.name = objName + 'Mesh'
    return ob

f = makePrimitiveCircle('pizza', 20, 1.2, 'NGON', (1,2,0), (0,0,0))
print(f)  # does return the new object
# <bpy_struct, Object("pizza")>

# you could use this to specify layers directly..
makePrimitiveCircle('pizza', 20, 1.2, 'NGON', (1,2,0), (0,0,0), layers=[0,3,5])

Thanks, but I didn't get this error.

The following code in my module did the trick.  Although it meant the scene runs with the most recent object selected.
## create mesh and object
#
bpy.ops.mesh.primitive_circle_add(vertices=v, radius=r, fill_type=f, view_align=False, enter_editmode=False, location=(locX, locY, locY), rotation=(rotX, rotY, rotZ), layers=l)
ob = bpy.context.scene.objects.active
ob.name = objName
ob.show_name = True
me = ob.data
me.name = objName+'Mesh'
return ob


text:
It it safe to remove an unused bone?
I'm making a shirt for Sims 4 and couldn't find a Sims 4 reference mesh shaped like mine from which to transfer the weight paint. I ended up using a full body mesh, but now I have vertex groups for calves and feet. I don't know if it's okay to leave them there or not. Should I remove them? Is it safe to do so? And would just deleting these vertex groups be enough or do I need to do more? Thank you!

Just make sure nothing you have requires those vertex groups (such as bones or particle systems).  If nothing is using it, and you have no further use of them, the go right on ahead!  However, you don't have to delete them; you could just not use them.  Whichever you want.

Just wanted to add that you can remove groups and keep the bone.  That won't hurt the bone, it will just mean that the bone no longer influences that part of the mesh.  PS: if anyone has a problem with me posting this as a comment instead of an answer, I'll change it.

Thank you so much! I thought using a full body outfit would make no difference since my mesh is just a shirt and wouldn't use the calf and foot bones. But someone said that transferring weights from a full body mesh to a shirt is bad practice. I'm learning still so am always worried I'm going to mess something up. :)


text:
Procedural Materials On Fluid Simulations
Been struggling with this for a while. I've made a procedural lava shader and I want to put it on a fluid sim. The problem is, all the mapping methods I've tried make the fluid travel through noise textures in 3D space rather than the noise flowing with the lava.
Is there something like the particle info node that I should be using the apply the texture to the fluid sim as it's generated?
Thanks in advance!

This is an interesting problem as far as I know there is no simple way to correctly map a texture on a fluid because it can't really be unwrapped, and there probaby isn't any deterministic solution to solve the issue. If the lava moves primarily in one direction you could try mapping it to object based texture coordinates with an empty moving roughly at the same speed as the lava

I saw a tutorial doing this but unfortunately my simulation is more complicated and goes in multiple directions and it's also a continous flow. I think the issue is the noise texture node rather than the mapping. Generated seems to give me a good result but the noise seems to have it's own co-ordinates in 3D space that the fluid is moving through which is overwriting my shader overall.

Speaking to some guys at work, in Houdini you can use particles doing the same movements and assign them colours. Then the mesh finds the closest vertex in proximity to the particle and assings it that colour. Any ideas if Blender has a similar system?

I'm not aware of any, as far as I know, perhaps Animation Nodes can do something equivalent. Not sure, never used it myself.


text:
Cartoon Style Materials and Render
First post here and I am trying to determine what I would need to do (or try to do) to create a static render that looks more like the 3D cartoons I watch with my kids than a semi-photorealistic render.  I am so much more interested in the 3D cartoons than realistic renders but I just can't figure out how to make my images look like a cartoon similar to an image like this (below).
My renders (which are not great since I am a relative beginner) always end up looking something like this (below).
I am not an artist so I may not have the eye for this but my gut feeling is that the cartoon style has more hand-drawn textures.  Perhaps it is more the lighting.  Can anybody give me some hints as to how I could move towards this 3D cartoon style of modeling and rendering rather than the sort of realistic look?
Here is another screenshot of the kind of render I am hoping to one day achieve.  I can imagine that some of the textures are procedural node-based, ie. seat on tractor.  But what is it about this image that makes it look more like a 3D cartoon than some kind of photo-realistic image?

Any help would be greatly appreciated!  Thank you very much.

Hello and welcome This looks like a primarily subjective question, your renders look fine to me. Which part are you unsatisfied with? Could you edit your question and make it more concise? Perhaps focus a bit on the technical side of the problem.


text:
Newbie Shading problems!
i run into some problems with the shading in the tail of the airplane. but i did not know what cause the problem. can any help?

Thanks for helping this...


text:
How to scale properly after rotate the mesh without using apply rotation?
i know we could use apply rotation to correct this, but here is the situation, i have mesh A and B that are joined with Ctrl + J. i just rotate the A and then want to scale along the mesh A's length without affecting Mesh B, but apply rotation(Ctrl + a) only can be used in object mode, which will affect my mesh B since they are joined.
And i saw a tutorial that do the following tricks. however, following his method i came out with some problems.
The Tutorial is in the following GIF :
https://gfycat.com/UnripeUnfortunateDanishswedishfarmdog
and following is mine:
After i choose the Normal, the coordinate axes has some offset to other angel,hence scale along y axis will create some weird shape. but in the tut, the coordinate axes works perfectly.
I strictly followed his steps but cannot find the reason.

As you don't apply rotation you can use Local orientation. That said, Normal should also work but the angle might get skewed if mesh has slight variation like some faces skewed. It seems that author of that gif gets slight deformation as well, but it's hard to tell

Thanks for replying, i tried local orientation, but it does not work as well.


text:
An easy way to remove all children in a parent-child relation?
I have some parent-child relations with the Blender objects that I'm working with, to make the things cleaner. Now I have an object with all its children that I don't want any more, the object specifically is an empty and the children are some meshes, there are a bunch of them and I'm looking for an easy and fast way to delete them all to avoid select them one-by-one. Maybe some python script?

this may be a bit over-simplified and context specific but, since its just an empty, couldn't you just delete the empty? (then add a new one)

Deleting the empty moves its children to the parent node, but not delete them

Select the parent object, then use ShiftG > Children to select all the children automatically.
You can then remove the parent-child relationships acting upon all selected objects by pressing AltP.
See the official docs on parenting

Using that method is a two-step process, because you first delete all the children and then the parent. But it's fine, is pretty much better than deleting them one-by-one. Thanks

see my edit for details on simply removing the parent-child relationship

its says my edit need to be reviewed... you can remove parent child relationships with alt-p

The edit is somewhat redundant, once you select the objects (and delete them as OP wants), the relationships are destroyed.

@KonnerRasmussen I already checked the official docs before asking, Alt-p just removes the relation this means that the child will be disassociated from the parent, but not deleted

@lordscales91 oh im sorry... it sounded like you wanted to delete the relationships, not the objects themselves... to that end i dont believe there is a single hotkey to delete the children of a selected parent as this is not a common enough task, and it only requires a second step to accomplish... you could however examine the source for these hotkeys, and create your own addon if you know python


text:
Where is the Pipe joint addon in Blender 2.7.3?
Hi i'm searching this option at User preferences - Addons, but i can't find it in the new version, even making a search. Has been deleted form blender 2.7.3? I want to turn it on as in older versions.

This is now located under Extra Objects in the Add Mesh category.

Once you enable it, you can access the custom primitive types with ShiftA > Pipe Joints.
EDIT:
On version 2.79 Pipe Joints are on Add>Mesh>Mechanical>Pipe Joints


text:
Why is the smoke preview not showing in Blender's viewport?
I've been trying to put together a smoke sim in blender 2.74 using the quick smoke preset however have found that it does not show up in the viewport, yet will still render.
Long story short i have recently updated my AMD Radeon 6750M drivers and it has given me some issues with using the older versions of blender (2.71>), however i have apparently now managed to fix that issue with the error126 fix.
I had initially thought that the smoke not showing up was an opengl issue caused by the drivers, (especially since opengl render no longer works for me), however having now been able to use 2.71 again i have found that not only does the smoke display in 2.71s viewport, but i can also opengl render in 2.71?!
I've attached 3 screenshots of blender 2.71, 2.72b and 2.74 each with the default cube having a quick smoke preset applied to it and the animation played to frame 70. As you can see there does not seem to be any issues with the viewport in 2.71:

Yet nothing displays in 2.72b and 2.74:

This has lead me to ponder if blender uses a different opengl version from 2.72 onwards, or whether there's just something blindingly obvious I'm missing (wouldn't be a first! ;) )?
Anyone have any ideas? Thankyou in advance!
Specs:
Samsung Laptop running Windows 7 x64
Quadcore Intel i7 CPU
8GB RAM
AMD Radeon 6750M GPU and Mobile Intel(R) HD Graphics(?)
EDIT:- Just downloaded the 2.75 Release Candidate, same issue as 2.74, however when i opened the application i was greeted by this message (does not appear when opening 2.71):

In response to @MrZak on the previous post, i have tried copying them in seperately now, but as they're already in the folder it understandably won't let me now. And yes I used the AMD Catalyst (i think it's called) software from their site to update the correct driver :)

"as they're already in the folder it understandably won't let me now" - it will. You should enter "copy 'filename'.dll .dll" (typing name of that file without quotes instead of 'filename'). And shutdown every program using OpenGL (Blender for example). But I believe this discussion becomes offtopic here

Ah my bad, you were right i had missed the extra .dll! Unfortunately it still hasnt solved the issue however :( It just seems odd to me that it works perfectly fine on a previous version, yet not at all on a later one, unless blender was processing something differently.

What version of OpenGL library do you have ? (there are some tools for checking that - http://www.realtech-vr.com/glview/, but you can do that inside of Blender, selecting in the main menu Help > System Info, then switching one of Blender windows to Text Editor window and selecting system-info.txt)

Not sure which bit is the specific library version (1.1.0 maybe?) but this is what the system-info.txt says.
`OpenGL
============================================
renderer: 'GDI Generic'
vendor:  'Microsoft Corporation'
version: '1.1.0'
extensions:
'GL_WIN_swap_hint GL_EXT_bgra GL_EXT_paletted_texture'
Implementation Dependent OpenGL Limits:
Maximum Fixed Function Texture Units: 0`

Here's the whole text file http://www.pasteall.org/59091 for 2.74, ill see if its different in 2.71 and update :)

Here's the update for the 2.71 version, seems that blender is using my AMD card in 2.71, but not in 2.74? http://www.pasteall.org/59094

Apparently I'm unable to post in the chatroom as I don't have 20 reputation points yet :(

I have tried using the new OpenCL to experiment with AMD GPU rendering (unfortunately no success as the card isnt 7xxx series :( ) When i've tried to change the Compute device from the Microsoft one this is all it displays: http://www.pasteall.org/pic/89759 , any ideas?

Try to use this site suggestions - http://leshcatlabs.net/2013/06/11/leshcats-catalyst-13-6-beta-2-uniflfor-amdintel-powered-laptops: 1) "terminate atieclxx*32.exe from task manager (open with Ctrl+Shift+Esc in Windows)" or 2) install that program. Can't suggest you more unfortunately as I haven't ever heard about AMD+Intel powered PCs

Okay I'll have a look over the coming week, thanks for all your help @MrZak ! I'll have another look in the meantime to see if i can run my amd card as the default gpu for opengl processes in blender as it is in 2.71 :) If anyone else has any ideas on the matter please do not hesitate to post :)

Found the solution!
It was simply the case that Blender no longer used the updated AMD GPU as the primary card when running Blender, and instead used the Intel card which was not up to date. Consequently parts of Blender which require OpenGL (such as the viewport smoke simulation or OpenGL render, in my case) will not display correctly, or will throw up errors when used. This is easy to fix by reconfiguring which card is used when running the app.
This was the steps taken for my Windows 7 x64 laptop.
1) Right Click on the Desktop, select the Graphics Properties option from the drop down menu. Note: If there is a Configure Switchable Graphics option (as shown in the screenshot), click that instead and skip to step 3.

2) Under the Power tab, click Switchable Graphics Application Settings.

3) This will bring you to a window with Recent Applications and All Applications drop down menus. Don't be fooled if you see Blender in the 'all applications' menu, if there are multiple versions saved on the same machine yet under different file locations, you will sometimes need to configure each individually. To do this click the Add Application button by the dropdown.

4) Navigate to the file location that the Blender Version is saved at. Select the app and hit Open.

5) When you do this you will be brought back to the All Applications drop down menu. The selected app will now be highlighted (in this case it is the same app as was already on the list at the outset) and will have a drop down menu on the right hand side. Click the menu and choose High Performance. This will set the AMD graphics card as the primary driver used when running Blender.

6) Click Apply and restart Blender. This should hopefully fix any issues, however you may need to repeat the process when installing later versions! :)


text:
Is there a smart way to apply a better transition between colours while maintaining one solid colour per face?
I recently started using blender for a project. I have tried using a color ramp with a transition between the 4 colours, but the result is too smooth when applied:

Im aiming to achieve this kind of effect:

Is there a way, or is it the long winded way?

The following script reads the face position normalize it and assign it to the vertex color of this face ( new group named 'face_pos' will be created ) :
import bpy

obj = bpy.context.object
obj_data = obj.data
group_name = 'face_pos'
#check for existing group with the same name
if None == obj_data.vertex_colors.get(group_name):
    obj_data.vertex_colors.new(name=group_name)
color_map =  obj_data.vertex_colors[group_name]

#collect dimension info
dim = obj.dimensions
min_x = -1*min([p.center[0] for p in obj_data.polygons])
min_y = -1*min([p.center[1] for p in obj_data.polygons])
min_z = -1*min([p.center[2] for p in obj_data.polygons])

for poly in obj_data.polygons:
    pos = poly.center
    color = ((pos[0]+min_x)/dim[0], (pos[1]+min_y)/dim[1], (pos[2]+min_z)/dim[2])
    for loop_ind in poly.loop_indices:
        color_map.data[loop_ind].color = color

we wont apply this vertex color but instead we use it as a face position input in the material nodes using the Attribute node and the vertex color name , then we manipulate this information to create the desired effect
material node

the result is color transition for faces not points :

This solution maybe a bit complicated but it introduce a trick for accessing other properties in cycles(this is not like drivers since it updates per point not frame)

I copied your script and saved as 'face_pos.py', I then installed from File > User Preferences > Install From File.
I followed the node layout exactly but it only renders the first colour in the colour map.
I've never dabbled with scripts before, but is there a step ive missed or something I may not have done?

copy and past in blender text editor select your object and click Run_Script in the text editor you will see new vertex_color_group you can go to vertex_color_paint mode to see the colors the rest is as in the answer

Would it be possible to do this with an image texture instead of a color ramp?

@GiantCowFilms every face has one coordinate (it would be a point on the texture ), still can't get what you mean exactly

I think the choice would be an average of the color of the points at the vertexes...

if you select all of the faces in Edit mode and then use Alt+e to access the Extrude options menu->Individual.
Press the Esc key to cancel the movement.
Next, press Ctrl + i to invert the selection
Press x to access the Delete menu and select 'Faces'.
Now you should be left with only the extruded faces and they should be all separate components.
OPTIONAL:Personally, I would bake these results to a UV map probably using the 'Lightmap Pack'setting.
This way, the individual faces can be re-joined after baking.  This helps keep the Outliner clean.  The 3D Viewport should also run much faster when many Objects are joined together into one.
Make sure that everything is selected and press p to access 'Separate->By Loose Parts'.
Now enter Object Mode and make sure that all the separate pieces are selected then use the shortcut Ctrl+Shift+Alt+c
to access the 'Set Origin' Menu.  Choose the option 'Origin To Center Of Mass' and now the model is ready.
The 'Node: Input -> Object Info -> Random' is key here.  This is why the faces are all separate objects.  Random greyscale values will be assigned to each separate model and this can be used to modulate the colors ramp so the color transition is a bit more scattered.
Here is a simple node setup that uses the random node to change the relative brightness of triangles.

This next node setup uses a second color ramp combined using the Linear Light Blend mode, many of the other blend modes give interesting effects as well.  This setup also uses a noise texture to modulate how the main colors transition across the model.

Here's the .blend file http://www.pasteall.org/blend/35306

I followed your instructions and copied the node modules and layout to my material exactly, however when it comes to render it comes out solid pink (the first colour in my gradient) any ideas?

My apologies.  I didn't think to mention that that color ramps and mapping nodes are very touchy here.  The model scale has a big impact on which numbers should be chosen.  Usually I just move the sliders around quickly until I find the range I am looking for and then I hold down Shift and also sometimes Alt to fine-tune the numbers.

I've added the .blend

I think you might want to set up Color Ramp node like that:

In this case, color transition will be a lot more sharper.
To control the sharpness you can drag the control points in and out or change the Interpolation type (it's better than using default Linear one in this case, because it provides still smooth but more visible transitions, imo).
If rendered, objects might look like that:

This is about as far as I got before posting the question, should have been a bit clearer, but thanks for the input all the same :)

Well, you have much better answers on your question already so mine is here only because I didn't think it's more complicated task and haven't delete it ;)

@MrZak You could have used constant interpolation and saved alot of points

@GiantCowFilms as I've got OP this approach isn't good enough at all because he needed much more than this solution could provide. I simply misread his question.


text:
This auto render border script wont work with CLI but works fine in the GUI
This registered script works fine inside the GUI when I open the blend file, It refuses to work in CLI mode. I can see that the script runs because it prints the values at the end of the script. Its as if taking the coordinates from the object before the animation kicks in. If I save at frame 20 and render frame 50 the border will be where frame 20 is(I did not save the border in the blend). But the cube is in the location of frame 50.
from bpy_extras.object_utils import world_to_camera_view
import bpy

border = 0.01
scene = bpy.data.scenes["Scene"]
verts = bpy.data.objects["Cube.002"].data.vertices

accuracy = int(len(verts) / 5000)

if accuracy < 1:
    accuracy = 1
x = []
y = []

for v in range(0, len(verts), accuracy):
    v2 = bpy.data.objects["Cube.002"].matrix_world @ verts[v].co
    x.append(world_to_camera_view(scene, bpy.data.objects["Camera"], v2).x)
    y.append(world_to_camera_view(scene, bpy.data.objects["Camera"], v2).y)

bpy.context.scene.render.border_max_x = max(x) + border
bpy.context.scene.render.border_min_x = min(x) - border
bpy.context.scene.render.border_max_y = max(y) + border
bpy.context.scene.render.border_min_y = min(y) - border

print(min(y), max(y), min(x), max(x))

Could be due to argument order https://docs.blender.org/manual/en/latest/advanced/command_line/arguments.html#argument-order. What is your command line?

.\blender.exe -b border_render.blend -s 2 -e 2 -a

Maybe using --python-expr  so that you can give the starting frame to the script (via a function which will include your current code) and set the frame as current in it.

It's an order of things. If a text block foo.py is registered they are run first. and just like an addon. imported and  the  register method called.   SImilarly to what is suggested by lemon, use --python-text foo.py to run the text block after setting frame.

So there is no way to delay it at all? Well without modifying the cli. The problem is I want it to work out of the box GUI and CLI for the render farm and for users. Sure I can tell the render farm to run it but that is adding unnecessary complexity to the farm

Actually after trying --python-text border.py it still doesn't seem to work


text:
how to make a 360 video (turntable) of an Object using a python script
How to make a video of a PLY mesh from python script? I need to place the model in space and rotate it of 360 degrees on an axis.
Here is a ply example: http://156.54.99.175/3d/sodark.zip

Do you mean a turntable? Is there any difference between ply and other import formats in this case? What have you tried so far? Related: http://blender.stackexchange.com/questions/1459/turntable-rotation-with-y-axis-up-add-on/1460#1460

Thanks for your reply. I want to get a video file of my object rotated by 360 degrees. I would like to automate the process with a python script.

sborfedor, what render engine? Internal or Cycles?

Something like this: https://www.blender.org/manual/_images/multiview_workflow_6.gif, right? I think this question needs to be reworded/clarified. For a solid answer more information is required: Rendering in OpenGL, Blender-Internal, Cycles? Background color? Camera properties? Object size? etc. Perhaps it's a good idea to upload an example scene.

poor, the gif is exactly what I want! Render engine: Blender Internal. You can download a sample model from here: http://156.54.99.175/3d/sodark.zip

I think in this question it doesn't make any difference whether the model was a .ply or not. If it's inside blender it is an Object like Suzanne.

it's right, zeffii!

You could use the add-ons linked to in the comments, but if you already have some form of script it's easy enough to plug in a small bit of code to get the same effect. Something like this. This adds a Camera (child) and an Empty (parent), then rotates the Empty on the Z-axis and keyframes each rotation, for frame: (1..num_frames+1).
import math
import bpy

def add_cam(location, rotation):
    bpy.ops.object.camera_add(location=location, rotation=rotation)
    return bpy.context.active_object

def add_empty(location):
    bpy.ops.object.empty_add(location=location)
    return bpy.context.active_object

cam = add_cam(location=(0, -5, 0), rotation=(math.pi/2, 0, 0))
empty = add_empty(location=(0, 0, 0))
cam.parent = empty

num_frames = 90
gamma = math.pi * 2 / num_frames
for i in range(1, num_frames+1):
    empty.rotation_euler[2] = gamma * i
    empty.keyframe_insert(data_path='rotation_euler', frame=i, index=-1)

You might perform some calculations to figure out based on the size and orientation of the Object, where to place the Empty and how far away to place the Camera and which Euler axis to rotate around.
animation example
Then you set your render resolution x, y and quality and output type, and scene.frame_start, scene.frame_end. A smart approach is to render the sequence as separate frames first, using the .png format. Then decide on the kind of final video format. A popular webformat is GIF or MP4. Blender can output a couple of video formats, but GIF is not one of them.
MP4
Blender can load a directory full of .png in the Video Sequence Editor  (VSE) and render directly to a video video format/container (mp4, avi...etc). See Save rendered images in different formats
GIF (animated)
Unfortunately there's no feature that lets you convert a sequence of .png straight to GIF built in. But there are add-ons that use tools like ImageMagick and ffmpeg to do the conversion.

spritify by Fweeb
roll your own scripts using ffmpeg: https://unix.stackexchange.com/questions/24014/creating-a-gif-animation-from-png-files

That's great! But how to get out the animated gif or video or a sequence of rendered images?

Can you explain how exactly use  scene.frame_end and scene.frame_start (should we add them in a code, or use somehow in a different way)?

For zeffii's answer to this, I want to point out that there actually isn't a need to load up on the keyframes. You really only need to keyframe the initial and final rotation values, so a minimum of two keyframes. Plus, with two keyframes, you can easily play around with the interpolation between them instead of for example having to hard-code a sinusoidal interpolation function. I also find that camera movements which contain easing effects usually look much nicer. If you really want linear interpolation with two keyframes, you can set it as the default in preferences, manually do it, or you can code it into the python script, which is what I did here:
import math
import bpy

def add_cam(location, rotation):
    bpy.ops.object.camera_add(location=location, rotation=rotation)
    return bpy.context.active_object

def add_empty(location):
    bpy.ops.object.empty_add(location=location)
    return bpy.context.active_object

cam = add_cam(location=(0, -5, 0), rotation=(math.pi/2, 0, 0))
empty = add_empty(location=(0, 0, 0))
cam.parent = empty

num_frames = 90

empty.rotation_euler.z = 0
empty.keyframe_insert(data_path='rotation_euler', frame=1, index = -1)

empty.rotation_euler.z = 2 * math.pi
empty.keyframe_insert(data_path='rotation_euler', frame=num_frames, index = -1)

# set interpolation to linear:
bpy.ops.object.select_all(action='DESELECT')
empty.select_set(True)
bpy.context.area.ui_type = 'FCURVES'
bpy.ops.graph.interpolation_type(type='LINEAR')
bpy.context.area.ui_type = 'TEXT_EDITOR'


text:
bpy.ops.view3d.view_selected() issue
I try to import an obj file and make a rendered image, by a python script.
How to center the view to the mesh?
I've tried bpy.ops.view3d.view_selected() but i get this error:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<string>", line 43, in <module>
  File "J:\Programmi\blender-2.75a-windows32\2.75\scripts\modules\bpy\ops.py", l
ine 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.action.view_selected.poll() failed, context is in
correct

If you don't have a reference to a specific window, you can iterate over all screen areas, and call the operator on all VIEW_3D area types.
for area in bpy.context.screen.areas:
    if area.type == 'VIEW_3D':
        ctx = bpy.context.copy()
        ctx['area'] = area
        ctx['region'] = area.regions[-1]
        bpy.ops.view3d.view_selected(ctx)            # points view
        # bpy.ops.view3d.camera_to_view_selected(ctx)   # points camera

I think the topic and resolutions to context is incorrect have been covered exhaustively .
If you use camera_to_view_selected(ctx) you can break the loop early if you only have one camera to point, else it will point the camera at the same thing for every 3dview opened.

Thanks @zeffii, no exception now, but the command seems not to work. Here a rendered output example: http://156.54.99.175/3d/preview.jpg I want to call Numpad Period from script.

I see.. what you're doing there is using a Camera to render. This (although seemingly related) has nothing to do with view32.view_selected() -- which only controls the viewing angle of the viewport, in much the same way as you would use your mouse to position the view so you could see stuff better.  ---- That being said you can allign the active camera to the view using another command.bpy.ops.view3d.camera_to_view_selected()

i'll update my answer so this isn't lost

Thanks again @zeffii ! Now I get: http://156.54.99.175/3d/preview2.jpg how about light? How to get better light in scene? I have to act on the context?

you should ask a separate question about lights.. and scripting of light positions.


text:
How to run script on Blender Quit
Is it possible to set Blender quit callback? I just need to execute come code when quiting from Blender

You might also try the atexit module
import time
import atexit

filepath = r"C:\Users\pink_vertex\Documents\Blender\log.txt"

@atexit.register
def on_exit():
    with open(filepath, "a") as output:
        output.write(time.strftime("Exit on %d.%m at %H:%M:%S\n"))

There's currently no event handler for blender Quit. See event handlers
What I might do in your situation is write an operator and make it an add-on (or add it to an existing add-on), which first runs some arbitrary code, then triggers bpy.ops.wm.quit_blender()
quit_with_sidefx.py:
bl_info = {
    "name": "Quit with Side Effects",
    "version": (1, 0),
    "blender": (2, 76, 0),
    "description": "Quit blender after running some code",
    "category": "User Interface"}

import bpy

def do_this_code():
    print('this happened')
    pass

class INTERFACE_OT_quit_withfx(bpy.types.Operator):
    bl_idname = "wm.quit_with_sidefx"
    bl_label = "Quit With Side Effects"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        do_this_code()
        bpy.ops.wm.quit_blender()
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

enabled here

triggered either via a custom keyboard shortcut (different topic) or simply via spacebar search

You could ofcourse also add the operator to the File menu. Making modifications in standard menus (like swapping out the existing Quit operator with the Quit With SideEffects operator) is not a convenient way to do this and I won't cover it.
Keyboard shortcuts maybe the easiest way to trigger the operator. It's easy to re-purpose the existing Quit shortcut by changing the operator path.

Thanx, but user shouldn't know about callback executing. He just quit from blender. And i want to run script at this point.


text:
Why is the color white darkened through glass?
So here are two pictures, the first one Has the outer eye object, which is just solid glass, and the inner eye, which is has a UV map of an eye. The second having just the inner eye. I took a screenshot of my whole screen so you could see I turned the outer eye visibility off on the top right.

Why does the glass darken the inner eye when the light is shining right at it? I could understand the outer eye is reflecting the background, but the light is shining directly at the left eye (as you can see in picture 2).
How do I fix the darkening while keeping the reflective property of an eye?

After some extensive testing, I have found that you need to add a glossy effect to the inner eye. For the outer eye, you need to have a mix shader with a glass and transparency shader connected to it.