Snap! Tip: snap-points on flexible objects


In a previous article I introduced a new add-on called Snap! 


This new video shows how you an approach to creating curve based assets with snap-points that allow for easy snapping while deforming an object at the same time.

Snap! is a time saving tool for people who often work with modular assets packs or creators of asset packs who want to make there product easier to use.

Snap! allows you to define snap-points with a predefined location and orientation on objects which can then be used to interactively snap objects together without the hassle of precise positioning.

Snap! is available in a personal and a redistributable version on my BlenderMarket shop.

Snap! New features

 In a previous article I introduced a new add-on called Snap! 


This video highlights some new features added in the latest releases, in particular an option to quickly align a snap-point direction vector to a normal, the new pie menu and the auto flip feature which can make a snapping workflow even easier if the snap-points all point consistently outward.

Snap! is a time saving tool for people who often work with modular assets packs or creators of asset packs who want to make there product easier to use.

Snap! allows you to define snap-points with a predefined location and orientation on objects which can then be used to interactively snap objects together without the hassle of precise positioning.

Snap! is available in a personal and a redistributable version on my BlenderMarket shop.

Snap! A new add-on to simplify working with modular assets

It is not every day I can announce a new add-on but today I published Snap! on BlenderMarket.





Snap! is a time saving tool for people who often work with modular assets packs or creators of asset packs who want to make there product easier to use.

Snap! allows you to define snap-points with a predefined location and orientation on objects which can then be used to interactively snap objects together without the hassle of precise positioning.

It is available in a personal and a redistributable version on my BlenderMarket shop.

Blender Market Summer Sale 2021


It's that time of the year again: BlenderMarket is having a summer sale until August 30.
This means serious discounts on participating products and of course my add-ons are on sale too!

Check out BlenderMarket to see if that special product on your wish list now has an orange 'on sale' label.

Generate a list of Blender object information

This isn't the next killer add-on you must have, but it could prove useful if you find yourself like me in the following situation: You are working on a high poly model consisting of dozens of different meshes and at some point you need to start thinking about your polygon budget.

So you want to focus on the meshes with the largest number of tris first, but determining how many tris there are requires selecting each individual object and switching to edit mode to see the data.

Also, at some point you may want to have a checklist of all objects to verify if you unwrapped them, retopologized them or whatever, before you start moving them to an external paint program for example, so a list of objects can be convenient to keep things organized.

object_list.py


I am a coder with a bit of a list obsession, so I created a small add-on that creates a comma separated list of objects with the most common properties for those objects. The list is created as a text block in the built-in editor. Such a list is then easily copied to a spreadsheet if you like, an example is shown below:



Note that the numbers listed are for the render time object with all modifiers applied (which is especially important for subdivision modifiers). Those numbers are only calculated for meshes: I would love to do this for beveled curves as well but I didn't figure out how to do that yet.

Code


The add-on is available from my GitHub repository. Simply use this direct link to download the file object_list.py and then install it with Edit > Preferences > Addons ... in the usual manner.

Once enabled it will be available in the Object menu of the 3D viewport. For large scenese with large meshes it can potentially take quite some time depending on the power of your computer.

The list of info is stored in a Text block called Object list.csv.



Installing Python packages with pip in your Blender environment

Say you are developing Blender add-ons and you need some additional packages, perhaps to to some line profiling use the line_profiler package.

You could keep a separate Python installation outside your Blender environment (like I mentioned in this old article ) but then versions needed to be the same and you needed to tweak the import path to be able use those packages.

An easier approach is to install the necessary packages in your actual Blender Python installation, but if you use pip from the command line it will install inside you regular python environment because pip is a python script that installs in whatever Python installation it is part of.

Fortunately it is rather straight forward to bootstrap your Blender Python environment to get its own pip and then use it to install whatever you want.

Examples

In the examples below, /blender refers to your Blender installation directory. This could be something like /home/michel/Downloads/blender-2.93.0-stable+blender-v293-release.84da05a8b806-linux.x86_64-release

First we install the pip module

/blender/2.93/python/bin/python3.9 -m ensurepip
After installing it, we verify whether it works
/blender/2.93/python/bin/python3.9 -m pip --version

pip 20.2.3 from /blender/2.93/python/lib/python3.9/site-packages/pip (python 3.9)
Now we can immediately use it to install packages inside the Blender Python installation, for example the line_profiler package
/blender/2.93/python/bin/python3.9 -m pip install line_profiler

Collecting line_profiler

... [a boatload of dependencies gets downloaded as well] ...
You will most likely get a warning
WARNING: You are using pip version 20.2.3; however, version 21.1.2 is available.
which is ok. You can upgrade the pip module if you like (with /blender/2.93/python/bin/python3.9 -m pip install --upgrade pip) but the version you got with ensurepip works fine, as demonstrated, so there is no immediate need. You can verify that the package is installed
ls /blender/2.93/python/lib/python3.9/site-packages/line_profiler
Now you can use this package in your add-ons without the need to change sys.path
from line_profiler import LineProfiler  
profile = LineProfiler()
 
@profile
def fie():
    ... expensive code happening here ...

And then somewhere else in your code
profile.dump_stats("/tmp/test.prof")
Inspecting the profile can then be done with
/blender/2.93/python/bin/python3.9 -m line_profiler /tmp/test.prof

Notes

You cannot profile Python code that you code inside text blocks in Blender. Or rather you can profile them alright but you can not inspect the stats in any meaningful way because the file name of the code that is logged makes no sense (if your .blend is called MyBlend and you have a text block test.py, the file will be called .../MyBlend.blend/test.py which is a file that does not exist and even if you save your text block this is an issue because MyBlend.blend is not a directory you can save to. I do not have a workaround for this (except for hacking the .prof file) but in practice this is probably not much of an issue.

Do not forget to remove the profiling changes (and the import) if you want to distribute your login, because your customer will probably not have the line_profiler package installed.

(refer to the original article for a bit more detail. Note that there is no longer the need to use my tweaked version, if you use pip as described earlier you have all you need)

IDMapper just got support for face-maps

IDMapper just got support for face-maps

It is now possible to assign vertex colors based on the face-map membership of faces.


If your workflow involves face-maps already, it is now super easy to create a vertex color layer (ID-map) based on those face-maps.

IDMapper simplifies creation and editing of vertex color layers that can be used as ID-maps in texturing software like Substance Painter or Quixel. It aims to reduce the time it takes to create an ID-map significantly, especially for complex hard surface models. It uses powerful heuristics to create an ID-map from scratch and lets you interactively adjust the results. It offers options to use existing information, like uv-seams, but can also intelligently assign the same color to similar mesh parts. 

The new version is available on BlenderMarket.