Commit e83f88c9 authored by Peter Kim's avatar Peter Kim
Browse files

Merge branch 'master' into xr-dev

parents ec84e329 0cd92169
......@@ -3,8 +3,8 @@
bl_info = {
"name": "Add Camera Rigs",
"author": "Wayne Dixon, Brian Raschko, Kris Wittig, Damien Picard, Flavio Perez",
"version": (1, 4, 4),
"blender": (2, 80, 0),
"version": (1, 5, 0),
"blender": (3, 3, 0),
"location": "View3D > Add > Camera > Dolly or Crane Rig",
"description": "Adds a Camera Rig with UI",
"doc_url": "{BLENDER_MANUAL_URL}/addons/camera/camera_rigs.html",
......
......@@ -73,30 +73,16 @@ class ADD_CAMERA_RIGS_OT_add_marker_bind(Operator, CameraRigMixin):
return {'FINISHED'}
class ADD_CAMERA_RIGS_OT_add_dof_object(Operator, CameraRigMixin):
bl_idname = "add_camera_rigs.add_dof_object"
bl_label = "Add DOF Object"
bl_description = "Create Empty and add as DOF Object"
class ADD_CAMERA_RIGS_OT_set_dof_bone(Operator, CameraRigMixin):
bl_idname = "add_camera_rigs.set_dof_bone"
bl_label = "Set DOF Bone"
bl_description = "Set the Aim bone as a DOF target"
def execute(self, context):
rig, cam = get_rig_and_cam(context.active_object)
bone = rig.data.bones['Aim_shape_rotation-MCH']
# Add Empty
empty_obj = bpy.data.objects.new("EmptyDOF", None)
context.scene.collection.objects.link(empty_obj)
# Parent to Aim Child bone
empty_obj.parent = rig
empty_obj.parent_type = "BONE"
empty_obj.parent_bone = "Aim_shape_rotation-MCH"
# Move to bone head
empty_obj.location = bone.head
# Make this new empty the dof_object
cam.data.dof.use_dof = True
cam.data.dof.focus_object = empty_obj
cam.data.dof.focus_object = rig
cam.data.dof.focus_subtarget = 'Aim_shape_rotation-MCH'
return {'FINISHED'}
......@@ -104,7 +90,7 @@ class ADD_CAMERA_RIGS_OT_add_dof_object(Operator, CameraRigMixin):
classes = (
ADD_CAMERA_RIGS_OT_set_scene_camera,
ADD_CAMERA_RIGS_OT_add_marker_bind,
ADD_CAMERA_RIGS_OT_add_dof_object,
ADD_CAMERA_RIGS_OT_set_dof_bone,
)
......
......@@ -32,20 +32,23 @@ class ADD_CAMERA_RIGS_PT_camera_rig_ui(Panel, CameraRigMixin):
layout.prop(cam_data, "type")
# DoF
col = layout.column(align=True)
col = layout.column(align=False)
col.prop(cam_data.dof, "use_dof")
if cam_data.dof.use_dof:
if rig["rig_id"].lower() in ("crane_rig", "dolly_rig"):
if cam_data.dof.focus_object is None:
col.operator("add_camera_rigs.add_dof_object",
text="Add DOF Empty", icon="OUTLINER_OB_EMPTY")
else:
col.prop(cam_data.dof, "focus_object")
row = col.row(align=True)
sub = col.column(align=True)
if cam_data.dof.focus_object is None:
sub.operator("add_camera_rigs.set_dof_bone")
sub.prop(cam_data.dof, "focus_object")
if (cam_data.dof.focus_object is not None
and cam_data.dof.focus_object.type == 'ARMATURE'):
sub.prop_search(cam_data.dof, "focus_subtarget",
cam_data.dof.focus_object.data, "bones")
sub = col.column(align=True)
row = sub.row(align=True)
row.active = cam_data.dof.focus_object is None
row.prop(pose_bones["Camera"],
'["focus_distance"]', text="Focus Distance")
col.prop(pose_bones["Camera"],
sub.prop(pose_bones["Camera"],
'["aperture_fstop"]', text="F-Stop")
# Viewport display
......@@ -74,9 +77,15 @@ class ADD_CAMERA_RIGS_PT_camera_rig_ui(Panel, CameraRigMixin):
if rig["rig_id"].lower() in ("dolly_rig", "crane_rig"):
# Track to Constraint
col = layout.column(align=True)
col.label(text="Tracking:")
col.prop(pose_bones["Camera"].constraints["Track To"],
'influence', text="Aim Lock", slider=True)
track_to_constraint = None
for con in pose_bones["Camera"].constraints:
if con.type == 'TRACK_TO':
track_to_constraint = con
break
if track_to_constraint is not None:
col.label(text="Tracking:")
col.prop(track_to_constraint, 'influence',
text="Aim Lock", slider=True)
# Crane arm stuff
if rig["rig_id"].lower() == "crane_rig":
......
......@@ -269,7 +269,7 @@ def MakeABlock(bounds, segsize, vll=0, Offsets=None, FaceExclude=[],
bounds: a list of boundary positions:
0:left, 1:right, 2:bottom, 3:top, 4:back, 5:front
segsize: the maximum size before lengthwise subdivision occurs
vll: the number of vertexes already in the mesh. len(mesh.verts) should
vll: the number of vertices already in the mesh. len(mesh.verts) should
give this number.
Offsets: list of coordinate delta values.
Offsets are lists, [x,y,z] in
......@@ -365,7 +365,7 @@ def MakeAKeystone(xpos, width, zpos, ztop, zbtm, thick, bevel, vll=0, FaceExclud
zbtm: distance from zpos to the bottom
thick: thickness
bevel: the amount to raise the back vertex to account for arch beveling
vll: the number of vertexes already in the mesh. len(mesh.verts) should give this number
vll: the number of vertices already in the mesh. len(mesh.verts) should give this number
faceExclude: list of faces to exclude from the faces list.
0:left, 1:right, 2:bottom, 3:top, 4:back, 5:front
xBevScl: how much to divide the end (+- x axis) bevel dimensions.
......@@ -779,7 +779,7 @@ class rowOb:
def arch(ra, rt, x, z, archStart, archEnd, bevel, bevAngle, vll):
__doc__ = """\
Makes a list of faces and vertexes for arches.
Makes a list of faces and vertices for arches.
ra: the radius of the arch, to the center of the bricks
rt: the thickness of the arch
x: x center location of the circular arc, as if the arch opening were centered on x = 0
......
......@@ -74,7 +74,7 @@ from amaranth.misc import (
bl_info = {
"name": "Amaranth Toolset",
"author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin, Lukas Tönne, Cesar Saez, CansecoGPC",
"version": (1, 0, 10),
"version": (1, 0, 14),
"blender": (3, 2, 0),
"location": "Everywhere!",
"description": "A collection of tools and settings to improve productivity",
......
......@@ -36,7 +36,7 @@ class FILEBROWSER_PT_amaranth(bpy.types.Panel):
@classmethod
def poll(cls, context):
return panel_poll_is_upper_region(context.region)
return context.area.ui_type == 'FILES' and panel_poll_is_upper_region(context.region)
def draw(self, context):
layout = self.layout
......
......@@ -65,7 +65,8 @@ class AMTH_store_data():
'TEXTURE': [], # Textures (Psys, Brushes)
'MODIFIER': [], # Modifiers
'MESH_DATA': [], # Vertex Colors
'VIEW3D': [], # Background Images
'OUTLINER_OB_CAMERA': [], # Background Images in Cameras
'OUTLINER_OB_EMPTY': [], # Empty type Image
'NODETREE': [], # Compositor
}
libraries = [] # Libraries x type
......@@ -632,6 +633,7 @@ class AMTH_SCENE_OT_list_users_for_x(Operator):
if name not in AMTH_store_data.users['MATERIAL']:
AMTH_store_data.users['MATERIAL'].append(name)
# Check Lights
for la in d.lights:
# Cycles
......@@ -643,6 +645,7 @@ class AMTH_SCENE_OT_list_users_for_x(Operator):
no.image and no.image.name == x:
if la.name not in AMTH_store_data.users['LIGHT']:
AMTH_store_data.users['LIGHT'].append(la.name)
# Check World
for wo in d.worlds:
# Cycles
......@@ -654,6 +657,7 @@ class AMTH_SCENE_OT_list_users_for_x(Operator):
no.image and no.image.name == x:
if wo.name not in AMTH_store_data.users['WORLD']:
AMTH_store_data.users['WORLD'].append(wo.name)
# Check Textures
for te in d.textures:
if te and te.type == 'IMAGE' and te.image:
......@@ -662,6 +666,7 @@ class AMTH_SCENE_OT_list_users_for_x(Operator):
if name == x and \
name not in AMTH_store_data.users['TEXTURE']:
AMTH_store_data.users['TEXTURE'].append(te.name)
# Check Modifiers in Objects
for ob in d.objects:
for mo in ob.modifiers:
......@@ -672,21 +677,31 @@ class AMTH_SCENE_OT_list_users_for_x(Operator):
name = '"{0}" modifier in {1}'.format(mo.name, ob.name)
if name not in AMTH_store_data.users['MODIFIER']:
AMTH_store_data.users['MODIFIER'].append(name)
# Check Background Images in Viewports
for scr in d.screens:
for ar in scr.areas:
if ar.type == 'VIEW_3D':
if ar.spaces and \
ar.spaces.active and \
ar.spaces.active.background_images:
for bg in ar.spaces.active.background_images:
image = bg.image
if bg and image and image.name == x:
name = 'Background for 3D Viewport in Screen "{0}"'\
.format(scr.name)
if name not in AMTH_store_data.users['VIEW3D']:
AMTH_store_data.users['VIEW3D'].append(name)
# Check Background Images in Cameras
for ob in d.objects:
if ob and ob.type == 'CAMERA' and ob.data.background_images:
for bg in ob.data.background_images:
image = bg.image
if bg and image and image.name == x:
name = 'Used as background for Camera "{0}"'\
.format(ob.name)
if name not in AMTH_store_data.users['OUTLINER_OB_CAMERA']:
AMTH_store_data.users['OUTLINER_OB_CAMERA'].append(name)
# Check Empties type Image
for ob in d.objects:
if ob and ob.type == 'EMPTY' and ob.image_user:
if ob.image_user.id_data.data:
image = ob.image_user.id_data.data
if image and image.name == x:
name = 'Used in Empty "{0}"'\
.format(ob.name)
if name not in AMTH_store_data.users['OUTLINER_OB_EMPTY']:
AMTH_store_data.users['OUTLINER_OB_EMPTY'].append(name)
# Check the Compositor
for sce in d.scenes:
if sce.node_tree and sce.node_tree.nodes:
......
......@@ -19,6 +19,10 @@ class AMTH_FILE_PT_libraries(bpy.types.Panel):
bl_category = "Bookmarks"
bl_label = "Libraries"
@classmethod
def poll(cls, context):
return context.area.ui_type == 'FILES'
def draw(self, context):
layout = self.layout
......
......@@ -13,6 +13,23 @@ import bpy
KEYMAPS = list()
def check_for_unsaved_images(self):
im_unsaved = []
for im in bpy.data.images:
if im.is_dirty:
im_unsaved.append(im.name)
if im_unsaved:
report_text = 'There are unsaved changes in {0} image(s), check console for details.'\
.format(len(im_unsaved))
self.report({"WARNING"}, report_text)
print("\nAmaranth found unsaved images when trying to save and reload.")
for im in im_unsaved:
print('* Image: "' + im + '" has unsaved changes.')
return True
return
class AMTH_WM_OT_save_reload(bpy.types.Operator):
"""Save and Reload the current blend file"""
......@@ -23,6 +40,10 @@ class AMTH_WM_OT_save_reload(bpy.types.Operator):
if not path:
bpy.ops.wm.save_as_mainfile("INVOKE_AREA")
return
if check_for_unsaved_images(self):
return
bpy.ops.wm.save_mainfile()
self.report({"INFO"}, "Saved & Reloaded")
bpy.ops.wm.open_mainfile("EXEC_DEFAULT", filepath=path)
......
# SPDX-License-Identifier: GPL-2.0-or-later
# ##### BEGIN AUTOGENERATED I18N SECTION #####
# NOTE: You can safely move around this auto-generated block (with the begin/end markers!),
# and edit the translations by hand.
# Just carefully respect the format of the tuple!
# Tuple of tuples:
# ((msgctxt, msgid), (sources, gen_comments), (lang, translation, (is_fuzzy, comments)), ...)
translations_tuple = (
(("*", ""),
((), ()),
("fr_FR", "Project-Id-Version: AnimAll 0.9.6 (0)\n",
(False,
("Blender's translation file (po format).",
"Copyright (C) 2022 The Blender Foundation.",
"This file is distributed under the same license as the Blender package.",
"Damien Picard <dam.pic@free.fr>, 2022."))),
),
(("*", "Tab Category"),
(("bpy.types.AnimallAddonPreferences.category",),
()),
("fr_FR", "Catégorie d’onglet",
(False, ())),
),
(("*", "Choose a name for the category of the panel"),
(("bpy.types.AnimallAddonPreferences.category",),
()),
("fr_FR", "Choisir un nom pour la catégorie du panneau",
(False, ())),
),
(("Operator", "Insert Key"),
(("bpy.types.ANIM_OT_insert_keyframe_animall",
"bpy.types.ANIM_OT_insert_keyframe_animall"),
()),
("fr_FR", "Insérer une clé",
(False, ())),
),
(("Operator", "Clear Animation"),
(("bpy.types.ANIM_OT_clear_animation_animall",),
()),
("fr_FR", "Effacer l’animation",
(False, ())),
),
(("*", "Delete all keyframes for this object\nIf in a specific case it doesn't work\ntry to delete the keys manually"),
(("bpy.types.ANIM_OT_clear_animation_animall",),
()),
("fr_FR", "Supprimer toutes les images clés pour cet objet.\n"
"En cas d’échec, essayez de les supprimer manuellement",
(False, ())),
),
(("*", "Insert a Keyframe"),
(("bpy.types.ANIM_OT_insert_keyframe_animall",),
()),
("fr_FR", "Insérer une image clé",
(False, ())),
),
(("Operator", "Delete Key"),
(("bpy.types.ANIM_OT_delete_keyframe_animall",),
()),
("fr_FR", "Supprimer image clé",
(False, ())),
),
(("*", "Delete a Keyframe"),
(("bpy.types.ANIM_OT_delete_keyframe_animall",),
()),
("fr_FR", "Supprimer une image clé",
(False, ())),
),
(("*", "Animate"),
(("bpy.types.VIEW3D_PT_animall",),
()),
("fr_FR", "Animer",
(False, ())),
),
(("*", "Insert keyframes on active attribute values"),
(("bpy.types.AnimallProperties.key_attribute",),
()),
("fr_FR", "Insérer des clés sur l’attribut actif",
(False, ())),
),
(("*", "Insert keyframes on edge bevel weight"),
(("bpy.types.AnimallProperties.key_edge_bevel",),
()),
("fr_FR", "Insérer des clés sur les poids de biseau d’arête",
(False, ())),
),
(("*", "Insert keyframes on edge creases"),
(("bpy.types.AnimallProperties.key_edge_crease",),
()),
("fr_FR", "Insérer des clés sur les plis d’arête",
(False, ())),
),
(("*", "Insert keyframes on face material indices"),
(("bpy.types.AnimallProperties.key_material_index",),
()),
("fr_FR", "Insérer des clés sur les indices de matériaux",
(False, ())),
),
(("*", "Insert keyframes on point locations"),
(("bpy.types.AnimallProperties.key_point_location",),
()),
("fr_FR", "Insérer des clés sur les positions des points",
(False, ())),
),
(("*", "Insert keyframes on point radius (Shrink/Fatten)"),
(("bpy.types.AnimallProperties.key_radius",),
()),
("fr_FR", "Insérer des clés sur le rayon de rayon de point (épaisseur de la courbe)",
(False, ())),
),
(("*", "Key Selected Only"),
(("bpy.types.AnimallProperties.key_selected",),
()),
("fr_FR", "Sélection uniquement",
(False, ())),
),
(("*", "Insert keyframes only on selected elements"),
(("bpy.types.AnimallProperties.key_selected",),
()),
("fr_FR", "Insérer des images clés seulement sur les éléments sélectionnés",
(False, ())),
),
(("*", "Insert keyframes on active Shape Key layer"),
(("bpy.types.AnimallProperties.key_shape_key",),
()),
("fr_FR", "Insérer des clés sur le calque de clé de forme actif",
(False, ())),
),
(("*", "Insert keyframes on point tilt"),
(("bpy.types.AnimallProperties.key_tilt",),
()),
("fr_FR", "Insérer des clés sur l’inclinaison des points",
(False, ())),
),
(("*", "Insert keyframes on active UV coordinates"),
(("bpy.types.AnimallProperties.key_uvs",),
()),
("fr_FR", "Insérer des clés sur les coordonnées UV actives",
(False, ())),
),
(("*", "Insert keyframes on vertex bevel weight"),
(("bpy.types.AnimallProperties.key_vertex_bevel",),
()),
("fr_FR", "Insérer des clés sur les poids de biseau des sommets",
(False, ())),
),
(("*", "Insert keyframes on active vertex group values"),
(("bpy.types.AnimallProperties.key_vertex_group",),
()),
("fr_FR", "Insérer des clés sur les valeurs des groupes de sommets",
(False, ())),
),
(("*", "AnimAll"),
(("scripts/addons/animation_animall/__init__.py:138",
"Add-on AnimAll info: name"),
()),
("fr_FR", "AnimAll",
(False, ())),
),
(("*", "Key:"),
(("scripts/addons/animation_animall/__init__.py:146",),
()),
("fr_FR", "Insérer :",
(False, ())),
),
(("*", "Tab Category:"),
(("scripts/addons/animation_animall/__init__.py:653",),
()),
("fr_FR", "Catégorie d’onglet :",
(False, ())),
),
(("*", "Points"),
(("scripts/addons/animation_animall/__init__.py:152",
"scripts/addons/animation_animall/__init__.py:159",
"scripts/addons/animation_animall/__init__.py:188"),
()),
("fr_FR", "Points",
(False, ())),
),
(("*", "Others"),
(("scripts/addons/animation_animall/__init__.py:155",
"scripts/addons/animation_animall/__init__.py:171",
"scripts/addons/animation_animall/__init__.py:196"),
()),
("fr_FR", "Autres",
(False, ())),
),
(("*", "Bevel"),
(("scripts/addons/animation_animall/__init__.py:161",
"scripts/addons/animation_animall/__init__.py:165"),
()),
("fr_FR", "Biseau",
(False, ())),
),
(("*", "Edges"),
(("scripts/addons/animation_animall/__init__.py:164",),
()),
("fr_FR", "Arêtes",
(False, ())),
),
(("*", "Crease"),
(("scripts/addons/animation_animall/__init__.py:166",),
()),
("fr_FR", "Plis",
(False, ())),
),
(("*", "Faces"),
(("scripts/addons/animation_animall/__init__.py:168",),
()),
("fr_FR", "Faces",
(False, ())),
),
(("*", "\"Location\" and \"Shape Key\" are redundant?"),
(("scripts/addons/animation_animall/__init__.py:218",),
()),
("fr_FR", "\"Position\" et \"Clé de forme\" sont redondants ?",
(False, ())),
),
(("*", "Splines"),
(("scripts/addons/animation_animall/__init__.py:193",),
()),
("fr_FR", "Splines",
(False, ())),
),
(("*", "Maybe set \"%s\" to 1.0?"),
(("scripts/addons/animation_animall/__init__.py:209",
"scripts/addons/animation_animall/__init__.py:209"),
()),
("fr_FR", "Essayez de mettre « %s » à 1.0 ?",
(False, ())),
),
(("*", "Cannot key on Basis Shape"),
(("scripts/addons/animation_animall/__init__.py:212",),
()),
("fr_FR", "Impossible d’ajouter une clé sur la forme de base",
(False, ())),
),
(("*", "No active Shape Key"),
(("scripts/addons/animation_animall/__init__.py:215",),
()),
("fr_FR", "Pas de clé de forme active",
(False, ())),
),
(("*", "Clear Animation could not be performed"),
(("scripts/addons/animation_animall/__init__.py:581",),
()),
("fr_FR", "La suppression de l’animation n’a pas pu aboutir",
(False, ())),
),
(("*", "Object includes old-style vertex colors. Consider updating them."),
(("scripts/addons/animation_animall/__init__.py:182",),
()),
("fr_FR", "L’objet contient des couleurs de sommets à l’ancien format. Veuillez les mettre à jour",
(False, ())),
),
(("*", "Vertex %s"),
(("scripts/addons/animation_animall/__init__.py:358",
"scripts/addons/animation_animall/__init__.py:313",
"scripts/addons/animation_animall/__init__.py:318",
"scripts/addons/animation_animall/__init__.py:328"),
()),
("fr_FR", "Sommet %s",
(False, ())),
),
(("*", "Edge %s"),
(("scripts/addons/animation_animall/__init__.py:360",
"scripts/addons/animation_animall/__init__.py:333",
"scripts/addons/animation_animall/__init__.py:338"),
()),
("fr_FR", "Arête %s",
(False, ())),
),
(("*", "Point %s"),
(("scripts/addons/animation_animall/__init__.py:265",),
()),
("fr_FR", "Point %s",
(False, ())),
),
(("*", "Spline %s"),
(("scripts/addons/animation_animall/__init__.py:273",),
()),
("fr_FR", "Spline %s",
(False, ())),
),
(("*", "Face %s"),
(("scripts/addons/animation_animall/__init__.py:343",
"scripts/addons/animation_animall/__init__.py:362"),
()),
("fr_FR", "Face %s",
(False, ())),
),
(("*", "%s Point %s"),
(("scripts/addons/animation_animall/__init__.py:260",),
()),
("fr_FR", "%s Point %s",
(False, ())),
),
(("*", "Loop %s"),
(("scripts/addons/animation_animall/__init__.py:364",),
()),
("fr_FR", "Boucle %s",
(False, ())),
),
(("*", "UV layer %s"),
(("scripts/addons/animation_animall/__init__.py:379",),
()),
("fr_FR", "Calque UV %s",
(False, ())),
),
(("*", "%s Vertex %s"),
(("scripts/addons/animation_animall/__init__.py:386",),
()),
("fr_FR", "%s Sommet %s",