Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
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
Commits
969f1776
Commit
969f1776
authored
14 years ago
by
Martin Buerbaum
Browse files
Options
Downloads
Patches
Plain Diff
* Version 0.10.6 - Made PEP8 compatible again.
* Some minor formatting * Synced with my local copy.
parent
4d694baf
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_pipe_joint.py
+26
-5
26 additions, 5 deletions
add_mesh_pipe_joint.py
with
26 additions
and
5 deletions
add_mesh_pipe_joint.py
+
26
−
5
View file @
969f1776
...
...
@@ -19,7 +19,7 @@
bl_addon_info
=
{
"
name
"
:
"
Pipe Joints
"
,
"
author
"
:
"
Buerbaum Martin (Pontiac)
"
,
"
version
"
:
(
0
,
10
,
5
),
"
version
"
:
(
0
,
10
,
6
),
"
blender
"
:
(
2
,
5
,
3
),
"
api
"
:
31667
,
"
location
"
:
"
View3D > Add > Mesh > Pipe Joint
"
,
...
...
@@ -42,6 +42,14 @@ The functionality can then be accessed via the
Note: Currently only the
"
Elbow
"
type supports odd number of vertices.
Version history:
v0.10.6 - Removed
"
recall properties
"
from all functions.
Updated various code for new API.
API: mathutils.RotationMatrix -> mathutils.Matrix.Rotation
API: xxx.selected -> xxx.select
API:
"
invoke
"
function for each operator.
Updated for new bl_addon_info structure.
New code for the
"
align_matrix
"
.
made script PEP8 compatible.
v0.10.5 - createFaces can now create fan/star like faces.
v0.10.4 - Updated the function
"
createFaces
"
a bit. No functional changes.
v0.10.3 - Updated store_recall_properties, apply_object_align
...
...
@@ -136,11 +144,14 @@ def align_matrix(context):
obj_align
=
context
.
user_preferences
.
edit
.
object_align
if
(
context
.
space_data
.
type
==
'
VIEW_3D
'
and
obj_align
==
'
VIEW
'
):
rot
=
context
.
space_data
.
region_3d
.
view_matrix
.
rotation_part
().
invert
().
resize4x4
()
view_mat
=
context
.
space_data
.
region_3d
.
view_matrix
rot
=
view_mat
.
rotation_part
().
invert
().
resize4x4
()
else
:
rot
=
mathutils
.
Matrix
()
align_matrix
=
loc
*
rot
return
align_matrix
# Create a new mesh (object) from verts/edges/faces.
# verts/edges/faces ... List of vertices/edges/faces for the
# new mesh (as used in from_pydata).
...
...
@@ -403,6 +414,7 @@ class AddElbowJoint(bpy.types.Operator):
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
Elbow Joint
"
,
edit
,
self
.
align_matrix
)
return
{
'
FINISHED
'
}
def
invoke
(
self
,
context
,
event
):
...
...
@@ -410,6 +422,7 @@ class AddElbowJoint(bpy.types.Operator):
self
.
execute
(
context
)
return
{
'
FINISHED
'
}
class
AddTeeJoint
(
bpy
.
types
.
Operator
):
# Create the vertices and polygons for a simple tee (T) joint.
# The base arm of the T can be positioned in an angle if needed though.
...
...
@@ -592,7 +605,8 @@ class AddTeeJoint(bpy.types.Operator):
faces
.
extend
(
createFaces
(
loopJoint2
,
loopArm
,
closed
=
True
))
faces
.
extend
(
createFaces
(
loopJoint3
,
loopMainEnd
,
closed
=
True
))
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
Tee Joint
"
,
edit
,
self
.
align_matrix
)
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
Tee Joint
"
,
edit
,
self
.
align_matrix
)
return
{
'
FINISHED
'
}
...
...
@@ -601,6 +615,7 @@ class AddTeeJoint(bpy.types.Operator):
self
.
execute
(
context
)
return
{
'
FINISHED
'
}
class
AddWyeJoint
(
bpy
.
types
.
Operator
):
'''
Add a Wye-Joint mesh
'''
bl_idname
=
"
mesh.primitive_wye_joint_add
"
...
...
@@ -798,7 +813,8 @@ class AddWyeJoint(bpy.types.Operator):
faces
.
extend
(
createFaces
(
loopJoint2
,
loopArm1
,
closed
=
True
))
faces
.
extend
(
createFaces
(
loopJoint3
,
loopArm2
,
closed
=
True
))
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
Wye Joint
"
,
edit
,
self
.
align_matrix
)
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
Wye Joint
"
,
edit
,
self
.
align_matrix
)
return
{
'
FINISHED
'
}
...
...
@@ -807,6 +823,7 @@ class AddWyeJoint(bpy.types.Operator):
self
.
execute
(
context
)
return
{
'
FINISHED
'
}
class
AddCrossJoint
(
bpy
.
types
.
Operator
):
'''
Add a Cross-Joint mesh
'''
# Create the vertices and polygons for a coss (+ or X) pipe joint.
...
...
@@ -1075,6 +1092,7 @@ class AddCrossJoint(bpy.types.Operator):
self
.
execute
(
context
)
return
{
'
FINISHED
'
}
class
AddNJoint
(
bpy
.
types
.
Operator
):
'''
Add a N-Joint mesh
'''
# Create the vertices and polygons for a regular n-joint.
...
...
@@ -1235,7 +1253,8 @@ class AddNJoint(bpy.types.Operator):
createFaces
(
loopsJoints
[
loopIdx
],
loopsEndCircles
[
loopIdx
],
closed
=
True
))
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
N Joint
"
,
edit
,
self
.
align_matrix
)
obj
=
create_mesh_object
(
context
,
verts
,
[],
faces
,
"
N Joint
"
,
edit
,
self
.
align_matrix
)
return
{
'
FINISHED
'
}
...
...
@@ -1244,6 +1263,7 @@ class AddNJoint(bpy.types.Operator):
self
.
execute
(
context
)
return
{
'
FINISHED
'
}
class
INFO_MT_mesh_pipe_joints_add
(
bpy
.
types
.
Menu
):
# Define the "Pipe Joints" menu
bl_idname
=
"
INFO_MT_mesh_pipe_joints_add
"
...
...
@@ -1267,6 +1287,7 @@ class INFO_MT_mesh_pipe_joints_add(bpy.types.Menu):
import
space_info
# Define "Pipe Joints" menu
def
menu_func
(
self
,
context
):
self
.
layout
.
menu
(
"
INFO_MT_mesh_pipe_joints_add
"
,
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