This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import listdir | |
from os.path import isfile, join | |
import unreal | |
dir = "D:\\" | |
files = [f for f in listdir(dir) if isfile(join(dir, f)) and f[-3:]=='jpg'] | |
AssetTools = unreal.AssetToolsHelpers.get_asset_tools() | |
import_tasks = [] | |
for f in files: | |
print join(dir, f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unreal | |
from unreal import Vector | |
lst_actors = unreal.EditorLevelLibrary.get_all_level_actors() | |
print('place actors at 0 z') | |
for act in lst_actors: | |
act_label = act.get_actor_label() | |
if 'Sphere_' in act_label: | |
print('placing: {}'.format(act_label)) | |
act_location = act.get_actor_location() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import MaxPlus | |
import math | |
from MaxPlus import INode | |
from MaxPlus import TriObject | |
from MaxPlus import SelectionManager | |
from MaxPlus import Factory | |
from MaxPlus import Animation | |
from MaxPlus import Point3 | |
from MaxPlus import Control |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
mesh = bpy.context.active_object.data | |
mesh.calc_loop_triangles() | |
for tri in mesh.loop_triangles: | |
tri_center = (mesh.vertices[tri.vertices[0]].co * 0.333) +\ | |
(mesh.vertices[tri.vertices[1]].co * 0.333) +\ | |
(mesh.vertices[tri.vertices[2]].co * 0.333) | |
bpy.ops.mesh.primitive_uv_sphere_add(radius=0.1,enter_editmode=False,location=tri_center) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import bmesh | |
obj = bpy.context.active_object | |
frames = range(0,10) | |
# get the object's evaluated dependency graph: | |
depgraph = bpy.context.evaluated_depsgraph_get() | |
# iterate animation frames: | |
for f in frames: | |
bpy.context.scene.frame_set(f) | |
# define new bmesh object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
# access mesh data: | |
obj = bpy.context.active_object | |
mesh_data = obj.data | |
mesh_loops = mesh_data.loops | |
uv_index = 0 | |
# iterate teh mesh loops: | |
for lp in mesh_loops: | |
# access uv loop: | |
uv_loop = mesh_data.uv_layers[uv_index].data[lp.index] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
objects = bpy.context.selected_objects | |
num_chars = 3 | |
for o in objects: | |
o.name = o.name[:-num_chars] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
objects = bpy.context.selected_objects | |
base_name = "new_name" | |
for (i,o) in enumerate(objects): | |
o.name = "{}_{:03d}".format(base_name, i) |
OlderNewer