Changeset View
Standalone View
add_mesh_BoltFactory/createMesh.py
| Context not available. | |||||
| from itertools import * | from itertools import * | ||||
| NARROW_UI = 180 | NARROW_UI = 180 | ||||
| MAX_INPUT_NUMBER = 50 | MAX_INPUT_NUMBER = 500 #increase to allow extra long bolts | ||||
| #Global_Scale = 0.001 #1 blender unit = X mm | #Global_Scale = 0.001 #1 blender unit = X mm | ||||
| GLOBAL_SCALE = 0.1 #1 blender unit = X mm | GLOBAL_SCALE = 0.1 #1 blender unit = X mm | ||||
| Context not available. | |||||
| def Scale_Mesh_Verts(verts,scale_factor): | def Scale_Mesh_Verts(verts,scale_factor): | ||||
| Ret_verts = [] | Ret_verts = [] | ||||
| #added by Jan R.I.B.-Wein on 2014-Feb-10: | |||||
codemanx: We have version control to track changes. | |||||
faerietreeUnsubmitted Not Done Inline ActionsTrue, unfortunately I could not commit, hence no commit message, thus I was quite uncertain what to do. So I went down the detailed road. :) How best remove it, resubmit the patch - change inline? Sorry for noob question! faerietree: True, unfortunately I could not commit, hence no commit message, thus I was quite uncertain… | |||||
| #scale according to scene unit settings otherwise it's too small or too big: | |||||
| #TODO use scale_length alone? remove scale_factor in the process if feasible. | |||||
| scale_factor = bpy.context.scene.unit_settings.scale_length / scale_factor | |||||
| for v in verts: | for v in verts: | ||||
| Ret_verts.append([v[0]*scale_factor,v[1]*scale_factor,v[2]*scale_factor]) | Ret_verts.append([v[0]*scale_factor,v[1]*scale_factor,v[2]*scale_factor]) | ||||
| return Ret_verts | return Ret_verts | ||||
| Context not available. | |||||
| if matSize != 4 : | if matSize != 4 : | ||||
| print ("Simple_RotationMatrix can only do 4x4") | print ("Simple_RotationMatrix can only do 4x4") | ||||
| f !bpy.context.scene.TSTEPS or bpy.context.scene.TSTEPS is None or bpy.context.scene.TSTEPS is "": | |||||
codemanxAuthorUnsubmitted Not Done Inline ActionsMissing i in if. What kind of check is this? if not bpy.context.scene.TSTEPS: should do the same. If it's supposed to test for the existence of the property, then it should probably check if hasattr(bpy.context.scene, "TSTEPS") but would prefer a real fix (cases, in which the context really needs to be accessed during registration, are rare) codemanx: Missing `i` in `if`. What kind of check is this?
if not bpy.context.scene.TSTEPS:
should do… | |||||
faerietreeUnsubmitted Not Done Inline ActionsTrue ... will do. Thanks for detailed note! Perhaps a combination of both is best? I remember Ton shouting: "Don't touch working code!" aka "Never change a running system." Sorry for my rush at it! Will post back later .. faerietree: True ... will do. Thanks for detailed note! Perhaps a combination of both is best?
I remember… | |||||
| init() | |||||
| q = radians(angle) #make the rotation go clockwise | q = radians(angle) #make the rotation go clockwise | ||||
| if axisFlag == 'x': | if axisFlag == 'x': | ||||
| Context not available. | |||||
We have version control to track changes.