- 1
http://lentach.media/articles/php-konferentsiiu-v-drezdene-otmenili-potomu-chto-sredi-dokladchikov-byli-odni-belye-muzhchiny
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 5
0
http://lentach.media/articles/php-konferentsiiu-v-drezdene-otmenili-potomu-chto-sredi-dokladchikov-byli-odni-belye-muzhchiny
Именно поэтому я за «PHP ».
0
Узнали? Согласны?
https://www.youtube.com/watch?v=0GIcP6xvW5Q
−1
А давайте ругать Фрейда
https://imgur.com/a/hH4QLKd
https://imgur.com/a/07wciaX
+4
def do_creaprim(self, mesh, objname, addondir):
global message
objname = objname.replace(".", "")
objname = objname.replace(" ", "_")
bm = bmesh.new()
bm.from_mesh(mesh)
try:
txt = bpy.data.texts[str.lower("add_mesh_" + objname) + ".py"]
txt.clear()
except:
txt = bpy.data.texts.new("add_mesh_" + str.lower(objname) + ".py")
strlist = []
strlist.append("bl_info = {\n")
strlist.append("\"name\": \"" + objname + "\", \n")
strlist.append("\"author\": \"Gert De Roost\",\n")
strlist.append("\"version\": (1, 0, 0),\n")
strlist.append("\"blender\": (2, 65, 0),\n")
strlist.append("\"location\": \"Add > Mesh\",\n")
strlist.append("\"description\": \"Create " + objname + " primitive.\",\n")
strlist.append("\"warning\": \"\",\n")
strlist.append("\"wiki_url\": \"\",\n")
strlist.append("\"tracker_url\": \"\",\n")
strlist.append("\"category\": \"Add Mesh\"}\n")
strlist.append("\n")
strlist.append("\n")
strlist.append("if \"bpy\" in locals():\n")
strlist.append(" import imp\n")
strlist.append("\n")
strlist.append("\n")
strlist.append("import bpy\n")
strlist.append("import bmesh\n")
strlist.append("import math\n")
strlist.append("from mathutils import *\n")
strlist.append("\n")
strlist.append("\n")
strlist.append("\n")
strlist.append("\n")
strlist.append("class " + objname + "(bpy.types.Operator):\n")
strlist.append(" bl_idname = \"mesh." + str.lower(objname) + "\"\n")
strlist.append(" bl_label = \"" + objname + "\"\n")
strlist.append(" bl_options = {\'REGISTER\', \'UNDO\'}\n")
strlist.append(" bl_description = \"add " + objname + " primitive\"\n")
strlist.append("\n")
strlist.append(" def invoke(self, context, event):\n")
strlist.append("\n")
strlist.append(" mesh = bpy.data.meshes.new(name=\"" + objname + "\")\n")
strlist.append(" obj = bpy.data.objects.new(name=\"" + objname + "\", object_data=mesh)\n")
strlist.append(" scene = bpy.context.scene\n")
strlist.append(" scene.objects.link(obj)\n")
strlist.append(" obj.location = scene.cursor_location\n")
strlist.append(" bm = bmesh.new()\n")
strlist.append(" bm.from_mesh(mesh)\n")
strlist.append("\n")
strlist.append(" idxlist = []\n")
posn = 0
strlist.append(" vertlist = [")
for v in bm.verts:
if posn > 0:
strlist.append(", ")
posn += 1
strlist.append(str(v.co[:]))
strlist.append("]\n")
strlist.append(" for co in vertlist:\n")
strlist.append(" v = bm.verts.new(co)\n")
strlist.append(" bm.verts.index_update()\n")
strlist.append(" idxlist.append(v.index)\n")
posn = 0
strlist.append(" edgelist = [")
for e in bm.edges:
if posn > 0:
strlist.append(", ")
posn += 1
strlist.append("[" + str(e.verts[0].index) + ", " + str(e.verts[1].index) + "]")
strlist.append("]\n")
strlist.append(" for verts in edgelist:\n")
strlist.append(" try:\n")
strlist.append(" bm.edges.new((bm.verts[verts[0]], bm.verts[verts[1]]))\n")
strlist.append(" except:\n")
strlist.append(" pass\n")
posn1 = 0
strlist.append(" facelist = [(")
for f in bm.faces:
if posn1 > 0:
strlist.append(", (")
posn1 += 1
posn2 = 0
for v in f.verts:
if posn2 > 0:
strlist.append(", ")
strlist.append(str(v.index))
posn2 += 1
strlist.append(")")
strlist.append("]\n")
strlist.append(" bm.verts.ensure_lookup_table()\n")
strlist.append(" for verts in facelist:\n")
Залил вам отборного
0
RunTemplate("WoWADT.bt");
int i;
for( i=0; i < 99999; ++i )
{
if(ADT_file.mddf.entry[i].pos.z&1)
ADT_file.mddf.entry[i].pos.z &= ~z&1-100;
}
// Автор хотел сделать вот это:
RunTemplate("WoWADT.bt");
int i;
for( i=0; i < ADT_file.mddf.hdr.byte_size \ 0x24; ++i )
{
ADT_file.mddf.entry[i].pos.z -= 100;
}
FileSave();
FileClose();
По мере надобности программирую на скриптовом языке 1SC в Sweetscape 010 editor. Один человек прислал мне вот такой вот кусочек кода. Ниже то что он хотел сделать на самом деле (вычесть 100 из каждой координаты). :)