How do I simply create a mesh line? I'm currently teaching myself Blender and have been going through the online documentation. Many of the examples are using nothing but lines of vertices/edges but I can't see how I do that. For instance, how would I "create a mesh representing the profile of your object" as it says in this example?:

Change your view to top orthographic (numpad 7 for top, numpad 5 to toggle perspective/ortho).
Add a plane (shift+A, select Mesh/plane in the menu).
Enter Edit Mode with Tab.
Select the 2 vertices on the right (R click to select, Shift+R Click to add to selection) and delete them with X and select "vertices" in the delete menu.
Now you can move your vertices where you need.

Select one and Ctrl+L Click to create one more where you click.

continue until you have your profile done.


How to create a spiral 3d structure? I want to create a helical/spiral structure like the figure below. I tried to create a circle and poke faces after that I dont know how to extend it in z direction to look like a spiral.

You can use the 'screw modifier' to do that.

Here is two examples, just starting with an edge (segment) a bit rotated and placed differently relatively to the objects origins:

The modifier starts with a base mesh and extrudes it around an axis (of the mesh itself or the one of another object). The 'screw' parameter give the elongation along the axis.


Custom made menu hotkey problem, blender doesn't find it unless I run it form the text editor I am new to scripting in blender, kinda new to python as well.
I followed a tutorial on how to make a custom menu in python, and then add it as an addon in blender. Now I installed it from file and it worked, I enabled it and assigned an hotkey, but unless I run it from the text editor I get this error:

Report: Error
Menu "gino" not found.
(gino is the bl_idname)

if I run the script from the text editor once, the hotkey start working and I don't receive any errors.
How do I fix this so that when I start Blender my addon work with that hotkey?

This is the code:

bl_info = {"name" : "GinoMenu","category" : "3D View","author" : "Edo"}

import bpy

class customMenu(bpy.types.Menu):
    bl_label = "G I N O"
    bl_idname = "gino"

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

        layout.operator("mesh.primitive_cube_add")
        layout.operator("mesh.primitive_cone_add")
        layout.operator("mesh.primitive_circle_add")

        return{'None'}

def register():
    bpy.utils.register_class(customMenu)
    #bpy.ops.wm.call_menu(name = customMenu.bl_idname)

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

if __name__ == "__main__":
    register()

for anyone facing the same problem in the future here is the solution, thanx again to  batFINGER for helping me find it.
you need to make sure that you put your blender version in the script's dictionary, in my example:

bl_info = {
    "name" : "customMenu",
    "category" : "3D View",
    "author" : "Edo",
    "blender" : (2,80,0)
}


Making mirrored object a real object with mesh This is something I've been looking for for a very long time and found no answers to: how do I make the mirrored side of an object a "real" object with selectable mesh?

If I apply the mirror modifier to an object how can I separate the two halves so that they become two separate objects that can be edited independently?

The Mirror Modifier has a Merge option.

DO untick that! - check that the checkbox is not checked, so you have to separate objects while working with the Mirror.
Now the Magic:
After applying the Mirror modifier, you can go into edit mode and use "L" in Face select mode to "select linked".
that means you select all facees that are connected and because you dont merged before you can select both halfs of the mirror separatly.
Now pres "P" to separate selected. leave edit mode.

now you have two objects and can go one with it.


Why is X mirror not working on a mesh? Does X-Axis Mirror work on a mesh?  I applied X-Axis Mirror to a set of bones and it worked but not on the mesh, I tried to mirror the mesh using the X-Axis Mirror option but it doesn't mirror anything.

Here's the .Blend.

The mesh isn't exactly symmetrical.

This behavior is intentional. Meshes which are almost (but not quite) symmetrical wont detect vertices as mirrored.This is needed to avoid problems with high-poly meshes where vertices may be very close.

To resolve the problem, you can use the Snap to Symmetry tool.
See: Mesh -> Snap to Symmetry.

This has options to select a distance threshold and choose which side of the axis to use.


Iterated edge drawer animation nodes I have a set of lines instanced along a curve using "Replicate Matrix" and "Object Matrix Output."

My goal is to loop through the instanced lines and, for each one, get a random point on it, find the nearest point on the next instanced line, and make edge between them. The end result I want is edges drawn through all of the instanced lines, looking something like this:

I've tried to do the following way. First, a loop that runs through the lines and finds edge starts and ends:

The "random point" comes from the Random Number that inputs to the Get List Element, which has the vertices from the first line. I then pass these edge starts and ends out of the loop to draw the edges.

This works to some extent, but I'm having problems achieving the result I want. The result I actually get is more like this:

Edges are drawn between adjacent lines, but only between the two lines currently being compared in the loop. And the number of edges being drawn between adjacent lines increases as the loop runs. I don't understand why that is. And the edges don't accumulate as the loop runs - so the edges drawn on first iteration aren't preserved in the second, etc.

To try to fix the second, accumulation issue, I tried to make this second loop, which would save all the edges the loop calculates:

But this hasn't worked. The list in the Append gets longer after each iteration, but each element in the list gets written over with a single vector value. You can see that happening, e.g., in the Viewers connected to the Append to List nodes. It's weird.

So, that's where I am. I can't figure out how to turn something like the second drawing into something more like the first. Maybe I'm going about this whole thing the wrong way! But even just figuring out how to get the Append node to hold values across iterations would be awesome.

Here's the .blend file:

A spiral or a helix is described using the set of parametric equations as follows:

$$
\begin{aligned}
x &= R\cos{t}\\
y &= R\sin{t}\\
z &= \delta t
\end{aligned}
$$

Where $R$ is the radius, and $\delta$ is the vertical frequency of the curve. By implementing this, we get:

Now, we are going to move the points of the helix with a random amount in the direction of your choice, I can see you are offsetting them in the direction of the $x$ axis (This is the equivalent of sampling a random vertex along your instanced paths), so lets do that:

The points we just computed act as the first vertex of each edge, the other vertex can be computed mathematically or just by using the Project Point On Line node, the line starts are defined as the position of the next point and the ends are defined as the position of the next point plus some value in $x$ just to define the direction. To the location of the points of the next points, we simply shift the vector list backward, by doing so, each point is aligned with the one following it. Then we create the edges from the points and their projection. The node tree is as follows:

And the result is as expected (The horizontal lines are just for visual aid, not part of the implementation and they are the lines you originally had in your file):

You may notice that there is an extra edge going from the last vertex to the x axis, this is due to the fact that after shifting, the first vector became aligned with the last, and this is just a normal consequent of doing so. To fix that, just remove the last vector and last edge from the output using the slice  or remove list element node.


dirty vertex color with the multiresolution I am making a candle with sculpting and I want some dirt on it so I am going to use dirty vertex color but I don't want to apply the multires modifier so is their any way to make dirty vertex color without applying the multires modifier

Not currently. I know of one person who has been on a campaign over this issue for a long time now.
I always have UV's built early so what I do is duplicate the object then move it to another layer.  Then I apply the modifier and bake the results to a texture.

Then I delete the duplicated object and apply the baked texture to the original model which still has the modifier.

Once you get used to doing this it can be usually be redone within a couple of minutes so you can redo it easily if you have updated the mesh and require a rebake.

Here are the relevant bake settings that I use.

BTW, even though there is a bake pass type called Vertex Colors, it does not produce the results that I expect.  For me it always bakes much darken than it should but maybe I'm doing something wrong.  The settings I showed here work well.


Rendering taking too long. Is there a way to improve it? I recently tried to render in Blender, but, it is taking the a ridiculously long time to render a frame. I've tried rendering on my windows laptop which has a NVIDIA GT 520M, 8GB of ram, and a 64-bit operating system and people told me that using the GPU won't accelerate rendering much. Instead I decided to render on my school computer. The school computer has a:
NVIDIA GeForce GTX 760 GPU
Integrated with 2GB GDDR5 memory, 256-bit memory interface

This took 20 mins a frame, I then thought my animation is 2000 frames long. 1 frame takes 20 mins, 20*2000 is 40000 mins. 40000 mins equals to 667 hours which equal to 30 days. I would never be able to hand up my assignment on time. I watched many tutorials on rendering and trying the tips that people gave me but it didn't improve the rendering time.

Here's my blender file:
(note, it is in CPU render instead of GPU render because I am currently working on it on my macbook air)

First screenshot of the render settings.

Second screenshot of the render settings.

There are several ways to speed up render times.

Enable auto tile addon to set tile size correctly.

User preferences => Addons => Enable Render: Auto Tile Size => Save Settings

By utilizing denoising you should be able to decrease render samples.
Scene tab => Check denoising box
Bake your materials. Its too complex to explain here, so check out this tutorial.


Multiple objects being edited in edit mode I've tried googling this but I don't even know how to word it. I'm fairly new to blender and i've just been using it to edit some models slightly. I've come across a problem on some of the model.

This model was taken from a .x3d file I've imported and wish to edit, whenever I select any of those cylinders and tab into edit mode, they all tab into edit mode. Anything I do to one, effects the others, and this is undesirable. Is there anyway I can stop this from happening?

Thanks a lot

Let me know if there is anything else you need me to add.

I think they have linked data, they share the same mesh and whatsoever you are doing to one applies to the others. So either press U and select Object & Data

or press the number that shows how many objects share the data (on the right in the red circle)


Why can't I "Copy a Data Path"? I'm sorry this question won't be very clear but i really can't understand why i can't "Copy Data Path".

I can't even select him although i corretly paste data before.

What could be wrong??

I'm going to say it is because it is a bad idea to copy the data path for the driver's expression.  (but only the last half is true, it's not the reason for the menu being non-functional).

You probably want to go through the UI for an element whose property you want to use in the driver (like maybe object location) and copy its data path and paste it into the property path of the driver.

I vaguely recall there are some places in the UI which actually do have a data path, but whose "copy data path" operation is not functional.  This is usually because it's a little too tricky for blender to keep track of it and you'll need the help of an experienced human to figure it out.

Nothing is more frustrating to a new blender python programmer than the "..." that appears in the mouseover readout of a field.


How to make 3d text values larger in 3d view? How do i make these values larger ?

The font size for the dimensions is the same size as the text in panels throughout Blender (ie, the fields in the right-hand properties panel in your screenshot. You can adjust the overall font size by adjusting the DPI setting in the System section of the User Preferences :

Note that adjusting the DPI will affect the whole Blender user interface, not just the labels in the 3d View.


Procedurally Generated Texture Scaling based on Surface Curve I've got a fairly simple character that I'm texturing procedurally, and my question is this:

Is there a way to tell the Voronoi texture base that I'm using to have variable scale based on how flat/curved the surface its applied to is?  IE, the scales on its belly would be larger than the scales on its arms because the belly has a flatter surface area than the arm tubes.

You can try using a grayscale image to set the factor of the scale of... heh, the scales. That's an incredibly esoteric thing to say, so here is my setup (please forgive my liberal use of "reroute" nodes, I wanted to fit it all in at a decent resolution);

Which results in this (with the "factor" texture that's used in the above node setup, but you can paint the values however you want);

I'm also including the .blend file;


How to disable see-through mesh I have a mesh wich currently looks like this on edit mode:

Even though I haven't activated the Z key to enter wireframe mode, I can see the edges behind the mesh. This is really annoying since I keep accidentally selecting the vertices at the back.

How can I disable this?

You need to check the "Limit Selection To Visible" button

in the toolbar in Edit mode. This will hide the back edges from view.


Can't animate the scale of objects changing I'm trying to make a sphere go from size 0.001 to 2.000 over a course of 20 frames. When I scale it in one frame however, it stays that way for all the other frames. I can rotate it, move it, but I cant scale it

When I press i it doesn't do anything except say on the top say "successfully added 3 keyframes for keying set 'LocRot'" but that doesn't help at all.

You need to insert keyframes for changes to values.

Go to frame one, scale the object to 0.001 and with the mouse cursor in the 3d view press I > Scale. Now all frames will have this value.
If you change to frame 20 and scale it to 200, you will notice the scale property being orange. Orange means that this value is different than the keyframed one and will be lost after changing frames.

Press I > Scale again to insert another keyframe for this value.


How to get to the pie menus? With the pie menus, new for blender 2.72, I'm now wondering how do I get to them? I have tried some of the different keyboard shortcuts mentioned for the pie menus.

For 2.72 you have to enable the pie menus in the user preferences. CtrlAltU or File -> User preferences then the Addons tab. Search for pie, enable the addon called User Interface: Pie Menus Offical.

After the pie menu addon is enabled the keyboard shortcuts such as Tab or Z will open a pie menu. Documentation about the pie menus on the blender wiki.


Is it possible to dump an Objects Properties and Methods? Due to the lack of a class diagramm I need to explore the data structures by dumping objects to see what is in there.

How can I dump the Objects internals to the console?

In this snippet I tried to print the objects but I only get error messages 'TypeError'

def assignPose( plIdx ):
    rig = bpy.data.objects.get("rig")

    if rig != None:
        print("rig=" + str(tuple( rig ))) # TypeError: 'Object' object is not iterable
        print( "" + rig.__str__ )         # TypeError: Can't convert 'method-wrapper' object to str implicitly
        pl = rig.pose_library
        pl.poselib_apply_pose( plIdx )
    else:
        print("couldn't find rig.")

I found a solution to get started:

def dump(obj):
   for attr in dir(obj):
       if hasattr( obj, attr ):
           print( "obj.%s = %s" % (attr, getattr(obj, attr)))

This is based on one of the methods suggested on this Stackoverflow post and this

Instead of invoking print call dump( anyobject )

This would print something like:

...
obj.copy = <bpy_func Object.copy()>
obj.cycles_visibility = <bpy_struct, CyclesVisibilitySettings("")>
obj.data = <bpy_struct, Armature("rig")>
obj.delta_location = <Vector (0.0000, 0.0000, 0.0000)>
obj.delta_rotation_euler = <Euler (x=0.0000, y=0.0000, z=0.0000), order='XYZ'>
obj.delta_rotation_quaternion = <Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0
000)>
obj.delta_scale = <Vector (1.0000, 1.0000, 1.0000)>
obj.dimensions = <Vector (0.0000, 0.0000, 0.0000)>
obj.draw_bounds_type = BOX
obj.draw_type = WIRE
obj.dupli_faces_scale = 1.0
...


Why is my animation render all white? I'm working on a gold logo with a transparent background to throw on some videos. I'm in Cycles Render and it's taken me a long time just to get the glossy logo to look shiny. My render is all white or shows the world background, not sure why. Could you guys point me in the right direction? Any tips on how I can just have a gold logo without the clouds keeping the background transparent / what's wrong with my render settings? Many thanks in advance.

Here's what my render view looks like:
https://gyazo.com/ee8cb329c6b13f05b4dd7ed893333626

Here's a photo of my actual render:
https://gyazo.com/27ced9312ddb08897976049aea39ec74

Here's a link to my Blender file packed with textures if someone could please take a look:
https://drive.google.com/file/d/1gV01wETy5eX__zMRxH3eayb62O2P6I_2/view?usp=sharing

Rich

I'm not sure if this is the answer you're looking for, but I did look at your file. With my limited knowledge (I'm a n00b myself), I will say that if you want to get rid of the clouds, you need to hide them so that they don't render. I tried it, and it seems to work (I did get a transparent background). Refer to this pic below:


How to get the missing library and its collection with Python? As my project folder structure and naming convention were reorganized, missing libraries and collections occurred.
To recover them collectively, I'm trying append into list the missing libraries and collections, but the API seems to have no properties related to missing.
Maybe I couldn't find it in the API?
Or is there any way to get them with other programming techniques?

Look at the library filepaths.
Iterate over the libraries, for any that do not exist in saved filepath, convert the filepath and reload.
import bpy
from pathlib import Path

for lib in bpy.data.libraries:
    p = Path(bpy.path.abspath(lib.filepath))
    if not p.exists():

        print("Missing:", lib.filepath)
        # convert filepath
        lib.filepath = "/some/converted/path"
        # with new valid path
        lib.reload()


Principled BSDF don't appear Well, you can see, in Shader, P BSDF don't appear, thanks.

You are editing a world shader, not a material.
World shaders don't really have a surface per-se so you obviously can't add surface based shaders like principled.
Change the shader context you are editing on the top left of the Shader Editor header from World to Object.


Riggifying. How to make the arms and fingers bend with the armature? I made up my model, added some bones to it, but I couldn't manage to make the arms and fingers bend properly. They bend like some spaghetti

Also the "Weight Paint" mode (I know it may seem wrong or completely not right)

It's hard to tell without the file.
here couple of points to consider:
Activate normalize in options
go through the vertex groups to verify that unrelated bones don't influence the given region. Ex. fingers on the upper arm.
If yes, then subtract it.
In case you didn't try watching - enter link description here
DanPro tutorials are brilliant and provide useful tips.
Remember also that the hand is a very complex mechanism, not only 3D, real hands are not intuitive organs, it's one of hardest parts of rigging.


Access a property in python from a menu I tried to answer a question on blenderartists from what I already know, and then it was pointed out to me that I should be able to use the property directly in the panel menu instead of creating the operator for it outside the menu like I did here:

import bpy

class AutoMergeBool(bpy.types.Operator):
    """Automerge Toggle"""
    bl_idname = "mesh.automerge_toggle"
    bl_label = "Automerge Toggle Operator"

    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        #main(context)
        merge = bpy.context.scene.tool_settings

        if merge.use_mesh_automerge != True:
            merge.use_mesh_automerge = True
        else:
            merge.use_mesh_automerge = False
        return {'FINISHED'}

class CustomMenu(bpy.types.Menu):
    bl_label = "Custom Menu"
    bl_idname = "view3D.custom_menu"

    def draw(self, context):

        self.layout.operator("mesh.automerge_toggle")
        self.layout.operator("mesh.primitive_cube_add")

def register():
    bpy.utils.register_class(CustomMenu)
    bpy.utils.register_class(AutoMergeBool)
    bpy.ops.wm.call_menu(name=CustomMenu.bl_idname)

def unregister():
    bpy.utils.unregister_class(CustomMenu)
    bpy.utils.unregister_class(AutoMergeBool)

if __name__ == "__main__":
    register()

Can anyone give me a single line example of how the property should be accessed in the layout so that it results in the bool? I already tried searching here and elsewhere and haven't found anything that works.

Instead of adding a layout.operator you would add a layout.prop, which would look like this:

self.layout.prop(context.scene.tool_settings, "use_mesh_automerge")

The first parameter in the parentheses is where the property is stored and the second is the name of the property you wish to access.

This results in this menu, with a property that can be toggled on and off:


UV map not showing up for new additions Alright So I'm working on something that already had a UV map and I'm adding onto it. I opened up the UV editor to see what I was working with and low and behold the UV map for the new additions are not there I worked on seams for the new addition but I really do not want to redo the seams for the whole object. What do I need to do to be able to open the additional object AND the old object in the UV editor should I make them separate objects or is there another way?

The safest is to create a new UV Map via the Data tab in the Properties window within the UV Maps section, and then prepare and unwrap your additional geometry.


How to change the arc of vertices? You can see how the vertices are right now, but the red line is what I am trying to achieve. How do do I do this?

Scale the vertices by -1.0 on, in this case, the Z axis. This should flip them as you wish.


Blender growing polygons I wanted to make an animation, on an modeled object, that it doesn't just appears like in the "build" modifier. Instead, the object should appear in small parts and grow fast. (So it builds together the model).

Is that possible ?

There are many ways you could achieve "build" effect. The simplest one that mimic the Build Modifier, but does not simply "pop" the polygon faces are of course by using Add-Ons like Animation Nodes.

You could probably use Blender's own Particles as well to kind of reveal each polygon face slowly one by one?

One idea, using Animation Nodes Add-Ons:
1) Install Animation Nodes (AN) Add Ons.
2) Study a little bit a bout AN. Get a hang of it.
3) One of the Template provided to transform individual polygons will be perfect. The idea here is instead of appearing like a sudden pop, you want to use some kind of transition. The most obvious is probably to animate scaling of each polygon.
4) With a little adjustment you can get a more elegant "reveal" of your 3D model, perhaps in this case is basically polygon by polygon, as they are scaling from Scale zero to one.

Remember the way it is being revealed is also important and there are limitless way you could do this from basics to more sophisticated effects.

Here is basic:


Adding objects in a different scene than controller's I have a number of scenes in my game; main, overlay, and underlay. I am currently attempting to use scene.addObject() to add an object in the underlay scene.

Both the argument objects, the object to be added, and the object to be used as position reference, are located in the main scene, along with the controller object which is running my python module.

What I have tried:

I have attempted calling [underlay].addObject() which does not work.
It tells me that the blender objects are not in an inactive layer.

    empty = self.scene.addObject('Empty', 'Origin')
ValueError: scene.addObject(object, other, time): KX_Scene (first argument): object must be in an inactive layer

the output of calling scene.objectsInactive on the main scene immediatly before calling addObject is

[Empty, Origin, Placeholder, Lamp, Camera, PHolderCam, Lamp, Camera, StarSphere1]

likewise for the underlay scene it is

[]

I have also tried locating one and both of the objects to be added in an inactive layer of the underlay scene, however this gives me a different error;

ValueError: scene.addObject(object, other, time): KX_Scene (first argument), requested name "pri_underlayEmpty" did not match any KX_GameObject in this scene

I am looking for either a solution to this problem or alternate means to be able to add objects into that other scene, from the controller in main. Help is appreciated, thanks in advance to any answerers.

You can't duplicate objects that are not present within the scene you want to have them in.

If they are not present already you might load them into the scene via LibLoad. I suggest to do that only when you need dynamic loading.

The easier way is to link the object (or mesh) from the original scene to the other scene. This means when you edit the object in either scene both objects get updated. Be aware: they are only linked in Blender not in the BGE. in the BGE they are two different objects.


How to accurately simulate an anamorphic lens I am aware of the aperture ratio slider in the camera properties. However, I am wondering if there is a way to actually render squished in Blender, and stretch it out in the compositor later. I honestly don't fully understand anamorphic lenses, so I might be asking the wrong question.

There is a way to anamorphize the rendered image by controling the aspect ratio values

The values depend on the proportions of the container.

For a 1.33 image the anamorphic pixel ratio should be 2:1 meaning that the image should be squeezed 2 times horizontally (X axis)

The unsqueezed image would have a format of 2.35:1

For a 16X9 image the anamorphic pixel ratio should be 1.33


UV Maps not preserved after Boolean Modifier I have multiple objects I need to boolean together, but when I apply the modifier, the UV maps get messed up in a very odd manner. It is actually visible before the modifier is applied.

Two Objects:

Before Application:

UV Map afterwards:

I can't for the life of me figure out what the problem is. I checked the face normals, made sure the meshes were manifold and applied all materials to the objects in multiple configurations.

take a look at this , I have had the same problem : Using Boolean Wraps texture awkwardly

they answered by saying i have to use the "Knife tool" Or knife project . The boolean should heavily be avoided , especially when you have already textured your mesh because it adds un necessary edges , doubles and vertices .


Can Animation Nodes extract data from dupli-instances? By dupli-instances I mean dupli(verts/faces/particles/frames). I was thinking that once vertex snapping is working with duplies in 3d viewport, then you can somehow extract vertex location and poly's in Animation Nodes, like from normal mesh.

Is it possible or not?

I don't think the API provides such access. However, it is very easy to generate this information yourself based on the data already given by blender. For instance, vertex dupli-instances data can be generated as follows:

Similarly, we can do that for polygons, edges, particles, and frames.


Particle Instance Modifier - Options to Offset missing in V2.83 In Blender 2.83 I cannot find the Options in the Particle Instance Modifier that include 'Amount' and 'Offset'. They are shown under the World properties in previous versions.
I need this control to avoid overlapping of systems in vertex groups.

These settings are available in the modifier panel in my build.


Texture Painting Uv map is gone My problem is about uv mapping. My model has multi parts. I unwrap my model parts then i create uv map image for every single part. In texture painting mode i painted every uv map image but after paint 3 images first and second is gone.
I clicked first image and it's just show black color not other colors that i painted. I solved this by save as image but i have to do for all uv map images Is there a other way to do this ?

As far as I know, you will have to save these manually every time. Blender will discard everything not used, and not saved. Therefore you will have to save the texture, for it not to vanish.

OR you can pack the image into the blend file.

See this post regarding the same subject:

Why did the texture I painted in texture paint mode disappear?


Mandelbulb using Animation nodes Lately i've been reading a lot about fractals, mandelbrot set and the mandelbulb.

I am able to recreate the mandelbulb in Blender using a volumetric material (similar to the solutions discussed here, without using an add-on: Recreating Mandelbulbs with math nodes).
But as I wasn't really satisfied with the possibilities there I tried to replicate in in Animation nodes to maybe get a particle-system-like look (I don't really know where I was going tbh).

The formulas used in pseudocode:

r = sqrt(x*x + y*y + z*z )
theta = atan2(sqrt(x*x + y*y) , z)
phi = atan2(y,x)

newx = r^n * sin(theta*n) * cos(phi*n)
newy = r^n * sin(theta*n) * sin(phi*n)
newz = r^n * cos(theta*n)

The way I understood the whole thing was, I have starting Coordinate (P1), and for every iteration I get a new Coordinate (Pn).
So this is my node tree and the result (not really what I was going for):

I think my formulas are correct – I don't think I really understood the whole concept though. Is this even possible to do? Any hints?

I experimented with Mandelbulb in Animation Nodes before, so yes, it is possible. However, I had to write a lot of custom code to the point that the node tree was composed entirely of nodes that don't exist in the official version of Animation Nodes. Creating what you want in the official build is extremely hard if not impossible. I shall not attempt to answer your question, but I will give you an idea about what we need.

A very quick explanation, will edit later when I have the time.

The Cycles implementation classified every point in space to either belong to the Mandelbulb set or not, the density of the volume at the points that belong to the set was initialized to a very high value, while the points that didn't belong were initialized to a zero density. The very high density rendered the set almost diffuse, that's why you can see it.

In Animation Nodes, we could similarly compute whether a point belong to the set exactly like the Cycles implementation, but what next? what are you going to do with this information? One thing you could try is for each point in a 3D grid, place an object if the point belongs to the set, this will roughly visualize the the set depending on the resolution of your grid. But if you want to create a mesh from it, we have to use something called Implicit Polygonization, the most commonly used and simplest technique is called Marching Cubes(MS). MS can polygonize binary fields(Either belong to the set or not), but for better smoother results, one has to compute a Signed Distance Field(SDF) which is somewhat hard to compute from the set (Basically you will be computing the distance between every point in space and the closest boundary of the set). But then you will need to store and compute that field somehow, Animation Nodes only support linear lists/Arrays, we will need 3D arrays, which is something we can do in Python using Numpy, a workaround would be to use Linear Indexing, but it will be less convenient.

Here are some resources to help you implement this. A full description of the problem and solution can be found in this article by Inigo Quilez. The only difference is, you will be polygonizing the SDF and not rendering it using Ray Marching. You can learn how to implement Marching Cubes from this article by Paul Bourke. Finally, you can store and compute the field using numpy, a good starting point is the meshgrid function, you can work your way through the documentation from there.


How do I make Front Ortho the Active Camera? How can I render my scene so that the camera is in the same spot as the front orthographic viewport? The Front Orthographic view is exactly how I want it rendered, not by pressing NumPad 0.

Go to the front view by pressing NumPad 1. Then press Ctrl+Alt+NumPad 0 to set the camera to the current view. Then switch the camera from perspective to orthographic.

Unlike with a perspective camera, the local Z location of an orthographic camera is irrelevant. To render more or less of your scene, you must change the orthographic scale.


Multiple materials on a specific shape? Using cycles, how would I go about making text that is UV mapped onto a surface (in this case a book cover) have a gloss while the remaining part of the image stays matte? The text needs a kind of foil finish with the white being matte paper. Can the mesh be selected with the image, or is there a better way?

Here's the image in question.

Use your image to control the mix between a glossy and a diffuse shader:


png loses alpha on gltf export I was trying out the gltf + bin + texture export feature on blender 2.8.

and the model i was exporting had a png eye texture with a transparent background.

with a Principled BSDF shader like this, which worked fine.

but when I exported the model to gltf then reimported it,

the png texture file turned to this:

and the nodes like this:

the alpha line disconnected

so, I was wondering if the gltf format doesn't support transparent textures,
or is there something wrong with what I did?

Sorry, this is a known bug, a regression.  Issue #425 details it, and a fix is in the works in #506.  Sometime in the next few days it should start working again, after that PR gets merged.

Also, even after the missing alpha channel gets fixed, you'll still have to specifically enable blending mode per-material.  This is done in the "Settings" panel of an Eevee material, "Blend Mode" should be set to "Alpha Blend".


Is it possible to have a variable increase using the game logic editor? For a game I'm making, I need the speed an object moves increase until it reaches a set amount. If this can be achieved just by using the logic editor that would be brilliant but I know a bit of the Python bge so that would be fine.
Also just out of interest, is it possible to do this on, for example, the camera's orthographic scale (or other properties)?

Also, I might have explained this badly, so let me rephrase: when the game is started, I want an object to gradually speed up until it reaches a certain speed. At this point, I want the object to keep moving at the same speed.

Thanks! :)

You might be happy by looking at the Physics tab/Physics panel.

There are two Velocity parameters: Minimum and Maximum. You can set the maximum and apply any force you like = speed is capped. It caps any speed of that object.

(Do not ask me why there is a minimum.)

The downside is, this counts for all motions.


How to use the Principled BSDF shader to create an old-paper-like material? I'm trying to figure out how to make an old paper material in Cycles with the Principled shader.
Something along the lines of the following image, a bit yellowed out and rough, but still whole

This paper, in my render, will also have some text I'll overlay on it, as it is written on it.

I did see a few people also asking around for this, but the only material I found for it was not Principled BSDF (as it was made before it was added) and it doesn't fit the rest of my scene because of it.

Thanks for your reading.

Here is what I got for you

For the color, I added a noise texture with a color ramp, the right side being a white-ish yellow, the centre-left being a darker yellow. On the very left, I had a dark orange, but this isn't that important. I then plugged the color ramp into the base color of the BSDF Shader.

If you want to add displacement, I used a Mix RGB node to mix a Noise Texture and a Musgrave Texture. I changed the fac of the Mix RGB so it is mostly the Musgrave Texture. When you connect the Mix RGB node to a displacement node, you will want to turn the strength down a lot. I changed the strength to about 0.05 in my example.

That should make a decent old paper texture using the Principled BSDF shader.

I hope I helped.


there is no image in texture paint blender 2.82 In blender 2.82 what I expected was there should be an image in the viewport so that I can paint, chosing part of image as I wanted, but I can't do that because there's no image showing.

Is there any hotkey or UI to show image on viewport?

For this, you need to load a texture in the texture subpanel of the Bursh settings panel, and set its mapping to Stencil:


How to edit "skin" instead of edit bones? I am new to Blender. I downloaded a blender file with 2 rigged arms. I want to edit the shape of the arms, but when I press A or right click to select, I can only select the bones instead of the "skin" of the model. So what can I do?

This could possibly be because their selection has been limited in the outliner. To make sure this isn't the case, check and see if all of the pointer icons in the outliner are white, and not grey. Click them to change if they are.

This could also be if you are in the wrong mode. Armatures have three modes;

 Object mode is portrayed by an orange cube, it allows you to change which object you can select
 Edit mode is portrayed by a grey cube with four orange studs on its front (I suspect this is the one you're in) it only allows you to change the shape of the bones in your armature
 Pose mode is portrayed by a small white man waving his hands around like he's trying to slow down a Taxi, it allows you to wiggle the bones around once they have been shaped right in edit mode.

You need to switch to object mode in order to select the mesh "skin" of your object.


bpy: how do I list the "pivot center for rotation/scaling" items? I'm new to blender and python.
I would like to create a pie menu that lists the "pivot center for rotation/scaling" items (active element, median point, 3d cursor, ...).

I found the very useful "Ui Pie Menu" python template in the text editor, but I don't know what to replace the "pie.operator_enum"'s function arguments with, here is the template code:

import bpy
from bpy.types import Menu

# spawn an edit mode selection pie (run while object is in edit mode to get a valid output)

class VIEW3D_PIE_template(Menu):
    # label is displayed at the center of the pie menu.
    bl_label = "Select Mode"

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

        pie = layout.menu_pie()
        # operator_enum will just spread all available options
        # for the type enum of the operator on the pie
        pie.operator_enum("mesh.select_mode", "type")

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

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

if __name__ == "__main__":
    register()

    bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")

I know that I need to replace this line:

pie.operator_enum("mesh.select_mode", "type")

But what with?

I tried this without luck:

pie.operator_enum("bpy.context.space_data.pivot_point")

but it didn't work.

Window manager context operators

Just as there is a window manager operator to call a pie menu, there is also a cluster of bpy.ops.wm.context_blah(...) operators, including

bpy.ops.context_pie_enum(data_path="")

which  expands the enum property elements in a pie menu.  The data_path parameter is the path from context. In this example  context.space_data.pivot_point the RNA string path from context is "space_data.pivot_point"

Test script, needs the context of a VIEW3D space. For convenience I prepended a button to the VIEW3D header.

import bpy

def piebut(self, context):
    layout = self.layout
    op = layout.operator("wm.context_pie_enum")
    op.data_path = "space_data.pivot_point"

def register():
    bpy.types.VIEW3D_HT_header.prepend(piebut)

def unregister():
    bpy.types.VIEW3D_HT_header.remove(piebut)

if __name__ == "__main__":
    register()


Check for user interaction in the workspace I'm trying to make what I think is a basic script in Blender 2.9.1; however, for this to work I need to check if the user performs any form of interaction in the current workspace (essentially if they're idle or not). How can I go about performing this check? I've looked through the API documentation, but I haven't been able to find anything that does this. The only real approach to this I can think of would be to go through all operators and add a check to see if they're performed perhaps.
If someone could point me in the right direction, I would really appreciate it!

For your special case I would use a mix out of modal operator and the depsgraph_update handler.
The modal operator doesn't run when the other operators run. E.g. move operator.
Then the depsgraph_update handler run, because the user make important changes to the scene. So if one of them runs the user interact with blender.
Some cases that are not caught: moving nodes, moving the frame slider (only found these 2)
For these case you maybe could use an event to check if the mouse was pressed and then released or if a key was pressed which starts the moving.


Suddenly can not move bones after making some shape key Yeah the headline says it all. I cant find the solution myself :(
I made some shape key for the hand and couldnt move finger bones after that. The hip bones couldnt move too.

Here's blend file
http://www.mediafire.com/file/19qp6k39f10dx68/Judy.blend

I can't open your blend in my release, but if you created the shape by applying the armature as a shape key, then you just need to add another armature modifier to your mesh and select it in the resulting Object field. If that's the issue then don't forget to select all bones in pose mode and ALT+r then ALT+g to reset the pose to default.


3ds max's dot ring in blender? Ok so I've pretty much done the move from 3ds max to blender as my everyday software, but there's a useful feature that's in max that I can't find in blender. It's the dot ring selection mode.
In the 3ds max modeling ribbon you can use dot ring to select a ring with gaps in it.

It's a useful feature if, for whatever reason, you had to collapse a subdivision surface modifier, and you wanted to decimate it by hand while keeping the flow of the topology intact since you can select entire loops with a gap of 1 between them then delete.
The dot ring selection in action:

Then delete selection.

Is there a similar feature in Blender ? If not can I request it ?
Thanks.

I think the closest thing to this in blender is checker deselect. If that does not do what you want, yes, you can request such a feature. I do not know where to request features for blender, though.


My render is black and all of the fixes I have seen do not work I am following Blender Guru's donut tutorial on Youtube, and it was working fine until I started doing the coffee. Now, whenever I go into the render viewport the screen is completely black. Whenever I hide the donut and only render the coffee it works fine. What is the problem? None of the fixes I have found have worked.

It's not the donut - it's the material you are using. Whenever I choose other material the scene renders just fine, but with material nomber 3 and 6 everything goes black.
It has to do something with the nodes you are using because when "Use nodes" is checked - it's black and when it's not checked it's normal.

My advice is not to use these materials - make a new one. You can even make the same nodes but don't capy and paste them - folow Andrew's tutorial.


How do I set this property? So I'm working on a simple game and I want to control an object to go upwards with a certain amount of force. I then want to be able to press shift and set the standard value used for the amount of force to a different number.

import bge

def main():
cont = bge.logic.getCurrentController()
obj = cont.owner
speed = 8.3

#Input
keyboard = bge.logic.keyboard

shift = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.LEFTSHIFTKEY]
up = bge.logic.KX_INPUT_ACTIVE == keyboard.events[bge.events.UPARROWKEY)

if up:
    obj.applyForce((0, 0, speed), True)
if shift:
    #set the 'speed' value to 12.0

What do I need to write doown here!?
So the speed was 8.3. After pressing the shift key it should change to 12, but how?

can someone help me with this?
thanks!

Current behavior
Just now you have one operation:

apply an impulse (a force with the duration of one frame)

As you apply this impulse at subsequent frames again and again you get a constant force.
Be aware the value you describe as "speed" is no speed at all. It is the z-component of the force/impulse.
Request
You want changeable z-component of the force. This means you need new operations that change this strength.
Solutions
Additional forces
As you can add forces, you can simply add another force when shift is pressed.
if up:
    obj.applyForce((0, 0, zStrength), True)
    if shift:
        obj.applyForce((0, 0, additonalShiftZStrength), True)

Replace force
You calculate a different force to be applied:
if up and not shift:
    obj.applyForce((0, 0, zStrength), True)
if up and shift:
    obj.applyForce((0, 0, shiftZStrength), True)

Toggle

With this code I have to hold shift to change speed. But I want to change the speed at one click so that it will keep using the new speed when I press my uparrowkey.

In this case I suggest a different design at the higher abstraction level.
Lets see:

you want to use up to move forward
you want to use shift to switch to turbo strength
you want to use shift to switch to normal strength

State machine
I suggest to use states:

normal
turbo

Hint: Think about what a key press really means -> what is the purpose of the key press. The design will be determined by the purpose rather than the key. Therefore I will not talk about up and shift anymore but "move" and "toggle turbo". The easiest way to think about that is: how would you explain to a player what the keyboard key is used for.
You transit between the states this way:

when in normal state and "toggle turbo" is requested -> transit to turbo

when in turbo state and "toggle turbo" is requested -> transit to normal

This is our high-level behavior. You can switch state by requesting "toggle turbo" (pressing shift once).
Now the low-level behavior. With the two states we have two different low level behaviors:

when in normal state:
**when requesting to "move" -> move with normal strength

when in turbo state:
**when requesting to "move" -> move with turbo strength

The details are quite similar. The difference is the strength.
There are several options to implement a state machine. They mostly differ where to hold the state.
Build In states
Transitions:

And then add Actions:

Please note the [Level] switch is enabled. This ensures the sensor triggers the controller on state change and therefore activates the actuator without the need to release and press the button again.

The actuators are labeled: "normal move" and "turbo move"
Property
You store the mode in a property as you have just two of them you can use a boolean property.

To toggle the value you can use property actuators:

Then perform the according operations dependent on input and property value:

Dynamic strength
This more flexible than a state machine as you are not limited to a low number of states. But this solution is not that flexible in terms of difference between normal and turbo mode. The differences you can have is the force you apply.
The idea is that you use the current strength as "state".

When you request "toggle state" and the current strength is high -> reduce the strength.
When you request "toggle state" and the current strength is low -> raise the strength.

These are still two operations:

toggle strength -> which needs Python due to it's dynamic nature

move -> which can be Logic bricks or Python

Both operations rely close together do to the shared strength.
The implementations differ in the way where you store the strength.
Motion actuator as storage
You can benefit from the fact that the motion actuator can store parameters. You simply re-configure the actuator when toggling turbo.
toggle_strength.py
import bge

controller = bge.logic.getCurrentController()

STRENGTH_NORMAL = 1
STRENGTH_TURBO = 10

if controller.sensors[0].positive:
    motionActuator = controller.actuators["move"]
    force = motionActuator.force
    strength = force[2]

    newStrength = STRENGTH_TURBO if strength < STRENGTH_TURBO else STRENGTH_NORMAL
    force[2] = newStrength
    motionActuator.force = force

Property as storage
A pure python solution requires you to store the current strength somewhere else. A good place would be the object itself -> means a property.
toggle_strength.py
import bge

controller = bge.logic.getCurrentController()

INTERNAL_PROPERTY_STRENGTH = "internal.strength"

STRENGTH_NORMAL = 1
STRENGTH_TURBO = 10

if controller.sensors[0].positive:
    owner = controller.owner
    strength = owner.get(INTERNAL_PROPERTY_STRENGTH, STRENGTH_NORMAL)

    newStrength = STRENGTH_TURBO if strength < STRENGTH_TURBO else STRENGTH_NORMAL
    owner[INTERNAL_PROPERTY_STRENGTH] = newStrength

move.py
import bge

controller = bge.logic.getCurrentController()

INTERNAL_PROPERTY_STRENGTH = "internal.strength"

STRENGTH_NORMAL = -1

if controller.sensors[0].positive:
    owner = controller.owner
    strength = owner.get(INTERNAL_PROPERTY_STRENGTH, STRENGTH_NORMAL)
    force = [0.0, 0.0, strength]

    owner.applyForce(force, True)

The "move" sensor requires [True Level Triggering] enables otherwise there will be just a single impulse rather than a constant force when the key is pressed.

Hint
Better avoid "main()". It serves no purpose other than to make your code hard to read.
If you really want to place your code into a function choose a descriptive name that tells what the function is supposed to do.
When this is the only function in your script the script name should already provide this information. This should not prevent you to provide more details with the function name.
The name "main" is a reserved word in other programming languages for complete different purpose. It can easily create confusion when used here.
Btw. in your sample code above it cause errors.


How do texture coordinates work? How exactly to texture coordinates work?  I know they are represented by vectors, but how does a vector store texture mapping information?  How does each type of texture coordinates work and what are their respective advantages and disadvantages?

First, a little explanation of how texturing works.

The process of applying a texture to a mesh is called UVW mapping.  The result of UVW mapping an object is a set of UVW coordinates that define what parts of the texture go where on the mesh.

A texture can be thought of as a three-dimensional space with each point assigned a color.  A two-dimensional image texture can be thought of as a “solid” three-dimensional texture where the color is the same regardless of the Z position we are looking.  Looking straight at an image texture, the bottom left corner is (0, 0, 0) and the top right corner is (1, 1, 0).

The way mapping works is every point on the mesh is assigned a three dimensional UVW coordinate (for some reason the letters U, V, and W are used instead of X, Y, and Z in texturing).  This coordinate defines where in the texture blender should look to find the color for that point.

You may be wondering why we need a third (W) dimension for texturing.  This is probably because you are used to thinking of image textures (which are two-dimensional).  When you are using an image texture, it is true, the third dimension is basically ignored.  But, there is another type of texture: a procedural texture.  Procedural textures (such as noise, Voronoi, magic, etc.) are generated based on some kind of a computer algorithm or formula which need not be restricted to two-dimensions.

Now a look at the main types of texturing.

I will look at four different types of texture coordinates here: generated, unwrapped, camera, and window.  There are many other types, but these are generally the most useful, especially the first two.

Generated texture coordinates:
Generated coordinates are based on the bounding box of the object.  The bottom, left, front corner of the bounding box is assigned the coordinates (0, 0, 0) and the top, right, back corner of the bounding box is assigned the coordinates (1, 1, 1).  The UVW coordinates of each point on the object's surface are simply their coordinates in the bounding box.  Generated coordinates are most often used for procedural textures.

Unwrapped texture coordinates:
The most common and versatile way of UV mapping an object is by UV unwrapping it.  This is done by cutting up the mesh of the object with seams along the edges.  The cut out pieces of the object (called islands) are then flattened out (the flattened out version of the object is called a pelt or a UV map) and further adjusted to fix distortions.  This is typically done just for two-dimensional textures as the W (Z depth) coordinate of all points will always be 0 since you are flattening the object out.

Camera texture coordinates:
Camera texture coordinates are based on the object's position relative to the camera.  The origin of this coordinate system is the location of the camera and the U, V, and W axes are parallel to the camera's local X, Y, and Z axes.  This is typically used for lining up the texture with the camera-plane; i.e. the texture will be “squared” with the camera's view.

Window texture coordinates:
Window texture coordinates produce a similar (but not identical) result to camera coordinates, but in a different way.  Window coordinates are based on the viewing window.  They, like unwrapped coordinates, produce no W coordinates (W is always 0).  The U and V coordinates of a point on the surface of the mesh are equal to the coordinates of that point on the view screen/window.  With the bottom left corner of the screen being (0, 0) and the top right being (1, 1).  The main distinctions from camera coordinates is that window coordinates are always 0 in the W direction, and are stretched based on the aspect ratio of the final render (since the top right corner is always 1, 1).


I am trying to create a Script that does a Smart UV unwrap of seperate connected parts of a mesh This is what I got so far. Note that I have a counter which I check with 10 while I'm testing, so it doesn't pass through everything, since it takes quite a while.

The reason for doing this is that if I select all and smart unwrap, I get a sub optimal result compared to the result I get when selecting each connected part and smart unwrap those parts separately, and then finally at the end, re-pack everything.

I am using this for light UV maps in UE4

Question 1) Seems the select-linked part doesn't work. What am I missing?

Question 2) Seems nothing gets unwrapped (is probably related to Q1)

def getNextVisibleVertex():
    bpy.ops.object.mode_set(mode="EDIT")
    bpy.ops.mesh.select_all(action="DESELECT")
    bpy.context.tool_settings.mesh_select_mode = (True , False , False)
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)

    if hasattr(mesh.verts, "ensure_lookup_table"):
        mesh.verts.ensure_lookup_table()

    for vert in mesh.verts:
        if (not vert.hide):
            vert.select = True

            # Select linked
            bm = bmesh.from_edit_mesh(bpy.context.object.data)
            for e in vert.link_edges:
                e.select = True
            return True
    return False

def execute(self, context):
    obj = context.object
    data = obj.data
    i = 0

    found = getNextVisibleVertex()

    while (found and i < 10):
        bpy.ops.uv.smart_project()
        bpy.data.objects[name].select = False
        # Hide selection so we don't pickup same 1st vertex next time
        bpy.ops.mesh.hide(unselected = False)
        i = i + 1

        found = getNextVisibleVertex()

    return {'FINISHED'}

I finally got something that works, it's slow as molasses, but works.

    def execute(self, context):     # execute() is called by blender when running the operator

        while (hasMoreVerts()):
            bpy.ops.uv.smart_project()
            bpy.ops.mesh.hide(unselected = False)
            bpy.ops.object.mode_set( mode = 'OBJECT' )

        return {'FINISHED'}         # this lets blender know that the operator finished successfully

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

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

if __name__ == "__main__":
    register()

def hasMoreVerts():
    bpy.ops.object.mode_set(mode="EDIT")
    bpy.ops.mesh.select_all(action="DESELECT")
    bpy.context.tool_settings.mesh_select_mode = (True , False , False)
    mesh=bmesh.from_edit_mesh(bpy.context.object.data)

    if hasattr(mesh.verts, "ensure_lookup_table"):
        mesh.verts.ensure_lookup_table()

    for vert in mesh.verts:
        if (not vert.hide):
            vert.select = True
            bpy.ops.mesh.select_linked()
            return True

    return false


Laptop requirements for Blender I have recently downloaded Blender. But because my laptop is old i'm thinking of buying this HP Laptop (Pavilion 17-e100sv) with these characteristics:

Intel Core i3-3110M Processor-2.40 GHz
RAM: 4 GB - DDR3 SDRAM
500 GB - Serial ATA - 5400 rpm
2GB AMD Radeon HD 8670M graphics card.

Can you please tell me if these technical characteristics are enough for Blender?
If not, what do you recommend in terms of RAM, etc?

Please help out, since I will only buy a new laptop for Blender and I don't want to pay for something and then realize that it will not perform when i render an animation.

Thanks a lot!

Blender should run okay on old hardware for some tinkering. I would only worry about buying a new computer if you experience performance issues with more complex models and rendering (especially Cycles). If you really need a lot of horse power, go for a desktop machine, laptop performance isn't ever great.

See the general specifications:
http://www.blender.org/download/requirements/

Dedicated Nvidia cards are recommended (CUDA support!), you should avoid ATI/AMD from what I've read (buggy OpenCL support etc.).


why Booleans slow my computer more than expected Hi, I'm on a 3.2Ghz 6core AMD processor, 16Gb Ram, GTX 1050Ti vid card.
Blender 2.91, via Steam ( so auto updates)
usually works fine, so I'm suspicious of how i'm working.
The mesh was a curve, converted to mesh, cleaned of excess Verts and extruded.
The cylinders (holes 6mm/8mm/10mm) are the default 32 sided, I've changed the dimensions and applied transforms.
Difference boolean calls on the 'Holes colection' which has the cylinders in it.
a couple of arrays spread out the cylinders/holes which display as wire.
it.. chuggs.. soo... slow..
is 32 sides on the cylinders considered excessive?
should I get rid of the arrays and make instances of the cylinders?
have i missed something obvious?

Blender 2.91 comes with a new "exact" solver for Booleans. The old one is still around but by default EXACT it enabled.
There's the option "fast" in the Boolean Modifier (this enables the old algorithm/solver). If you click it you get way better performance but a less accurate boolean operation.


Simulating rounded edges on a mesh I'm looking to create the illusion of rounded or beveled edges without actually adding new geometry as a batch process for multiple types of meshes, from something as simple as a cube to very complex. Mental Ray within Maya solves this with mia_roundcorners attached to the bump node of a mia_material_x shader.

I recommend using a Normal Map to simulate the effect of a bevel. It doesn't add any mesh either (yes, even modifiers add mesh, except they are not directly applied to the object in Edit Mode). I wrote a tutorial on my blog for it.
http://renderedsmoothie.wordpress.com/2014/05/31/fake-bevels-using-normal-maps-blender-cycles/
(But here's the full post in a quote ;) )

First, we have a basic Cube. We need to UV-unwrap it. Press the U key, and click Smart UV Project to quickly unwrap this model. Next, duplicate your model and go to Edit Mode. Bevel that model by clicking Ctrl+B. (You can use the scroll wheel to adjust the quality of the bevel, and move your mouse to adjust the size of the bevel).

When you go back to Object Mode, you will notice that your cubes are overlapping. That’s great! Except that the beveled cube needs to be slightly larger.

Scale the beveled cube up just a small but so that you can not see the cube underneath.

Next, select your non-beveled cube and go to Edit Mode. Visit the UV/Image Editor window and create a new image. It can be whatever size you want. After you have your image created, go back to Object Mode on the cube, and follow these directions very carefully:

Select the Beveled Cube FIRST
(Go into Wireframe view mode for this one) Select the non-beveled cube SECOND.
Go into Edit Mode (Should be on the non-beveled cube)

You need to make sure you are in Blender Render Engine for this step. This is where we bake the Normals. In the Properties Window, find the Bake header. Change the Bake Type to Normals, set the Normal Type to Tangent, and check Selected to Active. Make sure you have your New Image in the Image Editor Window before baking. Then click Bake.

Shortly, you will see a Normal Map pop up on the Image Editor screen! Go ahead and Save the image so you don’t loose it from Blender’s Cache. Move the Beveled cube to another layer (by pressing the M-Key in the 3D Viewport) or Delete it. Next, switch back to Cycles Render. Cycles uses a special Node for Normal Maps. It’s called the Normal Map Node. Anyway, add that node to your node setup and plug it into the Normal plug of any shader. In the photo below, I have made a basic glossy and diffuse material setup using my “Bump-map-Normal-map”.


How can I query the panels in the Tool Shelf from a script? I would like to query the panels in the Tool Shelf, regardless of the context. Also I would like to query the tools that are in a certain panel. The idea is that my script can check if a certain panel is already there (preferably by matching the bl_label) and add certain functions to the panel if they don't already exist.

If you wanna check the appended (or prepended) draw functions of another addons, added to built-in panels, you can do for example:

draw_method = bpy.types.OBJECT_OT_relations.draw
if hasattr(draw_method, "_draw_funcs"):
    print(draw_method._draw_funcs)

As soon as a custom draw function is added, _draw_funcs will be defined and contain a list of draw functions. They are stored in a list, which means you can pop/remove/insert/append/prepend or shuffle the entries.

A really advanced possibility is to intercept all draw calls, but beware! Only a single addon may do this at a time, or you'll run into errors.

http://wiki.blender.org/index.php/User:Ideasman42/Blender_UI_Shenanigans


Problem with bone animation with 3D cursor as pivot EDIT: I solved it by simply making smaller rotation increments with more keyframes. Would still be interesting to know the cause and if there's a better solution though.

So I'm trying to simply animate the rotation of a bone using the 3D cursor as a pivot. When I rotate it myself it works fine this way:

However when I animate it, the rotation ends up looking like this instead:

What's the cause of this and how can I fix it?

This is the way animation work when you add a keyframe you store the variables values (loc, Rot, Scale) at that time, and when you play the animation blender try to interpolate ( guess ) the values of the variable (between keyframes ) depending on the last and next value and the type of interpolation used (this can be seen in the F-curve )

so whatever happens between keyframes is lost and new value will be calculated

in this case of the bone

the location of the bone is the location of its head
the bone will rotate around its head

in this example i keyframed the first and last states only :

the result motion :

the bone will follow straight path from the first pose to the last (blender can't  regenerate the original motion from those two states only) while rotating around its head

To prevent this you can :

add more intermediate keyframes.
or use an empty as a parent at the center of rotation.
or use curve as guide for the motion


exported fbx with multiple textures has only one I created an object with multiple textures. It looks fine in "Viewport-Shading - Texture". When it's in "Material" mode it fully has only the first texture. It also happens when rendering. When I export it as fbx and import it to unity it also has only that oe texture. Why can it happen?

You have to assign every material to its part and not only unwrap it with the textures.


BGE problem with speech bubbles I am trying to use speech bubbles in BGE. I have them in another layer and I want them to appear in a specific position above a character. I used a near sensor so every time you go near that character they appear. The problem is that they appear in the center of my character and rotated in the wrong way. I don't know how to change their position so that they would appear where I want them to.

To get the object to appear above the character, the simplest way is to just move the speech bubble mesh above the origin in edit mode.

To rotate the speech bubble, use the Track To Actuator to make sure the object is always facing the camera.

Or, even easier,

Under material settings, set the speech bubble to 'billboard', this way, it will always point at the camera automatically. You'll need to make sure the normal of the mesh is pointing at the +X axis of the world for it to appear correctly.


Given location(x,y,z), check if object exists at that position As the title says, I want to be able to check a location for the existence of an object. I'm randomly filling a space with objects and want to make sure I'm not placing an object somewhere that is already occupied. Current code is:

for x in range(1000):
    loc = np.random.randint(-100, 100, 3)
    bpy.ops.mesh.primitive_cube_add(size=2, view_align=False, enter_editmode=False, location=(loc[0],loc[1],loc[2]))
    bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)

I'd like to add something like,

if NOT location(loc[0],loc[1],loc[2]):
    add object...

Existing questions seem to be about getting location of known objects. I need the reverse of that - getting an object (or not) at a known location.

If purely creating the random objects...

Here is a test script that places 100 cubes  in scene with integer location components x, y, z selected randomly from range [-10, 10]

Each random location could be added to a list or set when assigned and its contents checked x in [0, 1, 2] Instead I've chosen to use  defaultdict(list), which behaves like a dictionary that returns an empty list() if there is no value for that key.   An empty list is Boolean False ie there is no object in that location..

>>> dd = defaultdict(list)
>>> dd["missing"]
[]

The tuple (x, y, z) is used as a key.    If the key is taken, choose another random number combo, otherwise append to the list of that key marking as taken,  until all cubes placed.

import bpy
import numpy as np
from collections import defaultdict

ncubes = 100
locations = defaultdict(list)
i = 0
while i < ncubes:
    loc = tuple(np.random.randint(-10, 10, 3))
    if locations[loc]:
        continue

    locations[loc].append(i)
    bpy.ops.mesh.primitive_cube_add(location=loc)
    i += 1

Without checking against already existing objects in a scene this is pretty much purely a python problem. A good place to find answers to python questions is https://stackoverflow.com


How do I save an edited texture to a file from within Blender? I imported an .obj file with a texture (from photogrammetry app 3DSOM) which I show on the web using Three.js. As you can see, I need to edit the texture inside the jar, so I successfully imported the .obj file into Blender and edited the texture's appearance using the brush:

I know the .blend file doesn't save the texture on re-opening.

I can export the file an an .obj and also understand that the .obj format won't export the texture.

Is there a way from Blender to export the texture I've modified?

From the Image Editor, press f3 to save the image to a desired location and name (save as) and you can press Shift+S to save the image over that previously saved one. (Save)


Animation nodes - Replicate splines - random bevel size Id like to build set of spline with applied vector noise to simulate lightnings. I have followed Chris.P. tutorial and its done.
But I have two problems.
How can I set different Bevel Depth on each spline? It seems like Curve Object Output doesn't support list, only single value.
Second question is how can I set specific Bevel Depth for each point but on each spline specifically?
It can be random, but each spline should have different random sizes.
Third question is there any node which can from input 1,2,3 make 111,222,333?
Thanks a lot.
I want to control thickness of each spline

Here is a solution for your third question. It takes four AN-nodes if want a number as a result. If a text will do you can skip the last node.


Can't select (Most) of my armature So I have an interesting situation I have been unable to find an answer for anywhere. I recently started working on a character for an animation. I am ready to start animating, but for some strange reason, I can only select 1-2 of the bones in the armature, in any mode (pose, object, edit, etc.). The "A" command works no problem, but I'm not wanting to select all the bones. Has anyone else come across a situation such as this? One thing I will point out is that occasionally I will see  one bone with a thicker black outline than the others. Idk if this has anything to do with it, but here is a screenshot showing what I mean:

The bone in question is the one at the base of the spine, which also happens to be one of the few bones I can select. Any input would be appreciated!

So I went and updated my Blender Version, and it seems to have solved my problem (Heads up to anybody who sees this, 2.8 is close to being stabilized, so if you haven't already, update your version).


Object moving on it's own when rendered! Sometime when I move an object in the viewport it renders ok in the real-time rendered viewport (Cycles) but as soon as I press F12 and render the image - it goes back to the original location in the rendering as well as the viewport. It doesn't happen all the time but I have faced this issue few times in the past couple of months.

I have a feeling that it's something to do with the parenting. But I have tried everything I could think of - un-parenting, re-parenting with or without keeping transform but nothing seem to help!

Here is a screen capture of the issue:

Here is the .blend file in case anyone wants to examine it:
http://pasteall.org/blend/index.php?id=47962

Could anyone suggest what's the issue and how to avoid it?

I should have looked at the Graph Editor and the Dope Sheet - after deleting the unwanted keyframes the problem is resolved.

Thanks atomicbezierslinge and m.ardito for pointing the issue with keyframes.


different assigned materials into one texture? so i am using blender cycles render and i have this character
i colored it with materials assigned to the mesh
i need to bake them into one texture
i cannot do it because i can only bake one material at a time and use one color texture which does not give good results "only black"
please help

When you UV unwrap and create a new image, save the black image as whatever you want your final map to be called. Then add an image texture to any of those materials (it doesn't matter which one) and open up the file you just saved. You don't have to plug it up to anything, just make sure it's selected. Now make sure your object is selected, then tell it to bake. If you only want the colors and want to add your lighting another way, make sure you only have 'color' selected in your options. When it bakes, it should appear on image texture, but make sure to save it (you can do this in the UV image editor).

Now you can delete all your materials and use your mapped colors as the color input for any node that accepts a color input!


Animate location (or strength?) of alpha / opacity mask to suggest motion along arrows I have a globe depicting trade winds:

The trade wind arrows are an image with alpha.

I am in cycles, using this node tree for the earth material:

I would like to animate the opacity of the arrows from less visible to more visible in a conveyor-belt manner, or in "waves", suggesting motion from the south to the north. The point is to emphasize the motion of the trade winds along the image.

The north and south trade winds are on a single image. I can make them separate if a solution requires... as I only want to animate the arrows in the southern hemisphere.

I would start by adding something like this node set up where my Diffuse BSDF is your Diffuse shader after the Trade_Winds11 Image Texture and it all goes into the following Mix node.

In my example animating the Z Location in the Mapping node will cause that black line (hopefully alpha as it is running through a transparent shader) to move up or down. You can really play with the Mapping node to get the lines from the wave texture to move how you'd like.

I hope this helps.


Rotation animation isn't fixed on the pivot point I'm trying to animate a door turning and I've successfully created the keyframes by using rotate on the X-Y axis around my 3D cursor. I've created start and end keyframes that are fine:

note how both have the end fixed on the 3d cursor, my pivot point. However, the animation has the door poking out, for lack of a better word, 'escaping' the hinge.

It rotates and changes location, making it jut out and snap back again.
I've tried adding more keyframes in the middle to fix its position, but then I can't control the easing...

I'm very new to blender and animation, so I'm not sure how to proceed ><
Is there a setting to sort of 'fix' the door to the 'hinge' or pivot point during animation? Any help would be so much appreciated!

You can either change the pivot point as moonboots suggests, or (if you need the pivot point to stay elsewhere for other reasons) you can

Add an Empty on the desired axis of rotation

Select the door, then Shift+Select the Empty, and CtrlP Set Parent to Object
Animate the Empty, not the door

(this is a very common procedure for rotating a camera around a scene by using an Empty)


Why does zooming out too far cause my object to vanish? If you think the title of this question sounds hilarious, you aren't alone, but that's what's happening. I've built a large complex shape (crude description, I know), and now find out that I can only view it from certain angles and certain distances. If I zoom out too far it vanishes, just as if it was passing through a pressure curtain to another world. The object is generated entirely using python code.

Likely your viewport clipping end distance is too short. Press N in object mode to bring up the tool menu and change it under "view".


How to use Boolean Operations to create Windows in a Mesh? Is there a way to make an object like this without the artifacts?
No matter how I do it, they are always there. I may be missing something.

This is a boolean operation. No matter how I approach the base mesh (the arc), solidifying extruded bezier curves or making it out of a cylinder, also for the cutter it's the same, I always end up with these artifacts.

I was having this problem yesterday.
When you do booleans with a lot of round surfaces you can get these problems.
Check that your normals are facing the right way. Try to line up vertices through rotation or extra subdivisions and then re-mesh afterwards. Also make sure to remove double vertices.
It's also nice to have a linked duplicate, of the cut out, off to the side to modify.

As for a fix, Try this:


Changing Grease Pencil stroke placement? (2.8 Beta) So, I'm trying to re-draw something I made in the annotation tool (while projecting to the 3D cursor) with the new grease pencil tool (in a grease pencil object, of course), but it doesn't seem to project the same way.
When I was drawing with annotations, there was no problem. I could change it to project to the cursor and sketch (doing this so later I can use the camera for perspective, I'm experimenting with it).

and here's what happens in motion (I couldn't figure out how to embed it...)
https://imgur.com/JKqeklD
Basically what I'm trying to do is find the options listed here. I need to change the projection to cursor so I can draw on the same "layer" as it is how I would describe it.

You could try to move the Stroke OBJECT (in object mode) to the place where you're drawing, using it like the 3D cursor. Then, it will work like the cursor was before.

Hope that helps-


Viewport Background not transparent in rendered preview In rendered viewport mode, the background doesn't appear transparent, but black when switching Transparent on under Film using Cycles.

Usually, I see a checked background indicating transparency.

What have I done with this file?

I'm not quite sure why this is happening, but disabling the Background Images checkbox in the Properties shelf will return the transparent display in the viewport.


How do you wrap a plane around an object? I'm fairly new to Blender and I'm trying to make a teddy model and I want to wrap the arms around the body (Like how when you drop cloth on a ball, it forms to the shape of the ball where it lands)

This is what  I have at the moment:

However, the red arm is a flat plane so when i try to attach it onto the body some of the arm either goes into the body or is too far from it:

So I need it to be curved to the same curve of the body where it joins on.

I've tried using the shrink wrap modifier but that just makes the hand go deformed and when I get it in the right position it doesn't follow the curve of the body anyway.

I've tried making a curve and manually created points following the curve of the body and using the curve modifier on the arm and setting it to the curve.

I've tried using the simple deform modifier on the arm and selecting curve and curving it however, this just sort of twists it in a weird way.

I've also tried creating a uv sphere (thinking it might be the fact that the body is actually a cube would effect it) and trying the shrink wrap modifier for that but it still has the same effect.

In case it's not clear what i'm trying to do here how it is now from a top view:

... and here's what I want to achieve:

The body is a cube that I have used a subdivision modifier on and adjusted (It is not a sphere) and I made the arm by creating a curve, setting the spline type to poly and manually placing each point to form the shape, then converting it too a mesh and filled in the face.

It's probably something really stupid i'm missing but I would be very grateful if you could help.

Thanks,

Saul

Create a plane, subdivide it, put it between your sphere and the arm.
Give your plane a Shrinkwrap modifier with the sphere as the Target. Disable the modifier visibility for the moment.
Give your arm a Surface Deform modifier with the plane as the Target. Click on the Bind button.
Enable the plane's Shrinkwrap visibility.


Strange Nodes in imported .obj file from Alias .wire export I exported an .obj file from Alias, then import it to Blender. It was able to import, but all I see is broken surfaces/edges and lots of CVs/points.

I've also tried with .fbx format, the mesh will not be shown at all in Blender.

Anyone can help? Thanks.

When transferring data from application A to application B, the challenge is that there is always two potential sources of the problem. In your case, I suspect it to be an incomplete Alias export. You've stated in the comments that you were not able to tessellate the data during .obj export. Just in case, you have been using settings similar to the ones in the screenshot below?

Note that Tessellate is checked (the tolerance depends on your model), and that the output units are set to Meters. Importing such a file to Blender 2.79b worked fine for me in a quick test.

If you still get a faulty export, it's worth converting the data yourself to Meshes before exporting. The NurbsToMesh tool from the Palette is your friend:

If you check use existing tessellation you don't need to enter values yourself. The existing viewport shading tessellation is used instead. Pick the resulting Meshes and export them to OBJ as proposed above.

The preferred way is to use the .fbx Interface, but there were API changes in Alias from 2017 to 2018, resulting in different options available. The screenshot here is from Alias 2018. Note the File Version setting, which is important for Blender to be able to read the .fbx:


Rotate with the z-x'-z'' Euler sequence with Animation Nodes I want to rotate an object using the z-x'-z'' convention of Euler using Animation Nodes.

What I've thought that I need to do is to rotate along the local axis of the object, first around the z, then around the x and then around the z again. If I create a rotation matrix, select the transformation orientation to local and then rotate first on the z, then on the x and then on the z I get the result that I want for the first two rotations, the last is done in the the original z, not in the modified local axis, so I can't use that:

Is there a way to do the three rotations in local axis in the specific order using only animation nodes? I have other objects in my node tree that I don't want to transform along their local axis, so I rather prefer to avoid to select the local transformation orientation and do it purely in animation nodes:

Thanks! I hope that I explain myself

You can use Combine Matrices for doing any complex transformation.


Hold down mouse click but not tap? The title basically says it all, but not in any explanation. I have a weapon, and, for instance, it fires every 30 tics if you hold down mouse click. I am not sure how fast 30 tics is as of now, but I know I can say someone can click fast enough to shoot faster than expected and implemented. How can I have clicking also work at 30 tics in logic bricks as simple as possible?

This is very easy but you are thinking about it from the wrong approach. Instead of setting a delay between the positive pulses, Create a reload property that is always increasing as long as that same property is less than a specific amount. In this case, it is 30.

Then have another property sensor limiting the mouse's input so that it will only send a positive pulse when the reload is at 30.

When using a system like this, you can hammer on the mouse as fast as you want, but it will only fire when the reload property reaches 30. and as soon as you click, The reload property starts increasing until it reaches 30, where you will be ready to fire again.


How can I make a linked duplicate path with other bevel object? I want to make a cable with an outer sheathing and inside four wires. (Like a simplified version of a KNX-cable, see eg.
(source: domofox.it)  ).

I want to be able to dynamically modify the curvature of the cable afterwards.

So I started with a curve, then made a bezier circle and used that as bevel object for the curve, and finally added a solidify modifier for sheathing thickness, works marvelously.

I thought I could just make a linked duplicate of the curve and use a second, new bevel object (smaller) for my linked duplicate path and thus make a smaller conductor which would follow the same path. But when I change the bevel object of the duplicate, it also changes on the original?

How do I get this to work, so I can afterwards change 1 curve and all the others follow the change, each with its own bevel object?

Thanks to Mr.Zak's kind comment, I more or less solved it. I even threw in the twisting of the wires :)
The final solution does not use Bevel objects, but screw and curve modifiers.

In short:

for the wires, I made an object "KNX-wires" that consists of 4 circles
for the sheathing, I made another object "KNX-sheathing", that consists of a single circle
I added a curve "KNX-Path", to define the path of the cable

I then added the following modifiers to "KNX-wires" and "KNX-sheathing": screw, curve (with "KNX-Path" as curve object), solidify (to give some thickness), and a subsurf to finish.

Result looks like this. By changing "KNX-Path" in edit mode, the cable's path changes. By sliding the "KNX-Sheathing" and "KNX-Wires" along the Z-axis, they slide along "KNX-Path" following its curve. By changing the "screw" parameter of the screw modifier, I can change the length of the sheathing and wires (making the wires stick out a bit for instance).


Blender smoothed everything I am new to Blender and started to create a low-poly character. I was working on the hands when suddenly Blender smoothed everything out. I googled a bit but i couldn't really find a solution to this. I wanted to extrude and i don't know what i accidently pressed but this happned:

How can i undo this ?

Did u accidentally add a modifier? if that's the case remove it.
If that's not the case then try decimating its geometry.
To decimate: Properties -> Modifiers. Then click on Add modifier and select Decimate\
hopefully, that should work


Fluid Sim and Particles So I have set up a particle emitter and a fluid sim, the emitter particles do not interact with the fluid even when I set the emitter as an obstacle, also tried setting the object as an obstacle but no luck. Can anyone help please, thanks.

There is no way to currently do this in Blender, as it takes a lot of RAM and computing time. In the future there may be support for this kind of thing in later versions of Blender. However, you can fake achieve a similar effect by subdividing the fluid a substantial amount, and using a dynamic paint modifier to produce waves on the surface. Add a dynamic canvas to the fluid (domain), and set the dynamic paint type to waves.Faked particle interaction

Then set the particle emitter to have a dynamic brush. Set the paint source to your particle system like in this picture:Hope this helps!


Subdividing arbitrary face into smaller faces I'm trying to split an arbitrary face into smaller faces hopefully making some kind of grid. What I mean by arbitrary face is a face constricted by an random number of edges. Say, for example a circle with 32 vertices. By selecting the face (in edit mode) and pressing W> Subdivide I only manage to split the edges of the face into more edges, not the face itself.
For my purpose it doesn't matter what shapes the original face is split into, as long as its some kind og grid.

You can use Grid Fill to fill faceless circle.

Select all vertices, press CTRL+F > Grid Fill, adjust Offset as you want, also you can check Span value.

  Note: This will only work with even number of vertices.


How to make particles change colour over time in Eeevee? I just started tinkering with Blender (specifically 2.8) for the first time ever, and I've been looking up old tutorials on particles and how to change their colors over time, but I'm stuck on the colurs in the ColorRamp just sticking to one. I've been using Eevee to render.

And here is the effect I'd like to make, except the blue particles turn to another color:
https://gyazo.com/868e518fb69b1910f22e282557ecea6f

I know of two ways of doing it.
A: Add a "time node" using animation nodes, and point in "frame" to some math node then to "color"

B: Use Key Frames on the Color ramp. Click on the first color, set to the frame you want that color to be, in the shader, mouse over the color bar, press I.  Change frame, change color ramp color, mouse over color bar, press I.

NOTE: This changes all the particles color at once.
Note 2: The color ramp, as you have it, won't show up in Eevee, but will in Cycles.

This is similar to: How do I get particles to change color over time?


How to use blue weight paint? When I use weight paint the only thing it paints is red. How can I go back to painting blue?

This should be a very simple answer as I'm a beginner.

Red indicates high weight.  Blue indicates low weight.  So what you're asking is, how to reduce the weight?

Simple answer:  Change your brush to subtract.  See the pic:

Information you may not want want, but should want:

You can select another bone, paint it more red, and then normalize your weights.  Increasing the weight of one bone decreases the weights of other bones.

Another way to do it is by changing the weight of a brush.  You can use mix, darken, or multiply with a low brush weight.


Blender and requests PostgreSql I am new to programming.
Since Blender, I communicate with the PostgeSQL database. The purpose of the code is:

1 / Browse the table "works" and find new date_works for each object.
2 / affect the material to each object based on the date.
3 / if an object is in the group 'work', we find the parent.
If date_works of the child is higher than that of the mother, we hide the child object.

This is the point 3, which does not. What do you think of my code? What is wrong?
Thank you.

#Find the most recent work in the table "works"
    for  works ,recentW in db.prepare("SELECT mesh_ works,max(date_ works) FROM  works GROUP BY mesh_ works"):
       year=str(recentW.year)
       mat_M= bpy.data.materials.get(year)
       mesh=bpy.data.meshes["%s"% works]
       for obj in bpy.data.objects:
        if (obj.data==mesh):
                 c=obj
       # materials allocation in accordance with the date found. (example: finding dates 2015 => material it affects the "2015")
       c.active_material=mat_M
       # ensure that these objects are visible
       c.hide=False
    # hide child objects whose work dates predate those of parents
       #if it is a child,
       if c.name in bpy.data.groups["Child"].objects:
           #find parent
           parent=c.parent
           #search in the database of the most recent date of the parent
           recentParent=db.prepare("SELECT MAX(date_ works) FROM  works WHERE id_ works='%s'"%parent)
           #if the date of the parent is more recent than that of the child while the child is masked.
           for recent in recentParent:
                     if(recent[0]!=None):
                       yearParent=str(recent[0].year)
                       if(yearParent>=year):
                         c.hide=True
    return {'FINISHED'}

Syntactically something like this should work (I striped the DB code):

import bpy

mat_M= bpy.data.materials.get('2015')
year='2014'
for obj in bpy.data.objects:
    c = None
    print(obj)
    if obj.type=='MESH':
        c=obj
    if c == None:
        continue
    c.active_material=mat_M
    c.hide=False
    if c.name in bpy.data.groups["Child"].objects:
        parent=c.parent
        recentParent = [[2014],[2015]]
        for recent in recentParent:
            if recent[0]!=None:
                yearParent=str(recent)
                if yearParent>=year:
                    c.hide=True

for recent in recentParent iterates over the result of the db query, try your exact statement in a UI for your SQL server. If it doesn't return any data you need to fix that first. DB connections are better ask on stackoverflow. Note that there is a space in id_ works


Blender 2.8 - show hidden files in file browser? I'm working on Blender installed on Ubuntu 20.04. I installed my fonts using the Typecatcher in order to get Google Web Fonts. Typecatcher installs the fonts in a user home directory under ~/.fonts/typecatcher/.
Unfortunately I can not 'Unhide' the hidden directory in Blender in order to get access to the fonts (the one with the dot in front). I tried Ctrl-H but that doesn't work. Is there a way to get access to that location or should I just move the fonts to another location?

You can click the Filter dropdown menu (Display Mode) at the top-right of the File Browser in order to enable 'Show Hidden' which displays all files (or just press H to toggle the that mode on/off):


Move object continuously after being triggered by near sensor Can the near sensor be use a switch?
Having Cube1 near Cylinder I want the Cube1 to do a infinite continuous movement.

In my file Cube1 stops once it goes out of range of the near sensor. Is there a way to make it move forever once it triggers the near sensor?

Although you could have the reset distance at 10,000 blender units before it stops moving, and this may work for what you want, that is not at all the correct way to do this.

From what I can tell from your question, you want to have the cube detect being near the cylinder, and then after that, you want the cube to continuously move. The Near sensor detects the distance from the cylinder, and that sets the Boolean property to true. When the Boolean property is true, it will continuously make the cube move.

If you wanted to make the cube stop moving, you could simply have another property actuator assign the value of the property "PropName" to false. then the property "PropName" will obviously no longer be true, and thus "Property" (sensor) will no longer be true and will not send the positive pulses to "Motion" (actuator) and as a result, the motion will stop.


Why don't the freestyle lines show in the rendered image? I wanted to utilize freestyle for technical drawing, so I followed some simple tutorials. I activated the Freestyle checkbox in the Render menu, also activated the lineSet in the Render Layers menu. I hit F12, and I expected to see the edge lines in the rendered image, but alas, nothing. I used a simple white cube for testing purposes.

Can you help me? What did I miss?

All the best
Twerp

PS: Here is the file:  (https://blend-exchange.giantcowfilms.com/b/2422/)

Because (probably accidentally) you clicked on Exclusive, and now no edges are marked for inclusion. Click on inclusive, and you will see immediately some edges.

EDIT This is the result:


How to import text data blocks as modules using the 'from/import' statement? I practiced using text data as a module as below. And it works very well.
# function.py

def function():
    print('hello')

import bpy
f = bpy.data.texts['function.py'].as_module()

f.function()

>> 'hello'

But I want to use the from import statement. But I couldn't find a way.
Can text data be recalled to the from import statement as a module and used?

Add to sys.modules
Among other ways to make fake modules, can simply add it to sys.modules
>>> import sys
>>> sys.modules["function"] = bpy.data.texts['function.py'].as_module()
>>> from function import function
>>> function()
hello

Have a good link re fake modules and namespaces, will look for it.
https://stackoverflow.com/questions/5122465/can-i-fake-a-package-or-at-least-a-module-in-python-for-testing-purposes/27476659#27476659
Will add this link here too, https://dev.to/dangerontheranger/dependency-injection-with-import-hooks-in-python-3-5hap in can make a fake namespace that can be imported as if a regular module.
An example using above (stripped of comments to make shorter) making the function method appear to come from module  my_addon.utils
import importlib.abc
import importlib.machinery
import sys
import types

class DependencyInjectorFinder(importlib.abc.MetaPathFinder):
    def __init__(self, loader):
        self._loader = loader
    def find_spec(self, fullname, path, target=None):

        if self._loader.provides(fullname):
            return self._gen_spec(fullname)
    def _gen_spec(self, fullname):
        spec = importlib.machinery.ModuleSpec(fullname, self._loader)
        return spec

class DependencyInjectorLoader(importlib.abc.Loader):
    _COMMON_PREFIX = "my_addon."
    def __init__(self):
        self._services = {}
        self._dummy_module = types.ModuleType(self._COMMON_PREFIX[:-1])

        self._dummy_module.__path__ = []
    def provide(self, service_name, module):
        self._services[service_name] = module
    def provides(self, fullname):
        if self._truncate_name(fullname) in self._services:
            return True
        else:
            return self._COMMON_PREFIX.startswith(fullname)
    def create_module(self, spec):

        service_name = self._truncate_name(spec.name)
        if service_name not in self._services:
            return self._dummy_module
        module = self._services[service_name]
        return module
    def exec_module(self, module):

        pass
    def _truncate_name(self, fullname):
        return fullname[len(self._COMMON_PREFIX):]

class DependencyInjector:

    def __init__(self):
        self._loader = DependencyInjectorLoader()
        self._finder = DependencyInjectorFinder(self._loader)
    def install(self):
        sys.meta_path.append(self._finder)
    def provide(self, service_name, module):
        self._loader.provide(service_name, module)

if __name__ == "__main__":
    import bpy
    injector = DependencyInjector()

    injector.provide("utils", bpy.data.texts["functions.py"].as_module())
    injector.install()

    import my_addon.utils as utils
    utils.function()

output
hello