Is there a way of keyframing RGB curves? In the node editor the RGB Curves node only lets me keyframe the factor. The control points have boxes for x and y coordinates, but it doesn't allow me to keyframe these boxes. Is there a way around this?

All of the node data is available through python so a workaround could be to use a python script to adjust the curve at the right time.

To view the curve data you can use a script like -

import bpy

theCurveNode = bpy.data.materials['Material'].node_tree.nodes['RGB Curves']

print("R Curve points are:")
for point in theCurveNode.mapping.curves[0].points:
    print(point.location)

print("G Curve points are:")
for point in theCurveNode.mapping.curves[1].points:
    print(point.location)

print("B Curve points are:")
for point in theCurveNode.mapping.curves[2].points:
    print(point.location)

print("C Curve points are:")
for point in theCurveNode.mapping.curves[3].points:
    print(point.location)

So curves[] will always be 0-3 for RGBC and each curve can have any number of points. It would be tedious but you could use the script to generate a list of values that you then use as data for the script that imitates keyframes. Possibly calculating them or interpolating smoothly between frames.

theCurveNode.mapping.curves[1].points[2].location.x = myCurvePointLocX(1,2)
theCurveNode.mapping.curves[1].points[2].location.y = myCurvePointLocY(1,2)
theCurveNode.mapping.update()

Be sure to run mapping.update() after altering any curve points.

You could then setup a script that appends a function for bpy.app.handlers.frame_change_pre that alters the curves based on frame_current.

I can't say this is a recommended method but in theory it could work.


How to create such a mechanism? I thought to do it sideways. Here you need to use drivers and math, I think. But where can I find similar examples in execution, tutorials with a solution to a similar problem? Or books, videos, articles on sections of mathematics that would help create such a mechanism.
Tell me the sources of information that would help create such a mechanism and in the future know where to get knowledge to resolve such issues. I will be grateful)

You can get this effect by using a cast modifier and instancing. Create a plane and use edge loops and cut once down the middle and a few times on the side. Then delete everything besides the middle edges to create a single line of vertices. Then in the object properties for it, set instancing to vertices and add a cast modifier. Then create the rectangles or whatever else you want to be moving up and down. Then set the relations for its object properties to be the line of verts you previously made. This should instance the rectangle to all the verts on the line.
Now create an empty, and in the cast modifier settings you added to the line, set the object to be the empty. Make sure to clamp it to the Z axis as well in the modifier settings. Mess with the scale and radius settings until you get the effect you want.


can i use cloth simulation to create clothing I have a character with a plane over its head as cloth.  I ran the cloth simulation and once the cloth has finished draping over my character, i'd like to save the newly fallen cloth as clothing.  Is this possible?


How to assign a color value to face (object) using python I have the following two functions:

def get_random_color():
    ''' generate rgb using a list comprehension '''
    r, g, b = [random.random() for i in range(3)]
    return r, g, b, 1

def createMeshFromData(name, origin, verts, faces):
    # Create mesh and object
    me = bpy.data.meshes.new(name + 'Mesh')
    ob = bpy.data.objects.new(name, me)
    ob.location = origin
    ob.show_name = True

    # Link object to scene and make active
    scn = bpy.context.scene
    scn.objects.link(ob)
    scn.objects.active = ob
    ob.select = True
    ob.color = get_random_color()

    # Create mesh from given verts, faces.
    me.from_pydata(verts, [], faces)
    # Update mesh with new data
    me.update()
    return ob

createMeshFromData gets its data from a database for verts and faces. Later on it will also get a color value.

So far I am trying to assign a random color using the function get_random_color. I assign this color with ob.color = get_random_color() but this does not seem to work once I press F12 to render.

How to assign a color value to an object?

I am not familiar with blender (coming from matplotlib) and I would apprecite your help.

Set Material.use_object_color to True

From code in this answer which demonstrates use of object colour

# get mat create.
mat = bpy.data.materials.get("randobjcol")
if not mat:
    mat = bpy.data.materials.new("randobjcol")
    mat.use_object_color = True

# assign to object
ob.active_material = mat


Need help with a particle system I'm working on a basic animation, and am having trouble getting the effect I want from a particle system. I have a cube inside the torch object giving off "smoke" particles, that's parented to the torches' motion, and I want there to be a particle every few seconds that slowly rises straight up. I tried turning down the emission number, and turned off the gravity, but the particle always starts behind the back of the torch, and then moves ahead of it while going up. How can I get it to start from the cube inside the top of the torch, and not move while the cube moves?

 (With @eromod's answer)

Make a wind forcefield.
Make a particle system that isnt effected by gravity, has no starting velocity, and has some brownian motion.

I think you are asking how to have the particles only come from the top of the torch with no particles coming from the bottom? Just weight paint it and remove/re-enable it in the particle system so that it updates


Keyframing specified object location at frame from csv data I've been trying animate a large amount of objects based on location and frame data from an excel sheet. So far I've read through a dozen different threads both here and other forums, but I'm just not able to understand how to do it. My only previous coding experience is only a small amount of html/css, so having a slightly hard time wrapping my head around this.

Object_id,X-Loc,Y-Loc,Z-Loc,Frame
Sphere_01,0,0,0,1
Sphere_01,6,0,0,25
Sphere_01,6,-6,0,40
,,,,
Cube_01,3,3,0,1
Cube_01,3,3,10,25
Cube_01,3,3,0,40
Cube_01,10,3,0,60

This is what I use to test on. The goal is to have the script select each object, set its location at a specified frame and keyframe it. So that I can then manually tweak the transition between them if needed.

So far this is the code I have so far, partially copied from here. And i somewhat understand what it does, I think, it at least moves the sphere in the scene.

import bpy
import csv

csvfile = open('FilePath/Sphere_Anim.csv')
readcsv = csv.reader(csvfile, delimiter=',')

for i, row in enumerate (readcsv):
    if i==0: continue
    obname = row[0]
    loc = [float(x) for x in row[1:4]]
    frame = row[4]

    bpy.context.object.location = loc

Would greatly appreciate it if someone could point me in the right direction.

Data to blender edits.

Get the scene object ob by name. Skip if not present in scene.
Add location keyframes at each frame  using

ob.keyframe_insert("location", frame)

Read the docs:

Edited script.

import bpy
import csv

scene = bpy.context.scene

csvfile = open('FilePath/Sphere_Anim.csv')
readcsv = csv.reader(csvfile, delimiter=',')

for i, row in enumerate(readcsv):
    if i == 0:
        continue
    obname = row[0]
    # get the object
    ob = scene.objects.get(obname)
    if not ob:
        continue
    loc = [float(x) for x in row[1:4]]
    # set location
    ob.location = loc # local
    #ob.matrix_world.translation = loc # global
    frame = int(row[4])
    # insert all location keyframes
    ob.keyframe_insert("location", frame=frame)

Related.

Fast keyframe insertion


Is there a way to auto update or reproject newly added vertices on a shrinkwrapped mesh? I am doing a retopology project where I am using a low poly mesh that is shrinkwrapped to the high poly reference mesh. I have Snap during transform enabled with the snap element set to Faces and Project individual elements on the surface of other objects enabled.

The trouble, as we know, is that when new points are added with the knife tool, the vertices don't automatically snap to the reference mesh until each and every newly added point is translated a tiny bit in order to get it to snap back on to the surface.

Is there an add-on or a trick to using Blender that will speed up this workflow or do I really have to manipulate every single added point to get it to snap to the surface after I add it?

PS - I figured out that if, after making the knife cut, I tap G then all the newly added verts seem to update. Did I find the only solution or is there something that will reproject newly added points automatically?

Q. What is the workflow to setup retopolgy with SubD in Blender?

A.

Create your reference mesh:

In the Properties Editor> Object tab> Display panel set Maximum Draw Type to Solid.

Create your retopo mesh:

Create a plane as the beginning of your retopology mesh and name it.

Setup X-Ray for retopo mesh:

In the Properties Editor> Object tab> Display panel enable X-Ray.

Setup Sudivision Surface Modifier for the retopo mesh:

Add Subsurface Modifier.
Enable Adjust edit cage to modifer result icon.
Subdivisions level to 2 or whatever is desired.

Setup Shrinkwrap Modifier for retopo mesh:

Add Shrinkwrap Modifier with defaults.
Set the Target to the reference mesh.
Enable Adjust edit cage to modifer result icon.

Setup Snapping to Faces for retopo mesh:

In the 3D View header, enable Snap during transform and set the
Snap Element to Face but leave off Project individual elements on the
surface of other objects.

Setup a viewport material for the retopo mesh:

In the Properties Editor> Material tab, add a new material.
Give it color like bright green or whatever you desire.
Copy the material color (hover over it and press Ctrl+C)
Go to the Material tab> Settings> Viewport Color, hover over it and
paste (Ctrl+V).

Update: I discovered that if your shrinkwrapped mesh is misaligned in certain areas, a quick fix is to apply the shrinkwrap modifier and then add another shrinkwrap modifier and set it up again. All the misaligned points will be fixed without having to move them around individually in order to get them to update.


bone heat weighting failed to find solution for one or more bones I am guessing you guys get this a lot, but I've tried everything to fix the Bone Heat Weighting Failed error. I have no idea what to do, so if you guys can somehow fix this, then you're amazing.

.blend file below:

You need to " set origin to geometry" for the mesh.

The button is located in the (t)toolshelf-->Edit-->SetOrigin


I can't draw good lines with the UV texture brush I want to draw thin and clear lines, but when I tried to, every lines are broken and thier quality is pretty bad. How could I made it work better? I used 1 px line but in the video which i referd, even 30 px brush could make thin lines. I guess that 1 px brush doesn't work good.

You can set the brush parameters in the UV/Image Editor tools panel (T to display).

If you want a continuous line you should use the Space stroke method (you can also press E in the image window to switch form a stroke to another).

Make sure that the Spacing value is low enough so that the line is not broken.

To make the line sharp, change its curve (you can add or remove points to give the curve the shape you want), if you select the second one it is pretty sharp.

To save the brush you've created, on the top of the panel, on the right of the brush name, click on the "+" button.

Also good to know, in the image window, F to increase the Radius, shiftF to increase the Strength, X.


When I rendered my model with Cycles, it seemed to flatten out I noticed that when I rendered my model with Cycles, it seemed to flatten out. No matter how much more I rounded the model out, and no matter how I lit it to eliminate shadows, there was still a hint of this. I noticed what looked like other examples of this online. Is there an adjustment I should know about? Also, I tried to re-enter color and texture information and render with the Render engine but this does not work now. Did I change something by using Cycles that I cannot reset?

Is this the issue you have mentioned?

A flat shaded model without shadows as shown in the image below.

Check your "Ambient Occlusion" option under the tab "World". If you have set its "Factor" value to a higher value like "1" you will face this issue.

Try unchecking the Ambient Occlusion option or turn the factor value down to a smaller value like 0.05 or so as required. This might help resolve the issue.

Furthermore, darken the background color towards black, otherwise the model receive equal amount of background light from all angles.

Use multiple (about 3 different) smaller stronger lamps opposed to a large lamp. A large lamp will generate soft shadow and large widely distributed highlights. Small lamps generate well defined falloffs and concentrated highlights.


How to get the pivot point at center I have 2 mesh and i have join them with ctrl+j and made a single mesh. And i want the pivot point to be center of the new mesh i have made from joining the 2. I have tried geometry to origin but also it did not fix the center. Its on the top of the match stick and not in the center of my mesh. I can go in the edit mode and move my model and set the pivot manually. But without doing manually how can to fix it to the center.

Final image (answer for the question)

Select you object. Then, simply Press CTRL+ALT+SHIFT+C and when the menu pops up just press O. This resets the origin to the center of the selected object.


Making a textured sphere using color coded height map? I was trying to create an image of a fantasy world as viewed from space, and so I was wondering if there is a way to apply a texture to a sphere, separate from the actual color of the sphere, using a color coded height map such as
this one

created in John Olssen's fractal world generator. I am sort of new to blender and don't have a lot of experience, so this was meant to be like practice.

Run the color through a "Seperate HSV" node to get the Hue. Then invert the hue and you'll have a more or less accurate result. If you want to make the mountains taller relative to the grasslands I imagine you could do it using RGB curves node. You may also want to get rid of the sea's variation in depth, so that it doesn't look like the sea is uneven. I would recommend doing that by hand or at least without blender.
Let me add, that you don't really want real displacement. You would need extremely dense geometry and it wouldn't look good either. A planet is so large, that its surface imperfections and bumps can not be noticed from space. At least our planet is like that. A simple bump node would give you the detail you need in the reflections (mainly via fresnel). Hope this helps.


Export reprojected texture I'm not entirely sure how to explain this so I hope this makes sense to someone.
Essentially, I have this illustration which I have projected from viewport onto a concertina-folded plane. The idea is that this will be printed and folded in such a way that from a certain perspective it'll be visible as normal, but when flattened out or viewed from the wrong angle it'll be intentionally distorted.

Currently the only method I can think to export the distorted texture from Blender would be to manually unfold the mesh into a flat plane and do an orthographic render of that. Is there any other method that may be more simple?

Is there any way to export a texture which warps to a uniform rectangular UV where all the edges are parallel, which could then be printed onto the physical concertina, perhaps?
I suppose I'm asking if it's possible to perform the opposite of how UVs are meant to be used, warping the image to fit a UV, instead of warping a UV to fit an image. The image below shows the current UV map with the zig-zag shape, can Blender somehow bake the texture to this UV map and then warp the texture with the UV, allowing me to straighten out the UV and therefore distort the texture?

Also, I'm wondering if there is any way to make the projection more accurate, at the moment it seems to still have some degree of distortion as opposed to looking exactly like the original texture once projected.

You can use "UV project modifier" to do that:

The principle: the modifier will take the object (often camera) as point of view to determinate UV map projection.


Which Nvidia RTX attributes are the important ones? This RTX family of Video Cards includes different generations of GDDR ram and amounts and multiple price points as well as so many clock speeds and OC options.

Rather than just throw money at a high-end card, which of these attributes best contributes to the Cycles render for the smartest purchase?

“With NVIDIA RTX, core ray-tracing operations are now hardware accelerated by the GPU, making this the fastest version of Cycles yet.” - Brecht Van Lommel said.

Cycles core computing method is ray trace. And if this thing is supported by GPU hardware directly, then it will be fast to compute ray trace part. So, RT core number will benefit Cycles most in general.

But the whole Blender Cycles use OSL/GLSL for rendering. Not every thing in those complex shader node bottle-neck is to compute ray trace result. See this chart in official Blender Optix support post:

You can see that not every scene got the same boost from using Optix. Since not every thing is boost by new architecture.

Also, there are some special unit to do other calculation in RTX family as well(texture, Render Output):

Those unit (including RT unit) performance are almost directly proportional to GPU Cores in RTX family. So I think don't bother on what core are best for Cycles. Cycles benefit all performance from them.


Exporting a Denoised Composited Image Sequence I just finished Blender Guru's donut tutorial, all parts and levels. However I must have misunderstood how the composite node works, especially in regards to animation (or rather image sequences).

So I rendered the entire animation. The animation has a lot of noises, and as I understand it, for the denoise to work it needs to render first.
After I rendered it, I've imported it as an image sequence in the node viewer, and linked it to the image dot of the denoise node.
Now what do I do? I've tried re-rendering it, but it still renders the noisy renders. I must be missing a function or something that will trigger the composite to render out the sequence. As it is now, I have to save each frame as an image in the image editor. That can't be right?

I figured it out! I'm so proud! I turned on composite in the Output properties under post-processing,
Now when I render the pngs the render says "initializing execution" and the final image is noise free! I look forward to learning about EXRs etc, but I'm just trying to do this one step at a time haha.
Thanks @JachymMicha and @susu!


Is there a way to rotate the origin without rotating the geometry? Is there a way to rotate only the origin, without rotating the geometry?
All I can think of is rotating the whole object in object mode. Once the local axis points in the direction I need, then I go in edit mode and rotate the geometry back in the opposite direction, to its original position. I can live with that, but is there another (faster) way to do this?

First go into Edit Mode (Tab). Select the whole mesh (A) and copy it to the buffer (CtrlC).

Leave Edit Mode Tab and rotate (R) your object as you like. Then go back into Edit Mode, delete the whole mesh (X or DEL).

While still in Edit Mode, paste the mesh from the buffer (Space and type "Paste Selection from Buffer" then hit Enter).

Now leave Edit Mode and the mesh is back in place, but the object is rotated.

Not a direct button to do what you want, but this is pretty quick to do.


How to move layers around? Probably a dumb question, but I can only find solutions on how to move bones from layer to layer,
not how to, for example, move a whole layer from slot 1 to slot 2.

There's no direct way to move layers around from the UI.  I think the best you can do is select the source layer (either clicking in the properties panel or using the ShiftM popup), use A to select all bones, and then M-ove them to the destination layer, assuming the destination layer is empty.  If you are trying to swap two layers "X" and "Y", you need to move all the bones in "X" to a spare empty layer "Z", then move "Y" to "X", and them move "Z" to "Y".


How to get the correct size of the image texture in Blender 2.8 with python? Mutant Bob already helped me a few years ago back when I was dealing with Blender Internal materials, but now I am stuck - how do I get the image size from the active image texture now that we are dealing with nodes with Cycles and Eevee?

example from before:

bpy.context.active_object.data.materials[0].texture_slots[0].texture.image.size[:]

Based on batFINGER's response, this ended up being the solution.

#-----------------------------cameraview paint

class PAINT_OT_CameraviewPaint(bpy.types.Operator):

    bl_idname = "image.cameraview_paint"
    bl_label = "Cameraview Paint"
    bl_options = { 'REGISTER', 'UNDO' }

    def execute(self, context):

        scene = context.scene

        #toggle on/off textpaint

        obj = context.active_object

        if obj:
            mode = obj.mode
            # aslkjdaslkdjasdas
            if mode == 'TEXTURE_PAINT':
                bpy.ops.paint.texture_paint_toggle()

        #save selected plane by rename
        bpy.context.object.name = "canvas"

        #variable to get image texture dimensions - thanks to Mutant Bob http://blender.stackexchange.com/users/660/mutant-bob
        #node solution from batFINGER

        for ob in bpy.context.scene.objects:
            for s in ob.material_slots:
                if s.material and s.material.use_nodes:
                    for n in s.material.node_tree.nodes:
                        if n.type == 'TEX_IMAGE':
                            select_mat = n.image.size[:]
                            #print(obj.name,'uses',n.image.name,'saved at',n.image.filepath)

        #add camera
        bpy.ops.object.camera_add(view_align=False, enter_editmode=False, location=(0, 0, 0), rotation=(0, 0, 0))
        #ratio full
        bpy.context.scene.render.resolution_percentage = 100

        #name it
        bpy.context.object.name = "Canvas View Paint"

        #switch to camera view
        bpy.ops.view3d.object_as_camera()

        #ortho view on current camera
        bpy.context.object.data.type = 'ORTHO'
        #move cam up in Z by 1 unit
        bpy.ops.transform.translate(value=(0, 0, 1), constraint_axis=(False, False, True), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)

        #found on net Atom wrote this simple script

        rnd = bpy.data.scenes[0].render
        rnd.resolution_x, rnd.resolution_y = select_mat

        rndx = rnd.resolution_x
        rndy = rnd.resolution_y

        if rndx >= rndy:
            orthoscale = ((rndx - rndy)/rndy)+1

        elif rndx < rndy:
            orthoscale = 1

        bpy.context.object.data.ortho_scale = orthoscale

        bpy.context.selectable_objects

        #deselect camera
        bpy.ops.object.select_all(action='TOGGLE')

        #select plane
        bpy.ops.object.select_all(action='DESELECT')
        ob = bpy.data.objects["canvas"]
        bpy.context.view_layer.objects.active = ob

        #selection to texpaint toggle
        bpy.ops.paint.texture_paint_toggle()

        return {'FINISHED'}


Mark freestyle edge to all objects in a collection with Python I'm a new Blender user and just started trying python. I want to apply Mark freestyle edge to all objects in a collection with code instead of doing it manually.

If I have objects selected in object mode & used the code below it works:

import bpy

for obj in bpy.context.selected_objects:

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

    bpy.ops.mesh.mark_freestyle_edge(clear=False)

I'll like to do the same but without having to select objects first. I found this but I can't combine them into one script.

import bpy

col = bpy.data.collections.get("Collection_name")
if col:
   for obj in col.objects:
       obj.select_set(state=True)

Thanks,

I did some more research and found the solution.

import bpy

for obj in bpy.data.collections['wireframe'].all_objects: obj.select_set(True)

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

bpy.ops.mesh.mark_freestyle_edge(clear=False)


Import OBJ with textures So up until recently I have been editing 3D models using the built in windows 10 app 3D builder, but I decided to give blender a go because of its good reviews. When 3D builder exports as an obj it puts the obj file, an mtl(I think), and all of the textures. When I import the obj to blender, not surprisingly, it drops all the textures and makes the object white. How do I import the textures along with the obj?

OBJ (Wavefront) file itself only stores geometry data, it does not keep anything regarding materials or textures. So you can't import .obj file with texture or materials.You can try .fbx file.


The difference boolean doesn't seem to work on a specific area I am trying to build a pc in blender and I just updated my blender to 2.91 but the boolean modifier doesn't seem to work as expected on a specific area.I am attaching a video below
https://streamable.com/ovvr7a

The Boolean modifier relies on correctly set normals. Check if your normals are all facing outwards by checking "Face Orientation" in the Viewport Overlays menu:

All the outward faces should be blue. If an object has incorrect normals, you can select all of its faces (A) in edit mode, and Mesh > Normals > Recalculate Outside (ShiftN)


Optimize UV map after removing geometry I have a model created via photogrametry. I removed lots of unuseful geometry, but the UV map stays the same, taking a lot of space containing non useful data. I need to optimize the model for the smallest possible size.

Is there a way to optimize the materials so they're only made of the remaining part of the geometry?

Thanks for your help

I never did this in Blender, but the way should be like this:

1.) Make a copy (not instance) of your mesh

2.) Reunwrap the copy(its probably easier if you turn off the textured mode while doing that)

3.) Bake the texture from the old model to the new one. I googled this here
hope its still valid / useful


Rendering to Google Drive? I have a blend that's 493 frames long.
I have 2 pc's. A desktop and a laptop. I usually bring the laptop to work.*
I looking for a way to render the same blend on both the desktop and the laptop and exporting the frames to a shared folder.
Since my laptop is going to travel from my workplace to my home and back I think the best way would be using Google Drive to sync the folders.

Google Drive syncs in:
C:\Users\USERNAME\Google Drive.

How can I render to that folder on both my laptop and pc regardless of the user name? Can I use environment variables when rendering?

No, you can not use environment variables in the Output File field, because it doesn't support drivers (and key-framing also).

You would have to write a python script that would change this field every time you open the file (with Run Python Scripts enabled in Preferences). In the script you can for sure use python environment variables:

import bpy
import os

user = os.environ['USERNAME']
bpy.context.scene.render.filepath = "C:\\Users\\" + user + "\\GoogleDrive\\file_name"

The best thing to do is to put the .blend file also in the Google Drive folder and use relative paths just like: //rendered\file_name(this saves to folder "rendered" next to the .blend file).


Full spherical view inside Blender Game from Pre-Rendered images Ever played Myst IV? Most of the game visuals are pre-rendered and you move in a discrete fashion. However, you have the ability to turn the camera 360ºH and 180ºV with your mouse.

I want to accomplish that inside Blender Game using still images renderer in Blender Cycles. What's the most direct, no frills workflow to achieve such thing?

You can render straight to a panorama/full dome image from Cycles by simply adjusting the camera type to Panoramic.

Then you can UV map the rendered image onto a sphere in the BGE and use a mouse-look controller to allow the player to look around it.


Problems with denoising in rendering I'm starting to take my first steps in Blender. I recently did the BlenderGuru's light bulbs tutorial. I have problems with rendering. The two images attached were rendered using Cycles (Blender 2.79), by CPU, 16x16 tile size and 1000 samples (all other parameters by default). The first image presents an excessive amount of noise (fireflies).

To mitigate this problem I used denoising (with default parameters), but another problem arose: black areas appear around the brightest reflections in the off bulbs (zoom in image).

I duplicated the number of samples in both cases with the same reder results.

Anyone knows how to solve this? What am I doing wrong?

Here is the .blend file

Thank you very much!

Play around with the radius settings for denoise.

On the other hand you can get a very clean render disabling denoise all together and using clamp indirect.

Here's your scene with no denoise and Clamp indirect 10.0


Blender stopped rendering with cycles I'm following the donut tutorial and got to part 6, everything was going well and I was switching back and forth between eevee and cycles just fine until... it no longer will render cycles in the viewport.  I can still render images with cycles, but the viewport isn't working.
I tried closing and restarting my computer + restoring blender to factory settings.  I'm hoping theres a setting I'm messed up.

Ok I figured it out, the first clue was that I wasn't seeing a shadow on the plane even in eevee.  Turns out I was in 'solid mode' and not in 'render preview mode'.
Leaving this up in case it helps another beginner.


How to create a lattice and link all objects to it procedurally? I've been trying to do that but have got some problems:

I was not able to retrieve the reference to a recently created object with bpy.ops.object.add().I had to use bpy.ops.lattice.select_all(), but that sounds inelegant.
While I was able to create a lattice for each object with bpy.ops.object.modifier_add(type='LATTICE'), I was not able to link it - mostly because the command to link a lattice modifier to the lattice object won't show on the info window. (Also, this needs the object to be selected...)

What is the proper way to do it?

The proper way is to not use operators:
import bpy

scene = bpy.context.scene

lattice = bpy.data.lattices.new("Lattice")
lattice_ob = bpy.data.objects.new("Lattice", lattice)
lattice_ob.scale = (5, 5, 5)

for ob in scene.objects:
    if ob.type == 'MESH':
        mod = ob.modifiers.new("Lattice", 'LATTICE')
        mod.object = lattice_ob

scene.objects.link(lattice_ob)
scene.update()

The .new() methods return object references to be used for subsequent method calls and property assignments in contrast to operators, which run isolated and only return a status (e.g. {'FINISHED'}). Some methods also take objects (the second parameter of objects.new()), whereas operators don't support objects/pointers, but only references by name (StringProperty).
//update: For Blender 2.8 and above, I believe you would do it like this:
import bpy

collection = bpy.context.collection

lattice = bpy.data.lattices.new("Lattice")
lattice_ob = bpy.data.objects.new("Lattice", lattice)
lattice_ob.scale = (5, 5, 5)

for ob in collection.objects:
    if ob.type == 'MESH':
        mod = ob.modifiers.new("Lattice", 'LATTICE')
        mod.object = lattice_ob

collection.objects.link(lattice_ob)


Blender Scale Issues with MakeHuman and Mixamo Fuse I have imported the Mixamo Fuse default female character and a MakeHuman MHX2 file. I want to project the UV map of the Fuse default onto the MakeHuman character because Mixamo Fuse has a strict and different UV map in order to import to Fuse. (Is that possible, someone said to use the Shrinkwrap Modifier?)

See Here: https://community.mixamo.com/hc/en-us/community/posts/205090387-UV-Map-Frustration-from-a-disabled-designer

I have a major scale issue (yes, I did change the MakeHuman model to meters before exporting) It does not matter which model I import first or second. The first model imports to the correct scale. The second model imports as a tiny and I mean almost not visible from any angle or zoom  factor model.

Is there a solution to this issue?

Without seeing a ~.blend file containing both imported images, this is a bit of shot in the dark, but the first thing I would try is to open the file, select the model that is in the smaller scale in object mode, then switch to edit mode, and scale the model up until the proportions approximate those of the first model imported. Then switch back to object mode, and apply the scale of the object using CTRL - A.

Of course you could use the same technique in the reverse direction to scale the larger object down to the smaller one.


Blender Viewport suddenly blank The viewport of my Blender project recently went completely blank except the cursor. I rendered once and only the HDR is seen. I've checked all the visibility options and everything seems okay.

Here is a screenshot:

Here is a link to the project file:

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

Your issue is that you've moved your viewport really far away from your scene, out of its render distance, so you couldn't even see your objects anymore.

One quick solution is to select any object of your scene (or just press A), and use the "view selected" function available in the View menun or via Numpad .. That's it.


Object scaling preventing retargeting of rigify rig to bvh with MakeWalk I created my rig from rigify armature and it is working beautifully.

The issue now is I want to load some mocap bvh files on it, I'm using MakeWalk addon but when I try to load the bvh file by clicking in "Load and Retarget" button under the Misc Tab I got this error:

I searched a lot I didn't find any clue to solve this... using a regular rig or makehuman rig would be a pain in the a*% for me since Rigify is amazing and I am pretty used to it.

any tips are welcome thanks

Apply Scale

The warning indicates the rig scale in object mode is not (1, 1, 1) (unity). Select the rig in object mode and press ctrl-A-S, or select via the Object > Apply > Scale  menu, to apply scale.

It's the same process as selecting all bones in edit mode and scaling to match the current size, with unity object scaling.


Display object only in certain animation I got two object "Rabbit" and "Knife" with armature.
I need to show Knife armature in "Cook" animation only, and hide in other animation.

Animation:
1. Cook(knife displayed)

Walk(Need to hide knife)

Does anyone know how to do this?

In pose mode scale to zero bone that controls object

Just insert keyframe for scale with zero value.

But if you perform switching between actions, bones will inherit values from previous action (true only for non-animated values). To override zero values, you have to insert keyframe with value 1 in all actions, where object is present.


Split Edges doesn't work I found a hard surface modeling technique in the video below (link) but i have no idea how to make it work. Skip to the minute 28:00 of the video.

https://www.youtube.com/watch?v=oJbxu_GLMz0&list=WL&index=4&t=1583s

Please someone know how could this work?
Thanks in advance.

Start with a default cube;

Add a Solidify and Bevel modifier;

Edit the cube, and add an edge loop;

Hit v, then enter;

Edit the Solidify thickness to a desired value;

Edit the cube, and add another loop cut, hit v, then enter;

Add in a bunch more, wherever you like;


How to make a rough gravel terrain? I need some help figuring out how to model some rocky ground. Basically, I want to model the Ludendorff Bridge and I'm in the process of trying to create the ballast-like area of the train tracks, for example:

You can see a train track situated on the rocky ground I'm trying to create.

How would I go about doing this? I've tried creating individual rocks and then dropping a bunch of them with the Drop To Ground add-on, but it doesn't really give the effect I'm going for.

A particle system with Dupli-group is probably a good way to go.

I'd start by creating a dozen or so rock templates. Using modifiers, you can come up with this pretty fast:

Then create a new plane that will serve as the base of where the rocks will go, and create a particle system to it. The particles system controls where the rocks will go, distribution, size, etc.


How does scultping fit into the workflow? So i am familiar with modeling, and I know that you want to try and maintain quads, especially when planning on animating/rigging ect.
I know that sculpting results in a lot of tris, which is bad for animation. So, say I wanted to sculpt a wood plank (maybe the grooves in the wood ect.), would I be able to sculpt that and then use it in my animation, as long as it’s not moving (even though it has tris)?
And then, say I were to sculpt a character, but then I did want to animate and rig it. I would need to convert those tris to quads, correct? Would this be retopology?
I guess I’m trying to figure out how sculpting fits into the workflow of creating models. Thank you for your help!

Generally speaking, sculpting is used either to add details to a model, or the replicate organic organisms. In the former, it is used as a final stage to create a normal map, and does not significantly alter the shape of the model. In the latter, all but the most basic blocking out is done using sculpting, and the topology is created after the fact, using retopology.

Adding Details

When you use sculpting to add details, those details are generally baked into a normal map. Create a model that fully defines the overall shape of your mesh, and then sculpt fine details on it. Just keep a pre-sculpt copy of the mesh, and then use blender built-in baking features to turn those details into a normal map.

Organic Organisms

While some people do use sculpting to create hard surface objects, this is the exception and a fairly advanced use of sculpting. CG Cookie once made a tutorial on this (requires a subscription) if you are interested.

The majority of users use sculpting to create creatures and characters. Often they model a basic mesh that defines the shape, and then sculpt from there. They will then retopologize the mesh and possibly bake any lost details into a normal map. The retopology makes the mesh animation ready, and brings down the insanely high polygon count.


make Decimate modifier permanent I've got a really cool model of a Mechwarrior robot, beautifully made, that is entirely too many vertices for putting into my game framework. I've been using the Decimate modifier successfully to reduce the vertex count from around 199K to about 20K, or about 10% original size. Great!.

Now I need to uv map the model with a simple texture. Not looking for precision here, I'm just learning the ropes.

Problem is, when I uvunwrap the model, the full vertex count reappears and everything is entirely too complex.

Is there a way to apply the Decimate modifier and make it permanent? Basically have Blender forget about all those decimated vertices?

Thanks!

Simply click the Apply button of the decimate modifier. You must be in Object Mode for that to work.


How to put 2 parts of 1 object on different layers? I have single object (human model), but I want legs and arms to be in different layers so I can composite it in compositor. I don't want to break it into different object.

You cannot move different parts of the same object to separate layers.

As mentioned by sambler, what you are trying to do is possible using separate materials to generate masks.

Quoting from my answer here:

  This can be done . . . using an ID Mask node:

  . . .
  1. Enable Material index in Render layers > Passes, and set the pass index for the material:

  Use Materials > Settings > Pass > index to set the pass index of the  material in Cycles:

  Or in Blender internal use Materials > Options > Pass index:

  Add an ID Mask node and set the Index to 1.
  Plug the IndexOB output from the Renderlayer node into the ID Mask node. This will provide a mask for the [material]:

This will give you a black and white mask of that material, which you can use to separate, combine, etc. in the compositor using mix nodes.


How to get the exact color as output that we are looking for? I have been learning Blender recently. And I have understood that lighting plays an important role in getting the exact shade of color that we want. But I am still not clear on how to achieve this.
For ex, I am trying to create a plane for my background with the color(Hex: #ffc1c2). But no matter how much I play with the lighting(Area and point)I am unable to get this color as output in the rendered image using cycles.
Can anyone help me on how to get the color that we want as output.

The values and position of your lights (and world/HDRI) will affect the color of your object, and all the indirect lights as well, so you can't get the exact same color, except, of course, if you use an Emission node.
I've noticed though that if you delete all source of light, create a sun, reset its rotation, give it a Strength of 3.1 and an Angle of 0, you'll get the exact same color in render. So if you want to keep the exact same color you need to stay around these values, or if you play with one of these values you need to compensate with another.
If you test Emission or a sun with this precise setup but still don't get the exact same color, it may have to do with the Render settings (example: the Color Management settings, View Transform must be on Standard).


Assign mirrored existing weights from bone_L to bone_R vertex group I have already painted bone_L weights over my mesh. How can I assign the mirrored weights of bone_L vertex group to the bone_R vertex group?

Sub-question: is there a way to do so for multiple selected bones at once?

Method 1: Ensuring that you will always get mirrored weights from the very start of your project.

While in Weight Paint Mode, look in the Properties Shelf to the right of your viewport (press n to bring it up) and select the Tools tab. There is a Symmetry section, as well as an Options section. Do not activate anything under the Symmetry section, as it will not do what you want. If any Axis buttons are activated under the Symmetry section, press them to deactivate them. What this does is add whatever weight value you are painting to the other side of the mesh, but only for the current vertex group, not its mirrored partner.  Instead, you want to make sure that X Mirror is checked under the Options section. This will ensure that whatever weighting you add on one side is mirrored to the corresponding vertex group on the other side. Provided that this other vertex group exists, of course.

Method 2: Mirroring existing weights after they've already been created.

Go into the Object Data tab of the Properties Panel with your mesh selected in Object Mode. Press the Plus Sign to the right of the Vertex Group section to create a new vertex group. Even though you only want to mirror a vertex group, you must create a new one first, and assign weights to it from selected vertices. It seems like you should be able to mirror vertex groups without beginning with a creation step, but mirroring without creating a new vertex group first will actually remove the old weights from the old group and replace them with mirrored versions of those same weights,now on the opposite side of the mesh, which is not what you want. Note that creating a new vertex group first doesn't alter this behavior, but it does ensure that the weight reassignment takes place only for the newly created vertex group, while leaving the old one alone. The end result is that you will now have two vertex groups with mirrored weights. It's just that you needed to manually create the new vertex group before mirroring, to avoid losing the original weights in the old group. So understand that the Mirror Vertex Group option creates no new vertex groups, but merely reassigns existing ones.

Give the new vertex group a name, and end it with either a .L or .R suffix, based on which side you will want it on. Switch back to Edit Mode and select the vertices that will be assigned to this group and hit the Assign button. Make sure the blue Weight bar under the Vertex Groups section is set to a value greater than zero, or the assignment will have no effect (it's usually at 1 by default, meaning full influence).

Now go back to Weight Paint mode so that you can see the effect of what happens next. In the Object Data tab once again, make sure your new vertex group is still selected under the Vertex Group section, go to the Vertex Group Specials pulldown (1) and choose Copy Vertex Group (2). The new one will be given the same name as the old, except it will either have a "_copy" or ".001" suffix, which is not what you want. Rename it to have a '.R' or '.L' suffix, whichever is the opposite of the one you first created.

Now that you have two groups, instead of one, you can mirror the new one. As explained earlier, mirroring will remove existing weights from the selected vertex group, but that is okay, because you still have the original vertex group's weights in tact. From the same Vertex Group Specials pulldown, with your new vertex group selected, choose Mirror Vertex Weights (3). You should see in your viewport that weights have appeared on the opposite side of the mesh.


Giving smoke no shadow I've been trying to use smoke as a way to show simple steam for some hot coffee, generally looks good except the steam has a huge shadow, not something I really see in real life, so I'm trying to disable it's shadow. I've read these posts:

Totally white shadeless material in Cycles?

Where Is Shadeless Material Option For Blender 2.8?

Which generally suggest this node setup (what I'm currently using):

But my final render still has a shadow (notice the black shadow off to the right of the coffee cup):

I've applied this node setup on the "smoke" material generated when I add "quick smoke" --  not to the smoke domain, doing that results in a big white box, which makes sense. I don't really know where else I can setup this shader so I'm assuming I'm doing it right, but maybe not, a little unclear to me.

Any help greatly appreciated!!!

If you're using Cycles:

Select your smoke object, go to Object Properties tab, then Visibility > Ray Visibility and disable Shadows.


Subdivision surface smoothing only some edges I am applying the Subdivision Surface modifier on the model of a queen chess piece. Does anyone know why some of the crown's horns are modified like in the second picture? The topology seems to be exactly the same for each individual horn. My desired outcome is for all the horns to remain pointy.

Actually your topology should not allow to have sharp tips, it's just because some of your faces are flipped that you get them sharp, if you recalculate the normals you'll have the same result:

To fix this, bring some edge loops with the knife (K to activate, Z to cut through):


Does blender release the memory when a render is finished? I use Blender basically for rendering. and often I need to continue working in Blender (modelling - Graphics, CAD) while Blender is rendering.

My assumption is that after blender renders it does not release the memory used, is this true?

Should I close Blender after every render to release the memory?

Any comment, clue will be great.

Certain things like image textures are cached after a render, so they don't have to loaded from disk if you render again. That can be disabled in the Render Properties panel(But i wouldn't recommend it unless you are really low on RAM):

As previously mentioned, after a rendering, the system memory usage is definitely higher, but there is no runaway memory leaks, so you can just keep rendering again and again without having to worry about Blender running out of memory.

For the GPU renderer, data on the GPU RAM are freed as soon as the render is done.

"Free RAM is wasted RAM". As long as your system has enough RAM that it's not swapping to disk, I wouldn't worry too much about it.


background image/video issue in blender vfx I was following one youtube tutorial and tried vfx green background.

I have selected the mask and now in compositing mode i want to add a new background. But, i am unable to do that . Please suggest me the menu to do that .
I am a beginner in Blender vfx.

I have attached the screenshot.

Press Shift + A and add one more movie clip, load your background footage in that movie clip angle, and finally you can connect it with viewer


Connect vertices where they would meet, not fill? Lets say I have a plane, and I extrude two edges, it would produce a gap. I would like to fill this gap by using the projected intersection of the new outer edges. Shown in the right most example of the image below:

I can extrude the two vertices and fill the area, making the desired outcome. If I had used F to fill before I've made the vertices meet, the result would be a square with diagonal edges (the empty area would be filled and turned into a triangle, not a square).

For my situation, I am trying to do the same, except I am using a circle. If I simply hit F to join the two vertices I get the result seen on 3.
How can I connect the two vertices where they meet (shown in 4). Are there any tools to get the intersection or fill it automatically?

You might want to try the tinyCAD addon.

Select the two extruded edges then choose w->TinyCAD->VTX Auto and you will get a vertex joining the two where they would intersect.


How do I print something to the console when using the game engine? I am having trouble just starting a script in BGE
for example

cont = GameLogic.getCurrentController()
print dir(GameLogic)

This does not print out in a console window - In fact I get no interaction with the console window at all At this point I would love to simply print something out from a script to the console. Is there a quick test to check my system? Is there a  tutorial which just gets things rolling? Thanks in advance

You need to import GameLogic before you can use it, print statement has been replaced by a function in python3 print( arg ).
This works:
import bge
import GameLogic
cont = GameLogic.getCurrentController()
print(dir(cont))

or alternatively
cont = bge.logic.getCurrentController() # bge.logic is automatically imported
print(dir(cont))

Note that the script wouldn't work in the python console (Editor Type) only when wired in the logic editor.

The output goes to console opened via main menu: Window / Toggle System Console
Related:

Is it possible to dump an Objects Properties and Methods?


Can a quaternion be used to convert between coordinate systems? I'm trying to convert hierachical rotation matrices (from a Kinect) to manipulate a mesh in the game engine.

I was trying to change the Quaternion values like:

  qt.w = qr.w
  qt.x = qr.x
  qt.y = -qr.z
  qt.z = qr.y

Should this work mathematicaly?

My models joints jump randomly around (this with having only a few matrices changed from idendity to have a chance while debugging):

I'm not into quats at all, but here's something I noticed, which may or may not be of any use.

Swap y and z in a matrix and look at the quat:

>>> Matrix(((1,0,0,0),(0,1,0,0),(0,0,1,0),(0,0,0,1))).to_quaternion()
Quaternion((1.0, 0.0, 0.0, 0.0))

>>> Matrix(((1,0,0,0),(0,0,1,0),(0,1,0,0),(0,0,0,1))).to_quaternion()
Quaternion((0.9999999403953552, 0.0, 0.0, 0.0))

# both matrices give different orientations, but not the quats!

And here's a custom space matrix:

>>> Matrix(((1,0,0,0),(0,0,-1,0),(0,1,0,0),(0,0,0,1))).to_quaternion()
Quaternion((0.7071068286895752, 0.7071068286895752, 0.0, 0.0))

>>> Matrix(((1,0,0,0),(0,0,1,0),(0,-1,0,0),(0,0,0,1))).to_quaternion()
Quaternion((0.7071068286895752, -0.7071068286895752, 0.0, 0.0))

Note the difference 1.0 / 0.0 vs. 0.7 / 0.7 (whereas the matrices are normalized, with using zeroes and ones only) - it might not be enough to negate the sign of a quat component.

I suggest you create a custom matrix for the space conversion and cast it to quat.


Mesh Has Black Faces and Recalculate Normals Outside (Ctrl+N) Change Nothing everyone.

I'm still "intermediate" in Blender.
I usually mod 3D model from TESIV:Oblivion game.
Know a bit about: importing, exporting, cutting mesh, UV mapping, bone weighting, etc.
But haven't learn to make 3D model from 0.

Usually, there's commmunity that likes to rip 3D model from games.
And so, I import .obj file to Blender 2.49b, but found this issue on the mesh:

Anybody know how to fix it?

(I follow this link: Why are some faces in my mesh darker? but nothing change)

Found solution!
Use NifSkope, right-click on the mesh, choose Mesh > Face Normals.


Toggle Lamp Visibility Blender Game Engine and Python I have this Sun lamp in my scene. I need to toggle the visibility of the lamp with the press of a button. I tried using the Visibility actuator, but it does not remove my lamp because visibility in the Physics panel does not apply to lamp values. I thought of a few ways of toggling the visibility of it, but could not get any of them working:

Move lamp to another layer on the same scene
Delete lamp and re-spawn it (I tried endObject() but it would never remove the object)
Change the lamp's brightness value

Remember, this is going to be on a button, so it has to be re-spawnable. If I could get the base code, I can make the toggleable if block myself. Also, this is a Python question. Logic blocks take more time to setup than just a simple script. ;)

Thanks in advance!

In python you can access the lamps energy attribute like this:

bpy.data.objects["Lamp"].data.energy = 0

In the game engine you can toggle the energy by this script (assumes energy value set to 1.0):

co = bge.logic.getCurrentController()
lamp = co.owner
toggle = co.sensors["space"] # space is the name of keyboard sensor

if toggle.positive:
    lamp.energy = 1 - lamp.energy


Boolean modifier combined with Subsurf modifier creates weird shapes. How to Fix? When I use the subsurf modifier with the boolean modifier, the model looks weird

With boolean only:

Boolean and subsurf modifier:

Check the video to see what I mean
https://www.dropbox.com/s/su496cek5o2pn9e/2018-08-27%2020-59-05.mp4?dl=0

Boolean operations always messes with the topology of the mesh, you can go around this in some ways, but the best practice is to invest in understanding topology, and how to create the best topology for Your model. In this Example, I would make the model without the boolean modifier and do something like this:

Without subsurf

With subsurf, and edge crease on the edges to create sharp edges.

If you want to learn about topology, the anvil series by Blender Guru is quite good. He also addresses the issues with the boolean modifier and the topology (in part 2).


Cannot add image texture to UV unwrap? New to Blender, trying to load an image texture into the Diffuse channel instead of a colour to learn to UV unwrap. Quite simply I do not have the button needed to the right of the colour bar in materials to open the drop down menu with the image texture option in it, why is that? Using 2.79

thanks


How to bring back the mainframe I'm not sure how I did it but I accidentally deleted the mainframe and don't know how to bring it back. while I was trying to, I duplicated the thing under the mainframe and put it above it. I have tried so many things to get It back for so long. I noticed that when I went to another project or a new one it was like usual. Please help I am extremely frustrated. Here are some pictures to show what I am talking about if you got confused:

It is not called a mainframe, it is called the Outliner. This took me a while to figure out what you meant, but that's fine.
Look very closely at the top right corner inside where the outliner should be. See that gray arrow pointing down? Click it or drag it down. A bar should slide down. Go to the left side of that bar, and there is another dropdown. Click it, and from the window types select Data->Outliner.
Click the arrow to unhide the header and switch to Outliner.


How to convert image textures to different formats? I used Blender to export a 3D model in X3D format. However, textures are automatically exported in TGA format. In order to print multicolor models in Shapeways (https://www.shapeways.com), the requirement is to provide textures in JPG or GIF format. Is there any way to do this in Blender or any other tool?

In the UV/image Editor select the texture or image you want to convert and press F3 (or Image->Save As),

Then select which format you want to save as.

(If you don't see these options on the left side of the screen press T.)

NOTE: Gif files are not supported in blender..

see http://wiki.blender.org/index.php/Doc:2.6/Manual/Data_System/Files/Formats


Why does Blender say “Python script failed, check the message in the system console” when trying to import a Blender Python file from SynthEyes? I am new to SynthEyes and I just tracked something but when I try to import it to Blender it just says:

Python script failed, check the message in the system console.

When I check the system console it says:

Traceback (most recent call last):   File "\3d Camera Track.py", line
3, in  ModuleNotFoundError: No module named 'Blender' Error:
Python script failed, check the message in the system console

It's for version 2.49b or before.
If the script is trying to import Blender assume it is written for Blender version 2.49 and before.
Script will need to be upgraded (or search for upgraded version)  using  bpy for later version.


Eyeball gloss not visible behind another glass object I have these objects with glasslike materials

I used refraction and glossy shaders because I dont like the double relfection I get with a glass shader.

But even with a glass shader my eye glass shader is not visible behind it.

`

This is my reference:
Clear reflections, clear see through glass

Any tips, trick or advice?

Ok I tested your setup and found your mistake. The outer ball material is more or less correct (You can omit the reflection ray handling). The problem is the inner reflection material of the eye. Just remove everything you have done with Light Paths in that material and it should work perfectly fine.

EDIT:
Also you should change out the Glass BSDF for a Glossy BSDF in the eye reflection. At least I found it to work better.


Particles and Textures and Density Goal

Particles density produced by Texture Image Sequences such as black and white.

Current Situation

Unreliable Failed results.

Question

Below particles correspond to Black and White, if I take manual intervention by clicking say ramp on .... ramp off repeatedly, the usual incantations.  I have never achieved a successful render of an image sequence.  Single Image I can achieve as in the below pic.

Has anyone achieved reliable results with the above goal and if so how?

If I understand you correctly (and I might not) and you want to control particle emission with an image sequence, then this isn't possible. Only the first image in an image sequence will be taken into account for particle density.

According to Brecht, one of the Blender developers here:

  The problem here is a limitation of the particle system. The way it works is that a distribution of particles is generated once beforehand (to have an even distribution), and can't be dynamically changed.


How to evenly space vertices along several segments bezier curve Is there a way I can separate the vertices on the the segments evenly without moving the end points? I would like for the vertices to maintain the current curve.

As far as I know there is currently no way to do what you ask in Blender.

There currently is no tool to evenly place existing vertex long a curve.

If you already have a curve with the desired shape and wish to add additional vertex you can use the Subdivide operator under the Specials Menu W key. This will evenly subdivide currently selected segments and place vertex along its length at regular intervals while trying to maintain the shape as best as possible.

One workaround you might use is using an array modifier on a mesh to reconstruct you curve.

Create a new mesh
Erase everything but one single edge
Place one of it's vertex on the object's origin so that the edge starts at local coordinates 0,0,0 and extends horizontally in X
Align that object with your curve (same object coordinates and same rotation)
Add an array modifier to the new mesh and set it to Fit Curve mode
Pick your curve as length object and turn on option Merge in the array modifier
Now add a Curve Modifier to the mesh and set it to use your same curve
You should now have a mesh with the same shape as your curve and evenly spaced vertex.
Adjust your mesh edge length to fit your desired level of detail or vertex spacing
Convert your mesh to a curve with Alt+C > Curve from mesh
Enter edit mode on newly created curve and set it's type to Bezier (Tool Shelf > Tools > Set Spline Type button)
Set it's handle types to Auto for smoothest results with the V menu Set handle type > Automatic

Hope this helps


How to create car paint material? so i am trying to learn texturing so that i can render my cars, but these car paint materials are pretty hard to make for a noob. I did some research and tried making this shader in cycles but failed miserably. Can anyone help me here? How can i get car paint shader like one shown here in cycles?

Try this :D

Also, I suggest getting the PBR materials add-on if you want accurate materials.


Cycles renders object deep purple I've been following this tutorial (using blender 2.8). At around 14:15 a sphere is created and a texture with some modifiers wrapped onto it; this is what I get when following the tutorial exactly:

With Eevee:

With Cycles:

Why does Cycles forget about the nodes?

I created the shader with "All" as the output.

Tried redoing the material directly in Cycles; now the sphere is purple by default and remains so even after the texture has been added.

I was able to recreate the problem: it seems to be caused by setting material output to Cycles (in the material editor) while rendering with Eevee (in the render settings). The only solution I know is to render with the same render engine as you specify in the material.


Mirror modifier active after applying Blender Version
2.79b (2.79b 2018-03-22, Blender Foundation)

Issue:
As per the screenshot the mirror modifier still appears to be active (see the crease I added) even though it is no longer seen under the "modifiers" section of this object.

I'm quite new to Blender.  Is this a bug or something I am doing?

You are in the Sculpt mode. Turn off Symmetry/Lock in the T-panel


How can I make an existing mesh appear to be drawn in animation? I have a mesh of a football field that I want to render so that it seems to be drawn onto another plane in an animation. The basic idea, in the end, is that I want to make an animation that shows a football field being created on a barren piece of land, but I first want to figure out how to do this first step of drawing the lines.

Here's my mesh:

I'd like for it to either start smack in the middle or on one of the corners, from nothing to the mesh here.

Thanks in advance.

You can use animate the size of another object (e.g. the radius of a cylinder) using keyframes, and then apply a boolean intersect modifier to your mesh.

Step by step

Create a cylinder with the middle in the point where you want the "drawing" to start. Make sure that it's thick enough to cover all the mesh on the Z direction

Scale it down on the X and Y directions hitting S then Shift+Z

Set a keyframe to the current size using I > Scaling. Then move to the end frame, scale it up (again only along X-Y with S and Shift+Z), and set another keyframe (I > Scaling).

Optionally, you can avoid the visualization of a solid cylinder by setting its maximum draw type to wire

Last, select your mesh and add a Boolean modifier, using the Intersect method and your cylinder as the reference object


Combine multiple blender files I'd like to know if it's possible to link a .blend with another .blend file.

For example, I have a House .blend file, but it has no doors. I'd like to add multiple of the same door .blend file to the house, and have it so that if I edit the door .blend file, it will update all of the corresponding doors in the house .blend file, and possibly have it editable in the house .blend file too, where editing a door in the house .blend file would update all other door objects and the door .blend file.

I just find it would make life much easier for making models for things like games, where it's tedious to edit everything in 1 single file.

Thanks in advance!

Use the Link. (Surprising you already used the word in your question!)
This will enable you to import the object and the change in the original file will be reflected.

You might also be interested in the Scenes. This is a link within a single file.


Noise in thin gaps between meshes in cycles I´m new at this and Im out of my depth. The problem is this: rendering in cycles, at some places of the model, specially in the thin gaps between different meshes (marked red), I get a lot of noise. See image attached. I´ve raised the samples, the bounces, etc... and it alleviates the problem but still persist. What am I doing wrong? Do I need to add even more samples? That would a pain.

I´ll add the render, world and material settings. I hope you spot something inusual. The file is quite heavy, so I´ll only waste your bandwidht as a last resort.
I´ve already tried to disable the bump mapping, in case it was that causing any normal problem or something, but it didn´t work.

Try this checkbox, I'm just wondering if it's the smoothing.

Edited to add:  This was not the answer in this case, but shade smooth can produce effects somewhat like this as seen in this example:

The auto-smooth option defines a cutoff where, below this angle, normals will be smoothed between the two faces.  For angles above this threshold the hard edge is retained.


Hotkey to set playhead to Left mouse click In the Video Editor (Sequencer), left mouse anywhere used to move the playhead. Now one must click in the frame numbers (since left click now select, which I like) to achieve the same thing.
Is there a way to set SHIFT + left click anywhere moves/scrubs the playhead?
Some research shows change frame but I think that is now gone (can't find it in the hotkey list) How to map “CHANGE FRAME” to mouse right click in Blender 2.80 in the VSE.

Shift + Right Mouse Button
At the top of the hotkey list is a search box, search for change frame and see/set the Sequencer value.


How can I add banded lines to the end of cinnamon sticks(or sheets of wood)? I would like to make a realistic cinnamon stick and its shader. My approach is as much procedural as possible, but easier options are ok too.

Here is my first render:

And a reference image:

(3)I have noticed that there's a darker line can be seen at the both ends; how can I achieve this?

To add the darker banded lines on the ends of the model, you can make a linear gradient texture, instead, I used Google image search.

By selecting all of the edges and by pressing u UV Mapping->Follow Active Quads you should end up with a mapping that is proportional and square.  Be sure to select a face near an edge where you want the mapping to begin.  This will be the Active Quad which the algorithm uses as its basis.  You can see the active quad in the following image, it is pale compared to the other selections and also has a grid of white dots across it. Now rotate and scale the UV Coordinates to align properly with the image you selected.

The color doesn't matter because you can use an RBG To BW node to make it greyscale.

Here is what it looks like when rendered.

You can also use Generated Coordinates with a Wave Texture set to Bands.  It works well for the model I made but this is because the model is planer and is rolled up with an Armature.  When the Armature Modifier is Applied, it no longer works.

Here is the Blend file. Select either of the Material Output nodes to make that material active.


How do I change the number on the end of a animated render? I would like to change the amount of numbers at the end of my animation, separated by BMP images. For example, change 0001 to 001, ect. Thank you! I'm using Internal Render on 2.79.

Check the manual. Or do some research before posting.


Regularly spaced holes in a cylinder What would be the best method for making regularly spaced holes in a cylindrical mesh? Similar to the vent holes you'd see on gun barrels like these:

Without creating any n-gons, having good topology, and not excessively increasing the tri/polycount overall (this is for models that would potentially be used in a game). It would be good to know how to do this in a way that would work where the holes overlap on the x axis of the cylinder if you see what I mean, like the MG34 barrel, and where they don't, like the SMG barrel.

Being a huge fan of modifiers, I've tried this solution here, which keeps the modelling geometry as simple as possible (I guess). You can see the results here in this Blend file:

There are two layers, I've experimented a bit with the topology of the base mesh to reduce shading artefacts. Unfortunately, they cannot be avoided completely.
Procedure
You can start off with laying down the polygons highlighted in this screenshot:

A rather elaborate modifier stack will then turn this into the pipe geometry you're looking for. I won't explain all of them as you have the Blend file too, but I'll talk a bit about the first Array.

The thing is, here I'm using the object offset option. The Array I defined basically rotates the mesh around the empty by 180 degrees. The merge option is turned on in all three arrays, and the limit set to 1mm in my case, to make sure the neighboring points are merged together.

Now that you have the alternating geometry in place, you can use simple arrays to get a flat base mesh. A simple deform modifier bends that into a pipe shape, and the rest (solidify, bevel, subsurf) is optional.

You'll notice that a seam is going through at the ends. That's because there unfortunately is no merge option in the simple deform modifier, neither is there a remove doubles modifier. I wish there was so badly! If you have to remove the seam, apply the first three arrays and the deformer, and then remove doubles.
You'll notice shading artefacts as pointed out in the beginning. Using the geometry below, those artifacts become less apparent, as they happen in a more logical place:

This is a wireframe on that final result (Layer 2 in the Blend file):


How to set cursor position in the text editor? I found bpy.ops.text.set_cursor(), which looks like what I want, however it always sets the cursor to the end of the file.

import bpy

class CommentLineOperator(bpy.types.Operator):
    bl_idname = 'text.comment_line'
    bl_label = 'Comment a line'

    def execute(self, context):
        t = bpy.context.space_data.text
        cursor_x = t.current_character
        cursor_y = t.current_line_index

        if t.select_end_line != t.current_line:
            # if there is a selection already, use default behavior:
            bpy.ops.text.comment()
        else:
            bpy.ops.text.select_line()
            bpy.ops.text.comment()

            print(cursor_x, cursor_y)
#            bpy.ops.text.cursor_set(x=cursor_x, y=cursor_y)
            bpy.ops.text.cursor_set(x=0, y=0)

        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Running the above in the text editor and assigning the newly created text.comment_line operator to a shortcut and subsequently using that shortcut in the text editor will comment the line, then move the cursor to the end of the file even when I manually specify position 0,0.

How can I move the cursor in the text editor properly?

Yep, cursor_set appears to use a mix of 'space_data.top' and 'space_data.visible_lines' and is a might confusing.  However you can use

    bpy.ops.text.jump(line=1)
    bpy.ops.text.move(type='LINE_BEGIN')

Will move the cursor to the beginning of line 1

    bpy.ops.text.jump(line=10)
    bpy.ops.text.move(type='NEXT_WORD')

moves to the first word in in line 10, where you would add a comment #


Overlapping faces while extruding corners When I extrude the face that's been highlighted in the first image, it overlaps with some part of the face marked as 2, as shown in the second image. How can I make it so when I extrude face 1, it'll also divides face 2 into 2 pieces so I can merge the overlapping faces. Or should I be following a different practice all together? Thank you for your time.

You should try to avoid overlapping geometry, like faces that occupy the same space creating z-fighting and other problems.

One of the many ways to go about this is to use loop cuts, and use those that define the places where the intersections should take place, and more importantly to create new vertices for such intersections.

Select one of the newly created edges, extrude to the point where the new vertex is (Enable snap to vertex for precise placement). Select the matching edge on the other wall and pres F to create a new face.

At the end of all of this do "remove doubles" to get rid of extra vertices


Blender multiple Image texture one Material I made a few signs in blender. They all have the same Material.
I want to put an images on the front of the signs - but all the images are unique. I want to keep the ability to edit the material of the signs and to use one unique Image for every sign.
So the only ways I know how to achieve this are: Create one big image and map it (i dont want to do it).
Duplicate the Material with different Images (i will lose the ability to edit all materials at once)
What to do?

A good solution to this is to take advantage of Node Groups. You can extract the common portions of your different materials into a group, then share it across all of them. You can then edit the contents of the group to make changes to all the materials that share it at once.
For example, suppose you have a material that looks like this:

If you want to share the Principled BSDF settings across many different materials but use different image textures, you can select the Principled BSDF node and press CtrlG to convert it to a new node group:

By default, all of the node’s inputs are made into group inputs, but in this case we only want the Base Color to be provided by the enclosing material, so we can delete all the other inputs in the node properties panel (accessed by pressing N):

This produces a node group that looks like this:

Pressing Tab to leave Edit Mode for the new group and return to the original material, we can rename the group to something more informative:

Now you can add the node group to other materials using ShiftA ▸ Group ▸ <name of group>:

To edit the group contents, just select it (from within any material) and press Tab to enter Edit Mode again. Any changes you make will affect all the materials that use the group, so there’s no need to duplicate anything between materials.


Cycles rendering stopped Cycles render (animation) stopped without finishing. What could be the reason ? I didn't turn off the computer while its animating.
I'm a real beginner for blender, please be kind enough to guide me]1

You Must have pressed the cancel button in the render tab or Esc accidentally.


how to UV unwrap a material Is it possible to UV unwrap only a material? I have on object with multiple materials and I would like to apply a texture only to one of them.
Thanks for answers

To clarify, you don't unwrap a texture, you unwrap a mesh. UV unwrapping is a way of defining the translation between a spot on a 3D object to a spot on a 2D image.

You can create multiple UV maps for an object and choose a specific UV map to use for a texture image. When you want to use more than one image for an object you don't have to use the same UV map for each image.

When UV unwrapping, the UV layout shown in the UV/Image Editor is the data associated with the UV map highlighted in the UV Map list. The UV map with a little camera next to it is the default layout that will be used if no specific UV map is chosen.

When using Blender Internal you choose the UV map to use in the Mapping panel of the texture settings.

For cycles instead of using a Texture Coordinate node, you add a UV map node and choose the UV map.


Blender 2.8 (and up) crashes on start When I try to open Blender 2.8 my screen goes blank and then turns on again with Blender (Not responding). Other versions like 2.79 don't crash. I tried both 32-bit and 64-bit Blender

My PC specs: Windows 10 Pro (64-bit) ATI Radeon HD 4770, Intel Xeon W3565 16GB RAM,

Blender 2.80 requires AMD graphics card with at least GCN first generation architecture. The Radeon HD 4770 has the old Terascale 1 architecture and is therefore not supported.


My mesh deforms while moving a armature in object mode I'm trying to do bug walking animation that follows a path but mesh deforms too much especially legs . Btw there is no problem if I move all bones in the pose mode


Can I edit XYZ simultaneously in pose mode? With most objects, I can drag my cursor through the XYZ properties, enter a value, and hit return to confirm. This changes all 3 values at once, like so:

For some reason this process doesn't work in pose mode. It even shows all the properties changing in preview, but only one changes after hitting return. Here's the same process in pose mode:

Am I doing this wrong? Is there another way to input values across multiple channels simultaneously?

I'm not sure how to directly fix this problem, but there is a way you can move around this problem and still do it faster.  In Blender you are able to maneuver to the next field by pressing tab.  This does not solve the problem, but it is faster than having to switch over to your mouse and clicking the next field.
Hope that is at least somewhat helpful.


A way to fix the texture UV easly Is there any way to fix the UV without moving the UV vertices ? (This mesh has got a lot of vertices and it would be a lot of time to make them correct)
Maybe a tool like in the image editor softwares (clone tool) for UVs ?

It's available under Texture Paint.

Go to Texture Paint.
Select Clone Brush.

Hit CTRL where you want to take sample from.
Adjust Radius and Strength then paint on the mesh.

When you are done with painting don't forget to go to Slot tab and Save all images.


how to unparent objects without everything moving? So I got this model of a robot and I had to rotate the whole model (which is made up of several non-joined meshes) so I parented every single part to the body and now when I unparent everything goes haywire. Anyone got any ideas on how I can unparent them without everything moving?

This is how it looks parented

And this is what happens when it gets unparented (I used alt+p clear parent)

I got another question. I need to rig this model and keep everything unjoined (because I dont want anything to bend since this is a robot made up of solid parts) any tips on that?

Here is a download link if anyone wants to have a closer look: http://pasteall.org/blend/index.php?id=50768

alt P (Clear Parent) > Clear and Keep Transformation. Otherwise the child will come back to the position it got before the parentage.


Bone to mesh - convert I have seen this post Convert bones to meshes but i need just box (or cylinder), not a piramyd at every bone, can someone help me please?

This is an update of lemon's code on the question Convert bones to meshes. Run the script and it will pop a menu asking if you want Pyramid, Tapered, or Box shapes. Pyramid is what the code did originally, tapered uses the bone envelope, and Box takes the average.
This image is "Box":

# from https://blender.stackexchange.com/a/75049/33589

import bpy
import mathutils
from mathutils import Vector
from math import *

class ArmatureMenu(bpy.types.Menu):
    bl_label = "Mesh 2 Armature Menu"
    bl_idname = "OBJECT_MT_Mesh_From_Armature"

    def draw(self, context):
        layout = self.layout
        layout.operator("wm.mesh_from_armature", text="Pyramid").mesh_type = 'Pyramid' # from here
        layout.operator("wm.mesh_from_armature", text="Tapered").mesh_type = 'Tapered' # from here
        layout.operator("wm.mesh_from_armature", text="Box").mesh_type = 'Box' # from here

def CreateMesh(self, meshType):

    obj = bpy.context.active_object

    if obj == None:
        self.report({"ERROR"}, "No selection" )
    elif obj.type != 'ARMATURE':
        self.report({"ERROR"}, "Armature expected" )
    else:
        processArmature( bpy.context, obj, meshType = meshType )

#Create the base object from the armature
def meshFromArmature( arm ):
    name = arm.name + "_mesh"
    meshData = bpy.data.meshes.new( name + "Data" )
    meshObj = bpy.data.objects.new( name, meshData )
    meshObj.matrix_world = arm.matrix_world.copy()
    return meshObj

#Create the bone geometry (vertices and faces)
def boneGeometry( l1, l2, x, z, baseSize, l1Size, l2Size, base, meshType ):

    if meshType == 'Tapered':
        print(meshType)
        x1 = x * baseSize * l1Size
        z1 = z * baseSize * l1Size

        x2 = x * baseSize * l2Size
        z2 = z * baseSize * l2Size
    elif meshType == 'Box':
        print(meshType)
        lSize = (l1Size + l2Size) / 2
        x1 = x * baseSize * lSize
        z1 = z * baseSize * lSize

        x2 = x * baseSize * lSize
        z2 = z * baseSize * lSize

    else: # default to Pyramid
        print(meshType)
        x1 = x * baseSize * l1Size
        z1 = z * baseSize * l1Size

        x2 = Vector( (0, 0, 0) )
        z2 = Vector( (0, 0, 0) )

    verts = [
        l1 - x1 + z1,
        l1 + x1 + z1,
        l1 - x1 - z1,
        l1 + x1 - z1,
        l2 - x2 + z2,
        l2 + x2 + z2,
        l2 - x2 - z2,
        l2 + x2 - z2
        ]

    faces = [
        (base+3, base+1, base+0, base+2),
        (base+6, base+4, base+5, base+7),
        (base+4, base+0, base+1, base+5),
        (base+7, base+3, base+2, base+6),
        (base+5, base+1, base+3, base+7),
        (base+6, base+2, base+0, base+4)
        ]

    return verts, faces

#Process the armature, goes through its bones and creates the mesh
def processArmature(context, arm, genVertexGroups = True, meshType = 'Pyramid'):
    print("processing armature {0} {1}".format(arm.name, meshType) )

    #Creates the mesh object
    meshObj = meshFromArmature( arm )
    context.collection.objects.link( meshObj )

    verts = []
    edges = []
    faces = []
    vertexGroups = {}

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

    try:
        #Goes through each bone
        for editBone in [b for b in arm.data.edit_bones if b.use_deform]:
            boneName = editBone.name
            # print( boneName )
            poseBone = arm.pose.bones[boneName]

            #Gets edit bone informations
            editBoneHead = editBone.head
            editBoneTail = editBone.tail
            editBoneVector = editBoneTail - editBoneHead
            editBoneSize = editBoneVector.dot( editBoneVector )
            editBoneRoll = editBone.roll
            editBoneX = editBone.x_axis
            editBoneZ = editBone.z_axis
            editBoneHeadRadius = editBone.head_radius
            editBoneTailRadius = editBone.tail_radius

            #Creates the mesh data for the bone
            baseIndex = len(verts)
            baseSize = sqrt( editBoneSize )
            newVerts, newFaces = boneGeometry( editBoneHead, editBoneTail, editBoneX, editBoneZ, baseSize, editBoneHeadRadius, editBoneTailRadius, baseIndex, meshType )

            verts.extend( newVerts )
            faces.extend( newFaces )

            #Creates the weights for the vertex groups
            vertexGroups[boneName] = [(x, 1.0) for x in range(baseIndex, len(verts))]

        #Assigns the geometry to the mesh
        meshObj.data.from_pydata(verts, edges, faces)

    except:
        bpy.ops.object.mode_set(mode='OBJECT')
    else:
        bpy.ops.object.mode_set(mode='OBJECT')

    #Assigns the vertex groups
    if genVertexGroups:
        for name, vertexGroup in vertexGroups.items():
            groupObject = meshObj.vertex_groups.new(name=name)
            for (index, weight) in vertexGroup:
                groupObject.add([index], weight, 'REPLACE')

    #Creates the armature modifier
    modifier = meshObj.modifiers.new('ArmatureMod', 'ARMATURE')
    modifier.object = arm
    modifier.use_bone_envelopes = False
    modifier.use_vertex_groups = True

    meshObj.data.update()

    return meshObj

class MeshFromArmatureOperator(bpy.types.Operator):
    bl_idname = "wm.mesh_from_armature"
    bl_label  = "MeshFromArmatureOperator"

    mesh_type : bpy.props.StringProperty(name="mesh_type")

    def execute(self, context):
        print('The mesh type is', self.mesh_type)
        CreateMesh(self, self.mesh_type)
        return {'FINISHED'}

def register():
    bpy.utils.register_class( ArmatureMenu )
    bpy.utils.register_class( MeshFromArmatureOperator )

def unregister():
    bpy.utils.unregister_class( ArmatureMenu )
    bpy.utils.unregister_class( MeshFromArmatureOperator )

if __name__ == "__main__":
    register()

    # The menu can also be called from scripts
    bpy.ops.wm.call_menu(name='OBJECT_MT_Mesh_From_Armature')


Image Render Works, Animation Render Doesn't I've been working on a donut (BlenderGuru) and it's all been working great. I render a single frame with F12 and it renders fine. Once I go to Render -> Render Animation, it's just one of my textures?
Viewport:

Image Render (Frame 0):

Animation Render (Frame 0):

Yes I know it's Eevee engine, but it shows the same thing in Cycles. I did notice that the animation renders part of my plate texture, but with a pink tint. Any help is appreciated, I'm trying to get this finished by tomorrow (Valentine's Day!)

It was a noob problem. I had my local camera set to my camera, but the actual scene camera was my donut's icing...? I think Blender also bugged out, because when I reopened the scene, the regular F12 still image render had the same result.
Anyways, how to fix it:
Go to Scene Properties > Scene > Camera, then you can use the eye dropper to pick the camera you want to use.


How to change shadow softness of light? The option for softness has changed since blender updated and I don't know where to find it

The bottom one is the old version and has the softness option

It looks like:

Light Size will influence the softness of the light edges and of the objects shadows.

Light Blend will influence the softness of the light edges only.


How do I create this material in cycles (2.79)? This question is a repost: I wanted to know how I could make the material shown on the characters shown here:

Now let me explain:

I am trying to make a fan game with similar aesthetics to the ones in this game, FNAF: Sister Location, where the character screenshots were taken from. For months now, I've been trying to recreate the materials on the characters. What materials, you ask? Basically, all of them that you can see. You may be thinking that I should limit this question to one material, but the thing is, all of them are the same, despite different colors and/or normal maps. Now, you might also want more information on these materials. From my analysis, they're super reflective and metallic in little to no light. However, their specular in the brighter light makes it seem almost like a leathery material. For example, if you view the image with the snouted white-and-pink character gripping a disco ball looking microphone, you can see what I'm talking about. Around the bottom of his lower jaw, it is super reflective, but where the specular is, there is little to no reflection at all.

Keep in mind that I have researched all the videos that are relevant to this, but none provided an accurate node setup. How do I create this in cycles?

I'm not sure the materials have anything particular, it looks like normal plastic, like a Diffuse mixed with a Glossy, with various values, plus perhaps Fresnel and SSS. It seems to me that what you think comes from the material may actually comes from the work with lighting, so maybe you should dig that aspect?


How to get an mp4 video export format Hey all I am stuck I don't know what video format I need to do to export as mp4 in blender animation

Set the output format to FFmpeg video and the container to MPEG-4 in the encoding tab (which appears after selecting the output format).


How to save an .exr file with 32 bit with python I'd like to create a picture in blender and save it as a 32 bit exr.

import bpy

# in case of re-runnign this code,
# get the old 'foo' image out of the way
if 'foo' in bpy.data.images:
    bpy.data.images['foo'].name='bar'

#create an HDR image with name 'foo'
bpy.ops.image.new(name='foo', width=512, height=512, alpha=False, float=True)

#find the image with name 'foo'
image=bpy.data.images['foo']

# set it up for saving an exr HDR image
image.filepath_raw =  '/tmp/foo.exr'
image.file_format = 'OPEN_EXR'
# TODO here: image.save_as_32_bit=True (instead of 16)

#save image to disc
image.save()

The above code makes 16 bit exr according to imagemagick.
I want to use bpy.ops.image.save_as somehow from python, in conjuction with this code, to emulate the behaviour of Image->Save as Image with the option [Float (Full)] rather than [Float (Half)]

The Save as dialogue points to a thing called ImageFormatSettings. Where can I supply this in python?

Thank you

You can change the color depth like this:

image_settings = bpy.context.scene.render.image_settings
image_settings.file_format = "OPEN_EXR"
image_setting.color_depth = '32'

Note that '32' is a string and not an integer/float.
Then save the image like this:

img = bpy.data.images['myImage'] # your image here
img.save_render("C:\\Users\\daddy\\me\\Documents\\myImage.exr") # save to desination


print number and index of selected lines in text editor I try to improve my "comment", uncomment", "copy" and "cut" command in the text editor and i'd like to know if it was possible to print the number and the index of selected lines in the text editor.
I'd like to comment or uncomment all selected lines.
This is the code i'm using to comment:

class CustomComment(bpy.types.Operator):
    ''' Auto comment with a space after # '''
    bl_idname = "text.custom_comment"
    bl_label = "Custom comment"

    def execute(self, context):

        base = context.space_data.text.current_line.body
        bpy.ops.text.select_line()
        if "    " in base:
            bpy.ops.text.move(type='LINE_BEGIN')
            bpy.ops.text.move(type='NEXT_WORD')
            bpy.ops.text.insert(text="# ")
        else:
            bpy.ops.text.move(type='LINE_BEGIN')
            bpy.ops.text.insert(text="# ")
        return {'FINISHED'}

import bpy

txt = bpy.data.texts['Text']
line_begin = txt.current_line_index

#select_end_line_index missing - iterate over txt.lines
for line_end, line_obj in enumerate(txt.lines):
    if line_obj == txt.select_end_line:
        break

selection = [i for i in range(line_begin, line_end + 1)]
print(selection)

There is already a comment function


Help me to fix reflection problem My helmet reflection is distorted when I move a bone head. I don't know how to solve is
https://drive.google.com/file/d/1n41ku7dmLktpH3lJzI8Bnjf__MsHi-nB/view?usp=sharing

Your mesh is high-poly, which will make rigging and animations more complicated imho, but what you could do is join the helmet to the rest of the body (CtrlJ), remove its vertices from all groups and assign them to the vertex group called spine.006 which is controlled by the head bone:


Correct syntax for "mirror" pie operator in UV Editor as one operator What is the correct way to in the UV editor perform an X or Y mirror as one command for a pie operator?

pie.operator("transform.mirror()", text="Mirror").constraint_axis='True, False, False'

Based on what I saw in the console:

bpy.ops.transform.mirror(constraint_axis=(True, False, False), constraint_orientation='GLOBAL', proportional='DISABLED', proportional_edit_falloff='SPHERE', proportional_size=0.0323492)

I struggle to understand the logic because I was able to successfully do this with a different snapping command

bpy.ops.uv.snap_cursor(target='SELECTED')

has to be written as

pie.operator("uv.snap_cursor", text="Snap Cursor to Selected").target='SELECTED'

Alternatively I could just define an operator and call the name via a pie button but I feel this makes the script longer than needed

The description of the operator can be found here.

bpy.types.UILayout.operator returns an bpy.types.OperatorProperties object.

So if you need to assign multiple presets, assign it to a local variable first

op_props = pie.operator("transform.mirror", text="Mirror")
op_props.constraint_axis = True, False, True
#...

When the operator's invoke method is called the operator may use user input to set its properties or run modal, before finally running its execute method.

To skip the invocation you might try:

#...
pie.operator_context = "EXEC_DEFAULT"
pie.operator("transform.mirror").constraint_axis = True, False, True

pie.operator_context = "INVOKE_DEFAULT"
#...

See UILayout.operator_context for the available options


Is it possible to get total render time via Python code? Is it possible to get total render time via Python code when render’s done?

Render Handlers

Borrowing heavilly from
Is it possible to get render time per tile?

Test code prints the total time elapsed from render init handler being fired, to render complete (or cancel)

from datetime import datetime
from bpy.app import handlers

FRAME_START_TIME = None
RENDER_START_TIME = None

def handler_function(name):
    def handler(scene):
        print(name)
    return handler

frame_handlers = [getattr(handlers, name)
        for name in dir(handlers) if name.startswith("render_")]

def add_dummy_handlers():
    for  handler in frame_handlers:
        handler.append(handler_function(name))

def clear_handlers():
    for  handler in frame_handlers:
        handler.clear()

def render_init(scene):
    global RENDER_START_TIME
    RENDER_START_TIME = datetime.now()
    print("Render Start")

def render_pre(scene):
    global FRAME_START_TIME
    FRAME_START_TIME = datetime.now()

def render_stats(dummy):
    print("Elapsed:", datetime.now() - FRAME_START_TIME)

def complete(scene):
    print("Total:",  datetime.now() - RENDER_START_TIME)

def cancel(scene):
    print("CANCELLED.... After:",  datetime.now() - FRAME_START_TIME)

clear_handlers()

handlers.render_init.append(render_init)
#handlers.render_pre.append(render_pre)
#handlers.render_stats.append(render_stats) # write or post ?
handlers.render_complete.append(complete)
handlers.render_cancel.append(cancel)

Output of a 4 frame render animation.

Render Start
Saved: '/tmp/0000.png'
 Time: 00:01.06 (Saving: 00:00.48)

Saved: '/tmp/0001.png'
 Time: 00:00.92 (Saving: 00:00.26)

Saved: '/tmp/0002.png'
 Time: 00:00.87 (Saving: 00:00.25)

Saved: '/tmp/0003.png'
 Time: 00:00.97 (Saving: 00:00.32)

Total: 0:00:03.846082

Added code from https://blender.stackexchange.com/a/62870/15543 to clear the handers clear_handers(), and also to add a set of dummy handlers that simply print their name when called. add_dummy_handlers()


how to make camera moves slower when moving along a curve I've been looking for a solution for several hours but got no luck..

Is there a way to make the camera's footstep smaller when moving "follow path"? (camera moves along a curve)

Put it another way, how can I decrease the distance on the curve that the camera moves between two frames? (in python script)

By default it moves way too fast...

With the curve selected;
Select the Object Data tab in the Properties window,
In the Path Animation panel change the Frames value, higher values result in a slower follow speed.

Edit:
This value can be modified in python using the following line;

bpy.data.curves["NurbsPath"].path_duration = X

where NurbsPath is the name of your curve, and X is the value you would like to set.