-
Notifications
You must be signed in to change notification settings - Fork 22
Useful Blender Scripts
AsteriskAmpersand edited this page Feb 16, 2020
·
11 revisions
The following is a disjoint collection of blender scripts that might be of use to modellers:
used = sorted([e["boneFunction"] for e in C.scene.objects if e.type == "EMPTY" and "boneFunction" in e])
unused = set(range(512))
unused.difference(set(used))
print (unused)import bpy
boneFunctions = {}
repeats = set()
for bone in [obj for obj in bpy.context.scene.objects if obj.type == "EMPTY" and "boneFunction" in obj]:
func = bone["boneFunction"]
if func in boneFunctions:
boneFunctions[func].append(bone.name)
repeats.add(func)
else:
boneFunctions[func] = [bone.name]
for repeated in repeats:
print("Bone Function: %d\n"%repeated+'\n'.join(["\t%s"%repeat for repeat in boneFunctions[repeated]]))for meshobj in sorted([o for o in bpy.context.scene.objects if o.type=="MESH"], key=lambda x: x.name):
mesh = meshobj.data
uvList = []
for layer in mesh.uv_layers:
uvMap = {}
for loop,loopUV in zip(mesh.loops, layer.data):
uvPoint = (loopUV.uv[0],1-loopUV.uv[1])
if loop.vertex_index in uvMap and uvMap[loop.vertex_index] != uvPoint:
o = bpy.data.objects.new("YAVP-%s"%meshobj.name, None )
bpy.context.scene.objects.link( o )
o.location = meshobj.matrix_world * mesh.vertices[loop.vertex_index].co
o.show_x_ray = True
o.empty_draw_size = .5
else:
uvMap[loop.vertex_index] = uvPoint
uvList.append(uvMap)renameTable = {}
for bone in [o for o in bpy.context.scene.objects if o.type == "EMPTY" and "boneFunction" in o]:
newname = "BoneFunction%03d"%bone["boneFunction"]
renameTable[bone .name] = newname
bone.name = newname
for mesh in [o for o in bpy.context.scene.objects if o.type == "MESH"]:
for group in mesh.vertex_groups:
if group.name in renameTable:
group.name = renameTable[group.name]
active = bpy.context.active_object
for obj in [ o for o in bpy.context.selected_objects if o.type == "MESH" and "blockLabel" not in o.data]:
for property in active.data.keys():
obj.data[property] = active.data[property]for obj in [o for o in bpy.context.selected_objects if o.type == "MESH"]:
colors = list(obj.data.vertex_colors)
for c in colors:
obj.data.vertex_colors.remove(c)for obj in [o for o in bpy.context.selected_objects if o.type == "MESH"]:
weights = list(obj.vertex_groups)
for w in weights:
obj.vertex_groups.remove(w)for obj in [o for o in bpy.context.selected_objects if o.type == "MESH"]:
modifiers =obj.modifiers
m = modifiers.new("Mod Name","MODIFIER TYPE")
#Properties you want to be set are done as m.PropName = Valuefor obj in [o for o in bpy.context.selected_objects if o.type == "MESH"]:
weights = obj.vertex_groups
group = weights.new("Your Bone Goes Here")
group.add([i for i in range(len(obj.data.vertices))],1.0,'REPLACE')for obj in [o for o in bpy.context.selected_objects if o.type == "MESH"]:
modifiers =obj.modifiers
for m in modifiers:
bpy.context.scene.objects.active = obj
bpy.ops.object.modifier_apply(modifier=m.name)General Tutorials
Animation Tutorials
Audio Tutorials
File & In Game IDs
- Accessory and Specialized Tool IDs (Asset)
- Armor IDs (Asset)
- Decorations IDs
- EFX IDs
- Endemic Critter IDs (Asset)
- Face IDs (Asset)
- Furniture IDs (Asset)
- Gimmick IDs (Asset)
- Hairstyle IDs (Asset)
- Item IDs
- LMT IDs
- Material IDs
- Medal IDs
- Model Bone Function IDs
- Monster IDs
- Monster Shell IDs (A-P)
- Monster Shell IDs (Q-Z)
- NPC IDs (Asset)
- NPC Base Model (Asset)
- Palico Equipment IDs (Asset)
- Pendant IDs (Asset)
- Poogie Clothes IDs
- Quest IDs
- Skill IDs
- Stage IDs (Asset)
- Player Weapon Action IDs
- Weapon IDs (Asset)
- Weapon ID Dump (GS,SnS,DB)
- Weapon ID Dump (LS,Ham,HH)
- Weapon ID Dump (Lan,GL)
- Weapon ID Dump (SA,CB)
- Weapon ID Dump (Bow,HBG,LBG)
Model Tutorials
- Quick Guide to Importing Models (Blender 2.79)
- Walkthrough of a Weapon Import
- Basics of Exporting Into the .mod3 Format
- How To Fix UVs Sharing a Seam
- How To Separate Mesh Parts in Blender
- Rotating, Moving and Resizing in Blender
- How to Split a Single Mesh Outfit into Player Equippable Parts
- Jigglebone Chains (.ctc) and Colliders (.ccl)
- Axial CTC Rotations
- Editing Hair Models and Materials
- Useful Blender Scripts
- [external page] How to Make All Polygons Into Triangles (Required for MHW models)
- [external page] How to Convert Triangles Back Into Quads
- [external page] How to Change The View-port clipping Parameters For Large Models
- [external page] How to Set Origin to Vertex in Edit Mode
- [external page] Shortcut to repeat the last operation in Blender
- [external page] Transferring Rig Weights From One Mesh To Another
- [external page] How to Copy Paint Weights From One Object to Another
- [external page] How to Remove All Zero-Weight Vertex Groups
- [external page] How to Weight Paint Against Current Pose
- [external page] Making a Hair Rig
- [external page] Physics Transfer
EFX Tutorials
FSM Editing
MRL3 Tutorials
NPC Editing
Plugins and Memory Editing
Monster AI Editing
General Texture Tutorials
- Obtaining, Converting and Replacing Textures
- Textures with Paint NET
- How To Open DDS Files
- Editing Textures
- Understanding Alpha Channels
- Exporting Textures with Transparency
- How To Achieve Glass Texture
- How to create Crystal materials with Alpha Textures
- Working Around the Mip Map Loading Bug
- [external page] Extracting a UV Layout
Specific Texture Tutorials
Asterisk's Plugin Notes
Miscellaneous Tutorials
Outdated Tutorials
- How to Make an NPC Skin Material Support Skin Color Customization
- Plugin Comparison
- A Theoretical Proposal on Skeleton Extension
- Monster Hunter World Save Editor Tutorial
- Making Copies of a Save Slot
- Making a Green Screen
- Notes on CTC Physics Jiggle Files
- Opening MRL3 file with a template
- Transferring MRL3 Files Between Models
- Expanding mrl3 Reference List
- How to Edit Eye Color in mrl3 Files