@@ -1,4 +1,6 @@
# GPL # "author": "Kayo Phoenix"
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: Kayo Phoenix

import bpy
from bpy_extras import object_utils
@@ -272,9 +274,14 @@ def poll(cls, context):
return context.scene is not None

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('HoneyComb' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('HoneyComb' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -310,10 +317,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def HoneyCombParameters():
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2015 sugiany
# This file is distributed under the MIT License. See the LICENSE.md for more details.
# SPDX-License-Identifier: MIT
# Copyright 2015 Sugiany

import bpy

@@ -1,4 +1,6 @@
# GPL # "author": "Buerbaum Martin (Pontiac)"
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: Buerbaum Martin (Pontiac)

import bpy, bmesh
from math import sin, cos, tan, pi, radians
@@ -169,6 +171,10 @@ def draw(self, context):
box.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

radius = self.radius
div = self.div

@@ -226,7 +232,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
('ElbowJoint' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('ElbowJoint' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -255,10 +262,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}


@@ -360,6 +374,10 @@ def draw(self, context):
box.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

radius = self.radius
div = self.div

@@ -481,7 +499,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
('TeeJoint' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('TeeJoint' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -510,10 +529,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def WyeJointParameters():
@@ -622,6 +648,10 @@ def draw(self, context):
box.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

radius = self.radius
div = self.div

@@ -753,7 +783,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
('WyeJoint' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('WyeJoint' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -782,10 +813,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}


@@ -911,6 +949,10 @@ def draw(self, context):
box.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

radius = self.radius
div = self.div

@@ -1089,7 +1131,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
('CrossJoint' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('CrossJoint' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -1118,10 +1161,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}


@@ -1198,6 +1248,10 @@ def draw(self, context):
box.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

radius = self.radius
div = self.div
number = self.number
@@ -1322,7 +1376,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if (context.selected_objects != []) and context.active_object and \
('NJoint' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('NJoint' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -1349,8 +1404,15 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}
@@ -1,4 +1,6 @@
# GPL # "author": "Phil Cote, cotejrp1, (http://www.blenderaddons.com)"
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: Phil Cote, cotejrp1, (http://www.blenderaddons.com)

import bpy
import bmesh
@@ -162,10 +164,14 @@ def draw(self, context):
col.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('Pyramid' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('Pyramid' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -191,10 +197,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def PyramidParameters():
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

# Paul "BrikBot" Marshall
# Created: July 1, 2011
# Last Modified: September 26, 2013
@@ -8,29 +10,6 @@
#
# Coded in IDLE, tested in Blender 2.68a. NumPy Recommended.
# Search for "@todo" to quickly find sections that need work.
#
# ##### BEGIN GPL LICENSE BLOCK #####
#
# The Blender Rock Creation tool is for rapid generation of
# mesh rocks in Blender.
# Copyright (C) 2011 Paul Marshall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ##### END GPL LICENSE BLOCK #####

# <pep8 compliant>

bl_info = {
"name": "Rock Generator",
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

# This try block allows for the script to psudo-intelligently select the
# appropriate random to use. If Numpy's random is present it will use that.
# If Numpy's random is not present, it will through a "module not found"
@@ -26,7 +28,7 @@ def randomizeTexture(texture, level=1):
param: texture - bpy.data.texture to modify.
level - designated tweaked settings to use
-> Below 10 is a displacment texture
-> Below 10 is a displacement texture
-> Between 10 and 20 is a base material texture
'''
noises = ['BLENDER_ORIGINAL', 'ORIGINAL_PERLIN', 'IMPROVED_PERLIN',
@@ -133,7 +135,7 @@ def randomizeTexture(texture, level=1):
elif texture.type == 'VORONOI':
metrics = ['DISTANCE', 'DISTANCE_SQUARED', 'MANHATTAN', 'CHEBYCHEV',
'MINKOVSKY_HALF', 'MINKOVSKY_FOUR', 'MINKOVSKY']
# Settings for first dispalcement level:
# Settings for first displacement level:
if level == 0:
tempInt = randint(0, 1)
texture.distance_metric = metrics[tempInt]
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

# Blender rock creation tool
#
# Based on BlenderGuru's asteroid tutorial and personal experimentation.
@@ -84,31 +86,9 @@
# Coded in IDLE, tested in Blender 2.59. NumPy Recommended.
# Search for "@todo" to quickly find sections that need work.
#
# Remeber -
# Remember -
# Functional code comes before fast code. Once it works, then worry about
# making it faster/more efficient.
#
# ##### BEGIN GPL LICENSE BLOCK #####
#
# The Blender Rock Creation tool is for rapid generation of mesh rocks.
# Copyright (C) 2011 Paul Marshall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ##### END GPL LICENSE BLOCK #####

# <pep8 compliant>

import bpy
import time
@@ -174,6 +154,9 @@ def createMeshObject(context, verts, edges, faces, name):
# Update mesh geometry after adding stuff.
mesh.update()

if bpy.context.mode == "EDIT_MESH":
bpy.ops.object.mode_set(mode='OBJECT')

return object_utils.object_data_add(context, mesh, operator=None)


@@ -749,7 +732,7 @@ def generateRocks(context, scaleX, skewX, scaleY, skewY, scaleZ, skewZ,
scale_fac, detail, display_detail, deform, rough,
smooth_fac, smooth_it,
numOfRocks=1, userSeed=1.0,
scaleDisplace=False, randomSeed=True):
scaleDisplace=False, randomSeed=True, use_enter_edit_mode=False):
global LASTROCK
sigmaX = 0
sigmaY = 0
@@ -790,7 +773,7 @@ def generateRocks(context, scaleX, skewX, scaleY, skewY, scaleZ, skewZ,
# sigma is the standard deviation of the values. The 95% interval is three
# standard deviations, which is what we want most generated values to fall
# in. Since it might be skewed we are going to use half the difference
# betwee the mean and the furthest bound and scale the other side down
# between the mean and the furthest bound and scale the other side down
# post-number generation.
if scaleX[0] != scaleX[1]:
skewX = (skewX + 1) / 2
@@ -823,8 +806,10 @@ def generateRocks(context, scaleX, skewX, scaleY, skewY, scaleZ, skewZ,
else:
muZ = scaleZ

rocks = []

for i in range(numOfRocks):
# todo: enable different random values for each (x,y,z) corrdinate for
# todo: enable different random values for each (x,y,z) coordinate for
# each vertex. This will add additional randomness to the shape of the
# generated rocks.
# *** todo completed 4/19/2011 ***
@@ -895,7 +880,7 @@ def generateRocks(context, scaleX, skewX, scaleY, skewY, scaleZ, skewZ,
rock.modifiers.new(name="Smooth", type='SMOOTH')
rock.modifiers[6].factor = gauss(smooth_fac, (smooth_fac ** 0.5) / 12)
rock.modifiers[6].iterations = smooth_it
# Make a call to random to keep things consistant:
# Make a call to random to keep things consistent:
else:
gauss(0, 1)

@@ -928,13 +913,20 @@ def generateRocks(context, scaleX, skewX, scaleY, skewY, scaleZ, skewZ,
bpy.ops.mesh.normals_make_consistent()
bpy.ops.object.editmode_toggle()

if use_enter_edit_mode:
for m in rock.modifiers:
m.show_in_editmode = True
m.show_on_cage = True

# Store the last value of i:
shift = i

rocks.append(rock)

# Add the shift to LASTROCK:
LASTROCK += shift + 1

return
return rocks


# Much of the code below is more-or-less imitation of other addons and as such
@@ -1009,7 +1001,7 @@ class OBJECT_OT_add_mesh_rock(bpy.types.Operator):
min=-1.0, max=1.0, default=defaults[6])
use_scale_dis: BoolProperty(
name="Scale displace textures",
description="Scale displacement textures with dimensions. May cause streched textures",
description="Scale displacement textures with dimensions. May cause stretched textures",
default=defaults[7])
scale_fac: FloatVectorProperty(
name="Scaling Factor",
@@ -1087,12 +1079,10 @@ def draw(self, context):
box.prop(self, 'user_seed')
box.prop(self, 'preset_values')

@classmethod
def poll(cls, context):
return context.mode == 'OBJECT'
# return (context.object is not None and context.object.mode == 'OBJECT')

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

# The following "if" block loads preset values:
if self.lastPreset != int(self.preset_values):
@@ -1120,7 +1110,7 @@ def execute(self, context):
# *** Eliminated "deform_Var" and "rough_Var" so the script is not
# as complex to use. May add in again as advanced features. ***
if self.use_generate:
generateRocks(context,
rocks = generateRocks(context,
self.scale_X,
self.skew_X,
self.scale_Y,
@@ -1137,10 +1127,19 @@ def execute(self, context):
self.num_of_rocks,
self.user_seed,
self.use_scale_dis,
self.use_random_seed)
self.use_random_seed,
use_enter_edit_mode)

return {'FINISHED'}
for rock in rocks:
rock.select_set(True)

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

# Register:
def menu_func_rocks(self, context):
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

# Paul "BrikBot" Marshall
# Created: July 1, 2011
# Last Modified: November 17, 2011
@@ -8,29 +10,6 @@
#
# Coded in IDLE, tested in Blender 2.59. NumPy Recommended.
# Search for "@todo" to quickly find sections that need work.
#
# ##### BEGIN GPL LICENSE BLOCK #####
#
# The Blender Rock Creation tool is for rapid generation of
# mesh rocks in Blender.
# Copyright (C) 2011 Paul Marshall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ##### END GPL LICENSE BLOCK #####

# <pep8 compliant>

import inspect
import shutil
@@ -1,27 +1,6 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# The Blender Rock Creation tool is for rapid generation of mesh rocks.
# Copyright (C) 2011 Paul Marshall
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ##### END GPL LICENSE BLOCK #####

# <pep8 compliant>

# SPDX-License-Identifier: GPL-2.0-or-later

# Converts a formated string to a float tuple:
# Converts a formatted string to a float tuple:
# IN - '(0.5, 0.2)' -> CONVERT -> OUT - (0.5, 0.2)
def toTuple(stringIn):
sTemp = str(stringIn)[1:len(str(stringIn)) - 1].split(', ')
@@ -31,7 +10,7 @@ def toTuple(stringIn):
return tuple(fTemp)


# Converts a formated string to a float tuple:
# Converts a formatted string to a float tuple:
# IN - '[0.5, 0.2]' -> CONVERT -> OUT - [0.5, 0.2]
def toList(stringIn):
sTemp = str(stringIn)[1:len(str(stringIn)) - 1].split(', ')
@@ -93,11 +72,11 @@ def smooth(mesh):
# from random import weibullvariate as weibull
print("Rock Generator: Numpy not found. Using Python's random.")
numpy = False
# Artifically skews a normal (gaussian) distribution. This will not create
# Artificially skews a normal (gaussian) distribution. This will not create
# a continuous distribution curve but instead acts as a piecewise finction.
# This linearly scales the output on one side to fit the bounds.
#
# Example output historgrams:
# Example output histograms:
#
# Upper skewed: Lower skewed:
# | â–„ | _
@@ -113,7 +92,7 @@ def smooth(mesh):
# | _▄_ ▄███████████████▄_ | _▄███████████████▄▄_
# ------------------------- -----------------------
# |mu |mu
# Historgrams were generated in R (http://www.r-project.org/) based on the
# Histograms were generated in R (http://www.r-project.org/) based on the
# calculations below and manually duplicated here.
#
# param: mu - mu is the mean of the distribution.
@@ -1,4 +1,5 @@
# GPL "author": "Dominic Kröper, (dommetysk)"
# SPDX-License-Identifier: GPL-2.0-or-later
# Author: Dominic Kröper, (dommetysk)

import bpy
from math import (
@@ -298,7 +299,7 @@ def addBrilliant(context, self, s, table_w, crown_h, girdle_t, pavi_d, bezel_f,
bpy.context.tool_settings.mesh_select_mode = sel_mode
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)

bpy.ops.object.modifier_apply(apply_as='DATA', modifier="EdgeSplit")
bpy.ops.object.modifier_apply(modifier="EdgeSplit")

return dobj

@@ -422,10 +423,14 @@ def draw(self, context):

# call mesh/object generator function with user inputs
def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('Brilliant' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('Brilliant' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -462,10 +467,17 @@ def execute(self, context):
)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def BrilliantParameters():
@@ -1,4 +1,6 @@
# GPL # Author: Alain Ducharme (phymec)
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: Alain Ducharme (phymec)

import bpy
from bpy_extras import object_utils
@@ -388,6 +390,10 @@ class AddRoundCube(Operator, object_utils.AddObjectHelper):
)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

if self.arc_div <= 0 and self.lin_div <= 0:
self.report({'ERROR'},
"Either Arc Divisions or Linear Divisions must be greater than zero")
@@ -401,7 +407,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('Roundcube' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('Roundcube' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -437,10 +444,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def check(self, context):
@@ -1,4 +1,6 @@
# GPL # "author": "DreamPainter"
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: DreamPainter

import bpy
from math import sqrt
@@ -1,4 +1,6 @@
# GPL Original by Fourmadmen
# SPDX-License-Identifier: GPL-2.0-or-later

# Original by Fourmadmen

import bpy
from mathutils import (
@@ -202,9 +204,14 @@ def draw(self, context):
col.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('Star' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('Star' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -252,10 +259,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def StarParameters():
@@ -1,4 +1,6 @@
# GPL # "author": "DreamPainter"
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: DreamPainter

import bpy
from bpy.props import (
@@ -97,7 +99,7 @@ def supertoroid(R, r, u, v, n1, n2):
# x = (cos(theta) ** n1)*(R + r * (cos(phi) ** n2))
# y = (sin(theta) ** n1)*(R + r * (cos(phi) ** n2))
# z = (r * sin(phi) ** n2)
# with theta and phi rangeing from 0 to 2pi
# with theta and phi ranging from 0 to 2pi

for i in range(u):
s = power(sin(i * a), n1)
@@ -199,6 +201,10 @@ def draw(self, context):
col.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

props = self.properties

# check how the radii properties must be used
@@ -219,7 +225,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('SuperToroid' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('SuperToroid' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -270,10 +277,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def SuperToroidParameters():
@@ -1,4 +1,6 @@
# GPL # Author, Anthony D'Agostino
# SPDX-License-Identifier: GPL-2.0-or-later

# Author, Anthony D'Agostino

import bpy
from bpy.props import (
@@ -9,9 +11,10 @@
import io
import operator
import functools
from bpy_extras import object_utils


class AddTeapot(bpy.types.Operator):
class AddTeapot(bpy.types.Operator, object_utils.AddObjectHelper):
bl_idname = "mesh.primitive_teapot_add"
bl_label = "Add Teapot"
bl_description = "Construct a teapot or teaspoon mesh"
@@ -31,16 +34,42 @@ class AddTeapot(bpy.types.Operator):
default='1',
)

def draw(self, context):
layout = self.layout

box = layout.box()
box.prop(self, 'resolution')

box = layout.box()
box.prop(self, 'objecttype')

# generic transform props
box = layout.box()
box.prop(self, 'align', expand=True)
box.prop(self, 'location', expand=True)
box.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

cmode = bpy.context.mode
verts, faces = make_teapot(self.objecttype,
self.resolution)
# Actually create the mesh object from this geometry data.
obj = create_mesh_object(context, verts, [], faces, "Teapot")
obj = create_mesh_object(self, context, verts, [], faces, "Teapot")
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.remove_doubles()
if cmode != "EDIT_MESH":
bpy.ops.object.mode_set(mode=cmode)

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}


@@ -56,7 +85,7 @@ def create_mesh_face_hack(faces):
faces[:] = faces_copy


def create_mesh_object(context, verts, edges, faces, name):
def create_mesh_object(self, context, verts, edges, faces, name):

create_mesh_face_hack(faces)

@@ -66,8 +95,8 @@ def create_mesh_object(context, verts, edges, faces, name):
mesh.from_pydata(verts, edges, faces)
# Update mesh geometry after adding stuff.
mesh.update()
from bpy_extras import object_utils
return object_utils.object_data_add(context, mesh, operator=None)

return object_utils.object_data_add(context, mesh, operator=self)


# ==========================
@@ -1,4 +1,6 @@
# GPL # Author, Anthony D'Agostino
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: Anthony D'Agostino

import bpy
from mathutils import Vector
@@ -138,9 +140,14 @@ def draw(self, context):
col.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('TorusKnot' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('TorusKnot' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -173,10 +180,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def TorusKnotParameters():
@@ -1,4 +1,5 @@
# GPL # "author": Sjaak-de-Draak
# SPDX-License-Identifier: GPL-2.0-or-later
# Author: Sjaak-de-Draak

bl_info = {
"name": "Triangles",
@@ -1,4 +1,6 @@
# GPL # "author": Paulo_Gomes
# SPDX-License-Identifier: GPL-2.0-or-later

# Author: Paulo_Gomes

import bpy
from mathutils import Quaternion, Vector
@@ -225,6 +227,9 @@ def draw(self, context):
col.prop(self, 'rotation', expand=True)

def execute(self, context):
# turn off 'Enter Edit Mode'
use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode
bpy.context.preferences.edit.use_enter_edit_mode = False

if self.use_abso is True:
extra_helper = (self.abso_major_rad - self.abso_minor_rad) * 0.5
@@ -233,7 +238,8 @@ def execute(self, context):

if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('TwistedTorus' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and ('TwistedTorus' in context.active_object.data.keys()) and \
(self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -284,10 +290,17 @@ def execute(self, context):
obj = object_utils.object_data_add(context, mesh, operator=self)
obj.select_set(True)
active_object.select_set(True)
bpy.context.view_layer.objects.active = active_object
bpy.ops.object.join()
context.active_object.name = name_active_object
bpy.ops.object.mode_set(mode='EDIT')

if use_enter_edit_mode:
bpy.ops.object.mode_set(mode = 'EDIT')

# restore pre operator state
bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode

return {'FINISHED'}

def TwistedTorusParameters():
@@ -1,4 +1,6 @@
# GPL # Originals by meta-androcto, Pablo Vazquez, Liero, Richard Wilks
# SPDX-License-Identifier: GPL-2.0-or-later

# Originals by meta-androcto, Pablo Vazquez, Liero, Richard Wilks

import bpy
from bpy.types import Operator
@@ -1,20 +1,5 @@
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# SPDX-License-Identifier: GPL-2.0-or-later

# Contributed to by PKHG, Meta Androcto, Noctumsolis, Lijenstina,
# Spivak Vladimir (cwolf3d)
# Origunally an addon by Andy Houston
@@ -54,7 +39,7 @@ def Geodesic_contex_menu(self, context):
obj = context.object
layout = self.layout

if 'GeodesicDome' in obj.data.keys():
if obj.data is not None and 'GeodesicDome' in obj.data.keys():
props = layout.operator("mesh.generate_geodesic_dome", text="Change Geodesic Dome")
props.change = True
for prm in third_domes_panel_271.GeodesicDomeParameters():
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

import bpy
import mathutils

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

from math import sin, cos, sqrt
from .vefm_271 import *

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

from .vefm_271 import mesh, vertex, edge, face
from math import pi, acos, sin, cos, atan, tan, fabs, sqrt

@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

import bpy
import os
from . import vefm_271
@@ -1293,7 +1295,8 @@ def execute(self, context):
if mesh != None:
if bpy.context.mode == "OBJECT":
if context.selected_objects != [] and context.active_object and \
('GeodesicDome' in context.active_object.data.keys()) and (self.change == True):
(context.active_object.data is not None) and \
('GeodesicDome' in context.active_object.data.keys()) and (self.change == True):
obj = context.active_object
oldmesh = obj.data
oldmeshname = obj.data.name
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

# vert class and overloading experiments
import bpy
# PKHG>NEEDED?
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Amaranth
@@ -53,8 +41,6 @@
simplify_nodes,
node_stats,
normal_node,
switch_material,
node_shader_extra,
)

from amaranth.render import (
@@ -86,12 +72,12 @@
bl_info = {
"name": "Amaranth Toolset",
"author": "Pablo Vazquez, Bassam Kurdali, Sergey Sharybin, Lukas Tönne, Cesar Saez, CansecoGPC",
"version": (1, 0, 8),
"blender": (2, 81, 0),
"version": (1, 0, 17),
"blender": (3, 2, 0),
"location": "Everywhere!",
"description": "A collection of tools and settings to improve productivity",
"warning": "",
"doc_url": "https://pablovazquez.art/amaranth",
"doc_url": "{BLENDER_MANUAL_URL}/addons/interface/amaranth.html",
"tracker_url": "https://developer.blender.org/maniphest/task/edit/form/2/",
"category": "Interface",
}
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Current Frame Slider
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Jump X Frames on Shift Up/Down
@@ -28,7 +16,7 @@
"""

import bpy
from bpy.types import Operator
from bpy.types import Operator, Panel
from bpy.props import BoolProperty

KEYMAPS = list()
@@ -141,40 +129,35 @@ def execute(self, context):
return {"FINISHED"}


def ui_userpreferences_edit(self, context):
get_addon = "amaranth" in context.preferences.addons.keys()
if not get_addon:
return
class AMTH_USERPREF_PT_animation(Panel):
bl_space_type = 'PREFERENCES'
bl_region_type = 'WINDOW'
bl_label = "Jump Keyframes"
bl_parent_id = "USERPREF_PT_animation_keyframes"

preferences = context.preferences.addons["amaranth"].preferences

col = self.layout.column()
split = col.split(factor=0.21)
split.prop(preferences, "frames_jump",
text="Frames to Jump")


def label(self, context):
get_addon = "amaranth" in context.preferences.addons.keys()
if not get_addon:
return
def draw(self, context):
preferences = context.preferences.addons["amaranth"].preferences

layout = self.layout
layout = self.layout

if context.preferences.addons["amaranth"].preferences.use_timeline_extra_info:
row = layout.row(align=True)
col = layout.column()
row = col.row()
row.label(text="Frames to Jump")
row.prop(preferences, "frames_jump", text="")

col = layout.column()
row = col.row()
row.label(text="Jump Operators")
row.operator(AMTH_SCREEN_OT_keyframe_jump_inbetween.bl_idname,
icon="PREV_KEYFRAME", text="").backwards = True
icon="PREV_KEYFRAME", text="Jump to Previous").backwards = True
row.operator(AMTH_SCREEN_OT_keyframe_jump_inbetween.bl_idname,
icon="NEXT_KEYFRAME", text="").backwards = False
icon="NEXT_KEYFRAME", text="Jump to Next").backwards = False


def register():
bpy.utils.register_class(AMTH_USERPREF_PT_animation)
bpy.utils.register_class(AMTH_SCREEN_OT_frame_jump)
bpy.utils.register_class(AMTH_SCREEN_OT_keyframe_jump_inbetween)
bpy.types.USERPREF_PT_animation_timeline.append(ui_userpreferences_edit)
bpy.types.USERPREF_PT_animation_timeline.append(label)

# register keyboard shortcuts
wm = bpy.context.window_manager
@@ -201,9 +184,10 @@ def register():


def unregister():
bpy.utils.unregister_class(AMTH_USERPREF_PT_animation)
bpy.utils.unregister_class(AMTH_SCREEN_OT_frame_jump)
bpy.utils.unregister_class(AMTH_SCREEN_OT_keyframe_jump_inbetween)
bpy.types.USERPREF_PT_animation_timeline.remove(ui_userpreferences_edit)

for km, kmi in KEYMAPS:
km.keymap_items.remove(kmi)
KEYMAPS.clear()
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Bone Motion Paths:
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Timeline Extra Info
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Color Management Presets
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Object ID for Dupli Groups
Say you have a linked character or asset, you can now set an Object ID for the
@@ -1,29 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Sequencer: Display Image File Name
@@ -1,19 +1,42 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later

import bpy

class AMTH_VIEW3D_PT_wire_toggle(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_category = "View"
bl_label = "Wireframes "
bl_parent_id = "VIEW3D_PT_view3d_properties"

def draw(self, context):
layout = self.layout

layout.use_property_split = True
layout.use_property_decorate = False # No animation.

scene = context.scene

row = layout.row(align=True)
row.operator(AMTH_OBJECT_OT_wire_toggle.bl_idname,
icon="MOD_WIREFRAME", text="Display").clear = False
row.operator(AMTH_OBJECT_OT_wire_toggle.bl_idname,
icon="X", text="Clear").clear = True

layout.separator()

col = layout.column(heading="Display", align=True)
col.prop(scene, "amth_wire_toggle_edges_all")
col.prop(scene, "amth_wire_toggle_optimal")

col = layout.column(heading="Apply to", align=True)
sub = col.row(align=True)
sub.active = not scene.amth_wire_toggle_scene_all
sub.prop(scene, "amth_wire_toggle_is_selected")
sub = col.row(align=True)
sub.active = not scene.amth_wire_toggle_is_selected
sub.prop(scene, "amth_wire_toggle_scene_all")


# FEATURE: Toggle Wire Display
class AMTH_OBJECT_OT_wire_toggle(bpy.types.Operator):
@@ -61,31 +84,6 @@ def execute(self, context):
return {"FINISHED"}


def ui_object_wire_toggle(self, context):

scene = context.scene

self.layout.separator()
col = self.layout.column(align=True)
col.label(text="Wireframes:")
row = col.row(align=True)
row.operator(AMTH_OBJECT_OT_wire_toggle.bl_idname,
icon="MOD_WIREFRAME", text="Display").clear = False
row.operator(AMTH_OBJECT_OT_wire_toggle.bl_idname,
icon="X", text="Clear").clear = True
col.separator()
row = col.row(align=True)
row.prop(scene, "amth_wire_toggle_edges_all")
row.prop(scene, "amth_wire_toggle_optimal")
row = col.row(align=True)
sub = row.row(align=True)
sub.active = not scene.amth_wire_toggle_scene_all
sub.prop(scene, "amth_wire_toggle_is_selected")
sub = row.row(align=True)
sub.active = not scene.amth_wire_toggle_is_selected
sub.prop(scene, "amth_wire_toggle_scene_all")


def init_properties():
scene = bpy.types.Scene
scene.amth_wire_toggle_scene_all = bpy.props.BoolProperty(
@@ -102,7 +100,7 @@ def init_properties():
description="Draw all the edges even on coplanar faces")
scene.amth_wire_toggle_optimal = bpy.props.BoolProperty(
default=False,
name="Subsurf Optimal Display",
name="Optimal Display Subdivision",
description="Skip drawing/rendering of interior subdivided edges "
"on meshes with Subdivision Surface modifier")

@@ -121,14 +119,21 @@ def clear_properties():

# //FEATURE: Toggle Wire Display

classes = (
AMTH_VIEW3D_PT_wire_toggle,
AMTH_OBJECT_OT_wire_toggle
)

def register():
init_properties()
bpy.utils.register_class(AMTH_OBJECT_OT_wire_toggle)
bpy.types.VIEW3D_PT_view3d_properties.append(ui_object_wire_toggle)

from bpy.utils import register_class
for cls in classes:
register_class(cls)

def unregister():
bpy.utils.unregister_class(AMTH_OBJECT_OT_wire_toggle)
bpy.types.VIEW3D_PT_view3d_properties.remove(ui_object_wire_toggle)
clear_properties()

from bpy.utils import unregister_class
for cls in classes:
unregister_class(cls)
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Symmetry Tools: Find Asymmetric + Make Symmetric (by Sergey Sharybin)
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Display Active Image Node on Image Editor
@@ -32,22 +20,27 @@
"CompositorNodeViewer",
"CompositorNodeComposite",
"ShaderNodeTexImage",
"ShaderNodeTexEnvironment")
"ShaderNodeTexEnvironment",
"GeometryNodeImageTexture")


class AMTH_NODE_OT_show_active_node_image(bpy.types.Operator):
"""Show active image node image in the image editor"""
bl_idname = "node.show_active_node_image"
bl_label = "Show Active Node Node"
bl_label = "Preview Image from Node"
bl_options = {"UNDO"}

@classmethod
def poll(cls, context):
return context.space_data == 'NODE_EDITOR' and context.active_node is not None

def execute(self, context):
return {'FINISHED'}

def invoke(self, context, event):
mlocx = event.mouse_region_x
mlocy = event.mouse_region_y
select_node = bpy.ops.node.select(mouse_x=mlocx, mouse_y=mlocy, extend=False)
select_node = bpy.ops.node.select(location=(mlocx, mlocy), extend=False)

if 'FINISHED' in select_node: # Only run if we're clicking on a node
get_addon = "amaranth" in context.preferences.addons.keys()
@@ -78,8 +71,17 @@ def invoke(self, context, event):
elif active_node.bl_idname in ["CompositorNodeComposite", "CompositorNodeRLayers"]:
space.image = bpy.data.images[
"Render Result"]
elif active_node.bl_idname == "GeometryNodeImageTexture":
if active_node.inputs['Image'].is_linked:
self.report({'INFO'}, "Previewing linked sockets is not supported yet")
break
if active_node.inputs['Image'].default_value:
space.image = active_node.inputs['Image'].default_value
elif active_node.image:
space.image = active_node.image
else:
self.report({'INFO'}, "No image detected")
break
break
else:
return {'CANCELLED'}
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later

"""
Object / Material Indices Panel

This file was deleted.

@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Nodes Stats
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Nodes: XYZ Sliders for Normal Node
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Nodes Simplify Panel [WIP Feature]

This file was deleted.

@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Node Templates - Vignette, Vector Blur
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later

import bpy
from mathutils import Vector
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later

import bpy
from mathutils import Vector
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later

import bpy
from bpy.props import (
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Set Camera Bounds as Render Border
@@ -30,7 +18,7 @@ class AMTH_VIEW3D_OT_render_border_camera(bpy.types.Operator):

@classmethod
def poll(cls, context):
return context.space_data.region_3d.view_perspective == "CAMERA"
return context.space_data == 'VIEW_3D' and context.space_data.region_3d.view_perspective == "CAMERA"

def execute(self, context):
render = context.scene.render
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
UI: Final Resolution
@@ -46,8 +34,8 @@ def render_final_resolution_ui(self, context):


def register():
bpy.types.RENDER_PT_dimensions.append(render_final_resolution_ui)
bpy.types.RENDER_PT_format.append(render_final_resolution_ui)


def unregister():
bpy.types.RENDER_PT_dimensions.remove(render_final_resolution_ui)
bpy.types.RENDER_PT_format.remove(render_final_resolution_ui)
@@ -1,3 +1,5 @@
# SPDX-License-Identifier: GPL-2.0-or-later

import bpy
from mathutils import Vector
from amaranth.utils import cycles_exists
@@ -48,7 +50,7 @@ class AMTH_OBJECT_OT_meshlight_add(bpy.types.Operator):
name="Temperature",
min=800, max=12000.0,
default=5500.0,
step=800.0,
step=100.0,
description="Temperature in Kelvin. Lower is warmer, higher is colder",
)

@@ -168,8 +170,8 @@ def execute(self, context):
sockets.show_expanded = True

material.cycles.sample_as_light = True
meshlight.cycles_visibility.shadow = False
meshlight.cycles_visibility.camera = self.visible
meshlight.visible_shadow = False
meshlight.visible_camera = self.visible

return {'FINISHED'}

@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Select Meshlights
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Passepartout on Specials menu
@@ -1,23 +1,11 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
EXR Render: Warn when Z not connected
Display a little warning label when exporting EXR, with Z Buffer enabled, but
forgot to plug the Z input in the Compositor.
Might be a bit too specific, but found it nice to remember to plug the Z input
if we explicitely specify for Z Buffers to be saved (because it's disabled by
if we explicitly specify for Z Buffers to be saved (because it's disabled by
default).
Find it on the Output panel, Render properties.
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Cycles: Samples per Scene

@@ -34,66 +22,6 @@
)


class AMTH_RENDER_OT_cycles_samples_percentage_set(bpy.types.Operator):

"""Save the current number of samples per shader as final (gets saved in .blend)"""
bl_idname = "scene.amaranth_cycles_samples_percentage_set"
bl_label = "Set as Render Samples"

def execute(self, context):
cycles = context.scene.cycles
cycles.use_samples_final = True

context.scene["amth_cycles_samples_final"] = [
cycles.diffuse_samples,
cycles.glossy_samples,
cycles.transmission_samples,
cycles.ao_samples,
cycles.mesh_light_samples,
cycles.subsurface_samples,
cycles.volume_samples]

self.report({"INFO"}, "Render Samples Saved")

return {"FINISHED"}


class AMTH_RENDER_OT_cycles_samples_percentage(bpy.types.Operator):

"""Set a percentage of the final render samples"""
bl_idname = "scene.amaranth_cycles_samples_percentage"
bl_label = "Set Render Samples Percentage"

percent: IntProperty(
name="Percentage",
description="Percentage to divide render samples by",
subtype="PERCENTAGE", default=0
)

def execute(self, context):
percent = self.percent
cycles = context.scene.cycles
cycles_samples_final = context.scene["amth_cycles_samples_final"]

cycles.use_samples_final = False

if percent == 100:
cycles.use_samples_final = True

cycles.diffuse_samples = int((cycles_samples_final[0] / 100) * percent)
cycles.glossy_samples = int((cycles_samples_final[1] / 100) * percent)
cycles.transmission_samples = int(
(cycles_samples_final[2] / 100) * percent)
cycles.ao_samples = int((cycles_samples_final[3] / 100) * percent)
cycles.mesh_light_samples = int(
(cycles_samples_final[4] / 100) * percent)
cycles.subsurface_samples = int(
(cycles_samples_final[5] / 100) * percent)
cycles.volume_samples = int((cycles_samples_final[6] / 100) * percent)

return {"FINISHED"}


def render_cycles_scene_samples(self, context):

layout = self.layout
@@ -103,36 +31,6 @@ def render_cycles_scene_samples(self, context):
cscene = scene.cycles
list_sampling = scene.amaranth_cycles_list_sampling

# Set Render Samples
if utils.cycles_exists() and cscene.progressive == "BRANCHED_PATH":
layout.separator()
split = layout.split()
col = split.column()

col.operator(
AMTH_RENDER_OT_cycles_samples_percentage_set.bl_idname,
text="%s" %
"Set as Render Samples" if cscene.use_samples_final else "Set New Render Samples",
icon="%s" %
"PINNED" if cscene.use_samples_final else "UNPINNED")

col = split.column()
row = col.row(align=True)
row.enabled = True if scene.get("amth_cycles_samples_final") else False

row.operator(
AMTH_RENDER_OT_cycles_samples_percentage.bl_idname,
text="100%").percent = 100
row.operator(
AMTH_RENDER_OT_cycles_samples_percentage.bl_idname,
text="75%").percent = 75
row.operator(
AMTH_RENDER_OT_cycles_samples_percentage.bl_idname,
text="50%").percent = 50
row.operator(
AMTH_RENDER_OT_cycles_samples_percentage.bl_idname,
text="25%").percent = 25

# List Samples
#if (len(scene.render.layers) > 1) or (len(bpy.data.scenes) > 1):
if (len(scene.render.views) > 1) or (len(bpy.data.scenes) > 1):
@@ -163,14 +61,14 @@ def render_cycles_scene_samples(self, context):
row.prop(
rl, "samples", text="%s" %
"Samples" if rl.samples > 0 else "Automatic (%s)" %
(cscene.aa_samples if cscene.progressive == "BRANCHED_PATH" else cscene.samples))
cscene.samples)

if (len(bpy.data.scenes) > 1):
col.separator()

col.label(text="Scenes:", icon="SCENE_DATA")

if utils.cycles_exists() and cscene.progressive == "PATH":
if utils.cycles_exists():
for s in bpy.data.scenes:
if s != scene:
row = col.row(align=True)
@@ -206,21 +104,13 @@ def init():
scene.amaranth_cycles_list_sampling = bpy.props.BoolProperty(
default=False,
name="Samples Per:")
# Note: add versioning code to adress changes introduced in 2.79.1
if bpy.app.version >= (2, 79, 1):
from cycles import properties as _cycles_props
_cycles_props.CyclesRenderSettings.use_samples_final = BoolProperty(
name="Use Final Render Samples",
description="Use current shader samples as final render samples",
default=False
)
else:
bpy.types.CyclesRenderSettings.use_samples_final = BoolProperty(
name="Use Final Render Samples",
description="Use current shader samples as final render samples",
default=False
)

# Note: add versioning code to address changes introduced in 2.79.1
from cycles import properties as _cycles_props
_cycles_props.CyclesRenderSettings.use_samples_final = BoolProperty(
name="Use Final Render Samples",
description="Use current shader samples as final render samples",
default=False,
)


def clear():
@@ -232,23 +122,13 @@ def clear():

def register():
init()
bpy.utils.register_class(AMTH_RENDER_OT_cycles_samples_percentage)
bpy.utils.register_class(AMTH_RENDER_OT_cycles_samples_percentage_set)
if utils.cycles_exists():
if bpy.app.version >= (2, 79, 1):
bpy.types.CYCLES_RENDER_PT_sampling.append(render_cycles_scene_samples)
else:
bpy.types.CyclesRender_PT_sampling.append(render_cycles_scene_samples)
bpy.types.CYCLES_RENDER_PT_sampling.append(render_cycles_scene_samples)


def unregister():
bpy.utils.unregister_class(AMTH_RENDER_OT_cycles_samples_percentage)
bpy.utils.unregister_class(AMTH_RENDER_OT_cycles_samples_percentage_set)
if utils.cycles_exists():
if bpy.app.version >= (2, 79, 1):
bpy.types.CYCLES_RENDER_PT_sampling.remove(render_cycles_scene_samples)
else:
bpy.types.CyclesRender_PT_sampling.remove(render_cycles_scene_samples)
bpy.types.CYCLES_RENDER_PT_sampling.remove(render_cycles_scene_samples)


clear()
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
File Browser > Go to Current Blend's Folder

@@ -48,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
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Scene Debug Panel

@@ -77,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
@@ -644,6 +633,7 @@ def execute(self, context):

if name not in AMTH_store_data.users['MATERIAL']:
AMTH_store_data.users['MATERIAL'].append(name)

# Check Lights
for la in d.lights:
# Cycles
@@ -655,6 +645,7 @@ def execute(self, context):
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
@@ -666,6 +657,7 @@ def execute(self, context):
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:
@@ -674,6 +666,7 @@ def execute(self, context):
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:
@@ -684,21 +677,31 @@ def execute(self, context):
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:
@@ -801,7 +804,7 @@ def execute(self, context):


class AMTH_SCENE_OT_list_users_debug_clear(Operator):
"""Clear the list bellow"""
"""Clear the list below"""
bl_idname = "scene.amth_list_users_debug_clear"
bl_label = "Clear Debug Panel lists"

@@ -992,7 +995,7 @@ def draw(self, context):
AMTH_store_data.count_images, "IMAGE_DATA"
)
if AMTH_store_data.count_image_node_unlinked != 0:
self.draw_miss_link(col, "image", "node", "nodes", "with no output conected",
self.draw_miss_link(col, "image", "node", "nodes", "with no output connected",
AMTH_store_data.count_image_node_unlinked, "NODE"
)

@@ -1147,12 +1150,9 @@ def draw(self, context):

col.label(text="Name/Library link")

if engine in ["CYCLES", "BLENDER_RENDER"]:
splits = 0.6 if engine == "BLENDER_RENDER" else 0.4
if engine in ["CYCLES"]:
splits = 0.4
splita = split.split(factor=splits, align=True)
col = splita.column(align=True)
col.alignment = "LEFT"
col.label(text="Samples")

if utils.cycles_exists() and engine == "CYCLES":
col = splita.column(align=True)
@@ -1226,20 +1226,15 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn
emboss=False, icon="LINK_BLEND").filepath = is_library

rows = split.row(align=True)
splits = 0.9 if engine == "BLENDER_RENDER" else 0.4
splits = 0.4
splitlamp = rows.split(factor=splits, align=True)
splitlampb = splitlamp.row(align=True)
splitlampc = splitlamp.row(align=True)
splitlampd = rows.row(align=True)
splitlampd.alignment = "RIGHT"

if utils.cycles_exists() and engine == "CYCLES":
if "LIGHT" in icon_type:
clamp = ob.data.cycles
if context.scene.cycles.progressive == "BRANCHED_PATH":
splitlampb.prop(clamp, "samples", text="")
if context.scene.cycles.progressive == "PATH":
splitlampb.label(text="N/A")
lamp = ob.data
if lamp.type in ["POINT", "SUN", "SPOT"]:
splitlampc.label(text="{:.2f}".format(lamp.shadow_soft_size))
@@ -1251,33 +1246,13 @@ def draw_item(self, context, layout, data, item, icon, active_data, active_propn
)
else:
splitlampc.label(text="{:.2f}".format(lamp.size))
else:
splitlampb.label(text="N/A")
if engine == "BLENDER_RENDER":
if "LIGHT" in icon_type:
lamp = ob.data
if lamp.type == "HEMI":
splitlampb.label(text="Not Available")
elif lamp.type == "AREA" and lamp.shadow_method == "RAY_SHADOW":
splitlampb.prop(lamp, "shadow_ray_samples_x", text="X")
if lamp.shape == "RECTANGLE":
splitlampb.prop(lamp, "shadow_ray_samples_y", text="Y")
elif lamp.shadow_method == "RAY_SHADOW":
splitlampb.prop(lamp, "shadow_ray_samples", text="Ray Samples")
elif lamp.shadow_method == "BUFFER_SHADOW":
splitlampb.prop(lamp, "shadow_buffer_samples", text="Buffer Samples")
else:
splitlampb.label(text="No Shadow")
else:
splitlampb.label(text="N/A")
if utils.cycles_exists():
visibility = ob.cycles_visibility
splitlampd.prop(visibility, "camera", text="")
splitlampd.prop(visibility, "diffuse", text="")
splitlampd.prop(visibility, "glossy", text="")
splitlampd.prop(visibility, "shadow", text="")
splitlampd.prop(ob, "visible_camera", text="")
splitlampd.prop(ob, "visible_diffuse", text="")
splitlampd.prop(ob, "visible_glossy", text="")
splitlampd.prop(ob, "visible_shadow", text="")
splitlampd.separator()
splitlampd.prop(ob, "hide", text="", emboss=False)
splitlampd.prop(ob, "hide_viewport", text="", emboss=False)
splitlampd.prop(ob, "hide_render", text="", emboss=False)
splitlampd.operator(
AMTH_SCENE_OT_amaranth_object_select.bl_idname,
@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
File Browser: Libraries Bookmark

@@ -31,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

@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
import bpy


@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Refresh Scene

@@ -1,16 +1,4 @@
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Save & Reload File

@@ -25,6 +13,23 @@

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"""
@@ -35,6 +40,10 @@ def save_reload(self, context, path):
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)