Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons-contrib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons-contrib
Commits
e845980e
Commit
e845980e
authored
6 years ago
by
Clemens Barth
Browse files
Options
Downloads
Patches
Plain Diff
Code cleaning: removal of code that is not anymore needed.
parent
83c06d95
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
add_mesh_clusters/__init__.py
+0
-178
0 additions, 178 deletions
add_mesh_clusters/__init__.py
with
0 additions
and
178 deletions
add_mesh_clusters/__init__.py
+
0
−
178
View file @
e845980e
...
...
@@ -143,29 +143,6 @@ class CLASS_PT_atom_cluster_panel(Panel):
row
=
box
.
row
()
row
.
prop
(
scn
,
"
atom_number_drawn
"
)
# This is not needed because all such functions are available
# in the Atomic Blender Utilities panel.
#
#row = layout.row()
#row.label(text="Modify cluster")
#box = layout.box()
#row = box.row()
#row.label(text="All changes concern:")
#row = box.row()
#row.prop(scn, "radius_how")
#row = box.row()
#row.label(text="1. Change type of radii")
#row = box.row()
#row.prop(scn, "radius_type")
#row = box.row()
#row.label(text="2. Change atom radii by scale")
#row = box.row()
#col = row.column()
#col.prop(scn, "radius_all")
#col = row.column(align=True)
#col.operator( "atom_cluster.radius_all_bigger" )
#col.operator( "atom_cluster.radius_all_smaller" )
# The properties (gadgets) in the panel. They all go to scene
# during initialization (see end)
...
...
@@ -230,23 +207,6 @@ class CLASS_atom_cluster_Properties(bpy.types.PropertyGroup):
atom_number_drawn
:
StringProperty
(
name
=
"
Drawn
"
,
default
=
"
---
"
,
description
=
"
Number of drawn atoms in the cluster
"
)
#radius_how: EnumProperty(
# name="",
# description="Which objects shall be modified?",
# items=(('ALL_ACTIVE',"all active objects", "in the current layer"),
# ('ALL_IN_LAYER',"all"," in active layer(s)")),
# default='ALL_ACTIVE',)
#radius_type: EnumProperty(
# name="Type",
# description="Which type of atom radii?",
# items=(('0',"predefined", "Use pre-defined radii"),
# ('1',"atomic", "Use atomic radii"),
# ('2',"van der Waals","Use van der Waals radii")),
# default='0',update=Callback_radius_type)
#radius_all: FloatProperty(
# name="Scale", default = 1.05, min=0.0,
# description="Put in the scale factor")
# The button for reloading the atoms and creating the scene
class
CLASS_atom_cluster_load_button
(
Operator
):
...
...
@@ -363,144 +323,6 @@ def DEF_atom_draw_atoms(prop_element,
return
True
# Routine to modify the radii via the type: predefined, atomic or van der Waals
# Explanations here are also valid for the next 3 DEFs.
def
DEF_atom_cluster_radius_type
(
rtype
,
how
):
if
how
==
"
ALL_IN_LAYER
"
:
# Note all layers that are active.
layers
=
[]
for
i
in
range
(
20
):
if
bpy
.
context
.
scene
.
layers
[
i
]
==
True
:
layers
.
append
(
i
)
# Put all objects, which are in the layers, into a list.
change_objects
=
[]
for
obj
in
bpy
.
context
.
scene
.
objects
:
for
layer
in
layers
:
if
obj
.
layers
[
layer
]
==
True
:
change_objects
.
append
(
obj
)
# Consider all objects, which are in the list 'change_objects'.
for
obj
in
change_objects
:
if
len
(
obj
.
children
)
!=
0
:
if
obj
.
children
[
0
].
type
==
"
SURFACE
"
or
obj
.
children
[
0
].
type
==
"
MESH
"
:
for
element
in
add_mesh_cluster
.
ATOM_CLUSTER_ELEMENTS
:
if
element
.
name
in
obj
.
name
:
obj
.
children
[
0
].
scale
=
(
element
.
radii
[
int
(
rtype
)],)
*
3
else
:
if
obj
.
type
==
"
SURFACE
"
or
obj
.
type
==
"
MESH
"
:
for
element
in
add_mesh_cluster
.
ATOM_CLUSTER_ELEMENTS
:
if
element
.
name
in
obj
.
name
:
obj
.
scale
=
(
element
.
radii
[
int
(
rtype
)],)
*
3
# Routine to scale the radii of all atoms
def
DEF_atom_cluster_radius_all
(
scale
,
how
):
if
how
==
"
ALL_IN_LAYER
"
:
layers
=
[]
for
i
in
range
(
20
):
if
bpy
.
context
.
scene
.
layers
[
i
]
==
True
:
layers
.
append
(
i
)
change_objects
=
[]
for
obj
in
bpy
.
context
.
scene
.
objects
:
for
layer
in
layers
:
if
obj
.
layers
[
layer
]
==
True
:
change_objects
.
append
(
obj
)
for
obj
in
change_objects
:
if
len
(
obj
.
children
)
!=
0
:
if
obj
.
children
[
0
].
type
==
"
SURFACE
"
or
obj
.
children
[
0
].
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
children
[
0
].
scale
*=
scale
else
:
if
obj
.
type
==
"
SURFACE
"
or
obj
.
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
scale
*=
scale
if
how
==
"
ALL_ACTIVE
"
:
for
obj
in
bpy
.
context
.
selected_objects
:
if
len
(
obj
.
children
)
!=
0
:
if
obj
.
children
[
0
].
type
==
"
SURFACE
"
or
obj
.
children
[
0
].
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
children
[
0
].
scale
*=
scale
else
:
if
obj
.
type
==
"
SURFACE
"
or
obj
.
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
scale
*=
scale
## Button for increasing the radii of all atoms
#class CLASS_atom_cluster_radius_all_bigger_button(Operator):
# bl_idname = "atom_cluster.radius_all_bigger"
# bl_label = "Bigger ..."
# bl_description = "Increase the radii of the atoms"
#
# def execute(self, context):
# scn = bpy.context.scene.atom_cluster
# DEF_atom_cluster_radius_all(
# scn.radius_all,
# scn.radius_how,)
# return {'FINISHED'}
#
#
## Button for decreasing the radii of all atoms
#class CLASS_atom_cluster_radius_all_smaller_button(Operator):
# bl_idname = "atom_cluster.radius_all_smaller"
# bl_label = "Smaller ..."
# bl_description = "Decrease the radii of the atoms"
#
# def execute(self, context):
# scn = bpy.context.scene.atom_cluster
# DEF_atom_cluster_radius_all(
# 1.0/scn.radius_all,
# scn.radius_how,)
# return {'FINISHED'}
# Routine to scale the radii of all atoms
def
DEF_atom_cluster_radius_all
(
scale
,
how
):
if
how
==
"
ALL_IN_LAYER
"
:
layers
=
[]
for
i
in
range
(
20
):
if
bpy
.
context
.
scene
.
layers
[
i
]
==
True
:
layers
.
append
(
i
)
change_objects
=
[]
for
obj
in
bpy
.
context
.
scene
.
objects
:
for
layer
in
layers
:
if
obj
.
layers
[
layer
]
==
True
:
change_objects
.
append
(
obj
)
for
obj
in
change_objects
:
if
len
(
obj
.
children
)
!=
0
:
if
obj
.
children
[
0
].
type
==
"
SURFACE
"
or
obj
.
children
[
0
].
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
children
[
0
].
scale
*=
scale
else
:
if
obj
.
type
==
"
SURFACE
"
or
obj
.
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
scale
*=
scale
if
how
==
"
ALL_ACTIVE
"
:
for
obj
in
bpy
.
context
.
selected_objects
:
if
len
(
obj
.
children
)
!=
0
:
if
obj
.
children
[
0
].
type
==
"
SURFACE
"
or
obj
.
children
[
0
].
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
children
[
0
].
scale
*=
scale
else
:
if
obj
.
type
==
"
SURFACE
"
or
obj
.
type
==
"
MESH
"
:
if
"
Stick
"
not
in
obj
.
name
:
obj
.
scale
*=
scale
# The entry into the menu 'file -> import'
def
DEF_menu_func
(
self
,
context
):
self
.
layout
.
operator
(
CLASS_ImportCluster
.
bl_idname
,
icon
=
'
PLUGIN
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment