text:
Is it possible to bake to a texture with animatable alpha gradient?
Starting with a scene like:

I want to bake to a transparent image like:

In Gimp a gradient can be added to transparency channel:

Result should be an animatable alpha-gradient (with high transparency but visible ,then the objects should blend in along x-axis):

How can this be achieved in Blender?
Ideally all of this:

initially 20% transparency of objects
a gradient that allows to make the objects opaque from left to right
optinally a white border (no transparency at all).

All I get from the attached .blend is something like:

The transparency is lost after bake.

is it enough to  just create the effect with nodes ?

@Chebhou unfortunately no, I wan't to use it in a game engine (Unity) so that I have only to animate the alpha threshold to blend in the symbols when selected.

what about image sequence as a texture ?

I need many of them, still hope that there is an easy solution, the question could probably reduced to 'How to keep transparency when baking more than one (semi)-transparent object to a combined bake type image.

@Chebhou I updated the question and .blend hopefully it's now more clear what I'm looking for.

maybe you can create one gradient image ( gray scale ) and  use at as alpha channel for other textures

@Chebhou Thanks this worked. I did another google search and found this http://blenderartists.org/forum/showthread.php?189024-Trying-to-create-transparent-gradient solved it. Would you like to answer the question?

since I can't give a detailed good solution, i think it's better if you do

I had no success with baking, but could achieve the desired effect by rendering the image.

Set the materials alpha channel to initial transparency

Materials properties

Add a plane with an alpha gradient as texxture behing the scene

In Gimp create an image with the required dimensions
From the layer context menu select  Add Layer Mask

Use the Blend Tool to create tha gradient

Export to .PNG

Set camera to orthographic

Render and save the image.


text:
How to prevent malicious code execution loading blend files?
Since I download from time to time example files from blogs, wikis etc. I would like to know how I can avoid execution of malicious code.
Is it enough to disable the autoexec switch and see what is in the text editor?

I don't know about "enough", but AFAIK it's about the only thing you can do.

The most likely thing a virus will do is change a bunch of files. You can check for this by scrolling through and making sure that don't open any files that don't make any sense (i.e. system files, config files, personal folders). Even so, they could do something else such as download malware, so it's not 100% (I prefer to just stick with the official add-ons/scripts. There are a bunch and you don't have to worry about virus's then).

Yes, It is enough to open a blend file with Trusted Source disabled. *
But looking the the text editor is not the only place that can contain code. Animation driver expressions can also contain code too.
Take care, even when the file is not trusted you could inadvertently run a script by...

Starting the game engine.
Rendering with freestyle.
Executing a command in the Python console.

If you are in a situation where you need to load blend files you don't trust (an online render-farm for example). Suggest to sandbox the environment Blender runs in (see containers).

* There is the possibility of crafting a file which makes use of a buffer overrun exploit, these are much more involved then writing malicious Python scripts.

For reference, this is a known pain-point, see these threads:

"Python Security gets in the way"http://lists.blender.org/pipermail/bf-committers/2010-April/027216.html
"Python Sandbox"http://lists.blender.org/pipermail/bf-committers/2010-March/026778.html
"Please turn off Auto Run Python Scripts by default"http://lists.blender.org/pipermail/bf-committers/2013-June/040502.html
"Trusted blend files and scripted drivers bug and annoyance"http://lists.blender.org/pipermail/bf-committers/2013-August/041464.html
"Keymaps and presets - Security issues?"http://lists.blender.org/pipermail/bf-committers/2015-June/045523.html

I just wonder now if we could extract all embeded files to check if the blend file is safe. I wonder if python scripts are limited (like in a sandbox) or if they can do things outside of the blend file, like in the harddrive or anything else.. And if blend file access to websites could simply be prevented... I read more things about it here

the default is set to disabled at 2.76b! to check: (info)menu: file / user preferences / file / [_] auto run python scripts

@Aquarius Power, Its not so difficult to extract embedded text, (though that deserves its own Q&A).  And sand-boxing CPython isn't supported, and very difficult unless you also cripple Python at the same time making it unusable for valid use-cases too. - see: http://stackoverflow.com/questions/3068139/how-can-i-sandbox-python-in-pure-python

I thought exactly on that, cripple python! its libraries to have file and internet access should require permission to be accessed! but... from the link you provided, it seems the attacker could simply create their own tiny specific lib to provide these accesses... :(, may be the best is really avoid scripts running at blender, unless we trust who created the blend file...

Right, thats why its disabled by default. (so you have to explicitly trust the file).
The main issue is with rigs which often use py-drivers, and aren't useful unless you enable scripting. As for requiring permission - Then we would have to add a python-permission system with some way for users to control it. (also quite involved, and likely not hard to work-around).

May be, restrict what users can do, like in their python code cannot have certain things that can be considered an attempt to workaround the user's allowed permissions. If they are used to code in that uber-complex way, that kind of code would be flagged as potential threat. I would like to only have python scripts for things that do not go outside blender, do you believe a python script checker could work?

Also, concerning permissions, I dont know if it could be compared to android where apps require permissions to access certain functionalities (see how "automate" works, each permission requires another app lib download), but with the "code uber-complexity restriction" I thought above, may be, the permissions could work.

@Aquarius Power, restricting CPython isn't practical at the moment, so not sure its useful to plan a permission system.

What about instead of restricting, create security warnings? So users could review "the way the code is implemented" and not the code itself (as many do nowadays).I thought yesterday on a modified python interpreter that when it is running,will stop at specific code constructs that could be used in an attack, and inform the user what is happening in a newbie language. Basically, this means, only less capable scripts would receive no warning flags. Or people that are used to implement using such code constructs, would be required to use more safe coding to let their scripts be considered clean.

@Aquarius Power, this isn't really the right place to discuss security implementations, a lot of discussion on this has already taken place over the years, added links in the answer.

source: Stack Exchange

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

sort: votes


text:
mesh=obj.data error when no object is present
I experience the following error when no object is present on the layer:
Traceback (most recent call last):
  File "C:\Users\info\Desktop\untitled.blend\studioTools_Shelf_Beta v2.py", line 352, in draw
AttributeError: 'NoneType' object has no attribute 'data'

location: <unknown location>:-1

This is part of the object shading class I wrote.
class ObjectShading(bpy.types.Panel):
    bl_label = "Viewport Shading"
    bl_idname = "ObjectShading"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "Shading Toolbox"

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

        mesh = obj.data

        row = layout.row()
        row.prop(mesh, "use_auto_smooth", text="Break Edges")

Do I have to build in a switch that in case no object is present on the layer this class is ignored meaning the object shading tab is not evaluated? Similar to the switch here:
Ray visibility panel
Here is what I learned and this approach works - I am just curious if this is the way one should do it or if in this case a better idea should be used.
class ObjectShading(bpy.types.Panel):
    bl_label = "Viewport Shading"
    bl_idname = "ObjectShading"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "Modeling Toolbox"

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

        mesh = obj.data

yeah an if / else construct is fine.
def draw(self, context):

    obj = context.object
    if obj and obj.data:
        # do one thing, if it has data
    elif obj:
        # probably an empty, an object without data
    else:
        # show something in the case of no object selected

Study the poll functions of the UI scripts that come with Blender to get an idea of common practices. Though the poll functions are usually to completely prevent panels or menus from showing or stopping Operators from executing. You'll find the same logic in place for hidding sections of a menu / layout.
Also be aware that sometimes you should be checking for context.active_object rather than just context.object.

Thank you very much for explaining the best use of poll (hiding panel) and other stages to check that object is present and then show selectively only what makes sense. This removed all errors so far in my complete script.

I've asked a follow-up question https://blender.stackexchange.com/questions/124683/what-is-the-difference-between-bpy-context-object-and-bpy-context-active-object , maybe you can shed some light on it?

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

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


text:
USD support in blender 4.2.1?
Has anyone else been testing or using USD with Blender 4.2.1? I've just started testing with Blender 4.2 LTS with little success. But I have had success with the 4.2 alpha branch in the Omniverse launcher.
In the alpha branch I was able to get the umm material mapper to remap my omnishaders.
However in the 4.2 LTS documentation it mentions preview surfaces from USD import should work but I have had no luck with that.
Has anyone had any success with USD in 4.2.1 LTS

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


text:
Skin modifier doesn't add any verticies
I am trying to follow this tutorial on how to model a dragon (https://www.youtube.com/watch?v=TR8nYG0DtJc&ab_channel=RicSanCustomToys) (I know its old and that theres probably better ones but I couldnt find any good and I need a tutorial since I am new to blender). He removes 3 of the vertices from the plane and then get new ones once he adds the skin modifier, but I dont. I dont get any new vertices and I do not understand why.

What is the exact timestamp when this happens? The video is three quarters of an hour long, which is too much to just search through for what you’re describing.

The Skin modifier showed vertices in older versions, but not anymore. It doesn't matter anyway, because these vertices are just virtual vertices created by the modifier, they are not selectable or editable or anything. The only vertex he is working with is the one in the center which he keeps extruding and moving to create more.

So it doesnt matter that I cant see the verticles? Thanks for the help


text:
How can I generate instances on my imported svg logo file using geometry nodes?
I have imported an svg file of a logo and I need to generate a crowd of people that essentially "form the logo" from a top view.  I've been able to create a geometry node where I can generate the crowd instances on a grid mesh, but I don't know how I can do the same thing with using the svg logo file?


text:
How edit rig bones after skinning?
During the posing phase, I noticed that the rig bones at the thumb are out of place.
Checked the metarig, everything is in the right place and so are the axes.
I re-generated the rig and the result is the same.
Then I change the rig bones in edit mode, and after i swich to pose mode mesh gonna crazy.
Do I need to delete the WeightPaint first, then rearrange bones in the edit mod, and re-add the WeightPaint?
Or is there an easier way?


text:
Reduce hair particle count without losing grooming?
I've been given an asset with tons of hair particles, which, if translated to hair cards, end up putting verts in the multiple millions.

I need to reduce the polycount drastically for this to be ready for UE5, but I can't modify the particle count unless I Delete Edit, but that leads to a really lousy-looking result:

Deleting Edits removes all the grooming, and for some reason, even though all the properties' numbers are the same after deleting them, the length of the particles is halved, and I'm left with an ungroomed mess:

Is there any way to preserve the asset's grooming, decrease the particle count, and export hair cards that aren't blowing up people's computers?
Or is there a way to reduce the particle count sufficiently to just export the fur alembic to UnReal without any hitches?
Thank you!

Can you explain how you converted the particles into hair cards? The conversion should reduce, but not increase, the required number of vertices. Have you converted only the hair particles (=good) or the hair particles + their children (=bad)?  For example, here is a model with hair cards: https://sketchfab.com/3d-models/furry-bear-8cec0e6615574edf9ffd4ef45338e0da Stop the animation and turn on Wireframe mode in the Model Inspector (key I or icon at bottom right) to see them. According to the description it has only ~48k vertices.

What do your hair cards look like? Usually, they have a hair strand on them. Your hair cards don't have a single hair on them, do they?

@Blunder I'm mainly trying to follow this this tutorial. The process I know is to first convert the particle system to mesh, then to convert the resulting object to curves, but the sheer number of particles has that taking a long time, and I haven't seen any settings that would give me control over whether the children are being converted, which means I'm not really able to get to the stage where each card has its strand.

@Blunder There's also an issue where while the guy in the tutorial uses, as he says, Ctrl+T to "tilt" the curves so that they line up better with the source mesh, that doesn't seem to work for me, so I can't get them to be anything but either perpendicular to the surface or all basically aligned together wherever they are on the mesh.


text:
How does anti-aliasing work in cycles?
As far as I understand, cycles anti-aliasing in cycles (per default), works by sampling around a specific arc/vector determined by the camera position/rotation.
This explanation and my experience lines up with the answer here
https://blender.stackexchange.com/a/3554/245
but kind of disagrees with the explanation given in
https://blender.stackexchange.com/a/17845/245 specifically the image https://i.sstatic.net/irhyB.png

describing sampling.
If sampling is working this way, the image will always be anti-aliased.
So my understanding for sampling is as follows

Where the radius of the circle is the width of the  width value of the "pixel filter" in the UI.
This would mean however, that either not all the space is sampled or the sampled space overlaps (thus blurring the image) and the only way to get high quality (super-sampling) anti-aliasing is to manually render at increased resolution and downsample the image later. Is there a way around this?

and the only way to get high quality (super-sampling) anti-aliasing is to manually render at increased resolution and downsample the image later. Is there a way around this? So my understanding of what you want it to get a really high quality render of an image? One free of less than stellar poorly done anti aliasing and to my knowledge I'm afraid there is no work around from what you have described I'm afraid. You're just going to have to have a render the scene at a large resolution and then downsample it later as you described. Also it wouldn't hurt to bump of the samples a ton but of cou

filter_func_blackman_harris and filter_table are implemented in https://developer.blender.org/diffusion/B/browse/master/intern/cycles/render/film.cpp and cdf functions in https://developer.blender.org/diffusion/B/browse/master/intern/cycles/util/util_math_cdf.h https://developer.blender.org/diffusion/B/browse/master/intern/cycles/util/util_math_cdf.cpp

tldr: The default anti-aliasing setting samples significantly outside one pixel which reduces the effective resolution. For a maximum effective resolution use the "box" setting which acts as an incredibly high multisampling anti-aliasing filter.
From my own experiments and the information provided in the discussion from the patch https://developer.blender.org/D1453, the sampling with the Blackman-Harris-Filter happens in a circular pattern around the center of the pixel, with the density following the Blackman-Harris-Distribution.
In the default case, with a "filter width" of 1.5 pixels, this means that up to 5 pixels in a horizontal line contribute to the central (third) pixel. Not only the nearest neighbor but also the next nearest neighbor pixels. This leads to a significant "blurring" of the image. Only "filter width" values below ~.65 pixels guarantee sampling stays within the original pixel. This however leaves out the corners of the pixel.
Chosing an "optimal" default and distribution is not possible as per wikipedia:

The goal of an anti-aliasing filter is to greatly reduce frequencies above a certain limit, known as the Nyquist frequency, so that the signal will be accurately represented by its samples, or nearly so, in accordance with the sampling theorem; there are many different choices of detailed algorithm, with different filter transfer functions. Current knowledge of human visual perception is not sufficient, in general, to say what approach will look best.

However what originally motivated me to post this question, was the blurring when working with pixel accurate sprites. With the default anti-aliasing setting it felt like detail got lost in the renders. However turning off or reducing the width of the filter too far killed the anti aliasing even inside the pixels.
When using the "box" anti-aliasing filter and adding a Gaussian blur in the compositor, I can no longer distinguish the results from the Blackman-Harris filter, but I have the freedom to adapt the sharpness in after the render.


text:
How can I check the returned boolean of a function?
I am attempting the check whether a function returns True or False in order to procede to the next step of a separate function.
For example, here is a stripped down version of what I have:
def target(modifier):
    if modifier == 'MIRROR':
        return True
    elif modifier == 'ARRAY':
        return False

def execute(self, context):
    if target is True:
        print("True")
    else:
        print("False")

This does not work, though. How can I check what the return boolean of target() is?

Okay I believe I've got it with:
"if target(modifier) is True:"
Is there a better way to do this?

Yes, that is the way to do it. Unless target() is run and assigned to a variable, there is nothing to pass in to execute().

Pure Python questions would be better placed over at Stack Overflow.

Good call @Aldrik

The way you are doing it in the second block is not what you think you are doing.  The line
if target is True:

will ask if a function reference is the same as a literal True...which it is not.  You want to invoke the function, so use the parenthesis and pass in the string you want.
If the parameter "context" is the one you are interested in comparing (if you are using BPY, it isn't, heads up), it will instead be:
if target(context):

Notice I drop the is True", if is doing that for you already, you don't need to do it again.

Is doing "if target(context):" the same as doing "if target(context) is True:"?

Yes, without redundancy.  "if" will only execute true statements, so just returning true is enough.  Checking if True = True is a tautology.

@JonathanWilliamson No, if obj: checks truthiness. if obj is True: checks identity.

@Aldrik: Good point, you would filter out returned strings or numbers this way.

With True/False/None you can check identity.
if target(obj) is True:
    # do_something

Though in most cases there is no need to be so explicit and you can do...
if target(obj):
    # do_something

In some cases you may want to test against True though.

How about something like this:
import bpy

# Input String the name of modifier
def exists(modifiername):
    if bpy.context.active_object.modifiers.get(modifiername):
        print("yes, true")
        return True
    else:
        print("not true")
        return False

exists("Mirror")


text:
If inside 'elif' ignored / not working with autosmooth script
Here is a script that checks is auto smooth is on and if yes just turns it off.
Ideally when you want to turn it on for the first time it should also set the shading angle value.
And then check if the default 180 is used and if not realize that a custom value is used and only turn on/ff autosmooth.
But the script ignores the if 180Dgeree check and thus never sets the initial angle to 30 degrees.
#Set AutoSmooth
class SetAutoSmooth(bpy.types.Operator):
    bl_idname = "set.autosmooth"
    bl_label = "Set Auto Smooth"
    bl_options = {'REGISTER'}

    def execute(self, context):

        if bpy.context.object.data.use_auto_smooth == (True):
            bpy.context.object.data.use_auto_smooth = False
        elif bpy.context.object.data.use_auto_smooth == (False):
             bpy.context.object.data.use_auto_smooth = True
             if bpy.context.object.data.auto_smooth_angle == (3.14159):
                bpy.context.object.data.auto_smooth_angle = 0.523599
             bpy.ops.object.shade_smooth()

        return{'FINISHED'}

Maybe this should be migrated to Stackoverflow? The problem here is not bpy. (I obviously don't mind answering the question but it's usefulness will be limited without zooming-in to the to real cause of the problem..)

Do you mean this should go to stackoverflow because this is maybe a bug?

Yeah, the bug was in how you thought the comparison of two floats would work. Interesting problem but I think i've shown in my answer that the heart of the problem can be conveyed without the use of an operator.

The problem here is not that the if statement in the elif was ignored, but rather the statement itself didn't evaluate to True. To help debug your control flow consider adding a temporary else statement with a print(). Even if you then still don't understand why an if statement isn't True you'll have localized the problem, and you can try to solve the real issue: comparing floats.
As a test you can even run this directly from the TextEditor, and check the terminal / console for the print statements.
some_value = 0.343523435235
if some_value == 0.34352:
    # do something
    print('yep')
else:
    print('some_value ({0}) is not equals to 0.34352'.format(some_value))

Use some aliasing and the rounding as suggested by jerryno. Another readability improvement is the inclusion of radians(180) and radians(30). These carry extra meaning to the reader (mostly you) than a rough float does.
import math   #  <--- yes!
from math import radians

class SetAutoSmooth(bpy.types.Operator):
    bl_idname = "set.autosmooth"
    bl_label = "Set Auto Smooth"
    bl_options = {'REGISTER'}

    # have a poll check for active_object (optional)

    def execute(self, context):

        data = bpy.context.object.data
        data.use_auto_smooth ^= True  # inverts

        # use the boolean directly, else it's like saying: if True == True
        if data.use_auto_smooth:
            if round(data.auto_smooth_angle, 5) == round(radians(180), 5):
                data.auto_smooth_angle = radians(30)
            bpy.ops.object.shade_smooth()

        return{'FINISHED'}

seen as the extra bit is only intended to be done if the use_auto_smooth is True after the inversion, then that will still need an if-statement. If you see so much repetition of code characters you need to think about using aliases (a variable to store a reference lookup) . It's easier to read and easier to write.

some Python notes
math.isclose()
Python 3.5 will be getting / has a new feature for testing if a float is close to another float, so we won't necessarily need to use rounding anymore. This feature is called 'approximate equality': read about it here https://www.python.org/dev/peps/pep-0485/
math.isclose(a, b, relative_tolerance, absolute_tolerance)
inverting a boolean
These two lines are functionally equivalent
data.use_auto_smooth = not data.use_auto_smooth
data.use_auto_smooth ^= True

The ^= is an augmented arithmetic assignment

pretty great idea to to place localized print statements to check for issues. Why is a poll for active object needed here?

well, it might not be needed if your menu already had such a poll. else  there is no such thing as obj.data.use_auto_smooth and you'll get an exception.

it doesn't need to necessarily be active_object, I could imagine a scenario where you might want to do something similar for multiple selected_objects at the same time.

If you print the default autosmooth angle, the result is 3.1415927410125732. So, either compare against this number, or round the angle to the to the same as your comparing to.
This works:
if bpy.context.object.data.use_auto_smooth == (True):
    bpy.context.object.data.use_auto_smooth = False
elif bpy.context.object.data.use_auto_smooth == (False):
    bpy.context.object.data.use_auto_smooth = True
    if bpy.context.object.data.auto_smooth_angle == (3.1415927410125732):
        bpy.context.object.data.auto_smooth_angle = 0.523599
    bpy.ops.object.shade_smooth()

or:
if bpy.context.object.data.use_auto_smooth == (True):
    bpy.context.object.data.use_auto_smooth = False
elif bpy.context.object.data.use_auto_smooth == (False):
    bpy.context.object.data.use_auto_smooth = True
    if round(bpy.context.object.data.auto_smooth_angle, 5) == (3.14159):
        bpy.context.object.data.auto_smooth_angle = 0.523599
    bpy.ops.object.shade_smooth()

never compare float numbers like this, always round them..

That works - oddly my script initially worked and I moved on and then later it  did not work which is why I posted it. The rounding step does it.

To add the poll function this will work
@classmethod
def poll(cls, context):
    return context.active_object is not None

def execute(self, context):

    for obj in bpy.context.selected_objects:
        if obj.data.use_auto_smooth == (True):
            obj.data.use_auto_smooth = False
            print('AutoSmooth Off')
        elif obj.data.use_auto_smooth == (False):
            obj.data.use_auto_smooth = True
            print('AutoSmooth On')
            if round(obj.data.auto_smooth_angle, 5) == (3.14159):
                obj.data.auto_smooth_angle = 0.523599
                print('numbers check')
            bpy.ops.object.shade_smooth()
            print('Shade Smooth')
    return{'FINISHED'}


text:
Move Animation within the Timeline
I have an object which follows a 3D NurbsPath.
My object is visible at frame 1 and also my animation starts at frame 1.
How can I "move" the animation, such that my object start getting animated at e.g. frame 30?

Moving a Keyframe animation in time:
You can move the entire animation sequence from within the Dope Sheet Editor. There you select all keyframes (type "a" on the keyboard once or twice), then for example: G X 30  to shift the animation by 30 frames:

Moving a Constrained Path Animation in time:
This animation type starts at timeframe 0 by default. Within the Constraints panel you can define an Offset to shift the start of the animation:

Open The Object Constraints of the animated Object
Set the Offset to the start timeframe where the Path Animation shall begin (30 in this case)

Moving the Animation time of an Object parented to a Path
This animation type starts at timeframe 0 by default and runs for 100 Frames, then it stops. You can define the animation window by setting 2 keyframes in the Path Animation Panel of the Path:

Select the Path
In the Data Properties locate the Path Animation panel
In the Timeline select the startframe for the animation (30 in this case)
In the Path Animation panel set the Evaluation time to 0.00
Then keyframe the Evaluation time.
In the timeline select the Endframe for the Animation
In the Path Panel set the Evaluation time to 100 (or to whatever value you have set the Frames Attribute right above the Evaluation tmie attribute)
Keyframe the Evaluation time again.

great! I'll try that in a moment!
Thanks for telling me that the name is "Dope Sheet Editor", because I'll need to do some research on that first.

i don't see any keyframes. my animation is playing because I'm using a path, but I don't see any keyframes in that Dope Sheet Editor. Am I doing anything wrong?
I see "Dope Sheet Summary" > "NurbsPath" > "NurbsPath.001" > "Evaluation Time"

if you use a Path Constraint on your object, you will have to set the Timeframe Offset in the Constraint. In that case no keyframes are created.

still don't see it.
use the default cube. shift+a > add a nurbpath. Extrude the Nurbpath to make it longer. Select both cube and nurbpath and do ctrl+p.  now this is my current situation for my animation. I can't seem to find a path constraint or timeframe offset. The only thing I see is "Frames" and "Evaluation Time" in the Path Animation when I select my nurbspath.

Now i think i have documented all possible options :) I believe your case is topic 3 in my answer

I have edited your Original Question for easier finding. I suspect it is worth to split the question into 2 and split the answers accrodingly.

there should be more people like you giving such detailed answers! +1
For step 3: this video helped also: http://youtu.be/OgF7wTv6a10?t=3m48s

Maaaan, I've gotta say, I just created an StackExchange account, JUST, to thank you my friend very much!
OOOO my god, I was dying thinking that it would be SOOOOO complicated to make an animation happen after another in a GOD(avoiding many bad words here) animation software.
Spend the hole day looking for a solution, at least I found one! Thanks^^


text:
Error faces on limited dissolve
When using limited dissolve in blender its creating some bad faces like this
Original geo:

Error Face:

Here is the just the face in isolation and fixed face on the right.

The idea is to decimate the model and the frame shown here is part of a bigger model and just this is having issue when doing limited dissolve.
What are these faces called ?
What can I do apart from triangulation to fix it ?
Attaching the blender file here...

For converting triangles to quard faces use Alt+J (Tirds to quards).
For good result in your model, tweek Max Shape Angle:

About "these faces called": https://blender.stackexchange.com/a/34267/32374

The idea is to decimate the model and the frame shown here is part of
  a bigger model and just this is having issue when doing limited dissolve.

About decimating: there is no much difference between this 2 models:
Before limited dissolve:

after:

As you see tirs count stays same. That's because n-gons (that created by limited dissolve) based on same triangles, so there'is no any memory saving in doing this.

Well, the idea is not to triangulate but decimate. This is part of a
  larger model and the frame is giving issue

If you realy want to save some memory - use decimate modifier or (much better way) - instancing.

Well, the idea is not to triangulate but decimate. This is part of a larger model and the frame is giving issue. hope its clear.

As I said, it might not make sense to do it in this model. I have a perfect use case for it. Thanks for the link to the other question. Yes, its called concave face. That brought me to the solution. EditMode mesh > cleanup faces > split concave faces.  Running this will eliminate the concave faces and triangulates them. Again that might look like triangulation in the current geo. It does fix the problem in my model. Thanks for you help. If you can just add the explanation of using split concave faces to your answer. I can accept it. Thanks!


text:
Working with VRML 1.0 files in the current version of Blender
I have a set of VRML 1.0 files that have been exported from SolidWorks. I need to import these into Blender, work on them, and then export them back into new VRML 1.0 files.
My predecessor had been working with Blender 2.49b, which apparently had a VRML 1.0 option under the File → Import menu. I would like to use the current version of Blender, but it does not seem to have this option; it seems to only support VRML 2.0 instead.
Is there any way to enable VRML 1.0 support in the current version of Blender? Is the previously built-in functionality now available as a plugin?
If not, I would appreciate pointers to any activity related to the removal of VRML 1.0 support from Blender (such as discussions or commits). I've looked through the
release notes for recent versions, but they didn't tell me when this support was dropped, so I'm not sure where to start looking. If necessary and practical I'd consider doing some work on the VRML 1.0 import/export code to get it working.

I had been hoping that VRML 1.0 supporting was implement in Python, as the VRML 2.0 support is, so that it could be pulled into a Blender plugin. Unfortunately, it's not. I just took a look at the source for Blender 2.49b. VRML 1.0 support is implemented alongside several other "exotic" formats in /source/blender/blenkernel/intern/exotic.c.
The Blender exporting code is in the write_vrml function, but I was initially confused looking for the importing code. It turns out it's implemented as read_inventor, because VRML 1.0 is a subset of the Autodesk Inventor 1.0 ASCII format. That's good to know; maybe the support I'm looking for is available somewhere under the Inventor label.
It's definitely not built-in to the current version of Blender, though: there are no interesting hits for "VRML 1.0" or "inventor" in the source.

@zeffii Interesting, I haven't been able to find any discussions along those lines. Could you give me a pointer? Yes, they are .wrl files.

You pose an interesting question, but it lies on the periphery of what Blender.Stackexchange is about (ie not bug reports, or discussing todos). You may want to wait till @ideasman notices this question for a more definitive answer.

You could try importing with 2.49b and opening the resulting blend with a modern version. .blend files are forward and backward compatible

Note that if you only want geometry, writing a basic importer isn't that complicated, but once you start to get into parent/child hierarchy, cameras, lamps etc - it becomes a much bigger task (see blenders vrml2 importer)

Blender doesn't support VRML1.0, Your best option would be to find a program that supports it and re-save as a different format that Blender does support (VRML2.0 or X3D)
If you search for VRML 1 to 2 there are many hits and links that look useful.
The successor to VRML1 was released in 1997, over 15 years old. Support for formats that are long out of use is limited, at some point its probably best to use file format converting applications.

I haven't found many of the VRML-converting links very helpful, but your point is well-taken. We'll adopt a different format.

If you have a special case where you have a lot of data in an old format and existing software is insufficient, it could be an worth writing an importer especially for your use-case. When you only need to support a limited file-set, this is typically much less work then supporting the full spec. If this is a commercial project, you could hire a developer to do this for you.


text:
Cutting a mesh in half
I have a mesh which I have imported from an OBJ file. I would like to apply Material A to the section of the mesh which is on one side of a given plane, and apply Material B to the section of the mesh which is on the other side of that plane. A potential plane is indicated here as a blue line. Note that it does not necessarily intersect the centre.

To do this, I need to split the any faces which intersect this plane, and select all faces on one side of the plane so that I can apply a material to them. How can I do this in the current versions of Blender?

I've tried using the K knife tool in Z cut-through mode, but the cuts haven't been reliable. Even when they were, after the cut was finished I  couldn't figure out how to select only the faces on one side of the cut. (The details were too fine to be reliably selected with any tools I know, such as the C circle select tool.) I tried using the B selection tool, but it only selected the faces on the near-side of the mesh.
We used to have a procedure to cut a mesh using a plane in Blender 2.4, but it involved using mesh boolean tools which appear to have been replaced, and I can't figure out how to adapt it.

Another use for this is for deleting one side before creating a mirrored object.

If i may point to https://blender.stackexchange.com/questions/143100/cut-object-into-two-objects-with-a-plane/158682#158682, i answered there with my (free) add-on, that does exactly what was asked there and if i read it right, here too, using a plane to cut (non-destructive).

I would recommend using the bisect tool (new in Blender 2.69):

Enter edit mode (Tab), then press Space and type in Bisect, or select Bisect from the toolshelf (under Add).
Click and drag, to bisect the object.

Press F6 to bring up the options for the tool, and select clear inner, or clear outer depending on which half you don't want.

If you don't want to delete half, but just want to select it:

Instead of step 3, press H to hide the loop:

Hover over the half you want and press L to select linked vertices under the cursor:

Unhide everything (AltH), leaving you with one half of the object selected:

Thank you, that's incredibly helpful! Do you know if there's a way to just select the other half, instead of deleting it?

@JeremyBanks yep, added the process to the answer.

Thank you very much. That almost works, but unfortunately the selections created with L sometimes cross over the bisection, even with the middle parts hidden. I'll keep trying to figure it out. Even if I can't get it perfect, you've helped me get a much better result than I had so far.

@JeremyBanks I think you are looking for Select > Select Loop Inner Region.

Note that this feature was added in Blender 2.69, which is at present newer than the version in the Ubuntu repositories. You can get a newer version from a PPA: http://askubuntu.com/questions/4586/is-there-a-ppa-for-the-latest-blender-version

In step 3, how would one go about filling in the missing faces?

@tecywiz121 You could create an n-gon with F, then triangulate the mesh with Ctrl-T.

Works very well in Blender 2.8 too, if you do a little digging around. I prefer the menu's to using shortcuts, as it helps me to learn and retain information. Thank you.

A recommended workflow here would be:

KZC, then drag a perfect vertical line. (Optional for C)
Menu: Select > Select Loop Inner Region, to select one side of the cut result.(F6 > Select Bigger to select the other side)
Assign a second material for the selection. Done.

As shown below:

@Jeremy Banks, have you solved it?

I'd prefer this version over CharlesL's, because I had to cut in the perfect middle and with K + Ctrl you can snap to the exact center of an edge and thus keep full precision.

A better answer would explain what KZC is, because in my version I don't think it is the same.

K Z C has no effect for me in blender 2.8

@ivanzoid @Octopus   i know this is an older question but you need to be in Edit mode for an object.  k = Knife. Z = Pass Through option. C = constrain angle option

If you want to create two identical halves from a symmetrical mesh, all you need to do is to tab into Edit Mode and press Numpad 5 then Numpad 1. Now you can press B for Box Select and drag over the vertices to one side of the center line, then delete those vertices.

This method can be used to make Vertex Groups for easy selection, so you can assign materials. Notice that your selection will be limited to the vertex locations, and no new geometry will be created to ensure a straight line.

What if I have keyboard without Numpads?

Just to add a more procedural way to do this cutting thing. This is one solution if using Sverchok Add-On. The cutting is done using Bisect Node, very similar to Blender's Modeling own Bisect operation.

https://gist.github.com/d6149321dfa1cce9db64347f48a33bf5
You will end up with 2 new objects in this case, but you can join them if you like.

What is the 2nd picture?

2nd picture is Sverchok node tree. You need to install this addon.

If you just want to do a temporary bisect you can also use the Bool Modifier.
Create an object with the shape of the cut you want to make, call your object cutout just for easy reference, then select the object you want to cut, add Modifier > Generate > Boolean and on the object select cutout, then select the type of operation you want to make, Intersect, Union or Diference...
Since this is a Modifier, the changes are not applied until you do so, and if you make a copy of the object, you can apply the same Modifier with opposite operation to create the effect you are looking for.

2.8x bmesh version.  Using cursor for plane coords
This one popped up today so what the hey. a blatant attempt to improve my people reached

A plane has been used as a visual tied to cursor orientation
Extended the  bmesh bisect plane operator to return the left and right faces, and the cut's edges.
import bpy
import bmesh
from mathutils.geometry import distance_point_to_plane as dp2p

def bisect(bm, plane_co=(0, 0, 0), plane_no=(1, 0, 0)):
    ret = bmesh.ops.bisect_plane(bm,
            geom=bm.faces[:] + bm.edges[:] + bm.verts[:],
            plane_co=plane_co,
            plane_no=plane_no
            )

    cut = [e for e in  ret["geom_cut"] if isinstance(e, bmesh.types.BMEdge)]

    left = []
    right = []

    for f in ret["geom"]:
        if not isinstance(f, bmesh.types.BMFace):
            continue
        left.append(f) if dp2p(f.calc_center_median(), plane_co, plane_no) > 0 else right.append(f)
        continue
    return left, cut, right

For the case in question to create new edges at cut and set materials left and right.
Example script append to above and run in object mode
context = bpy.context
scene = context.scene
cu = scene.cursor
ob = context.object

# convert cursor coordinates to object space
mwi = ob.matrix_world.inverted()
plane_co = mwi @ cu.location
plane_no = mwi.to_3x3() @ cu.matrix.to_3x3().transposed()[2]
# create a bmesh from context object
me = ob.data
bm = bmesh.new()
bm.from_mesh(me)
left, cut, right = bisect(bm, plane_co, plane_no)

# do something
for f in left:
    f.material_index = 1
for f in right:
    f.material_index = 2
bm.to_mesh(me)
me.update()

Split the cut edges
bmesh.ops.split_edges(bm, edges=cut)

List of all vert indices in left faces, assigned to a new vertex group
# all left verts
left_verts = [v.index for v in set(v for f in left for v in f.verts)]
# create and assign to vertex group
vg = ob.vertex_groups.new(name="Left")
vg.add(left_verts, 1.0, 'REPLACE')


text:
Extruded Part disappears after switching from Edit Mode into Object Mode
As the title says: my newly added parts in my mesh disappear when I change from edit into object mode.
And if I change the position of my mesh in edit mode it's still at the same spot in object mode.
My mesh is rigged and weight painted, I also made a few animations.
I already checked my layers, tried Alt+H but nothing helped. Making a new mesh wouldn't be a big deal, but I can't make always a new mesh if get the same problem, so I want to know how to solve this problem.

could you upload the blend file as well please? Use:  http://www.pasteall.org/blend/

I am not sure how to solve this problem but I know it has to do something with the rigging and  animation

I just downloaded the blend file you uploaded to pasteall.org and I don't see the big extruded object either in object mode or in edit mode. Did you upload the correct file?

Bizarre, I see what you mean: I just extruded that same face and the extrusion disappears for some reason after switching out of edit mode. I wonder if you have to set a keyframe for the extrusion in the beginning of the animation? It might be that the size & shape of objects need to have keyframes also.

@BLendedUser If you need the shape keys, then at least you now will know what to research: how to edit Shape Keys to include edits to your model.

Thanks Thom Blair III and Vader, now i have some clues what i need to google :)

Shape Keys
I just deleted the Shape Keys for Head_Cube.005 and now the extruded arm face stays throughout the animation:

I don't know any more about Shape Keys, but here is a link to them on the Blender wiki:
http://wiki.blender.org/index.php/Special:Search?search=shape+keys&fulltext=
If you need the shape keys, then you will need to figure out how to edit them to incorporate the extrusion throughout the animation. I'd help more with them if I could, but I know nothing else about them.

Thanks a lot Thom ! :) Guess i can live without them till i learn more about blender.

@BlendedUser No problem...I know the feeling!
:)

If you try to extrude on a model that has shape keys you must make sure you have  Basis selected before you do any edits. If you have any other shape key highlighted the edits will only show up for that shape key when it is set to 1.


text:
Could LMB be made to box-select when used outside of a model, but circle-select when initiated over the mesh?
I'm trying to customise my Blender further, but finding it hard to set it up the way I want.
A few of the things I want to accomplish in order of complexity:
Box select on LMB
Box select with consistent modifier-key use: Shift LMB  to add to selection, Ctrl LMB  to remove from selection.
The above, but additionally: releasing the LMB  exits box select (confirms)
The above, but additionally: clicking over empty viewport starts box select, clicking over a mesh starts paint-select.
I know I can set Box Select to LMB  click, but have found it kind of annoying without at least some of the other things I bring up. Are these possible, and if so: without much scripting?

'Box select on LMB'
Try setting this in User Input: 3D View --> Border Select --> Tweak, Left, Any

(Let me know if you made progress on the SHIFT-drag to add to selection, I am looking for that as well.)
EDIT: I discovered a partial answer. Add a new shortcut, use the same one (type in view3d.select_border) This time check "Extend" and "Shift." Now Box selecting with shift will add to the selection in object and edit modes.
However there still isn't a way to subtract from the selection that I've found yet. And I don't know how to unmap CTRL-select for adding to selection. Keep me posted if you find a way.


text:
Using overlap() to check if two meshes are intersecting?
This is a follow up to How to check if two meshes intersect in python with BVH Tree?
It appears that just calling overlap() on the BVH tree of two objects is not enough. Some sort of bmesh transform is required (this part confuses the hell out of me). I tried this in the code below, however I am still getting intersection on every object even if they are all not touching..
#delete objects that are intersecting
def delInter():
    #check every object for intersection with every other object
    for obj_now in obj_list:
        for obj_next in obj_list:
            print()
            if obj_now == obj_next:
                continue

            #create bmesh objects
            bm1 = bmesh.new()
            bm2 = bmesh.new()

            #fill bmesh data from objects
            bm1.from_mesh(scene.objects[obj_now].data)
            bm2.from_mesh(scene.objects[obj_next].data)

            #fixed it here:
            bm1.transform(scene.objects[obj_now].matrix_world)
            bm2.transform(scene.objects[obj_next].matrix_world)

            #make BVH tree from BMesh of objects
            obj_now_BVHtree = BVHTree.FromBMesh(bm1)
            obj_next_BVHtree = BVHTree.FromBMesh(bm2)

            #get intersecting pairs
            inter = obj_now_BVHtree.overlap(obj_next_BVHtree)

            #if list is empty, no objects are touching
            if inter != []:
                print(obj_now + " and " + obj_next + " are touching!")
            else:
                print(obj_now + " and " + obj_next + " NOT touching!")

Whoops. Corrected! :)

Turns out I had to apply location to the BMesh I generated, I have edited code above to work:
        bm1.transform(scene.objects[obj_now].matrix_world)
        bm2.transform(scene.objects[obj_next].matrix_world)

This is the reason I was getting intersection for every face and object, since they were all in the same location as far as BVHTree was concerned.

I added the missing context so the code can be used by anyone. Tested and working with 2.8.
import bpy, bmesh
from mathutils.bvhtree import BVHTree

#show objects that are intersecting
def intersection_check():
    #check every object for intersection with every other object
    for obj_now in obj_list:
        for obj_next in obj_list:
            print()
            if obj_now == obj_next:
                continue

            #create bmesh objects
            bm1 = bmesh.new()
            bm2 = bmesh.new()

            #fill bmesh data from objects
            bm1.from_mesh(scene.objects[obj_now].data)
            bm2.from_mesh(scene.objects[obj_next].data)

            #fixed it here:
            bm1.transform(scene.objects[obj_now].matrix_world)
            bm2.transform(scene.objects[obj_next].matrix_world)

            #make BVH tree from BMesh of objects
            obj_now_BVHtree = BVHTree.FromBMesh(bm1)
            obj_next_BVHtree = BVHTree.FromBMesh(bm2)

            #get intersecting pairs
            inter = obj_now_BVHtree.overlap(obj_next_BVHtree)

            print("i got this far 1")

            #if list is empty, no objects are touching
            if inter != []:
                print(obj_now + " and " + obj_next + " are touching!")
            else:
                print(obj_now + " and " + obj_next + " NOT touching!")

# use active scene
scene =  bpy.context.scene

# define object list
obj_list = ['object_a', 'object_b']

# Run it
intersection_check()

This doesn't seem to work if objects are overlapping by just an edge or vertex... meaning an edge from one object is equal to the edge of another. If one object is moved over the other just a tick, then it flags overlap. My project has objects that start right at the point where one ends, using the same edge vertices. Overlap doesn't appear to be the proper solution in those cases.

@SamVimes I guess that is just how Blender (currently) works. Try a boolean operation of type union and see the result. That probably does not union as nice as if the objects would have overlapped by just the tiniest bit.

I tried to copy this code/test myself, without any Blender Python knowledge.  But was getting many errors.    I had to add in some extra code/rename some stuff to get it to work.  But here's what I got:
import bpy  #addbpy   <<ADD
import bmesh #addbmesh   <<ADD
import mathutils   #add mathutils  <<ADD

# get the current meshes   <<ADD
obj_list = bpy.data.meshes

# get the current scene  <ADD
scn = bpy.context.scene

# Define the BVH Tree  <ADD
BVHTree = mathutils.bvhtree.BVHTree

#Print objects that are intersecting
def delInter():
#check every object for intersection with every other object
  for obj_now in obj_list:
    for obj_next in obj_list:
    print()
     if obj_now == obj_next:
       continue

      #create bmesh objects
      bm1 = bmesh.new()
      bm2 = bmesh.new()

      #fill bmesh data from objects
      bm1.from_mesh(scn.objects[obj_now.name].data)   #<<  Add .name on both
      lines.
      bm2.from_mesh(scn.objects[obj_next.name].data)  #<<  Add .name on both
      lines.

      #fixed it here:
      bm1.transform(scn.objects[obj_now.name].matrix_world)   #<<  Add .name
      on both lines.
      bm2.transform(scn.objects[obj_next.name].matrix_world)  #<<  Add .name
      on both lines.

      #make BVH tree from BMesh of objects
      obj_now_BVHtree = BVHTree.FromBMesh(bm1)
      obj_next_BVHtree = BVHTree.FromBMesh(bm2)

      #get intersecting pairs
      inter = obj_now_BVHtree.overlap(obj_next_BVHtree)

      #if list is empty, no objects are touching
      if inter != []:
       print(obj_now.name + " and " + obj_next.name + " are touching!")   #
       <<  Add .name on both lines.
        else:
          print(obj_now.name + " and " + obj_next.name + " NOT touching!")
          #<<  Add .name on both lines.

  delInter()  #Call FN

Please use 4 space indenting.

a similar code would return an empty list of indices:
import bpy, bmesh
from mathutils.bvhtree import BVHTree

list_of_obj = [ o for o in bpy.context.scene.objects]
the_object = list_of_obj[0]
the_other_object = list_of_obj[1]

BMESH_1 = bmesh.new()
BMESH_1.from_mesh(bpy.context.scene.objects[the_object.name].data)
BMESH_1.transform(the_object.matrix_world)
BVHtree_1 = BVHTree.FromBMesh(BMESH_1)

BMESH_2 = bmesh.new()
BMESH_2.from_mesh(bpy.context.scene.objects[the_other_object.name].data)
BMESH_2.transform(the_other_object.matrix_world)
BVHtree_2 = BVHTree.FromBMesh(BMESH_2)

inter = BVHtree_1.overlap(BVHtree_2)

print(inter)

is there a missing bmesh operation ?
EDIT : the above code actually works if any object matrix transformation has not been changed after the last scene update. To apply this code to objects which have been transformed within the same script for example, one can add the following line above the code:
bpy.context.scene.update() # as commented below by @batFINGER


text:
Move meshes of several objects without affecting relative position
I've got a problem. I imported the single parts of a model as about 80 separate .obj files. The thing is, that the location of the objects is at {0,0,0} but the meshes are at ca {32,-149,1252} which makes them very far from the origin.
I need to keep the relative position between the meshes of the objects as they are part of a single model. Is it somehow possible to move all meshes without affecting their relative position? I need to get the model to the origin.
Maybe there is a different approach? I'm glad for every tips.
Note, I cannot combine the meshes into a single one because I need them separated.
Edit: Minimal Example

Create a new file with the standard cube
Create an additional torus and move it 1 along the z axis (g z 1)
press Tab to get into Edit-Mode of the torus and then move the mesh 5 along the x-axis (g x 5)
press Tab again to leave Edit-Mode and select the cube
press Tab to get into Edit-Mode of the cube and then move the mesh 5 along the x-axis (g x 5)

After this, you should get something like shown in the following image:

Now, as you can see the location of the objects is {0,0,0} and {0,0,1}. This is similar to the situation I have with my imported *.obj files. It is vitally important the torus stays on top of the cube, but I want to move the meshes so that both objects are in the origin.
When I select all objects and move them together to the origin, then I get the situation, where for instance the cube is at {-5,0,0} but the mesh of the cube is at {5,0,0}.

You see that although my objects are now at the origin, the little coordinate system indicator is far behind it. Therefore, is there a way to move all meshes (instead of the objects) while maintaining their relative position?

I would suggest one of two methods.
Method 1

Move your 3D cursor to the center or your objects (that you want to move)
Set origin of all the objects to 3D cursor.
Now move the objects. (movements are based on origin. You can also set transform to "individual origins for a different effect.)

Note: Selecting all objects and making a group will make things easier. This way you can select the whole group easily by selecting one of the objects and pressing shift+G then selecting "group".
Method 2

Create an empty
parent those objects to the empty.
Move the empty to the location you want.

Note: put the empty in the center of the object before parenting.
Method 3
This method is for moving the vertices of different objects to the same place, when the origins are already in the desired location.

Select all the objects you would like to edit.
Snap 3D cursor to selected (shift+s)
Set origin to geometry. (ctrl+alt+shift+c or toolbar)
Snap "selection to Cursor (offset)". (this operation is based on the origins, which are now at the centre of the geometry [mesh].)

Sorry for the late reply. I resolved it differently but I'm still interested in understanding it. The big problem is that objects are already at zero but the meshes are far off. I would like to move all meshes at once which doesn't seem to be possible. Do you know whether this is possible? AFAI can see, your method moves the objects, not the meshes that are contained in the objects.

Oh, I see what you mean. You want the vertices moved to the origin of the object. That is not quite possible, but something very similar is, and it may work for you (it is not quite precise, but it should help). I will add it to my answer.

I added method 3. I hope it works out for me. Tell me if it doesn't, and if you can, explain what needs to be done differently, but I'm not guaranteeing I'll know the answer. Still, I hope I can help. :) Thanks, Uncle Snail

I have added a small example for further reference, but as far as I can see, your 3rd method does what I want. The last step needs to be Snap: Selection to Cursor (Offset) but the important thing was the origin to geometry step. Thank you very much for your effort.

You're welcome. Thanks for the correction. I didn't actually have Blender open. :P


text:
How to turn medical scans into models in Blender?
This is not directly a Blender question, as it could be solved otherwise, but I'd like to see whether experienced users would do this inside blender and how.
Let's assume I had access to various kinds of 3D scans like CT, MRI, OCT, etc. The overall goal is to extract some part from this scan and turn it into a simple and good looking mesh. A very easy example would be to extract the skeleton from a CT scan. In this case I could

do a bone segmentation in the CT volume because this works reasonably well
use the binarized volume data to calculate the surface mesh of the skeleton
import and simplify the mesh in Blender

Other problems are harder to tackle because tissue or organs might not be easily separate-able from its surrounding with image processing. However, an expert could easily do the segmentation manually or semi-automatic layer by layer.
Question: For these two problems, is there a preferred way about what should be done inside Blender and what not? Are there good tutorials about it?
The second problem is especially interesting since one could trace the structure layer by layer inside Blender, extruding each layer afterwards. However, this could be more tedious than simply doing the segmentation in the images and calculating the mesh like in the first case with e.g. marching cubes/tetrahedrons.
Note: I have see the related questions here, here and here but unfortunately they are only related and don't discuss how to turn a scan into a simple mesh.

I wouldn't, as I believe that this is beyond the scope of what Blender currently does (not saying that I wouldn't ever, just not currently). At this point in time, I would probably try to use meshlab, and get a mesh to import into Blender. Assuming that you are getting point data from your scan. If not, and all you're getting is slice by slice images, I would try to use python's OpenCV to do some edge detection, and plot points at that particular (assumed Z/Depth) position of the slices recognized edge(s), and then still go out to meshlab to get mesh faces. After that Blender here we come.

Your comment is unfortunately what I was afraid of. I'm already using meshlab, osirix and friends and I know of e.g. 3d slicer. I just wanted to ask, because I wasn't sure there is something I missed. Thanks for your long comment. If the question is out of scope, feel free to mark it so.

I don't believe the question is out of scope as you intentioned to accomplish your task in Blender. I may be completely ignorant to something that exists in Blender now to accomplish this, and I'm personally glad you asked it.

Would it be possible to write an answer that explains what to do in Meshlab to get a usable mesh in Blender, or is that out of the scope of the SE? I come from the point of view that if part of the answer is about Blender, and being able to have a Blender-based workflow, it's not totally out of topic...

Is this a 3d image scan and if so what file formate?

Blendermarket: search for Dicom2Mesh program which allows to create 3D surface mesh models from DICOM volumes directly into Blender

I am not an expert but I am also interested in this question.
What I have found is an open source program which can process dicom files.
Invesalius 3 (https://www.cti.gov.br/en/invesalius)
Here is a short tutorial which shows extracting a skull mesh from a mummy's CT scan and export to Blender for further processing. https://www.youtube.com/watch?v=LMdxKwfEkvg
I have been started to experimenting with it just lately, so I cannot help much more.(for Ubuntu you can use ppa:tfmoraes/invesalius-ppa , but you can find other download methods on site)

This ENTIRELY depends on the kind of data you're working with.
If you're talking about physical or digitized images, then no Blender would not be the right solution. Blender doesn't have any kind of image-processing tools to generically discern 3D information from 2D images. I'm sure there are other tools that can do this.
If, however, the CT scanner is able to give volumetric data, I'd bet good chocolate that it's in a standard format like OBJ, PCD, or PNY. If THAT's the case, it'd be relatively trivial to import that data into Blender and make a model out of it. It might require pre-processing in MeshLab, but even that would be minimal.
If the CT data is in a volumetric format, you might be able to import it from "File -> Import..." if the related filetype is available.

The overall goal is to extract some part from this scan and turn it into a simple and good looking mesh

It depends what is a good looking mesh according to you:
a mesh that that a same shape as the medical scan or a mesh with a good topology.
For a blender user, a good topology is very important is it will influence further modeling ( such as smooth of subsurf), UV mapping, Rendering time etc..

•import and simplify the mesh in Blender

What do you mean by simplify? Change the topology in order to have fewer points? or make the mesh to only have quads?

Other problems are harder to tackle because tissue or organs might not be easily separate-able

In the CT scan, for each point, do you have some kind of additional information, such as tissue density, that would help to separete organs?

Question: For these two problems, is there a preferred way about what should be done inside Blender and what not? Are there good tutorials about it?

One could see 2 options:

Export the CT scan data in a format that can be import by blender.
Convert the CT data, in the some data point file (with a defined referential point, 3D coordinates, tissue density) like .csv and then use a python scrypt to import it into blender.


text:
Exporting hair curves and cards for UE5: Coloring fur based on image texture?
The TL;DR is that I can create texture-based color-inheriting alembics + hair cards when working with a new, clean fur curve system in the Blender > UE5 pipeline. I am unable to recreate this successfully, however, when converting hair particles to fur curves, and I suspect it has to do with certain Attributes that are easily accessible in Curves that are not so accessible in a Particle system.
The reason I must find a way to go from particles to curves/hair cards is that for my current project I am bound to using a preexisting set of assets that implement Particles in order to create the needed hair cards.
I hope you'll bear with me as I detail my whole process of discovery; I want to make it clear what have and have not tried.
With a new scene, I create Fur Curves on the default cube. These are exported using the Groom Export addon to an alembic file:

I convert them to meshes using Hair Tool (I'm sure this isn't the only way, but it's simple and clean) and export these as an FBX in order to use as custom hair cards:

In UE5, I create a material that uses the Hair Attributes node and the desired texture (1). Importing the alembic file and setting up the system like so (and using Cards instead of Strands), I get fur with the desired pattern (2):

It works wonderfully for this default cube, but when I move on to the more complicated thing I'm trying to get (a cat), I can only get a single solid color, even when all settings are identical (1). The only difference I can see is that the curves that make up the cat are not a single system: There are eight separate parts to the whole. So I tried to isolate just the tail (only tail curves + only tail cards), but in vain (2):

Testing further: I imported just the cat geometry, and created a new, from-scratch fur curve system and replicated the first curves-to-alembic process. It turns out that this works perfectly, and that there's some major difference between exporting native fur curve alembics and going from particles > fur curves.
Most notably, I learned from this tutorial (https://youtu.be/AnzLNdYvt34) that there is a list of Attributes that are by default connected to default curves, to which list you can add Color and Radius, and a custom Roughness Attribute:

When converting particles to curves, these attributes do not carry over. I assume they exist in some form on the particles, though, because when a material with an image texture is applied to the particle system, it inherits the per-vertex/face colors of that texture:

Also, whereas before with native hair curves I was able to just create out of thin air the "roughness" Attribute (as per the tutorial earlier mentioned), it does not look like the necessary surface_uv_coordinate, UVMap, and the others can be added manually with any expectation of a successful connection, even though in UE they are listed as present when importing the alembic curves:

It's at this point that I'm at a loss as to where to look. I don't know where that information is located in the Particle system to begin with, much less where to find where it goes when Particles are converted to Curves.
Is there something I'm missing, or is what I'm trying to do wholly impossible?
Thank you!


text:
What is the best way to approach this?
I run into very specific tasks, so I decided to join the forums )
I am relatively new to blender and am trying to learn the best ways.
I am modeling a temple that looks like this:

I noticed it has a bisymmetry, so I'll just model half of it and mirror it. But the front wall has a lot of detail that I need to replicate. So, I could subdivide it using edge loops and extract the formed "pixels"

Or do I use the knife tool to create the vertices and edges and then extrude it?
So what I am asking what are the best methods pertaining to modeling real estate with detail?

unfortunately these kind of questions are problematic on this site, because they might be getting closed because it's opinion based. This site has some strict rules so i recommend asking "how can i" so you don't risk that your question will be closed.

I agree with Chris. Any suggestions would be opinion-based as everyone has different ideas. Voted to close.

Just to elaborate on why this is opinion-based, this amount of quads is definitely not suitable for say a mobile video game. But if you're going to model a temple that will appear in the foreground of the next Avengers movie you will need a LOT more detail. Please add  bit more background to your specific workflow and needs. As a rule of thumb if you're beginning you should aim for the least amount of geometry to achieve your goal. You can always subdivide a mesh, un-subdividing after the fact is way harder.

Hello and welcome. Please use a title that matches the content of the post. It should read like a question, be descriptive but succinct, unique and identifying, summarizing the problem so that anyone searching for similar issues is likely to find this. Remove anything superfluous, avoid using words like "this", "help with", "issue" or "question about", instead describe what "it" is. Remember, your title is the first thing visitors see, answers you get depend heavily on it. See What is the problem of asking “How do I do this?"

While it's true that the modeling style depend a lot on what you want it for, here's a few pointers:

You don't need the hole object to be full of small quads. That kind of geometry is usually reserved for things that are going to deform. It's not needed in a building.

Things usually don't need to be a single object/mesh. Instead of extruding all the detail manually from the faces you can use other objects. You can use a boolean modifier to cut windows out of the wall with one or more box type objects. Depending on the use of the model you may need to apply the modifier and clean the topology, but that's still a lot easier than covering it in quads.

You can make the details on the top by modeling one of them and giving it an array modifier

The crenelations don't need to be connected to the main wall either, as they need a lot more geometry and will be hard to connect. The objects just need to overlap to look good.

There's a lot of youtube tutorials on how to model architectural stuff so look them up if you are just starting.


text:
Renders with horizontal darker bar in cycles with GPU
I have an issue with several renders of a project.
As you can see in the attached snapshot, during a Cycles render appear several horizontal bars or lines with different coloration or darkened, and I don't know why... (it occurs with different cams in this interior project)
I've made these renders before in 50% resolution without facing this problem. But with 100% resolutions it appears (4500x3000 pixels).
It only happens with GPU. In CPU mode it works correctly (but it takes 3-4 times longer to do the render).
I've tested in CUDA instead of OptiX, and it solves the problem with one of my renders, but not with others, so this is not a permanent solution.
Blender 4.1.1
Mac & Windows (I've tested in both systems)
Please, could you help me with this problem?
Thanks and best regards,
Jose.

Sorry, this does not seem to be a problem with using Blender, it is rather a hardware problem or a bug. I would recommend you try updating your GPU drivers and/or report it as a bug. In any case I think it is off-topic on this site. Or we would need your file to check if our hardware has the same problem rendering it.

It's not a hardware problem because I've the same problem in a Macbook Pro M1 Max, with different GPU. How can I send you the file?

You can upload files at https://blend-exchange.com and follow the instructions there to edit them into your question.


text:
Objects in blender do not fit into collections/problem with collections in blender
I don't know how to make sure that all my objects in the scene are sorted into collections, because when I add an object to a collection, it remains separately, in the outliner itself. when I try to hide this collection nothing happens, I think it's because of a problem with the collection. I'm a newbie and I'm hoping someone knows why this is happening and can help me resolve this issue.

That depends on what and how you have done it which I cannot in screenshots. You can move objects into a collection with M (which removes it from another) or link (Shift+M) them to a collection (which means they are in both), which can be used for organizing in different categories, like blue and red objects and spheres and cubes as simple examples, where objects can be part of different collections. Apart from that, let's say an object is parented to another, when you move the parent to a collection, the child does not move with it if it's not selected.

As Gordon says, the object can be linked, what does it give if you right click >Unlink?

Gordon, thank you very much, I didn’t even know that you can add collections in different ways (I use shift+m all the time)


text:
problem with UvRizom
I downloaded the trial version of UvRizom 2024, And I bought the Rizomuv Bridge addon - Blender 2.8+
(https://blendermarket.com/products/rizomuv-bridge)

In "RizomPath" I chose this path:

After clicking export, the following error appears:

What am I doing wrong?

Sorry but we can't help you with third-party commercial addons. This Q&A site can only help with problems using Blender and its built-in addons. Suggest you contact the addon's author(s).

Okay, I just thought that maybe someone also used this add-on and could answer me, thanks

@AlenaZhuravleva have you tried contacting the seller of this addon? They should be able to help you.

I tried it, I'm waiting for an answer, thanks


text:
Possible to add more than one object via Boolean modifiers?
The following script adds a boolean modifier to the active object. This works great for one cutting and one target object.
Imagine you have one cube and 4 spheres and you would like to end up with the cube having 4 boolean modifiers and each modifier uses one of the four spheres.
Would it be possible via python to collect / sort all the non-active objects and one by one add a modifier to the cube and then add a sphere?
    target_obj = context.object
    cutter_obj = bpy.data.objects['Sphere']

    bool_mod = target_obj.modifiers.new('cutter', 'BOOLEAN')
    bool_mod.operation = 'DIFFERENCE'

    bool_mod.object = cutter_obj

No, one cutter object per one boolean modifier. But you can join the cutter meshes into one object and cut with that within one modifier. Or just use multiple boolean modifiers like you suggested.

I think you misunderstood me. I know that one boolean can only use one object. I am asking about adding as many boolean modifiers as there are objects to add automatically so you do not have to do this manually. I rewrote my question to make this more clear.

This seems to be a duplicate of this, at the very least they are related.

Why not add Boolean modifiers based on selected vs active states. If you have 5 selected objects, the last one selected is active.
The concept
import bpy

def get_active_and_selected(context):

    active = context.active_object
    selection = context.selected_objects
    selected = set(selection).difference(set([active]))
    print('active:', active.name)
    print('selected (not active):', [o.name for o in selected])

get_active_and_selected(bpy.context)

If the cube is selected last it will print:
active: Cube
selected (not active): ['Sphere.004', 'Sphere.002', 'Sphere.001', 'Sphere.003']

The function
Adding multiple modifiers to the active object
import bpy

def add_selected_to_active(context):

    active = context.active_object
    selection = context.selected_objects
    selected = set(selection).difference(set([active]))

    if not (active and selected):
        return

    for idx, cutter in enumerate(selected):
        bool_mod = active.modifiers.new('cutter_' + str(idx), 'BOOLEAN')
        bool_mod.operation = 'DIFFERENCE'
        bool_mod.object = cutter
        cutter.hide = True

add_selected_to_active(bpy.context)

The operator
This could be easily turned into an Operator and employ error checking to avoid doing anything until all necessary conditions are OK.
At this point it's worth your time to read up on operators. How to make them, register them and call them from UI. It's just a bit of boilerplate which is similar for all add-ons. Blender's TextEditor has a few Operator templates, most notably: TextEditor > Templates > Python > Operator (Simple)

.difference  is like remove/minus? inside "selected = set(selection).difference(set([active]))"

technically it is just: return the items in set(selection) that are not in set([active]) and call the result (also a set) selected, using Boolean math. like Venn diagrams.

great this also helped me to figure out how to do a mirror modifier along a specific axis

I see, lets get the target_obj = active object (last selected), and all the cutter objects (selected but not active) and then you add a modifier for every cutter object with your code snipped in a loop:
import bpy

target_obj = bpy.context.active_object
cutter_objs = [obj for obj in bpy.context.selected_objects if obj != target_obj]

for obj in cutter_objs:
    bool_mod = target_obj.modifiers.new(obj.name+'_cutter', 'BOOLEAN')
    bool_mod.operation = 'DIFFERENCE'
    bool_mod.object = obj

This works as well great. Adding "obj.draw_type = "BOUNDS"" will make call cutters to BOUNDS. This script also works with only two objects selected. Any idea why this is different to zeffii's script?

The answers here didn't really work for me using Blender 2.79, so I thought I'd paste the script I currently use here:
def applyBoolean(operation, name, a, b):
    """For operation use either UNION, DIFFERENCE, or INTERSECT"""
    modifier = a.modifiers.new(type="BOOLEAN", name=name)
    modifier.object = b
    modifier.operation = operation
    bpy.ops.object.modifier_apply(modifier=name, apply_as="DATA")

    bpy.data.objects.remove(b)

Usage:
    bpy.ops.mesh.primitive_cylinder_add(
        radius=3,
        location=(0, 0, 0)
    )

    base = bpy.context.object
    base.name = "Base"

    bpy.ops.mesh.primitive_cylinder_add(
        radius=2,
        depth=7,
        location=(0, 0, 0)
    )

    torso = bpy.context.object
    torso.name = "Torso"

    applyBoolean("DIFFERENCE", "diff_base_torso", torso, base)

This will create a modifier to remove the base object from the torso object. It will also the delete the base object so the end-result in your editor is what you would expect if you have used other tools. :)


text:
Where to find correct syntax for operator in Blender API manual?
I have an issue finding the correct documentation online.
Example:
CTRL + A calls the following command:
bpy.ops.wm.call_menu(name="VIEW3D_MT_object_apply")

And a selection option reads out the following command:
bpy.ops.object.transform_apply(scale=True)
bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)

Solution:
Now by trial and error I found out that if you want to call an operator it has to be formatted the following way:
row.operator("wm.call_menu", text="Apply Tans").name="VIEW3D_MT_object_apply"
row.operator("object.transform_apply", text="Apply Rot").rotation=True

name and rotation have to come after the operator closing bracket to pass that information to the operator.
Where can you in the Blender Python API find this information? I searched for it but do not find anything about the correct syntax.

duplicate ? http://blender.stackexchange.com/q/2515/5113

I read this earlier and this option works by first generating a class that can execute the complete bpy command. Then command name is given to the button to operate/ execute.  I am more interested in a solution that is only one line long - if that is actually possible.

the one line solution is working fine check your full script

The docs have this information if you know what you're looking for.
http://www.blender.org/api/blender_python_api_current/.../wm.call_menu
In this case TextEditor > Templates > Python > UI Menu has a working example of how to trigger a specific menu
The UI source is often the most comprehensive documentation. For example space_view3d.py's class VIEW3D_MT_mirror(Menu) shows how to pass properties to an operator. As you have now seen
props = layout.operator("transform.mirror", text="Z Global")
props.constraint_axis = (False, False, True)
props.constraint_orientation = 'GLOBAL'

Here both constraint_axis and constraint_orientation are passed as values to bpy.ops.transform.mirror as soon as the button is pressed.


text:
Fighting split col and aligning row content
I am really struggling with horizontal alignments.
Look at lower right image example.
Layer + Parent are in one column and a split function defines the width of the next column that contains the layer and parent UI elements.
The problem is that this way the row like horizontal alignment is off.
Parent text is higher than the parent UI element.
I tried different row ideas but nothing worked.
To my frustration in the upper right corner the parent UI is drawn on the left side while the layer element is on the right side. What causes this?

So this is what I try to do.
Lets say 30/70 column spacing
and the content aligned along their top edge
The % value should be global so I have to adjust it once and the layer + parent UI will be stretched along the length.

Two approaches.
not pixel accurate, but less code.
c = layout.column()
row = c.row()
split = row.split(percentage=0.3) # use factor instead of percentage for Blender 2.8+
c = split.column()
c.label("Layers")
split = split.split()
c = split.column()
c.prop(obj, "layers", text="")

c = layout.column(align=True)
c.prop(obj, "parent", text="Parent")

Pixel perfect but a little convoluted!
c = layout.column()
row = c.row()
split = row.split(percentage=0.3)
c = split.column()
c.label("Layers")
split = split.split()
c = split.column()
c.prop(obj, "layers", text="")

c = layout.column()
row = c.row()
split = row.split(percentage=0.3)
c = split.column()
c.label("Parent")
split = split.split()
c = split.column()
c.prop(obj, "parent", text="")

The second version can be restated using a function, there's a lot of repetition, and you might want to do the same for more properties..
    def draw_props(labelname, propname):
        c = layout.column()
        row = c.row()
        split = row.split(percentage=0.3)
        c = split.column()
        c.label(labelname)
        split = split.split()
        c = split.column()
        c.prop(obj, propname, text="")

    draw_props("Layers", "layers")
    draw_props("Parent", "parent")

Ah you confirmed my opinion that you cannot do that with one percentage call. Would that not be possible to define the number as a global one so each percentage could fetch the number?

you can make a function inside the draw function (nested function). I 've done that on many occasion to simplify my UI code. Else you are bound by the Blender layout

authors: Савелий Пацула


text:
Attribute error while declaring correct variables
I try to display the light type options inside the toolbar in a shelf.

So I copied the code from the Blender "ui.py" but I remain getting the error that for the light object I have not defined the attribute lamp right.

AttributeError: 'Context' object has no attribute 'lamp'

class ObjectShading(bpy.types.Panel):
    bl_label = "Light Shading"
    bl_idname = "LightShading"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "Shading Toolbox"

    @classmethod
    def poll(cls, context):
        return context.lamp

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

        lamp = context.lamp
        clamp = lamp.cycles
        cscene = context.scene.cycles

        layout.prop(lamp, "type", expand=True)

        row = layout.row()
        row.prop(clamp, "cast_shadow")

What is it that I am missing or doing wrong here?
If I exchange lamp=context.lamp with lamp = context.active_object.data it works.

As the error suggests, there is no lamp property in bpy.context and as you found context.active_object.data gives you the properties you are after when a lamp is selected.
Unlike a camera, there is no "active" lamp and there could be hundreds of lamps in a scene. You will most likely want to test if the active object is a lamp and display it's properties if it is.
if context.active_object.type == 'LAMP':
    lamp = context.active_object.data
    layout.prop(lamp, "type", expand=True)

Quick note. There is a context.lamp available if you are in the properties space  'DATA' panel, with a lamp object selected, just as there is a context.speaker if that is the type of object selected.   As shown they are not available elsewhere, and is something to look out for when re-using properties panel code elsewhere, like in the 3D view toolbar.


text:
Argument error with remove constraint py code
This is the constraint remove function:
class DeleteTrackTo(bpy.types.Operator):

    bl_idname = "delete.trackto"
    bl_label = "Delete TrackTo"
    bl_options = {'REGISTER'}

    def execute(self, context):

        obj = bpy.context.active_object
        constraint_to_remove = obj.constraints.get("TRACKTO")

        obj.constraints.remove(constraint_to_remove)

        return{'FINISHED'}

This is the Pie menu calling the constraint remove function:
class PieManipulateObject(Menu):
    bl_idname = "pie.manipulateobject"
    bl_label = "Object Edit"

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

        scene = context.scene

        pie = layout.menu_pie()

        col.operator("object.track_set").type='TRACKTO'
        col.operator("delete.trackto")

I get this error message when calling the remove function:

TypeError: ObjectConstraints.remove(): error with argument 1,
  "constraint" -  Function.constraint does not support a 'None'
  assignment Constraint type

it is obj.constraints.remove()

you can always try it in blender python console and you 'll get auto completion this really help  ( also the docs )

I adjusted the code a little but ran into the following error.

you have to pass the name of the constraint not the type to the get()  function ( which is returning None because it doesn't find the constraint with a name "TRACKTO"  ), also it would be better to check if the constraint exist before deleting it

@Chebhou I see. This then renders the problem that in case the Name got changed the script will fail. That is why I thought you could filter out the constraint via the type (trackto) and not via the individual name.

you can loop through all constraints and if their type is trackto you delete them

How do you do that? I thought with "obj.constraints.get("TRACKTO")" I would be able to do that.

for c in obj.constraints : if c.type=='TRACKTO' : ....

Let us continue this discussion in chat.


text:
Get texture to never distort or change scale without manual unwrapping
To clarify things, as most of the firsts answers suggest I need a better wording:

I'm looking for something like the "smart UV Project" unwrapping method but real time (like a node or mix of node in the material or a projection mode in the texture property or a modifier, whatever adapt to changing meshes)
Why real time and not through unwrapping ? Because most of our objects are parametric, most of the geometry comes from modifiers for ease of management, memory efficiency and many other reason which makes applying those modifier impossible without involving 10x time the workload for the project. So we sometime have only 2D meshes, the rest is an animated modifier stack. As our objects are mostly not organic, stretching is not wanted. Another reason are big meshes (more than a million polygons, really hard to unwrap).

Original Version:
I would like my texture to always keep a scale and be orthogonally projected following the ngon's normal it's projected on, without unwrapping, so that textures never get distorted, whatever modifications are made to the mesh in edit or object mode. (so if you look at an ngon with orthogonal view mode, facing the ngon, the texture looks exactly like in the image editor)
I Tried "box" projection mode in texture panel. It works to some extent on a plane with "texture coordinates" set to "object". I can move edges and scale, but if I rotate the mesh on the x or y axis, it starts to distort because the projection is in object coordinate instead of following the ngon normal.
The solution should work on complex meshes.

When using Object mapping, why aren't you using vertex parenting? You can choose 3 vertices in your ngon and make them the parent of your control object (probably an Empty). Then, when you rotate your mesh, the control object moves with it correctly.

Why no unwrapping?

Why no unwrapping? Because it breaks as soon as vertices are moved : it doesn't allow big movement with shapekeys or real time visualisation of modifications and involves repetitive steps. Without to mention that unwraping a 1 000 000 vertices mesh every 30sec is pretty slow.

Another reason, is that many of our objects are parametric/made with modifiers (like 2d shapes who are only automatically extruded with an animated solidify modifier, etc...) Here is the solution of unwrapping simply impossible (maybe through an unwrapping modifier ? like a "smart UV Project" modifier. But it would be a feature request)

@Fweeb I'm not sure what you mean with vertex parenting. Could you give an example with image/blend file? Would I have to add 1 empty per ngon (hard on many million ngon meshes) ?

@matali sure thing. To do vertex parenting, you need to have either one or three vertices selected. You can see an example .blend file here (http://www.pasteall.org/blend/24822). I made one of Suzanne's eyes a ngon and parented an empty to three of the vertices in that ngon. Of course, If you have a mesh with millions of ngons, this is not likely to be the best solution... but then again, you probably shouldn't have a final mesh with that many ngons ;)

@Fweeb thanks for the file, it's interesting, I didn't knew about it. Sadly, we do have those million polygon meshes. I work for a midrange town (200 000 ppl), and the shape data file alone, just "schrinkwrapped" on the Terrain and solidified (so a really simple model of the town) has 1,8 Billion quads... and the shape data is updated every year by people without any knowledge in 3D. Anyway, applying the modifier is giving to much trouble for what we want to do with the model. So we look for an adaptive solution. We use "box" projection in the texture panel, but it's ugly in some streets.

If you don't want to unwrap, the only way I know how to achieve what you are asking for is by using 3D procedural texture shaders. You can achieve some very impressive results if you learn how to work with them and or code them yourself. Blender has some built in that you can layer up on top of each other, though it will likely take you a lot longer than unwrapping UVs and painting to make look nice.
Note that with procedural textures, you will lose a lot of control. With procedural textures you are trying to emulate a texture using math. So getting a dent or scratch right where you want it is difficult, getting an image like a decal is nearly impossible - or will still require unwrapping UVs and a good ol' fashioned texture. So basically procedural textures are really good if you have a repeating natural pattern such as landscapes, dirt, rock, metal, wood, cement, but not for highly controlled images/decals.
If you need your model to deform, you need to use refP or whatever the Blender equivalent is (relatively new to Blender myself.) Essentially, because you are using vertex positions as the coordinates (world space or object space) instead of UVs, if the vertex positions change or morph, your texture will swim unless you are using a static reference position/frame as your texture coordinate.
So moral of the story, if you have a deforming object or an object which needs a high amount of control and or decals/images, you are stuck with UV unwrapping. Honestly UV mapping is relatively painless in Blender with their seams. I prefer this method to all other solutions I have seen.
I know Disney came up with some form of mapping which made it so you don't have to unwrap or mess with UVs called Ptex, you just paint directly on the faces and each face stores its own image map of sorts (texels). But Blender obviously does not have that in their toolset. Here's the reference on that:
http://ptex.us/

here is an informative thread on Ptex, OpenSubDiv, and Blender: http://blenderartists.org/forum/archive/index.php/t-275832.html

Welcome to blender PolyMesh :) Congratulation for your answer, you took care of the question. I tried to find those control points you speak about, but couldn't find anything about it. OSL seems to be a good mix of procedural and it seems I can plug textures in osl nodes, but OSL+texture nodes makes rendering 5x slower than without (both render in CPU mode)on my PC and it's a replicable bug on many computers, seems to be inherent to the actual implementation with OpenImageIO or something.

So in the end, it would do the job in theory but in practice, it's 3x5=15x slower than GPU rendering which is way to slow :( We don't have a programmer team to get 100% procedural textures for all our needs. To resume, I would be happy if you give more info on those control points :)

Thanks! If by control points you mean refP, you could just generate a custom vertex attribute which is equivalent to the vertex position, just set this once after modifying the geometry as it is a "reference position" of the vertices. Then in your OSL shader simply use that custom attribute when doing texture lookups. I have zero experience with OSL in Blender, but my understanding is that OSL is similar and based off RSL, which I am familiar with. Hope that helps :)

You can use Smart unwrap and set the angle to 0. This will make each ngon an island (unless they are totally flat I think).
It will look like this:

Hi Gunslinger, the result is good and I know this option, I'm looking for that without unwraping (if possible at all) to allow quick modification and visualisation of the modification.

and as explained above, some of our objects can't even be unwrapped (parametric objects or object of which most of the geometry comes from modifiers which can't be applied)

My guess is you have to dive into python then. But as you have one million ngons, it will not be very snappy. :-/

You can select all in edit mode with A and then Ctrl E-> Mark Seam and unwrap, then every face will get it's own part of the texture (it still will distort though if you distort the face)

Thanks dimus, but as explained above, some of our objects can't even be unwrapped (parametric objects or object of which most of the geometry is from modifiers which can't be applied)


text:
Possible to replay repetitive tasks using Python?
Is there a way to do a particular task manually, generate the code for it automatically and update that code to do some task repeatedly?
I'm looking for something like record macro functionality that's available in MS Excel.

If you pull down the Info header you will find that a fair amount of operations you can perform in Blender are printed there for relatively simple stuff such as adding a lamp or a modifier etc.
This example:

adds a cube
scales it by 2.0
translates on the Z axis by 1.0.
sets the color to red
shows the name
renames the object.

Select the lines (mouse-click, border-select or AKey)
Ctrl+C to copy the selected lines.
Paste into the text editor.
add import bpy at the top of the text block.

After that, if you were to have a look at the api, you could cut out much of the fluff and just use said commands in a script to reuse whenever you need to provided it is simple enough and in the correct context.
For example:
bpy.ops.mesh.primitive_cube_add(
        radius=1.0, view_align=False, enter_editmode=False,
        location=(0.0, 0.0, 0.0), rotation=(0.0, 0.0, 0.0),
        layers=(False, False, False, False, False, False,
                False, False, False, False, False, False,
                False, False, False, False, False, False,
                False, False))

... can be shortened to bpy.ops.mesh.primitive_cube_add() in most situations.
This is as close to a macro like functionality that you can get in Blender and it is linear so any actual repetitive bits will have to be crafted by you, loops etc. It is also worth noting that many of these commands need to be run in a specific context so I would recommend using it as a means of learning the correct calls instead of trying to reuse it directly.
Note
For most operations, there is an accompanying line of code printed. Including changing numeric values, toggles... etc.
Excluded operations are typically not useful to redo, zooming/panning, setting the cursor location... etc.

Note that not all operations are logged, and changes in the context (which operators rely on) don't necessarily appear in the operator log.

@CoDEmanX I did say most, will add a bit more info shortly.

I refered to "reuse whenever you need to", which sounded like you could run the copied ops whenever you want to. But it's not true, 'cause of the context requirements. Thus, it's not a proper macro system, 'cause it will mostly require touch-up to make it work (under several conditions). It can be misleading to see the operator log and think of it as a macro system. I would appreciate a full action serialization in Blender of course (to allow for true macro recording), but it's not going to happen any time soon.

@iKlsR how to save and add in macro list and give hotkeys not mention. I have seen an video https://www.youtube.com/watch?v=zMxkU350SaE in that video the shortcut are made in the menu time its coming from beside the mouse pointer.

If you're using Linux, another option is to use the command line program xdotool.  It allows you to simulating pressing certain keys. I just used the following command below to automate duplicating, shifting and rotating an object 20 times.  The sleep 5 at the beginning is to give you enough time to move your mouse into the Blender window.
sleep 5 ; for i in {1..20} ; do xdotool type "Dgz-.15^Mrz5^M" ; done

The ^M sequence is a single character that represents pressing Enter. You can generate it by pressing <ctrl-v><enter>.

As mentioned above, repetitive tasks in blender are scripted in python.
When blender is launched with --debug-wm argument , python expression corresponding to executed user actions are printed in console of Info panel and also can be a reference for simple macro script creation.
Also, not exactly same as Excel macros but macro recorder add-on is useful to record a a set of user's actions as python script, while editing a mesh for example and refactor it for reuse if necessary.
There is also paid nice UI based macro editing feature in Pie Menu Editor add-on