text:
Syncing action and lips of a charecter with pre recorded voice over
I am trying to animate my character according to the pre recorded voice over, but the problem is my 3D view port is running at 3 FPS, and I want my animation at 24fps.
I wonder how complex scenes in movies are animated if it is too slow.
Anyway, is there any work around to complete my job?
I also want to to know what are the hardware specifications I should have to play my viewport playback at required FPS

Please share screenshot, where we can see your scene and modifier stack.

There are a few approaches you can try. I would first enable Simplify to make the scene a little lighter while you're animating.
Another way to make your animations run faster is to split up the blend file into multiple files, and use them as linked libraries. You'd have one file with the rigged character model, another one with the scene, and a third one with the animation data. You can then link the rigged character into the animation file, make a local proxy of the armature, and animate the character. Because the animation file doesn't contain the rest of the scene, your computer will have an easier time moving from frame to frame. Once you have the animation the way you want it, you can link the animated character into the scene for lighting & rendering.


text:
I am not getting the minor radius for even after scrolling down.

when i am selecting torus this(image attached) is what i am getting and there is no option of changing minor radius.

What you want to change is only available just after the object is created. After that this is considered as a simple mesh with no particular property (like torus properties).

https://www.take-a-screenshot.org

source: Stack Exchange

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

sort: votes


text:
How can i give a melting vibe to an object?

King of like this, i tried to use the fluid simulation but it does not stick to que object like i want.

Look at the icing portion here: https://www.youtube.com/watch?v=JYj6e-72RDs  and see if that might help.

Probably easy to achieve using a cage modifier

https://blender.stackexchange.com/questions/67088/making-a-solid-mesh-melt

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


text:
Cycles standalone Render Layers and Composite nodes
The Blender version of Cycles can use the result of specific render passes as the final composite image.
For example, normals can be rendered instead of the regular image, as seen in the image below.

I would like to do the same in Cycles standalone.

Saving the scene shown in the image to a .blender file and converting it to Cycles standalone API didn't export the Composite node
There aren't Render Layers or Composite nodes in the Cycles XML nodes source code

What is the best way of capturing the result of render passes such as Normal, AO, Shadow, Emission, etc. in Cycles standalone?

Can it be done through the XML API? From what I've seen so far, it doesn't seem possible.
Can it be done by modifying the source code? If yes, can anyone point me in the right direction?

Cycles is a renderer. It provides the data that a compositor can use to combine the data to a final image. Blender's compositor is written inside blender and cannot be run outside Blender as it is tight related to other parts of Blender's pipeline.
So basically the answer to your question is no, you cannot do it via the XML API of Cycles as it does not know anything about compositing; except producing the combined pass, which cannot be influenced.
You can always modify Blender as it is open source, but there are other channels that are better to ask these development questions, like IRC or https://devtalk.blender.org/

I created a related topic on the devtalk page: https://devtalk.blender.org/t/output-result-of-individual-passes-in-cycles-standalone/200/1


text:
Where can I find Zero Brush in Blender
I am new to Blender. I just download it and start my learning here. I have question about Grease Pencil...I don't see Zero Brush menu when I press my short cut key "T" and I don't see it in my search menu either...Please guide me through it if you know thanks!

This is a commercial addon you can find at BlenderSensei.com - you need to buy it and install separately.
https://blendersensei.com/zero-brush/


text:
Bending sharply for edges of cylinder
This may have been answered in another post but I quickly skimmed over the answers there and they didn't look like they would help
I'm making a bow but I'm struggling with the string. I'd like the ends of the string to fold inwards.
Right now it's doing this.

But I'd like it to do something like this in the one mesh

I've subdivided it once but I haven't made much progress with that. Is there something I'm missing or should I subdivide it more? I've also tried to use armatures but it just isn't working for me.

What do you mean "ends of the string to fold inwards"? If you want to prevent ends of the string going through the bow then just grab vertices in the endings slightly inwards or scale the string a bit down

My intent is for the string to go in a dent in the bow, but I'm struggling with bending it in general.

See https://blender.stackexchange.com/questions/34598/how-to-curve-my-mesh


text:
Random triangles are appearing in Blender 2.81
Random triangles are appearing and disappearing and i can't figure out why, this happens with any complex model I create or import, anyone has any idea?
My drivers are updated, this only happens in Blender 2.81, Blender 2.80 works fine, even 3ds max works fine.

Can't tell if those are relationship lines or real geometry, can you provide a .blend?

https://www.mediafire.com/file/jndw6vqutn3ha3r/MeshProblem.blend/file
Here is the blend file, play the animation and watch the vertices go crazy, if the problem does not happen for you, then i can assume it's my PC's fault.

Animation runs until frame 48, all looking fine here Edit: I'm using the latest Buildbot build

Thats weird, then its my pc that cant handle 2.81 for some reason

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


text:
Iris Round Transition
I recently began a project and I would like to implement an "Iris Round" transition in Blender. This is where a circle closes in on the frame, almost like at the end of some cartoons. I thought something like this would work:

It would work if I was able to keyframe in edit mode, but does anybody know how this can be done?
Thanks!

You could use shapekeys.

This is probably a lot more practical to achieve in post production in the compositor

So long as the hole is not completely closed at scale 1, you can animate the scale in object mode, can't you? Or do you need the exterior rectangle to be in shot?


text:
Reflections showing wave pattern after adding plane
We actually it is quite hard to describe my problem with only using words.
1
My problem is this weird wavy contour. Without the plane underneath the can, the reflections look fine (like in the bottom part), but even when I use the standard Glossy BSDF on the can and a plane with Diffuse BSDF this problem occurs.
Using a higher roughness on the can doesn't change much except that the border between the black part and the correctly reflecting part becomes less prominent.
I am using two area lamps that are lighting every other object correctly.

In this I am using a HDR image for world lighting and a plane without any specific material and now the bottom part doesn't reflect like it should.
Also, the mesh isn't faulty or something in that particular place and if I look at the can from another angle the intersection moves.
I would like to know what I did wrong and I'd be glad for your help.

Your cylinder is not truly round. Try adding a Subdivision Surface Modifier and/or in Object Mode Smooth. You can see it in the second image if you look close to the top.

This is the proper reflection of a curved surface. the peaks of the wave pattern are actually just the corners of the plane.
you could reduce the effects by changing the camera angle or the size of the plane. maybe it helps adding walls and making the plane more of a rectangle than a perfect square.
And the reflections aren't wrong in your second image. the bottom part is just the reflection of the plane.


text:
Loading obj file, loosing texture
I am fairly new to Blender. I downloaded that file:
[https://free3d.com/3d-model/salmon-44387.html]
and tried to import it in Blender. It works great but I am losing all the textures. I googled around
https://blenderartists.org/forum/showthread.php?220278-Imported-OBJ-file-no-textures
FBX import not rendering textures, though look linked properly
but could not find a satisfying answer.

Possible duplicate of .fbx export why there are no materials or textures?

@DuarteFarrajotaRamos nope that a dup of that at all. This is importing not exporting. completely different issue.

This is how to do it in the cycles and here is blender internal.


text:
Blender Texture Paint a Voxel Model - 64px x 64px texture - Need Pencil/Voxel Brush
I am trying to texture paint my voxel model (9k triangles). I managed to unwrap it and to create the texture.
The thing is I need solid colors and I need a voxel/pixel brush, also if I paint over a color the color becomes brighter which is weird. It has to overwrite the color.
Is there somewhere such an option for my needs?
- pencil
- Overwrite colors
I really struggle right now. Probably there is even a better workflow.

You could also look at using vertex paint which would allow you to paint the colors as you touch the mesh tvertex, and then maybe you could bake the colors to the uv image.

Below your color picker there is a Box named Blend and its set to add which is exactly what you said: It will make your color brighter every time. Set it to Normal or Mix (Im not home right now so I can't lookup)

Thank you very much, it was mix. This already helps me a lot.


text:
I need to export a rigged Blender model to Maya
I am supposed to move a model I have built in blender into Maya. The model looks fine in blender, but no matter what I do I can't get it into Maya properly. I understand that the constrains on the bones are not transferable and the best solution would probably be to not export the bones at all with the mesh. There are parts of the model other than the legs that are not constrained to an armature that that are being distorted beyond recognition and I can't figure out how to fix this. Does anyone know why this is?
The model in Blender
 And in Maya

Have you made sure you have applied all transforms in blender before exporting?

I would probably try unparenting the mesh from the armature, import them separately, and redo the weighting and bone constraints in Maya. It's possible the weighting would not need to be done entirely, but since the mesh is not deforming as you expect, I think you will need to address this issue first. Maybe isolate one leg first and just try to get it to deform correctly, then if that works, apply the technique to the rest of the model. I don't use Maya, so I can't really give any more specific advice than that.


text:
Rounded Corners Are Way To Sharp and Ridged
I'm trying to render some product images for my app with a model of an iPhone. During rendering, I've realized that thr corners of the device are WAY to sharp and ridged. As you know, an iPhone's corners are smooth and round. What could I do to fix this? I attached some images to show the issue.   I am using Cycles.

Hi, did you try using a subsurface modifier?

@m.ardito Hello! I'm an app devloper, and I'm VERY new to rendering and modeling and those things. Can you explain what this means? Thank you!

@m.ardito Wait, nevermind. I figured it out! Thank you!


text:
Trouble importing my model materials to unity
I need some help with my models and why i can't see the materials in unity once i import them.
I believe i know the reason but i refuse to accept restarting my whole texture/material process.
Okay so i'm using cycles render, i make the materials for my model and assign their locations then it's all done.
I import and my materials are blank and not the RGB input materials that i made.
I just want my models simple colors and not image textures.
I believe im missing something simple and need some help.

https://blender.stackexchange.com/questions/57531/fbx-export-why-there-are-no-materials-or-textures

I'm voting to close this question as off-topic because it is about blender compatibility with 3rd party software.


text:
Motion Tracking not working for Eyeball
I'm experimenting with motion tracking an I'm a little stuck.
My plan is to track the motion of an eyeball from a video an let an animated eyeball repeat the same motion.
And in principle it works. If the attached image was a video you could see that the eyeball in fact moves according to the track. However only very little (track is highlighted in red).
I even get why: The path of the track is (since it is eye movement) very little. I want this little motion to rotate the eyeball by something like 45° which of course it does not.
Is there a way to sort of amplify the movement from the track?

The Follow Track constraint includes a 'Constraint to F-Curve' button - click that and Blender will convert your track into a series of keyframes. You can then use the Graph Editor to edit the resultant F-Curves for the object.
To edit a curve, right-click on one of its points and press L to select 'Linked' (ie, select the whole curve). Then use S to scale it (you can type a number to scale by a fixed amount if desired - eg, S10Enter) to scale up by a factor of 10. Repeat for each of the X, Y, Z channels.
Once you've scaled up your F-Curve you'll find that the motion of the empty used for the track is similarly affected, resulting in more motion for the eye.

I prefer your idea now - ha ha

Amplify movement -
(Blend file attached)

The 3D (Blender) eyeball is parented to the Lever (plane) B.
Lever B is told to look at ('Track To' constraint) an Empty placed at the eyball end of Elbow A.
Elbow A is told to look at ('Track To' constraint) the brown cube.
Note that when an object is told to look at (Constrained to 'track to') another object/Empty, it will be looking at that object's pivot point which is where the Gismo coloured arrows sit when you select it.
Lever B's pivot point is at it's far end, and that is set at the center of the eyeball.
Elbow A's pivot point is down at the camera end, at the corner.
If the brown cube can be parented or moved by the motion tracking then you'll amplify the eyball's rotation.
Should the motion tracking be a rotation, place a lever at the center of the rotation (pivot point) and parent it to the rotating object.  Have the brown cube parented to an Empty placed at one of the lever's ends so it moves in the axis shown by the arrows.

Interesting solution. Could possibly simplify it by using a Copy Rotation from the lever to the eye.


text:
How to improve the Annoying Orange effect?
I'm working on a project that is using the annoying orange technique.
It works fine but the mouth is surrounded by that shadow.
I know it due to the feather of the mask I'm using.
Do you guys have an idea how I can make the transition smoother so it will blend in better?

Alpha looks good? Is that the premuliplied version already? Colors are matching? Are you using blenders compositor? Did you already tried Set Alpha node? A lot of questions, I know :)

need more info and or a file

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


text:
Can I use VSE result in Movie Clip Editor?
I'm editing a video in VSE. Some cutting here, a new sound track there.
I would now like to use the result of my edit in VSE in Movie Clip Editor to do motion tracking.
Is that possible wihtout exporting it as a new video (and importing it again) first?

You can only use unedited clips in the motion tracker for now.

You can add a movie clip to a VSE timeline and employ its 2D stabilisation. To do tracking you must send the movie clip to the compositor (via a different scene) then back to your VSE as a scene strip.


text:
Deleting objects by name without affecting current selection
Before 4.0, it was possible to use context override with operators.
It was very handy to be able to delete a list of objects without messing with the current selection.
objs = [bpy.context.scene.objects['my_obj_01'], bpy.context.scene.objects['my_obj_02']]
bpy.ops.object.delete({"selected_objects": objs})

This got removed in 4.0: https://projects.blender.org/blender/blender/commit/ac263a9bce53e190d07d679a058a230e91e722be
It now returns an error:
ValueError: 1-2 args execution context is supported
What is the best way to do the same thing now? This is my pretty long workaround:
# Objects to delete
objs = [bpy.context.scene.objects['my_obj_01'], bpy.context.scene.objects['my_obj_02']]
#Store the current object selection
current_sel = context.selected_objects
active_obj = context.view_layer.objects.active

# Check if objects to delete are currently selected and remove them or it will fail at restoring selection.
for o in objs:
    if active_obj == o:
        active_obj = None
    if o in current_sel:
        current_sel.remove(o)

# Select objects to delete
bpy.ops.object.select_all(action='DESELECT')
for o in objs:
    bpy.data.objects[o].select_set(True)

bpy.ops.object.delete()

#Restore the previous selection
if current_sel:
    for o in current_sel:
        bpy.data.objects[o.name].select_set(True)
if active_obj:
    context.view_layer.objects.active = active_obj

context can still be overriden, but now you have to use the context manager with bpy.context.temp_override(...)

I did not get it to work. I have tried different syntaxes but it does not delete my objects. Could you share a working example please?

import bpy

objs = [
    bpy.data.objects['Cube'],
    bpy.data.objects['Cube.001']
]

for obj in objs:
    bpy.data.objects.remove(obj)

Remove does not delete associated data, unlike the delete operator. So for each object, we need to search for associated data and its type, and remove that data, which is also cumbersome?

The delete operator doesn't delete data either ? Note you can also use bpy.data.batch_remove(objs) (faster if you have a lot of objects to delete, it doesn't trigger a redraw each time)

I thought it did, according to what I was able to find on the net.
But thanks for the batch_remove, I'll give it a try.


text:
Filmic to linear math?
I know the math to convert sRGB and REC709 to linear, but does anyone know what is the (approximative?) math for filmic to linear?
Or is there a way to use OCIO configs in python to convert any picked color to be converted to linear, independently of the color profile you are using?
Thanks!

You can use the OpenColorIO Python library to transform a Filmic log encoded image back to scene referred linear.
The base log is a simple normalized log base 2 format, with ten stops down from middle grey and six and a half stops up.

Thank you for answering Troy.
Sorry to ask for that, but do you have an example you could share?
I'm trying to import PyOpenColorIO but that module doesn't seem to be accessible from an addon?

Depends on your OS I suppose. You can compile it pretty easily, or install it via Homebrew or your Linux distribution. Easier for me once I know you have PyOpenColorIO working and what configuration we are using.


text:
Check when Active Camera has changed
Is there is a way to check when the Active camera has been changed?
I'd like to change some Scene settings depending on the camera you look through, and I'm looking for a way to know when a new camera is set as the active camera.
I'd prefer to avoid having to create a custom function to replace the "Set Active Object as Camera".
Thanks!

Related : https://blender.stackexchange.com/a/90723/29586 - changing properties based on the active camera using drivers.

Properties updates and handlers

Added a scene pointer property (x_camera for want of a better
name) which points to a blender object type. The poll method lets it
be narrowed down to those of type 'CAMERA'
Scene.x_camera has an update method for when this object is changed
and changes scene camera to match.
Added the property to the UI in the scene panel. The benefit of this
approach is the user can choose a camera, and run code based on this
choice.
Next added a simple getter boolean property, cam_change that is
false when  our pointer property camera is not the scene camera
To handle other ways the active camera is set, eg keystrokes, or
markers, a handler is used. The scene update pre handler ticks over a
lot. Another boolean could be utilized to turn the handler on or off.

Test code below. Added a couple of convenience methods to uncomment and remove handlers and panel draw_methods.
import bpy
from bpy.props import PointerProperty, BoolProperty

def cam_changed(self):
    return self.x_camera is not self.camera

def cam_update(self, context):
    if self.cam_changed:
        self.camera = self.x_camera
        print("UI UPDATE")
    else:
        print("HANDER UPDATE")

def cam_update_handler(scene):
    if scene.cam_changed:
        scene.x_camera = scene.camera

def cam_poll(self, object):
    return object.type == 'CAMERA'

bpy.types.Scene.x_camera = PointerProperty(
        type=bpy.types.Object,
        update=cam_update,
        poll=cam_poll,
        )

bpy.types.Scene.cam_changed = BoolProperty(
        get=cam_changed
        )

def cam_draw(self, context):
    layout = self.layout
    scene = context.scene
    row = layout.row()
    row.alert = scene.cam_changed
    row.prop(scene, "x_camera")

bpy.types.SCENE_PT_scene.prepend(cam_draw)

# handler

bpy.app.handlers.scene_update_pre.append(cam_update_handler)

def remove_handlers(prefix, handler):
    handlers = getattr(bpy.app.handlers, handler, [])
    remove = (h for h in handers
            if h.__name__.startswith(prefix))
    for h in remove:
        handlers.remove(h)

#emove_handlers("cam_", "scene_update_pre")

def remove_draw_funcs(prefix, panel):
    funcs = getattr(panel.draw, "_draw_funcs", [])
    remove = (f for f in funcs
            if f.__name__.startswith(prefix))
    for f in remove:
        panel.remove(f)

#remove_draw_funcs("cam_", bpy.types.SCENE_PT_scene)

You need to specify hadnler function with simple condition:
cam_current = None
def camera_handler(scene):            # handler function with condition
    global cam_current                # get global value
    if cam_current != scene.camera: # if camera was chaged
        print('camera was changed')   # print 'camera was changed'
        cam_current = scene.camera  # prevent next actions until camera will be changed

bpy.app.handlers.depsgraph_update_post.append(camera_handler)

I found a solution by using Animation Nodes add-on.
You just need to set different value of Pass Index (Object Tab) for every camera. And this node-tree will check camera's Pass Index and send its value to rotate Empty. Now you can extract rotation data from Empty and drive everything you need in the scene.
For example, Cube is rotating in accordance with active camera (all cameras are binded to timeline markers).


text:
Pie Menu Operator with several properties
Is it possible to specify several operator properties for a Pie Menu operator?
I have an operator that has two properties, axis and type:
bpy.ops.object.myscript.align(axis="X", type="TO_LAST")
I can add it to a pie like this:
pie.operator("myscript.align", text="Align X").axis="X"
But can I specify the type at the same time as the axis? Or do I have to create another operator just for that?

From where do you got that info how to create your own Pie-Menu? I would like to create my own PieMenu too, can you provide me some more Infos ?

Off topic, but you can watch this tutorial to begin with: https://vimeo.com/103321600
There is a Pie Menu template script in blender that you can create from the Text Editor.

Thanx much appreciated

So I went with creating a new operator for each combination of properties that I need, but then I lose the Redo Last menu... I can't find a proper a simple way to do what I want.


text:
Unregister Timers with parameters
I am trying to use a timer for a function, but I need to provide it a parameter so I'm using the example from https://docs.blender.org/api/blender2.8/bpy.app.timers.html:
import bpy
import functools

def print_message(message):
    print("Message:", message)

bpy.app.timers.register(functools.partial(print_message, "Hello"), first_interval=2.0)

The problem is that I don't know how to unregister it.
Trying with this:
if bpy.app.timers.is_registered(functools.partial(print_message, "World"):
    bpy.app.timers.unregister(functools.partial(print_message, "World")

Or this:
if bpy.app.timers.is_registered(print_message):
    bpy.app.timers.unregister(print_message)

Or even this:
   if bpy.app.timers.is_registered(functools):
        bpy.app.timers.unregister(functools)

And a lot of other things, but that doesn't work. Any idea?
Thanks!

bpy.app.timers has not unregister function, but timer function can return False to stop execution, try look at this

I have been able to unregister timers, it actually unregisters if I don't check if it's registered first (it does throw an error though, maybe it's trying to unregister itself twice).
But the return None solution works great, so thanks for your help!

@RUben bpy.app.timers has an unregister function listed here

It's a bit weird that bpy.app.timers.is_registered doesn't work when using parameters. It must be expecting a specific argument that I don't know about.

I am not an expert in Python, but if my knowledge from JavaScript translates well enough, then this is caused by the fact that the created function references are not equal. Let's say, you have a function called a:
def a(x, y):
    return x + y

It is stored as a reference, that can be assigned to multiple variables that will be equal to each other and itself as well:
print(a == a) # True
b = a
print(a == b) # True

But each time you call functools.partial, it creates a new function reference, which are then not equal to each other, not even if their parameters are the same:
c = functools.partial(a, 5)
d = functools.partial(a, 5)
print(c == d) # False

Or alternatively you can even directly compare the results.
print(functools.partial(a, 5) == functools.partial(a, 5)) # False

Because of this, if you want to later unregister a function created with functools.partial, you need to store a reference to it, so Python will be able to find which one to unregister by checking for equality among the registered ones, like for example this way:
e = functools.partial(print_message, "World")
bpy.app.timers.register(e, first_interval=2.0)

after which you can use the following code to unregister:
if bpy.app.timers.is_registered(e):
    bpy.app.timers.unregister(e)

because
print(e == e) # True


text:
Check if any modal is running
I have pie menus that conflict with the keymap of other addons when being in some of their modal operators.
Is there a way to check if there is any modal running and use that as a poll for my pie menus?

Not sure how helpful this is; bpy.ops.script.reload() throws an error when a modal timer is running.

Unfortunately it takes a couple of seconds to try bpy.ops.script.reload(), not really suitable to open a pie menu.


text:
Register Property Group in existing type
Is it possible to register a PropertyGroup in an existing type like bpy.types.Light ?
This doesn't work: bpy.types.Light = PointerProperty(type=light.MyPropertyGroup)
But this works fine if I add my addon class: bpy.types.Light.myaddon = PointerProperty(type=light.MyPropertyGroup)
I manage to register a single property with:
bpy.types.Light.myproperty = FloatProperty(.......) but this isn't really clean to add all my properties in the register function.
The reason I would like to add my properties directly into the Light type is because I have get/set functions for my properties that would need to refer to the correct self.
Thanks!

If your property group is registered akin to bpy.types.Light.myaddon = PointerProperty(type=MyPropertyGroup) then in an update self is the pointer light.myaddon and self.id_data is the light.

self.id_data works like a charm!
Thanks batFINGER for your amazing support on StackExchange.


text:
Simple way to reveal brush strokes, such as in the example
Example: https://www.youtube.com/watch?v=aLvmXuInbHo
I do have access to After Effects, but I would prefer doing all my video editing etc. in blender. Is there a simple way?


text:
Cycles image renders in black and white
I'm trying to make an image in Blender using the cycles engine. When I choose rendered in the view port shading menu, there's color. But when I actually render it, it's in black and white. What do I do?

"What do I do?" Provide us with details about your scene, materials, textures, settings, screenshots and possibly a a as simplified as possible file reproducing the problem

See https://blender.stackexchange.com/questions/90551/object-turns-white-when-rendering-render-layer-colors-disappear

Here is a link to the blend file


text:
Blender viewport lags while animating
I'm animating a scene in Blender and am experiencing some lag. This makes it hard to preview the animation. I'm in solid mode, I tried enabling frame dropping, I tried turning off visibility for some objects, but still pretty laggy. Using v2.79
Specs:
Windows 10 Home
32GB RAM
Intel core i7 6700HQ @ 2.6 Ghz
NVIDIA GeForce GTX 1070

This is a common problem, the more complex is the mesh, the armature, the weights, the more the animation gets slow.
Youn can use various strategies to check your animations:
1 - hide (maybe using layers, even separating some vertices of the mesh) all vertices you can
2 - building a fake simpler mesh, which will be very fast if done using bone parents instead of weighted vertices: i.e. it's very common to build a characetr using the face as it is and using simple cubes or cyliders for torso, arms, legs, parenting each whole object to its corrispondent bone: in this way you avoid lots of calculations.
3 - making a superfast OpenGL render of the scene, which can be analyzed always running in perfect realtime.
Maybe others users know some more strategies.


text:
What's the best way to do an IK rig for a stick figure?
This is the tutorial I used for learning IK rigging. https://youtu.be/Q9f-WVs3ghI It's difficult to do this kind of rigging with stick figure legs, since they don't have feet and their legs are really close together in a t-pose. Is there a recommended way of rigging stick figure legs with inverse kinematics?

If you struggled with that tutorial, you might have a hard time with Rigify too, idk (Rigify is worth learning though, imo).  But Blender has a built in Auto IK Feature; so you just add some bones, parent your mesh to the armature, then turn on the check box for "auto IK".  You need to be in Pose Mode to see the option in the tools area, where ever the heck that is now, lol.  GL OP  (tools is the screwdriver/wrench icon in the properties panel, I think)

If you have legs without feet you can simply do it this way:

Create your torso, thigh and shin, parent the thigh to the torso (Keep Offset mode)
Create a target bone and a pole target bone, deparent them from the other bones, deactivate their Deform option.
Give the shin an IK constraint, with the target bone as Target and with the pole target bone as Pole Target.
If the shin bone rotates abnormally once in Pose mode, correct its Pole Angle in the constraint.
To mirror the bones, select all in Edit mode and go in the Armature menu (3D view bottom menu bar) > Symmetrize.
For the mesh parentage, if it doesn't work correctly With Automatic Weight, parent With Empty Groups, and assign the group to the vertices you want in the Properties panel > Data > Vertex Groups, or switch your armature to Pose mode, switch your mesh to Weight Paint mode, and begin to paint for each bone.

Using Addon "Rigify" might be the best way
It includes auto IK function,so you don't need to set the bones one by one


text:
Is there a way to simulate water balloon physics in Blender?
Trying to animate something in Blender and I thought I might try and give it water balloon physics. I don't know how to simulate these kinds of physics so I was wondering if anyone has any suggestions.

Could you give some reference to what you mean by water balloon physics? Edmond suggested using fluid simulation, but it seems to me you don't want the water to be visible, you just want a round object with parameters adequate for a balloon filled with water. Even if the balloon is transparent, if there's nothing else than water inside, it seems you don't need fluid simulation and just cloth with pressure.

I doubt very much that you can combine fluid sims and soft bodies. You can't even combine cloth sims and soft bodies. Sadly, in Blender the soft body system is very old and can't do many things because of that, it badly needs an overhaul.

Maybe after Simulation Geometry Nodes are introduced, eventually all simulations will be migrated to geonodes…

Let's hope for that.

Do you want a physically accurate simulation ? Or just something that looks like a water ballon ?
If you want something that simulates the look of a water ballon I would suggest looking at soft body but If you want to go in depth, You would need to put a fluid simulation inside a soft body or a cloth simulation ( but you will need a pretty buffed up computer for that ).

How do I put a fluid sim inside a cloth sim?

Sadly I can't do it on my computer, so I was only able to do one with a soft body :
Create a soft body bake a simulation and export it as shown here then make behave as the obstacle for the fluid.

But the fluid won't have proper interaction with the soft body, the physic simulation will be cooked and the fluid will move inside.


text:
Particle system affects photo scanned texture in Eevee
I tried using a particle system on an object in Eevee and when it's visible, it affects the photo scanned material, both in the viewport and in the final render. The material becomes a solid color that changes every frame and the material isn't smooth anymore.

I'm trying to imagine this, and visualize it in my head, based on your description. I'm failing miserably. Could you add some screen shots, or even your .Blend file? That might help for understanding.

https://drive.google.com/file/d/1Ar5h0snaGYGUHwD6SbBqiPxuICcjnoVp/view?usp=sharing


text:
Blender gives a `NameError` error when calling get_strokes()
I'm currently working on an addon for Blender that turns the camera view into an SVG. There's this error that shows up when I try calling get_strokes()
File "d:\Blender builds\Blender 4.2.1\4.2\scripts\freestyle\modules\freestyle\utils.py", line 95, in get_strokes
    return tuple(map(Operators().get_stroke_from_index, range(Operators().get_strokes_size())))

NameError: name 'Operators' is not defined

This function exists in Blender's api.
It's the first time I'm coding an addon for Blender, so I might be missing something obvious.
To replicate this, you can run the following code inside Blender:
import bpy
from freestyle.utils import get_strokes

var = get_strokes()

I really need to get the strokes from the freestyle linesets for the project I'm working on at work. I'm now stuck on this part. I tried looking into the code of the existing addon Freestyle SVG Exporter to try to find how to do it, but I'm very lost.


text:
I can't create a video output when a picture is set in VSE. Output file is black for most of the output
I have a project that plays perfectly in VSE. It has 3 pictures and 2 video clips. All are sized to 1280x720. The whole clip should be about 15 seconds. Audio is from an mp3 file. Project is set to 29 fps.
I chose the mp4 presets, tried rendering, and I get black screen for 10 seconds, 3-5 frames from one video clip, and then it freezes on a frame from the second clip. None of the pictures show up at all.
I've tried changing to a different output, but the file duplicates the result. Are there any suggestions?
using Blender 2.79 (whatever the latest is. downloaded a fresh copy this week)

Can you share your project so I can try to investigate it? For me it looks like a codecs issue.

ok, here is the blender file. I think it might be related to my GPU. I've had all sorts of problems since updating to Win10. I'm going to try on a different computer as well.
https://1drv.ms/u/s!AltX43w8Syqehl7rckIILrs0LCA7

Please Pack your assets using File -> External Data -> "Pack all into .blend" and re-upload the .blend file so I can check your media too

ok, it only put the mp3 file into the blend file. clearly something is wrong with this project. I'm going to start over and try again.

ok, After trying and failing to recreate this project from scratch and attempting to get Blender to render something proper (and failing) and not being able to add all the files into the .blend file I got fed up and looked for different software.
I was only trying to create a 15 second clip, so I tried NHC VideoPad and in less than 10 minutes I downloaded, installed, created the project I was trying to create and rendered the finished file.
I am disappointed in blender.

Still I would like to know what causes the problem - I use VSE a lot and never had such issue.


text:
3D texture (UVW map to UV map?)
I have a complex model and I want to apply a Perlin noise texture on it. This model is to be used in a video game.
Because this can be generated, I was thinking of using a 3D texture to avoid having artifacts. From what I could find online this process seems to exist (UVW mapping, even though different people seem to use this name to refer to different things).
I am wondering if it is possible to create a 3D texture for Perlin noise, and then use Blender to generate a 2D texture + a corresponding UV map so that I can use these in my game engine.

UVW map is accurate name of UV map, it is result of unwrapping (unfolding) the mesh in order to get UV coordinates which will be used to map texture. Perlin noise texture is procedural one and it doesn't need UV map to be applied to mesh. However you need UV map if exporting that texture as it has to be baked and that's where UV coordinates will be required. Related https://blender.stackexchange.com/questions/90096/how-can-i-convert-a-node-made-material-into-an-image-texture

Magic UV add-on has a tool to work with UVW

What you are describing is exactly one of the uses of texture baking. In this case you could use either cycles or the old blender internal.
The process would be:

Texture the object.
UV unwrap the object.
Bake the Perlin noise texture.

I'm using cycles, but the same principles apply to the BI (in the blender internal renderer you can pick what type of noise generator it uses, cycles only has perlin noise.)
Texturing
Texturing is very easy, because it is all procedural. My material is super basic, just the noise texture and a gamma node to boost the color:

Yes I'm using a teapot as my demo.

UV Unwrapping
In edit mode simply select everything and hit U > Smart UV Project. Depending on your model and what else you are going to do with it you might need a better UV map. Sufficient to say, smart uv project does not always do the best job. Yet if all you are going to do with it is bake a map, then this will do.

Texture Baking
Before you can bake the texture you need to create an image blender will bake to. So in the UV Image Editor create a new image. "New" button in the header. Or if the new button is not showing, then click the "+" plus button in the image data block control, its still in the header.
Important Add an Image Texture node to the material for your object. Set the texture to the image you just created. The Image Texture node should not be connected to anything, but it must be active.

All set for baking.
In the Properties window go to the Render tab and scroll down to the Baking section. Here change the bake type to Emit (notice I'm using an emission shader in my material), and hit the large Bake button.

Presto you have a 3D procedural texture baked to a 2D image for further use anywhere.


text:
LWO import in 2.7x ( macOS) ?
I don't see Lightwave object in import menu and I was wondering if the support has been dropped. I still see the python script for lwo format in addons folder, but it doesn't seem to work. I tried from 2.79 to 2.70,versions work on current macOS (Sierra). 2.69 won't launch under current OS. I don't have a PC to test it.
Thanks in advance.
Euisung Lee

Alternative is to export fbx from LW then import fbx into Blender which works fine.


text:
Substance / Blender GLTF workflow = wrong metal render
I have a 3D armor which was textured in Substance and exported following that pipeline: https://www.khronos.org/blog/art-pipeline-for-gltf, that is to say with a ORM map.
However, once the maps pluggued in the right nodes in Blender (I'm using the glTF metallic roughness node from https://github.com/KhronosGroup/glTF-Blender-Exporter)...the metal renders like plastic, not at all like in Substance. I have tried to toggle Color / Non-Color Data modes, to darken the roughness... Nothing works.
Here are some screenshots. First what it renders in Substance painter.

Then what it renders in Blender using the gltf nodes

The node connexions:

And finally what it renders when plugging the maps in the Principled BSDF node

Can someone please explain me why I can't seem to get the metal effect right using the GLTF pipeline? :(
Thank you very much :)

The wireup looks mostly correct to me, except the "alpha" wire shouldn't connect to "DoubleSided" (and for this model I think you can remove the alpha wire completely).  What reflection map are you using?  Is this Eevee or Cycles?

I think I'd recommend the Principled BSDF node rather than the custom nodes now, along with https://github.com/KhronosGroup/glTF-Blender-IO. One notable limitation is that occlusion will have to be wired up and exported separately.

Hi everyone and thank you for your answers! Emackey asked whether I was using EEVEE or Cycles which gave me the idea to try and upgrade to Blender 2.80 :) (yes I was still in Blender 2.79). I'll give it a try, as the GLTF pipeline was included as native into Blender 2.80, that might work better. I'll keep you informed :) EDIT: ok so I have tested with Blender 2.80, and it seems that the GLTF shader node doesn't exist anymore, you can simply use the Principled BSDF and it works. However it does raise a question: why is the ORM still needed? Thank you very much!

glTF internally packs Occlusion, Roughness, Metallic into the RGB channels of what's informally called an ORM map.  In Blender 2.80, a "Separate RGB" node is used to split out these channels so they can be plugged into the corresponding inputs of Principled BSDF.  The "Separate" node isn't part of glTF, it's just being used to explain to Blender how glTF packs this information into a single image.

Thank you emackey, indeed that's how I proceed now. And as you said, the ambient occlusion doesn't seem to work for now, you evoked the possibility to "wire it up and export it separately", what did you mean by that? Thank you!

Currently the Principled BSDF node doesn't have a hookup for baked ambient occlusion, so the importer/exporter doesn't connect that channel to anything yet.  We're hoping the Blender devs add that channel to Principled BSDF, that would make import/export hookup real easy.  But for now, you can still download a copy of the legacy glTF Metallic Roughness custom node, and the exporter still has a fallback that can find Occlusion on that node.

All right thank you, I will give it a try :)

An ORM texture stores each map in a channel : Occlusion in Red channel, Roughness in Green channel, Metalness in Blue channel.
You need to use a SeparateRGB node to split the texture into separate channels. Then, simply connect each channel to the corresponding input.

Thank you for your answer.Problem is, it seems that the GLTF node is made such as there is only one slot for the Metal and Roughness information (MetallicRoughness). So I tried what you suggested out of curiosity but it still not renders well :/ Moreover, in the Kronos pipeline they say nothing about re-separating the channels after ... :/

Wouldn't that work correctly if you instead plugged the corresponding separated channels into the two inputs there under the metallic roughness, into the Metallic factor and the Roughness factor?

The SeparateRGB node is only needed when connecting ORM to Blender's own Principled BSDF node.  The "glTF Metallic Roughness" node group internally contains the correct separations for a glTF ORM texture, there's no need to wire these up manually outside that node.

Hey Craig D Jones, no it still renders wrong by plugging into the Metallic and roughness factors :/

I have been trying what you told me about using the gltf metallic roughness node in Blender 2.8, but I can't get the ambient occlusion map to show... Here whether the AO is pluggued or not, it gives the same result, there's no AO.  Am I doing something wrong? EDIT: I just realized that the AO doesn't work either in 2.79...! Below, I plugged an AO map (not an ORM, just the AO) in the Occlusion spot and...nothing happens! Maybe I should create another

Ok tthat post is resolved (I'm trying to find where you toggle that lol) for now I'm using the gltf roughness metallic and not the principled bsdf shader. Thanks for your help and especially emackey!


text:
Why we can't apply edge loop on mesh if we applied bevel first
Some times I noticed that we can't apply edge loop on mesh if we applied bevel why it is happening? It's bothering me to model as I want to. I guess it's happening because of geometric reasons please help me to understand what rocket science is happening there?

If you bevel it can create ngons (faces with more than 4 vertices that are no longer quads), and you can't automatically create edge loops through ngons because it can't guess what opposite edge it is supposed to cut through. But you can cut with knife and recreate quads from your ngons.

Thanks for your valuable time I appreciate your knowledge.


text:
How to fix distortion in LWJGL using .obj
I am a blender novice and was looking for some help. I have a UV Sphere that I unwrapped and applied a texture to. In blender it looks very good but when I export it as a .obj file and render it in LWJGL it distorts. How can I prevent this distortion?

As you can see in LWJGL it has pretty bad distortion. My setting when exporting are: Include Edges, Write Normals, Include UVs, Triangulate Faces, and Objects as OBJ Objects. Any help on how to fix would be appreciated!

See http://blender.stackexchange.com/questions/3315/how-to-get-perfect-uv-sphere-mercator-projection or https://www.youtube.com/watch?v=yc0b5GcYl3U or http://blender.stackexchange.com/questions/10741/what-is-the-best-way-to-unwrap-a-sphere

I have tried both of these and neither fixed my problem. Do you have any other suggestions?

Why what happened specifically that didn't fix the problem? "neither fixed my problem" is pretty generic. Also what is LWJGL and what does it have to do with Blender? If it only displays wrongly in other applications then it not a problem with Blender and doesn't belong in this site.

Im sorry. I should have been more specific. Both of those tutorials did not fix the distortion originally present for me. LWJGL is a Java Graphics Library and is the java equivalent to OpenGL. I posted this here because I assumed it was a problem with how blender was exporting the UV to my .obj file that is causing the distortion. I have previously never had a problem loading a texture with LWJGL and this is why I think it has to do with some blender settings.

We are more in these approach here : http://blender.stackexchange.com/questions/24043/how-to-animate-morphing-a-rectangular-plane-into-a-sphere or http://blender.stackexchange.com/questions/52904/wrap-curve-around-sphere. Anyway, you should start from a grid and make the grid spherical


text:
Exporting blender model to Indesign
I create different poses in blender with my character, that I made with makehuman. I want to export this character to Indesign for a workoutmanual.
When I export the character (to meshlab for example) the poses are gone an the character is silver, so it doesen´t wear the clothes that I put on in makehuman.
Any ideas?

this question is not about blender... anyway you didn't explain what you did exactly, anyway.

Indesign is an illustration and layout 2D application, as far as I know there is no way to export 3D models directly. You either have to render them or capture in a 2D image or vector format.


text:
Random values changing each frame
I want to make some lights changing colors randomly each frame. They need to be either red, green, blue, or orange. That for about 1000 objects that need to be changing differently.
I think it would be some combination with ColorRamp node and a randomly changing factor each frame between 0 and 1.
Is this possible? If yes, how?
I am using cycles.

Setup a material similar to the following :

The 'Animate' Value should be keyframed to start at 0 and increase to change the colours - the faster this changes, the faster they will animate. The Color Ramp can be adjusted to change the sequence of colors or you could use a different interpolation if you want gradual changes rather than 'Constant'. The Power node uses the 'Random' value to add some variation to the flashing - so that some of the objects change at a different rate. Set the Power to 0 and they should all change at the same rate - or experiment with other Maths nodes to get the desired spread (eg, an 'Add 1.0' node in place of Power would allow you to set the rate to range from 1.0 to 2.0 so you'd never get really slow changing ones).
Results as shown :

Blend file attached

The "natural way" to do it is to use drivers. But it seems that frame driven values in a material node does not update properly or leads to an error.
So I found this previous answer which mainly links to an external tutorial but leads to a solution.

Get access to a random value

To do that, we use a script (see below) that allows to use a random function in the driver's expression (see comments).
import bpy
import random #Import the random module

#Define a random function based on the random module
def randf( min, max ):
    return random.uniform( min, max )

#Link the function to the driver namespace so that we can use it as an expression
bpy.app.driver_namespace['randf'] = randf

Define a material with a value node

We'll come back later in the material setting. Here we just want to have a 'value' node so that we can get the previous Python function in the material's nodes.

Setting the driver

We can add a driver directly in the node's output slot. He will appear in purple and setting driver's expression is possible. But for some reason it won't work properly and/or refresh at each frame.
So, as indicated in the video accessible from there, we can add it from the outliner.
The noticeable difference is adding the driver directly is a material node based driver but this workaround is an object base driver.
To set it, open the outliner. Set it to 'datablocks' view. Navigate to the following:

Your object (ie "objects then Cube")
"Material slots" then the wanted material
"Node tree", "shader node tree" and "nodes"
"Value" (as our node is a value node), "outputs" and for this node "default value"

Finally, that drives to this:

Select this last "default value", then press D or use the menu "edit/add driver to selected".

The driver

Open a view with graph editor (1)
Set it to 'drivers' (2)
Select your object's driver (3)
In the driver tab, set the expression corresponding to our script (4)

In case of error in the expression:

Be sure to run the script (AltP or "run script" button is the text block
"update dependencies" in the drivers tab
Enable scripts in the user preferences, "file" tab, then "auto run Python scripts"

Now for the material

Material

The material setting has a mix from the driver value (frame based) and "object info" node (object based) as inputs.
The aim is to combine these two random values to influence a color ramp (for instance). A modulo is used to avoid average effect (which may lead to values around 0.5).

Here is the blend file.
To make it work, if needed:

Reload trusted (on top menu bar)
Run the script (on script/textblock part)
Update dependencies (driver part) for one cube

Note: you'll see that this is not perfect as some objects have the same color, always... I think this is due to the "object info" node, but I don't know why...
Please comment for any enhancement.


text:
how do I colour using vertex paint?
I've been looking around for a while now and its so hard to navigate. Anyway, how do I colour in models? I've tried the vertex paint thing but it disappears after I have selected another part.

What render engine are you using? Cycles or blender internal?

Vertex color won't be shown in any shading mode except for Vertex Paint or in Solid shading if proper option on the Properties shelf > Mesh Display is turned on. To render it you have to define material using it. The question is not so clear about what exactly do you want to color and what is your desired goal.

Using Blender Render, To see vertex colors in 3d viewport you need to be at least in textured viewport mode...although you can paint in solid mode also.
And to see  vertex colors in render, your material needs to have "vertex color paint" option enabled.


text:
Can anyone help me get Blender stable?
I am super late on my final because Blender crashes anytime i try using it. It's been buggy since start but it's downright unusable now. I'm only using the factory settings and no plug ins. I have windows 10-64 bit, 24 GB ram, AMD 4.2 GHz quad core. I've pretty much got no hope of passing finals but it'd be real nice to at least submit something.

...too few info to understand why it's crashing, but lately win10 gives problems here and there. Please add graphic card info, blender version, and install type (zip, msi, other..). Meanwhile, if you're in a deadline, with your pc, I would quickly create a vm with ubuntu, or mint and try to use blender from there, it would be slower but it could be stable.

Thanks card is 750ti nvidia Blender 2.78c  msi installer

I would also try a zip archive, a few times msi may give problems. Just unzip it and run blender.exe.

I think it's not about your hardware but software.
Some tips you can try:

reinstall Microsoft C++ 2012
install the latest version of Blender.
run Blender as Administrator.

Well after a reinstall of c++2012 and a restart, blender 2.78c  with out any plugins I'm still crashing. Any ideas or suggestions appreciated.

I can't change themes either? Keep getting a trace back. I've wiped blender completely from the registry and still get this odd behaviour. Can anyone please help with this?

@Kent318 A python traceback? Or..? Is it possible you could include the traceback in the question?

Can you try installing / updating the OpenCL SDK.
found the solution from this link:
https://blenderartists.org/forum/showthread.php?419626-Blender-2-78c-crashes-upon-startup-(fresh-install-on-new-system)

I'm so sorry never got a notification issue was a known bug in the end ty so much

Known bug in that blender version was the answer again sorry for not closing this long ago notifications here could use improvement possibly btw

Very kind of you too leave it so long ty an again sorry


text:
Custom property not evaluated on first frame of animation
I am adding a bunch of properties to cameras with my add-on. To support animation during renders, I add a frame_change_post handler like this:
import bpy
from bpy.app.handlers import persistent
from .camera import PhotographerCameraSettings

@persistent
def update_render_camera(self,depsgraph):
    camera_ob = bpy.context.scene.camera
    camera_ob_eval = camera_ob.evaluated_get(depsgraph)
    # Dictionary of Photographer Camera properties
    for key in PhotographerCameraSettings.__annotations__.keys():
        try:
            key_eval = camera_ob_eval.data.photographer[key]
            camera_ob.data.photographer[key] = key_eval
        except KeyError:
            # Properties that haven't been changed will return a KeyError
            pass

def register():
    bpy.app.handlers.frame_change_post.clear()
    bpy.app.handlers.frame_change_post.append(update_render_camera)

It works fine, except for the first frame of the render if the current frame is different.
For instance, if I render from frame 1 to 10, and in the viewport I am looking at frame 5, then when rendering the animation (CTRL+F12), frame 1 will use camera property values of frame 5. Frame 2 gets updated properly and the renders continues fine.
It seems that the frame_change_post doesn't get triggered when moving to the first frame. Is there a way to fix it?

IMO don't mix context and handlers. First argument of a handler is scene.  The intersection of annotation keys and object keys   eg (ob.data.keys()) would remove the need for try catch. TBH not sure what this is doing? consider a setter / getter on the property instead. Assuming you are looking for  properties that haven't been set, rather than changed.

Maybe the intersection of the camera_ob_eval then, because I think the object.data would have all the keys.
Properties use update functions, isn't that a correct way to do it?
I am looking for properties that have been set and not using default values, and make sure they are evaluated for animation. Annotation keys don't exists if they haven't been set.
I am not sure I understand how to make sure animations are evaluated for viewport and rendering, is it just because I should use get/set?

To check if set can also  use ob.is_property_set("foo") , used in conjunction with getattr(ob, "foo")  (ie avoid try catch see best practices in API manual) Re the getter setter example on the properties page see https://blender.stackexchange.com/a/134310/15543  Might pay to have a look at the auto tile size addon for cycles. On start has a button to fix what appears to be a similar situation as here.  May also pay to add a test example of your property group class and property update method.

Thanks a lot for your help. I have removed the try catch with the intersection you mentioned, but in the end I am replacing update functions with getter setter, it fixes the first frame issue. Is it OK to access bpy.context from a set function though?


text:
Use an object as a Driver variable
I have a function for a driver that expects 2 objects as arguments, and I can't find a way to set the variable as the Object ID, only a single property of that object. Is that possible?

Provide a data path. Maybe "location" in that case?

So it's not possible to only reference an object? I can easily work around it by making the function arguments require each object property separately, and create variables of these, but I wanted to make sure there wasn't an cleaner way.

afaik no. But may be a workaround? you can distance("Camera") without using var. And get the object, bpy.data.objects[param] in the function. Or if you want var, use "name" as datapath

You can set the driver to data path and use "name" as path, at the cost of getting the object from its name.
With this setting, the object can be renamed by the user and the driver won't be broken.

Using the depsgraph
Since the upgrade to 2.8 the depsgraph is a member of the locals of a driver, as are the variables.  See answer to
How to use different types of data blocks for driver variables?
re setting up a test driver.
As an example, driver is on "Cube".  The object "Lamp" is in scene, and passed as an evaluated object  to the driver via the depsgraph.  The depsgraph can also be used.

def test(*args, depsgraph=None, **kwargs):
    for arg in args:
        print(arg)
    print(depsgraph)
    return -1 # a simple val to indicate working

<bpy_struct, Object("Cube") at 0x7f62fcbefa08, evaluated>
<bpy_struct, Object("Lamp") at 0x7f62fcbf0008, evaluated>
<bpy_struct, Depsgraph at 0x7f62faba6c08>

An example to return minimum global z of all other objects in the depsgraph.  The method of @lemon can be used for the object names. Other options could be tagging them via custom property or name prefix suffix.
def test(self, *args, depsgraph=None, **kwargs):

    z = min(o.matrix_world.translation.z for o in depsgraph.objects
    if o != self)

    return z

Pointerproperties.
IMO the best way to associate an object(s) with another is via a pointer property
bpy.types.Object.driver_obj1 = bpy.props.PointerProperty(type=bpy.types.Object)

which can be assigned via script or UI.
context.object.driver_object1 = context.scene.objects.get("Lamp")

How does the depsgraph keyword argument get automagically assigned inside your first test() function? Don't you have to look up the **kwargs items through the kwargs dictionary? .. (Sorry, another  Python baby- gurgle.. I really have tried to look it up.

It's in the locals() of the driver so can be used by name directly. just like any driver variable accessed by its name.

OK, got it


text:
How to make a Delete operator with its confirmation window?
I would like to have a Delete button that can Delete Global using Shift-Click.
It deletes globally fine, but I'm not getting the confirmation window even if I set confirm=True
Could you help me find what I'm doing wrong?
class MYADDON_OT_Delete(bpy.types.Operator):
    bl_idname = "myaddon.delete"
    bl_label = "Delete Object"
    bl_options = {'REGISTER', 'UNDO'}

    obj: bpy.props.StringProperty()
    use_global: bpy.props.BoolProperty(default=False)

    def execute(self, context):
        obj = bpy.data.objects[self.obj]
        obj.select_set(True)
        if self.use_global:
            bpy.ops.object.delete(use_global=True, confirm=True)
        else:
            bpy.ops.object.delete(use_global=False, confirm=True)
        return{'FINISHED'}

    def invoke(self, context, event):
        if event.shift == True:
            self.use_global = True
        else:
            self.use_global = False
        return self.execute(context)
```

Try bpy.ops.object.delete('INVOKE_DEFAULT', confirm=True).

Invoke the WindowManager.invoke_confirm
IMO the way this was is confusing. If your desire is to delete an object by name, can instead get it from the scene by name and remove it.
As it was would remove active, selected and "obj" if it existed, or simply throw an error if it didn't.
Have passed an override to the delete object operator to only delete the object known with name self.obj if it is linked to the context scene.
Test script, run in text editor throws up the confirm menu.
import bpy

class MYADDON_OT_Delete(bpy.types.Operator):
    bl_idname = "myaddon.delete"
    bl_label = "Delete Object"
    bl_options = {'REGISTER', 'UNDO'}

    obj: bpy.props.StringProperty()
    use_global: bpy.props.BoolProperty(default=False)

    @classmethod
    def description(self, context, event):
        return f"Delete {event.obj}"

    def execute(self, context):
        scene = context.scene
        obj = scene.objects.get(self.obj)
        if obj:
            return bpy.ops.object.delete(
                {
                     "object" : None,
                     "selected_objects" : [obj]
                 },
                 use_global = self.use_global
            )

        return {'CANCELLED'}

    def invoke(self, context, event):
        self.use_global = event.shift
        wm = context.window_manager
        if event.shift:
            return wm.invoke_confirm(self, event)
        return self.execute(context)

def draw(self, context):
    layout = self.layout
    op = layout.operator("myaddon.delete")
    op.obj = "Cube"

if __name__ == "__main__":
    bpy.utils.register_class(MYADDON_OT_Delete)
    bpy.types.TEXT_HT_footer.prepend(draw)
    bpy.ops.myaddon.delete('INVOKE_DEFAULT', obj="Cube")

Thanks for your help, I learn a lot from all your answers on Stack Exchange.
I agree my example code was confusing and lazy, your answer is much cleaner.

Thankyou, the feedback is appreciated.  Appreciate any python  question that shows effort and code.   So many do not, ...  Btw if you look at revision intially answered using API methods. Re use_global This was simpler pre 2.8 as could either unlink from scene objects (False)  or delete from blend.  Could make a good question as in as much as could code it, a quick attempt  seems overly complicated to find the collection that is linked to scene to unlink object from.  Also noticed that answer was accepted since removed... any specific reason?.

Your example will also open the confirmation window when not holding shift, I want to only ask for confirmation when deleting globally. The other reason is that I want to use this operator with a button, so it doesn't show how to use 'INVOKE_DEFAULT' for the button.
I am looking into fixing these two and will add it as an answer, but your answer is still extremely valuable :)

INVOKE_DEFAULT is the default for a button.

Ah ok, I was confused by this one: https://stackoverflow.com/questions/51135822/blender-python-add-operator-to-menu-with-invoke-default
So in my case I just changed the invoke with a condition if self.use_global to use either wm.invoke_confirm(self,event) or self.execute(context)


text:
How do I properly store a value with a modal operator invoke?
I am trying to understand why storing a value on a modal invoke doesn't always work if not creating a class property. The following example works for some properties (focal length for instance) but the stored camera location somehow gets updated with the latest camera location before cancelling. I thought INVOKE was only run once, at the start of the modal.
This modal will set the camera position to 0 and its focal length to 10mm when pressing the left mouse button. Pressing ESC or right-click will cancel the modal and revert the focal length properly, but won't place the camera back to where it was.
class MYADDON_Modal(bpy.types.Operator):
    bl_idname = "myaddon.modal"
    bl_label = "Modal"
    bl_options = {'REGISTER', 'UNDO'}

    def modal(self, context, event):
        cam_obj = context.scene.camera

        if event.type == 'LEFTMOUSE' and context.space_data.type == 'VIEW_3D':
            if event.value == 'PRESS':
                cam_obj.location = (0,0,0)
                cam_obj.data.lens = 10

        # Cancel Modal with RightClick and ESC
        if event.type in {'RIGHTMOUSE', 'ESC'}:
            cam_obj.location = self.stored_cam_loc
            cam_obj.data.lens = self.stored_lens

            if self.cursor_set:
                context.window.cursor_modal_restore()
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.stored_cam_loc = context.scene.camera.location
        self.stored_lens = context.scene.camera.data.lens

        context.window.cursor_modal_set('EYEDROPPER')
        self.cursor_set = True

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

In order to make it work, I have to create a class property by inserting this line before the def modal
stored_cam_loc: bpy.props.FloatVectorProperty()
Could someone explain why this is necessary and what the difference is with other properties?

The : means it's an annotation, not a regular attribute that you would define with =. I don't know the internal specifics, but I gather in the registration process these annotations are used to define instance-specific attributes that are correctly linked to the whole API ecosystem. I'm not sure this is your actual question, but you do have to define custom operator properties this way if you want to access them correctly inside the execution code.

You don't need a class property and you don't need a bpy.props....  The problem is that in your invoke function you have the line
self.stored_cam_loc = context.scene.camera.location

and that is really assigning stored_cam_loc to be an alternative name for ...camera.location, so that when you change ...camera.location in modal you're actually changing both values.
You can experiment with this annotated version of your class to see this in action.  Change True to False at line 42 and you can see print statements showing that the value of both change when the assignment at line 21 is executed.
import bpy
from mathutils import Vector

class MYADDON_Modal(bpy.types.Operator):
    bl_idname = "myaddon.modal"
    bl_label = "Modal"
    bl_options = {'REGISTER', 'UNDO'}

    stored_cam_loc = Vector((0, 0, 0))
    stored_lens = None

    def modal(self, context, event):
        print(f"M Stored lens = {self.stored_lens} Stored loc  = {self.stored_cam_loc}")
        print(f"  Event {event.type}")
        cam_obj = context.scene.camera

        if event.type == 'LEFTMOUSE' and context.space_data.type == 'VIEW_3D':
            print("L")
            if event.value == 'PRESS':
                print(f"P- Stored lens = {self.stored_lens} Stored loc  = {self.stored_cam_loc}")
                cam_obj.location = (0,0,0)
                cam_obj.data.lens = 10
                print(f"P+ Stored lens = {self.stored_lens} Stored loc  = {self.stored_cam_loc}")

        # Cancel Modal with RightClick and ESC
        if event.type in {'RIGHTMOUSE', 'ESC'}:
            print(f"R Stored lens = {self.stored_lens} Stored loc  = {self.stored_cam_loc}")
            cam_obj.location = self.stored_cam_loc
            cam_obj.data.lens = self.stored_lens

            if self.cursor_set:
                context.window.cursor_modal_restore()

            print("C\n")
            return {'CANCELLED'}

        print("M\n")
        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.stored_lens = context.scene.camera.data.lens
        if True:
            self.stored_cam_loc.x = context.scene.camera.location.x
            self.stored_cam_loc.y = context.scene.camera.location.y
            self.stored_cam_loc.z = context.scene.camera.location.z
        else
            self.stored_cam_loc = context.scene.camera.location
        print(f"I Stored lens = {self.stored_lens} Stored loc  = {self.stored_cam_loc}")

        context.window.cursor_modal_set('EYEDROPPER')
        self.cursor_set = True

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

classes = [
    MYADDON_Modal,
]

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

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

if __name__ == '__main__':
    register()

Here's a version without the extra print statements and if statement that seems to work:
import bpy
from mathutils import Vector

class MYADDON_Modal(bpy.types.Operator):
    bl_idname = "myaddon.modal"
    bl_label = "Modal"
    bl_options = {'REGISTER', 'UNDO'}

    stored_cam_loc = Vector((0, 0, 0))
    stored_lens = None

    def modal(self, context, event):
        cam_obj = context.scene.camera

        if event.type == 'LEFTMOUSE' and context.space_data.type == 'VIEW_3D':
            if event.value == 'PRESS':
                cam_obj.location = (0,0,0)
                cam_obj.data.lens = 10

        # Cancel Modal with RightClick and ESC
        if event.type in {'RIGHTMOUSE', 'ESC'}:
            cam_obj.location = self.stored_cam_loc
            cam_obj.data.lens = self.stored_lens

            if self.cursor_set:
                context.window.cursor_modal_restore()

            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        self.stored_lens = context.scene.camera.data.lens
        self.stored_cam_loc.x = context.scene.camera.location.x
        self.stored_cam_loc.y = context.scene.camera.location.y
        self.stored_cam_loc.z = context.scene.camera.location.z

        context.window.cursor_modal_set('EYEDROPPER')
        self.cursor_set = True

        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

classes = [
    MYADDON_Modal,
]

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

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

if __name__ == '__main__':
    register()
```

Thanks for the explanation, this is cleaner. But I'm still confused as to why it would behave differently for stored_lens, it should also have been updated by the modal but wasn't
You are working around assigning stored_cam_loc to camera.location by storing each axis separately, but how could I store a single float property then?

It has to do with the type of the object.  stored_lens is a primitive, while stored_camera is a class instance.


text:
Normal Maps can I create my own or download it?
How I can download or create my own what is normal map can we edit in Gimp or Photoshop ?

There are several ways, you can for example bake it from a high poly model which is covered in this tutorial: https://www.youtube.com/watch?v=0r-cGjVKvGw or you can use some normal map generator like CrazyBump or some non-commercial alternatives. But I am sure you can find some already made by searching the internet for "free normal maps" :)

I seen this video after seen I upload question

So you should then know how to create a normal map in Blender. What specific problem do you have with that?

It's nothing but a jpg images? Are normal Maps?

Yes, it is just a specially colored image. For the start, you can try this free generator: http://cpetry.github.io/NormalMap-Online/, download a map and try to apply it to your model to see how it works.

I seen I can import plug in for Gimp I use Gimp so I choose and I will today definitely try this jpg file hmm ok thanks

Woh link is very useful automatically generated normal map so nice

Only one time it genrat? Second time it doesn't work?


text:
what's the difference between 'repeat', 'extend' in image texture node?
i'm toying with those two options but cannot figure out. with flat mode on, I loaded image texture but they both extend the edge of image at the boundary on the top of cube. all I figured out is repeat extends only one direction of image horizontally and vertically but is there more than that? and what is tiled looking.

how can i remove this question? i figured out. you can check the difference when you use mapping node with image texture and change the scale of image on the object through mapping node.

I figured out. you can check the difference when you use mapping node with image texture and change the scale of an image on the object through mapping node. scale the image down with the mapping node by tweaking its scale option you'll see that extend just extends the image on the top of a object while repeat makes several same images on the top of an object.
from what I've figured out, you should scale the image down through mapping node or whatsoever.


text:
what does context mean in blender
"In compositing and texture context each node supports the Alpha channel. In the texture context only RGB color space is available. In the shading context of the Blender internal adds HSV and the Cycles shading context offers an additional pair of nodes to combine/separate a vector (XYZ)"
trying to figure out what separate xyz node does but I don't get the meaning of 'context' in modeling

Context in this case is roughly analogous to "area" or "mode". The separate XYZ node takes a vector and separates it into 3 scalar x, y, and z values. It can be handy if you want to take object position (for example) and use just the  Z channel to shade an object with some sort of vertical gradient.


text:
how do you reduce the space between cuts when you use 'loop cut and slide'?
how do you reduce the space between cuts when you use 'loop cut and slide'?

if I got what you mean, you first apply the cuts then you can "scale" or "slide" them.

Hover over the mesh, wait for the loop cut appear on the mesh, click once and now you may move the mouse to move the loop cut to left, right, up or down as you like.

If you want to looking for multiple loop cuts at once, you may scroll the mouse wheel to have mulitple loops like this

I'd add that you can also select those same cuts and scale them on an axis, freehand or proportionally if you want a certain number but not the autospaced width.


text:
Looking to see if Blender is a good tool for an AI project
I have an AI project that I'm working on. I have a machine learning algorithm for a robot, but I want to train it in simulation first. The experimental design is: The robot has a camera, and can see its own hand. It then makes random sequences of motor actions, and creates a causal link between what it saw in its camera, and the random set of motor actions.
I want a setup similar to this:
https://www.youtube.com/watch?v=T-c17RKh3uE1
What I want to know is, does the Blender game engine/python library give access to a camera and stream its input in real time, and is it possible to send motor sequences to a virtual arm? Or should I use a different tool? From the virtual camera, I don't require a raytracer, just having access to the pixel buffer is enough using, more over a high resolution isn't required, 1024x768 is plenty.
I can't test my models on a real arm/webcam due to funds. I am good with python, C and C++, I have written many export and mesh scripts for Blender, however I don't know how to set something like this up, or if it is possible. Any help/direction is greatly appreciated.
Thanks

This is possible, but will probably require some very heavy coding in Python. Check out PyroEvil's Neural Network Python scripts for Blender. You can see them in action here and here (more on the channel).

Not sure how up to date this page is. You may want to look at the work being done at open robots

The R&D for my article Torso Crowds was also done with the BGE. It took some changes in the C++ code too, but they were relatively simple additions & fixes, so they were easily accepted and thus are now part of Blender

In my mind, blender is a good fit for this sort of project. It has access to python allowing high level development and the use of many many libraries.

What I want to know is, does the Blender game engine/python library give access to a camera

Yes - you can extract the pixels from a camera using the ImageRender refresh() method by passing in a buffer and pixel format. I have used this for a variety of purposes in the past, though not for robotics.
https://docs.blender.org/api/blender_python_api_2_78a_release/bge.texture.html#bge.texture.ImageRender.refresh

and stream its input in real time,

You'd have to set something up

and is it possible to send motor sequences to a virtual arm?

Yes. I wrote a minimal test scaffold for a UR5 robot arm. This allowed me to test a program intended for the actual hardware without needing the actual arm present. This was a huge help when trying to do a university project with limited lab time. I also somewhat sidestepped the project (with permission) by writing a blender script to generate the proper commands from the virtual setup....

just having access to the pixel buffer is enough using, more over a high resolution isn't required, 1024x768 is plenty.

That should be possible - although you may find the GPU->CPU bottleneck on some hardware.

Some other things I have done with AI and blender include:

Testing IK solutions.
GUI's to display telemetry and provide control of various chassis,
Prototype control algorithms for hardware (eg four wheel omni-steer chassis - how do you co-ordinate the wheels?)
Robot hardware design - doing in in blender+BGE allows it to be tested inside the game engine before building it.


text:
Rendering only the highlights of an object in Cycles
In the internal renderer, it's possible to turn off the diffuse on a light source while leaving on specular:

which gives the neat effect of only rendering the highlights on an object:

To my understanding, Cycles emulates real world physics in that the object's properties control how light interacts with it and the light itself doesn't play as much of a role. So I'm curious if there's a way to manipulate an object in Cycles so that it only shows highlights of any light source to simulate this effect?
I've seen some questions on the topic of specularity in Cycles, but only about adding it to light sources, not as a hypothetical solo source.

You can emulate equivalent results with Cycles Ray Visibility flags for the lamp object.
To a similar result to highlights you can turn off all components except Glossy for your lamp object.

Have in mind that this will only work on objects with materials with some sort of glossy reflection component. Purely diffuse, transparent, refractive or translucent materials will likely become totally unaffected by that light siurce


text:
How would you write this condition in a cleaner way?
I wanted to know if there was a cleaner way to write this condition:
if area.spaces[0].shading.type == 'MATERIAL' and not area.spaces[0].shading.use_scene_world:
       intensity = intensity
   else:
       intensity /= pow(2, (context.scene.view_settings.exposure))

I couldn't find a way to get the inverted intersection I want to get rid of the else.

Is intensity  used when the shading type is not MATERIAL?

Intensity division should happen when it's not MATERIAL, and when it's not use_scene_world when it is MATERIAL.

I’m voting to close this question because, while it does use the Blender Python API, it is a general programming question unrelated to Blender. (I would also vote to close this as an opinion based question.)

I would also improve readability by reducing the maximum line length.
shading = area.spaces[0].shading
if (shading.type != 'MATERIAL' or shading.use_scene_world):
    intensity /= pow(2, (context.scene.view_settings.exposure))

Good suggestion, but I don't think the "or" will give the same intersection though?

Follows De Morgan's Law "not (A and B) == not A or not B"

Thanks a lot, I like learning things :)

I usually suggest making a human readable temporary variables.
They will immediately show everyone who's reading the code what they mean just like comments.
isShadingTypeMaterial = (area.spaces[0].shading.type == 'MATERIAL')
isShadingUseSceneWorld = (area.spaces[0].shading.use_scene_world)

if isShadingTypeMaterial and not isShadingUseSceneWorld:
    intensity = intensity
else:
    intensity /= pow(2, (context.scene.view_settings.exposure))

is_shading_type_material would make it even more readable according to pep8: https://www.python.org/dev/peps/pep-0008/#function-and-variable-names


text:
Conform selected edges or vertices to the objects surface

Hi all,
I would like to scale the selected vertices inwards and make them to stick on to the surface of the cylinder that i have placed in the centre. the cylinder is not joined to the plane.Would be awsome if some one would help.Thanks

As the object you want edge loop to stick to is circular (cylinder) then the edge loop should become circular. This can be easily done either via default command Shift+Alt+S, then setting the factor to 1 or via LoopTools addon, Circle option. See also How do I make vertices equidistant from a given center?
Note to avoid making faces too distorted, in this case outer edge loop shown on screenshot is better to be moved towards cylinder a bit or add one more edge loop in between existing ones.


text:
I'm having problem enabling Animation Nodes in blender 2.82
I dont know what to do. Im pretty sure you will get the idea what is wrong by seeing this picture. I'm new doing animation in blender so any help will be apprreciated...

I had a similar problem when I upgraded recently.
I suspect you need to reinstall the vc_redist.x64 which has some windows features that AN uses.
Check out this link on the AN github, third item titled "Import Error: DLL load failed"
https://github.com/JacquesLucke/animation_nodes/issues/1240
After I reinstalled vc_redist, I went through the AN install process again and it worked normally.
HTH


text:
How to move a bone and a separate object together
Is it possible to move a single bone from an armature in pose mode with a separate object in object mode at the same time?
I often need this functionality when creating a layout for an animation shot. After posing my character I might need to move the root bone or an IK controller a bit. But when my character interacts with the environment, for example sitting next to a table, I can't find a way to move both the character armature and the table at the same time. So I find myself moving the two elements separately which often leads to inaccurate positioning.
If I turn the armature to object mode I can move both objects but there are some use-cases where I want to move an object with only one particular bone.

I haven't tried this to find out what effect it has on the other bones in an armature, but you can give a bone a Copy Rotation, and/or a Copy Location Constraint. With the location one especially you might have to tick Offset.  It's probably more practical to do it the other way around - that is, give the constraints to the object instead of the bone, so the object follows the bone.

When I try adding constraints it changes the object's current position so I can't really use that (even when setting offset in copy location since the object has a transform of its own). Also, I'm just trying to make a one time position change so adding a constraint seems a bit much for that...

I'm assuming you need the child object to rotate on the spot, that is, with its own Origin as pivot point?  If so ....
Select the object to be constrained, which I'll call a cube from now on, and Shift S, Cursor to selected.
Shift D, and call the new object TemporaryCube.
Create an empty.
Add a Copy Rotation constraint to the Empty with the bone as the target.
Select the Empty first and the Cube second, Control P, Object with Keep Transform.
Add two Child Of constraints to the Cube.
In the first constraint, untick the Rotation and Scale axes. Pick Bone as parent.
Correct the location by pressing Shift S, Selection to Cursor.
In the second constraint untick Location and Scale axes. Pick Empty as target.
Rotate the Cube back to how it should be by:
Selecting a) the Cube, b) the Temporary Cube, then going to Object/Transform/Align to Transform
Orientation. Then you can delete Temporary Cube.
If you want to remove the constraint afterwards ....

Create a cube or sphere or something. With it selected, press Shift and select the object with the constraint.  This cube/sphere is going to "hold" the position and rotation data for you.
The cube or whatever needs to be in the same position and rotation as the object with the constraint.  You can get it there using Object/Transform/Align Objects, and Object/Transform/Align to Transform Orientation.  You'll probably need to select all axes in the tool settings and change Global to Local.
Remove the constraint, then get it back into the position of the "data holder" cube/sphere using the same two align tools as above.  Remember that the object you select last when the two objects are selected ready for the align tool, is the object whose data will be copied.

Thanks Susan! I've managed to change the object's position with the bone. However when I try to remove the constraints or delete the Empty, the object changes its position and rotation again. Can you also explain how to remove the constraint?

I just edited my answer to give you the answer to that question.


text:
Messed up my characters head
When I subdivided it destroyed this gentleman's face. I am absolute beginner trying to run through tutorials but I cannot see what I did wrong, I have an older version of this character but would rather not go back since I did some good work on details like the ribs and chest and belly button as you can see in the photo. I am going to be rigging him up next and i don't want to make a pill mouth

Try this: select the head object, go into edit-mode, select all the vertices (A), hit ctrl+N. If this doesn't work, try deleting doubles with all vertices selected.

Looks like you need to re-uv unwrap the bottom part of his face.

My man Bert saved the day! It was doubles that needed to be removed. I was dreading David's suggestion but the uvs are messed up anyway and i am just going to proceed with rigging now cause it's a learning process. Thanks all.


text:
Why is my object look so weird in rendered mode?
I have a table with a simple UV added as a material.
Here is my table in material view:

Below is my table in Rendered:

Any idea what I can do to fix?

This issue is called z-fighting. That means, that you have overlapping geometry. Most likely, you have objects in your scene, that are invisible for viewport rendering (the eye icon in the outliner), but visible for rendered view (the camera icon).


text:
How can I control the texturing of the pieces created by cell fracture?
I am trying to make a simple box explode to some extent. I have chosen to try out cell fracture and it works fine but how would I fix the inside of my object looking so weird? Is there a different approach required?
Here is object before explosion:

Box after explosion, the pieces look weird, I was hoping to see just wood textures on the inside, would this require me to redo the UV map after I applied the cell fracture?

Could you clarify what you mean by "the pieces look weird", this is pretty subjective. What did you expect them to look like?

May this help (have a look at 13m40s and further)?
https://www.youtube.com/watch?v=XUUi2AdLtmk

There's a tricky part in retrieving usable texture coordinates for fractured objects. A possible answer - but rather advanced - is on this question https://blender.stackexchange.com/questions/58932/apply-object-texture-coordinates

I removed doubles which there was 512 and then did the cell fracturing with source limit of 6 and got desired results


text:
scripting - zoom camera to view all objects
My objects sounds like a bit large, I guess I need to move camera far away from origin (put a sphere there) but if I increase the camera location x value, it will can not see anything.

import bpy
from math import radians,cos,sin,tan
from mathutils import Matrix, Vector, Euler

def clean_objects():
    if len(bpy.data.objects) == 0:
        return
    oldMode = bpy.context.mode
    if oldMode != 'OBJECT':
        bpy.ops.object.mode_set(mode='OBJECT')

    for o in bpy.data.objects:
        if o.type == 'MESH':
            o.select = True
        else:
            o.select = False
        o.select = True
        #print("%s -> %d"%(o.name,o.select))

    bpy.ops.object.delete()
    if oldMode != 'OBJECT':
        bpy.ops.object.mode_set(mode=oldMode)
    return

def dump_objects():
    for ob in bpy.data.objects:
        print(ob.name)
    return

def setOrigin(loc):
    for ob in bpy.data.objects:
       ob.location -= loc
    return

def add_objects():
    m = 16
    n = 12
    h = 96
    outer = 100
    stud_x = 4
    stud_y = 8
    stud_z = 96
    alpha = 30
    for i in range(0,m):
        print(i)
        for j in range(0,n):
            if (i == 0 or i== m-1 or j == 0 or j == n-1):
                bpy.ops.mesh.primitive_cube_add()
                bpy.context.object.dimensions = (stud_x,stud_y,h)
                bpy.context.object.location = (16*i,16*j,0)

    bpy.ops.mesh.primitive_cube_add()
    bpy.context.object.dimensions = ((m-1)*16 + stud_x,stud_y,stud_x)
    bpy.context.object.location = ((m-1)*16/2,0,(h+stud_x)/2)
    bpy.ops.mesh.primitive_cube_add()
    bpy.context.object.dimensions = ((m-1)*16 + stud_x,stud_y,stud_x)
    bpy.context.object.location = ((m-1)*16/2,(n-1)*16,(h+stud_x)/2)
    bpy.ops.mesh.primitive_cube_add()
    bpy.context.object.dimensions = (stud_x,(n-1)*16,stud_x) # overlap
    bpy.context.object.location = (0,(n-1)*16/2,(h+stud_x)/2)
    bpy.ops.mesh.primitive_cube_add()
    bpy.context.object.dimensions = (stud_x,(n-1)*16,stud_x) # overlap
    bpy.context.object.location = ((m-1)*16,(n-1)*16/2,(h+stud_x)/2)

    for i in range(0,m):
        bpy.ops.mesh.primitive_cube_add()
        bpy.context.object.dimensions = (stud_x,(n-1)*16+2*outer,stud_x)
        bpy.context.object.location = (16*i,(n-1)*16/2,(h+stud_x)/2+stud_x)

        p = outer + (n-1)*16/2
        bpy.ops.mesh.primitive_cube_add()
        bpy.context.object.dimensions = (stud_x,p/cos(radians(alpha)),stud_x)
        bpy.context.object.location = (16*i,p/2 -outer,(h+stud_x)/2+stud_x + p*tan(radians(alpha))/2)
        bpy.context.object.rotation_euler = (radians(alpha),0,0)
        bpy.ops.mesh.primitive_cube_add()
        bpy.context.object.dimensions = (stud_x,p/cos(radians(alpha)),stud_x)
        bpy.context.object.location = (16*i,p/2 -outer + p,(h+stud_x)/2+stud_x + p*tan(radians(alpha))/2)
        bpy.context.object.rotation_euler = (radians(180-alpha),0,0)
    bpy.ops.mesh.primitive_plane_add()
    bpy.context.object.dimensions = (16*(m+5),16*(n+5),10)
    bpy.context.object.location = (16*m/2,16*n/2,-h/2)
    setOrigin(Vector(((m-1)*16/2, (n-1)*16/2, h/2)))
    return

def add_camera():
    bpy.ops.object.camera_add()
    bpy.context.object.location = (150,50,150)
    bpy.ops.object.lamp_add(type='SPOT')
    bpy.context.object.location = (200,200,200)
    bpy.context.object.dimensions = (200,200,200)
    bpy.ops.curve.primitive_bezier_circle_add(radius=400)

    camera = bpy.data.objects['Camera']
    path = bpy.data.objects['BezierCircle']
    lamp = bpy.data.objects['Spot']

    camera.select = True
    lamp.select = True
    path.select = True

    bpy.context.scene.objects.active = path #parent
    bpy.ops.object.parent_set(type='FOLLOW') #follow path

    bpy.ops.mesh.primitive_uv_sphere_add(size=20, location=(0,0,0))
    target = bpy.context.object;
    camera.constraints.new(type='TRACK_TO').target = target
    camera.constraints["Track To"].track_axis = 'TRACK_NEGATIVE_Z'
    camera.constraints["Track To"].up_axis = 'UP_Y'
    bpy.context.scene.camera = camera

    for area in bpy.context.screen.areas:
        if area.type == 'VIEW_3D':
            area.spaces[0].region_3d.view_perspective = 'CAMERA'
            break
    return

def select_objects():
    for ob in bpy.context.scene.objects:
        ob.select = False
    for ob in bpy.context.visible_objects:
        ob.select = True
    return
#-----------------------------------------
clean_objects()
add_objects()
add_camera()

I guess "track to" feature should be able to adjust the angle of camera, how can I adjust my camera parameter to view full objects?

As far as I know only moving the camera farther away or lowering the focal length will do what you want. To prevent objects from disappearing as you move the camera away you can increase the end clipping of the camera.

I'd recommend going the other way.  Parent all "add" objects in scene without a parent to a single  empty.  Scale the empty to fit the camera. Related


text:
loop cut then extrude into object
I try to loop cut 2 times on a cubic, then switch to front view, use box select to select the middle part, then extrude -1 around z axis into the cubic. but the output looks like below:

Obviously, the two border face not been extruded as expected. I know boolean modify works for this case but I wish to use extrude.

"face not been extruded as expected" This is the expected result. what did you wish to see? Blender erasing those faces for you?

You could use Rip Fill (ALTV) on both edges, you can use vertex snap tool to help the edges Z positioning,

you could also do both together (start with cursor between edges)

remember to remove doubles, after.

If i understood the question are you looking for this. No need to remove doubles or delete extra mesh. This addon do the best.

With the Default cube sub divide it twice. With the edge selected scale to Y axis. Select the top 3 Faces and with the Destructive Extrude Addon
Push it downwards. Holding control key you can align with the edges.


text:
draw color space conversion cubic with script
I wish to draw a color space conversion cubic with script.
reference output as below:

The inner cubic formula is:

The surface color is calculated from the formula as well. I have some python knowledge but a little bit blender script!
Many thanks if anyone can give some instruction! it's awesome if any recommend tutorials!

What do you want to represent in Blender? Blender is not design for showing sciences chart and figure but modeling project. The easiest one might be using OSL node in experiment Cycles render engine. Or you can use math node to do the linear algebra.

I wish to use blender to show details between two cubic,zoomin/zoomout/rotation freely. if it's not good to use blender! then I have to giveup. I guess it's easy to write a script to do that. if we only care about the shape but no color, is it easy for blender script?


text:
Blender 2.8: units of scale, grid, and default size of objects
I have installed the 2.80 of blender and trying to make sense with the changes in the GUI and the mindset. Most of the changes I like; some of the changes I still need to get accustomed with. I am modeling with blender for 3D printing and am still in the beginning phase to learn things.
My unit system is in meters, and the unit of scale is in centimeters. My "universe" is driven by the bed size of the 3D printer (which is about 200mm). So I adjusted the units in blender so:

I also adjusted the grid:

If I place an object (say a cube or a plane), the default size is still in meters, which means 2000mm (which is huge):

Questions:
* Is it possible to make the default size to 2cm?
* How can get zoomed in to area of 10cm by default (when I open blender, as well as when I press shift-C

I got the same problem (I use unit scale 0.001). However I now managed to have blender add a standard cube of 2mm. But all other primitives still add at a 2000mm scale. sigh...

this answer also has something to do with it.

I believe you also must set your "length" from millimeters to centimeters.

Scene > Units > Units Scale $0.001$, Length > Millimeters

Viewport Overlays > Grid Scale $0.001$

File > Defaults > Save Startup File

Restart Blender, then
Add > Mesh > Cube, Torus, open the sidebar to check


text:
Color panel in the properties section is changed
I was using blender and might've accidently pressed some keys and so when I go to my section to add color it is not at the original perspective that I want it to be. I need this back because it gives me like 3 options for color and none of them add nodes to my node editor. please help.
How do I change it from this perspective

Back to this?

Did you accidentally change to Blender render instead of Cycles? At the top bar in the 3D editor try switching it to Cycles Render. Hope that helps :).

@Nicksin on't post thanks. Upvote the question, or consider marking it as accepted if it solved your problem.

Np but please mark the question as answered as mentioned by Mr. Ramos. Good luck with your work in Blender!