text:
How to scale an object via a slider in Python?
First: I'm new to Python programming in Blender.
I already know how add a row to scale one single axis of an object by using a slider in the tools panel e.g. I'm using this code snippet to do this:
import bpy # Python API for Blender
from bpy.types import Panel, Operator

# Class for the panel, derived by Panel
class SimpleToolPanel(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_label = 'CW Tools'
    bl_context = 'objectmode'
    bl_category = 'CW Tools' # Where the Panel have to appear. In this case in the Tools cetegory.

    # Add UI elements here
    def draw(self, context):
        layout = self.layout

        # New row
        row = layout.row()

        # get the selected object
        obj = context.object

        #Let's display the scale of the object
        str_scale = 'Object: ' + obj.name + ' scale: ' + str(obj.scale)

        row.label(text=str_scale)

        #Add scale slider property
        row = layout.row()
        row.prop(obj, 'scale', index=0, text='Scale x:')

        row = layout.row()
        row.prop(obj, 'scale', index=1, text='Scale y:')

        row = layout.row()
        row.prop(obj, 'scale', index=2, text='Scale z:')

# Register
def register():
    bpy.utils.register_class(SimpleToolPanel)

# Unregister
def unregister():
    bpy.utils.unregister_class(SimpleToolPanel)

# Run in text editor
if __name__ == "__main__":
    register()

My question:
How is the code to resize a complete active object via one single slider, please?

What happens if you don't mention the index? Will it scale the whole object then?

Sorry. The row scales the x-axis only. I would like to scale all three axis together e.g.

I've replaced the whole code to show you my current version. At the moment I'm able to scale every single axis of an active object. But I would like to scale the whole object by using one single slider only.

@CraigDJones To answer your question: No. I see all three axes at once side by side then.

Make the current scale "unity" for the scale_factor.
This is a bit of an old chestnut, if a simple scale factor is added such that
ob.scale *= scale_factor

which is how the scale operator works somewhat, everything turns to zero once the scale hits zero... And it also acts geometrically making it very unmanageable very quickly.
As a workaround I've added a boolean to copy the current scale to a vector property and set the scale factor to 1. To reset click the boolean back on and off. (prob should be an operator instead but you get the idea.)

import bpy
from mathutils import Vector
from bpy.types import Panel, Operator
from bpy.props import (FloatProperty,
        FloatVectorProperty,
        BoolProperty)

class SimpleToolPanel(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_label = 'CW Tools'
    bl_context = 'objectmode'
    bl_category = 'Tools'

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        obj = context.object
        row.prop(obj, "scale_set", toggle=True)
        if obj.scale_set:
            row = layout.row()
            row.prop(obj, 'scale_factor')

def scale_set(self, context):
    if self.scale_set:
        self.scale_vector = self.scale.copy()
        self["scale_factor"] = 1

def scale_obj(self, context):
    self.scale = self.scale_factor * Vector(self.scale_vector)

def register():
    bpy.types.Object.scale_vector = FloatVectorProperty()
    bpy.types.Object.scale_set = BoolProperty(
            default=False,
            update=scale_set)

    bpy.types.Object.scale_factor = FloatProperty(
            name="Scale Factor",
            default=1,
            update=scale_obj
            )
    bpy.utils.register_class(SimpleToolPanel)

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

if __name__ == "__main__":
    register()

This is a nice solution too. Thank you for your efforts. See my answer above to know what I miss in your code.

IMO the accepted answer is not the way to go.... unless the question is how to make the y and z scale the value of x scale.  It scales an object to scale.x * (1, 1, 1,) taking into no account if the object already has non-uniform scale. Eg  If the object already has scale.x = 0, then the object becomes scaled to zero. (0, 0, 0) .  If an object has scale (3, 0, 0) it gets scaled to (3, 3, 3)   If the initial scale is (1, 1, 1) my answer will do same. But if the initial scale is (1, 2, 3) and I scale it by 2 I get (2, 4, 6) which makes sense to me, (2, 2, 2) not so sure. Anyway your question..

You are completely right. Your solution answers my basic question and scales an object the right way. But both solutions here are a good foundation for myself to work with and learn more. Thank you.

Here's the script to do this (open to corrections):
[Edit: Added getVal to reflect current X scale]
import bpy # Python API for Blender
from bpy.types import Panel, Operator

# Class for the panel, derived by Panel
class SimpleToolPanel(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_label = 'CW Tools'
    bl_context = 'objectmode'
    bl_category = 'CW Tools' # Where the Panel have to appear. In this case in the Tools cetegory.

    def setVal(self, val):
        self.objects.active.scale[0] = val
        self.objects.active.scale[1] = val
        self.objects.active.scale[2] = val

    #Edit: Pick the value from the X scale, assuming all scale values are the same
    def getVal(self):
        return self.objects.active.scale[0]

    bpy.types.Scene.scaleVal = bpy.props.FloatProperty(set = setVal, get = getVal)

    # Add UI elements here
    def draw(self, context):
        layout = self.layout

        # New row
        row = layout.row()

        # get the selected object
        obj = context.object

        #Let's display the scale of the object
        str_scale = 'Object: ' + obj.name + ' scale: ' + str(obj.scale)

        row.label(text=str_scale)

        #Add scale slider property

        row = layout.row()
        row.prop(bpy.context.scene, 'scaleVal', text='Scale:')

# Register
def register():
    bpy.utils.register_class(SimpleToolPanel)

# Unregister
def unregister():
    bpy.utils.unregister_class(SimpleToolPanel)

# Run in text editor
if __name__ == "__main__":
    register()

Thank you! It's nearly what I was looking for. Now I have to check out how to set the current object scale value before adjusting it with the slider. In your version the slider is always zero and does not read the active object scale before adjusting it.

You are welcome. It's trivial to read the active objects scale. You need to just have another function getVal(self) and set it to get parameter of FloatProperty constructor. But there are going to be three different values. How would you like to combine them? In the edit I am setting it to the first scale value. Assuming all three would be the same.

Exactly. I need just one same value for all parameters (x,y,z). Thank you!


text:
Is it possible to see glare streaks in transparent areas too?
Attached you see my problem. Is it possible to see the glare FX in the transparent areas "outside" the rendered content too?
Thank you in advance.

Related: https://blender.stackexchange.com/questions/57816/how-do-i-get-the-glare-node-to-output-transparent-instead-of-black-background

This solution worked perfect for me:
https://blender.stackexchange.com/a/77940/15678

This is a solution that worked perfect for me. Seperating and mixing one glare color channel with glare alpha output works great and supports nearly all situations, even for other FX nodes.
Here the node tree:

And the file:

source: Stack Exchange

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

sort: votes


text:
How can I rotate multiple objects in their LOCAL axis?
Hello blender friends.
I would like to rotate multiple objects by random, but in their LOCAL axis. NOT global.
I already know the random transform function for objects, but it's working always for the global axis only.
Bit I would like to rotate random around the local z axis e.g.
In Softimage XSI in 2005 it was possible to type in mathematical functions into the input fields. There were a function like this r(1,10). It has generated a random value between 1 and 10.
Is this possible without using python?

Try with proportional editing

There's a simple method for that in Blender.Here The couple of Cubes represent your Multiple Objects.

Select one of the  object in your scene. (The nearby objects to the selection will have more influence of Random Rotation).

Change the Pivot Point to Individual.(So cubes will be rotated on their Local Axis)

Press 'O' in keyboard (To turn on Proportional Editing) & set it to Random.

More Info while pressing R for rotate a circle will appear that represents the effective Radius for the Random Rotation that can be changed by (Mouse Wheel) or (Page Up or Page Down)

To rotate around multiple local origins, change the pivot point to "individual origins." The pivot point menu is shown in the picture below. I know this doesn't solve the problem of how to rotate at random, but I hope this helps at least a little.
Go to edit mode,

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


text:
How to set individual shadow catcher objects per render layer
I am using blender version 2.79.
Is there a way to set an object to be a shadow catcher in cycles settings per render layer?
Example for a scene setup:
Render layer 1:

qube = red material
sphere = blue material

Render layer 2:

qube = shadow catcher
sphere = blue material

Render layer 3:

qube = red material
sphere = shadow catcher

Are the examples possible? If you have a material setup for a shadow catcher or a way to do it in postpro this would help too.
I know there will be a new render layer organisation in upcoming v2.8 but I need a workaround now...
Thank you for all tips.
Best wishes from germany
Chris

This is my workaround about it:
I Used 3 frames and set the Shadow Catcher for every object in its frame.
Let the mouse pointer over the Shadow Catcher checkbox and press  I , this will make a keyframe to that single frame.
Move to the next frame, check the Shadow Catcher and with mouse pointer over the Shadow Catcher checkbox and press  I  again.
To the next frame, unckeck the Shadow Catcher and with mouse pointer over the Shadow Catcher checkbox and press  I  again.
Repest it to the other object. But using: frame 1 - unckeked, frame 2 - unchecked and frame 3 - checked.
Render the 3 frames an Animation.
See the image below:

Hi LeoNas. Thank you for the answer. This is a possible solution.

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


text:
How to add limited bone movement dependent on movement of other bones
So I imported a character mesh with a rig that has a lot of body parts tied to bones. I want to set the rig up so that if bones are moved certain bones will move in certain ways, for example if the arm is lifted the chest muscles are stretched and the shoulder rotates.

I think the best way to do that would be to use drivers on the bones that are supposed to follow, but I want to limit how the bone follows, i.e. when the arm lifts up I only want the shoulder to rotate a little and when the arm is lowered I don't want the shoulder to rotate at all. I tried using limit rotation and location restraints but that means the shoulder won't rotate evenly with the arm movement but will move quickly and then stop before the arm movement is finished. Would be cool if I could somehow script the driver to tell it what to do and when but I have no experience with scripting, any advice would be greatly appreciated!

You can use ActionConstraints and also AnimationNodes_scripts to create your desired effect

@MohammadHosseinJamshidi Oh okay, is there somewhere you can get template scripts, or maybe you know a good tutorial that explains how to use them?

I'm pretty sure that action constraint can do the job for you but for doing it by animation nodes, take a look at documentaion and this short video. Addressing to bones in blender is by names and so is not robust for the case of name changes.


text:
Problem with GPU- rendering particles. CUDA error in Cycles
I get this CUDA error: Out of memory in cuMemAlloc(&device_pointer,size) when I try to render the image with particles (hair) with my GPU. It doesn't render at all (even with experimental chosen). Without the hair it works but that's not what I need. The image I am trying to render is quite big. It does render with CPU but it is very slow.
I really need some help as I am a real newbie to blender. I' ve tried all the solutions I can think of and get my hands on.
I've tried Enabling GPU rendering for Cycles? but it doesn't help.
Is there any way to solve this problem and render it using GPU?
I would greatly appreciate some advice. THANK YOU!
SOME DETAILS:
I have a PC, System: 64 bit Windows 7, RAM 16 GB,
Graphics Card: GeForce GTX 750 (new),
GeForce 352.78 Driver, Cuda 7.5
Blender 2.75a

The error message says it all. You ran out of memory - your scene is too complex to fit on the memory of the GPU. Try reducing the particle count, geometry, texture size etc.

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


text:
Missing "encoding" panel/tab
I have recently installed the latest stable version of blender (2.75a) and used
the video editor to join audio with a video. The problem is, when I click Anim to render the video, it generates a video file but with no audio at all. As I have seen in many tutorials, all I need to do is to set the renderer's audio settings properly in scene's "encoding" tab... it should be found under the "output" tab, but it just does not exist! What I see is exactly this:
OpenSUSE - Blender cannot encode or export video
I have searched in many sites over the web and tried many "possible" solutions with no luck at all. I have checked the FPS settings, reinstalled and even installed previous versions of blender (2.6) and still nothing.
I just want to get what I have made in my blender's project written in a video file, just that...
Thank you for your help

What file format are you exporting to?

AVI Raw format.

Do you have an audio device selected in "user preferences" > "system" tab?

Are the Encoding options visible in the H.264 output file format?

You only get an encoding panel for the outputs H.264, MPEG, Ogg Theora and Xvid

AVI Raw is only a container for raw frames, does not support audio.

I don't think that AVI Raw has encoding options.
As it's an uncompressed format you'll not have much setting to work with, they are just plain frames.
The purpose of this format is to provide an input video that will be mixed and encoded with sync audio in a second phase, after for example some compositing, or color correction. It's the RAW data, it is expected to be used as a "base", not to be the final result.
You can Mixdown to extract audio from your file and than mix them with video in Blender or an external application.
Note: I wasn't able to find out any evidence of the fact that Blender AVI Raw format, despite its name, is not able to contain audio (and I'm not even sure), so consider this as a personal opinion.
You should use another output format.

Thank you all very much for your help, It was the AVI Raw format that does not support audio, as you have stated. I've switched the format to another and now I can see the encoding tab, I can't believe that was the problem.

I thought I had lost Encoding Panel Tab, and was searching long time in internet, but, at the end, i dont know how, I had move it to the bottom of all the Tabs. I was accostumed to see it below Output Tab, so I was happy when I found the Panel at the bottom of all.


text:
How to create a simple button for a script?
I'm struggling trying to create a simple button for this script:
for Nlys in (3,8,11,13,16,5):
    bpy.context.object.data.layers[Nlys] = True

for Nlys in (0,1,2,4,7,10,14,17,9,12,15,18,6,20,5,19,28):
    bpy.context.object.data.layers[Nlys] = False

In Maya I was used to drag an drop the code into a shelf and the button was created automatically.
Is there a way to to this in Blender?

Update: This helped me to figure out a solution for this result.

Thanks @Ray Mairlot for pointing me in the right direction!


text:
How to remove background HDR of rendered image using compositing?
How to remove background HDR of rendered image using compositing? I tried the below, and it doesn't seem to work.

The best way does not use compositing, but avoiding having a background image in the first place.
You would just go to Properties panel > Render tab > Film  and check Transparent.

By doing that your background will not be part of the render image and will be transparent through an Alpha channel:

Transparent enabled on the right

That being said, there is a way to do it using the following Compositing Nodes setup.

The Color Key takes out the black from the Environment pass. The Invert changes the matte map to preferable colors. The Alpha Over node actually adds the transparency.
The following .blend file is the one shown in the above Compositing Nodes screenshot.


text:
How to create 'inner-tube being towed by boat" physics effect
I have a rough terrain (plane, displacement mod) that serves as a LAKE. I have an INNER-TUBE (a torus) that I want to tow around on top of the LAKE.
My initial method (that doesn't work, or is incomplete):

Rig: Create a curve. Parent an empty ("BOAT") to the curve in a 'Follow path' relationship. Add a couple of Limit Distance constraints to the INNER-TUBE to create a range of distances the INNER-TIRE can move around the BOAT.
Physics: Create a Rigid Body World. Set LAKE as passive, INNER-TUBE as active. Add some dampening and friction to the LAKE and INNER-TUBE .
Animation: Set frames and negative-start evaluation time for BOAT path (negative start time allows INNER-TUBE to settle on the LAKE before movement). Mark start/finish keyframes for BOAT.

The result is: Not Much. Once BOAT starts moving INNER-TIRE moves with it... but INNER-TUBE is completely unreactive with the TERRAIN, and doesn't swing wide after BOAT turns corners. INNER-TUBE may as well be directly parented to BOAT : INNER-TUBE just stays in the same angle to TRUCK as at the initial orientation.
In short: physics ain't happening.
The scene's enormous so I won't provide a blend file. But if someone could provide a simple .blend that illustrates how to do this boat-tows-inner-tube effect at its simplest level, I'd be grateful :)

I've never heard it called an "inner-tire" but "inner tube."

OK... I'll edit :)

I'm not an expert on rigid body physics in blender, so I can provide a full example, but it sounds like you have used an object constraint to attach the tube to the boat. If you want physics you should use a rigid body constraint instead. See: https://www.blender.org/manual/physics/rigid_body/constraints/types/index.html

Thanks Sazerac. I was trying rigid body constraints but it turns out I was doing it wrong. After half a day watching YouTube tutorials I saw the error of my ways :)


text:
Is there a way to export each rendered layer as its own image?
My scene uses multiple render layers.
I'd like to edit each rendered layer in Photoshop, and composite it in Photoshop.
Is there a way to export each layer as an individual image?

Just a quick question, I gather this is for a still image and not an animation?

Correct :) My problem is I'm using an outdated version of PShop. The current version supports OpenEXR... But even if I did have the current version of PShop I'm not after render PASS separation, I'm after render LAYER separation :)

I hard that @TLousky made a script that works both with render layers and passes. It automatically assing a different output file name based. You can find it here: https://github.com/Tlousky/production_scripts/wiki/save_all_renderlayers_And_passes.py

Duplicate of http://blender.stackexchange.com/q/33048/935

Yes, you can use File Output nodes. Just specify a file path for each.

facepalm I'm gonna have to replace "There's an app for that" with "There's a node for that". I was looking all over the UI for 'Export Render Layers' :P Thanks guys.

Don't sweat it - I remember I felt the same way when I first learned about it.


text:
Baked normal map comes out transparent
Blender 2.79
I'm trying to follow a Cycles workflow in baking out normals from a high poly mesh to low. Instead of a purple image with rainbow detail I'm getting nuthin.

I've checked both meshes' normals. They're all facing the right way.
A 2048 image was created for the normal bake and selected in the materials editor. It's not hooked up, but that shouldn't matter - so long as it's selected and targeted.
No modifiers are on either mesh. No subsurfs, nuthin.
Ray distance only seems to work on 0. Anything higher and the result is as the image shows.

What are your best guesses? I've had this happen before, and I found starting over again worked. I don't want to have to keep re-starting models.

Could you include a testing file with the problem shown on blend-exchange? I see this problem gets asked last time but I couldn't reproduce it

It's most definitely the ray distance. Try setting it to 1. Otherwise it's hard to tell without the file.

I don't get how it even works for you as it just shuts down for me when baking, but you disabled rendering surfaces for the render layer which objects are on. Though I've no idea how is this related with transparent normal maps working on nearly 0 ray distance only - this isn't that clear

EDIT 2: FIX
Ok After some crazy amount of testing I found the culprit :D

In the render layer section, you have to check in EVERY render layer "use Surfaces".
If unchecked, you will get this strange transparent section in GPU Mode.
And in CPU mode it will even cause a crash to desktop.
In my opinion this crash is even worth a bug report.

Tried that - no joy. Just get different shaped transparent hole. Cage doesn't work - I get a error, that the two objects must have the same number of faces... which is kinda silly.

Amending last comment: Tried cage (properly this time, I think): still no joy.

then, have you checked if all your normals are pointing in the same direction?

I've checked both meshes' normals. They're all facing the right way. (That is, all normals are radiating outwards from faces.)

Do you mind sharing your mesh? Then I can try to find the issue

Did you first select the high poly and then the low poly mesh?

Done, and Yes, respectively.

updated my post

Thanks Monasend :) Marked up your answer, but haven't called it correct because... Well, no offense, but you're effectively starting with a fresh file, which isn't a solve. If this keeps happening then there's some kind of bug, undetected corruption or weirdness I'm not aware of that will keep happening.

Ok I found the issue !

omg.... OMG! I'll try and duplicate this when I get back home. Marked your response right anyway cos I appreciate the effort :) It's kinda replacing one mystery with another: how did that box get unchecked? Is there a kbd shortcut I accidentally used, cos I don't recall deliberately unchecking that box!

(Monatsend found a key part of the issue. I'm just adding this simple scene file you can test things with, and a link to a video that explains the bug... Because there's more to it.)
Baking Normals in Cycles successfully requires users to check several things in different areas. Basically, baking normals is a hack, rather than a workflow, so you have to stay on your toes.
Monatsend's right: 'Use Surfaces' needs to be checked, or normals can't be baked. However, if you accidentally create a 'transparent normal' image, you can't go back from that. Something breaks. You'll need to restart Blender.
Link to an explanatory video: https://vimeo.com/261681317
Normal Cube.blend:


text:
How to reduce bloated file size?
I created this large scene file: lots of objects, textures, nodes, you name it, and am currently doing a post-mortem: stripping out assets so I can re-use them in later scenes.
However I'm getting some massive discrepancies in what's left in the scene and the file size housing it. I have a skybox asset that's barely 400kB in a blend file 107MB large!
I've been through all layers and stripped out objects. I've gone through the F-Curve and dopesheet to remove animations. I've gone through the materials and texture sections and pruned out unused materials, disabled fake users, axed modifiers and constraints, removed compositor nodes and deleted particle systems but still the file size takes a while to load and reads 107MB.
What's left to take out? Anyone think of any potentially overlooked 106MB item?
Blend file: https://dl.dropboxusercontent.com/u/13900881/Auriantation.blend

Did you look through the "Blender File" in the outliner? Use the dropdown menu there to see it. You should see EVERYTHING in the .blend...

Possible duplicate of Blender 2.78 file size grows and does never shrink

@Pycoder: Yes. Nothing but the object and its necessary attributes.

Did you try "Save and Reload" a few times?

@Pycoder: Yep. Still 107MB.

Is it possible you could post the file for us to inspect?

@gandalf3: Link added to post :)

And to clarify: This file does have nodes and objects I want to keep. I just can't seem to justify to myself that a skybox, camera, a lamp and a few nodes costs 107MB.

WAIT - Found it :) The sneaky error of truncated file names... It's the skybox UV image. The file I was trimming back used an early version of the skybox which used an uncompressed PNG. I'd swapped in a JPG file in later versions which was just as good but way cheaper on memory. I didn't pick that up because the Blender UI truncates longer file names on smaller screens :( Crap. Sorry for wasting your time guys.


text:
help texturing and adding materials to a violin
I would like to find a way to make the rune glow and make the violin look somewhat realistic. I have tried using some textures from textures.com, but I could use some tips.

there is another picture when you click on ]2

you need to unwrap it and put a wood texture on it, with a bit of glossiness


text:
Is it a problem to use triangles in a vehicle mesh for a game?
Does a vehicle like a plane have problems if I use triangles for its mesh? The plane will be animated for a game.

Possible duplicate of How can Tris be used to an Advantage?

11 questions on the topic, from slightly differents perspectives

Actually, it might be better to do that.

For models that do not undergo deformation (stretching/squishing/bending), it doesn't matter if your model consists only of quads or not. Some nice things about having topology consisting of similarly sized, nearly regular quadrilaterals is that calculations involving adjacent faces are well-behaved, so you won't expect to get weird artifacts during a render, among other things. But this holds for quads and tris.  In general, it is always best to have a model with similarly sized, regular(ish) faces. It is only when you have a model that will deform that you would like to use quads because that allows you to create rings and loops, which enables smooth deformations.


text:
Why does 'diffuse_color' expect four values and not three with Python in 2.8?
I am attempting to create a plane and set the color; the following code throws an error at this line:
bpy.data.materials['RSgreen'].diffuse_color=(0,0,0)

the error is:  ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3
which makes no sense to me; diffuse_color calls for 3 parameters in the documentation.
bpy.ops.mesh.primitive_plane_add(size=4,enter_editmode=False,location=(-2,-2,0.01))
bpy.context.active_object.name='Plane2'
bpy.ops.material.new()
bpy.data.materials[1].name='RSgreen'
bpy.data.materials['RSgreen'].diffuse_color=(0,0,0)
bpy.context.object.data.materials.append(bpy.data.materials['RSgreen'])

You saw the wrong version of document, 2.80 change a lot. Ones should always use new document page for 2.80 version:
Material(ID) - Blender 2.80 API (latest)

diffuse_color
Diffuse color of the material
Type:
float array of 4 items in [0, inf], default (0.8, 0.8, 0.8, 0.8)
last update: 2020-08-04 Blender 2.91 Alpha

The four values are represented as: [Red, Green, Blue, Alpha] by default rendering pipeline. These values may stay from 0.0 to 1.0 if the color is interpreted as diffuse. Other wise, it doesn't need to less than 1. eg. a light color node might contain a value more than 1 unit.

What do the parameters mean?  R,G,B,? ??

@vndep RGB and Alpha

I am trying to get a green color (RGB=0,113,57; hex=#007139). When I pass the array (0,113,57,1) to .diffuse_color I get a light blue color instead. Same result when I convert the 0-255 values to percentiles. Any suggestions as to how to get that green?   Maybe diffusion_color isn't the right property?

@vndep The description say it is an float number, and you should always consider the color value is in 0 to 1 rather 0 to 255. Divide your color value by 255 to fix it

Thanks! That solves it.


text:
Why can't I access the 'name' of an object when looping through the scene's objects?
I am trying to delete all the objects that start with 'LTR' but am getting the following error:  'tuple' object has no attribute 'name'
Any suggestions are much appreciated!
for obj in enumerate(bpy.context.scene.objects):
    namestr=obj.name #this throws the error
    if len(namestr)>=3:
        name2=namestr[3:]
        if name2=='LTR':
            delete_object(namestr) #this is a function that deletes the object

enumerate(iterable, start=0) returns a tuple for each element from any given iterable and its position based on the actual iteration. Proof using the Console:
>>> for i in enumerate(["Hello","World"]):
>>>     print (i)
(0, "Hello")
(1, "World")

A tuple is a composite data type, composed out of two elements (item1, item2). If you want to access its individual components (left, right) you can either use the index operator [] or create 2 variables for the actual return value (tuple) on the fly: left, right = ("Hello", "World"):
>>> my_tuple = ("Hello", "World")
>>> my_tuple[0]
"Hello"

left, right = ("Hello", "World")
>>> left
"Hello"

Means in your case that you can't access the object and its name this way because the returned tuple by the enumerate() function in your loop has no name property. Proof using the Console again:
>>> for ob in enumerate(C.scene.objects):
...     print (ob)
(0, bpy.data.objects['Cube'])
(1, bpy.data.objects['Light'])
(2, bpy.data.objects['Camera'])

In summary: you have to find a way splitting the components of the tuple if you want to access each element separately which basically leads into the following pattern:
>>> for left, right in enumerate(C.scene.objects):
...     print (left, right, "Name:", right.name)
0 <bpy_struct, Object("Cube")>, Name: Cube
1 <bpy_struct, Object("Light")> Name: Light
2 <bpy_struct, Object("Camera")> Name: Camera

Also notice that python has a lot of awesome tools dealing with strings. In order to determine whether a string is part of a another string (substring), you could use the in operator to test its "membership":
>>> "ell" in "HelloWorld"
True

To remove the objects, you might want to create some kind of black list before removing it. The following example removes all objects in the scene that have "Cam" in their name (substring):
import bpy

objects_to_remove = []

for ob in bpy.context.scene.objects:
    if "Cam" in ob.name:
        objects_to_remove.append(ob)

bpy.ops.object.delete({"selected_objects": objects_to_remove})

There is also str.startswith(prefix) returning True if the string begins with the prefix passed:
>>> "Hello World".startswith("Hell")
True

The following example removes all found objects whose names begin with "Cam":
import bpy

objects_to_remove = []

for ob in bpy.context.scene.objects:
    if ob.name.startswith("Cam"):
        objects_to_remove.append(ob)

bpy.ops.object.delete({"selected_objects": objects_to_remove})

When you use enumerate, an item in the list and an index/counter of where you are in the loop is returned to the variable (obj) instead of just the item. This is why you get the error, because in this case obj is a tuple ((index, listItem)) which does not have a name property itself.
The common loop syntax when using enumerate is:
for index, obj in enumerate(bpy.context.scene.objects):

obj will now contain the actual object as expected.
However, if you don't need an index of where you are in the loop you do not need to use enumerate. Remove it and it will work fine, e.g.:
for obj in bpy.context.scene.objects:

You could also access the second item in the tuple when trying to access the name:
namestr=obj[1].name


text:
Connecting two separate objects physically without moving them

I want to connect the cylinder to the half-sphere without changing their positions (they are separate objects with space between them).  In reality the half-sphere and cylinder have a lot more faces than this simplified version.  What is the most elegant way to do this?  The connecting surfaces can be anywhere, as long as they are inside the hemi-sphere.  In the end I want to 3D-print the model so that the cylinder is floating in the hemi-sphere exactly as it is positioned now.
One idea I came up with is to have a vertical plane be the connector, but the plane must not go through the cylinder, only touch it, and the plane must not go outside of the hemisphere, only touch it.  But I don't know how to do that.
Here is my idea with the plane.  If someone can tell me how to remove the section of the plane that is inside the cylinder and outside the hemisphere, then I am done:

Update:  Adding the difference Boolean modifier to the plane with the cylinder succeeds in removing the plane portion inside the cylinder, but I'm also not sure if the plane is actually touching the cylinder or not during the 3D-print (if it is not, then the cylinder will fall).  Then adding the intersection Boolean modifier to the plane with the hemisphere apparently succeeds in removing the plane section outside the hemisphere (again, I don't know if the plane is actually touching it or not).
However, when I export as obj and import in ZBrush, there is no proper hole of the plane inside the cylinder, so it actually didn't work:

This new blend file is attached (second one):

Update:  This method described totally does not work with my actual (more complex) models.  The Boolean function is really buggy.  Any other way? Here is my only working solution so far, which is really, ugly (protruding faces from the cylinder, and then using the Grab tool to make sure that the protruding faces just touch the hemisphere without going past it).  I'm not even sure if the cylinder will fall or not after the 3d print:

Please add images to illustrate your question - you’re much more likely to get a useful answer - rather than relying on someone downloading and opening your .blend file.

It's just a cylinder floating in the middle of a hemisphere.

So what you mean is how to connect the cylinder so that it can be printed? (with some kind of armature maintaining it for printing purpose)

@ Lemon    Yes but the "supports" must be permanent, not just temporary supports,   I mentioned using a vertical plane above.

But the cylinder could be connected via many ways (from bottom, top, front...)... could you draw what you want?

@ Lemon.  It doesn't matter, as long it is maintained there permanently.  The beauty doesn't matter either.

What about stability (will it fall down or not, in the position it is in your file)?

The cylinder must never move.

I’m no 3D printing expert but I thought the supportingg structures needed to fit strict requirements - otherwise you print will collapse. I think most 3d print software can generate the required additional structures for you (but I might be wrong - as I said, I’m no expert).

Yes, but those supports are flimsy, and they cannot be horizontal for example.

It's mainly a question of booleans, if I understand your request well.

you have your three geometries, sphere, cylinder and plane. Remove the desired faces on sphere and cylinder
image 1: boolean modifier applied on the plane, difference mode, select the cylinder in the Object drop-down menu, and click Apply
image 2 : once boolean intersected is applied, now show the sphere
image 3: then a new boolean modifier applied on the same plane, this time intersect mode, and select the sphere as Object you want to intersect to, apply the modifier

In short, the solidity of the 3d print depends of various factors, the thickness of the model, the surface of the different contact zones, if the object is full or hollow...
P.S.: I feel a Death Star inspiration here, lol

P.S.: I feel a Death Star inspiration here, lol Same!


text:
Objects mesh set to smooth but some edges show sharp after using Bevel tool
Please help me solve that. See images below.

As you see after I use Bevel tool, red circled edges are sharp. EdgeSplit modifier angle is 45 degrees, mesh set to smooth, no duplicate vertices.
Please help! Tried many ways but no luck. :-(
This is what I am trying to model.

You can use the Bevel Modifier with a Limit Method set to Angle, instead of Bevel tool + EdgeSplit modifier. EdgeSplit modifier only change wich Edge appear smoothed whereas Bevel Modifier allow to adjust wich Edge is beveled.

Did not work for me as I need only selected edges to be beveled. Bevel Modifier add bevels to all edges.

@Andrzej Can you share your file or a beveled mesh view ? The mesh has N-gons ? Also I don't get the point of beveling all selected edges, specially  horizontal ones.

Sure here is a link. Selected edges come from the part of the aircraft cockpit that I am trying to model. Here is the link to GD     https://drive.google.com/open?id=16mMZVnEI0tBUXqIKbQ_Z46HK6hNYfXKP

Added image in original post to show what I am trying to model

Both Bevel methods did not lead to great results, so you may use Subdvision modeling method:

Correct the topology to keep only quads. Disolve Edges (x > Dissolve Edges), add new ones with the Knife Tool K.

Add holding edges using CTRL+R

Add a Subsurface Modifier

Topology Guides has great step by step guide to solve similar topology.
Final result is smooth:
Final Blend file

Thank you, that looks pretty good except of one area, top left edge


text:
Vector Object to location array
I want to do this:
myLocation = (-0.9056, -0.0628, -3.000)
SplinePoint.co = myLocation

Where myLocation is a blender Vector.
i.e. I want to assign a vector to a spline point's co attribute ...
in other words I want to convert a vector object into an array that matches the co attribute per:
https://docs.blender.org/api/blender_python_api_current/bpy.types.SplinePoint.html?highlight=splinepoint
Note: SplinePoint.co requires 4 values in its array (not sure why???)
This is the error I'm getting.
Traceback (most recent call last):
File "/home/iainm/Desktop/objects/dev_space.blend/Text", line 209, in <module>
ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 4 items, not 3
Error: Python script fail, look in the console for now...

Worth noting that the SplinePoint.co must be:
"Type: float array of 4 items in [-inf, inf], default (0.0, 0.0, 0.0, 0.0)"
Per the docs linked in the question...

You don't need to convert a vector to an array, you can just assign it to the location. A vector is created from one value which is a set of three (or four) numbers, so you need the extra pair of parenthesis around the three values.
Any location, rotation and scale value can all take a vector or array as input values. All of the following work.
obj = bpy.data.objects['Cube']
obj.location = Vector((-0.9056, -0.0628, -3.000))
obj.location = [-0.9056, -0.0628, -3.000]
obj.location = (-0.9056, -0.0628, -3.000)
obj.rotation_euler = Vector((-0.9056, -0.0628, -3.000))

For bezier curves the same applies to it's curve points
# for bezier curve points
bezcurve = bpy.data.objects['BezierCurve']
SplinePoint = bezcurve.data.splines[0].bezier_points[0]
myLocation = Vector((-0.9056, -0.0628, -3.000))

SplinePoint.co = myLocation
SplinePoint.co = Vector((-0.9056, -0.0628, -3.000))
SplinePoint.co = [-0.9056, -0.0628, -3.000]
SplinePoint.co = (-0.9056, -0.0628, -3.000)

For nurbs paths each point is four values instead of three. The first three values are the x,y,z for the location as above while the fourth value (shown as w in the UI) controls the influence the point has on the curve, where a bezier point has handles that define the angle and strength of the curve leaving the point, a nurbs path only has an influence that pulls the path closer to the point the larger the value.
# for nurbs paths points
nurbpath = bpy.data.objects['NurbsPath']
SplinePoint = nurbpath.data.splines[0].points[0]
myLocation = Vector((-0.9056, -0.0628, -3.000, 1.0))

SplinePoint.co = myLocation
SplinePoint.co = Vector((-0.9056, -0.0628, -3.000, 1.0))
SplinePoint.co = [-0.9056, -0.0628, -3.000, 1.0]
SplinePoint.co = (-0.9056, -0.0628, -3.000, 1.0)

If you are getting a location as a vector from somewhere else you can use resize_4d() or the to_4d() to use the location in the nurbs point. You can then alter the influence with either SplinePoint.co[3] = 1.0 or SplinePoint.co.w = 1.0.

Ok, right, i don't have the word literally in there, just expressing what the blender console outputs when I print what myLocation is.
The problem is that the array for the co of the spline  requires 4 values (check the doc linked in the Q) to confirm ...

got it, had to call to_4d() on the vector.

@gl2748 - right I should have noticed you where looking at nurbs points and not bezier points. I expanded the answer to clarify things.


text:
Separate compositor glare
With the help of the compositor I added glare to my object and managed to render it with alpha. But is there a way to separate the glare that was added on top?
In the end I want to have two images. One with the object and one with the glare.

If I understand you correctly, you want to add a glare to the brights parts of your image. You can filter out these parts with RGB curves and then add your Glare. After that, you can alpha over against black the result.
Each of your two layers can be Saved with a File Output node on your hard disk.
To Combine them simply add the glare layer over your original.
EDIT: As mentioned below you dont need the AlphaOver if you set the Mix value of the Glare Node to 1.

If you move the Mix slider in the glare node to 1.000 it will only show the glare on a black background, you can then save the image.

Unfortunately this is not working.

What is not working for you?


text:
Multiple widths with bevel modifier
I want to avoid to cut all necessary supporting loops into the mesh instead I'm searching a non-destructive solution for multiple widths using the bevel modifier.
I tested the various options (edge crease, angle, vertex groups) but none of them seem to work in this case.
How can I have a bigger beveled edge at the red areas but kepping the smaller ones?

Here is the file (Blend-Exchange won't upload me anything.)
https://www.sendspace.com/file/ne0eiw
This is what I want to achieve:

You can set different bevel widths using edge bevel weight.
Set default edges at 0.5 bevel weight using CTRL+E - Edge bevel weight and "red"  edges at 1.0. When in modifier settings increase  width twice and set limit method as weight

You can also get an artifacts because of using subsurf after bevel. But, its easy to fix:

With this method I get pinched areas where the edges meet.  https://i.sstatic.net/fLIWs.jpg

Select all with A
Deselect, with Shift RMB, the red edges
Make the remaining edges a vertex group and     use Bevel modifier > Vertex Group
Apply bevel
Repeat steps 3  and 4 for the red edges but different width.

This may work in very simple situations, in my case it creates massive artifacts. Even when I dissolve surrounding edges to let blender create Ngons.


text:
Burned-out lines only in small resolution?
If I'm rendering dark thin lines over a light background, I get kind of a burned-out result. But if I render the same in huge scale - and rescale it down to original size - the result is as expected. Its the same with texture or geometry.

What can I do to prevent always rendering huge pictures in order to get a decent result?

What render engine do you use ? Blender Internal or Cycles (please add a tag)

This looks like the right job for a Vector Graphics drafting application like Inkscape or Illustrator instead. Anyway check your antialiasing settings

I created the graphic in Illustrator. Its just one part of a detailed model. I can not find any AA settings in cycles.

In Cycles, anti-aliasing is essentially how many samples you have. You should have at least 100.

It is rendered with 1024 samples. I already tried out different settings but still have no clue how to solve that.


text:
Displacement Node Artefacts
For the text I'm using a greyscale-texture that I plug into the displacement output. Everything is correct using low values. But if I increase the value of the multiply-node in order to receive more depth some black lines start to appear.

Is there a way to fix that? Or is there an other way to achieve more depth?

Does the displace map have a soft edge? Perhaps you could sharpen it before use? I guess that means that the map should be normalised 0-1


text:
Can an HDR movie from a 360 camera light a scene?
Lighting a scene with an HDR background is pretty well documented. But some 360 cameras can also shoot HDR movies.
Is it possible to import a HDR movie into the background of a Cycles or Eevee scene using the World settings? If so, how?

If it's a supported format, then simply by opening it like you would with a regular (single) HDRI.

Sadly, it's not that simple. Yes -  an EXR sequence can be brought into Blender. But there's a bunch of stuff that needs to be done to make it work. I brought a sequence in, but each frame wasn't of the required bit depth. Then, when I brought a sequence of the right bit depth in, it didn't have enough resolution, or the colors weren't right, or the shadows were inconsistent. It's tricky.

That's not an issue with Blender though, but rather with your footage. Blender can only display/use the image data that is in the file. If the bit depth or resolution is to low, then that's caused by the image file not containing these information.

It gets to be an issue with Blender when you consider filesize. Let's face it: I could light a scene with a 512x256-pixel 8-bit JPEG if I wanted to. The results will be indistinct, over-saturated and uncontrollable, but it's possible. However, if I want the scene to be lit with the same movie I'm using as a background plate, it's not possible to get a serviceable movie running. Blender will crash. I have a 10-core CPU, twin-GTX1080s and 128GB RAM. Even with that kind of power, Blender crashes with that amount of data to manipulate.

It shouldn't crash. I routinely use 8k or 16k, 32-bit .exr to light scenes. Image sequences should be allocated as needed and not all at once as far as I'm aware. Are you running out of memory or does Blender simply crash for no apparent reason?

After a lot of experimentation, the answer is Yes, but the results aren't great, for a few reasons. I'm going to use HDR footage from the Insta360 ONE X for reference, not because it's particularly great at HDR movies, but it's pretty popular, and the results from other cameras in this price range (and higher) will be about the same.
1. Low dynamic range
360 HDR movies shot on action cams do yield High Dynamic Range movies, but we're talking about a pretty low end of 'High' here. Users of the popular HDRI resource HDRI Haven will be used to HDRIs with 15, sometimes 26 EV (Exposure Values) of dynamic range. This produces very accurate lighting results, delivering excellent shadow quality and color. The ONE X will get you 3 EV... 4 EV tops... delivering soft shadows and saturated lighting.
2. Low Resolution

This scene features an outdoor Insta360 ONE X frame from an HDR movie. (A disclaimer first: The yellow rectangle features some settings that I wouldn't recommend or consider good practice, but it does eke out better contrast in the scene to get more pronounced shadows.)
Even so, you can see that the background plate is pretty blurry. this is due to camera movement and because the equirectangular image is just 2880 x 1440 pixels - the native dimensions from the camera. And we're only seeing about a third of those pixels in the background - the other two-thirds are out-of-shot, wrapping around the rest of the 'World'.
3. Soft Shadows
The green circles point out the difference between the sharp, full-sun shadows in the footage, compared to the soft, indistinct shadows in the scene. There's also an excessive amount of blue coloration from the sky on the white plane. (Ignore the slight pink coloration under the ball; that's ambient light from my hand, holding the camera).
4. Shake
Ideally, each frame of an HDR movie has multiple bracketed shots from a single point in time and space. If the camera's moving, this isn't possible. In the shot above, I was walking under an arch. The blue circle indicates blurred building lines due to camera movement and shake. This shake also impacts dynamic range, due to a difference in camera position between when it took its low bracketed shot to its high bracketed shot of that frame. If the shots don't overlap exactly, lighting becomes indistinct and colors aren't computed accurately.
Summary
Live HDR footage can give you, quite literally, quick and dirty background plates. You can mitigate problems by using a stationary camera and low-contrast, cloudy days. If you need a motion background plate (driving scenes when people are in cars, for instance), the low-res background could be blurred, with in-scene constraints used to blur in the right directions, depending on camera angle.


text:
How to kill Freestyle 'scribbles' and 'flecks'?
Here's a technical model I tidied up topologically. I want Freestyle line diagrams out of it. But I'm getting problems.

Overprinted lines/"scribbles". There are two line styles in operation. They're being applied to the same model topology. But when rendered there are numerous 'over-draws', like someone's scribbled over the same line but slightly differently.
Transparency. This model is in three parts - lid, base, cable socket, all solid. But base lines the lid should be hiding are showing through.
"Flecks". Short lines that are neither marked as Freestyle edges nor creases are being randomly placed on the detail (thin) strokes.
Broken lines. Lines marked with Freestyle edges occasionally have discontinuous breaks.

I'm going a little nuts trying to figure out what settings do which in Freestyle. File available for download:

Notes:
Edge Detection > Crease Angle: 15°; Culling +  Face smoothness enabled
Lineset: Outline (Thick, Black): Edge Type > Inclusive Logical OR - Silhouette; Crease
Lineset: Detail (Thin, Charcoal): Edge Type > Inclusive OR - Edge Mark
If anyone could spot that critical checkbox or two of the several billion in Blender that I need to check, please let me know :/

Would you mind marking up your model explicitly for illustration, or do you want line-sets that will generalize to anything you throw at them?

MArk up the model, or mark up the illustration?

The model. The contours are very smooth, ambiguous for crease-detection. You could explicitly mark Freestyle edges on the model, or, say, boundaries between materials..

The model is freestyle-marked, particularly along curved edges. You can download the .blend file above and see or yourself. In fact, one of the problems is that the deliberately-placed Freestyle lines are broken, when they should be contiguous. I'm prepping an animated GIF indicating the various problems.

Illustration updated.


text:
how to get driver value

how can I get the value of this value as in printable form.

Hi. What do you mean by 'printable form'?

Calculate the matrix world of the pose bone.
An objects matrix world contains its global transform in relation to scene (0, 0, 0) and the global X, Y and Z axes.
See How to get world-space matrix of any pose bone?
This will give the global Y Euler rotation of pose bone TORSO.  The value of the 'VAR' variable in driver in question.
import bpy

from math import degrees

ivan = bpy.data.objects["Ivan_rig"]
torso = ivan.pose.bones['TORSO']

# torso global matrix

mw = ivan.matrix_world @ torso.matrix

# angle

angle = mw.to_euler().y

print(f"{angle} ({degrees(angle)})")
print(torso.rotation_axis_angle[:])

Output matching driver as shown

-0.3148045539855957 (-18.036972314872912)

where the driver variable value is angle = -0.3148
Re your answer, it's demonstrably incorrect. The property is a 4d (angle, axis.x, axis.y, axis.z)  Result from example above.
(0.0, 0.0, 1.0, 0.0)

default value because my pose bone is not in axis angle rotation mode. Even if it was the angle part would only be global Z rotation when axis is global Z.
Need to convert to global coordinates and convert to Euler to see the WORLD space rotation Y value of driver using this.
Often would use context, eg select the torso bone
torso = context.active_pose_bone

If using 2.7x or prior replace @ with * to avoid TypeError: Element-wise multiplication: not supported between 'Matrix' and 'Vector'

Are you serious?

actually figured it out
bpy.data.objects['Ivan_rig'].pose.bones['TORSO'].rotation_axis_angle


text:
Dark material = less reflection?
I want to create a dark material in cycles that is strongly reflecting the HDR. That would be no problem with a bright color but a dark color seems to swallow the reflection. Why is that?

I tried to increase the brightness of the HDR with RGB-curves but than my bright materials are overexposed.
What node-setup do I need to bring back the reflections in the dark material?

I edited my post.

Try mixing a Glossy BSDF with a Diffuse BSDF, And then give the diffuse a color. You should almost never tweak the glossy color. it represent the reflection color (which is almost always whiteISH) for most materials.

"Strongly reflecting" and "dark" are mutually exclusive.
However, maybe all you need to do is decrease the saturation of your material's colour. If the colour contains no red or green components, then there will be no red or green components in the reflected colours and the material will look quite dark.
For example, here are three reflective balls rendered in Cycles. From left to right, the saturation of the blue colour applied to these materials is 70%, 85% and 100%. With a lower saturation, the results look a lot more natural.


text:
Armature changes pose for no reason after exporting
Before I export, I clear the transforms of all the bones in pose mode. I go back to object mode and export the armature and mesh, and the second it's done exporting the armature just magically poses itself to some animation.
Edit: closer inspection shows that it sets the pose to the last frame of the last action in the action list.
I can just go back to pose mode and clear the transforms again, but it's really annoying that it keeps changing the pose for no reason.
This has happened in every version of Blender I've used since 2015. Note that I only work with .dae and .gltf files. Both exporters have this problem.
How can I make it so the pose isn't changed after exporting?

It's just posing back to the keyframes of the active action.  If you really want, you can reset loc/rot/scale + keyframe your bones, possibly in a new action.

I have the T-pose as an action. I close any actions open on any objects before exporting and set the frame to zero. So there is no active action and if there was it would be going to frame zero of the T-pose anyway. But it doesn't, it actually poses a blend of two different actions. Edit: actually it's the last action in the (alphabetical) list. It just so happens in this case that my last action is lower body only and the second-last is upper body only.


text:
how modify script to do GUI
I'm learning to script in Blender, and I'm writing script to do trees using L-systems with the GUI. My question is where do I start to draw GUI? where in the  code? All from Tree Characteristics I want to put in the GUI.
import math
import random
import bpy
from mathutils import Vector, Matrix
### Configuration Options ##
# Tree Characteristics
ANGLE = 45                      # Angle which new branches come off of (in degrees)
BRANCH_LENGTH = 10              # Length of parent branch
BRANCH_DIVISOR = 1.6            # How much to divide parent branch length by
THICKNESS = 0.25                # How thick the branches should be
DEPTH = 5                       # How many levels to render
SOFT_ENDS = True                # Add soft ends (spheres) to the branches
# Twist at the A grammar
TWIST = False                   # Twist the child branches around the parent branch
TWIST_AMOUNT = 45               # How much to twist by
# Mesh Resolution
VERTICES = 16                   # For branches (cylinders)
RING_COUNT = 16                 # For soft ends (spheres)
SEGMENTS = 16                   # For soft ends (spheres)
# Apply some randomness to the tree
VARIATION_MODE = False          # apply a random variation to the tree, gives it a more natural feel
BRANCH_LENGTH_VARIATION = .5    # How much to vary the branch length
TWIST_VARIATION = 15            # How much to vary the twist by
ANGLE_VARIATION = 30            # How much to vary the child branche's branch angle by
#random.seed(0)                 # use this to set a random seed
# class for storing render state
class RenderParams:
    __slots__ = (
        'max_depth',
        'cur_depth',
        'branch_length',
        'matrix_chain',
    )
    # sets up the Rendering Parameters
    def __init__(self, branch_length=10, max_depth=5):
        self.max_depth = max_depth
        self.cur_depth = 0
        self.branch_length = branch_length
        self.matrix_chain = [Matrix.Identity(4)]
    # Checks if we are deeper than our current depth or not
    def depthGood(self):
        return self.cur_depth < self.max_depth

    # Multiplies the stored matrx_chain
    def computedMatrixChain(self):
        m = self.matrix_chain[0]

        for i in range(1, len(self.matrix_chain)):
            m *= self.matrix_chain[i]

        return m
# This is used so that we don't accidentally add more sphere than we need to
_soft_ends_set = set()
# Makes a branch
#   branch_length -- a non-negative number, how long each branch should be
#   world_matrix -- A Matrix that will be where the placement of the branch starts
def mkBranch(branch_length, world_matrix):
    global _soft_ends_set
    # For the endpoints
    if SOFT_ENDS:
        # compute locations
        a = world_matrix
        b = world_matrix * Matrix.Translation((0, 0, branch_length))
        # Get their tranlations (fronzen) (so we don't double add them)
        a_loc = a.to_translation().freeze()
        b_loc = b.to_translation().freeze()
        # first endpoint
        if a_loc not in _soft_ends_set:
            _soft_ends_set.add(a_loc)
            bpy.ops.mesh.primitive_uv_sphere_add(segments=SEGMENTS, ring_count=RING_COUNT, size=THICKNESS)
            bpy.context.active_object.matrix_world *= a
        # second
        if b_loc not in _soft_ends_set:
            _soft_ends_set.add(b_loc)
            bpy.ops.mesh.primitive_uv_sphere_add(segments=SEGMENTS, ring_count=RING_COUNT, size=THICKNESS)
            bpy.context.active_object.matrix_world *= b
    # The actual branch
    mid = world_matrix * Matrix.Translation((0, 0, branch_length / 2))
    cylinder = bpy.ops.mesh.primitive_cylinder_add(
        vertices=VERTICES,
        radius=THICKNESS,
        depth=branch_length,
    )
    bpy.context.active_object.matrix_world *= mid
# Grammar
# A -> BCDE
# B -> A
# C -> A
# D -> A
# E -> A
# (All these are in the context of having a max render depth
# A = Go forward x units, perform B & C,  then back x units
# B = Turn left 45 degrees, perform A, then turn right 45 degrees
# C = Turn right 45 degrees, perform A, then turn left 45 degrees
# A - BCDE
def A(rp):
    # Check depth
    if not rp.depthGood():
        return
    # Record the amounts
    original_branch_length = rp.branch_length
    branch_length = rp.branch_length
    twist_amount = TWIST_AMOUNT
    # If variations are on, apply some
    if VARIATION_MODE:
        branch_length += random.uniform(-BRANCH_LENGTH_VARIATION, BRANCH_LENGTH_VARIATION)
        twist_amount += random.uniform(-TWIST_VARIATION, TWIST_VARIATION)
    # Make the branch
    mkBranch(branch_length, rp.computedMatrixChain())
    # Increase distance & twist
    rp.matrix_chain.append(Matrix.Translation((0, 0, branch_length)))
    if TWIST:
        rp.matrix_chain.append(Matrix.Rotation(math.radians(twist_amount), 4, 'Z'))
    rp.branch_length = branch_length / BRANCH_DIVISOR
    # Do the other grammars
    rp.cur_depth += 1
    B(rp)
    C(rp)
    D(rp)
    E(rp)
    rp.cur_depth -= 1
    # undo distance increase and twist
    rp.branch_length = original_branch_length
    if TWIST:
        rp.matrix_chain.pop()
    rp.matrix_chain.pop()
# B -> A
def B(rp):
    # Check depth
    if not rp.depthGood():
        return

    # Set the angle
    angle = ANGLE
    if VARIATION_MODE:
        angle += random.uniform(-ANGLE_VARIATION, ANGLE_VARIATION)
    # Rotate & go deeper
    rp.matrix_chain.append(Matrix.Rotation(math.radians(angle), 4, 'X'))
    A(rp)
    rp.matrix_chain.pop()
# C -> A
def C(rp):
    # Check depth
    if not rp.depthGood():
        return

    # Set the angle
    angle = ANGLE
    if VARIATION_MODE:
        angle += random.uniform(-ANGLE_VARIATION, ANGLE_VARIATION)
    # Rotate & go deeper
    rp.matrix_chain.append(Matrix.Rotation(math.radians(angle), 4, 'Y'))
    A(rp)
    rp.matrix_chain.pop()
# D -> A
def D(rp):
    # check depth
    if not rp.depthGood():
        return

    # Set the angle
    angle = ANGLE
    if VARIATION_MODE:
        angle += random.uniform(-ANGLE_VARIATION, ANGLE_VARIATION)
    # Rotate & go deeper
    rp.matrix_chain.append(Matrix.Rotation(math.radians(-angle), 4, 'X'))
    A(rp)
    rp.matrix_chain.pop()
# E -> A
def E(rp):
    # check depth
    if not rp.depthGood():
        return

    # Set the angle
    angle = ANGLE
    if VARIATION_MODE:
        angle += random.uniform(-ANGLE_VARIATION, ANGLE_VARIATION)
    # Rotate & go deeper
    rp.matrix_chain.append(Matrix.Rotation(math.radians(-angle), 4, 'Y'))
    A(rp)
    rp.matrix_chain.pop()
# render something
rp = RenderParams(BRANCH_LENGTH, DEPTH)
A(rp)

Here is my code.
import bpy
import math
import random
import bpy
from mathutils import Vector, Matrix
from bpy.props import *

bl_info = {
    "name": "Extra Objects",
    "version": (0, 3, 0),
    "blender": (2, 74, 0),
    "location": "View3D > Add > Mesh",
    "description": "Generate tree",
    "warning": "",
    "wiki_url": "",
    "category": "Add Mesh",
}

def make_params(self, depth):

    __slots__ = (
        'max_depth',
        'current_depth',
        'branch_length',
        'matrix_chain',
    )

    self.max_depth = depth
    self.current_depth = 0
    self.branch_length = 10
    self.matrix_chain = [Matrix.Identity(4)]

    #check_depth(self, self.current_depth, self.max_depth)
    #calculate_matrix(self)

    #chyba zbedne bo mamy okreslonej dlugosci lancuch znakowy
    """def check_depth(self, current_depth, max_depth):
    return self.current_depth < self.max_depth  """

def calculate_matrix(self):
        m = self.matrix_chain[0]

        for i in range(1, len(self.matrix_chain)):
            m *= self.matrix_chain[i]

        return m

def make_branch(lenght, thickness, matrix):
    middle = matrix * Matrix.Translation((0, 0, lenght /2 ))
    cylinder = bpy.ops.mesh.primitive_cylinder_add(
        vertices = 8,
        radius= thickness,
        depth=lenght)
    bpy.context.active_object.matrix_world *= middle

def make_tree(self, formula, depth):

    roz_A = 'BCDE'
    roz_B = 'A'
    roz_C = 'A'
    roz_D = 'A'
    roz_E = 'A'
    nowa = ""

    k=0
    c=0
    while k < depth:
        for i, c in enumerate(formula):
            if c == "A":
                nowa = nowa + roz_A
            elif c == "B":
                nowa = nowa + roz_B
            elif c == "C":
                nowa = nowa + roz_C
            elif c == "D":
                nowa = nowa + roz_D
            elif c == "E":
                nowa = nowa + roz_E
        k=k+1
        formula = formula + nowa
        #print(nowa)
        #print(k)

    #print(nowa)"""

    render = make_params(self, self.branch_depth)

    for i, c in enumerate(formula):
        if c == "A":
            A(self, render)
        elif c == "B":
            B(self, render)
        elif c == "C":
            C(self, render)
        elif c == "D":
            D(self, render)
        elif c == "E":
            E(self, render)

def A(self, render):
    original_lng = self.branch_length
    branch_lng = self.branch_length
    twist_amount = self.twist_variation

    if self.variation_mode:
        branch_lng += random.uniform(-self.branch_variation, self.branch_variation)
        twist_amount += random.uniform(-self.twist_variation, self.twist_variation)

    M = calculate_matrix(self)
    make_branch(branch_lng, self.thickness, calculate_matrix(self))
    trans = Matrix.Translation((0, 0, branch_lng))
    M.matrix_chain.append(trans)
    return

def B(self, render):
    bpy.ops.mesh.primitive_cone_add(vertices=4, radius1=1, radius2=0, depth=2, view_align=False, enter_editmode=False, location=(0, 0, 2.5))

    return

def C(self, render):
    bpy.ops.mesh.primitive_cone_add(vertices=5, radius1=1, radius2=0, depth=3, view_align=False, enter_editmode=False, location=(0, 0, 2.5))

    return

def D(self, render):
    bpy.ops.mesh.primitive_cone_add(vertices=6, radius1=1, radius2=0, depth=4, view_align=False, enter_editmode=False, location=(0, 0, 2.5))

    return

def E(self, render):
    bpy.ops.mesh.primitive_cone_add(vertices=8, radius1=1, radius2=0, depth=1, view_align=False, enter_editmode=False, location=(0, 0, 2.5))

    return

class TreesGenerator(bpy.types.Operator):
    """Trees Generator"""
    bl_idname = "mesh.tree_add"
    bl_label = "Trees Generator"
    bl_options = {'REGISTER', 'UNDO'}
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOL_PROPS'

    """__slots__ = (
        'max_depth',
        'current_depth',
        'branch_length',
        'matrix',
    )"""

    grammar = ['A', 'AB', 'ABB', 'BA', 'BBA']
    random_value=[]
    random.seed(0)

    for i in range(10):
        random_value.append(random.random())

    #if random_value[1] != 0:
    #   bpy.ops.mesh.primitive_cube_add(radius=1, view_align=False, enter_editmode=False, location=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

    def InitialProperties(X, Y):
        return IntProperty(
            name = "Integer",
            description = "Int",
            default = X,
            min = X,
            max = Y)
        #wartosci domyslne w panelu

    def InitialPropertiesFl(X, Y):
        return FloatProperty(
            name = "Float",
            description = "Float",
            default = X,
            min = X,
            max = Y)

    def InitialPropertiesBl():
        return BoolProperty(
            name = "Randomness",
            default = False)

        ### PIEŃ
    trunk = InitialProperties(0, 4) # tu bedzie tablica z formula poczatkowa

        ### GAŁĘZIE
    branch_depth = InitialProperties(1, 5) # maksymalne rozwiniecie stringa
    branch_length = InitialPropertiesFl(1, 2) #wspolczynnik dlugosci galezi, im wiekszy wspolczynnik tym krotsze galezie
    seeds = InitialProperties(0, 10) # 10 roznych stringow, wybor z tablicy do ktorej wpisze randomy
    twist = InitialProperties(10, 16)
    thickness = InitialPropertiesFl(0.01, 0.3)

        ### RANDOMY
    variation_mode = InitialPropertiesBl()
    branch_variation = InitialPropertiesFl(0, 1)
    twist_variation = InitialProperties(10, 170)
    angle_variation = InitialProperties(10, 170)

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

            ### PIEŃ
        layout.label("Trunk")
        row = layout.row()
        box = row.box()
        split = box.split(percentage=0.35)
        col = split.column()
        col.label("Grammar:")
        #layout.separator()
        split = split.split(percentage=0.9)
        col = split.column()
        col.prop(self, 'trunk')
        layout.separator()

            ### GAŁĘZIE
        layout.label("Branches")
        row = layout.row()
        box = row.box()
        split = box.split(percentage=0.35)
        col = split.column()
        col.label("Depth:")
        col.label("Thickness:")
        col.label("Branch divisor:")
        col.label("Seeds:")
        col.label("Twist:")
        #layout.separator()
        split = split.split(percentage=0.9)
        col = split.column()
        col.prop(self, 'branch_depth')
        col.prop(self, 'thickness')
        col.prop(self, 'branch_length')
        col.prop(self, 'seeds')
        col.prop(self, 'twist')
        layout.separator()

            ### RANDOMY
        #layout.label("dupa")
        layout.prop(self, "variation_mode")
        if self.variation_mode == True:
            row = layout.row()
            box = row.box()
            split = box.split(percentage=0.45)
            col = split.column()
            col.label("Branch lenght variation:")
            col.label("Twist variation:")
            col.label("Angle variation:")
            split = split.split(percentage=0.9)
            col = split.column()
            col.prop(self, 'branch_variation')
            col.prop(self, 'twist_variation')
            col.prop(self, 'angle_variation')
            layout.separator()
        else:
            layout.separator()

    def execute(self, context):

        formula = self.grammar[self.trunk]
        #make_params(self, self.branch_depth)
        make_tree(self, formula, self.branch_depth)
        return{'FINISHED'}

def add_object_button(self, context):
    """adds button"""
    self.layout.operator(
        TreesGenButton.bl_idname,
        text=TreesGenButton.__doc__,
        icon='PLUGIN')

def register():
    """register"""
    bpy.utils.register_module(__name__)
    bpy.types.INFO_MT_mesh_add.append(add_object_button)
def unregister():
    """unregister"""
    bpy.utils.unregister_module(__name__)
    bpy.types.INFO_MT_mesh_add.remove(add_object_button)
if __name__ == "__main__":
    register()

It's not finished yet, so it looks chaotic, because all the time I have this error:
AttributeError: 'Matrix' obcject has no attribute 'matrix_chain'

I'm noob in programming so I think that's a stupid error but I don't know how to fix it. I'm very grateful to any help.

I've tried your scripts, the first one builds the tree and the second one runs without errors. Could you please explain the problem you are facing?

sure. it runs without error but when you do 'Space' and in this menu you put name of program Trees Generator then you will see error AttributeError: 'Matrix' obcject has no attribute 'matrix_chain'. and i don't know what is wrong with matrix. i'm not sure but i guess that is problem with inheritance.

Looks like it should be self.matrix_chain.append(trans) on line 117.  self the operator has a "matrix_change" attribute.  M is a matrix and doesn't.

I do second class instead of def make_prams and works, so problem is solved :)


text:
Script to remove animation from a specific bone instead of the armature using script
I found a way to point to bones in an armature
import bpy

armature = bpy.data.armatures["Armature"]
for bone in armature.bones:
    print(bone.name)

Here I want to check for names of bones and if those name match then I am looking to remove all the animation from that bone including all Scale , Location and Quaternion Rotation.
Thanks in Advance

As in same result as using `bpy.ops.anim.keyframe_clear_v3d() in pose mode with selected pose bones?

Actually I am looking for a way to remove animation from body parts of character programmatically like 'limbs' and 'torso' , all this be done just by running the script in the object mode is there a way to point to dope sheet summary ie "W Quaternion Rotation (Neck1)" and also a way to remove them.

I found keyframe_delete(data_path, index=-1, frame=bpy.context.scene.frame_current, group="") but I am not sure how to use it

As batFINGER suggested in his comment. This can be done using bpy.ops.anim.keyframe_clear_v3d(). To do this in python you need to select the bone first then apply the operation. Below is a script to delete animation of a specific bone, in this example, a bone named 'Bone' will have its animation deleted:
import bpy

arm = bpy.data.objects['Armature']
bpy.ops.object.mode_set(mode='POSE')
bpy.ops.object.select_all(action='DESELECT')
arm.select = True
bpy.context.scene.objects.active = arm

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

bpy.ops.pose.select_all(action='DESELECT')

for pb in arm.pose.bones:
    if pb.name == 'Bone':
        arm.data.bones[pb.name].select = True
        bpy.ops.anim.keyframe_clear_v3d()
bpy.ops.object.mode_set(mode='OBJECT')

here I have to select the armature , you know a way by which the armature will get auto selected. Thanks in advance

@ShubhamSharma  Answer updated, please mark and accept the answer if it solved your problem.


text:
How to make plasma ball's lightning's moving more naturally?
file link:https://drive.google.com/open?id=10F5kQ2czSXHlGY3pEPQGOIJnO1IRcAGK
I want to make the moving of lighting more naturally as red line showing, but i failed, could someone tell me how to do.

you can use the node to control line's segment that in the red rectangle as the picture showed.

blender version:2.79
animation node version:2.1
Thanks

So you want it to be smoother as shown in red?

Yes, but not only smoother, more like energy wave send from bottom to top.

To get a smoother spline based on the wiggle node, you need to evaluate the noise at parameters of the spline. Moreover, to move the waves along the spline, simply add a scalar proportional to the frame number:


text:
cant save as .blender

I am A Sims4 user and I've been trying to create new hairstyle.
But I seem to be unable to save as .blender so i cant open it on blender

Do i have to download something else to be able to save as .blender?
I'm confused help please

I'm voting to close this question as off-topic because it is not specifically about Blender

In this video (https://www.youtube.com/watch?v=PdPEPRm9s9Y) it shows a mesh direct export option to blender available, so I think what you wish to export is not possible... (it seems a picture, maybe a picture of the hair?). I've never user TS4, though.

The file type is .blend, but it is not a format you can just save to like an image file format. You will need to look for an exporter to go to maybe .obj file format or something like it that handles mesh and materials together.


text:
Why can I only select points from only certain strokes? (Grease Pencil)
I am a beginner with blender and grease pencil. I don't what I did but all the sudden I couldn't erase, cut or select most of the strokes. For some reason only stroke I have selected could be selected. I have already made sure that those layers are unlocked btw.

I suspect that you've somehow switched grease pencil layers.  You can only select on the current layer.

Hi, Thanks for the reply. I not sure what you mean. Is there someway you can help me? I would really appreciate it.

I somehow figured it out. I actually locked my materials somehow. I feel so stupid now. Thanks for you help!


text:
Why doesn't the image in the UV Image Editor appear on the object in the 3D View in 2.8?
I can't figure out this problem.  Based on this video @ 1:59 (which, admittedly, is set up a little differently in terms of nodes), I should see the texture on the surface of the selected object...

You'll need a Texture Coordinate node as well if you want to use the UV map.

I had one; the results were no different.

... and do what Jonney Shih wrote, select the Look Dev mode or texture in viewport shading. (I thought that was implied)

Was the texture coordinate node outputting with the uv option?

Two ways I can think of:
1) In the viewport overlay settings on the top right, click on the down arrow to expand the shading settings, then check texture on the color group.
2) Or, even more simply switch to LookDev mode nearby to show applied textures on the material.


text:
Creating button to select armature
I want to create a ui button in blender, after clicking on it, specified bone controls should get selected in pose mode!
REASON- i am learning animation and some group bone controls needs to be selected repeatedly which is very tedious. That button should select my specified controls!
Please send me code!

Hi. This isn't a site to ask people to send you code, but to ask and answer specific questions. If you have attempted to code this yourself, please edit the question to show what code you have so far and where you are getting stuck.

coding seems impossible to me. If anybody have answer of this question in their stack please exchange with me! Please (i know i am dumb fellow!)


text:
How do I stop faces extruding individually?
I'm making a model and all my faces are extruding independently, which is very useful and all, but what did I do to enable this and how do I deactivate it?

Would you mind sharing some screenshots to help give us more information about your problem? It's hard to know exactly what you're experiencing with only the description you gave there.

Can you please create a screenshot? In Blender in the top menu go to Window > Save Screenshot, save the file and attach it to your question.

I don't hve that opon    I'm dislexic

Can I reset controls without losing my project

i have a yellow circal with a + in it that extrudes normal

my scaling also doing it{working independently }

I'm really really confused now

It's ok I figured out how to reset my controls. I copied and pasted my entire project into a new window and then saved it over the old one resetting my controls. I don't know why but for some reason my controls on the left side of the screen was not changing the settings it changed the icon but not the settings very peculiar. Anyway long and short all fixed

You have likely right clicked on the tool and accidentally selected Extrude Individually. Right click on the tool and select Extrude Region to get the desired behavior.

I tried but nope


text:
The filename in Chinese can not be display in Blender 2.8 when file explore in open
When I tried to load a video to video sequencer, the file name in Chinese could not be displayed.

This is a bug, you should report it, so that it will be fixed soon. See https://www.blender.org/support/

@m.ardito no this is not a bug.

@joseph, it was a video file, with both name and extension in chinese characters? And did you see other strange characters (like boxes) instead of the expected ones or you didn't see the file item at all?

it was "fname.mp4", fname is in Chinese and it was shown as boxes.

The default font used for the interface does not contain all characters, Chinese is one of them.
There are two options to solve this in the preferences (Edit > Preferences)

Activate Translation  and set language to Simplified Chinese or Traditional Chinese. It may also work with Automatic depending on your OS language configurations.
Choose a different Interface Font for the interface which includes Chinese characters.

I think the first option is likely the best for your problem. Optionally you can also activate the checkmark next to Interface in the translation options to switch the entire interface to Chinese.

I activated the checkmark next to Interface in the translation options and I was able to see the Chinese characters. Thanks.

@joseph If this answer solved your problem, consider marking it as accepted, by ticking the checkmark on the top left of the question.

As also suggested in another answer, the issue could be solved just by turning on the interface "translation" feature. On my linux mint I created a txt file with some random chinese characters, and it was displayed good on my desktop and in text editor.
But when I tried to load it in Blender 2.80, all I could see was a bunch of boxes instead of the chinese characters.

it was sufficient to enable "translation", keeping it "Automatic" and the UI immediately shown the chinese characters, with no other option enabled, and no other font loaded. I guess why this is not a default option.

@joseph, you could even save your preferences as default after setting this - although on my fresh 2.80 I discovered to have "auto save preferences" enabled...

Yes, the issue was solved just by turning on the interface "translation" feature. And  "auto save preferences" is enabled in 2.8. Thanks.


text:
Why can't I render sharp images?
I can't seem to output sharp images.
I've search everywhere on the internet but the only solution I've found was to bump the samples but that didn't solve anything.
These are 1k samples with Intel's Denoise and 5k samples examples.
1K samples:

5K samples:

Here is the blend file
Can anyone help me please?

Isn't that just an accurate render of the bevel on the text?(Given the pixel resolution of the output).. could you present the text 2D instead?

This is a result of too low render resolution.
1000px is just too low, and upscaling makes it look blurry.
Render the image at 2000x2000px instead, and even with just 200 samples you'll get nice sharp edges (just tested it).
Bonus: How to properly connect the Denoise node for best results :).

Thanks for your help!! That was exactly the problem!
Regarding the Denoise I think I saw Andrew Price connecting the noisy image to the image parameter on the Denoise node, although I can't find it anymore. I'll try that way anyway ;)


text:
AMD RX 570 GPU slower rendering than NVidia GTX 1050 Ti?
I recently built a new PC running on a Ryzen 7 2700X CPU and AMD Radeon RX 570 GPU. However, I'm getting significantly longer Cycles rendering times than my old Intel i5 PC running on an older NVidia GeForce GTX 1050 Ti model graphics card. Am I doing something wrong, or what exactly is going on here? GPU is selected in Blender Preferences and all drivers are up to date.

CUDA has been far more optimized for a while than other rendering pipelines so this could be your issue. Only NVIDIA cards can run the CUDA rendering pipeline. Also check your "Cycles render device" in the "System" tab of preferences. You may need to use a different render device. I hear that AMD cards work great with the RADEON PRO RENDERER for blender (Developed and mantained by AMD) and are faster with that than the native cycles engine atm.

Thank you! I vaguely heard something about Radeon ProRender but had no clue they they had a Blender plug-in. Will give that a try and see how it goes. :)

OMG, this worked! Installed both the ProRender and the material library they have developed for it and it works like a charm and it renders A LOT faster than Cycles. Thanks so much man!!!


text:
Bone rotation gone wrong on mocap!
I really need you guys help.
Well, I have this ugly mocap:

And like all mocap, need my rig to follow it.
But the hand rotation is screwing up, no matter what I do.

Seems like the hand rotation is jumping the keyframes.

And sometimes the palm of the hand is facing the wrong direction.
I don't know if you guys can explain to me how to get it right, sometimes explain is harder than do it.
I included the project file to better visualization of what I'm trying to say, but if you fix it and don't want to explain, it's ok for me too LOL.
Thanks!!
Blender File

I can't download it, could you please share your file on another site? https://blend-exchange.giantcowfilms.com/

Blender File
Reuploaded! It was too big for blend-exchange, but I managed it.

I'm not used to this kind of rigging, it looks like your armature called HUGO_ANIM is supposed to follow the one called Armature with a lot of constraints, is there a reason for that and not directly use Armature? I may be not the one who can advise you...   :/

There's kinda reason. The software that I'm extracting the mocap don't give me an armature, but empties. So I have to make an armature to Copy Location of an empty and Track To another, so I can Copy Rotation from my main armature called HUGO_ANIM. I jerry-rigged.

I can't see it, when does it happen? It's very jittered and incoherent but I don't think it comes from a problem caused by the armature, I guess it's rather related to the motion capture, for arms and hands you have one keyframe per frame but there must be some interpretation problems

Don't mind the jittering or anything caused by the bad mocap, the problem is the hand rotation. :/


text:
Why do I get 'addon not found' errors when starting blender from the command line?
I installed blender with the source code and when I start from the command line it shows:
addon not found: 'io_scene_3ds'
addon not found: 'io_scene_fbx'
addon not found: 'io_anim_bvh'
addon not found: 'io_mesh_ply'
addon not found: 'io_scene_obj'
addon not found: 'io_scene_x3d'
addon not found: 'io_mesh_stl'
addon not found: 'io_mesh_uv_layout'
addon not found: 'io_curve_svg'
addon not found: 'object_boolean_tools'
addon not found: 'space_view3d_pie_menus'
addon not found: 'render_auto_tile_size'

How can I fix it?

How did you 'install Blender with the source code'? What does that mean? Do you mean you compiled Blender from the source code and then run it? Blender Stack Exchange might not be the right place to troubleshoot compiling problems. It's more for questions about the usage of official Blender versions. Try devtalk forums for help with compiling or download the official release

Looks like you're missing some of the addons, which Blender expects to find but can't. Some of them are available as their own source package, and generally are located in the [version]/scripts/addons directory. Compiling from source may have skipped some of those, as they are technically their own subprogram.
They aren't essential for Blender to run, but provide useful services; without UV Layout, as an example, you won't be able to export a UV-unwrap as a 2D graphic. It's been a while since I compiled the program myself, but it's possible that it simply failed during the portion meant to build these—like a missing dependency, as an example—and it just kept going with what it could build. You can find and build many of them independently and simply drop them in that folder.
If you still have the stdout from the build, you may find a hint as to what's missing in there. I hope this helps you.


text:
Why is blender's API documentation so incomplete
I'm new to blender. I want to write some python script using Python API. But I found API in the official website is so incomplete(for example bpy.data, it has only ONE page). Later, I found I can use CTRL+SPACE in the blender python console to find some methods and attributes, but I still feel inconvenient.
Did I do something wrong? Where can I found all of the APIs, or what is the correct workflow to write python script in blender?

What exactly is missing, can you give an example? The documentation is a community effort, just like the software development. If you find something that's missing get in contact with the developers and help us add it.

^ This. Just ask a real question and we can help for sure.


text:
Why do these green stripes appear when rendering with EEVEE?
I'm trying to render an imported file (.obj) from FaceGen (https://facegen.com).
With EEVEE I have the following results:

But with CYCLES:

Why?
I need to render with EEVEE,
because it’s faster and I don’t need a high quality rendering.

is your gpu compatible with blender? are the drivers updated?

I dont know, this is my computer spec:
Processor  : AMD E2-1800 APU with Radeon(tm) HD Graphics
Memory (RAM)  : 3619MB
OS : Ubuntu 19.04
OpenGL  : AMD PALM (DRM 2.50.0 / 5.0.0-25-generic, LLVM 8.0.0)

I don't know much about how to fix these problems. I only know that weird results can happen if you don't have a supported graphics card :|

The E2-1800 onboard GPU is a Radeon HD 7340, which is a Terrascale architecture GPU. These are not supported for Eevee. See https://code.blender.org/2019/04/supported-gpus-in-blender-2-80/


text:
Why do I get black dotted lines on my mesh when switching to look dev mode?

I just modeled this thing, but when I switch to dev look mode these black lines on the side of the mesh. What are those and how do I get rid of them? I used the knife tool to add edges to get clean quads. Is it related to that?

I just modeled this thing, but when I switch to dev look mode these black lines on the side of the mesh. What are those and how do I get rid of them? I used the knife tool to add edges to get clean quads. Is it related to that?

Difficult to tell just from the image can you share the blend file?

I played a bit around and found the problem. I've added new edges by connection to Points with F  but this created a direct connection which interfered with the rest of the mesh.
I've solved it by just using the Knife Tool instead, but is there an easier way than the knife tool?

I like to add edges using a custom shortcut for the Subdivide tool. If you are in edge mode, go to Edge -> (and right-click) Subdivide. You will get the option to set a shortcut. I use alt-W because somebody else suggested it and it works well for me (deliberate, fast, no conflicts). You can quickly connect any two edges, double-tap "G" to slide them along those edges, and can insert 1 to 10 edges at a time.


text:
Why are the unwrapped UV faces different sizes and proportions to my model's faces?
Hey so I'm fairly new to Blender and am having issues with some of my UV unwraps. The lines in the UV Image Editor are making completely different shapes. I've tried multiple things trying to get them to be more uniform with their model but it still isn't working. Not sure if it's how I'm doing my seams or something else. Let me know what you think.

Hi. Are you trying to say that your UVs are laid out how you want (on the right) but they're not showing correctly in the 3D View (left) or that the faces are not being unwrapped how you want?

It seem you have many extraordinary faces in your mesh. Could you upload your file? https://blend-exchange.giantcowfilms.com/

The outlines on the right side aren't at all right, they're different sizes, shapes, and proportions than what they should be as on the model on the left, and yeah ill upload the file!

Try to avoid the concave faces. Blender really bed at unwrapping them. In this case that would be the best if you create a grid on the whole object with "ctrl+r" or subdividing an then extrude the coffin holes inside with "e".

You can try to use a front orthographic view, select some faces and choose U - project from view. Then change the view and go on with other faces, until you unwrap the whole model.
The classic UV algorithm gets confused by your convex Ngons, a clear topology, with only not convex quads, would avoid the problems.

Yeah that really helped thank you! Im just wondering how I am able to keep all of the unwraps on the same map? Whenever I go to a new side and uv map it from the project view it removes the ones I had previously?

UV editor will show all selected faces, so you can simply select all unwrapped areas, so they all will be showed and you will be able to move, rotate and resize them.


text:
Any feature in Blender which can show front edges and back edges differently like in Sketchup
I have asked on question here: Why the inner edge line segments are drawn in freestyle render output , but it looks like Blender's freestyle render does not works quite well, as it has bugs.
So my question is: Is there any feature that I can show the edges cleanly just like the ones in Sketchup, see below:

In the above screen shot, both the front edges and back edges are shown in 2D style(I mean they don't have any 3D projection feature, they just have fixed width), but this feature is useful for me to show the inner structure for teaching. Thanks.

To show edges of geometry in render like on your screenshot I used Freestyle, i.e. it's possible to see the result only when rendering (either in Preview / Viewport render or scene render).
In Render Layers tab, Freestyle Line Set rollout I set up 3 freestyle layers:

one for border edges of meshes (contours);
one for hidden geometry (i.e. the one which is hidden from viewer with another geometry) (seeing-through)
and one for foreground edges (i.e. ones that are closer to the camera and are visible) (foreground).

contours layer (thick grey line):
Has the simplest setup, nearly default one (it has Suggestive Contours checked and that's not needed for it to work).
seeing-through layer (dashed green line):
I checked Hidden option to make hidden geomtry selected by Fresstyle. I unchecked all the options from Edge Types category (it will also work if checking default ones and Crease, which will work only if its angle is set, see below).
foreground layer (thin red line):
Only Crease is checked because layer is intended to show those edges which are neither borders nor contours and at the same time aren't hidden geometry. In order to make it work Crease Angle in Freestyle rollout in the same tab is set to 120 degrees instead of default 0:

I also changed line style for every layer, like thickness, color etc. in Freestyle Line Style rollout in the same tab.
The result:

It has some inaccuracies, like the one with the top red edge of the rightmost cube, it stops being visible and becomes hidden too early (it should've been red all the way up to cylinder). If this is something visible for you and not desired, it should be possible to avoid that if subdividing that edge with a loopcut.

Hi, Mr zak, I mark this as the answer to my question, thanks. But I do see some bugs in Freestyle, and I still need to some extra work (I need to subdivide some edge with a loopcut). Hope those bugs will be fixed.

@ollydbg23 yes the undesired behaviour is present unfortunately; it may be avoided with subdividing (make sure to grab added cut towards the intersection of geometry). You can use sliding (G twice with loop selected) to move it where needed. As I tested, adding Subsurf won't help much and subdivide seems to be the only kind of easy fix.

Is it possible what the hidden line is generated directly from the OpenGL? I see this post here: 3D shapes with stippled edges when hidden, I guess Sketchup just did some similar things. thanks.

@ollydbg23 I don't think so as Freestyle is Blender's render engine which is not just OpenGL. Though I haven't any special knowledge on that topic. If you want that question to be answered most likely you should ask a new one.

Are you talking about Blender viewport or Freestly rendering?
Blender viewport has currently very limited customization and edge representation options, there is an undergoing huge project that plans to revamp the OpenGL and drawing parts of Blender that will hopefully allow for better display modes and options.
So currently as far as I know there is no way to display it real time, as far as I know, but you might be able to do so in the future.
As for Freestyle rendering, despite some bugs and limitations, like intersections, coinciding faces and lines, and partially hidden edges; hidden lines are mostly supported, and you can configure different line styles for them as described here https://wiki.blender.org/index.php/User:Flokkievids/Freestyle/LineSets

I mean the viewport or the render output(whether Freestyle is enabled or not), I need the effect like the screen shot of Sketchup, but currently, as the Freestyle rendering engine has some bugs(as the last paragraph said by Mr Zak's answer, I still need to use loopcut to divide my box), so that I really hope the new implementation will have those bugs fixed.


text:
Is it possible to remove a window that is lying on top of 3 other windows in a row?
Suppose you have 4 windows in 2 rows. The first row has one window and the bottom row has 3. Is it possible to remove the top window?

The workaround I was thinking of was removing the top editor with the info window, but of course that doesn't work..

I can't find any particularly good and fast way around this, this is the best I could come up with:

That is what I've done!


text:
Applying on picture to a mesh but not the same picture to every face of the mesh
In cycle render.
There does not seem to be an option to wrap a texture around a mesh like in blender render.
In blender render I can wrap just ON texture to lets say a sphere.
In cycle render it is the same texture to every FACE of the mesh.
How could I have the same result in cycle like in blender render?
Thanks
armin
Ok, so the question was not clear:)
Sorry my friends.
I just want to take a texture and wrap it arround a mesh the same way
as if to take a drawn picture on paper and wrap it arround, lets say a football .
The football has faces.
At the moment, when using cycle render, I don´t knwo how to wrap this texture picture arround the football in on pice.
At the moment it cycle render puts the picture of the  texture on every face of the foodball
I don´t want that.
Hope that helps:)

I don't quite get what you mean . . . could you please clarify a little?

I think you should either unwrap your mesh to make image texture be wrapped around mesh or use Object texture coordinates. See this answer - http://blender.stackexchange.com/questions/8697/how-do-i-put-an-image-texture-on-a-material-in-cycles for more details