text:
How to recreate Principled BSDF node with BSDF nodes?
I would like to try to exactly recreate the Principled BSDF node with Blender's BSDF nodes, I'm doing this for Testing purposes.
I would like to create a group node that behaves exactly like a Principled BSDF, keeping in mind this graphic that explains how the layers are made: https://docs.blender.org/manual/en/4.0/render/shader_nodes/shader/principled.html#layers

I'm not sure if it can be done, for example Clearcoat doesn't seem to have a BSDF Shader equivalent.
Example of what I'm trying to do:

Additional note
See the answer from @X Y
which points to OSL Nodes as a potential solution, but this is not what I want, for one simple reason: OSL Nodes don't support GPUs or even Eevee, so I think it's almost unthinkable to use OSL Nodes as an answer
My question is oriented towards how to do this with Blender nodes and how to mix them together within a Group Node, so that they behave like the Principled BSDF node, As I indicated in the second image, I am trying to connect the simple BSDF nodes in order to recreate the Principled BSDF
Some Test
I tried mixing the Glossy with Fresnel with IOR at 1.45 (In order to make the Specular), the results are markedly different

The Principled BSDF, was introduced with Blender 2.8. So if you want to know how materials were made without it, have a look at 2.79 shaders. The Principled BSDF also calculates the Fresnel effect so I guess you need a Layered Weights node in your collection.

I don't think we did anything close to "exactly recreate the Principled BSDF" before that, we had lots of community-made meta/uber shaders shared by people (like this one) that would vary a lot in features and accuracy.

@L0Lock It seems interesting, but that node seems to have multiple outputs, I would be more interested in rebuilding one with only 1 output like Blender's.

Just do the same with just one output. BTW works on OptiX GPUs since 3.5 and is being updated for more compatibility since. See Reference/Release Notes/3.5/Cycles - Blender Developer Wiki and Open Shading Language — Blender Manual

By "overturned" you mean fixed? It's not like the Principled BSDF is changed every version either, plus professional productions aren't supposed to change software versions every Thursday, that's part of why LTS versions exists.

I don't think this is 100% possible just with nodes, because of some things like the roughness, the subsurface scattering algorithm and so

Also will come questions like performances.

Method 1: Custom Node in Cycles
It's useful when you want to use an older version of node in a new blender version

The OSL source of Principled BSDF you can find in ..\blender-3.x.x\intern\cycles\kernel\osl\shaders\node_principled_bsdf.osl
This is 3.41 version:
/* SPDX-License-Identifier: Apache-2.0
 * Copyright 2011-2022 Blender Foundation */

#include "node_fresnel.h"
#include "stdcycles.h"

shader node_principled_bsdf(string distribution = "Multiscatter GGX",
                            string subsurface_method = "random_walk",
                            color BaseColor = color(0.8, 0.8, 0.8),
                            float Subsurface = 0.0,
                            vector SubsurfaceRadius = vector(1.0, 1.0, 1.0),
                            color SubsurfaceColor = color(0.7, 0.1, 0.1),
                            float SubsurfaceIOR = 1.4,
                            float SubsurfaceAnisotropy = 0.0,
                            float Metallic = 0.0,
                            float Specular = 0.5,
                            float SpecularTint = 0.0,
                            float Roughness = 0.5,
                            float Anisotropic = 0.0,
                            float AnisotropicRotation = 0.0,
                            float Sheen = 0.0,
                            float SheenTint = 0.5,
                            float Clearcoat = 0.0,
                            float ClearcoatRoughness = 0.03,
                            float IOR = 1.45,
                            float Transmission = 0.0,
                            float TransmissionRoughness = 0.0,
                            normal Normal = N,
                            normal ClearcoatNormal = N,
                            normal Tangent = normalize(dPdu),
                            output closure color BSDF = 0)
{
  float f = max(IOR, 1e-5);
  float diffuse_weight = (1.0 - clamp(Metallic, 0.0, 1.0)) * (1.0 - clamp(Transmission, 0.0, 1.0));
  float final_transmission = clamp(Transmission, 0.0, 1.0) * (1.0 - clamp(Metallic, 0.0, 1.0));
  float specular_weight = (1.0 - final_transmission);

  vector T = Tangent;

  float m_cdlum = luminance(BaseColor);
  color m_ctint = m_cdlum > 0.0 ? BaseColor / m_cdlum :
                                  color(1.0, 1.0, 1.0);  // normalize lum. to isolate hue+sat

  /* rotate tangent */
  if (AnisotropicRotation != 0.0)
    T = rotate(T, AnisotropicRotation * M_2PI, point(0.0, 0.0, 0.0), Normal);

  if (diffuse_weight > 1e-5) {
    if (Subsurface > 1e-5) {
      color mixed_ss_base_color = SubsurfaceColor * Subsurface + BaseColor * (1.0 - Subsurface);

      BSDF = mixed_ss_base_color * bssrdf(subsurface_method,
                                          Normal,
                                          Subsurface * SubsurfaceRadius,
                                          mixed_ss_base_color,
                                          "roughness",
                                          Roughness,
                                          "ior",
                                          SubsurfaceIOR,
                                          "anisotropy",
                                          SubsurfaceAnisotropy);
    }
    else {
      BSDF = BaseColor * principled_diffuse(Normal, Roughness);
    }

    if (Sheen > 1e-5) {
      color sheen_color = color(1.0, 1.0, 1.0) * (1.0 - SheenTint) + m_ctint * SheenTint;

      BSDF = BSDF + sheen_color * Sheen * principled_sheen(Normal);
    }

    BSDF = BSDF * diffuse_weight;
  }

  if (specular_weight > 1e-5) {
    float aspect = sqrt(1.0 - Anisotropic * 0.9);
    float r2 = Roughness * Roughness;

    float alpha_x = r2 / aspect;
    float alpha_y = r2 * aspect;

    color tmp_col = color(1.0, 1.0, 1.0) * (1.0 - SpecularTint) + m_ctint * SpecularTint;

    color Cspec0 = (Specular * 0.08 * tmp_col) * (1.0 - Metallic) + BaseColor * Metallic;

    if (distribution == "GGX" || Roughness <= 0.075) {
      BSDF = BSDF + specular_weight *
                        microfacet_ggx_aniso_fresnel(Normal,
                                                     T,
                                                     alpha_x,
                                                     alpha_y,
                                                     (2.0 / (1.0 - sqrt(0.08 * Specular))) - 1.0,
                                                     BaseColor,
                                                     Cspec0);
    }
    else {
      BSDF = BSDF + specular_weight * microfacet_multi_ggx_aniso_fresnel(
                                          Normal,
                                          T,
                                          alpha_x,
                                          alpha_y,
                                          (2.0 / (1.0 - sqrt(0.08 * Specular))) - 1.0,
                                          BaseColor,
                                          Cspec0);
    }
  }

  if (final_transmission > 1e-5) {
    color Cspec0 = BaseColor * SpecularTint + color(1.0, 1.0, 1.0) * (1.0 - SpecularTint);
    float eta = backfacing() ? 1.0 / f : f;

    if (distribution == "GGX" || Roughness <= 5e-2) {
      float cosNO = dot(Normal, I);
      float Fr = fresnel_dielectric_cos(cosNO, eta);

      float refl_roughness = Roughness;
      if (Roughness <= 1e-2)
        refl_roughness = 0.0;

      float transmission_roughness = refl_roughness;
      if (distribution == "GGX")
        transmission_roughness = 1.0 - (1.0 - refl_roughness) * (1.0 - TransmissionRoughness);

      BSDF = BSDF +
             final_transmission *
                 (Fr * microfacet_ggx_fresnel(
                           Normal, refl_roughness * refl_roughness, eta, BaseColor, Cspec0) +
                  (1.0 - Fr) * BaseColor *
                      microfacet_ggx_refraction(
                          Normal, transmission_roughness * transmission_roughness, eta));
    }
    else {
      BSDF = BSDF +
             final_transmission * microfacet_multi_ggx_glass_fresnel(
                                      Normal, Roughness * Roughness, eta, BaseColor, Cspec0);
    }
  }

  if (Clearcoat > 1e-5) {
    BSDF = BSDF + principled_clearcoat(
                      ClearcoatNormal, Clearcoat, ClearcoatRoughness * ClearcoatRoughness);
  }
}

Method 2: Node Group
A Node group can be created using built-in nodes similar to source code. In v4.0 Principled BSDF, It changed a lot and added some new stuff, like change IOR will effect the Fresnel curve but v3.6 doesn't.
It is no simple way to make a accurate version since some closure in osl not Appear in node interface.
Here is a simple example you can refer to, a node group that performs Principled BSDF in Blender 3.6.
You can play with Color, Specular, Roughness and Metallic but less accurate than the original version.

Here is some test in 3.6 Cycles

Here are some tips for converting osl language to node
mix closure
BSDF = mix(A, B, fac);

Add closure
BSDF = A + B;

Multiply closure
BSDF = color(r, g, b) * A;

Condition a and b
BSDF = A;
if (a < 1.0 && b > 0.0) {BSDF = B;}

if else
a = condition ? b : c;
/* If the condition is true, then a is assigned to b, otherwise c */

This is very interesting! I don't want to use OSL nodes have limitation on Eevee if I remember correctly. It would also be interesting to understand if there is an OSL to Nodes converter that works accurately.

Converters don't exist because OSL can do things that node systems can't. Like for loop with variable.

If I'm free in a few days, maybe I can give you a similar node group or some hints if no new answers.

It would be nice to see how the Transmission integrates. I love this work you did! The result is slightly different, but I think we can work on it! Really useful!

For curiosity
you can find the source code for the closure in ..\intern\cycles\kernel\svm\closure.h here, and take a look at how 'BSDF_PRINCIPLED' is calculated:
   case CLOSURE_BSDF_PRINCIPLED_ID: {
      uint specular_ior_level_offset, roughness_offset, specular_tint_offset, anisotropic_offset,
          sheen_weight_offset, sheen_tint_offset, sheen_roughness_offset, coat_weight_offset,
          coat_roughness_offset, coat_ior_offset, eta_offset, transmission_weight_offset,
          anisotropic_rotation_offset, coat_tint_offset, coat_normal_offset, dummy, alpha_offset,
          emission_strength_offset, emission_offset, unused;
      uint4 data_node2 = read_node(kg, &offset);

      float3 T = stack_load_float3(stack, data_node.y);
      svm_unpack_node_uchar4(data_node.z,
                             &specular_ior_level_offset,
                             &roughness_offset,
                             &specular_tint_offset,
                             &anisotropic_offset);
      svm_unpack_node_uchar4(
          data_node.w, &sheen_weight_offset, &sheen_tint_offset, &sheen_roughness_offset, &unused);
      svm_unpack_node_uchar4(data_node2.x,
                             &eta_offset,
                             &transmission_weight_offset,
                             &anisotropic_rotation_offset,
                             &coat_normal_offset);
      svm_unpack_node_uchar4(data_node2.w,
                             &coat_weight_offset,
                             &coat_roughness_offset,
                             &coat_ior_offset,
                             &coat_tint_offset);

      // get Disney principled parameters
      float metallic = saturatef(param1);
      float subsurface_weight = saturatef(param2);
      float specular_ior_level = fmaxf(stack_load_float(stack, specular_ior_level_offset), 0.0f);
      float roughness = saturatef(stack_load_float(stack, roughness_offset));
      Spectrum specular_tint = rgb_to_spectrum(
          max(stack_load_float3(stack, specular_tint_offset), zero_float3()));
      float anisotropic = saturatef(stack_load_float(stack, anisotropic_offset));
      float sheen_weight = saturatef(stack_load_float(stack, sheen_weight_offset));
      float3 sheen_tint = stack_load_float3(stack, sheen_tint_offset);
      float sheen_roughness = saturatef(stack_load_float(stack, sheen_roughness_offset));
      float coat_weight = saturatef(stack_load_float(stack, coat_weight_offset));
      float coat_roughness = saturatef(stack_load_float(stack, coat_roughness_offset));
      float coat_ior = fmaxf(stack_load_float(stack, coat_ior_offset), 1.0f);
      float3 coat_tint = stack_load_float3(stack, coat_tint_offset);
      float transmission_weight = saturatef(stack_load_float(stack, transmission_weight_offset));
      float anisotropic_rotation = stack_load_float(stack, anisotropic_rotation_offset);
      float ior = fmaxf(stack_load_float(stack, eta_offset), 1e-5f);

      ClosureType distribution = (ClosureType)data_node2.y;
      ClosureType subsurface_method = (ClosureType)data_node2.z;

      float3 valid_reflection_N = maybe_ensure_valid_specular_reflection(sd, N);
      float3 coat_normal = stack_valid(coat_normal_offset) ?
                               stack_load_float3(stack, coat_normal_offset) :
                               sd->N;

      // get the base color
      uint4 data_base_color = read_node(kg, &offset);
      float3 base_color = stack_valid(data_base_color.x) ?
                              stack_load_float3(stack, data_base_color.x) :
                              make_float3(__uint_as_float(data_base_color.y),
                                          __uint_as_float(data_base_color.z),
                                          __uint_as_float(data_base_color.w));

      // get the subsurface scattering data
      uint4 data_subsurf = read_node(kg, &offset);

      uint4 data_alpha_emission = read_node(kg, &offset);
      svm_unpack_node_uchar4(data_alpha_emission.x,
                             &alpha_offset,
                             &emission_strength_offset,
                             &emission_offset,
                             &dummy);
      float alpha = stack_valid(alpha_offset) ? stack_load_float(stack, alpha_offset) :
                                                __uint_as_float(data_alpha_emission.y);
      alpha = saturatef(alpha);

      float emission_strength = stack_valid(emission_strength_offset) ?
                                    stack_load_float(stack, emission_strength_offset) :
                                    __uint_as_float(data_alpha_emission.z);
      float3 emission = stack_load_float3(stack, emission_offset) * fmaxf(emission_strength, 0.0f);

      Spectrum weight = closure_weight * mix_weight;

      float alpha_x = sqr(roughness), alpha_y = sqr(roughness);
      if (anisotropic > 0.0f) {
        float aspect = sqrtf(1.0f - anisotropic * 0.9f);
        alpha_x /= aspect;
        alpha_y *= aspect;
        if (anisotropic_rotation != 0.0f)
          T = rotate_around_axis(T, N, anisotropic_rotation * M_2PI_F);
      }

#ifdef __CAUSTICS_TRICKS__
      const bool reflective_caustics = (kernel_data.integrator.caustics_reflective ||
                                        (path_flag & PATH_RAY_DIFFUSE) == 0);
      const bool glass_caustics = (kernel_data.integrator.caustics_reflective ||
                                   kernel_data.integrator.caustics_refractive ||
                                   (path_flag & PATH_RAY_DIFFUSE) == 0);
#else
      const bool reflective_caustics = true;
      const bool glass_caustics = true;
#endif

      /* Before any actual shader components, apply transparency. */
      if (alpha < 1.0f) {
        bsdf_transparent_setup(sd, weight * (1.0f - alpha), path_flag);
        weight *= alpha;
      }

      /* First layer: Sheen */
      if (sheen_weight > CLOSURE_WEIGHT_CUTOFF) {
        ccl_private SheenBsdf *bsdf = (ccl_private SheenBsdf *)bsdf_alloc(
            sd, sizeof(SheenBsdf), sheen_weight * rgb_to_spectrum(sheen_tint) * weight);

        if (bsdf) {
          bsdf->N = safe_normalize(mix(N, coat_normal, saturatef(coat_weight)));
          bsdf->roughness = sheen_roughness;

          /* setup bsdf */
          const int sheen_flag = bsdf_sheen_setup(kg, sd, bsdf);

          if (sheen_flag) {
            sd->flag |= sheen_flag;

            /* Attenuate lower layers */
            Spectrum albedo = bsdf_albedo(kg, sd, (ccl_private ShaderClosure *)bsdf, true, false);
            weight = closure_layering_weight(albedo, weight);
          }
        }
      }

      /* Second layer: Coat */
      if (coat_weight > CLOSURE_WEIGHT_CUTOFF) {
        coat_normal = maybe_ensure_valid_specular_reflection(sd, coat_normal);
        if (reflective_caustics) {
          ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
              sd, sizeof(MicrofacetBsdf), coat_weight * weight);

          if (bsdf) {
            bsdf->N = coat_normal;
            bsdf->T = zero_float3();
            bsdf->ior = coat_ior;

            bsdf->alpha_x = bsdf->alpha_y = sqr(coat_roughness);

            /* setup bsdf */
            sd->flag |= bsdf_microfacet_ggx_setup(bsdf);
            bsdf_microfacet_setup_fresnel_dielectric(kg, bsdf, sd);

            /* Attenuate lower layers */
            Spectrum albedo = bsdf_albedo(kg, sd, (ccl_private ShaderClosure *)bsdf, true, false);
            weight = closure_layering_weight(albedo, weight);
          }
        }

        if (!isequal(coat_tint, one_float3())) {
          /* Tint is normalized to perpendicular incidence.
           * Therefore, if we define the coat thickness as length 1, the length along the ray is
           * t = sqrt(1+tan^2(angle(N, I))) = sqrt(1+tan^2(acos(dotNI))) = 1 / dotNI.
           * From Beer's law, we have T = exp(-sigma_e * t).
           * Therefore, tint = exp(-sigma_e * 1) (per def.), so -sigma_e = log(tint).
           * From this, T = exp(log(tint) * t) = exp(log(tint)) ^ t = tint ^ t;
           *
           * Note that this is only an approximation - it assumes that the outgoing ray
           * follows the same angle, and that there aren't multiple internal bounces.
           * In particular, things that could be improved:
           * - For transmissive materials, there should not be an outgoing path at all if the path
           *   is transmitted.
           * - For rough materials, we could blend towards a view-independent average path length
           *   (e.g. 2 for diffuse reflection) for the outgoing direction.
           * However, there's also an argument to be made for keeping parameters independent of
           * each other for more intuitive control, in particular main roughness not affecting the
           * coat.
           */
          float cosNI = dot(sd->wi, coat_normal);
          /* Refract incoming direction into coat material.
           * TIR is no concern here since we're always coming from the outside. */
          float cosNT = sqrtf(1.0f - sqr(1.0f / coat_ior) * (1 - sqr(cosNI)));
          float optical_depth = 1.0f / cosNT;
          weight *= power(rgb_to_spectrum(coat_tint), coat_weight * optical_depth);
        }
      }

      /* Emission (attenuated by sheen and coat) */
      if (!is_zero(emission)) {
        emission_setup(sd, rgb_to_spectrum(emission) * weight);
      }

      /* Metallic component */
      if (reflective_caustics && metallic > CLOSURE_WEIGHT_CUTOFF) {
        ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
            sd, sizeof(MicrofacetBsdf), metallic * weight);
        ccl_private FresnelF82Tint *fresnel =
            (bsdf != NULL) ?
                (ccl_private FresnelF82Tint *)closure_alloc_extra(sd, sizeof(FresnelF82Tint)) :
                NULL;

        if (bsdf && fresnel) {
          bsdf->N = valid_reflection_N;
          bsdf->ior = 1.0f;
          bsdf->T = T;
          bsdf->alpha_x = alpha_x;
          bsdf->alpha_y = alpha_y;

          fresnel->f0 = rgb_to_spectrum(base_color);
          const Spectrum f82 = specular_tint;

          /* setup bsdf */
          sd->flag |= bsdf_microfacet_ggx_setup(bsdf);
          const bool is_multiggx = (distribution == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID);
          bsdf_microfacet_setup_fresnel_f82_tint(kg, bsdf, sd, fresnel, f82, is_multiggx);

          /* Attenuate other components */
          weight *= (1.0f - metallic);
        }
      }

      /* Transmission component */
      if (glass_caustics && transmission_weight > CLOSURE_WEIGHT_CUTOFF) {
        ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
            sd, sizeof(MicrofacetBsdf), transmission_weight * weight);
        ccl_private FresnelGeneralizedSchlick *fresnel =
            (bsdf != NULL) ? (ccl_private FresnelGeneralizedSchlick *)closure_alloc_extra(
                                 sd, sizeof(FresnelGeneralizedSchlick)) :
                             NULL;

        if (bsdf && fresnel) {
          bsdf->N = valid_reflection_N;
          bsdf->T = zero_float3();

          bsdf->alpha_x = bsdf->alpha_y = sqr(roughness);
          bsdf->ior = (sd->flag & SD_BACKFACING) ? 1.0f / ior : ior;

          fresnel->f0 = make_float3(F0_from_ior(ior)) * specular_tint;
          fresnel->f90 = one_spectrum();
          fresnel->exponent = -ior;
          fresnel->reflection_tint = one_spectrum();
          fresnel->transmission_tint = sqrt(rgb_to_spectrum(base_color));

          /* setup bsdf */
          sd->flag |= bsdf_microfacet_ggx_glass_setup(bsdf);
          const bool is_multiggx = (distribution == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID);
          bsdf_microfacet_setup_fresnel_generalized_schlick(kg, bsdf, sd, fresnel, is_multiggx);

          /* Attenuate other components */
          weight *= (1.0f - transmission_weight);
        }
      }

      /* Apply IOR adjustment */
      float eta = ior;
      float f0 = F0_from_ior(eta);
      if (specular_ior_level != 0.5f) {
        f0 *= 2.0f * specular_ior_level;
        eta = ior_from_F0(f0);
        if (ior < 1.0f) {
          eta = 1.0f / eta;
        }
      }

      /* Specular component */
      if (reflective_caustics && eta != 1.0f) {
        ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc(
            sd, sizeof(MicrofacetBsdf), weight);
        ccl_private FresnelGeneralizedSchlick *fresnel =
            (bsdf != NULL) ? (ccl_private FresnelGeneralizedSchlick *)closure_alloc_extra(
                                 sd, sizeof(FresnelGeneralizedSchlick)) :
                             NULL;

        if (bsdf && fresnel) {
          bsdf->N = valid_reflection_N;
          bsdf->ior = eta;
          bsdf->T = T;
          bsdf->alpha_x = alpha_x;
          bsdf->alpha_y = alpha_y;

          fresnel->f0 = f0 * specular_tint;
          fresnel->f90 = one_spectrum();
          fresnel->exponent = -eta;
          fresnel->reflection_tint = one_spectrum();
          fresnel->transmission_tint = zero_spectrum();

          /* setup bsdf */
          sd->flag |= bsdf_microfacet_ggx_setup(bsdf);
          const bool is_multiggx = (distribution == CLOSURE_BSDF_MICROFACET_MULTI_GGX_GLASS_ID);
          bsdf_microfacet_setup_fresnel_generalized_schlick(kg, bsdf, sd, fresnel, is_multiggx);

          /* Attenuate lower layers */
          Spectrum albedo = bsdf_albedo(kg, sd, (ccl_private ShaderClosure *)bsdf, true, false);
          weight = closure_layering_weight(albedo, weight);
        }
      }

      /* Diffuse/Subsurface component */
#ifdef __SUBSURFACE__
      ccl_private Bssrdf *bssrdf = bssrdf_alloc(
          sd, rgb_to_spectrum(base_color) * subsurface_weight * weight);
      if (bssrdf) {
        float3 subsurface_radius = stack_load_float3(stack, data_subsurf.y);
        float subsurface_scale = stack_load_float(stack, data_subsurf.z);

        bssrdf->radius = rgb_to_spectrum(subsurface_radius * subsurface_scale);
        bssrdf->albedo = rgb_to_spectrum(base_color);
        bssrdf->N = maybe_ensure_valid_specular_reflection(sd, N);
        bssrdf->alpha = sqr(roughness);
        bssrdf->ior = eta;
        bssrdf->anisotropy = stack_load_float(stack, data_subsurf.w);
        if (subsurface_method == CLOSURE_BSSRDF_RANDOM_WALK_SKIN_ID) {
          bssrdf->ior = stack_load_float(stack, data_subsurf.x);
        }

        /* setup bsdf */
        sd->flag |= bssrdf_setup(sd, bssrdf, path_flag, subsurface_method);
      }
#else
      subsurface_weight = 0.0f;
#endif

      ccl_private DiffuseBsdf *bsdf = (ccl_private DiffuseBsdf *)bsdf_alloc(
          sd,
          sizeof(DiffuseBsdf),
          rgb_to_spectrum(base_color) * (1.0f - subsurface_weight) * weight);
      if (bsdf) {
        bsdf->N = N;

        /* setup bsdf */
        sd->flag |= bsdf_diffuse_setup(bsdf);
      }

      break;
    }

Recreating it "pixel perfect" with BSDFs will be a big headache.
I'm not sure that a large BSDF is actually made up of pieces of small BSDFs.


text:
How to build an operator that corrects StringProperty("subtype = 'DIR_PATH') from relative path?
I'm trying to build a "smart" operator, this has to transform a relative path (Cause of a lot of trouble sometimes for novice users), so I was thinking something like this, if the StringProperty(subtype = 'DIR_PATH') property is relative
I have written a script that demonstrates what I would like to do, but I don't know how to continue and if it is possible to do this.
As you understand (I hope) I try to build an operator which is passed the right argument to interact with it (In this case 2 distinct properties).
import bpy, os

bl_info = {
    "name": "Test",
    "author": "NoobCat",
    "version": (1, 0, 0),
    "blender": (2, 92, 0)
    }

class MYADDON_OT_Realpath(bpy.types.Operator):
    """Convert to Realpath"""
    bl_idname = "myaddon.realpath"
    bl_label = "Realpath"
    bl_options = {'INTERNAL'}

    path: bpy.props.StringProperty() # <-- Is useful?

    def execute(self,context):
        context.path # <-- Is Useful?
        os.path.realpath(bpy.path.abspath(context.path))# Im very confused
        return{'FINISHED'}

class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        scn = context.scene
        preferences = bpy.context.preferences.addons[__name__].preferences
        scn_prop = scn.my_props

        layout = self.layout
        col = layout.column()
        #Case 1:
        col.prop(scn_prop, 'my_scene_path', text = "Add your scene prop path")
        if scn_prop.my_scene_path.startswith("//"):
            path = scn_prop.my_scene_path
            row = col.row()
            #row.context_pointer_set(name="path", data=path) <-- Is Useful?
            row.operator("myaddon.realpath", text = "Convert to realpath").path = path
        #Case 2:
        col.prop(preferences, 'my_preferences_path', text = "Add your preferences path")
        if preferences.my_preferences_path.startswith("//"):
            path = preferences.my_preferences_path
            row = col.row()
            #row.context_pointer_set(name="path", data=path) <-- Is Useful?
            row.operator("myaddon.realpath", text = "Convert to realpath").path = path

class MyAddonPreferences(bpy.types.AddonPreferences):
    bl_idname = __name__
    my_preferences_path: bpy.props.StringProperty(subtype = 'DIR_PATH')

class SceneProperties(bpy.types.PropertyGroup):
    my_scene_path: bpy.props.StringProperty(subtype = 'DIR_PATH')

classes = (MyAddonPreferences,
           SceneProperties,
           LayoutDemoPanel,
           MYADDON_OT_Realpath)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.my_props = bpy.props.PointerProperty(type=SceneProperties)
def unregister():

    for cls in reversed(classes):
        bpy.utils.unregister_class(cls)
if __name__ == "__main__":
    register()

Don't, see: How can I get the full path of the selected file from the file explorer?

Hello brockmann, yes i know :) The problem with that menu is that a lot of people struggle to find it, and even I sometimes find myself annoyed by that, but I don't want to change the blender options in this case, so I was thinking of a handy button that would do the dirty work in the immediate, with a message that warns, and under the button that resolves.
Then I am also intrigued as to how such an argument can be passed to the operator

Seriously? It is like it is. Take a minute and think about the concept and you'll see it's actually a great "feature". If that's so "annoying" to you consider to disable relative paths in the user prefs: https://i.sstatic.net/aOASe.png ... and yes your code is pretty bad. I'd suggest explain users how it actually works.

@brockmann agree a bit both ways here. It's my experience that setting the use relative paths in prefs and its value when using bpy.ops.buttons.directory_browse can sometimes be out of sync. Had looked at this re globbing from a file type string property without the need to write a file browser operator.  Added the method came up with re props. (usually via both in a propertygroup)

Still against this. There is usually more than one filepath to set and if there is one toggle in only one place to do that, the user even gets more confused, why there isn't such a toggle for all other paths... it's a design decision which has been made @batFINGER

No doubt. As mentioned sitting the fence a bit here. Method below could for example be used in conjunction with your recent excellent :) answer to OP  As is  changing 3 would require open filebrowser / open N window / (un)check use relative / accept, times 3 .  Or with bool prop in propgroup, click three checkoxes  (or perhaps  better still add another bool outside to toggle whole collection with one click)  btw perhaps link in first comment needs extra test

in case it is already, or set as  an abspath.  Another thing I find is for example setting filepaths (eg fonts etc, which is default "//"( in user prefs doesn't keep my choice of use relative, or use the global setting, find it can become a  bit ad hoc.

@batFINGER I don't deny that this can be useful somehow and I appreciate your answer as always. OP's decision... just a lot of code to maintain vs. a simple explanation about how paths in blender work, what "//" actually means and how to display the absolute path if required which is even more useful to the user IMHO. Good critics on the linked answer, should indeed add a test for abolute paths, although more like a general python thing, I'm going to edit the answer if I have the time.

With a setter and getter.
Instead of writing an operator, here is a suggestion re using a boolean property to toggle between the two, and set the path accordingly.
IIRC, (and I didn't) had asked a similar question re globbing string properties with a file or folder subtype, in particular to glob a file.  Have asked a new question.
For the case shown in question, consider adding your own "use relative" property
Have set up a generic setter / getter on path property, and on boolean property the getter simply looks at if the path starts with "//" it is relative, and toggle using the setter.  Will also use the option available in filebrowser of setting relative_path of the invoked and active in the file browser,  operator bpy.ops.buttons.directory_browse()

Example, file saved in tmp folder, draw method added to text editor footer for testing
import bpy

def update(self, context):
    print("update")

def set(self, value):
    print("setter")
    self["foo"] = value

def get(self):
    return self.get("foo", "//")

bpy.types.Scene.foo = bpy.props.StringProperty(
    subtype='DIR_PATH',
    default="//",
    get=get,
    set=set,
    update=update,
    )

def get(self):
    return self.foo.startswith("//")

def set(self, value):
    print("set relative", value)
    if value:
        self["foo"] = bpy.path.relpath(self.foo)
    else:
        self["foo"] = bpy.path.abspath(self.foo)

bpy.types.Scene.foo_relative_path = bpy.props.BoolProperty(
    name="Use Relative",
    get=get,
    set=set,
    )

def draw(self, context):
    layout = self.layout
    row = layout.row(align=True)
    row.prop(context.scene, "foo")
    row.prop(context.scene, "foo_relative_path")

classes = []

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.TEXT_HT_footer.append(draw)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    bpy.types.TEXT_HT_footer.remove(draw)

if __name__ == "__main__":
    register()

Sounds very interesting, just a little confusing in my head, why did you call get() set() functions the same way? There are functions there with the same name, is that right?

re same name, just lazy ... the property will use the last one defined ie first prop uses first get, second prop uses second get.

source: Stack Exchange

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

sort: votes


text:
Compositor: obtain facing from normals pass to affect glare?
Is there a way to obtain the "facing" of individual pixels on a rendered image by using the normals pass?  IE: if a surface's angle points away from the camera, it becomes darker, and when a surface's angle points towards the camera, it will become brighter.
Edit: The reason I'm asking is because I'm trying to develop a custom glare node in the compositor.  Bright areas will get weak fog glow, but I also want to produce a star-like glare over bright points which are facing the camera.  I don't know whether this is accurate to reality or not, though.  If there is a better method for doing so, or to realistically accomplish the effect, I'm all ears.

Is it necessary to do this in the compositor? I think it would be possible, but it's easier with material nodes.

To do this in the compositor you'll need to get the camera rotation, which is not as trivial as it might seem. See http://blender.stackexchange.com/q/10560/599

You can also approximate this effect by taking the screen-space x and y derivatives of the z-pass, although this will introduce artifacts if you make it too strong. I uploaded an example file here.

I'm not sure how you'd calculate the dot product of the camera vector against the normal using nodes but you could do a pass that has only one light at the same position as the camera.

Considering how convoluted this apparently is to do, I think I'll revise my question.

AFAIK all that matters is the brightness (amount of light) entering the camera. I don't think the angle of the surface relative to the camera should matter (other than affecting the amount of light bounced towards the camera, that is). I might be wrong though.

This works like a dream. ridiculously simple too. the normal node can be found under vector in the add node menu(shift-a).

This won't work if the camera is at a different angle. The tricky thing with this is getting the normal of the camera (easy in material nodes, but I don't know of a way to do this in composite nodes without using drivers). Drivers should work, but the only way I've thought of involves converting the rotation of the camera (in radians) to a vector where everything stays inside -1 to 1. Then using that to drive the ball widget (since there are no vector math nodes in compositing).

Yeah, I tried this.  It mostly works, but the normals aren't based off of the camera.  Rather, they are based off of how much they're pointing towards the corresponding pixels on the rendered image.

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


text:
Attempting to stretch texture towards edges
I am currently attempting to do a trick with texture mapping and noise texturing.  The effect I am trying to accomplish is to change the direction of the stretching on the noise bumps.
On the image below, the bumps get stretched out as they approach the edge of the sphere.  They stretch in a direction parallel to the edge.  What I want to do is have them stretched perpendicular to the edge, so that going longways with each bump it will point towards the edge more as the underlying surface points away from the camera.

The image below, a mockup made in GIMP with the Motion Blur (Zoom) filter, gives a rough idea of the effect I wish to accomplish.  The desired effect also should not rely upon baking or screen size/ratio, and it needs to work on organic shapes (I am just using a sphere for testing).  It also needs to work without OSL since I intend to use GPU rendering.

Below is the current node setup I am using.  Probably nowhere near close to what I need to do to get this to work.

That picture vaguely reminds me of a reflection, as if the ball were a mirror reflecting a textured plane behind the camera.  Perhaps you could do some math on the camera ray and the surface normal to compute a new texture coordinate as if the ray were being reflected and striking a plane behind the camera.

Yeah, the texture coordinate input I am using right now is "Reflection".  I've tried a variety of things to get it working, though I had no idea what I was doing.

I managed to figure this out on my own after toying around a bit with the method suggested by Gonzou.  Before passing the Normal output into the Mapping node, the solution is to first pass it through a Vector Transform node, and set it to transform from Object to Camera.

And that results in the desired effect:

please see my updated answer. It took me some time to figure it out, though your method looks better than mine. It's just much simplier :).

You could also plug Camera output from Texture Coordinates node, so this effect won't depend on surface rather that a camera position (assuming this instead of Vector Transform)

I had tried using the Camera output, though I couldn't get the desired effect.  Regardless though, the entire endeavor was pointless.  I was going to use the generated texture through a bump node, but it refused to use texture inputs with any camera-space mapping :-/

Set up the nodes as pictured below. In Texture Coordinate node choose the Normal output. Select the Normal option in a Mapping node and experiment with its Scale settings.

Change the Z Scale to increase the stretch of a noise.

I used this technique to procedurally create the iris. Hope this is the effect you're looking for.

UPDATE: After playing with the nodes I found out a new solution, though I am not sure it's the proper way of doing it.

Close, though not quite.  The effect I'm going for is dependent on facing.  IE: the more the surface faces away from the viewer, the more stretching there will be.

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


text:
Randomize Dupli-Groups
I'm currently constructing a city in blender, and one thing that I would like to do, so as to avoid modelling hundreds of buildings by hand, is to randomize some elements of the buildings.  What I was thinking is using a combination of duplifaces and scripted empties.
What I want to do with the empties, is I want to script them so that they will take the form of a random mesh (through dupligroups), which is selected from a list.  For example, have an empty that is meant for a window, randomly select from a set of window meshes, and it takes the appearance of the selected window.  The empty is parented to a mesh that has Duplication Faces enabled, so a copy of that empty's assigned object appears on each face.
I am familiar with Python, but I am not familiar with blender's python API.  So, what I need to know boils down to this:
On an empty that uses Duplication Group, is there a way to change the group by Python script or other means?  And further, can it be done in such a way that each instance of that object has a different group assigned?  IE: If I copy a building that used random windows several times, each building would have a different window type instead of the same (randomly selected) window type.
EDIT 1: I have attempted to implement this (unscripted) through the use of a particle system, with the particles set to randomly select an object from a group.  However, this did not work.  The way it randomly determines the selection is such that it will always have the same result every time.  I realize there is good reason for this, but unfortunately it makes it not so useful in my case, as it causes it to always select the same object, no matter what.
EDIT 2: I have figured out how to change the random seed for a particle system, which does change which object is randomly selected.  And I have figured out how to set up a driver that uses the parent object's position to change the seed.  The particle emitter and its parent object are placed into their own group, which is then duplicated by several empties.  However, instead of each empty having a different object, they are all carbon copies of the object they are duplicating.
Blend file I was using to test stuff in the above two edits: http://www.pasteall.org/blend/40062

It isn't uncommon to model a few buildings then use particles to distribute some of each throughout your city. Blenderguru has one of the tutorials on it.

@cegaton: Yeah, I've seen suicidator.  AFAIK, it only generates modern cities.  I'm trying to create a canal city within a time period equivalent to the late 1800's and early 1900's.


text:
Mesh editing tools disappeared
I'm not getting the options for vertices, edge, face selection.

Please don't scream! This object is a curve, not a mesh.

Please don't use all caps, it is the online equivalent of shouting and is considered rude

Yep, what the others said. Also: you imported a DXF, right?

https://www.quora.com/Why-is-it-a-bad-manner-to-type-in-caps

Curve objects are different than Mesh objects as they are not constructed from vertices edges or faces, but from vectors.
You can convert the object to a mesh. In edit mode select the object and select
Object > Convert to > Mesh from Curve/Meta/Surf/Text

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


text:
How to change from wireframe, to solid or rendered shading mode?

How to change from the transparent mode to the following rendered/smooth mode?

Click one of the little circles in the top right of the 3D viewport - these are the preview modes (Left to right: Wireframe, Solid, Material, Rendered)

You want solid, I think.
You can also press Z in the 3D viewport and pick "solid" from the pie menu that appears.

For more info read the manual page (yes, there is a manual and has lots of useful information).
https://docs.blender.org/manual/en/latest/editors/3dview/display/shading.html

omg thank you so much! This reply is awesome, informative!


text:
Combine two different textures so that one appears in the shadows as Earth rotates?
I just watched to this amazing example on how to animate Earth: https://www.youtube.com/watch?v=0yz_-U7t8AU
So I ask: is it possible to combine the two different textures below so that the night Earth (with lights on) appears in the shaddow region as Earth rotates?

Sources of images:

https://en.wikipedia.org/wiki/File:Whole_world_-_land_and_oceans_12000.jpg
https://www.nasa.gov/feature/goddard/2017/new-night-lights-maps-open-up-possible-real-time-applications/

Possible duplicate of Mapping two image texture on a sphere and how to make texture appear only in dark spots and how to mix two materials based on incoming light

Yes. Sure. It is a duplicate. The second link is similar to my question. And the answer seems to solve my problem. I will try now. Thank you. I probably didn't search with appropriate terms to find the posts you suggested. Thank you again!


text:
Problem rendering quick effect fluid animation
Please, try this:
Start Blender, select the cube, add quick effect (type: liquid).
Press space bar to run the animation. Up to here, it is ok for me. Now comes the problem.
Change to the render view then run again. This doesn't work for me, even if I change from Eevee to Cycles. Does it for you?
So, my question is: How to render this animation?

:-) you have to enable "Mesh" in properties like now you see only particles. Check some tutorials with mantaflow solved.

Hey @susu thank you for replying. I watched to toutube videos and read some tutorials, but didn't find any one with rendering. So I have no idea on how to do it :-/

Even with @susu comment, it was still not clear for me how to proceed. But hist tip of searching for tutorials with mantaflow solved, I got this link that helped a lot: https://www.youtube.com/watch?v=fanm2P5ITCs

I did not comment, I edited the title of the question only the comment comes from @vklidu

Ow... my mistake. Tank you @vikidu for the comment and sorry for my mistake.

In case you arrive here looking for a simple answer without wanting to watch the youtube video. As @Brasil describes:

press space to run the animation showing particles which will be quick.
stop the animation and return to frame 1
with the Liquid Domain object selected open the Physics Properties tab, scroll down and tick the Mesh check-box.
step through the animation to the frame you want to render

EDIT: as @mins says below, if you change some of the flow parameters, such as the domain dimensions or any obstacles, after the first 'automatic' bake then the animation won't necessarily change. Some changes, like the the Resolution Divisions in the Settings section will force a cache rebuild.
To re-bake it you can switch the Type in the Cache section to Modular, return to frame 1 then switch back to Replay and re-run the animation to rebuild the cache.
Alternatively switch Type to All then click on the Bake All button.

Thanks a lot for this information. It seems you also need to "bake" the domain object, first selecting a cache type all or modular to display the bake button (which turns into a free button after being used).


text:
How to make the windows material transparent so that I can see an image through it?
I created a room (floor, table, walls and windows). For the windows' faces, I used a material with the following features (I list below only the features I changed, the remaining ones kept standard, ie, as they came):

Principled BSDF
Base color: white
Specular: 0.15
Roughness: 0
IOR: 1.5
Transmission: 1
Emission strenght: 0

I checked Screen Space Reflection both in materials and in Eevee render.
Finally, I added a reference image with sky and trees to be the outside environment. However, I cannot see the image through the windows (either in material or render mode, independently of rendering in eevee or cycles).
My question is: How to make the windows material transparent so that I can see an image through it?

Wooow. That works! Thank you!

When using transparency in EEVEE, make sure to set the material's Blend Mode to something other than Opaque. Alpha-Blend or Alpha Hashed should work fine. For some objects, you may also find things look better if you also enable Backface Culling:


text:
How do I reset all of my view panels without having to do the click and drag method?
I would like to find a different solution to closing these windows without having to do the click and drag.

Possible duplicate: https://blender.stackexchange.com/questions/822/how-do-you-return-to-the-default-view-the-one-you-see-when-blender-starts

https://blender.stackexchange.com/a/165915/67327 this is the answer that cleared everything up for me as far as controlling viewports

See also: https://blender.stackexchange.com/questions/203138/resetting-ui-on-the-viewport/203139

Stop modifying the windows and use Layouts or Workspaces instead.
Press CtrlPage Up and CtrlPage Down to  navigate to the next layout.
It is much faster, and you can set your own set of screens for specific tasks, and to suit your personal workflow, without modifying the interface at all or dragging windows everytime.
Start with an empty project. Use the plus sign at the top to create a new workspace.
Arrange the windows to the way you want to work.
Create as many layouts/workspaces as you want.
Once you've created your own layouts in an empty project, save the project as default (File > Defaults > Save Strartup File), and then your custom layouts will be available to you every time you open blender.
To open an existing project into your new layout use File > Open and disable the Load UI option, so that the file opens with your default User Interface and not the one saved on the file.
For more detail read the following link:
Can screen layouts or workspaces be locked?.

If you want to come back to the default windows setup you can click on the "+" tab on the top and choose General > Layout (or whatever setup you want to come back to). You can move or delete all this tabs with right click. If you want to save your own custom layout I think you need to create it and Save the Startup File.


text:
How to Convert Coordinate object from Coordinate Node into Mapping Node?
In the example below, I'm using an empty object that I've named "Empty XYZ" as the Coordinate Object, right in the Coordinate node into the Sphere Material (Named: "Strip Material")
Now I would like to delete my Empty XYZ object and insert the values into the mapping node, converting the position of the object (Loc, Rot, Scale) and inserting them into the Mapping node, in order to keep the strip exactly where it was placed thanks to the Empty Object

I would like to use Python for this operation, but I'm not sure about this, I'm doing some tests that don't produce satisfactory results, in some cases the Empty XYZ object might be a child of the object on which the material is applied, and in others not. So I'm looking for a decent solution that works (As long as it can be done)
import bpy

mat = bpy.data.materials['Strip Material']
nodes = mat.node_tree.nodes

coordinate = nodes['Texture Coordinate']
mapping = nodes['Mapping']

sphere = bpy.data.objects['Sphere']  # The sphere object
empty_xyz = bpy.data.objects['Empty XYZ'] # The empty object

loc = empty_xyz.location[:]
rot = empty_xyz.rotation_euler[:]
scale = empty_xyz.scale[:]

mapping.inputs[1].default_value = loc
mapping.inputs[2].default_value = rot
mapping.inputs[3].default_value = scale

coordinate.object = sphere

This example is a basic example in order to explain better what i want to do, I don't know if I have to apply matrix inverse, or other mathematical formulas to convert.
I can't find the right approach to this solution, and I'm not even sure if I'm doing anything that would work.
Note: I would like to avoid Bake at all costs
Any help will be appreciated

I don't quite have the time/energy to do this right now, but I would start by taking the matrix_world of both objects to get rid of the parenting issues, then take the location difference, that's simple. I'm sure there's some rotational difference calculations here on BSE to find, and once you have that, you have to figure out the order (use a separate mapping for each). Once you get that working, do also a scale difference, see if you need to put that mapping first or last. Then see if it can all be expressed as one mapping (depends on order)

Here is the second part of your script:
# We need to get relative transform of two transform matrixes
# to do this multiply inverted matrix of empty over sphere matrix:
matrix = empty_xyz.matrix_world.inverted() @ sphere.matrix_world

# Decompose matrix into location, rotation and scale:
(loc, rot, scale) = matrix.decompose()

mapping.inputs[1].default_value = loc
# convert quaternion to Euler:
mapping.inputs[2].default_value = rot.to_euler()
mapping.inputs[3].default_value = scale

# Remove empty object from node:
coordinate.object = None


text:
How to put if condition for empty material index
I need to have access to the active material and its nodes (if they exist), so I wrote this script that has a problem, when the object has no materials, when the object does not exist, and of course if the object is 'MESH' type
import bpy

ob = bpy.context.active_object
index = ob.active_material_index
mat = ob.material_slots[index].material
nodes = mat.node_tree.nodes
my_node = nodes.get("My node name")

if my_node:
    print("My node is inside!")
else:
    print("My node not inside!")

work only if object is not none, object is 'MESH' type and If inside have slot material.
else rightly give me that error:
IndexError: bpy_prop_collection[index]: index 0 out of range, size 0

I can't figure out how to assign variables in an if statement, because I know that in python you can't (I think)

You can find more info on if statements in Python here.
You can find a lot of useful information about bpy in Blender's Python console using the auto complete function (Ctrl+Space):

The script you are after could be something like this:
import bpy

obj = bpy.context.object
name = "My_node_name"
if obj is not None:
    if obj.type == 'MESH':
        if obj.active_material is not None:
            if obj.active_material.use_nodes:
                nodes = obj.active_material.node_tree.nodes
                if nodes.get(name) is not None:
                    print(name + " node is in the material's node tree.")
                else:
                    print(name + " node is not in the material's node tree.")
            else:
                print("Material does not ue nodes.")
        else:
            print("Object does not have an active material.")
    else:
        print("Object is not a mesh.")
else:
    print("There is no active object currently in the scene.")

Ty for my script it worked well


text:
bmesh.ops method to get Loose vertices / edges and delete from that list?
I read all the api about bmesh.ops, but not find and not have idea to get loose edge/vertices , someone knows something about it, I don't even find examples to get and then delete with method bmesh.ops.delete(bm, geom, context)
Equivalent with ops (Slow if have many object) bpy.ops.mesh.delete_loose()
meshes = set(o.data for o in context.selected_objects if o.type == 'MESH')
bm = bmesh.new()

for m in meshes:

    bm.from_mesh(m)
    ####get list of loose vertices/edge?
    ####delete vertices?
    bm.to_mesh(m)
    m.update()
    bm.clear()

example about loose edges:

Verts with no linked faces
Possibly easiest here is to look for verts with no linked faces. ie they make no part of any face
import bpy
import bmesh
context = bpy.context

meshes = set(o.data for o in context.selected_objects if o.type == 'MESH')
bm = bmesh.new()

for m in meshes:

    bm.from_mesh(m)
    # verts with no linked faces
    verts = [v for v in bm.verts if not v.link_faces]

    print(f"{m.name}: removed {len(verts)} verts")
    # equiv of bmesh.ops.delete(bm, geom=verts, context='VERTS')
    for v in verts:
        bm.verts.remove(v)

    bm.to_mesh(m)
    m.update()
    bm.clear()

Work fine. According to you to simulate "Delete loose" vertex, edge, face this method can be fine?


text:
Advanced Bullet Trail in Cycles
How can one simulate a real bullet distortion effect in Cycles, like in this image:

I'm mainly concerned about that funky trailing directly behind the bullet. This image is a shadowgraph of a supersonic bullet, and not directly visible, but I was wondering about adding that Hollywood factor by having a three-dimensional distortion trailing behind the bullet.
Any help would be very much appreciated. Thanks in advance :)

You will want to use the smoke sim....

@GiantCowFilms Interesting... that might work. I was wondering about using a fluid sim actually, since there is a collision object piercing through a volume. Hmmm, I think some experimentation is in order.

@GiantCowFilms I have this to report - initial experiments have proven unsuccessful. I used accurate size and time, so maybe it is possible using exaggerated scales or something. But based on what I've tried so far, fluid sim is not looking promising for this one. I think it's because current ripples that are beneath the water's surface show up as… nothing at all when rendered! It's obvious in hindsight.

Related: http://blender.stackexchange.com/q/18296/599

That looks quite interesting, Gandalf— I think I'll give that a try, maybe tweak it a bit, up the resolution & etc.


text:
How do you set dimension between edges?
On the cube when I split it to form blocks, how do you set the length and width of the split?

The answer will depend on the method you use to split the cube. Do you use the Subdivide tool or something else?

In the properties panel (N) under mesh display you can show edge length which can help if your using loop cut. this and this might also help.

what exactly do you mean by split? by my understanding there is no tool called split. how are you going about splitting said cube? are you using loop cut? are you subdividing? are you using the bisect tool? the options available depend entirely on the method you are using.. and the idea of blender is to have more than one way to accomplish the same task (funny that python was developed as a language intended to have "one ,and preferably only one", obvious way to accomplish you task)


text:
How do I create a Unity3d-compatible skybox in blender?
I wish to create skybox textures for use in Unity3D, by baking environment materials to the textures.  How would I go about setting something like this up?
EDIT: I have tried simply putting a camera in the center of the scene and rotating it at 90 degree angles, and rendering to a square texture.  However, the texture edges are not aligned, so I think I can assume that the field of view is wrong.

I managed to figure this out on my own, based on what I had noted above.
Prior to beginning, you must have set up an Environment material to render, or have set up a surrounding scene to capture.  Once that is done, you set resolution of the render to a square texture, preferably with a power-of-two size (I set it to 1024).
Once the environment or scene is set up and ready to capture, the first step is to open the camera object's properties, and just below the Perspective/Orthographic/Panoramic selectors, you change the Lens Units from Millimeters to Field of View, and then set the field on the left to 90 degrees.

After that, set the camera's position to the center of the grid (0,0,0 coords), and set its rotation so that it is facing straight forward (rotation 90,0,0).  Then render, and save it as the Front texture.
Then rotate 90 degrees counterclockwise, and render as the "Right" texture (even though the camera is facing left).  Rotate 90 degrees counterclockwise again, and render that as the "Back" texture.  Rotate 90 degrees counterclockwise again, and render that as the "Left" texture.
Rotate 90 degrees counterclockwise again, and then you're back at the starting position.  Rotate the camera 90 degrees to point upwards (exact rotation should be 180,0,0), and render that as the "Up" texture.  Then rotate the camera 180 degrees to point downwards (exact rotation is 0,0,0) and render that as the "Down" texture.
After that, fire up the Unity3D editor.  Import each of the textures (which should be named according to direction).  Bring up each texture in the inspector, and make sure that Texture Type is set to Texture, and that Wrap Mode is set to Clamp.  Then, create a new Material asset, and in the inspector, set the Shader to "Skybox/6 Sided".  Then assign each of the textures to the corresponding slots, and you're done.

After visiting this page I made a small python script that creates the camera and renders all 6 images.
You can download the script here:
https://github.com/oleg3630/blendertools/blob/main/render_skybox.py
You can set destination folder and image size right in the script.
import bpy
import math
import mathutils
import os

scene = bpy.context.scene

cam_data = bpy.data.cameras.new('SkyBoxCamera')
cam = bpy.data.objects.new('SkyBoxCamera', cam_data)
bpy.context.collection.objects.link(cam)
scene.camera = cam

bpy.context.scene.render.resolution_x = imageSize
bpy.context.scene.render.resolution_y = imageSize
cam.data.lens_unit = 'FOV'
cam.data.angle = 1.5708

#cam.rotation_clear(clear_delta=False)0
scene.render.image_settings.file_format = 'PNG'

cam.rotation_euler = mathutils.Euler((0, 0, 0))
scene.render.filepath = os.path.join(savePath, "SkyBox_Down.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi/2, 0, 0))
scene.render.filepath = os.path.join(savePath, "SkyBox_Front.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi, 0, 0))
scene.render.filepath = os.path.join(savePath, "SkyBox_Up.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi*3/2, math.pi, 0))
scene.render.filepath = os.path.join(savePath, "SkyBox_Back.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((-math.pi/2, math.pi,-math.pi/2))
scene.render.filepath = os.path.join(savePath, "SkyBox_Right.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi/2,0,-math.pi/2))
scene.render.filepath = os.path.join(savePath, "SkyBox_Left.png")
bpy.ops.render.render(write_still = 1)

objs = bpy.data.objects
objs.remove(cam, do_unlink=True)

Thanks - it worked! But on my Mac I had to launch blender through "Blender.app/Content/MacOS/Blender" first. BTW, for those who might not know how to activate the script: Click on the Scripting tab, click on the folder button on the toolbar on top, select the script file, edit savePath and imageSize, click the Run Script button (Triangle) and wait (took me over 10 minutes on my slow computer).

I updated  @lemon 's script a bit to hide all the objects in the scene, so they don't appear in the screenshots and ruin the skybox. Here it is:
import bpy
import math
import mathutils
import os

# Configurations
skyboxName = 'VioletSkyBox'
savePath = 'C:\\Users\\ASDASD\\Documents\\Unity\\Projects\\ASDASD\\Assets\\Skyboxes'
imageSize = 1024

# Script
if not os.path.exists(savePath):
    os.makedirs(savePath)

scene = bpy.context.scene

# Save the original hide_render state of all objects
original_hide_render = {obj: obj.hide_render for obj in bpy.data.objects}

# Hide all objects except the camera and lights (optional)
for obj in bpy.data.objects:
    if obj.type not in {'CAMERA', 'LIGHT'}:  # Keep cameras and lights visible
        obj.hide_render = True

cam_data = bpy.data.cameras.new('SkyBoxCamera')
cam = bpy.data.objects.new('SkyBoxCamera', cam_data)
bpy.context.collection.objects.link(cam)
scene.camera = cam

bpy.context.scene.render.resolution_x = imageSize
bpy.context.scene.render.resolution_y = imageSize
cam.data.lens_unit = 'FOV'
cam.data.angle = 1.5708

#cam.rotation_clear(clear_delta=False)0
scene.render.image_settings.file_format = 'PNG'

cam.rotation_euler = mathutils.Euler((0, 0, 0))
scene.render.filepath = os.path.join(savePath, f"{skyboxName}_Down.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi/2, 0, 0))
scene.render.filepath = os.path.join(savePath, f"{skyboxName}_Front.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi, 0, 0))
scene.render.filepath = os.path.join(savePath, f"{skyboxName}_Up.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi*3/2, math.pi, 0))
scene.render.filepath = os.path.join(savePath, f"{skyboxName}_Back.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((-math.pi/2, math.pi,-math.pi/2))
scene.render.filepath = os.path.join(savePath, f"{skyboxName}_Right.png")
bpy.ops.render.render(write_still = 1)

cam.rotation_euler = mathutils.Euler((math.pi/2,0,-math.pi/2))
scene.render.filepath = os.path.join(savePath, f"{skyboxName}_Left.png")
bpy.ops.render.render(write_still = 1)

objs = bpy.data.objects
objs.remove(cam, do_unlink=True)

# Restore original hide_render state
for obj, hide_render in original_hide_render.items():
    obj.hide_render = hide_render

Hope this helps somebody :)

I'd like to add a few things to the technique detailed by Zauber Paracelsus:
I set up my scene to have 6 frames.  Each frame animated the camera to capture a different face of the sky cube.  This is what my fcurves looked like, but I'm not 100% certain that I got the up and down cameras perfect (please correct me in the comments if so).

The result is that I can rerender the skybox simply by rendering the animation.
Actually configuring the skybox for a Unity scene is done in the dialog box accessible through the Window/Lighting menu option.
As of 2016-June it seems like the most detailed skybox supported by unity is 1024x1024 per face.  If you need resolution better than that, you might have to instantiate those objects in the Unity scene and leave them out of the skybox.


text:
Pixelate the viewport camera in Eevee for previewing live pixel art / low-resolution render?
Related question that covered only Cycles: Is there a way to force pixellate the viewport render?
These options are not available for Eevee. Is it possible with Eevee? Render sizes are 32x32, 16x16, 20x20 and 32x64. Right now I have to add a grid foreground to camera to get estimation of what pixels will look like:

Rendered example:

Why can't you just render at a low resolution?

@EricXue That's exactly what I do now, but I want to get rid of rendering step and preview the render in the camera.

Discussion about pixel-art tag moved to https://blender.meta.stackexchange.com/q/2727/1958

You'd have to be using blender 4 or greater I think for the real time compositor. Worked well enough to preview the pixel art look. Not exact as the pixel size will change with your zoom level, but at least you'll be able to control it.

Thanks for the posts. This is not a regular forum, according to site rules links to answers are not answers if the link goes missing your answer becomes an empty shell without content. Answers should be substantial and stand on their own without relying on external data like links, videos or images. Instead of having users go through external links, either transcribe essential parts of the process here, linking the source, or posts these in the comments section instead.

Sorry about that, thanks for the heads up. Posting the link here then.
I got the node graph from a CGmatter video (https://www.youtube.com/watch?v=LEfQXRtqzF0)

Thanks! I'll try it when the war ends.


text:
Apply boolean operations and modifiers in 2.9
I started recently to work on a spare part to print with a 3d-printer and I repeated my workflow that was successful in prior versions of blender and then i noticed changes in the with the bools.
I can not find apply for the boolean operation since i upgraded to 2.9 (from 2.83)
The first picture is the bool operations for blender 2.9,

The second picture is the same file in blender 2.83.

Yes that answered my question, thank you.


text:
Can I export blender's drawing lines for using in clipstudio?
I want to find to much easier way to what I make my web comics. so I found blender's surface drawing.
and trying to export drawing line for clip studio. but I can't.
Is this possible? clip studio's 3d object file form is *.fbx or *.obj
I want turn around my sketch lines without limits.

clip studio's 3d object file form is *.fbx or *.obj (Only I know is this two forms. maybe it more... )

Convert the grease pencil to a curve or a mesh.

Then export as the format you need.
Note that the format will determine what attributes will get saved as part of the file, most likely only the outline.

OMG..THX U SO MUCH. IM TRYING


text:
How do I make the image move with every frame of the video?
I just want to make the image in the frame move with every frame of the video.

Please [edit] your question and make an effort to describe the situation. Is the person moving the frame, and you want the superimposed image to track with the motion?

Note that you  don't need the color key at all, just do a plane track.


text:
Change view rotation command
Does anyone know how to change the rotate view command?
The scroll on my mouse is a bit buggy and I can't find it on the keymap.

Please show your efforts in a screen capture. There is a hand and an axis on the 3D screen so you might able to use this in addition to your mouse scroll.  Edit User Preferences list the keyboard mappings and others can talk about this. I use the on screen axis for view rotation and I enjoy it more than I thought I would. I have some mouse issues as well with ambidextrous mouse. If you can click and drag ... then with the onscreen axis your can rotate view. You can zoom with the hand. You can Pan. Orthogonal Perspective.

There may be tutorials for the 3D View controls.  Maybe experimentation is enough.

You can use the Numpad 4 and Numpad 6 keys to rotate horizontally, and Numpad 8 and Numpad 2 to rotate vertically.
Also, if you enable "Emulate 3 Button Mouse" in the preferences > Input > mouse section, you can use Left click while holding the Alt key and drag the mouse to rotate the viewport.

Menu Edit User Preferences.  Then Keymap on left side.
Name Search  text ... rotate.
3D View will show the match.


text:
UV tiling. Island is stretched
There is a tiling problem with one side of a wall on a mesh that I am working on. The island is stretched  for a reason that I do not know why.

Have you UV unwrapped the object? Have you edited the mesh since you UV unwrapped it? If the so, you may need to UV unwrap again.

I haven't edited the mesh since i unwrapped it. This the result of the unwrap by selecting the sharp edges and using them as seams.

You can try to UV unwrap it manually.


text:
Problem with Brick texture and the Mortar Smooth
I wish mortar smooth didn't fade between the tiles and the tile joints, as I'm using a bump map, which makes the tile smooth on the edges. I would like to have a clear cut between the tile and the Tile Joints, without blending, keeping the Bump effect of the "Mortar Smooth".
Note: I would like to make the tiles with the Mortar Smooth effect, i like the effect, like Subway Tile
How can I do?

Simple check if the factor/color is greater than 0 and transfer your predefined colors into a Mix node:

Or if you want to create your tiles with the Mortar the other way around, use the following setup:
Mortar Smooth is always subtracted from your Mortar Size value proportionally, so you would have to use two Brick textures:

one for your Base Color, where you reduce the Mortar Size by the value of Mortar Smooth
and one for your Normals, which you can flip depending on the direction with the node Map Range for example

And if you want to add the Mortar Smooth to both areas, you can mix these examples:

This is really what I was looking for. It would be nice at this point to have the smooth on the mortar and on the tiles (Obviously this was not the question) but given the good result obtained, it occurred to me

@NoobCat If this answer solved your problem, please consider accepting it by clicking on the checkmark.

Try adding a Math node set to "Greater Than" with the threshold set to 0. This will make any colour that is brighter than black white.
Then run that through a Colour Ramp to change the white colours back to red.

It could be a solution, but unfortunately, we cannot use the 2 colors of the brick texture

Another thing, I would like to make the tiles with the mortar Smooth.

a greater than after the fac output rather than color would let you use it as a mix factor afterwards while keeping the colors of the tiles


text:
Get all materials inside an object for controlling mapping nodes with single var
For now i can control mapping by name of material but the problem is , all in this object material use mapping , exist a way to get all mapping node inside at material and controll all with my rot_var?
this object can 1 to multiple materials slots
i think but not work:
ob = context.object
rot_var = ###my variable(0 to 360)
   for s in ob.material_slots:
       if s.material.use_nodes:
           for n in s.material.node_tree.nodes:

                    mapping = n.get("Mapping")
                    mapping.rotation[2] = radians(rot_var)

Edit: i find solution for Mapping:
for slots in ob.material_slots:
    for nodes in slots.material.node_tree.nodes:

        if nodes.type == 'MAPPING':

            nodes.rotation[2] = radians(rot_var)

but inside i have 2 nodes "MixRGB" i not have idea to get  because same name of nodes and not have idea about name of MixRgb

Ok i find my solution is put name inside the node and to if statement : if nodes.name == "My personal name":

thats great. please add an answer so others may find the solution. As a new user you may have to wait 24hrs before you can add the answer.

Wrote following in answer to this q. Noticed you sorted it out, thought I'd post anyway

Wrote a utility function to query an objects material nodes.
query_mat_nodes(ob, "type", 'MAPPING') returns a list of all
mapping type nodes.  query_mat_nodes(ob, "name", "Frank") returns a
list of all nodes named "Frank" in the objects materials.
Added a float property to the object with an update method to set all
the mapping nodes on object to this property value.  Notice giving the
property the unit='ROTATION' will display the value in the UI
dependant on the setting for scene rotation unit in units panel.
(generally degrees is selected)  The property value will always be in
radians.
For want of a better place I tacked (prepended) draw_prop (a UI draw method) to the node space
header to test.

Test script.
import bpy
from math import radians
def query_mat_nodes(ob, key, value):
    return set(n for s in ob.material_slots if s.material and s.material.use_nodes
            for n in s.material.node_tree.nodes if getattr(n, key, None) == value)

def update_map_nodes(self, context):
    for n in query_mat_nodes(self, "type", 'MAPPING'):
        n.rotation.z = self.map_rot

bpy.types.Object.map_rot = bpy.props.FloatProperty(
         min=0,
         max=radians(360),
         unit='ROTATION',
         update=update_map_nodes)

def draw_prop(self, context):
    self.layout.prop(context.object, "map_rot")

bpy.types.NODE_HT_header.prepend(draw_prop)

This is a good alternative!


text:
When exactly __init__() of bpy.types.Panel subclass must be executed?
I'm getting it run every time I hover a mouse over the button. Isn't it a bug? I thought it must be executed just once on addon activation.

The ____init____() function for BPY types (especially UI stuff) can be unpredictable and should not be used.  You likely want to be overloading the draw() method instead.
Example:
http://www.blender.org/documentation/blender_python_api_2_57_release/bpy.types.Panel.html


text:
How to make operator data persistent?
My addon needs just one button currently and I'd like it to work as a start/stop button. But on every button press Blender creates a new instance of the corresponding bpy.types.Operator thus losing any connection to already created ones to stop them. What are the ways (if any) to circumvent this behaviour? How to make bpy.types.Panel button work with the same instance of operator?
The addon in question is accelblend, intended to receive accelerometer data and rotate view accordingly. The operator is modular and keeps running in the background just fine. Source: http://bazaar.launchpad.net/~xintx-ua/+junk/accelblend/view/head:/accelblend_receiver.py

Can you give a bit more context? Its hard to guess at a good answer in this case because Im not sure what you're doing.

Yes, I'll add the details from the comment I've just added to the question body

I think in this case you're you really shouldn't be storing any state in the operator, If this operator has data which is spesific to the instance of Blender you have open, it makes sense to store the data globally in blender. (Probably within the python module).

ok, I'll try it the day after tomorrow, thanks a lot :)

There are a few options open to you:

Yes you can keep the operator instance by keeping the operator running, in this case you would need to start a modal operator, then use some action to trigger it (think the knife tool - it stays running and but act's when the mouse is dragged).Note: This is the most direct answer to your question - however its only really useful in specific cases.
Store the settings externally.
Typically when you store settings externally, the operators invoke function will read from these settings when initializing.

In a Python dictionary outside the operator instance (settings will be lost on restarting Blender unless you implement callbacks to write and restore them)
In custom properties (custom Scene properties is often used for this)
In the addons user preferences (not so good for per-blend-file data)
In a text data block (normally not optimal but including for completeness)

Another trick/hack missing in the list is to use empties (https://docs.blender.org/manual/en/latest/modeling/empties.html), disable their visibility and store the data in their custom properties.


text:
Is there a way to force pixellate the viewport render?
I occasionally use blender for pixelart by disabling interpolation, mipmaps and anti-aliasing in render options, but it would be great to see how a model is looking without having to render it everytime.
The render preview in the viewport only comes in one resolution, and it would be great to view it in the exact dimensions or just overall look as the final render. is such a thing possible?
Here's a render with the look I'm going for side by side with the viewport view in render mode.

I've created a related question about Eevee since these options are not available for it: https://blender.stackexchange.com/q/188023/1958

Captain, do you think this question is about pixel art? I've created a tag for it but some mods doubt it's needed. I'd like to know you thoughts on this.

I think it does apply, I used it for pixel art in the end. the viewport tweak was needed to preview it without rendering it every time.

Ok, I've added it to the post

You can change your viewport resolution.
Render Tab > Performance > Viewport > Pixel Size

It worked a charm. thank you

Happy to help :).


text:
Pixelart style render in blender
I want to create pixelart sprites for my game, but instead of drawing them, I want to render them with blender. Is it possible to make render like these http://timmaxwell.org/pages/retrorenderer/ ? I think about this flat shading and outline black lines.

Use toon shaders and freestyle, for cycles

You might want to have a look at this: http://www.blendswap.com/blends/view/65505
or this: http://www.blendswap.com/blends/view/44982
They are both using Freestyle for the lines, and Eight_Bit blending has no anti-aliasing. But you can find all that out with a look at the .blend files.


text:
How can I keep low resolution textures pixelated?
I have a problem. I am going to make a minecraft animation in blender. But when I put a minecraft texture on a 3d cube that is 16x16x16 it is very low resolution is there a way to get the texture in a better resolution or is there a way to make blender make the texture better?
I hope you have an answer.
Thanks in advance

Related: http://www.minecraftforum.net/topic/760973-how-to-resize-picture-in-gimp-without-getting-blury-picture/

You go to user prefrences and disable mipmapping.

In addition to scaling the textures up in an image editor with pixel interpolation disabled, (as mentioned by Gunslinger)
Another method is to disable pixel interpolation right in Blender and save memory, and as already mentioned by Krivar, keeping the texture sharp even when close up:
Cycles:

Update
As of this commit, (will be in blender 2.71) texture nodes now have an option to change the interpolation method:

Using Closest will keep the pixels sharp.

Original answer:
You could use this technique, which uses a node setup to scale the UV map:

To add Nodes, press ShiftA > Add node in the Node Editor.
To create a Node Group, select the nodes you want and press CtrlG to make them into a group, creating the Group input and Group output nodes. Press Tab to toggle editing the group.
To use the above group, connect the UV output of the Texture Coordinates node to the UV input of the NodeGroup, and connect the output to the UV coordinates used to map your texture.
(The Vector input on the texture node):

Set the X and Y values to the X and Y dimensions of your texture.
Blender Internal:
Disable Interpolation and set filter to Box in Material texture settings > Image Sampling:

Viewport
You can disable interpolation in the Viewport by disabling Mipmaps in CtrlAltU→ User Preferences → System:

The only thing I did understand is the picture in the bottom. I am kinda beginner in blender. I don't know how to open group input or texture coordinate. But it seems to work very good for @WChargin and krivar so I think its a good answer if I understand it.

@joapet99 I have updated my answer with more detail, hope this helps :)

Is this nodes applied to the texture or the material with the texture

@joapet99 these are Material nodes. (So the material with the texture)
Note that if you are using Blender Internal render, you don't have to worry about the nodes, You only need those if you are using Cycles.

Scale the texture to 512x512 in your favourite image editing software. Set interpolation to nearest, this is important.
Here is how it is done in photoshop:

Gandalfs answer is IMO the right one.

the answer by Gandalf is better, as you keep the tiny texture size. Also the textures will keep sharp even in extreme conditions.

Using GIMP. In the interpolation section you can choose between: None, Linear, Cubic, Sinc(Lanczos3).

None seems reasonable. But as everyone poits out, follow gandalfs answer.

There doesn't exist a direct way to do this in Cycles yet it seems. However, a user on the ba forums has devised a node group for this, see Cycles: Getting rid of Texture Interpolation, it has an attached example blend.

For the 3d view, see How do I disable texture filtering?.


text:
How to upscale final render (compositing)
I am working on retro style graphics. How do I upscale my final render through compositor?
I'm rendering frames with 480x270 resolution and want to upscale it to 1920x1080 without interpolation (or with nearest neighbour).
I found a topic which suggested rendering 1920x1080, pixelate to 480x270 and then upscale to 1920x1080. This method is not suitable.


text:
Isometric 30° seems to behave like dimetric 26.6° (Blender 2.8)
Isometric video game graphics article on Wikipedia says:

The projection commonly used in videogames deviates slightly from
  "true" isometric due to the limitations of raster graphics. Lines in
  the x and y directions would not follow a neat pixel pattern if drawn
  in the required 30° to the horizontal. While modern computers can
  eliminate this problem using anti-aliasing, earlier computer graphics
  did not support enough colors or possess enough CPU power to
  accomplish this. So instead, a 2:1 pixel pattern ratio would be used
  to draw the x and y axis lines, resulting in these axes following a
  26.565° ( arctan(0.5) ) angle to the horizontal.

I'm making a game and decided to create some assets in blender, with this typical use of pseudo-isometry, in order to be able to retouch my renders with "neat" (as Wikipedia puts it) lines, or to avoid changing viewing angle when switching from renders to fully drawn pixel art.
I've added a new camera with 0;0;0 rotations in the center, moved it up, parented it to an empty in the center and rotated that empty along X to 63.4 (which is 90 - 26.565, as I had to set the angle from the vertical and not the horizontal).
Then I parented that empty to another object in center, which I rotated along Z by 45°. You can see on the image, that a bounding box of a plane I use as a guide, is drawn in same, sharp style as in pixel art - except it has a jagged line:

This wouldn't be a problem, as I see it, the algorithm drawing these lines could be not optimized to draw them in a "neat" pixel art pattern, even if its angle allows for it. However, I started to have some fun with the interface, by fine-tuning the rotation of my empty until the lines became perfect:

I looked at the angle with which I achieved this result, and lo and behold, the angle was exactly 60° from the vertical (30° from the horizontal).
I don't understand what is happening here. Is Wikipedia wrong on the angle 26.565° producing "neat" lines? Does Blender introduce some magic algorithm, that somehow makes the "neat" lines possible on true isometric view? Does Blender lie about the angle, or does it apply some kind of a trick like slight vertical stretching/horizontal contracting in order to preserve 2:1 ratio for these lines?
I tried to see if it stays the same on renders, and it seems the effect is there too (I didn't know how to render crisp lines, but I measured pixel colors in 2 px to the side and 1 px down pattern and the render with real isometric setup was more consistent with the colors along edges than the one with pseudo-isometric setting).
As in title, I tested it on Blender 2.8.

I misunderstood the Wikipedia article. The angle 26.565° is the angle between projected non-vertical axes, and the horizontal line:

While the angle of the camera should indeed be 30° from the horizontal / 60° from the vertical:

To those, who want to achieve true Isometry in Blender, instead of the pseudo-isometry that I need, you actually have to set the angle of the camera to 35.264°.

Very interesting, thanks! Looks like 35.264° is also the angle you have to rotate objects to for them to be placed diagonally in orthographic view of a 45° camera.


text:
lines while importing .dae files
I imported a .dae file but there seems to appear line like objects (and circles at the end of it) starting out from the center of the world. Can you tell me what they are and can it be removed?

But when I open the same environment (.dae file) in another application, I get a proper environment.

These lines show relations between objects. I think in your case these are parent-child relations, which means that in the bottom left corner there is an object (parent) that, if you move it, moves all the other objects (children) with it.
You can disable that these lines are drawn.
In the Overlays for the viewport you can disable Relationship Lines.

Also have a look at the outliner window in the top right of your screen. It can tell you much about the scene:

If you expand the item by clicking on the small triangle left of the name of the object, you will see the objects that are parented.

If you want to make any of the parented object a completely independent object, then you can select it and press ⎇ Alt+P and clear the parent relationsip.

For Version 2.7
Press N while your mouse is in the 3D viewport to bring up the Properties shelf. Then scroll down to display and disable Relationship Lines:

If you also want to deactivate the transform widget look for the marked button at the bottom of your 3D viewport:

Alternatively you can activate Only Render. Then anything that is not mesh data will be hidden, except for the transform widget.

Thanks maddin for the help and the effort you put in. That helped.

You're welcome! If this answer is what you were looking for, please accept it.

ALT+P to clear parents ( fix the lines )
Then Search > Merge by Distance (with the object vertices selected ) (fix the mesh bug)


text:
Can't scale, what's wrong?
I can't get anything to scale, no matter what object I click select and hit S -- nothing scales in my scene anymore. Did I inadvertently hit something and lock everything in place?
?

Blender 2.91 Update: Click on Options in the upper right hand of your viewport. Under Transform > Affect Only, uncheck Locations.
Refer to image below:

This can also be accessed by hovering over viewport and pressing N > Click the Tool tab>Reveal Options>Reveal Transform>Uncheck Affect Only property Locations.
Refer to image below:

Previous answer from 2015:
Oops. I had things locked with Manipulate Center Points.

Please add more detail to your answer so people know how to turn off 'Manipulate Center Points'.

I edited the question with an image.

Blender 2.9 on PC doesn't have that icon...any tips?

@BenC suggest add a new answer rather than editing this one.


text:
Shortened mp4 renders 3x larger file than the original file
I have a 12mb mp4 that I have imported, deleted sound, made shorter in the VSE, increased speed to make shorter again, and rendered out as mp4 using default settings. The rendered mp4 is 39mb! Why would it increase so much?

FFMPEG (in Blender) can write many mp4 codecs with various encoder and quality settings.


text:
Deselect strip in the Video Sequencer
By default, in order to deselect a strip in the Video Sequencer, but keep the others selected, you just need to press ShiftLMB twice on the unwanted strip (same thing as with objects in the 3D View). I've lost the shortcut and I'm trying to restore it, I guess it is supposed to be under SequencerCommon > Sequencer > Sequencer (Global) (I've tried Select (Toggle) but it doesn't seem to work).
Edit: Mmh OK actually it seems like it's rather a problem of double click speed, I need to find where is the click speed setting...

I actually just needed to increase the Double Click Speed in the Preferences > Input > Mouse:


text:
BGE: Expression to check if Collision Sensor's property is True or False
In this simple demonstration of the problem there is a blue cube. When it falls and collides with an object having the property "obstacle" (while the player is also performing some action) the cube should turn red. What kind of expression syntax can accomplish this?

If an And Controller is used instead, the cube turns red. The problem is that it will do this whether the property of the object it collides with is True or False. I want it only to happen if 'obstacle'==True. How can this be accomplished? Thanks.

No Expression Required
I don't know if there's no way for a Collision Sensor to pass along the value of the property it's watching. Instead, we can have the object collided with send a Message, and receiving that Message can be one of the conditions required by an And Controller in order to trigger the Actuator.
Obstacle Logic

Cube Logic

As for expressions, here is a reference. I'll re-post it below:
Table 26-1. Valid expressions

Expression type  Example
===============  =======
Integer number   15
Float number     12.23224
Booleans         TRUE, FALSE
Strings          "I am a string!"
Properties       propname
Sensornames      sensorname (as named in the LogicBrick)

Table 26-2. Arithmetic expressions

Expression       Example
==========       =======
EXPR1 + EXPR2    Addition, 12+3, propname+21
EXPR1 - EXPR2    Subtraction, 12-3, propname-21
EXPR1 * EXPR2    Multiplication, 12*3, propname*21
EXPR1 / EXPR2    Division, 12/3, propname/21
EXPR1 > EXPR2    EXPR1 greater EXPR2
EXPR1 >= EXPR2   EXPR1 greater or equal EXPR2
EXPR1 < EXPR2    EXPR1 less EXPR2

Table 26-3. Boolean operations

Operation        Example
=========        =======
NOT EXPR         Not EXPR
EXPR1 OR EXPR2   logical OR
EXPR1 AND EXPR2  logical AND
EXPR1 == EXPR2   EXPR1 equals EXPR2

Conditional statement: IF( Test, ValueTrue, ValueFalse )

Examples:

Table 26-4. Expression examples

Expression           Result          Explanation
==========           ======          ===========
12+12                24              Addition
property=="Carsten"  TRUE or FALSE   String comparison between a Property and a string
"Erwin">"Carsten"    TRUE            A string comparison is done

And if anyone figures out syntax for testing the value of a property, please share.


text:
Driving Shape Keys by proximity of an Empty
How can shape keys be driven by an Empty's coordinates relative to the object?
I'm guessing this can be done with a Python expression but not sure how to write it.

Also, how might we specify the falloff curve for that Empty's influence?

You can use the technique mentioned here: http://blender.stackexchange.com/questions/7745/cycles-node-to-tell-distance-from-an-empty/7746#7746


text:
Fill image problem with generated_color in python, into paint workflow
After creating a new image,i know that D.images['my_image'].generated_color = (1,1,1,1) It makes the image all white, in short, it fills it (R,G,B,A)
The problem arises, when I go into texture paint mode, I paint over my image, and then I save the project, exit, and am asked to save the changes made to the image (And I confirm)
When I return to Blender, I realize that D.images['my_image'].generated_color = (1,1,1,1)
it won't work anymore.
For example, if I go on to paint and try again to use generated_color, it will always revert to the previous paint I had at the time of the previous save.
Therefore it will no longer be possible to do the "Fill" in solid colors
Anyone have any idea why?

Images have a source, D.images['my_image'].source, that specifies where the image comes from.
A "Generated" image (source == 'GENERATED') is generated based on some parameters, generated_type and generated_color. For example, when Generated Type is "Blank", it will generate a solid color image with the generated_color, like you observed.
When you paint over an image and save it, the source is changed to "Single Image" (source == 'FILE'). Now the image comes from a single file (possibly packed into the .blend).
The generated_color is only used for "Generated" images (and even then, only "Blank" type), it won't affect other source types. But if you switch back to "Generated" you'll see the color you set.
D.images['my_image'].source = 'GENERATED'

If you open the Image Editor and open the sidebar (shorcut: N), you can see all this under the Image tab. It might help to play around with it.

D.images['my_image'].source = 'GENERATED' It really does what I was looking for. I hadn't really noticed that API. Really useful, you solved a big problem for me.


text:
How to change description in an operator depending on the option assigned in the UI?
I would like my operator, once created 2 different buttons in the panel, When I fly over the button with the cursor them they give 2 different tips, based on the assigned property. I don't really know how to do it, i place a small example to better understand what I intend to do.
   class MYOPS_OT_Operator(bpy.types.Operator):
        #Crazy Example, obviously it cannot work like this:
        """It will do something""" if self.options = 'OPT_ONE' else """It will do something different"""

        bl_idname = "my.ops"
        bl_label = "My ops"
        bl_options = {'INTERNAL','UNDO'}

        options: StringProperty()

        def execute(self,context):

            if self.options = 'OPT_ONE':
                print('I did something')
            if self.options = 'OPT_TWO':
                print('I have done something different')

            return{'FINISHED'}

    class LayoutDemoPanel(bpy.types.Panel):
        """Creates a Panel in the scene context of the properties editor"""
        bl_label = "Layout Demo"
        bl_idname = "SCENE_PT_layout"
        bl_space_type = 'PROPERTIES'
        bl_region_type = 'WINDOW'
        bl_context = "scene"

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

            layout.operator("my.ops",text='Do something').options = 'OPT_ONE'
            layout.operator("my.ops",text='Do something different').options = 'OPT_TWO'

Operator description method
Combining answers from Changing tooltip for menu entries which use the same operator
Since 2.81 An operator now has a description(cls, context, event) classmethod. The properties of the operator are available thru the event object.  See print methods in script below to expand members available via context and event passed to description
The string returned from this method is used as the operator tooltip.  Remember this can be multiline too.
Secondly if an enumproperty is used for the options then the multi button layout is taken care of.  Unfortunately the description is seemingly unused. (No matter. Easy enough to use in description method)
import bpy
from  bpy.props import EnumProperty

class MY_OT_ops(bpy.types.Operator):
    ''' Enum Example '''
    bl_idname = "my.ops"
    bl_label = "My ops"
    bl_options = {'REGISTER'}

    zzz : bpy.props.IntProperty()
    def items(self, context):
        items = (
            ('OPT_ONE', "Option One", "I am ONE"),
            ('OPT_TWO', "Option Two", "I am TWO"),
            )
        return items

    options: EnumProperty(
        name="Options",
        items=items,
        )

    @classmethod
    def description(cls, context, event):
        '''
        print("event")
        for p in dir(event):
            print(p, getattr(event, p))
        print("context")
        c = context.copy()
        for k, v in c.items():
            print(k, v)
        '''
        opt = getattr(event, "options", "Something")
        return f"Choose {opt}"

    def execute(self, context):

        if self.options == 'OPT_ONE':
            print('I did something')
        if self.options == 'OPT_TWO':
            print('I have done something different')

        return{'FINISHED'}

class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

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

        layout.operator_menu_enum("my.ops", "options")
        col = layout.column()
        col.operator_enum("my.ops", "options")
        layout.popover("SCENE_PT_layout", text="Pop Over")

classes = (MY_OT_ops, LayoutDemoPanel)

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

if __name__ == "__main__":
    register()