How to create a Cycles material with python to bake a curvature map I want to make a script that bake a curvature texture at the resolution set automatically (i am creating a script that bakes every maps at once).

The script needs to create a textures, use the resolution entered, create a material with an emit shader and for the input a Geometry > Pointiness then a Color Ramp at 0.4 then 0.6.

It needs also to check is there is an existing node and texture with the same name already, if yes it should remove it. Then the script save the texture.

I have started the beginning of the script, the material part is missing:

import bpy

size = 2048, 2048

# create the texture, delete the old texture
image = bpy.data.images.new("curvature", width=size[0], height=size[1])

# create the material nodes, delete the old texture
bpy.data.materials.new("CURVATURE")

# to use once the material is created correctly
#bpy.data.objects['HP'].active_material = bpy.data.materials['CURVATURE']
#bpy.data.objects['LP'].active_material = bpy.data.materials['CURVATURE']
#bpy.ops.object.bake(type="EMIT", use_selected_to_active = True, use_cage = True, cage_extrusion = cage_size, margin = edge_padding, use_clear = True)

#need to get the name of the image on the variable image
image.filepath_raw = "//curvature.png"
image.file_format = 'PNG'
image.save()

zero025 helped me to code it:

import bpy

#Generate the textures and shader
#################################
#Get texture in data-block
###########################
tex = bpy.data.images.get("curvature")

#If exist or not
#################
if  tex is None:
    #create texture in data block
    tex = bpy.data.images.new("curvature", width=size[0], height=size[1], alpha = True)

    #Create material nodes "CURVATURE"
    ################################################################

    # Test if material exists
    # If it does not exist, create it:
    mat = bpy.data.materials.get("CURVATURE")

    if  mat is None:
       mat = bpy.data.materials.new("CURVATURE")

       # Enable 'Use nodes':
       mat.use_nodes = True
       nt = mat.node_tree
       nodes = nt.nodes
       links = nt.links

       # clear
       while(nodes): nodes.remove(nodes[0])

       d_geometry  = nodes.new("ShaderNodeNewGeometry")
       d_colorramp = nodes.new("ShaderNodeValToRGB")
       d_emission = nodes.new("ShaderNodeEmission")
       d_output   = nodes.new("ShaderNodeOutputMaterial")
       d_image   = nodes.new("ShaderNodeTexImage")

       d_geometry.location = (-100,-100)
       d_colorramp.location = (200,-100)
       d_emission.location = (500,-100)
       d_output.location = (700,-100)
       d_image.location = (300,300)

       d_image.image = tex
       d_colorramp.color_ramp.elements[0].position = 0.4
       d_colorramp.color_ramp.elements[1].position = 0.6

       links.new( d_output.inputs['Surface'], d_emission.outputs['Emission'])
       links.new( d_emission.inputs['Color'], d_colorramp.outputs['Color'])
       links.new( d_colorramp.inputs['Fac'], d_geometry.outputs['Pointiness'])

#BAKING
#########################

#Curvature map

#remove every material slot of the high poly
bpy.ops.object.select_all(action = 'DESELECT')

bpy.ops.object.select_pattern(pattern="tmpHP")
bpy.context.scene.objects.active = bpy.data.objects["tmpHP"]

for ob in bpy.context.selected_editable_objects:
    ob.active_material_index = 0
    for i in range(len(ob.material_slots)):
        bpy.ops.object.material_slot_remove({'object': ob})

bpy.ops.object.select_pattern(pattern="tmpLP")
bpy.context.scene.objects.active = bpy.data.objects["tmpLP"]

print("\n> Baking: curvature map\n")

bpy.data.objects['tmpHP'].active_material = bpy.data.materials['CURVATURE']
bpy.data.objects['tmpLP'].active_material = bpy.data.materials['CURVATURE']
bpy.ops.object.bake(type="EMIT", use_selected_to_active = True, use_cage = True, cage_extrusion = cage_size, margin = edge_padding, use_clear = True)


Shadow Catcher makes transparent the object that should make the shadow on the ground I'm trying to make a little animation,with Jesus Christ that's pierced on the rib by Longino. I got the characters from Blend Swap (a special thanks go for the creators) and I rigged them. Now I would like that the roman soldier and the cross make the correct shadows on the ground. So I started with the cross. I found this tutorial and I tried to follow. As you can see from the pictures attached below,the cross shouldn't be transparent.

I also attach the blender file.

I think you are confused on what the shadow catcher is supposed to do.

The shadow catcher would be an object whose only function would be to catch the shadow and be transparent, so that it can be overimposed over 2D images mainly. it is not meant for the object projecting the shadow. (read this link as an example of one of the uses for a shadow catcher: How to make a model cast shadows onto the world texture/background?)

If you wanted to project the shadow of a 3D object into a picture of a floor or wall that is just a 2D image then you would use a plane to work as a shadow catcher to create fake shadows.

In this case you want an object to cast a shadow on another 3d object, you just have to use a diffuse shader on the object and it will cast a shadow depending on the light you are using.

Part of your problem is that the background you are using is set to a strength of 1, creating a very bright flat illumination. Bring it down so you can see what the other lights are doing.


Can you add more loop subdivides later? If you create an object, then subdivide it (ctrl +  r), how can you later add more loop subdivides?

For example, if I try and add more loop cuts, the are confined to only a portion of the cube.

Yes and no.

One thing you can do is this:

Switch to edge select mode (⎈ Ctrl↹ Tab)
Select an edge ring (⎈ Ctrl⎇ Alt RMB)
Multi select edge loops (Fastest to access via the Space menu)
Subdivide

Example:

However this only lets you double the number of existing loops.

Without deleting loops/other manual tricks, I don't think there is currently a way of getting a precise number of evenly distributed loops, especially on more complex objects.

See Is there any way to edit parameters for an object after it is created?


Texturing with remesh modifier I find the remesh modifier very useful when placed above a displacement modifier in the modifier stack.  It saves the trouble of having to add loop cuts all over the place to get square faces.  And then I can also edit the mesh fluidly without having to dissolve and replace zillions of loop cuts.

But the only problem is that the remesh modifier eliminates all UV mapping I have done on the model.  I can use object mapping coordinates for boxy models but for non-squarish models, or when using a strongly patterned texture this does not work at all.  This especially does not work on cylindrical objects (most often wood logs or trees), which is where the remesh modifier is the most valuable.  With remesh I can lengthen/shorten the cylinder by simply moving its end face without having to dissolve all the loop cuts and add them again.

Here are some examples on a simple building-like model:

With no modifiers:

With remesh (desired result):

With subsurf, notice quads are not evenly sized or squares:

Any suggestions for other mapping techniques that work with remesh would be great.  I am also open to alternatives to remesh that accomplish a similar goal of creating even square faces as I use this technique a lot.

If you're only using the Remesh modifier with the purposes of subdividing the model then the 'Subdivision Surface' modifier set to 'Simple' subdivision will probably be better.

This will subdivide the object in a similar manner to doing W> Subdivide in edit mode, but will not change the shape of the object like the default 'Subdivision Surface' modifier will:

At least on a simple test, it doesn't seem to distort the UVs and leaves them intact.


Tips on increasing light I have been following a tutorial by BlenderGuru. I've done a render below however the scene seems to be quite dark, even though there are several light sources involved. Sorry if this is a noob question but any tips on increasing the light levels? Let me know if you need to see any particular settings as I'm still new to this...

If you are using Cycles render, select the light source and just go to the light tab in the inspector. There, just bump up the strength! Alternately, you could add more light sources, or change the lighting type.


Parenting with automatic weights fails with an error? I've worked on this character mesh and when I parent the rig to the mesh, I get a "bone heat weighting" error and nothing happens. Can anyone fix this?
Here is the link to the .blend file.

Here is a picture, just to let you know what the setup looks like:

It is the model's hair which leads to the error it isn't symmetrical.

If you separate the hair from the rest of the model it works fine:

In Edit Mode

Select one of the hair's faces
P shows the separate popup, Choose By Material

You can parent it later to the model.

In Object Mode

Select the mesh
Select the Armature
Ctrl-P With automatic weights

Note: When exporting from MakeHuman you can also export with a rig (personally I prefer the MHX rig because it doesn't pollute the outliner with all these WGT* objects)

Related:
What are the not so obvious features of Rigify?


Extension of standard operator How can I add additional code for already existing operator? For example, I want to add into bpy.ops.wm.save_mainfile this string:

print("My code")

I know that I can override this operator by creating a custom one with similar bl_idname, but previous features (saving functions in this example) will be destroyed too.

Hope for your help!

Okay, after many time of research I found a quite enough answer on my question. I rephrased what I want and made the following things.

Custom operator

First I created a custom operator. It looks like this:

class SaveFile(bpy.types.Operator):
    bl_idname = "my_wm.save"
    bl_label = "Save My File"

    def __init__(self):
        print("It is working now")

    def execute(self, context):
        try:
            bpy.ops.wm.save_mainfile()
            print("My code!")
        except RuntimeError:
            print("ERROR: Can't save file!")

        return {'FINISHED'}

    def invoke(self, context, event):
        return self.execute(context)

After that I registered it:

bpy.utils.register_class(SaveFile)

Invocation

In the places, where I want to execute my custom code, I use this:

bpy.ops.my_wm.save()

Hope that it will be helpful for somebody else.


Test if .blend is running in background I'd like to know if it was possible to test if my .blend, who is running in background, still open and, if it's possible, how can i do that with python please ?

Blender has a variable you can check for that bpy.app.background

  Boolean, True when blender is running without a user interface (started with -b)


Viewport material view I'm wondering why viewport material shading would draw an image texture fine, but doesn't seem to be able to draw a procedural texture:

The same is true for texture shading. Is it possible to get procedural textures drawn in the viewport without having to render?

No.

This is because the procedural texture is actually calculated by the render engine. The closest you can get is by "caching" the texture to a conventional raster image via texture baking, then using that as you would any other image texture.


How to create automatic follow-up (delayed) animation for child objects? I have a parent object with several child objects. I would like to animate the parent object with child objects following up with slightly delayed time. How can I achieve this? Thank you.

You can use the Slow Parent Option available in the object relations properties.

After setting up you parent/child chain of objects go to each object individually and under the Properties Window > Object > Relations Extras tick Slow Parent option. Bellow it set the desired delay in frames.

You can select all relevant objects and click the properties wile pressing the Alt key to set the values for several selected objects at once. Alternatively right click and choose Copy to Selected.


smoke&Fire CPU & GPU now getting black box It was working, I finally got it to where i wanted it, then rendered it and the fire was not showing up, then i removed some extra nodes I had put in other then the flame ones needed to be added, then the box went black, and I removed the smoke and added it again, changed the setting to where they needed to be, and still I am getting black box using both the cpu or gpu

MOdded
add pic, I downloaded what I uploaded, and got it working before I changed the smoke fire settings, should not matter but it is not rendering fire.

cpu or gpu with  partial system.

Don't plug volume shaders into the surface of the smoke domain.

They should be connected to the volume socket.


Can't use "Selection Popup Menu" Alt + Right Click (v2.76) I read this topic: "11 Useful Blender Tricks You May Not Know"

http://www.blenderguru.com/articles/11-useful-blender-tricks-you-may-not-know/

And got trouble with number #11: Selection Popup Menu, Hotkey: Alt+Right Click

I try to Alt+Right Click on Object Mode and Edit Mode but nothing happen, did i do wrong or miss something, i use blender 2.76, please help !!

You have to have multiple objects in your scene. Sometimes the scene is so crowded, that some objects overlap each other, so you press the Alt+RMB to choose the desired one. In my case I have the main model, the bones (metarig) and the rough proxy mesh. As you can see, when I hover the cursor over object and press Alt+RMB the pop up menu appears.


How can I undo an Automatic Weight? I can't seem to find a place to undo an automatic weight I applied to my mesh. Is it possible to undo this?

Yes you can.

Just go into the Vertex group. Look for the down arrow button, right click on it and select "delete all groups".


Fabric material (coloured) Does anyone know an idea to accomplish this from the picture?

(source: emancipath by Zeitguised)

Use a wave texture except use no ondulations. Put texture coordinates to object (so it will use a triplanar texture space).


How can I get the projection matrix of a panoramic camera with a fisheye equisolid lens? I am working on a project in which i used the panoramic camera with fisheye equisolid lens on Cycles render. For some tests, I need the projection model that uses by this camera to project a 3D point on a 2D image plane. Any help?

I needed to do this recently. I think the following code should do the trick.

p is our point in 3D space.

camera = bpy.data.cameras["Camera"]
scene = bpy.context.scene

f = camera.cycles.fisheye_lens
w = camera.sensor_width
h = (3/4) * w # Depends on aspect ratio. For some reason I don't get the correct value from camera.sensor_height

camera_ob = bpy.data.objects["Camera"]

p = camera_ob.matrix_world.inverted() * p
p.normalize()

# Calculate our angles
phi = math.atan2(p.y, p.x)
l = (p.x**2 + p.y**2)**(1/2)
theta = math.asin(l)

# Equisolid projection
r = 2.0 * f * math.sin(theta / 2)

u = r * math.cos(phi) / w + 0.5
v = r * math.sin(phi) / h + 0.5

x = u * scene.render.resolution_x
y = v * scene.render.resolution_y


How do i delete the inner side of this shirt How can i select only the inner side of the shirt and delete it so that i only have the outside faces of the shirt?

One way to do this is:

Limit selection to visible
Select all outside faces with C (do not select faces on the edge)
Change selection type from faces to vertices
Press ctrl-I to select the inverse (now you should have the inside selected)
Delete selected vertices


blender 2.91.2 bevel node doesn't work properly bevel node doesn't work properly in rendered mode with cycles, it darken the edges rather than soften it

You need to lower the radius in the bevel node.
If your cube is 2 units wide and the bevel radius is 1 m, it means the normals are interpolated right to the middle of each face, generating artifacts. Try the default (0.05).
Examples of the effect of the radius field :


How to control start and stop of fluid simulation How do you control when the fluid animation starts and stops? Because I want it to start a couple seconds in and then stop a few seconds later.

Animate the Fluid's Enabled property by inserting Keyframes.


Key Sensor | KEY + SHIFT ( with First Modifier ) Good Morning

I try to use the first and second modifier in the key sensor, but I can't find more information or examples of this, example

I try a simple combination in the pic but it does not work

S+SHIFT and/or S+CTRL

somebody can make a example of this, please

PLEASE IN LOGIC BRICKS
thanks

REFERENCE
(Blender Game Engine) Walk and Run cycle sound problems

The keyboard sensors allow to sense up to three keys being pressed at the same time.

It is the same behavior as three keyboard sensor's connected to a single AND controller.

There are some things to know about:
- Keyboards can deal with 3 pressed keys -> but more keys might not sensed (this is an hardware/OS issue)
- Keyboard sensors sensing one of the (already sensed) keys will still measure the single key press. It will not automatically ignore the single key because a modifier of another keyboard sensor is pressed.

Exclusive events

When you want to deal with  +  and  differently you need to describe it explicitly:

 AND
 AND not

The first condition can be sensed with the modifiers as you do already. Alternative you can use two keyboard sensors with AND.

The second expression requires two keyboard sensors:

-> Keyboard sensor sense

-> Keyboard sensor sense  [inverted]

combined with AND

or

-> Keyboard sensor "A" sense

-> Keyboard sensor "Shift" sense

(both positive)

combined with expression controller: "A and not Shift"

The last option can be used to reduce the number of involved sensors:


How to get the truly width and height of frame when rendering? (It would be good if I can render without saving images) I would like to know the width and height of frame when rendering.

And I found that someone has ask the familiar question, "How to access Render Result pixels from python script? "(see here)

So, I added some codes in the codes answered by wsfax (see original codes) , like this script(*).

import bpy

path_name = ''
file_name = 'test_2017'
file_path_name = path_name + file_name + '.blend'
bpy.ops.wm.open_mainfile(filepath = file_path_name)

# switch on nodes
bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
links = tree.links

# clear default nodes
for n in tree.nodes:
    tree.nodes.remove(n)

# create input render layer node
rl = tree.nodes.new('CompositorNodeRLayers')
rl.location = 185,285

# create output node
v = tree.nodes.new('CompositorNodeViewer')
v.location = 750,210
v.use_alpha = False

# Links
links.new(rl.outputs[0], v.inputs[0])  # link Image output to Viewer input

# Render and save image
bpy.ops.render.render()

# get width and height
width_of_render = bpy.data.images['Viewer Node'].size[0]
height_of_render = bpy.data.images['Viewer Node'].size[1]
print("width: ", width_of_render, "height: ", height_of_render)

# get viewer pixels
pixels = bpy.data.images['Viewer Node'].pixels
print(len(pixels)) # size is always width * height * 4 (rgba)

What I mainly did is using bpy.data.images['Viewer Node'].size[0] and bpy.data.images['Viewer Node'].size[1] to get the width and height.

I tested a simple blender file (test_2017.blend) only containing a cube and executed it in command line, and got 262144(pixels), width = 256(pixels), and height = 256(pixels) in command line.

However, When I opened blender file (test_2017.blend) and executed script(*)(without line 3 to line 6) in blender, I got 2073600(pixels), width = 960(pixels), and height = 540(pixels) in console window.

I have no idea why they are different?

And then I saved image when rendering, the width and the height of the image were 960(pixels) and 540(pixels).

How can I get the truly width and height? (It would be good if I can render without saving images)

You can get the Python expressions needed by enabling Python Tooltips in the User Preferences, "Interface" tab. Then you can just hover over the resolution settings in the render panel, and see you can use bpy.data.scene["Scene"].render.resolution_x. It's better, though, to use the currently active scene, rather than hard-coding the scene name. Also you'll want to multiply with the resolution scale percentage. This leads you to:

render = bpy.context.scene.render
scale = render.resolution_percentage / 100
rsize_x = render.resolution_x * scale
rsize_y = render.resolution_y * scale


Rotate the plane about x,y,z axis in Blender When press R in Blender, I can rotate the plane about the axis from user view to origin.There is also a option to constraint the axis. When I ticked x axis, I expected that I will be able to rotate the plane about x axis shown by red in view. But it clearly doesn't work in this way, because by ticking or unticking whichever axis nothing special changed when rotated.

In general these:

R,X
R,Y
R,Z

Will start rotating whatever it is around the global x,y,z axises, and these:

R,X,X
R,Y,Y
R,Z,Z

Will start rotating around whatever transform type is listed in the box in the 3d View Header:

(Normal is equivalent to Local for objects, but averages selected normals when editing meshes.)

As an aside, if your objects are rotating around unexpected places check the left two buttons in this picture.


Invalid Python expression when using driver with Python script I'm trying to use a python script as an expression in a driver. It was working fine at first and then all of a sudden I get the error message ERROR: Invalid Python expression.

I've tried running the script in the text editor multiple times with no errors, but I get an error in the driver section. Anyone know how to solve this?

Scrip in text

import bpy

prevTime = 0

###
# Rotates the object with the rotSpeed value in radians/s
###
def rotate(rotSpeed, curRot):
    scn = bpy.context.scene
    curFrame = scn.frame_current
    fps = scn.render.fps

    # Calculate total playtime
    time = curFrame / fps

    # Get delta time
    dt = time - prevTime

    # This will set the current rotation value of the object!!
    newRot = curRot + rotSpeed * dt

    # Set new previous time
    prevTime = time

    return newRot

# Add to driver namaespece to make it accessable
bpy.app.driver_namespace['RotWithSpeed'] = rotate

EDIT: The error occurs when I add the line "prevTime = time".

Found a solution after a while. Seems like global functions doesn't work the same way in Blender as in raw Python.

I used mini3d's solution found on the blender forum: https://www.blender.org/forum/viewtopic.php?t=27291

Here's a summary of the solution

import bpy

# Define global variables
bpy.types.Scene.prevTime = bpy.props.FloatProperty()

def getSettings():
    settings = bpy.data.scenes.get("Settings")
    if settings is None:
        settings = bpy.data.scenes.new("Settings")

    return settings

def rotate(rotSpeed, curRot):
    .
    .
    getSettings().prevTime = time
    .
    .

EDIT: Global variables do in fact work the same way. The following solution is much cleaner as suggested by batFINGER

The problem was that I tried to edit a global variable in a function without using the keyword "global".

import bpy

# Define global variables
prevTime = 0

def rotate(rotSpeed, curRot):
    # This will give us the ability to edit the global variable
    global prevTime
    .
    .


How to create child-of constraint I've looked all over the internet and found plenty of information on child-of constraints, but no site actually tells me how to make one. How are constraints made?

Select your object. Go to the the contsraints section of the properties window and add Child of constraint.Then select what object you want to use as target.

more info here: https://www.blender.org/manual/rigging/constraints/relationship/child_of.html?highlight=child


Inconsistant behavior when re-linking missing textures. sRGB and Non-Color mismatches I am having some trouble when re-linking image textures that have single user copies using different color spaces. I.E. A texture being used multiple times in the file, both in Non-Color and sRGB color spaces:

Create two objects and assign a unique material to them.
Plug in the same image texture into the base color of each object, but make one of them a single user copy set to "Non-Color" instead of "sRGB".
Rename the texture on disk to something different to break the links.
Point your materials to the new texture on disk.
Notice that your single user copy is no longer a single user copy. If you change the color space to non-color, the other material will change too.
This can be mitigated in simple scenes by making another single user copy. But if this material is used all over it can quickly become a nightmare trying to remember what was supposed to be sRGB and what was supposed to be non-color.

I can provide more images if any of this is confusing.
Is this working as intended? Or is this a bug? If I make a single user copy, I expect that datablock to function independently from the copy. But the process of re-linking the texture breaks this.
Any help would be great. Thanks!

When opening a new texture, Blender doesn't know it's meant to be a single user copy.
You should Remap the old texture instead, so it'll change for all materials at once.

Add your 'new texture.jpg', with a second copy (new texture.001) for the non-color variant
Open Outliner > Scene
Right click the 'old texture.jpg' and go > Remap users > 'new texture.jpg' > OK.


General system specs for large scenes in blender What are the system requirements for working with complex geometry in Blender? Things like RAM, GPU, CPU etc.?

Blender's website has a page dedicated to this, it is now dated a few years but is still useful (was updated for 2.6).

http://archive.blender.org/features-gallery/requirements/index.html

If you are considering building a PC for 3D, anything from Average and up should suffice for fairly complex scenes.

  Minimal specs for Hardware

  32 bits, Dual Core CPU with at least 2 GHZ, and SSE2 support.
  2 GB RAM
  24 bits 1280x768 display
  Mouse or trackpad
  OpenGL Graphics Card with 256 MB RAM

  Average specs for Hardware

  64 bits, Quad Core CPU
  8 GB RAM
  Full HD Display with 24 bit color
  Mouse or trackpad
  OpenGL Graphics Card with 1 GB RAM

  Production specs for Hardware

  64 bits, Dual 8 Core CPU
  16 GB RAM
  Two times Full HD Display with 24 bit color
  Mouse + tablet
  Dual OpenGL Graphics Cards, quality brand with 3 GB RAM

Also related: What are the best graphics cards for cycles? and How important is a GPU for modeling?


How can I move inside the scene with a midle mouse without limits? I need to record a camera movement by using the mouse (scrolling or ctrl + Middle Mouse) but the problem is it just stops very quickly and doesn`t let me passing through the whole scene, is there a way to expand it somehow?

I think you are looking for "continuous grab" it can be turned on/off under User pref->Interface. Alternatively you can "focus view" with alt+midclick while hovering over something. Or you could type "walk/fly navigation" after hitting space. Hope it helps


Dynotopo warning “Vertex Data Detected” I am doing an Anime female model for my animations I am not a beginner, but still finding my way around Blender.
It seems like every object I use that is poly does not work I use the subdivision modifier. So there is plenty of polygons to sculpt. Then go to sculpt then get the Vertex data warning. I get spikes in my objects which is annoying.
I tried sculpting the character but I like building the character the way I want then start sculpting.
I have been having these issues for months.
I would really appreciate the help. Thank you

I'm new to blender have version 2.90...
Maybe you can try this.
Click on the "Object Data Properties" tab (the green triangle, third last  on the right), then unfold "UV Maps" and click the minus symbol on the right.
I don't know what will be the effect but I'm sure it'll not complain you...
Hope it will help.      Thank you!


how to combine free floating meshes So I have made 4 box objects and after moving them to make a perfectly spaced grid I then combined them to make one object.

They all share the same edges (I think) or at least they are in the same places. O_o

How would I combine all of these boxes so that they maintain their individual faces but are connected at the edges?

In Edit Mode select all A, press W > Remove Doubles.


Dark reflections on glass I have a building with a lot of glass, when i render i get this.

The reflection on the glass its awfull.

I have a proper HDRI, and tried to just place lights and same result.
Some idea?

The reflection on the glass is awful because you don't have it enabled. Turn up the Specular parameter and adjust the Roughness to get the desired effect:


How come when I render my animation, the audio is clipped when I stitch together the pieces? I have a slow computer, and I have an animation of 4400 frames. If I render all at once, it would crash. So I made this Python script to try to help me:

#START OF SCRIPT

import bpy
import time

wait = time.sleep
start = 0
end = 4400
increment = 10

current = start

for i in range(start,end + increment,increment):

    wait(2)

    current = i

    bpy.data.scenes["Scene"].frame_start = current + 1
    bpy.data.scenes["Scene"].frame_end = current + increment
    bpy.ops.render.render(animation=True)
#END OF SCRIPT

And I get all of the pieces of the animation:

But when I try to stitch it together like so:

It just doesn't line up. The audio and video are clipped in-between, and the amount of audio frames just doesn't line up with the video.

Did I do something wrong with the script? The stitching? The animation? Please help soon, as I am trying to make this as a Christmas present.

These are the steps I took: https://www.youtube.com/embed/VVY6C2K_1wM
Here is the file: http://www.pasteall.org/blend/33331

It is good practice to not render out movie strips to a single move file. Instead you should render images as .PNG files and add the images together in the video sequence editor. Then add the original audio clip afterwards, in the final edit. I wouldn't recommend using a script at all.

Change output to PNG:

Set range to 100 frames(to test with):

Then press the normal animation-render button:

When that's done, you go to video editing and press "Add" -> "Image" and select all 100 images.

Blender will then treat this as a movie strip.

Then you add the audio clip, and adjust so the timing matches


How can I select all objects with the box select tool in blender 2.8? I entered Edit Mode, and try to use selection box to drag and select multiple objects, but the selection box can only select some surfaces that facing me, the inside surfaces and the surfaces at the back can not be selected.

What am I doing wrong?

Alt+Z to enable X-Ray mode. 'Box/Circle/Lasso Select' then picks up everything.


Modifiers: add and set "live" parameters then apply via python Here is my question: I have a single object and 5 modifiers to be applied to it. I would like to:

Add all of them together
Allow the user to change a set of parameters with some GUI, maybe a bar scrolling from a minimum to a maximum value
Allow the user to apply the modifiers (all together) when he is satisfied with the result.

Let's keep it simple for now and let's say I consider

DECIMATE MODIFIER with the ratio parameter to be set
WIREFRAME MODIFIER with the thickness parameter to be set

Point 1.

I was thinking to something simple

Code:

class AddModifiers(bpy.types.Operator):
    bl_idname = "modifiers.add"
    bl_label = "Adding Modifiers"
    bl_options = {"UNDO"}

    def execute(self,context):
        obj = bpy.context.active_object
        bpy.ops.object.modifier_add(type='DECIMATE')
        bpy.context.object.modifiers["Decimate"].ratio=0.5 # parameter inizialization
        bpy.ops.object.modifier_add(type='WIREFRAME')
        bpy.context.object.modifiers["Wireframe"].thickness=2 # parameter initialization

        return {'FINISHED'}

class Panel(bpy.types.Panel):
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"
    bl_context = "objectmode"
    bl_category = "Modifiers"
    bl_label = "Add Modifiers"

    def draw(self, context):
        layout = self.layout
        # ALLINEAMENTO
        row = layout.row(align=True)
        row.alignment = 'EXPAND'
        row.operator("modifiers.add", text="Adding Modifiers")

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

register()

Point 2.

Really don't know how to do that... class and gui...

Point 3.

Adding a class like that (with its own button in the gui of course)

Code:

class ApplyModifiers(bpy.types.Operator):
    bl_idname = "modifiers.apply"
    bl_label = "Applying Modifiers"
    bl_options = {"UNDO"}

    bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Decimate")
    bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Wireframe")
    return {'FINISHED'}

In point 1 for the add modifiers operator you set obj to the active_object but don't use it. Rather than using other operators it would be better to perform the task as -

obj = context.active_object
dm = obj.modifiers.new('Decimate','DECIMATE')
dm.ratio = 0.5

And similar for other modifiers.

For point 2
Inside draw() for your panel class you want to add

obj = context.active_object
row.prop(obj.modifiers['Decimate'], "ratio")

That will show the decimate modifiers ratio property right there in your panel. Adjust for other modifier properties you want.

For point 3 the apply modifiers needs to be inside the execute function.


How to make object slightly thinner? I have an object which is to be 3D printed.  This object will then be assembled with other objects.  However, due to the 3D printer being not very exact, I need to add a small tolerance to the object (i.e. make the object a bit thinner) so it will fit with the other objects.  I would also like the base of the object to be slightly thinner than the middle and top, to offset the object being fatter at the base where the first few layers are printed.

Here is a screenshot of the object:

Specifically, I would like to move all horizontal edges at the top of the object slightly "inward" on the XY-plane by a constant amount, and move all horizontal edges at the bottom in a similar way by another (larger) constant amount, while preserving the height of the object on the Z-axis.  All edges that are currently parallel to each other should remain so.

The effect would be that all points inside the modified object are also inside the original object, and the hole in the middle becomes slightly larger.

Note: The Alt-S command does something similar to what I want, but it doesn't seem to allow me to lock the Z-coordinates.  I do not want the height to decrease.

EDIT: Here is my .blend file.

Here's how I did it (and I think this is the cleanest method):

0. Original object

1. Loop cut the original object twice

As the object has a hole, the Loop Cut and Slide (Ctrl+R) tool doesn't loop cut both the internal and external sides together.  A better way is to use the Extrude Region (E) tool.

Rotate view totally horizontal, and with the face select mode enabled, select all the bottom faces:

Use the Extrude Region tool to extrude the bottom faces by 1 mm (this will be the height of the bevel at the bottom).  Use the Extrude Region tool again to extrude by another 1 mm (this value is arbitrary, and will be removed later):

2. Reduce the thickness of the object

Select all the side faces:

Using the Shrink/Fatten (Alt+S) tool, shrink the object by 0.2 mm (this is the tolerance of the object).  Hold down the Alt key while pressing the Enter key to enable the Even Thickness option.  This is the result:

3. Make the bevel at the bottom

Select the side faces nearest to the bottom of the object:

Use the Shrink/Fatten (Alt+S) tool to shrink the faces by 1 mm (the width of the bevel).  Again, hold down the Alt key while pressing the Enter key to enable the Even Thickness option.  This is the result:

4. Remove the the part of the object below the bevel

Select the bottom faces:

Translate the faces upwards by the arbitrary amount chosen in Step 1 (in this case, it is 1 mm):

Switch to vertex mode, and re-select all the bottom vertices:

Use the remove doubles tool to remove the double vertices:

5. Reduce the extra height from the bevel

Select the vertices at the bottom two layers (encompassing the whole bevel region):

Translate the vertices upward by the height of the bevel (1 mm in this case):

Done!


Using python and bmesh to scale/resize a face in place I'm playing around with bmesh and have run into something I can't figure out how to do and can't find any related documentation on.

I have extruded a face directly outward (after subdividing a larger object to create it) and now want to scale it inward after the extrusion. When I try to use bmesh transform and scale operators (code below), it ends up moving the face location, apparently in relation to the global space. It seems like the answer is related to feeding the proper matrix into whatever function I'm calling, but I haven't quite wrapped my head around how it all works yet.

Here is what the result looks like just after the extruding operation:

And here is what I'm trying to achieve:

Basically, what I want is to use the equivalent of:

bpy.ops.transform.resize()

...inside of bmesh, to scale the face on the X and Z axis in place/relative to the face center.

I've tried performing the operation using the scale operator with different "space" arguments:

face = bm.faces[0]
bmesh.ops.scale(
    bm,
    vec=(.5, 1, .5),
    space=matrix,
    verts=face.verts
)

I've also tried using the transform operator with manually constructed matrices

face = bm.faces[0]
matrix = mathutils.Matrix([ ... ])
bmesh.ops.transform(
    bm,
    matrix=matrix,
    verts=face.verts

I can't figure out how to get the boundaries of the scale transformation space to be confined to the face area.

Thanks for any insight or help!

Scale the distance from face centre to vert.

Propose in this case could simply use the face centre as stationary point, and reposition each vertex coordinate by a scale factor.  For a face face with a centre c = face.calc_center_median()  having a  vertex v the vector v.co - c represents the straight line from vert to c. Can then move the vertex to a new location by a factor along this line v.co = c + scale_factor * (v.co - c)

Example script, run in edit mode with the face you want to scale  active.

import bpy
import bmesh

context = bpy.context
ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
scale_factor = 0.5

face = bm.select_history.active
if isinstance(face, bmesh.types.BMFace):
    c = face.calc_center_median()
    for v in face.verts:
        v.co = c + scale_factor * (v.co - c)

bmesh.update_edit_mesh(me)

Have assumed the face is co-planar

Using Matrices.

Another way to achieve this is using matrices, v.co = c + scale_factor * (v.co - c) Indicates the operation needs both a transformation and scale. For the transformation can change the space locally such that the point c becomes the origin.  (Wont be shifted by any scale).

face = bm.select_history.active
if isinstance(face, bmesh.types.BMFace):
    c = face.calc_center_median()
    T = Matrix.Translation(-c)
    S = Matrix.Scale(scale_factor, 4)
    bmesh.ops.transform(bm, matrix=S, verts=face.verts, space=T)


Textures not showing up in rendered mode I just finished modeling my first 3D model while following a tutorial and I got to texturing. I did flat colors just to start out, but (and this may have been where I went wrong, but it wouldn't get it to work any other way) I did my painting on the checkered material instead.

I saved my texturing image but the textures never load in any mode other than texture paint mode with solid viewport shading. Nothing shows up at all in rendered mode. I can't figure out where I went wrong because I'm new at Blender. Any help is greatly appreciated!

The problem existed because of multiple materials assigned to object. Which most of them was Cycles materials.

First step is go to Object Mode and in Material tab delete any unnecessary materials and leave only the one you will use ("character" at the bottom of the list).

Next switch to the Texture tab and check preview to Texture (not needed but helpful), select image "checkered" and check View as Render.

Everything should now work just fine.


How do i copy material from one .blend file to another? I have two different files (rigs) which I would like to append one to the other, I did this by appending the object of one. Although now the material of this object is missing. How do i append it?

You append Materials like everything else in Blender:

In your new blend file, go to append:
Select the blend file with the original material, and click "Append" to browse its contents.
In it, go to the folder called "Material" (or "Mesh" or "Object" or "Texture" or something else depending on what you want to append)
Select the materials (meshes, objects, textures, ...) you want to import and hit "append from library".


Final render different than preview, black artifacts appear Update: Added edge split modifier, now it works. I don't understand any of this.

I'm going crazy over this. Tried rendering in 2.75 and 2.76b. Same result.

I have this piece of a sword that just looks completely different on the final render than on the preview. And all the "render" vs. "view" settings are completely identical. And there are no object that render but are hidden or vice-versa.

The material is a mix of anisotropic and glossy, in the top right you can see the rendered .png and at the bottom it's my 3D view in render view. Do you see the black artifacts? They just won't go. I tried messing around with the subsurf modifier or rotate the mesh, but some black crap always appears anyway.

Just have a look at this. How come is the final render so different from preview in this simple case below?! (just Fresnel->Emission)

I don't understand what's going on. I thought the final render ought to be the same as preview in general. Let me repeat: subsurf has 3 subdivisions for the "View" and also 3 for the "Render". That's not where the difference's coming from.

Please, help me!

Added Edge Split modifier, as suggested in a similar question -->here<--. Now it works.


Blender Python Custom Outliner tableview Blender standard Outliner is not showing to much properties (left tree table).

The option to view the Datafile is not optimize for quick view of the basic information.

Question:

Its possible to show the Location, Dimensions, Scale, Rotation and Custom properties of objects in table-view (right tree table made in Photoshop)?

If its possible, can you tell me witch Blender Outliner system file I have to rewrite (I am a Noobie at Python).

Thanks a lot.

The data shown in the outliner is filtered within blender's C code, the python code used to display it is rather minimal - view it here. Altering the display of the outliner will need to be implemented with C not python. code is here if you want to look.

The data you want displayed is available in the properties sidebar on the right of the 3dView (press N to show/hide it)

You can write an addon to show a customised version of this data, a sample to get you started --

bl_info = {
    'name': 'sample info display',
    'author': 'Shane',
    'version': (1, 0),
    "blender": (2, 6, 9),
    'location': 'View3D > Properties panel > Sample Info',
    'description': 'A simple panel for the 3D view properties panel to show stuff',
    "wiki_url": ""\
        "",
    "tracker_url": ""\
        "",
    'category': 'Properties'}

"""
This script simply places some properties into the 3D view Properies panel.
"""

import bpy

class SamplePanel(bpy.types.Panel):
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_label = "Sample data"

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

        row = layout.row()
        row.column().prop(obj, "location")
        row = layout.row()
        if obj.rotation_mode == 'QUATERNION':
            row.column().prop(obj, "rotation_quaternion", text="Rotation")
        elif obj.rotation_mode == 'AXIS_ANGLE':
            row.column().prop(obj, "rotation_axis_angle", text="Rotation")
        else:
            row.column().prop(obj, "rotation_euler", text="Rotation")

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

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

if __name__ == "__main__":
    register()


Recover corrupt .blend file after power failure I was working on my tutorial based project, when a surge in power made my computer shut down unexpectedly.
When I open my .blend file, it is not showing me anything. It's as if all the objects inside are no longer there, yet the file size has not changed, its still 4.35 MB.
I have tried accessing the autosave.blend file but it gives me an error code that reads "File format is not supported in file:
'C:\Users\my_Computer_name\AppData\Local\Temp\G_wagon_5020_autosave.blend'
I tried opening with another version of blender and it gave me an error that said 'missing DNA block'
Is there any possible way to recover the file to it's healthy state or is there any possible way I can transfer the objects data into another .blend file. Anyway to recover my file data?

Certainly sounds like it ought to read that file.
Something you can try is opening a new file and File>Append>Navigate to your Blend file>Collections and select all the collections.
This should append all the objects with any data attached to them and they should still be in the collection hierarchy that you've used.


MagicMouse and Trackpad Orbiting/Zoom Here is my set up: I'm running Blender 2.76 on a Macbook with an Magicmouse attached. I'm quite happy that in this version as opposed to older versions (this changed around 2.6ish) the two finger dragging on the trackpad acts more naturally (rotating instead of zooming) but unfortunately this messes up the magic mouse as well (scrolling is changed to rotating as opposed to zooming). This video illustrates a method to return this to the old way, but this removes the new trackpad behaviour.

Is there a way to have the trackpad behave the new way while having the magic mouse behave the old way at the same time?

This answer might be a bit late for you but may help other users.
I have found that ctrl + trackpad-scrolling or ctrl + magic-mouse-scrolling zooms.


How to repeat a single frame? I see a lot about repeating an animation sequence, but my issue is much simpler.

I'm using the video editor to make a very simple video, just a slide show really. I have a video of a person giving a talk and I'm just overlaying a set of slides to illustrate her talk. I've got that working very well.

The original video of the talk ends abruptly at the end of her last sentence. I'd like to fix that by extending the last frame for a few seconds and then fading to black. So my question is very simple, but I don't see it answered anywhere:

How do I get the last frame of a video to repeat for a few seconds?

==============================

I tried the technique suggested in the comment by @Edgel3D, but it didn't work. I'm saying that here so I can attach a picture of what happened:

The video strip in channel 2 used to be the same length as the audio strip in channel 1 at 11,575 frames. I pulled out the end handle on channel 2, which seems to have expanded it to either 11,771 frames or 11,772, depending on which number in the image above I should believe. But when I play it, after frame 11,575 the video window goes to a black and grey checkerboard pattern. The last frame is not being repeated. Am I doing something wrong?

In the original video's strip, there are two handles, one at each end. Simply pull the right side's end out with the mouse button. (Left button I think)
Beware of any faulty or black frames that might be present at the end.
These can be sliced off with SHIFT-K.  Delete those.
Once the very end frame is valid video pull the handle to the right and this will extend that last frame out for as many frames as you like. You can use this extension to fade the scene out to black by keyframing the strip's opacity.
Take some abience audio from another part, copy and lay that with the silent extension, fade that out over the same frames as your inserted fade to black.
You can copy/paste the original audio strip, into a free strip and if I remember rightly, you might also be able to duplicate it with SH-D and simply drag the copy up to a free strip.  Once the copy is established, it can be sliced up to extract whatever you want, lay it where it's needed.


Bevel goes in wrong direction and creates disortion I am trying to use bevel on the edge of my circle. When I select only on edge it causes the following problem:

The Bevel is inverted and it stretched over the other two edges.

If I try to do the half circle:

My first Idea was to try to change the vaule of the profile, which didn't help at all. At custom profile didn't help either.

Greetings Dr Deep

//EDIT:
I tried editing the whole circle:

//EDIT 2
Using Inset to remove the Nogone:

The File:

Welcome to Blender Stack Exchange!

I just downloaded the file and inset the ngon like in your first image. I got the same results as you did, but recalculating the vertex normals fixed the issue.

This can be done by selecting everything in edit mode and pressing Shift+N


How to save a group of objects separately for use in other programs? I am new to using Blender, and I think I have bitten off more than I can chew. I'm trying to play with a model of the Mark III Iron Man suit. I have broken it down into 8 different groups thanks to how the file was originally saved. The inner arms, inner legs, inner helmet, inner torso, and their outer equivalents. I want to take apart each group to make it more easy to edit and print. So my question is, how do you save each smaller part separately without going one by one? I'm also including a picture of the inner arms to help you understand what I'm talking about.

V2.80 is brilliant with this.

Select the objects in the Outliner
Right Click on one of the highlighted objects in the Viewport, on the left to the list.
When the poupup menu comes up select Move to Collection menu item.

That will bring up another popup Menu and click on the + New Collection

Another popup menu will show up, click in the box next to the Name, circled, and type in your new collection name you want.

In this example named the new collection MyCollection. Click OK button to create it.

The collection is created and can be collapsed or manipulated making individually visible or hidden with the screen and the camera icons next to them. Or select all the objects in the collection with right clicking on the collection name and selecting from the popup menu Select Objects. See first image selected objects and now included in this newly created collection.

The same way you can create collections within collections, called nested collections.
If you right mouse click on a collection name in the Outliner then from the popup menu you can create a collection with the New menu item and later any selected item can be added to any current collection. In this example adding these 2 additional objects to the MyCollection collection. In this case after step 3 select the desired collection name


Does Blender use Automatic Tweening/Animation? I'm entering into a competition and one of the rules states No Automatic Animation Software.

I just started using Blender and plan to use it more.

Now, I don't know if I have lost several days worth of work, or if I merely need to unmark a checkbox.

The animation features of Blender relies heavily on keyframes and different kinds of interpolation between those. So yes, Blender does indeed use "Automatic Tweening" (but not always as cegaton mentions in the comments).

At least if "tweening" is defined as in this Wikipedia article.


Why do these dark lines appear in render mode? Black lines appear on my mesh when moved away from the origin. The black lines intensify as the mesh is moved further and further from the origin. The black lines only appear in the render view. Any help on the issue will be greatly appreciated. Attached is a photo of the issue and the blend file.

This is a known bug and limitation of Cycles. Does happen in render also, not only in render view.

The solution is to keep everything close by scene origin. You can have the camera stationary close to origin and then move the scene if it is big inversely to do "camera motion".


How to paint with the clone option in Texture Paint? I would like to use the clone tool with texture paint, but as soon as I choose Texture Paint, the mesh is white, and I cannot paint on it.

I created a new UV Map, after I project the image from view, the image of reference appears well on the mesh in Object Mode, but I get this white color in Texture Paint Mode. I followed this tutorial : https://youtu.be/p4ngVoGIj1Q?t=15m56s but the version of Blender is not the same, so the settings are a bit different.

I tried to play with the clone settings, the options in the shader menu : GLSL/Multitexture, but nothing changes.

Would you know how to use this clone effect in Blender 2.72b ?

EDIT #4: it is confusing, sorry. Here is a new example : the clone painting works. But when I click on the paintTo UV Map, which is the image I should export at the end, the painting does not correctly match the seams :

This is when I paint :

This is when I click on the uv map : it is not the same result as the previous painting :

Here are the files :

http://www.pasteall.org/blend/35661

http://www.pasteall.org/pic/86965

When the render is set to Cycles you can add two textures to the material and they should both show up as slots in texture paint.  Be sure to add a UV Map node for each texture and set the appropriate UV Map.

Enter Texture Paint mode and activate "Clone From Paint Slot".

The texture that is being painted to should be selected in the section named "Available Paint Slots"

The texture that is being painted from should be selected in the section named "Source Clone Slot".

All the settings I used are shown in the following animation.

Update in response to a comment requesting more information.

Textures can be drag 'N dropped from the hard drive file system.  They can be added in as texture nodes by looking through the menu that is called up when the keyboard shortcut Shifts is used.  They can also be added by drag 'N dropping the image icon from the UV Image Editor.

Using Blender Render you can add images to the texture slots.  I think the limit is 18 slots per material for BI.  I'm not sure if the BI node editor has the same limit, probably not.


How do I make an object which hides 3d objects behind it, but shows my video background? I am currently interested in tracking 3d objects into my videos. I am not sure how to create what looks like a hole in the ground. If I used a sqaure with no top face, the outer sides of the cube would still appear over the video, I need only the inside of the cube to be seen.

Is it possible to make a sort of plane object that hides the 3d objects behind it, but still shows my video background?

-Owen

As Mechanic says, what you ask is not clear, please show some screenshots. Do you want to create an alpha transparency wherever you want on your 3D object? The Holdout shader does that. Don't forget to activate the Properties panel > Render > Film > Transparent option.


why doesn't texture paint show up on polygon materials? I'm trying to texture paint details on top of a poliigon material and it doesn't show upon any other mode. How can I fix this?enter image description here

Have you checked this video?

Here's a picture (tattoo being the texture you paint on):


motion tracking fish eye I have tracked a footage and added Suzanne to it .
motion model: perspective
n Suzanne has moved in perspective.moving from depth of view to forward.
my footage has became somthing like fish eye.but the footage is not.how should I solve the problem?

All lenses cause some distortion. There are no "perfect" lenses in the real world.

When dealing with motion tracking it is crucial to account for such lens distortion.

Usually, as part of the tracking and solve process, blender determines the lens distortion parameters.

That information can be used in two ways:

1- to create an undistorted version of the footage and use that as reference for the creation of 3D elements.

2- to distort the elements created in the 3D environment so that they match the distortion of the camera lens used to create the original footage.

Either one of those paths involve using the compositor and a movie distort node.

https://docs.blender.org/manual/en/latest/compositing/types/distort/movie_distortion.html

For a very detailed post on the subject please refer to:

How to determine lens undistortion values for motion tracking?


Image in material shrunk after render I'm modeling a iMac. I did UV mapping for the in screen image and applied image texture to the screen. Everything looks fine on viewport. But when I render the image in the texture shrunk.

I have tried, removing the edges and adding them back in. I have tried creating new texture. Adding new image. Moving the mesh to a clean file. Nothing works.

Yup. It was the subdivision modifier. Just needed remove it, or add in crease around the edge of the image. Thanks, problem solved.


'Mesh' object has no attribute 'uv' I'm trying to update an old script and I'm near to achieve my goal but I'm locking at getting uv coordinates because the old script used the texture assigned using the UV image editor and the new one need to use the texture assigned with material.

Then the thing I don't find is how to get the uv as easy as the vertex coordinates.
This is the code I have to get faces:

face_count = len(self.ob.data.polygons)
print("face count: "+str(face_count))

for f_index in range(face_count):
    uv_polygon = self.ob.data.polygons[f_index]

    vertices = []
    # export the triangle
    for i in range(3):
        vertices.append([self.ob.data.vertices[uv_polygon.vertices[i]],
                        self.ob.data.uv[uv_polygon.vertices[i]]])
    try:
        Face(vertices, uv_polygon.material_index)
    except:
        Face(vertices, -1)

The error appears here: self.ob.data.uv[ uv_polygon.vertices[i] ]
because uv is not an attribute of mesh.

Thanks

UV coordinates are stored in ob.data.uv_layers.active.data[loop_index].uv since the mesh system update (NGons are supported from 2.63 on). Note that a loop index is required, not a vertex index.

UV textures are stored in ob.data.uv_textures.active.data[face_index].image.

http://www.blender.org/api/blender_python_api_2_73_release/info_gotcha.html#ngons-and-tessellation-faces

You might wanna use the tessface mesh (triangles and quads) for your export. Don't forget to triangulate quads, your original code doesn't seem to handle them at all. Here's an example:

https://code.google.com/p/blender-cod/source/browse/blender_26/export_xmodel.py#518


How to find the name of the active material with python I want to add nodes to a node group, but for that, I need to know the name of the currently selected material. How can I find the active material with python?

The answer is bpy.context.active_object.active_material.name


How to quickly select edge loop around grid filled area? I've been trying to figure out a way to quickly select the edge loop / ring around an area I have just grid filled. If I 'alt + click' the edge ring it only partially selects. I appreciate the help.

Try this:

select an outer ring

expand the selection towards the ring around the grid fill

deselect all but the ring around the grid fill, using altshift and right click on the outer ring. In your example the above selection expansion will need then to deselect 2 outer rings, I guess.


Is there a way to rotate view by 180 or 90 degrees with 1 command? Most of the time I use the "hold alt + drag middle mouse button in a direction" to rotate the view. There are often times when I want to see the top or bottom view and then rotate the top/bottom view by 180 degrees along the Z axis.

I know I can rotate the view 180 degrees by pressing the Numpad_4 or Numpad_6 keys twelve times but I rather have a shortcut I can press once or ideally, a way to do it with the middle mouse drag gestures since using the numpad is a bit cumbersome when my right hand mostly sits on the mouse.

Method 1
You can go into the reverse of an orthographic view (i.e. the view is rotated by 180 degrees) by adding Ctrl to the numpad number. For example Numpad 1 goes into front view but Ctrl+Numpad 1 goes into back view. This works for Numpad 1, Numpad 3 and Numpad 7.
So you can either press Numpad 1 to go into front view and then press Ctrl+Numpad 1 to reverse that view or you can press Ctrl+Numpad 1 to go directly into that view.
Method 2
It is currently taking you 12 presses to rotate the view using the number pad keys because the 'Rotation Angle' is set to 15 (degrees). Luckily, there is a user preference option to set this to a custom angle (the maximum value it can be set to is 90 degrees).
In 2.8 you can go to Edit> Preferences> Navigation> Orbit & Pan and change the 'Rotation Angle' from there:


view only one transparent object at viewport when overlaping to another object in blender 2.8 i used to do this using blender 2.79 version with no problem .
now i need to do the same work with the 2.8 version , but cant find the way
when i have two objects , one on top of the other , i need to see only through the object that is on top or front, without making the one that is behind transparent. I found the xray mode but it turns all objects on the scene transparent , and as i said , i need to see through the first one and the other needs to remain solid.
this is how i did with the 2.79 version, and now im using 2.8 but cant find how to do it

EEVEE
Use alpha and also change the setting of Blend Mode in that material:

The Blend option need to be set explicitly to make EEVEE know what material need to consider transparent problem. And only alpha blend will give an actual blend process for color.
Related post

Material Settings — Blender Manual

Transparent Materials Workflow from Cycles to EEVEE from 2.79 - General Forums / Blender Development Discussion - Blender Artists Community

How to use alpha transparent textures in Blender - Artisticrender.com


Invisible wall that doesnt appear during modelling, but on rendering In the blend file attached, I want to render rgb frames at various camera viewpoints.

When I render a frame at the camera pose shown in the screenshot (facing the counter), only a white image is rendered.
However, as apparent from the global view, there is no plane in front of the camera. I get a white image for all camera poses at thetha-z = 180 and y > 3.5 (approx).
How do I get rid of this white 'wall'?

You have an object just named “Cube” that is hidden in viewports, but not in renders:

This object obscures the camera:

Either delete the object or disable it for renders as well, and your problem will be resolved.


Mirrored UV map is breaking up textures per-face Uv map was mirrored, but then every single face in an island is ripped seperately.
The map is in the perfect place but the textures per face are acting wonky.

Screencast of the situtation
(I'm sorry i wasn't able to upload a gif)

For more details:
The mesh is downloaded from blendswap, comes Unwrapped and Textured.

I modified one side of the mesh using edit and sculpt modes. X-mirror was on, but sadly somewhere i deleted some faces and i think it stopped copying my edits over to the left side.

The error is on the left side.
I deleted the left side.

I selected the right side and did shift+d scale x=-1
but ofc that only uses same UV's as right side while the textures aren't exactly the same.

I couldn't re-unwrap using U>Unwrap because the mesh is changed, and the resulting unwrap is different.

so I selected right side, separated by selection, mirrored it using mirror modifier, deleted the original side (lol must be tiring to read this, sorry.) and selected this new object in object mode, shift+selected the original object, did ctrl+L Transfer UV maps.
That last step must have made the errors.

I manually edited the new left side UV's to fit the texture map perfectly. BUT, the textures seemed off for this one side. Every face shows gradients. almost like if the normals weren't set to smooth. But they are.
The maps are in the perfect place, but when i select islands in the UV editor, it doesn't select the whole island, just random chunks of faces.
And the same happens when i select vertices.

I tried W>Remove UV doubles, at a low threshold too. It doesn't work.

Any way to salvage this? Is this a bug?

In the end I am deleting half the whole mesh and just going with mirrored textures... It doesn't really matter that much, I'm just surprised at the mess haha.

It's becouse faces in that place are "rotated". Let's i describe it in image:

your vertex number 1 is on position of vertex 3, n.2 on position of 1, n.3 on pos. 2.

so it look like all vertex on right place, but this places are wrong

Look at my another example. As you see all faces are in right place, but selected face is rotated at 90 degrees. Same thing in your model, but many of faces are rotated.

So if you have original model - try to transfer it UV map using Data Transfer modifier


Videogame like object variant switcher Is there an addon for Blender that allows a person to switch out parts on a model car like you can in a videogame? (One click selection that shows one part variant and hides the previous, and also lines up the parts so when they switch, it doesn't look off kilter)

If you have different parts/part groups that you would like to switch out, then group those parts, and reference them from empty objects:

This forms a good basis for using drivers in the future to automate the switching by mixing drivers with the use of Custom Properties:


VSE: how to zoom in on image without pixel blur? edit: i think this might be a solution? But I don't understand how to do it can anyone help? i open a new scene and...then im stuck

"This really bugged me, but I got a solution:
Create a new scene, and in that - using the node compositor zoom in/out of the clip. Add that scene into the other scene's VSE as a 'strip'. You are then able to "use the resolution" of the original clip re-sized however you like. It's slower and more clunky, but works (and very powerful!). As others have said the "transform" simply takes the existing canvas output and makes it bigger or smaller. It has no access to any extra resolution in the original, and can't "see beyond the edges" either. Image offset / crop do not allow you to control the size, they simply set it at "the original's resolution". Which is good enough for what it is."

I have to render out a 1080p video. So I set the workspace to 1080p.

I wanted to zoom deep into an image and end up with a part of it that wasn't blurry looking. So if I did this with a normal 1080p image....it would be blurry no doubt...

But what If I made a HUGE image, lets say 3x the size @ 5760x3240 (or whatever) in an image editor. And set it up so that the end view I get is an actual 1920x1080 view with no forced zoom, then there wouldn't be any blur!

So I have this large image. The intent would be to place it in the timeline. zoom out of it so get it into the 1080p window. Then just zoom in straight down to that intended 1080p point (My king is on the throne text bit).

Tried:
1. changing workspace to the original image size and then changing it back to 1080p, made it blurrry as can be when changed to 1080p (basically scaled the original image to 1080p and zoomed in on it :/).
2. tried image offset then adding transform layer....but the transform layer cuts anything not displayed in the 1080p viewport....and u can't fit an image that large in a 1080p window obviously.

Soo what can I do? you can do this all with a record screencapture. Infact its what the monitor is doing if u got a 1080p monitor....its scaled it down, I just want to zooom in and not get blur at the text selection.

This question has been asked before. See option 2 of Rumen Belev's answer.

The solution is to use the 3D view, import your image as a plane and use a scene strip of that 3D view in the VSE.


How do I make faces and vertices invisible in viewport? I started learning Blender recently, however once I got to a point in a tutorial, it showed faces and vertices being invisible (2nd image), my view doesn't show this, despite, as far as I'm aware, having the same settings as in the tutorial, how do I make these become invisible? I'm sure it's a fairly simple fix, but the tutorial I'm using didn't have any information on how to change this

In your first picture, we see a cup of tea in object mode. No big deal.
In the second one, we see a cup of tea in edit mode. With a subdivision modifier display. But with optimal display On.

My guess is, your tutorial shows you a mesh modeled with a subdivision modifier, and the authors has it set so that in edit mode, the subdivision modifier displays a preview of its effect (that's the default behavior), but has the Optimal Display option checked on so that it doesn't draw the created geometry's wires:


Extra Face when cutting a window I'm kind of new to Blender and I ran into a problem.  I am creating modular segments for a house.  For some reason when I created the segment with a window in it, blender split the front face into 2 faces when I go into edit mode.  Is there a way to rectify this?  I created the segment using 2 cubes.  One cube is the size of the wall, the other i used to cut out the window using a boolean modifier. I tried the "f" key and that didn't work for me.

One way is to subdivide a plane, select, with B, the faces you want to remove or the window and delete them. Then you select the object and extrude it.


Such difference between Edge Split as modelling tool and modifier Why Edge Split doesn't dynamically apply its functions through animation?

Using it as a tool (Mesh->Edges->Edge Split) allows you to manipulate each face independently. However Edge Split modifier doesn't work like that. Yes it still increase vertex count but doesn't actually split geometry, unless click Apply button.

Setup:

1. Hook is binded to the top face with Sharp edge surrounding

2. Split Edge modifier is splitting top face

Now animated hook is trying to move it: There is no visible split.

After pressing Apply in Edge Split modifer: Whole different picture

so why it splits edges and at the same time keeps them connected
  before applying?

Edge split modifier actually split geometry. But you test this using wrong way. Try to add Susurf after Edge Split:

When you adding hooks it moves both arrays of vertex, that splitted by edge split modifier


Objects are invisible Objects are invisible in Object/Sculpt mode, but not in the Edit mode - mesh is still here.
I have been using Blender before, but this glitch only appeared now
Thanks in advance

For Viewport Shading you have both X-ray(orange in the image below) and Wire frame (red) enabled.
Enabling the Solid mode (green) Viewport Shading option instead should fix it.


add modifier to png image? Im following this tutorial here: https://www.youtube.com/watch?v=bF3O4qbaMqs
which explains how to curve and animate text. But I've designed my text in gimp and imported it as a png file into blender. The video goes on to use the object modifier tab which isn't available for the png file, what can I do?

Many thanks

As you have read from the other answers this is not a good way to do this. I would use actual 3D text like they did in the tutorial you posted.

However to give your question an answer.

Import image as planes (choose your text PNG)
Make sure you subdivide your text plane to give it more geometry to bend.
Make an Empty and leave it in the center of your text.
on your text/image object add the simple deform modifier and choose the empty as the object to bend around.

Keep in mind you are very limited this way because you are using a picture of text and not actual text.


Frame-Duplicated Metaballs not rendering in Blender 2.79 I am trying to create a flow of water by duplicating metaballs along a curve. I've gone through the motions of creating a curve and a metaball, setting the Parent of the metaball to the curve, set the Duplication to Frames, unchecking Speed, and animated the End frame. Looks good in the viewport (sometimes needing to click the Update buttons to get it to update).

However, when I go into Rendered view or actually rendering the thing, none of the metaballs show up, not even the starting metaball. Changing Duplication to None shows the whole thing in Rendered View, but when I do anything to update the metaballs I only get the starting metaball. I even played around with the metaball's resolutions to no effect.

Is there any other method to create this growing "sausage"? Remember the material is semi-transparent so using ordinary spheres will produce ugly overlaps.

I don't know whether it's a bug or not, but if you ALT+D duplicate metaball on the same layer, dupliframed metaballs start rendering fine. To hide this copied metaball, clear relation to parent object (ALT+P) and put it outside view area or parent to camera and move behind it.


How do I get the deformed coordinate of a vertex with Python? How might someone find the deformed coordinate via Python or otherwise when using a subdivision modifier with the 'show on cage' option?

For example, a subdivided cube with cage enabled and a vertex selected shows the location of the vertex at 1,1,1 but when manually placing the cursor near on the surface it is closer to .5,.5,.5

I know the vertex location needs to be at its non-deformed location for subdivision to even work but would like to get more accurate point locations at the surface without having to apply to mesh.

Vertex Parenting

Among other ways can be done with vertex parenting.

Test script, run with mesh in edit mode, adds a vertex parented empty for each selected vert and prints  vertex's global location to the console.

import bpy
import bmesh

context = bpy.context
scene = context.scene
obj = context.edit_object
mesh = obj.data
bm = bmesh.from_edit_mesh(mesh)
empties = []
# selected verts
for v in [v for v in bm.verts if v.select]:
    empty = bpy.data.objects.new("Empty", None)
    empty.parent = obj
    empty.parent_type = 'VERTEX'
    empty.parent_vertices = [v.index] * 3
    scene.objects.link(empty)
    empty.matrix_parent_inverse.identity()
    empties.append((v.index, empty))

# update the scene
scene.update()
for index, empty in empties:
    print("Vert %d location: " % index, empty.matrix_world.to_translation())
    scene.objects.unlink(empty)
    bpy.data.objects.remove(empty)

Test result on default cube with subsurf (cat-clark) 3 subdivisions.

Vert 0 location:  <Vector (0.5015, 0.5015, -0.5015)>
Vert 1 location:  <Vector (0.5015, -0.5015, -0.5015)>
Vert 2 location:  <Vector (-0.5015, -0.5015, -0.5015)>
Vert 3 location:  <Vector (-0.5015, 0.5015, -0.5015)>
Vert 4 location:  <Vector (0.5015, 0.5015, 0.5015)>
Vert 5 location:  <Vector (0.5015, -0.5015, 0.5015)>
Vert 6 location:  <Vector (-0.5015, -0.5015, 0.5015)>
Vert 7 location:  <Vector (-0.5015, 0.5015, 0.5015)>


Does it matter if I bake a Normal map from a model withouth Color? Does it matter if I decide to bake a Normal map from a High Poly mesh to a low poly mesh first and then Create Textures on the low poly one?

Because as of now, I have not created Textures, But I have sculpted detail on the High Poly. Can I just do it withouth textures? It's fine?

If you're not going to add bump, displacement or normal textures onto the high poly model, then it does not make a difference wether you bake it before or after adding textures.

All sculpted detail will properly be baked regardless of (color) textures.


How to texture a cube so that each face has the same uv coordinates? I would like each face of a cube to have the same texture coordinates as each face will contain the same image. Therefore there will be no wasted space from storing a 'T' shaped image, instead of a square image.

I have attempted uv unwrap the cube and layer the islands on top of each other. However, I am unable to scale and align all of the faces to the full size of my square texture (image).

How can I fix this issue or is there a better carried out this process?

Just go to edit mode, select everything, hit U and choose reset!


How to assign different background images for different 3d views? I was following this tutorial about creating a spaceship in Blender:

As advised I created 3 background images for the three views to be uploaded via the properties bar (N). I did not fail to switch to the ortho mode with the NumPad 5, so that is settled.

After importing the three pictures there is a problem: I assign for example the top view background picture to the top view, NumPad 7 and it is visible. As soon as I assign, say the front picture to the front view and I switch back to the top view, the picture cannot be seen there any more. I have been trying all around for hours and I always end up with the only the last assigned background picture visible and the others then "gone".
I run blender 2.76 in portable mode.
Anybody any idea?

Sorry for the bad link, I forgot to set the filefolder to visible to others except me... Since my status does not allow to upload more than the 15 screenshots here is the correct link

I think I managed to generate a .blend with the images stacked. The link to upload it in MrZak's post did not work though. I am posting an alternative for the download.

I have read through your advised literature. The load UI was not unchecked.

Meanwhile I have noticed that whenever I try to save the project in the .blend, only the last uploaded picture/blueprint remains, even with the image packed. This means that when I open it, only the last picture remains.

Again sorry for any inconvenience with my virtually poor formatting skills and I much appreciate your efforts.

I have attached a file with 3 views. Try hitting Num 7 , Num 1 and Num 3 to view the different elevation views. Everytime you add an image to the background you will have to click on the "Add image" button. I believe that may be the reason why you could not get more than one image to show up on your viewport.

Alternative Methods

However there is a better way of working with image plane. Using import image
as plane. Here you get a polygon created to match the aspect ratio of your image and the image is applied as a shadeless material. This gives you more control in positioning your image planes and make them visible in all views including the
perspective views.

Note : You may also want to turn on lock transformation for the planes.

Here is the download for the alternative method.


What does it mean when a property is highlighted in green? I'm trying to edit a template I downloaded for a personal project.  I have specific axis values from a previous version of the template that I wish to add to the updated version.  However when I do, and I move the timeline cursor to review it, the properties revert back to their previous values.  The fields that I'm trying to change are highlighted in green for a reason I'm not entirely sure about, but presumably it's connected to the trouble I'm having.

So my question is twofold; what does it mean when properties are highlighted in green and, if the two are not connected, is there any way I can correct the issue?

I'm running Blender version 2.62 on a Windows 8.1 64-bit operating system.  I've attached a couple photos in case they will be helpful.

Green means a property has a keyframe applied, but not on the current frame. (yellow means the key is on the current frame). Your changes aren't sticking because it's reverting to the keyed values. You can set a new key if you'd like by right-clicking the field and hitting "insert keyframe", adjust the key values in the graph editor, or just clear them all by right-clicking the prop and hitting "clear keyframes"

Also, for the sake of completeness, a purple property is one that has a driver set.


changing filepath and creating directory in python filepath = bpy.data.filepath
directory = os.path.dirname(filepath)
path = directory + "/" + "BakedTextures_" + obj + "/" + obj + "_" + map + "Tex.png"

Trying to define a path variable while creating a folder inside my blend file directory to later use that variable for saving a baked image texture made in Blender. So far with this code I get this error:

Traceback (most recent call last):   File "D:\GOOGLE_DRIVE\WORK\3D_Work\OldWorld\Ducs_Armor\Ducs_Armor.blend\Text", line 15, in <module> TypeError: can only concatenate str (not "type") to str Error: Python script failed, check the message in the system console

Clearly I'm doing something wrong with my backslashes and probably something else, but I can't figure it out on my own, can you help please?

Python has useful functions built-in to handle common pathname manipulations.

import os
desired_path = os.path.join(some_existing_path, "some_folder", "some_file_name.ext")

See os.path, and see shutils for high-level file operations.

to test if a directory exists, and make it when not found):

if not os.path.exists(directory_to_test):
    os.makedirs(directory_to_test)


Problem with return super().__getattribute__(attr) blender 2.8 That script make this problem:
 return super().getattribute(attr)
AttributeError: 'ParticleSystem' object has no attribute 'my_particle_settings'
i think is a good solution , about create a particle system with default setting, but not work.
i think , i create another function ? is a good o bad way?

import bpy
from bpy.props import  BoolProperty, PointerProperty
from bpy.types import PropertyGroup, Panel, Object

def emitter_update(self, context):

    toogle = self.my_particle_settings.emitter_hair
    part = self.particle_systems[0]
    settings = part.settings
    settings.type = 'EMITTER' if toogle else 'HAIR'

class MyParticleSettings(bpy.types.PropertyGroup):
    emitter_hair: BoolProperty(update = emitter_update)

class ParticleSystem(bpy.types.Operator):

    bl_idname = "object.particlesystem"
    bl_label = "Why"

    def execute(self,context):

        part_system = bpy.context.active_object
        part_system.modifiers.new('New Part sys', type='PARTICLE_SYSTEM')
        emitter_update(self, context)

        return{'FINISHED'}

class VIEW3D_PT_toggle_ps(Panel):
    """Test"""

    bl_label = "My Panel"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "View"

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

        layout.label(text="My new problem:")
        row = layout.row()
        row.scale_y = 1
        row.operator("object.particlesystem", text='Click')
        layout.prop(ob.my_particle_settings, 'emitter_hair',  text="Toggle")

classes = (MyParticleSettings,
        VIEW3D_PT_toggle_ps,ParticleSystem)

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

    Object.my_particle_settings = PointerProperty(type=MyParticleSettings)

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

if __name__ == "__main__":
    register()

Knowing one's self

You have called the following

emitter_update(self, context)

from the operator, where self is the operator instance passed as the self argument to the execute(self, context) method. Operators have no particle systems 8^). The update method expects self to be an Object type which has a particle settings attribute.

From within the operator use

emitter_update(context.object, context)


rendering 3D video/image for google cardboard I'm looking to render out a video or image for display on Google Cardboard, i.e. a video is rendered with two barrel images, one for each eye, side by side.

I've found tutorials like the following: https://www.youtube.com/watch?v=1S-AATilv84

But I know that Blender now has Multi-view rendering capability so was wondering how to render for Cardboard from Blender without rendering an image/video for each eye, which the tutorial tells you to do.

Found it!

Once you have set up your animation or single frame:

In your Scene tab enable Views and select Stero 3D

Select the Camera on the scene and go to the Camera tab. Sort out the interocular disctance this should be 0.06 = 6cm, the distance between your eyes. Set Lens to Panoramic

Go to the Render tab, change the Dimensions -> Resolution to be the resolution for a single eye (this will depend on the android phone you are using)

Again, in the Render tab scroll down to the Output and change the Views Format to be Stereo 3D. Set the Stereo Mode to be Side-by-Side.

Press Render or Animation depending on whether you are creating a single image or a video, and you should be done!

Check an example output here: https://youtu.be/fEFmGVymbUg (Which annoyingly youtube currently seems to be converting to different 3D formats!)

To render for VR, see this: http://b3d101.org/en/vr/


Bevel Tool and Mac mouse when using the Bevel tool you can change the number of segments by scrolling the middle mouse wheel. At least when you are working under Windows. But how to simulate that with the Mac mouse (I know how to Rotate, Pan, Zoom with the Mac Mouse).

After you've left-clicked to accept the radius, the bevel-tool is still active and you can

press numpad + / - to change the segment count. If you don't have a proper numpad: in Preferences, go to Input and check Emulate Numpad
or.. press F6 and adjust segments from there:


"Timebase not supported by MPEG 4 Standard" Error when rendering AVI/MPEG-4 video I've been trying to render a video but either it won't have sound or it won't have audio. Whenever I try to render it in a way I can get both video and audio, this error message shows up. Any idea whats causing this?

my render settings:

Avi (divx) oh shoot. What a problem.
2 things: Fix the MUX rate (over the RIGHT side parameters over "Packet size") Should read 32000.

Second: Do you need to compress to divx? That´s a format no one is using anymore because of security reasons:

Use Mp4 with an .h264 wrapper. Quicktime.

Thank you if you vote me up as answer.

BFCT_Schiller


How to convert ZBRUSH .ZBP to a .jpeg or .png that I can use in blender sculping I bought a $20 texture scale alpha for my dinosaur modelling https://www.artstation.com/marketplace/p/mjq6/28-custom-brushes-for-zbrush-2018?utm_source=artstation&utm_medium=referral&utm_campaign=homepage&utm_term=marketplace
and it's only zbrush compatible. The owner is not responding for a refund. It has .ZBP file extension and I simply want to convert it to .png or .jpeg so I can use it as a stencil in blender sculpting.

If you can open up ZBP files to view it in a photo viewer( I have no experience with ZBP), then you, if you are using windows, can take the snipping tool in windows accessories and take a snip of it. It will be either a PNG or JPEG, I'm not sure, but it sounds like you are okay with both. If you are using an apple product, Control+Shift+4 will allow you to take a snip.


Exporting 3d object from blender cycle into unreal engine (or other engine) I would like to ask blender community to help me out with whatever it would make me understand better the problem that i am facing and would be understandable for my basic knowledge in blender.
Before presenting the problem that I face, please be patience with me and try reading all that I will write here.

After many hours spent in front of blender, smashing my head to the wall until understanding mostly the basics and figuring things out how they work, how they might work if they are willing to be imported into an engine and watching many videos, I came to a big halt to my small project. In blender, everything looks fine (especially in the rendered mode -see image-). Now I am willing to finish the work and pack it up so that it can be taken in unreal engine to work with it. All that is left is to bake things into it, but here it comes my problem. As far as I have read, tested, and tried to find videos about it (not that I was lucky), the emission surface that are added in blender cycle into the mesh (not separate object, but in a bigger mesh -see image-) can not be exported from blender nor baked in blender. Sadly, this would push my work way back or I will need to find some kind of alternative to it and just give up my "dream" with it. This is why I came here, to ask the community if there is a way for my solution before I just give up with this surface emission that I have added.

In short words:
- how would be possible exporting a file of blender cycle object with surface emission in it into an engine (unreal engine/unity or whatever, i want ue4) because it can not be baked and i think fbx will not export it.

Hope that my problem at hand is well written and explained, also the question is clear about what I wish to do. Any kind of solutions, suggestions, tips, videos, lectures (whatever) related to this are welcome, just hope that i will understand them.

*.fbx export/import = i have tested it, exported in fbx a model with surface emission, but when that was imported back into blender the surface emissions where gone, i guess it will happen the similar thing in ue4, not 100% sure.

You cannot simply export Cycles materials to fbx (or any game related model formats) materials. The reason for this is that Cycles uses a completely different approach to handle materials.

Cycles material setups were designed with the idea of being able to use procedural materials with a strong focus on photorealistic rendering and animation. You can still work with textures, but the main setup can be still considered as procedural, especially when using emission, glossy, transparency and translucency.

Game engines still use textures and uv-maps to project those textures on the models. Specific material setups like emission often need to be done in the Game Engine's material editor.

The procedure to go from a cycles material to a material that is (halfway) ready to be used in a game engine involves unwrapping your model and its submeshes and then baking the different texture maps for your material. This would be at least the diffuse map (pure color, no shadows, no light values). Additional texture maps could be normal maps, specularity maps and ambient occlusion maps.


How to bulge out a face? Hi I have the following shape:

and would like to bulge out the top face like the side of a pill. I've tried inset faces with proportional editing, but the faces can only become so small before the vertices overlap and it goes crazy.

When I'm done I'd like a shape similar to one of these:

Any help would be great.

Here comes a very simple way to do it:

1) Base
Add a circle with 32 vertices and a triangle fan.
Rotate it by 360/64 degrees along Z axis. This will get you nice flat sides.

2) Rim
Inset faces a bit to make a rim. All pills have a rim.
Then delete the triangle fan.

3) Fill the circle
Select 16 opposite vertices (exactly half).
Go to Face->Grid Fill.

Cool, right? Job done.

4) The bulge
Raise the middle polygon and enable proportional editing with falloff set to Sphere.
Play with the settings to your liking.

5) Create the bottom part.
Select all vertices Select->All, duplicate Mesh->Duplicate to make the bottom part.
You can use the mirror modifier for this, if you want.

6) Connect both parts.
Select those two edge loops and bridge them.
Edge->Bridge edge loops.

7) Add Subdivision modifier to smooth it out.
2 levels is enough.
Also set a smooth shading.

8) Change the shape to your liking
You can still change the shape and height in edit mode.
Just grab and move the vertices.

Example of final mesh.

Result:

Additional notes:
 - You can do this faster by using mirror modifier
 - Apply rotation, so modifiers work properly
 - There are many ways to do this, don't get hung up on this approach
 - Yeah... some pills have a groove in the middle.
 - Try it with different number of vertices, some will work better than others.

Uff.

Okay, here is the same pill with a groove in the middle.
It just felt so wrong without it I couldn't sleep.


Shader node to get z value I am putting together a coastal scene. In order to make the rocks close to the water shiny from the water, I would like to set the roughness as function of the height (z value). If all the rocks where single objects with unique location, I suppose it would be easily done. However, my landscape is a big 3D scanned object and I would like the reflection to change accross the mesh. Is there a node that achieves this?

Ludvig

Personally, I would create a 'Sea Level' object and extract the Z of its Object Space like this:

Now the Z output is a number; the height above/below sea level in Blender units. You can scale that number, map it to another range, put it through curves or a color ramp.. whatever you need. If you put this pair of nodes into a little group, you can quickly include it in any material


Render specific frames with opengl via python When I run the following script, current_frame is set AFTER the render.opengl():

bpy.context.area.type = 'VIEW_3D'
bpy.context.scene.frame_current = 234
bpy.data.scenes['Scene'].frame_current = 234
bpy.ops.render.opengl(view_context=False)

If I run the script again, the correct frame is rendered.
How can I force the frame_current to be applied before the render?

(A solution without using an operator is also welcome, as I understand that ops are more for user interaction that for scripts and are therefor very dependent on the correct context.)

Thanks!

You have to call Scene.frame_set() instead of setting the property Scene.frame_current:

bpy.context.scene.frame_set(234)

Only frame_set() updates animation data correctly. frame_current is mostly intended for reading access to determine the current frame.

Following example renders frame 0, 230, 99 and writes them to the disk as test_000.png, test_099.png and test_230.png.

import bpy
import os

# format integer with leading zeros
def formatNumbers(number, length):
    return '_%0*d' % (length, number)

# get the scene
scn = bpy.context.scene

# get the output path
output_path = scn.render.filepath

# set filename
filename = "test"

# set render frames
render_frames = [0, 230, 99]

# iterate through render frames
for f in render_frames:
    # set the frame
    scn.frame_set(f)
    # set filepath
    scn.render.filepath = os.path.join(
            output_path,
            filename + formatNumbers(f, 3) + ".jpg",
            )
    # render opengl
    bpy.ops.render.opengl(write_still=True)

# reset internal filepath
bpy.context.scene.render.filepath = output_path

Note: .jpg is only a placeholder and will be overwritten by the settings in the render panel.


How to render in cycles like when you use backface culling in eevee I want this model to render like this:

this is done by using backface culling in eevee rendering.
In cycles, however, it's rendering like this:

I know there's a node set-up in cycles to recreate backface culling, however it did not work and only made the model look glitchy.
Any help would be nice. For reference, here's the model I am using if anyone would want to experiment with it:
https://www.models-resource.com/nintendo_switch/supersmashbrosultimate/model/30311/

Here is a setup I use

WARNING* WITH SOLID MESH YOU MAY HAVE TO TURN OFF SHADOWS

If you don't want to turn off shadows use this setup here:


Change Greasepencil Color? is there an way to change those lines from grey to Black or do I need to draw it again?

Enter sculpt mode and use the strenght brush.


Creating Corners with Mirror / Symmetry Is there a modifier/tool or plugin to replicate the symmetry/mirror effects like the one at step 12 here:

https://knowledge.autodesk.com/support/3ds-max/getting-started/caas/CloudHelp/cloudhelp/2015/ENU/3DSMax-Tutorial/files/GUID-42DD88AC-4988-4CBB-A3FE-6298B1ECC9B3-htm.html

Basically all I want to do is create corner pieces of an existing modular model.
Thanks!

All I had to do was to check Bisect in the mirror modifier after rotating it 45° in Edit mode. Thanks anyways. Problem solved.


How to increase width of the walls? So I am beginner to blender. I want to make an object like swimming pool.
I made a cube and deleted one face. Now I have no idea how to increase width of the walls. I tried to extrude each face, but now I have a hole in connections between walls. I could not find other opportunities to make such changes

There are many different ways. This is one of them (maybe not the best, but should be easy to follow):

Create a cube
Resize the cube to match the size of the pool ( s )
Apply your object's scale( Ctrl-a > Scale)
Go to edit mode (TAB)
Press 3 to switch to "face selection"
Select top face
Inset the face i
Select the inner face and extrude vertically with e + z (so you can create the "hole" in the swimming pool
If you want to change the width of the walls you can select inner faces (check screenshot) and resize them in both X and Y to get your result ( S-x and S-y)


How to Export proportional UV Layout in blender? Because I want to use on the mold.But the blender uv size is always fixed at 36.12cm * 36.12cm.

Not sure I am understanding your question exactly as default Blender UV export size is 1024 x 1024 or about 27cm on the x and y.

When exporting UVs from Blender, after going to UVs > Export UV Layout there is a little panel in the bottom left where you can modify the output size.

The exporter only takes values in pixels, if you want definite values you can just simply use a converter like this one. translatorscafe.com, just put your desired centimeter value in and it will give you the equivalent in pixels.

As per brecht's comment below, conversion among such units is not as simple as it seems, one key factor involved is the dots per inch (DPI) of your current display. To take that into account, you can use this converter.