Python for 3ds max – Select objects of type

Software:
3ds max 2020

Continuing this example,
If you need to select objects (nodes) of a certain type i.e. lights, cameras etc.
You can use the INode class’s GetObject() method to get a reference to the node’s object, or “modified object” in 3ds max terms, and use the object’s GetSuperClassID() method to get the integer id representing the object’s superclass.

In addition, the MaxPlus SuperClassIds class contains convenient constants that can be used to avoid having to check and remember the superclasses numeric ids.
See reference here:
https://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__py_ref_class_max_plus_1_1_super_class_ids_html

An example of a script that selects all light objects in the scene:

from MaxPlus import SuperClassIds
from MaxPlus import SelectionManager

def scene_objects():
   def list_children(node):
      list = []
      for c in node.Children:
         list.append(c)
         list = list + list_children(c)
      return list
   return list_children(MaxPlus.Core.GetRootNode())

for o in scene_objects():
   obj = o.GetObject()
   if obj.GetSuperClassID() == SuperClassIds.Light:
      SelectionManager.SelectNode(o, False)

* note that when copying and pasting a script from this example, the indentation may not be pasted correctly.

Blender 2.8 – Select bones in Weight Paint mode

Software:
Blender 2.8

To select bones while in Weight Paint mode in Blender 2.8:

  1. Select the Armature
  2. Shift select the skinned mesh
  3. Switch mode to Weight Paint
  4. Shift-Click bones to select them
    * Shift double click to select bones hidden under the mesh

Update:
This has also been verified on Blender 3.6

wpaint.gif

Blender Python – Make an unselectable object local so it can be selected..

Software:
Blender 2.79

If you happen to link an external object that was made unselectable in the original blend file, You will have no interactive way to make it selectable again, or local, or even delete it from the current blend file.

The good news is that it can easily be done by a very short Python script:

import bpy

obj = bpy.data.objects['the_untouchable_object']
obj.make_local()

It should also be very easy script a loop that will find all those linked objects,
I will post an example when I’ll have a minute to breathe… 😀

Blender – Select Pattern

Software:
Blender 2.79

Use the Select Pattern tool to select multiple objects with name similarities.

  1. In the 3D View in Object mode choose Select > Select Pattern…
  2. In the Select Pattern dialog, type a part of a name with an Asterisk to define wild cards.
    For example *car* will select all objects who’s names contain the string ‘car’,
    And car* will select all objects who’s names begin with the string ‘car’.

Untitled-1

Untitled-2