Bump Map Acts differently on two different Meshes Here's a problem that has been puzzling me for months. I took The time to investigate further this time and decided to ask here in case anybody encountered that kind of behavior.

When I'm painting the bump maps on that mesh, trying to create pores, the alpha brush is more likely gonna scrape off the skin instead of digging small holes. The gradient also seems to be very arsh even though it looks smooth on the UV map.

At first I thought simply tuning everything down with a math node (or strenght etc) will dial it back a bit but I'm loosing lots of details.

The next picture is a simple UV sphere on which I used THE EXACT SAME material to show the difference. (Same UV, same settings etc)

So now, the things I have determined and tried

-The brush is correctly configured to work with It

-Cleared ALL the other materials on the mesh

-Tried to unwrap on a better resolution (no difference)

It looks like the dynamic range is crippled someway

See how it digs until it shatters

But this one is smoother

I'll be very happy to hear if anyone has an idea of how this happens.

Thanks.

-The texture mapping is done by texture painting with ''alpha'' brushes.

-The scale is applied 1,1,1

Very interesting observation here done by Nathan and some troubling outcomes.

I tried, as shown on the picture, to cut a part of the mesh on which I had the problematic bump mapping, scaled it 1/25... Now the bump works as expected. The more I scale it, the smoother the texture.

So YES it seems to work once I scale but the thing is, the model as real life measurements therefore it's not an option for the application.

So what happens probably is the UV texture is too Hi rez for the mesh (2048x2048) when I thought the problem was the opposite. Blender, by resolving the texture, is squishing the pixels down losing the gradient of the texture.

Is this theory right? I always thought you cannot have too many pixels on your uv map but I never thought there was a pixel scale factor to avoid?

Edit: Finally found the solution in an inelegant way. Found out this is a 'not so well' known bug with bump maps and that's why I was so much trying to find out what I was doing wrong...

Simply using a Divide Node seems to reduce the dynamic range that suffers from being map through ''too small'' polygons.

I can now finally continue to create, sorry blender, hope this will never happen again.


Blender 2.8 Less Saturated Colors in Material This has been bothering me for a while, when using any kind of shader I've noticed the color is kinda bland in comparison to the actual color selected. As I'm working from reference art it's a bit of a bother when all the colors are somewhat off, despite being picked directly from the image. This was never a problem in 2.79b Cycles for me. Does not seem to be a result of lighting, as both Emission and Diffuse Shader to RGB produce these.

If you want the render to show exactly the color of it, you will need to directly connect an RGB node to the surface socket of output node to avoid any other calculation of final color.

And if my memory is correct, default view transform calculation behavior is changed in 2.80 Cycles. Did you accidentally change it away from default setting?

If some of these value is not as same as the screen shot, then it will cause the color picker not able to retrieve the original color.


How do I shrinkwrap an object to a curved surface cleanly and efficiently? I have a sphere and two eyes. I want to shrinkwrap the eyes onto the sphere's surface cleanly.

The only way I know how to shrinkwrap ANYTHING is via the Shrinkwrap modifier, which crumples up the eyes when I try to stick them to the sphere, no matter how much I mess around with the settings.

What is the correct way of doing this, while staying efficient on the vertex count? I don't want to end up subdividing the objects too much for such simple geometry.

.blend file:

First you need to put Shrinkwrap modifier on the top of the modifiers stack.
Then in Shrinkwrap modifier change Mode to Project and in Direction enable Positive.
Then align the eye mesh tangentially to the surface of the sphere.


Ocean modifier not showing waves I just created a plane and added the ocean modifier, but it isn't showing the waves. What am I doing wrong? I am following this tutorial: https://www.youtube.com/watch?v=CwJrb3vjAaA


Any way to disconnect animations after animating? I'm pretty new to blender, so don't judge me to harshly on my noob levels here, but lets get right to the question. Is there any way to disconnect animations after animating. Here's An example if you don't quite get what i'm saying. I have a player character model and a gun model both with separate skeletal meshes. I would like to animate the gun and the player character together in the same file (for more precise animations) then separate the two so I have the gun and player as two separate objects/skeletal meshes, and both objects have there parts of the animation. Is there any way to do this? If not, tell me the best alternative. Thanks for any response :)

When you animate two separatedo objects (in example "sphere" and "cube"), two "actions" are created, named "SphereAction" and "CubeAction".
Turn a window into dopesheet and set the tiled menu from "dopesheet" to "Action editor": if you select an object you will see his action, wich can be copied, pasted, moved, muted, saved as "Fake" user, linked or appended in a new file, or even assigned to another object: it will work if all the names (of the bones) are the same.
Animation controls that search for a non existing object or bone are simply ignored.


How can I make a 3D mouse act the same as in other programs? I can't seem to get my 3D mouse (3DConnexion SpaceNavigator) to work 'right' in Blender.

The intended functionality is that rotations should be orbiting the object and the mouse should be able to pan/zoom. This is the functionality in all the other major 3D programs I've used (eg C4D, Modo, Rhino, NX).

However, in Blender, it seems that you can either set 3D mice to orbit around the object and lose the ability to pan, or the motions are completely decoupled from the object you've chosen, resulting in the object tending to move off screen.

Any clues on a way to work this out?

Just change navigation style of NDOF device to one which you like - orbit around selection or free. Trackball lets you bank the camera There isn't any other option I'm afraid there's no way to arbit around selected with ability to pan in 3d connexion mouse


Material color is darker in Kd in .mtl file than it is in blender I'm using Cycles Render and exporting my model as .obj and .mtl files. I have a simple green diffuse material, but in the .mtl file, the color becomes a much darker green. The viewport color and the material color are the same (I know that the wavefront obj/mtl files use the viewport color).

It SHOULD be Kd 0.121568 0.364705 0.149019 (hex #1F5D26)

but it's exporting as Kd 0.010962 0.087569 0.015506 (hex #031604  )

Why is this happening?

.mtl file:

newmtl PineTree.001
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.010962 0.087569 0.015506
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

Blender material:

Like Troy said it's a color management convertion.
In cycles colors aren't bounded to 0/1 range, this is scene referred datas.
In .mtl files colors are stored in a 0/1 range, the display referred datas.
Look the Wiki for description of Wavefront .obj, scroll down to the section "Material template library" and subsection "Basic materials"
It's said that : "Color definitions are in RGB where each channel's value is between 0 and 1."

So with that in mind you couldn't expect a 1/1 between Cycles internal values and exported bounded values. Plus I don't know if you're aware that Hex values are gamma corrected in Blender.
It looks like there is a transfere curve, I guess an EOTF curve, see here for more details : the-importance-of-terminology-and-srgb-uncertainty, the whole article is worth reading but there is a section about the sRGB EOTF transfer curve.


Animation Nodes - How to create transition with the gif-animated squares This is my square with gif animation. You can right-click on animation and press Save Image. It will save as gif.

I wish to repeat the animated squares to create examples below. How do I do that with Animation Nodes? I'm not too fussy how you do it, as long as I'm learning Animation Nodes. Thanks in advance.

Example #1

Example #2

Example #3

We shall create the animation by morphing between those shapes sequentially. The first shape is a four-petal flower shape, this can be created by modulating the the amplitude of a circle based on a positive sine wave. First, we create a circle using its parametric equation:

Then the circle is scaled based on the absolute of a sine wave. The integral multiple of the parameter range controls the frequency of wave which controls the number of petals. A phase shift is introduced by adding some scalar to the parameter, this effectively rotates the flower. Moreover, the power of the wave controles its curvature and a scalar addition to the wave controls the radius of the center part:

The next shape is a squircle that turns into a superellipse (A squircle is a special case of a superellipse), so lets create a superellipse. The superellipse is just a circle that was powered retaining its sign:

Finally, it turns into a square, which is the limit of the superellipse as the power approaches zero. So, lets animate between all those shapes. We start with the petal shape (Which is a superellipse with a unity power) that have a zero radius and animate the radius to reach the required state, we are also going to animate the phase shift to rotate the petal at some point:

Then, we are going to animate to a squircle with a constant radius. This is done by animating the petal factors to a constant radius and the power of the superellipse to half:

Then, we animate to a high power:

Finally, we animate to a square, remember that a square is the superellipse as its power approaches zero:

Finally, we create a mesh from those vertices:

To create a grid of those objects, create a loop with a time offset:

Adjust the timing, durations, offsets, and other parameters to get the result you are looking for.


Render stops after 1 frame. "Render error (Permission denied) cannot save: '0001.png'" For some reason today I can no longer render more than 1 frame at a time. I was able to just fine yesterday. After successfully rendering the first frame, render stops and I get this error message:

  Render error (Permission denied) cannot save: '0001.png'

I tried saving output to local drive instead of server but no luck.

I am using the "File output" node in the compositing node editor, and NOT using the render settings output path. I just tried putting something in the output path and leaving the composite nodes untouched, and now it renders fine but renders each frame twice (once for the File Output node, and once for the render settings output path.)

Why would I get this error?

I realize I've found a workaround where I just have to delete the extra renders, but I want to get to the bottom of this problem. ;)

Thanks!

On output property tab type /tmp\ into the Output file path.


Render pass that output center of object of each pixel I am looking to create a render pass that takes a scene and outputs, for each pixel, the 3D world coordinate of the center of the object to which that pixel belongs. In other words, all pixels that show the same object should have the same value.

Now, what I could do, is render a separate pass for each object where only the pixels of that object are white, and then set the values manually, but I was wondering if there was a better/quicker method.

Thanks a lot!

You can do this by using a Material Override and a special material to give the objects' positions.

First create a new material with an emission shader (you can add it to any object, it doesn't matter).  Add an Input > Object Info node and plug the Location into the color of the emission shader.

Now you can create a fake user for the material and remove it from whatever object you added it to.

Then add a new render layer and set the Material Override (under the Layer rollout) to the material you just created.  It would also be useful to override the samples to 1 as well to reduce rendertimes and effectively disable antialiasing.

In the resulting RAW rendered image the red, green, and blue values of each pixel will represent the location of the object rendered on that pixel.


How to bake multiple fluid simulations in one scene? If we understood correctly, Blender does not allow more than one domain for fluid simulation in a given scene. This means that any inflow (fluid) object will be transformed into only one domain object as the final simulated fluid. That is, regardless to any material assigned to inflow (fluid) objects, ultimately the domain material will apply. This causes difficulties to experience mixing fluids as questioned here.

In our recent trial in the following figures in order to simulate two different types of fluid (i.e., different material, etc) we simulated each separately and baked. Now we question how we can use the resulting images to put the fluids together in one animation? We tried to composite but didn't get acceptable results. Is this the correct approach or is it possible to bake multiple simulations in a scene?

Note that before we end up with separate baking we played sometime with multiple scenes, different layers but no success in putting two fluids together!

Here we share our results based on the method explained {here} and {here}.

The idea is simple:

  1) define domain, fluid, obstacle etc
  2) assign unique folder for baking cache
  3) bake the fluid one
  4) remove domain and fluid associations

Repeat the above as many times you want (here in the following example we did it three times).
Trick:  Indeed, for the following example we just baked once. Then we copied domain+obstacle two times. Relocated them on the scene. Duplicated all the cache on the disk two times in two folders that later we assigned in the above algorithm :))

We also used offset frame just to make the fluids a little bit different in stage:)

Note: domains can overlap or whatever, but notice that the fluids do not interact each other but overlay.


How do I set a background image while I am editing? How do I put a backdrop behind the model that I am creating so that I can compare the picture to the model while editing?

See Cannot find Background Images feature in Blender 2.8 if using 2.8.

Background images are gone in Blender 2.8, at least in the traditional pre-2.7# sense. The old system was aging and prone to failure ... and it has been retired due to inherent limitations.
Information was stored as User Interface data, as such if you opened a file without the Load UI option ticked they would appear to be missing, and any previously assigned background images mysteriously absent.
Saving the file would then silently erase them, permanently eliminating without warning or explicit user intervention.

As an alternative to Gwenn's answer, you can also use an empty. Empties in Blender now have an image type.

This is very useful as it gives you more control over positioning your references and users coming from other software can use this method as it is the norm for them. (most Max users I know use frozen planes with textures when modeling).
Control the image object properties in the "Object Data" tab:

Once added, you have a lot of control over the reference. You can adjust the opacity, scale it, rotate it etc. Much more flexible than the common way using the N panel in the other answer. You can also lock it so it behaves the same way. Another advantage this has is that it's visible in both orthographic and perspective views.


Baked texture is too dark I baked a procedural texture and now it renders very dark.  For the node setup I simply plugged in an image texture node with a diffuse shader (with roughness set to 0) into the material output.  No lighting was changed, the mesh was smart UV unwrapped and the image was baked to a transparent background. Is there a common reason for this?

Here is a screenshot (.blend is way too large to upload unfortunately).  The highlighted part is usually rendered much brighter with more visible detail.

This is what it renders like without the bake and here are the bake settings:

Thanks

You have two points to refine.
1. Use the emission shader.
2. add transparent input.

1. Use the Emission Shader

I should have noticed this earlier but when you bake with combine, the shader to use is usually an emission shader.

2. Add transparent input

As far as I know, combine baking does not support transparent shader. Your node system requires the transparent nodes that you already use.


How do I change the interpolation of multiple keyframes in the graph editor (f-curve)? When I select multiple keyframes in the f-curve view (graph editor) and change the interpolation to "constant", it only changes one keyframe, so how do I change it for multiple keyframes?
Thank you

While can't see how you do it, here is how i do it:

You frame all the wanted keyframes including their handles
Either go in the menu on top or use the context menu with RMB to change the
interpolation.

Here also a visual step by step:

Should this not work with your version, please explain where it differs from this.


Make smooth texture transition animation in BGE I have a skydome model to use in my game and 2 sky materials for it I want to have it fade between during an animation, like a day-night cycle with a smooth transition between day and night skies.  I have the placements of all of my keyframes ready for the animation, but I need to know what property(s) of my materials I need to change to achieve this.

I don't know whether you can fade between two materials, but you could easily set up a mix shader within a single material and animate the factor with keyframes.  So the single material would contain shader setups for your day sky and your night sky, and the mix shader would switch between the two.  It is possible to mix between background shaders FYI (although since you say you have a "skydome" perhaps you are talking about mesh materials, not background materials . . . it's the same principle either way).


Rigify (2.8) - automatic weight incorrect and issues with weight painting I'm trying to rig a character for animation for the first time, however dont seem to get it right :(

I placed a "human metarig" into my characters mesh using the rigify addon, when i parent the mesh to the metarig with "automatic weights", the following strange things happen:

vertex groups for tigh.L & tigh.R are placed on the opposite/ wrong sides on the x-axis, other vertex groups like shin.L & shin.R, toe.L & toe.R are place on the correct sides
weight influence is "leaking" far into my mesh which causes horrible deformations when when adjusting the pose on one side

I also unsucessflully tried the following to improve the automatic weight distribution after reading some threads:
- removing all douplicate vertecies from mesh (in 2.8 apparently "merge vertecies by distance")
- scaling the whole thing up

I tried to paint the influce for the vertex groups myself, but for example if I want to move a leg and paint the tigh bone red and the shin/ foot green for lesser influence, deformations occure again (they don't if I have x-axis mirror in pose options enabled).
The leg only moves correctly if I paint the whole leg + foot red in the tigh vertex group, but if i do this again for the lower leg in the shin vertex group (paint lower leg+foot red) and then move just the shin bone, the lower part of the leg starts deforming/ shrinking again.

I've uploaded the blend file here:

https://www.dropbox.com/s/xjmjj8basjienfx/burn_baby_7_4_20.blend?dl=0

I've anyone has had similar problems and would share some infos on that or has some advise on what I'm t doing wrong, that would be highy appreciated.

Thanks!

You're not supposed to use the metarig as a rig. It's a tool for you to tell Rigify where your character's body parts are so he can generate a rig that fits him.

̈Please see a tutorial to learn how to set this up, like this one. It was for v2.7x so the UI is a little different, but Rigify hasn't changed since.

Also, I wouldn't consider your mesh ready for animation.
The topology simply will not give good deformations. And the mesh density is extremely uneven, it seems you've made a patchwork of parts from very different assets; which is fine on its own but require a unification work that is lacking here.
I'd suggest you do a big retopology session first. And I'd advise you to keep the polycount way down. For a simple character like yours, you don't need as much polygons as right now, really. You can keep that really low, and have some level 1 subdivision modifiers on top to do the detail. And you WANT to keep things simple : less vertices = less headache when working on the weights.

Now more about your issue :
There are a lot of things you should always check before rigging. Including :

Translations & origin :

Those two go together, most meshes usually should have their origin to the world center, and such their translations are set to zero.
Some make exceptions, like the eyes that can have their origin to their center of mass, so their translations would be whatever the eyes are. But other than that, usually make sure origin is in center, period. Even the eyes if you have a doubt.

A quick fix for that :
Select you mesh and press ⎈ CtrlA → Apply location
This will set the origin of your selection to the world center and their translations to zero.

Rotations : are they all to zero?

Unless you make some special rig, your rotations should all be set to zero.

How to fix :
Select your meshes, hit ⎈ CtrlA → Apply Rotations.

Scales

You can have scales different than 1, but you really need to know what you are doing because, if scales are not the same between some objects, or between the deformed objects and the armature, or if the scales are uneven between the three axes, there will be issues. So really, an easy way to not have issues is to have all scales at 1.

How to fix :
Hit Ctrl A → Apply Scales.

You can also fix the rotation, location and scale in one go using ⎈ CtrlA → Apply Alll Transforms.

Normals

Among other things, they are used to tell which side of a face is upside and which one is downside. Quite a big deal in Rigging.
You can quickly see your face orientations using the "Face Orientation" overlay :

Red is downside, Blue is upside. You can see your mesh has a lot of backwards faces. It also has some inside mesh pocking through your eyebrows, you should edit that:

How to fix :
1. In edit mode, select the reversed mesh and hit ⇧ ShiftN to recalculate the normals
2. If it's still backwards, open the Redo Panel on the bottom left corner of the viewport (it appears right after an operation is done), and check the "Inside" option to flip the recalculated normals:

Apply unnecessary modifiers

Basically, except subdivisions and particles, any other modifier should probably be applied.

In your case, your pant object should have its displace applied.

In addition, make sure there are no useless subdivisions that give unnecessary mesh. Like on your teeth, they are dense enough, there's no need to add more mesh. You need to keep things simple as much as possible so you can work fast and so your viewport keeps a nice performance.

Go through that, and you should be fine most of the time.


How can I overlay snow onto a static scene to make an animation? I have a scene consisting of a castle in the mountains.  I want to add snowfall to the scene using a particle emitter to make the scene animated.  That's the easy part.
My scene takes quite a long time to render so as the only thing that is changing is the snow, I would like to avoid rendering the entire scene for each frame.
I tried creating a new blend file with the rendered scene as an a flat image, and adding the snow, but it looks exactly like that - snow falling in front of a picture.

I'd really like the snow to look as if it's falling into the depth of the scene.  I suspect this might be possible by some clever compositing trick or rendering the snow and the scene separately in different layers, but my Blender skills aren't quite up to those kinds of tricks as yet.

Can anyone guide me to a tutorial (or explain how it might be done here if it's that simple)?
Once that's done, I need to work out how to loop the snow so that it doesn't jump when it loops around, but that can wait for a separate question.

I'm working in 2.79 and Cycles.

Some tips that might help:

If you want visual depth, then some snow has to "dissapear" behind the
castle (So the snow density in front of the castle is much lower).
If i understand your current setup correctly this doesn't happen.
If you put the snow and the castle on different layers be sure to
tick mask for the castle layer on the snow layer (https://docs.blender.org/manual/en/latest/render/post_process/layers.html)
Also make sure your particle emitter Geometry has enough depth.
(horizontal plane).
Then it might be nice to add some force fields (to add some vortices
etc. you might add keyframes to the strength of some force fields and
use noise
How to make flickering light?
...

PS: You can loop your particles like this: https://m.youtube.com/watch?v=yanQ1C7GB04


How can I replicate an object over the surface of another? I am a beginner and I want to add nails to a cactus I've modeled. How would I go about doing this? I'm after actual geometry not just a flat plane with a texture.

One way to go about this would be to use DupliFaces.

  Duplication Faces or DupliFaces is the capability to replicate an
  object on each face of a parent object.

You would model your nail then parent it to the cactus object with Ctrl + P. You then select the cactus object and in the Object panel under Duplication and choose Faces.

This is not perfect and the outcome of this depends a lot on the topology of your parent object (the cactus) and how your child object (the nail) is scaled and or rotated etc. It can work with some tweaking however…

Another way would be to use a particle system, set the type to Hair and under Render, select the nail object. This is a bit harder to tweak if you don't have much experience with it etc. but can give you alot more control and variation as to how things can be placed.


How do I make sunlight emit between clouds? Many tutorials show how to make mist and have light go through a window and it's pretty straightforward, however, what puzzles me is how do you do that when you emit beams of light between clouds?

If it's in the distant background I'd just use a HDRI or similar but I want the camera to fly into them.

In cycles, what technique should I use to approach this shot?

ADDITIONAL
In the "possible duplicates" the rays don't pass through the clouds they emit off screen or through an object but never clouds. So how to make the emission of clouds have variable opacity in a specific pattern?

This has been asked before many times.

You need volumetric lighting to see beams of light shining through the environment

The reason you would see those rays in the real world is because all the suspended particles in the air (smoke or mist) reflect some light, making the air not completely transparent anymore.

Volume scatter simulates that effect.

Add volume scattering as volume for the world (or create a big box that surrounds the scene and connect a volume scatter node to the volume of the material shader as shown on this post). The default value of 1 is way to high, so bring it down a bit.

Add a lamp and give it a very high value for intensity.

Create a plane with a texture that controls the transparency.

IF you want a more elaborate scene, then create clouds with the cloud generator add-on. The important part is that the clouds create different degrees of opacity between the light and the ground


Mist Pass differences between Render Layer and Viewer For some reason there's a difference between the render layer's Mist Pass itself and the pass seen through the Viewer Node at least in Cycles.

I need an explanation to this, because I've experienced this changing into an animation too.

Passing it through the viewer like that causes it to be treated an output color instead of a data pass, so Blender starts gamma correcting it. When you view a pass directly, it is not corrected and you just see the raw data. You can verify this by checking values in a particular region on the raw pass, and comparing them to linear values shown on the viewer (not the ones labeled "CM"). They'll be the same.


How do I make the back faces of a transparent object hidden while other individual objects behind it remain visible? This is the scene in material mode

Render mode with Z transparency

The same thing but now with mask transparency

Can I make the back faces of the front cube hidden like the 3rd image, while the black cube behind it is still visible like in the 2nd image?

i know that your'e using blender internal, but you probably should use cycles or eevee (eevee is only in blender 2.80^).

with this simple node setup you should get the result below.

Result.


Is it possible to add modifiers dynamically with animation nodes? To add modifiers dynamically, I know that one can modify values of existing modifier via attribute output node. Can this node be used to create modifiers or does it need some sort of scripting?

The only way to do this is by using scripting, there are three important points to take into consideration when making this:

Make sure not to add the modifier if it was already added in a previous execution.
Output the input object and plug it into the attribute output node, making sure you are not editing a modifier before it gets added.
The modifier name should never be an empty text because then blender will automatically add a name and our first test will fail, so we should set a fallback value.

Making sure we got those three points right, we can write a code like this:

modifierName = modifierName if modifierName != "" else "Fallback"
if not modifierName in object.modifiers:
    object.modifiers.new(modifierName, 'ARRAY')
outObject = object


Python - Script to Assign Materials based on Mesh Name hoping someone may be able to help out with a script to automatically assign materials to meshes based on their names. I've not had any Python experience so it's all a bit beyond me.

I'm importing a series of car models (FBXs each consisting of around 25 mesh objects) into a scene to render (Cycles) and need to apply materials to the selected meshes (ideally more than one at once). The materials have already been created in the scene and applied to temp meshes (moved to layer 2). Each mesh object from the imported FBX has been named to match the material that needs to be applied (eg. "Car_Tyres" mesh needs "Car_Tyres" material applied).

Can someone help me out with a script or point me in the direction of a solution, I've had no luck searching previous questions on here. Thanks heaps for your time :)

Please try running this and let me know if there are any errors: (I just hope I understand your requirement correctly :)

import bpy

for obj in bpy.data.objects:
    objName = obj.name
    mat = bpy.data.materials.get(objName)
    if(mat != None):
        if(mat.name not in obj.data.materials):
            obj.data.materials.append(mat)
            obj.active_material_index = len(obj.data.materials)-1
        else:
            obj.active_material_index =  [*obj.data.materials].index(mat)
    else:
        print('No material available for', objName)


copy/paste (hair) modifier properties (different files) Perhaps this is related to any modifier that has desired/tuned parameters....
I have played around with hair settings on a modified UV-sphere mesh in file-1, and now i'd like to migrate/save (copy/paste) all of these satisfactory settings onto a different mesh (separate scalp mesh of a character) in a different file.
In 3ds Max, there is a hair copy/paste and Save/Load preset.  Is there a modifier copy paste in Blender?

You can go to File -> Append, browse to your previous file and open the Particle Settings folder to bring over the settings.  Just create a particle system in the new file and slot the settings in under it.


Blender 2.8 - Python - "active" removed from API - How to pick active object now? I want to pick the active object in the scene to tweak some settings at this object. A camera.

In Blender 2.79 and lower this could be done by bpy.context.scene.objects.active And it worked fine. But in the 2.8 API they have removed the active. And i get an error now.

So how am i supposed to pick the active object now?

The 2.8 api simply says active is removed. But not how to replace it. The api changes wiki states that it is replaced by context.render_layer.objects.active. But this just throws another error.

https://en.blender.org/index.php/Dev:2.8/Source/LayersCollections/API-Changes

Code that works in Blender 2.79, but not longer in 2.8:

bl_info = {
    "name": "Create My Cam",
    "description": "Creates a camera",
    "author": "",
    "version": (1, 0, 0),
    "blender": (2, 80, 0),
    "location": "add menu",
    "warning": "", # used for warning icon and text in addons panel
    "wiki_url": "",
    "category": "Create"}

import bpy
from bpy.types import Menu

# ----------------------------------------- Adding camera
class CIC_OT_mycam(bpy.types.Operator):
    """Creates a camera"""
    bl_idname = "scene.cic_create_cam"
    bl_label = "My cam"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):

        # ----------------------------Create Camera with correct position and rotation
        bpy.ops.object.camera_add(location=(30.60861, -30.60861, 30.60861), rotation = (0.955324, 0, 0.785398)) # Create Camera.

        object = bpy.context.scene.objects.active # Pick the active object, our new created camera

        # ------------------------------Here we adjust some settings ---------------------------------
        object.data.type = 'ORTHO' # We want to set the type of the camera to orthographic
        object.data.ortho_scale = 14.123 # Let's fit the camera to a basetile in size of 10
        object.name = "My Cam" # let's rename the cam so that it cannot be confused with other cameras.
        bpy.ops.view3d.object_as_camera() # Set the current camera as the active one to look through

        return {'FINISHED'}

# -------------------------------------------------------------------------------------------

class CIC_MT_cammenu(bpy.types.Menu):
    bl_idname = "CIC_MT_cammenu"
    bl_label = "Create camera"

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

        layout.operator("scene.cic_create_cam", text="My Camera")

classes = (
    CIC_OT_mycam,
    CIC_MT_cammenu,
)

def menu_func(self, context):
    self.layout.menu("CIC_MT_cammenu")

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

    bpy.types.VIEW3D_MT_add.append(menu_func)

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

    bpy.types.VIEW3D_MT_add.remove(menu_func)

bpy.context.object seems to still work just fine with an extra bonus of less typing.

You can use the autocomplete function(Ctrl+Space) in the Python Console to find out how things are in 2.80 as well as in previous versions.


Align vertices along vector (Python) I have a vector and vertices, and I'm trying to align the vertices to that vector using 'Translation Matrix', unfortunately multiplying the matrix with the vertices' coordinates do not change anything.

here is the code:

import bpy
import bmesh
import mathutils
import math

msh = bpy.context.object.data
mesh = bmesh.from_edit_mesh(bpy.context.active_object.data)

vec = mathutils.Vector((0.7071, -0.7071, 0.0, 1.0))
trans = mathutils.Matrix.Translation(vec)

m1 = mesh.verts.new((1, 0, 0))
m2 = mesh.verts.new((1.5, 0, 0))
m3 = mesh.verts.new((2, 0, 0))

m1.co = m1.co * trans
m2.co = m2.co * trans
m3.co = m3.co * trans

bmesh.update_edit_mesh(msh)

Thanks in advance.

Unit direction vector.

Suggest doing this without the transform matrix. The direction vector

>>> d = Vector((1, -1, 0))

can be normalized, ie have a length of one, to

>>> d.normalize() # in place normalize
Vector((0.7071067690849304, -0.7071067690849304, 0.0))

Now, given a source location point p can move from p x units in the direction d using

new_loc = p + x * d  # x is a scalar.

In the context of your original question

import bpy
import bmesh
from mathutils import Vector

me = bpy.context.object.data
bm = bmesh.from_edit_mesh(me)

p = Vector() # using origin as source point.

vec = Vector((1, -1, 0))  # direction vector
d = vec.normalized()  # unit direction vector

newverts = [bm.verts.new(p + x * d) for x in (1, 1.5, 2)]

bmesh.update_edit_mesh(me)


How to track an object to a specific property in the Blender Game Engine I make a game with the Blender Game Engine. I would like to make a cube (Enemy) which moves inside a navigation mesh.
This cube should follow all the objects with a specific property. The cube also should follow the nearest of this objects  in the navmesh.
I found this script. But it only work for the "Edit Object" actuator. I need this script work for the "Steering" actuator and the  path following. I hope you can help me.

def target_prop(cont):
self = cont.owner
objects = self.scene.objects

test = [o for o in objects if self["Cube"] in o]
test.sort(key=lambda o: self.getDistanceTo(o))

target, *_ = test

act_track, *_ = cont.actuators
act_track.object = target

for act in cont.actuators:
    cont.activate(act)

Simple change. The syntax for the "Steering" actuator calls for a target field, not a track _object field. So your new snippet looks like this:

def target_prop(cont):
self = cont.owner
objects = self.scene.objects

test = [o for o in objects if self["Cube"] in o]
test.sort(key=lambda o: self.getDistanceTo(o))

target, *_ = test

act_track, *_ = cont.actuators
act_track.target = target

for act in cont.actuators:
     cont.activate(act)

you can see the only change is line #11


Mesh deforms incorrectly When I move this part of the wing on my dragon, it deforms incorrectly, how can I fix please?
Also when I move the shoulder bone, the whole body deforms.. When I separated the wings from the body, and tried it. It worked perfectly, what is the problem here?

How did you rig your dragon?
"manually" you would do weight painting for your bone that parts you want to be deformend if that bone moves.
I did that for your case and i got:

But your vertex group (i just checked for that special bone) didn't had any weights!?, that's why i asked how you did setup your rig.
and i did this weight painting for this vertex group:


Blender adding unnecessary edges to flat surfaces I'm trying to make a beveled "B". I have a perfectly flat B that I'm extruding, but Blender keeps adding unnecessary lines. Scaling to Z 0, limited dissolve, etc will not remove them. Deleting them breaks the face.
These lines mess up the bevel process, even if I only select the 90 degree edges of the geometry. How do I force blender to just generate a flat, uninterrupted top surface?

The simplest way to bevel is not to convert the text to mesh, but to use bevels within the curve's geometry.

Converting curves (or text, which is another kind of curve) to mesh will almost always result in terrible topology.


Where is the GRLESS key? I'm watching different tutorials and making with them different models. And in one of those videos an author used keys Shift + GRLESS.
I've never found such key name before, so I'm wondering now, what is it and where is it?

GRLESS stands for "Greater than/Less" and refers to the comparison symbols < and > which mean "smaller than" or "less then", and "greater than".
In most a standard QWERTY keyboards for English speaking countries (like United States, Canada our Great Britain) these symbols are typically in the period . and comma , keys, to the right of the M key.
Elsewhere however, in other international QWERTY layouts it is common to find a dedicated key with both greater than > and less then < keys bundled together, toggled by Shift modifier key.
For Portuguese, Spanish, Greek, Italian, Danish, among  and others layout for example they are located towards the bottom left corner of the keyboard, next to the Z key.


How to create properties for new object types I try to create some properties for custom primitives in property group classes and I want to access them from an operator in another .py file to create primitives, but I get the following error:

  AttributeError: 'tuple' object has no attribute 'base'

I'm trying to follow this advice:

class MyProps(PropertyGroup):
        ... # properties and stuff

class ParentProps(PropertyGroup):
        # THIS WILL NOT WORK! MyProps _has_ to be registered at this point
        #foo = PointerProperty(type=MyProps)

def register():
        # 1) register property class
        bpy.utils.register_class(MyProps)

        # 2) add property (now it works)
        ParentProps.foo = PointerProperty(type=MyProps)

        # 3) register parent class
        bpy.utils.register_class(ParentProps)

Unfortunately I get another error:

  ValueError: register_class(...): expected a class argument, not 'tuple'

The WIP code looks like this: http://www.pasteall.org/60602/python (line 1260).

The design idea is that operators should create primitives and set up their properties, but these properties should still be there to change it later.

bpy.types.Object.povcone = PointerProperty(type=RenderPovSettingsCone_add)
bpy.utils.register_class(bpy.types.Object.povcone)

you do not need to register a property from bpy.props like this

the property is there after the assignment and blender will use it as a wrapper for

obj.["povcone"]

so simply drop the second line


Objects in entire project can no longer be edited When I RMB-click on any object in my project, it no longer gets a yellow profile that indicates that it is selected. However, in the Scene panel on the right, it does appear in yellow. I can also perform transformations (move, rotate, scale) on the "selected" object.
However, when I go into Edit Mode (see picture), the view of the "selected" object doesn't change, whereas normally it should change to either a vertex, edge or face view. The Editing interface does appear, but since there are no vertices, edges or faces to select, it's useless.
Did I inadvertently lock or deactivate a functionality in Blender?


How do I get vertex coordinates in the same units as the scene units? I want to get the coordinates of a vertex in the correct units, millimeters in this case for the current model, to do some calculations in external to blender module.
When changing the units of a scene in blender 2.82 all fields in the UI show the correct size, for example 100mm and 1mm in object and edit modes. So a vertex will show the location of 1000mm in the default cube for example.
But when accessing the same coordinate through Python code as follows:
bpy.data.objects['Cube'].data.vertices[x].co the data that we will get for the same vertex will be 1.0, meaning it remains in meters.
Any ideas as to how to get the coordinates/sizes in the correct units in Blender Python API?

I think the question is mathematically inaccurate. Your coordinates are defined by magnitude and direction. To add a scale factor like mm or m you need to multiply these unit vector values with constants.


Don't see the cube under layout instead i see key frames. How can i get back the layout screen in 2.9 This is my 3rd day in Blender 2.9. When I go to the blender Layout tab I see the keyframes. When I tried to pull it down by holding the corner I get more layers of keyframes. How do I get back to the default screen that shows the cube? Here is the image.

Click on the little clock icon in the top left corner of Blender's window (arrowed below).

That will bring up the window selector and you can click on 3D Viewport to bring back your editing window:


What is a Point Density texture? I see Blender 2.76 now has a feature called "Point Density" textures. Is this a particle system? If so, how is it different from previous particle systems?

Point Density Textures are a way of rendering particles or mesh vertices as volumetric halos in Cycles.

A halo is basically a little volumetric ball.  You can accomplish essentially the same effect without point clouds by using dupliverts or a particle system with little spheres as particles.  However point density textures are much more efficient due to requiring a much simpler BVH, since the entire volume is within one object, instead of hundreds of thousands of little overlapping objects.

The above example uses a particle system with 250,000 particles and a turbulence force field.  To render it as a point cloud I created a "domain" object (a scaled cube) around the particle system and gave it a volumetric emission shader using the Density from the Point Density as the emission strength.  See this answer for how to set up a point density texture.


Extruding curve and editing non destructively How would the following be possible using Blender? The example image is from Cinema 4D where this is easy. The shape is made with one spline of which two instances are made and set as children for the extrude modifier.

I have a curve, which is extruded into two different parts. The two parts are mainly needed because I need to different textures for the different surfaces ("Top" and "Side" in the example).

I tried to use the curve's bevel/extrude options in Blender and can get about this shape, while still maintaining the object as a curve (ie. not transforming to mesh). But how can I apply different textures to the different sides?

The main point of this exercise is to keep the curve editable, so that the extrusions follow the editing (if I convert to a mesh I can't easily change the shape of the curve for the surfaces afterwards).

I don't think you can directly assign two different textures to a curve.
But as a workaround, you can use a Gradient texture.

I'm just mixing two colors, but you can mix any number of shaders/textures...


cloth animation not working after adding loop cuts on the edges so, I am making a scene, where I have a piece of paper, with a cloth animation on it.  (see image below)

I have a subdivision surface on the paper, but I want to have sharp corners.  My problem is, is that every time I add a loop cut to the mesh to get rid of the sharp corners, the cloth animation suddenly stops working.

working.  Does anyone know why this is happening.  And better yet, how to fix it?  thanks :)

Another way to sharpen edges would be the "mean bevel crease". maybe try this.

btw: I added a file to the question you commented on. Not sure, whether you'd get notified of that. :)
Cloth is colliding with some objects but not all


Grease Pencil: render is darker than what is displayed in the viewport 2D Animators question:
I have a material with a certain color, but in the rendering it appears a bit darker. See here:

Maybe there is an light or shadow source.
What I've tryed:

deleted  all light objects (see layers)

unchecked "use lights" in the layers properties (see grease pencil properties)

deleted the backround in the world properties

Here are also my render settings (opened up light and shadow settings. is anything else needed?) and

material settings

Try switching the color management to standard.
As far as I know the grease pencil is hopelessly coded in sRGB, so it will look dark if the color transform is set to filmic.


How many layers can I make in Blender 2.8 Couldn't find any info on how many layers can Blender 2.8 handle. I need like 70-100 layers and need to know what is the limit of layers amount?

There are no more layers in Blender 2.80. Layers have been replaced by Collections
I have no idea, how many of them you can create (the limit might even be your hardware here), but it is basically as many, as you wish.

If you create a new text block in the Text editor, type:

import bpy

for i in range(1,1000):
    C = bpy.data.collections.new("Collection"+str(i) )
    bpy.context.scene.collection.children.link(C)

and then hit Run Script, it will create 1000 empty collections. If you need that many, or if you start to worry about collection amount limitations chances are you are doing something very wrong. Don't worry about them.


How do I select the best Keyframe Interval for video encoding? The Keyframe Interval is set to 18 by default. How do I know if I should change this? I have Perceptually Lossless quality set. Will Blender adjust Keyframe Interval as needed or do I need to figure out what the best setting for my needs are? How do I figure out what is best for me needs?

EDIT: I am referring to the keyframe interval in the video encoding properties panel.

Assuming that you mean the keyframe interval in the video encoding properties panel (highlighted), this governs how often keyframes are written to the video stream. The default, 18, is one keyframe every 18 frames (or two-thirds of a second.)

As the tooltip states, there is a trade-off between file size and seekability. What this means is that when you seek through a file, the video cannot render correctly until the first keyframe -- this is the first frame of video data that is guaranteed to contain all pixels (the in between frames are "delta frames" and contain only partial information about what changed). So with fewer keyframes (with a large keyframe interval), when you skip through the video it will take longer for the video to "catch up" and start playing. However, because the keyframes do contain basically a whole screenshot, these frames take up more storage space. So if you have a small keyframe interval (lots of keyframes) then the resulting video file with be larger.


Bone rotation applied twice In this image, the top bone is rotated by 45 degrees, but the model is deformed like there was a rotation of 90 degrees. This also happens for translation and scaling.

For each vertex, the sum of the weights is one.

What am I missing? The code for skinning is inspired by the second piece of code here: Rigged mesh

Thanks

This is caused by multiple armature modifiers on the mesh. Delete one to get better results. Notice that for each number of armature modifiers on the mesh, it (the mesh) is bent again by the same angle.


How can I delete a large amount of Materials? So I am doing renders of SolidWorks models in Blender. The models themselves do not pose a problem for me, however I have noticed that when the materials tab, to be precise the list of materials is opened Blender slows down almost to a stop until I reload the current .blend file.

This is from one of the models I have already setup and rendered. In the actual model I've cleaned up all those materials and setup my own which number 15-20. In spite of this these materials still remain in my file and slow down my work.

I have tried using the delete addon I've seen in some answers to this question but that only leads to Blender crashing. Manually removing them with the "Minus" is out of the question, I've done it before for single instances. Having 3-4 models with 5000-6000 materials is not timewise efficient.

Some extra info how I've setup the materials - ctrl+L Making material links to objects having the same material type.

There are two ways to approach this problem. There's a tedious easy one, and there's a programmatic complex one.

The tedious answer has been alluded to in the existing answer and a couple of comments. I.e. Blender is designed to delete (skip saving) any "orphaned" data block, like a material, anytime you save a scene. Consequently, if you remove those materials from any objects so that they're not being used by anything, then when you close Blender and reopen the scene, they should no longer be there. There is a way, though, to force Blender to keep an unused data block, by giving it a "Fake user" by clicking the 'F' next to its name in the object tab. This makes the data block seem used, so that it doesn't get deleted when Blender closes. The solution is to (tediously) remove all of those materials from any object that's using them. Then close the scene.

The programmatic solution is to write a Python script which will do a lot of this for you. Depending on what your objective is, you might have the script look at each material, find the object(s) it's assigned to, and replace the duplicate material with some other material, so that all your objects are using the same material. There are other ways to approach the design, depending on what your goals are, but all of them should be relatively simple. For example, this script is very short, and does some things sort of similar to what you're trying to do to... maybe.

I hope that helps.


Adding already animated armature to a model I made a Manuel Bastioni model. I wanna add a downloaded animation to it. But the animation armature's rest pose is a T-pose while my model is an A-pose. so I can't add that armature to my model. What should I do? If I change the rest pose to match my model, the animation keyframes of the armature get messed up because they are relative to the original rest pose.

In principle you have to bring your mesh into the position that it matches the given armature. One way would be to create your own armature, position your mesh so it alligns with the downloaded armature and press "Apply" in the Modifier tab.

But probably the Sculpt Brush would be a better solution for you: https://developer.blender.org/D5647

Remember to make a backup of your file before you start modifying the mesh.


Rendering without fire when executed from command prompt I am rendering from command prompt and output file is something like:

expected:

I executed this command(My installation Directory):

set path="C:\Program Files\Blender 2.79\blender-2.79.0-git.ec20d311da4-windows64"

path to my .blend file:

cd desktop\blender projects

and then:

blender -b art.blend -E CYCLES -s 10 -e 10 -t 2 -a

  And I have saved my file too.!

Smoke simulations need to be calculated in order to have something to display on render.
When using Blender, the calculations are being made as soon as you playback from the start frame or when you start a render.

But! When using command line rendering, the render command only does the rendering, not the smoke calculations.
So before doing some command line rendering, you need to bake the smoke simulations, meaning you have to ask Blender to calculate the actual simulations and store the result into files, which will be later read when rendering. It's the way to go even with UI rendering anyway, as it's overall faster to bake then render instead of rendering and calculating the simulations on the fly, especially if you render it several times. And if gives more reliable results to have baked sims.

So basically, you just have to watch in your domain's parameters, in the Bake panel. Set the right Start and End frames, hit Bake All Dynamics, wait for it to bale everything (it might take a while) and save your file.

More information in the manual.


Transformation matrix problem with matrix_world, with different results based on the same values in different form When I created a matrix transformation in the console as follows,
blender file

>>> c2=bpy.data.objects["Cube.001"].matrix_world
>>> c1=bpy.data.objects["Cube.002"].matrix_world
>>> c1
Matrix(((0.2511853277683258, -0.9679380655288696, 0.0, -47.04343032836914),
    (0.9679380655288696, 0.2511853277683258, 0.0, 18.430648803710938),
    (0.0, 0.0, 1.0, 0.0),
    (0.0, 0.0, 0.0, 1.0)))

>>> c2
Matrix(((-0.7805679440498352, 0.6250709295272827, 0.0, -10.104384422302246),
    (-0.6250709295272827, -0.7805679440498352, 0.0, 6.641378402709961),
    (0.0, 0.0, 1.0, 0.0),
    (0.0, 0.0, 0.0, 1.0)))

>>> bpy.context.active_object.matrix_world = c1*c2
>>> h=c1*c2
>>> bpy.context.active_object.matrix_world = h

the graphical results of the 3D screen on the active object were different when keep repeating the same line like:

>>>bpy.context.active_object.matrix_world = c1*c2
>>>bpy.context.active_object.matrix_world = c1*c2
>>>bpy.context.active_object.matrix_world = c1*c2

The object keeps incrementally moving but another one of the following with a resultant h would't move, like the following:

>>>h=c1*c2
>>>bpy.context.active_object.matrix_world = h
>>>bpy.context.active_object.matrix_world = h
>>>bpy.context.active_object.matrix_world = h

I wonder it is a bug or something?

I think the two answers above pretty much explain what's happening. In case of assignments, we need to understand what's being assigned. Is it value or reference to the memory location (in C, it's called pointer)?

When one does an assignment like:

c1 = bpy.data.objects["Cube.002"].matrix_world

one essentially stores the reference of matrix_world in c1. So if c1 changes, matrix_world would change and vice versa. Since the active object in this case happens to be (I guess) one of the two cubes, let's say Cube.001,  whose matrix world references is held in one of the two references (c2), the assignment to that objects matrix_world with the following line:

bpy.context.active_object.matrix_world = c1 * c2

changes the value referenced by matrix_world. But this is also the value referenced by c2. So when the same statement is executed again c2's value is already changed. This should explain the incremental movement. (I missed this point before since I was thinking the active object is not one of Cube.001 and Cube.002 but the original Cube :).

This does not hold true for h, it's a new memory location, which contains the (static) product of the two matrices. This is static in this particular case since none of the operations are manipulating the value referenced by h. So no matter how many times you assign h to the matrix_world the object is not going to change.


Simple way to add button to UI I'm looking for the simplest way to add a button and a text input field to Blender's UI so I can use some parameters in my Python script.

I've tried a few tutorials but...

This one uses the word self which throws me an error (name 'self' is not defined)
http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Code_snippets/Interface#Using_scene_properties_to_store_information

In this one I cannot really see where the actual code to add to UI is
http://www.blender.org/documentation/blender_python_api_2_57_release/bpy.types.Operator.html

Plus a few others that I don't understand at all.

You basically need to combine two of the Templates in Text Editor that ship with Blender:

An Operator and a panel. In the panel's draw() method, you add an operator to the layout, which will be represented by a clickable button. Clicking it will run the operator's execute() method.

Here is an example how interface and actions play together:

http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Cookbook/Panels_and_Operators/Ping_Pong


How do I add a new vertex group? I'm working on eye animations, but the right eye bone isn't in a vertex group.

How do I create a new Vertex Group that will appear in the Vertex Group section of the outliner? The section in the screenshot below.

Vertex groups can be added in Properties in Mesh Data tab:


Joining 2D tracking markers with an offset Is there any way to join tracks with an offset (like can be done in After effects)?  I'm looking for a way to create a gap less 2D track. (It will be used only for 2D stabilization)

This is an example showing the situation in the footage.

Here are the two tracked marks that get blocked by a pole at different times.

I want to be able to use the tracking data from the black mark when the red mark is obstructed.

However if I simply join the two tracks there will be a jump in the path.

To track areas that are blocked by obstacles or temporary going off-screen. Move the tracking marker before the area is hidden by pressing GG and dragging the marker to another tracking point, or offsetting the marker in Track properties panel in Marker section by changing X and Y offset position. You can then continue tracking the scene under the offset tracking area until the original tracking area is visible again, then move the marker back using the same procedure.


How to weight paint more accurately I'm trying to weight paint the beak and the jaw of my bird,but I realize that I'm not able to get the result I want. Infact,when I weight paint the jaw in red and I rotate it on the X axis,it works,but the beak doesn't. When I weight paint the beak with the red color nor beak nor the jaw are colored perfectly.
I would like to know if I can weight paint only a part of the bird,not everything. For example,in edit mode,I have selected only the vertices of the beak and I have inverted the selection with CTRL + I and then I hid them because I want to weight paint only a specific section. Why I want to do this ? Because when I paint a specific region of the model in weight paint,the painting is not carefully and I paint also the borders of a region that I don't need. I don't know if I can do it in weight paint mode,so,I thought that I could do it in edit mode....check the attached video,thanks.

video

You can use face selection masking or vertex selection masking to select only vertices or faces, that You wanna paint on.This are options located on the bottom bar of 3D view port.


Replace Game Property with Variable When using Game Properties, you can change the value during the game.

Example: "prop" = 50     press r      then "prop" -= 5

After pressing "r", the property would subtract 5 from the original number, and then the new number becomes the "original" number.

Is it possible to do the same sort of thing with a python variable? So that i can have a variable in my code set to 50 when the game begins, get changed when "r" is pressed, but not revert back to 50 when the script is run in the next frame?

Example:

Start the game

prop = 50

Press R    (Just an example, not real code)

if keyboard.r = just_activated:
    prop -= 5

But when the script is run again, prop reverts back to 50

When using python in the game engine you can use a script or a module. While a script will be run from start to end, a module is a collection of functions that can be called indiviually, the "global" code in a module is run once when the module is first activated, which makes it a good place for a one off initialisation that you are looking for.

import bge

GameScore = 50
print('init once here')

def ChangeScore(cont):
    global GameScore
    ksens = cont.sensors["Keyboard"]
    sce = bge.logic.getCurrentScene()
    scoreDisplay = sce.objects['ScoreDisplay']

    for key,status in ksens.events:
        if status == bge.logic.KX_INPUT_JUST_ACTIVATED:
            if key == bge.events.UPARROWKEY:
                GameScore += 5
            if key == bge.events.DOWNARROWKEY:
                GameScore -= 5

            scoreDisplay['Text'] = str(GameScore)

Paste this into a textblock and end the blocks name with .py you then use a python controller, set to module and enter the textblock name without the py extension followed by the function name like sample.ChangeScore. You will see the "init once here" will only get printed once when the module is first run.


Convert any 3D Game mesh to OBJ for use in blender There are few games that deliver it's own Development Kit so you can decompile and modify the game assets in this case the geometry of the models by converting them to a general geometry file format that almost every 3D modeling software can use like Wavefront OBJ.

However, there are lots of games that don't deliver tools for unpacking the assets and some games even restrict it by encrypting the packages that contain the assets with proprietary encryption tools which you can't find anywhere on the internet to decrypt the packages.

My idea: Every 3D Game, no matter what engine it runs on and how well the asset encryption is, have one thing in common: they use geometry, meshes that has to be rendered by the graphics card.

Is there a way you can get in between the game and the graphics card to take the geometry that has been sent by the game to the graphics card and convert it into a obj file so you can use it in blender?

Nevermind! I just found a program that lets you get the geometry of any 3D game.

It's called NinjaRipper made by blackninja. It simply takes all meshes that are currently loaded in the system memory or the graphics memory (I don't really know where the model files go when a game is loading) and saves them.

However, it doesn't output the meshes directly .obj files, but it comes with a Blender add-on (along with add-ons for other 3D modeling software) that lets you import the .rip files. It also takes the textures of the models and saves them as .dds files.

So far NinjaRipper is the only program that is capable of "snapshotting" meshes along with their textures in almost every game. I haven't found a competitive program on the entire internet yet that does the same. I hope that the development of this awesome program continues in the future.


why Imported fbx tga from UE4 look black? why Imported fbx tga from UE4 look black? I'm a novice, and New to texturing and materials, so Please help me finding what am I doing wrong.

I exported a static mesh from ue4 then the textures as tga. I replaced one of the placeholder textures for the tgs, but everything looks gray or black.

Can somebody teach me how to apply tga textures properly in this case?

Blender file attachment

You are having this issue because texture parameters in the materials are set wrong, instead of using the texture as diffuse color it is used as normal value.

To fix that, in each texture enable Color influence and disable Normal influence on the Geometry


How does Blender implement flat shading non-planar polygons? Following up on my recent question on ComputerGraphics.SE — how is flat shading of non-planar polygons implemented in Blender?

If polygons are rendered using GL_TRIANGLE_FAN in OpenGL, one approach would be to upload a single normal vector for every individual polygon that's rendered. This might not be very efficient though.

On the other hand, if polygons are split into triangles before everything is rendered, then these triangles somehow  have to share a normal vector. This sounds more like glDrawArrays() than glDrawElements(), which again might not be the best solution.

Blender's face normals are calculated as follows:

For quads, we use the cross product of 2 edge vectors which don't share a vertex.
For polygons, we use Newell's Method.

To draw with these normals, we store the tessellated triangles and simply copy the normals calculated from the original faces, into each of the tessellation triangles normals (which is sent as a buffer to the GPU).

See: gpu_buffers.c for details (though you will probably want to see how this API is used by other files to see how it works).


Why won't eyes move with the rest of my mesh? Why won't the eyes on my elephant move with the rest of my mesh. I created them in edit mode, parented them to the body and reapplied automatic weights.

In short, make sure that other bones aren't also affecting the mesh where the eyes are sitting.

More specifically, you should parent the eyes to whatever you have set as the head's bone as well. Ensure that other bones aren't affecting the mesh of the head. Visually, you would want the area around the eyes paint weighted red, and the eyes as well. When reviewing the other vertex groups, the area around the eyes should be blue, with 0 weights set to that location. This will ensure nothing else is affecting that area.


How do I reduce tesselation effect with textures? I need a few urban and environmental textures (concrete, stone, bark, dirt, ...) and I plan to create them myself. After I make the textures how can I place them on large objects in Blender to preserve high resolution but still reduce the repetitive effect in the resulting renders?

It's in the creation and size of the texture that determines the quality of "tiling" over large objects. There are many ways to create a texture. You seem to be interested in photographic textures. The key to success here is to have flat even lighting and a camera that is perpendicular to the subject. If you want to optimize the result the camera should be stationary (IE a tripod). High resolution is also important in the original capture.

In the texture itself, for 3D rendering, the “Power of Two” is important. One potential reference http://www.katsbits.com/tutorials/textures/make-better-textures-correct-size-and-power-of-two.php there are many others. The Blender default is 1024 x 1024. I use 2048 x 2048. I believe larger file sizes (in the current environment) offer little advantage and can even slow the system down. There can always be exceptions.

*Depending on the pattern of the original image capture/texture some modification most likely will be necessary to facilitate tiling. Every image/ texture is different but here are some bullet points to follow in creating tillable textures (assuming the above).

Remove from the original image capture any “stand out” features (Like a large blemish on a slab of concrete or maybe a knot in tree bark).
Duplicate the image and scale the height -100% and the erase/delete part of the top or bottom. Flatten.
Repeat the previous for the width.
Use the new texture and make adjustments if necessary.

*The use/knowledge of image editors like Photoshop/Gimp is key here.  But this is not the forum for me go into that level of detail. Hope this was of some help. Maybe I should do a tutorial?


Make python script to animate vertex points of any object I am very new to blender and python . i want to make python script which can animate the vertex point of any object (let's example bpy.data.obajects['Cube'])

import bpy

obj = bpy.data.objects["Cube"]
obj.shape_key_add(name="Basis", from_mix=False)

block = obj.shape_key_add(name="1", from_mix=False)

block.value = 0.0
block.data[0].co = (0,0,0)
block.keyframe_insert(data_path='mute', frame= 0,index=-1)

block.value = 1.0
block.data[0].co = (1,1,1)
block.keyframe_insert(data_path='mute', frame= 50,index=-1)

the above code steps works when i set it up by GUI blender , but In script it just set keyframes but no actual animation occur on play

import bpy

cell = bpy.data.objects['Cube']
bpy.context.scene.objects.active = cell

basis_key = cell.shape_key_add('basis')
basis_key.keyframe_insert('value', frame=0)

deform_key = cell.shape_key_add()
deform_key.data[0].co = ( 5 , 5 , 5)

deform_key.value = 0.0
deform_key.keyframe_insert('value', frame = 0)

deform_key.value = 1.0
deform_key.keyframe_insert('value', frame = 200)

the main difference in your script is that you set your data_path as "mute" , so just replace data_path="value" then it will work fine


How to apply Effect Strip in Video Sequence Editor Can I apply and remove an Effect Strip, for instance the Speed Control?
I mean like the modifiers, when we Apply them we also remove the controls. I want to remove the strips in the Video Sequence Editor but let the changes.
Thank you for your attention.

The command I was looking for was Make Meta Strip (Ctrl+G).


Match Orthographic along normals? If i were to rotate cube 23 degrees then go to orthographic view, it would be difficult to line up the viewfinder (in orthographic) to be flush with the object. Is there a function that makes this easier or does this for me?

Thanks

Ctrl+Shift+Numpad 7 will align your view to the normals of a selected face.


Python Opengl Render doesn't show texture when I click opengl render button in the GUI of the 3D view, the rendered image contains texture. However, when I use python script to render the same thing, I only get solid image without texture.

bpy.ops.render.opengl()

How can I make it so that script rendering also render with texture?

Thanks in advance!

If you can render from the GUI button I assume that you have the method to display/shade objects in the 3D view set to Texture.

With that out of the way the only thing that you need to do is to set both the write_still and view_context to True like this:

bpy.ops.render.opengl(animation=False, write_still=True, view_context=True)

If you only set one of them to True you get the solid display


How to define customized property in Material? I'm working on my addon for Blender, which is a simple offline renderer.
I'm stuck at the material system for two days.
I would be much appreciated if anyone gives me a pointer.

The issue is that in order to implement my own material system, I have to store my material information in the context.material class, however I've no idea how to add a customized property for this class.
I noticed that there are customized property for other external renderers, such as this one:
http://www.mitsuba-renderer.org/
There is a property named "context.material.mitsuba_material".
What I want is something like "context.material.my_material" so that I can store my material information there.

I also found this class in the render addon script:

@MitsubaAddon.addon_register_class
class mitsuba_material(declarative_property_group):
    '''
    Storage class for Mitsuba Material settings.
    '''

    ef_attach_to = ['Material']

I believe it has something to do with this customized property, however I got no luck by implementing myself.

Forgive me if it is a silly question and I did googled it, got nothing useful yet.

I believe all you need are bpy.props properties. The first example even demonstrates it for bpy.types.Material. Here's an extended example, that uses some additional options for a FloatProperty and adds it above the Material list in Material tab, so you can try it out:

import bpy

def draw_func(self, context):
    layout = self.layout
    ob = context.object
    layout.prop(ob.active_material, "my_material")

def register():
    bpy.types.Material.my_material = bpy.props.FloatProperty(
        name="My Material Property",
        min=0.0,
        max=10.0,
        default=5.0,
        subtype='FACTOR'
    )
    bpy.types.MATERIAL_PT_context_material.prepend(draw_func)

def unregister():
    del bpy.types.Material.my_material
    bpy.types.MATERIAL_PT_context_material.remove(draw_func)

if __name__ == "__main__":
    register()

You can add your custom properties to a full, custom panel too of course.

If you need to add plenty of properties, use a property group and a PointerProperty to organize them better (and avoid name conflicts with existing properties).

If you need a varying number of a group of properties, use a PropertyGroup to define the properties per occurrence and supply it to a CollectionProperty as type.


How can I animate data using blender python? I have imported data from Matlab and want to use this to animate the rotations of two objects that I have already created in the scene. The loop I have created does not end up changing the object's rotational orientation on each keyframe; the animation is static and the objects do not move at all. If someone could point out an error in my code or my approach that would be greatly appreciated.

Thanks in advance.

import bpy

from math import *
from mathutils import *
import numpy as np

ob1 = bpy.data.objects['Retriever']
ob2 = bpy.data.objects['defectsatellite']
bpy.context.scene.objects.active = ob1
bpy.context.scene.objects.active = ob2

#Import the data from matlab "Equation Analysis" script
rot1 = []
rot2 = []
x1 = np.loadtxt('C:\\Users\\Owner\\Desktop\\Math499\\Scripts\\defectsatelliterotation.csv')

for i in x1:
    rot1.append(i)

x2 = np.loadtxt('C:\\Users\\Owner\\Desktop\\Math499\\Scripts\\retrievalsatelliterotation.csv')

for i in x2:
rot2.append(i)

#Set up key frames, controlling the rotation of each satellite.

#First extract every fifth row
def altelement(x):
   return x[::10]

rot1 = altelement(rot1)
rot2 = altelement(rot2)

sce = bpy.context.scene
bpy.ops.screen.frame_jump(end=False)
frame_num = 0

for j in range(0,len(rot2)):

    bpy.context.scene.frame_set(frame_num)
    ob1.rotation_euler.x = (rot1[j])
    ob2.rotation_euler.x = (rot2[j])
    sce.update()
    ob1.keyframe_insert(data_path = "location", index = -1)
    ob2.keyframe_insert(data_path = "location", index = -1)
    frame_num += 1

You just need to change your keyframe statements:

ob1.keyframe_insert(data_path = "rotation_euler", index = -1)
ob2.keyframe_insert(data_path = "rotation_euler", index = -1)


Why is Blender so popular for 3D printing? In a recent news by i.materialise I saw that Blender is the most popular 3D modeling software for 3D printing (complete ranking here: http://i.materialise.com/blog/top-25-most-popular-3d-modeling-design-software-for-3d-printing).

Personally I have the feeling that it's quite hard to turn a Blender design into a 3D print. Am i missing out on something? Do you guys know any easy tricks/tools to make a Blender model 3D printable?

(Sorry if this is more of a comment, I can not comment on questions as of yet.) Well there is of course the obvious: Blender has a bundled addon called "3D Printing Toolbox" which lets you easily check for errors (non-manifold edges, faces too small to be accurately printed, overhangs, intersections) and measure statistics (area, volume, dimensions).

Go to file --> user preferences --> addons --> type : 3d print --> check the 3d printing toolbox


How to remove vertex slide? I used vertex slide for a shapekey. Everything came out great, except that when I go back to edit mode everything is deformed due to the vertex slide. I believe if I had used scale I could have gone back to object mode and alt + s to "undo" the deformation. However, resetting the scale, position, or rotation of the object seems to have no effect on vertex slide. Any fixes?

In Edit mode you will see and edit the active shape Key only , but when you switch to Object mode you will see a mix between shape keys depending on the value of each shape :


HDRI not appearing as the background I am trying to get an HDRI image load on a small project I am working on. When I go into Shading to set it up, and switch over to Rendered view nothing shows up.
I would really appreciate a solution for this

Disable "film > transparent" in the output settings.


Is it possible to change image texture after Render? As the title suggest, I have just discovered the wonderful blend4web, the current project I'm working on requires me to be able to change the image on my render outside of blender.

I've been able to achieve this somewhat with babylon.js, but being the complete novice I am at javascript it's difficult to fully impliment what I want.

So basically, I have a plane for example, with a image mapped onto it, export out to blend4web, and I would now like a way to change that image via the code inside the html document, without needing to go back into Blender and change it?

Is this possible?

First, check version of blend4web:

Before 17.08:

//load modules:
var m_tex       = require("textures");
var m_scenes    = require("scenes");

//get object
var obj = m_scenes.get_object_by_name("_object_name_");

//change texture in object
m_tex.change_image(obj, "_texture_name_", "_image_URL_" );

After 17.08:

var m_scenes  = require("scenes");
var m_tex = require("textures");

var obj = m_scenes.get_object_by_name("_object_name_");
var image = new Image();
image.onload = function() {
    m_tex.replace_image(obj, "_texture_name_", image);
}
image.src = "_image_URL_";

Where:

_object_name_ is the name of your plane in Blender:

_texture_name_ is the name of texture data block  in Blender:

_image_URL_ url of your image in web.

More information:

https://www.blend4web.com/api_doc/module-textures.html#.replace_image

Live example:

https://www.blend4web.com/apps/code_snippets/code_snippets.html?scene=change_image


How to un-extrude an object? I was making a cup handle so I extruded a face of the cup, then however I right clicked and thought that would undo it. I didn't notice the dent it left though, after that I did a bunch of smoothing on the cup and then when I went back to extrude it, it didn't create the smoothing I wanted. That's when I noticed the dent, I decided to make the handle on a different face, but is there any way I can remove the ugly dent?

P.S I am a beginner so please don't be angry with me for thinking right click was undo.

P.P.S Cup is on layer 2.

It seems you have extruded several times but did not moved the extruded vertices.

In this particular case, to remove that:

Select the top extruded face (CtrlTab then choose 'face' and right click to select the face)
Use CtrlNumpad+ to extend the selection. Do that several times. You know you are ok when the selection come to the surrounding parts, when it is deselect twice using CtrlNumpad-
X to delete the selected vertices
CtrlTab then choose 'edge' this time
AltRMB to select the edges surrounding the hole
F to remake the face


Applying Mirror Modifier with Shape Keys on a rigged Model Question:
Is there a way to quickly apply a mirror modifier on a rigged character with shape keys?

Story:
I have a rigged game-character and use shape keys to later transit between a muscular and thin person ingame. I use this procedure for clothing as well. Since its not possible to apply the mirror modifier with shape keys the FBX export fails to export the shape keys, which makes it impossible for me to use them in my game.

After intense searching i found out that this is partly possible to do by Hand. The next problem is the Weight-Painting. Since i duplicate my low poly character, to model my trousers or shirts, I need the exact same weight painting, which will not be mirrored correctly during the process I mentioned.
Further research explained me how to mirror the weight painting by hand. My Problem is, that i have to do a lot of Models for the game and it will too much time to do everything by hand.

I doubt that i am the first to have this problem and hope someone resolved this already.

Thanks!

For anyone who still wants to know (P.S. I did this in Blender 2.79):

This doesn't fix it entirely, but....

You can remove the mirror modifier,
and duplicate and then reverese the vertices onto the other side.

(E.g. move 3D cursor to centre of mesh, duplicate verts, and scale along x-axis by -1 around the 3D cursor)

Some of the shape keys might be close enough.
But some may need tweaking.

Depending on how lucky you are, this may or may not be easier than removing shape keys, applying mirror modifier, and re-do-ing all the shape keys again :/


Shadowcatcher, how to separate shadow and object I'm currently trying to render some assets (in cycles) for an application I'am developing.
As I need objects to appear separately the idea is to have object A, shadow A, object B, shadow B and so on so I can draw all shadows first (I'm aware there might be some shadow overlap then) and then the objects on top.

I have a groundplane which I currently have set to be a shadowcatcher.
This works fine, the "problem" is the output, as it combines object and shadow and I can't seem to find a way to get them separately.

I also tried moving every object to a different View Layer (currently trying it in 2.8) to get the objects separately later on, turning on shadow in the view layer properties for  each layer.
This, of course doesn't give me the shadow on the ground plane anymore, as it's on another layer.

I guess I'm just overthinking it and there must be an easy solution to get object|shadow separately for different objects.

Any help would be greatly appreciated!

Cheers,
Daniel

Your question is a bit confusing as to what exactly you want. Anyway, here is a way to split basically every object and shadow however you want, if this isn't exactly what you want you can definitely alter it with the methods shown in the nodes.


Trouble installing a script file of an addon (threejs export) I placed the threejs script export_threejs.py in %appdata%\Blender Foundation\Blender\2.71\scripts\addons, but it does not show up in the addons list in User Preferences.

When I try to install manually nothing happens.

export_threejs.py is only part of an addon, you need all of files or it won't work.

https://github.com/mrdoob/three.js/tree/master/utils/exporters/blender/2.65/scripts/addons/io_mesh_threejs

A __init__.py is crucial, because it contains the bl_info dict to make it a Blender addon, and it loads the other files.

In your ...\scripts\addons\ folder, there needs to be a subfolder (e.g. called io_mesh_threejs) with all 3 files of the addon inside.

In order to use Blender's Addon Install from file... feature for addons with multiple files, the mentioned folder with the scripts (io_mesh_threejs) needs to be zipped and you select that zip-file.


Poliigon.com leaf textures I'm new here and I started working on making an ultra realistic tree.

I made a nice bone on which I should continue working, but when I previously made something like this the leaf texture was cut in two parts"

front leaf
back leaf

For some reason when I got the texture from Poliigon.com, the back and the front are merged together. I'm 90% sure there s some trick to that which will make my work so much easier, but I can t see it.

Here s a pic of how the texture looks like:

https://www.dropbox.com/s/5ezth42nmoxs7bq/floare..png?dl=0

Thank you in advance for your answer

Mirror UV

Once you unwrapped the geoemetry, I would duplicate the uvmap with the "+" button on the right and then flip the UV islands on the other side of the texture. This way you just have to pick the right coordinate (in cyles for example the UV node as shown below) for two istances of the same texture and mix them with backfacing factor.

Reynante Martinez wrote an article about Double-Sided Texturing in Cycles, you can read it at: http://www.reynantemartinez.com/double-sided-texturing-in-cycles.html.

You can also take advantage of the Vector Mapping node to automatically flip your UV so you'll even not need to duplicate your UV map.


Mirror modifier on the same axis is actually opposite I have joined two objects: the body, and arms, which i imported from another file, and I'm trying to connect them. Both have mirror modifier, that i would like to keep.  When i use bridge edge loops, the loops go to other side of the mesh.

Apply both mirror modifiers, perfom the brdige edge loop operation on one side, then select and delete all the other side and re-add a mirror.


Resource for Blender addons? Trying to keep track of the updates to all the great, user-developed add-ons is fairly frustrating (at least for me). Is there currently a centralized resource where all these amazing add-ons are kept and updated in one location?

If there isn't such a resource, would it be possible to have blender query the collection of installed add-ins and then iterate through on-line references looking at version #'s for add-ins?

Since, as far as I know, it hasn't been done...I have to ask if there are any major flaws in the concept. Of course, in my dream scenario, there would be a "voting" front-end that would allow users to see what the most popular and useful add-ons are and where you don't have to read pages (and pages) of threads.

There are a number of online resources available that keep track of a number of Blender Addons, though I am not aware of any one centralized site that covers all of them.

Your first go-to resource is going to be the Blender Wiki's Scripts page, which keeps up-to-date information on all of the addons that come packaged with the Blender installation, as well as several others.
Another valuable resource is the unofficial Blender Addon List, a listing of many Blender addons maintained by Daniel Banasik.
Yet another resource is Graphicall.org. I am aware of a number of different user compilations of various scripts, but perhaps the largest of these is on this page.

The short answer to your question is that these resources are scattered everywhere, and while there are some that cover a large number of Blender addons, there isn't yet one location that keeps track of all of them.

Furthermore, the process of pulling these resources into one centralized location would be a logistical nightmare, with whole hosts of differences between how different scripts handle updates, as well as certain scripts being made obsolete by updates to new versions of Blender. I won't say it can't be done, but it would certainly be difficult to keep track of those things any better than the resources already out there.

Edit: zeffii also pointed out that you can get a zip with the most recent version of Blender and all user-contributed addons at builder.blender.org

Update: Added the Blender Addon List and removed a link to an inactive resource.


Change speed between particles appearing/dissapearing? i created a particle system and the movement works great, also along the time (470 frames at 60fps) works great too BUT the only little thing that is still wrong is the time of the particles dissapearing, is still too fast and it looks bad..
Is there any way to change this? (when the particles appear, and dissapear?)
I'm starting to work with particles, so i'm really new on this but also i'm really interested.

Please help!
Thanks in regards.

Increase the Random property under lifetime. This controls the pseudo-random lifetimes per particle.


Path animation ease (non-linear speed)? I created a very simple animation. I added a curve, and let the cube follow the path. It works, but the speed is constant. The pink line seem to be the position on the curve. Can I make this line a bezier instead of a straight line?

Here is the Blender file: https://gofile.io/?c=04aPgs

Look in the properties panel of your Graph Editor (displayed with N), it looks like you've automatically generated a Modifier > Generator. You can modify it but you won't be able to add keyframes or manipulate handles. So:

Close it.
Create 2 keyframes at frame 1 and frame n:
On the Timeline, put your cursor at frame 1 and give the Evaluation Time of your curve a value of 0 and insert a keyframe with i.
On the Timeline, put your cursor at frame X (for example 50) and give the Evaluation Time of your curve a value of 100 (for example) and insert a keyframe with i.
Now, in your Graph Editor, you can see the curve and handles that have been created, you can manipulate the handles, change their type with V or create new keyframes with i.


Playback from start instead of from current frame? I'm doing a smoke simulation right now, and I would love playback to start from my inpoint everytime I hit alt+a instead of running from the current frame.

Is that possible?
Looking at bpy.ops.screen.animation_play it doesn't seem so....

Press Alt+A then hit Esc (while mouse in the 3d view) and then press Alt+A again to start from frame one. If this doesn't work you should open once your timeline and move once your mouse at frame one.


Change Bones Axis Blender 2.8 I've had a problem the past couple days with animating my rig on the left side.. every time i upload a animation and rename all the bones to the rig on the right, the axis of the bones are wrong and it turns into a side scrolling animation. how can i change the bones axis/Orientation to the right rig?

You can change a bone's axis by going into edit mode, selecting the bone, and pressing Shift + N. then you'll be able to change the transformation axis

https://imgur.com/ByO5yQa


Donut tutorial: Condensation for coffee cup not adding I'm doing the donut tutorial. I'm on Part 5, Level 3: Condensation. At 18 minutes Andrew adds a condensation tuxture. I've added a material and the faces I select can change color and I assigned it. I've watched and retried this 5 times, but the texture will not add to the cup. My nodes are exactly like his. A download link to my project is below. Can anyone help?

I tried your file, it works fine after I relinked the image from my local drive. Maybe the image link is broken? Did you assign the material in Edit Mode? there is my screenshot of all the windows.


How to Show Face Center Dot in Blender 2.8 Solid Viewport Display Mode? I rely on the face center dot to know at a glance I'm in face selection mode. In Blender 2.8, these dots appear on all faces when the viewport display mode is set to wireframe; but for me they do not show up when the display mode is set to solid.

(I know this question has been asked with regard to Blender 2.79, but 2.8 is so different that the answer to that question doesn't seem to apply.)

I've looked everywhere for a configuration setting. I expected to find something in the Overlay settings, but did not (and also for reasons I don't yet understand, half the items in the Overlay settings always seem to be grayed out).

I have attached an image. The object is in Edit mode, set to select faces, and one face is selected. The picture includes the Overlay popover and the viewport display options in my Properties window.

What can I do to make the face center dots always show up in Edit mode? Or at least in non-rendered views...

You have to check Center in the Mesh Edit Mode section of the Overlays options.


Display and set internal operator properties from custom Panel UI I've been attempting to display operator property attributes from a Panel interface with the following code:

class MyPanel(bpy.types.Panel):
    # ...
    props = row.operator("my.button")
    row.prop(props, "foo")
    row.prop(props, "bar")

class MY_BUTTON_OT_Button(bpy.types.Operator):
    # ...
    bl_idname = "my.button"
    foo = bpy.props.FloatProperty()
    bar = bpy.props.BoolProperty()

This does display the properties, but they appear to be static and I cannot set their values from the interface.

From what I gather, the operator-specific draw() function is only used when the operator is explicitly called from a menu. Is there any similar way to define an operator interface inside a panel?

The properties of an operator only exist for the duration of the operator being run. When placing a button in a panel you can include a single property value like this:

row.operator("my.operator").property = 271

When the operator is run by clicking the button it's property will be set to 271.

If you want to pass more than one argument assign the returned instance of OperatorProperties to a variable and modify its attributes:

operator_props = row.operator("my.operator")
operator_props.prop_name1 = 42
operator_props.prop_name2 = "foo"

Another way to have more than one value available that can be set in a panel and used by an operator is to move them to a location that can be accessed by both the panel and the operator.

These could be global module variables that are defined in your script but outside both the panel and operator classes.

You could create a property for the Window Manager. Items stored in the ID dictionary of the Window Manager are not saved to the blend file. You might use a PropertyGroup to easily pack your properties.

bpy.types.WindowManager.my_operator_props = \
    bpy.props.PropertyGroup(MyPropertyGroup)

bpy.context.window_manager.my_operator_props.prop = 42

The operator could retrieve these in its invoke method to initialize its own properties.

If you make your script an addon you could also create a bpy.types.AddonPreferences subclass to hold your settings that can be adjusted in the preferences and also displayed in a panel for easier access.


Scripting: Is there a way to test if an object has shape-keys? Is there a way to test if an object in Blender has shape-keys or not?

Access shape key data via the object.data.shape_keys object, and the actual shape key blocks through object.data.shape_keys.key_blocks collection:

import bpy
# Reference active object
o = bpy.context.object

# Check if object has any shape keys at all (will be None if not)
if o.data.shape_keys:
    num_of_SK_blocks = len( o.data.shape_keys.key_blocks )
    print( "Number of shape keys: ", num_of_SK_blocks )


Apply transforms to all objects I'm importing a .obj file(s) from another software that results in changes in scale and location. I don't want to have select all objects individually and apply scale and location changes. I've tried the following:

import bpy

bpy.ops.object.select_all(action='DESELECT')
if bpy.context.selected_objects ==[]:
    for obj in bpy.context.scene.objects:
        if obj.type == 'MESH':
            bpy.context.object.location = (-6.0, -3.0, 0.0)
            bpy.context.object.scale = (0.001,0.001,0.001)

It selects one object and that's it. Any help would be appreciated! Thanks!

I am not sure why you are worrying about selected objects. You are running code for all scene objects. If you wish to change all scene objects, that are 'MESH' type that will do it:

for obj in bpy.context.scene.objects:
    if obj.type == 'MESH':
        obj.location = (-6.0, -3.0, 0.0)
        obj.scale = (0.001,0.001,0.001)

If you wanted to run the code for every selected object it would be:

for obj in bpy.context.selected_objects:
    if obj.type == 'MESH':
        obj.location = (-6.0, -3.0, 0.0)
        obj.scale = (0.001,0.001,0.001)

The code you have

bpy.ops.object.select_all(action='DESELECT') # deselects all
if bpy.context.selected_objects == []: # checks if nothing is selected
    for obj in bpy.context.scene.objects:
        if obj.type == 'MESH': # for every object in the scene that is 'MESH' type
            bpy.context.object.location = (-6.0, -3.0, 0.0)
            bpy.context.object.scale = (0.001,0.001,0.001)
            # it changes the location and scale of the same object that
            # happened to be active before the loop started


Figuring out FOV and Angle for a Reference? How to use a Reference Image? I want to start modeling a character from multiple references. The original references are just images of the character and are NOT standard references -  which means I should calculate the Angle of the camera, Fov etc. What should I do?

Another problem that I've had, is about references in general . I've been using background images to load references ever since I started working with Blender, because if I used images as planes it'd go invisible if I were to go to wireframe mode. But images as planes seem more comfy and easier to use. Is there a way to avoid this (to still being able to see the image when in wireframe mode)?

Images as Planes are textured plane geometry, so they can only be viewed in Texture, Material (LookDev), or Render mode.  Use the Empty/ImageType for your background image.  Select your camera view in the viewport. (numpad 0).  Then Add->Image->Background (in 2.8).   This will create the ImagePlane square to your camera view.  In the Properties -> Object Data choose the Back depth or Default Depth.  Just remember that you cannot render the background image in your final render, but you can render it in Viewport Render from the View menu.