当前位置: 首页 > news >正文

怎么做招聘网站的数据分析网络seo优化公司

怎么做招聘网站的数据分析,网络seo优化公司,北京工程网站建设,服务器网站模板blender scripting 编写 一、查看ui按钮对应的代码二、查看或修改对象名称三、案例:渲染多张图片并导出对应的相机参数 一、查看ui按钮对应的代码 二、查看或修改对象名称 三、案例:渲染多张图片并导出对应的相机参数 注:通过ui交互都设置好…

blender scripting 编写

  • 一、查看ui按钮对应的代码
  • 二、查看或修改对象名称
  • 三、案例:渲染多张图片并导出对应的相机参数

一、查看ui按钮对应的代码

在这里插入图片描述

二、查看或修改对象名称

在这里插入图片描述

三、案例:渲染多张图片并导出对应的相机参数

注:通过ui交互都设置好,如果ui能渲染,该代码就能运行成功。

import bpy
import math
import os
from mathutils import Vector, Matrix
from math import radians
import bmesh
import datetime
import time
import numpy as np
import os
#from os import pathscenenumber='baseline_scene6_clean'#basefolder=os.path.join(os.path.expanduser('~'), 'Documents', 'Zantis', scenenumber)
scene = bpy.data.scenes["Scene"]
#scene.camera.rotation_mode='YZX'
def length():leg=0.00p1=[0.0,0.0]temp=0ob = bpy.context.object # active objectfor p in ob.data.splines.active.bezier_points:p2=p1p1=[p.co.x,p.co.y]if(temp==0):temp=1continuedistance = math.sqrt( ((p1[0]-p2[0])**2)+((p1[1]-p2[1])**2) )leg=leg+distancereturn legitem=0
multiply=40
camera = bpy.data.objects['Camera']
target=bpy.data.objects['mesh.001']
my_obj=[]#my_obj.append("019")
#my_obj.append("021")
#my_obj.append("029")
#my_obj.append("030")
#my_obj.append("031")
#my_obj.append("032")
#my_obj.append("033")
#my_obj.append("034")
my_obj.append("040")
#my_obj.append("042")t1 = time.time()#import bpy#for ob in bpy.context.selected_editable_objects:#  ob.active_material_index = 0#   for i in range(len(ob.material_slots)):
#        bpy.ops.object.material_slot_remove({'object': ob})for item in my_obj:#break# basefolder=os.path.join(os.path.expanduser('~'), 'Desktop', 'Urban_Enviroment_Texturing','Mesh_Texturing_Pipeline', 'Scenes', '005', 'images')basefolder = os.path.join('E:\\', 'chromeDownload', 'mvs_test', 'scenes', '006', 'images')t2 = time.time()for ob in bpy.context.selected_objects:ob.select_set(False)curv='Curve.'+itempath = bpy.data.objects[curv]camera.select_set(True)path.select_set(True)# bpy.context.view_layer.objects.active = path # parent# bpy.ops.object.parent_set(type='FOLLOW') # follow path# camera.location=path.matrix_world @ bpy.context.object.data.splines.active.bezier_points[0].co# target.location=path.matrix_world @ bpy.context.object.data.splines.active.bezier_points[1].co# direc=target.location-camera.locationframes=(int)(length()*multiply)	# bpy.data.scenes["Scene"].frame_end=frames# bpy.context.object.data.path_duration=framesframe_is=0frames=frames+1print(frames)count=0for frame_is in range(scene.frame_start, scene.frame_end + 1):# for frame_is in range(frames - 3):t3 = time.time()scene.frame_current=frame_is#print(scene.frame_currents
#        s=str(scene.objects['Camera'].matrix_world[0][3])+"_"+str(scene.objects['Camera'].matrix_world[1][3])+"_"+str(scene.objects['Camera'].matrix_world[2][3])+"_"
#        s=s+str(direc[0])+"_"+str(direc[1])+"_"+str(direc[2])+".jpg"s = str(scene.frame_current).zfill(5)+".jpg"image_filepath=os.path.join(basefolder,s)#print(s)bpy.data.scenes['Scene'].render.filepath = image_filepath
#        bpy.ops.render.render(write_still=True)elapsedTime = time.time() - t3print("Frame time passed {hours:d}:{minutes:d}:{seconds:d}".format(hours=int((elapsedTime / 60 ** 2) % (60 ** 2)), minutes=int((elapsedTime / 60) % (60)),seconds=int(elapsedTime % 60)))#        print('path to create: ', os.path.join(os.path.expanduser('~'), 'Desktop', 'Data','Depth_data',scenenumber+'_'+item))if not os.path.exists(os.path.join(os.path.expanduser('~'), basefolder)):os.mkdir(os.path.join(os.path.expanduser('~'), basefolder))if not os.path.exists(os.path.join(os.path.expanduser('~'), basefolder, 'RTm/')):os.mkdir(os.path.join(os.path.expanduser('~'), basefolder, 'RTm/'))# Set up rendering of depth map:bpy.context.scene.use_nodes = Truetree = bpy.context.scene.node_treelinks = tree.links# clear default nodesfor n in tree.nodes:tree.nodes.remove(n)# create input render layer noderl = tree.nodes.new('CompositorNodeRLayers')RGB2BW = tree.nodes.new(type="CompositorNodeRGBToBW")links.new(rl.outputs[0], RGB2BW.inputs[0])map = tree.nodes.new(type="CompositorNodeMapValue")# Size is chosen kind of arbitrarily, try out until you're satisfied with resulting depth map.map.size = [0.05]map.use_min = Truemap.min = [0]map.use_max = Truemap.max = [1]links.new(rl.outputs[2], map.inputs[0])mix_multi = tree.nodes.new(type="CompositorNodeMixRGB")# Size is chosen kind of arbitrarily, try out until you're satisfied with resulting depth map.mix_multi.blend_type = 'MULTIPLY'mix_multi.inputs[2].default_value[0] = 0.5mix_multi.inputs[2].default_value[1] = 0.5mix_multi.inputs[2].default_value[2] = 0.5
#        mix_multi.inputs[2].default = [0.5 , 0.5, 0.5, 1.0]links.new(rl.outputs[3], mix_multi.inputs[1])mix_multi2 = tree.nodes.new(type="CompositorNodeMixRGB")# Size is chosen kind of arbitrarily, try out until you're satisfied with resulting depth map.mix_multi2.blend_type = 'ADD'mix_multi2.inputs[2].default_value[0] = 0.5mix_multi2.inputs[2].default_value[1] = 0.5mix_multi2.inputs[2].default_value[2] = 0.5links.new(mix_multi.outputs[0], mix_multi2.inputs[1])invert = tree.nodes.new(type="CompositorNodeInvert")links.new(map.outputs[0], invert.inputs[1])# The viewer can come in handy for inspecting the results in the GUIdepthViewer = tree.nodes.new(type="CompositorNodeViewer")links.new(invert.outputs[0], depthViewer.inputs[0])# Use alpha from input.links.new(rl.outputs[1], depthViewer.inputs[1])# Normal map# The viewer can come in handy for inspecting the results in the GUIdepthViewer2 = tree.nodes.new(type="CompositorNodeViewer")links.new(rl.outputs[1], depthViewer2.inputs[1])links.new(mix_multi2.outputs[0], depthViewer2.inputs[0])#        fileOutput = tree.nodes.new(type="CompositorNodeOutputFile")
#        fileOutput.base_path = os.path.join(os.path.expanduser('~'), 'Desktop', 'Data','Depth_data',scenenumber+'_'+item, 'depth')
##        fileOutput.file_slots[0].path = str(scene.frame_current).zfill(5)
#        links.new(invert.outputs[0], fileOutput.inputs[0])
#        
#        fileOutput2 = tree.nodes.new(type="CompositorNodeOutputFile")
#        fileOutput2.base_path = os.path.join(os.path.expanduser('~'), 'Desktop', 'Data','Depth_data',scenenumber+'_'+item,'normal')
##        fileOutput2.file_slots[0].path = str(scene.frame_current).zfill(5)
#        links.new(mix_multi2.outputs[0], fileOutput2.inputs[0])
#        
#        fileOutput3 = tree.nodes.new(type="CompositorNodeOutputFile")
#        fileOutput3.base_path = os.path.join(os.path.expanduser('~'), 'Desktop', 'Data','Depth_data',scenenumber+'_'+item,'panoramas_BW')
##        fileOutput3.file_slots[0].path = str(scene.frame_current).zfill(5)
#        links.new(RGB2BW.outputs[0], fileOutput3.inputs[0])bpy.ops.render.render(write_still=True)location, rotation = scene.objects['Camera'].matrix_world.decompose()[0:2]R_world2bcam = rotation.to_matrix().transposed()T_world2bcam = -1*R_world2bcam @ locationCamera_RT_matrix =  Matrix((R_world2bcam[0][:] + (T_world2bcam[0],),R_world2bcam[1][:] + (T_world2bcam[1],),R_world2bcam[2][:] + (T_world2bcam[2],),[0,0,0,1],))np.savetxt(os.path.join(os.path.expanduser('~'), basefolder, 'RTm')+'/'+str(frame_is).zfill(6)+"_RTm.txt",np.array(Camera_RT_matrix))# breakscene.frame_current=0path.select_set(False)bpy.ops.object.parent_clear(type='CLEAR')# camera.select_set(False)
elapsedTime = time.time() - t1
print("Total time passed {hours:d}:{minutes:d}:{seconds:d}".format(hours=int((elapsedTime / 60 ** 2) % (60 ** 2)), minutes=int((elapsedTime / 60) % (60)),seconds=int(elapsedTime % 60)))
print("Finished")
http://www.hkea.cn/news/163635/

相关文章:

  • wordpress云建站教程信息流广告公司一级代理
  • 我有一个域名怎么做网站百度一下下载
  • 郑州网站建设品牌好安装百度到桌面
  • 株洲做网站定制百度灰色词优化排名
  • 上海网页设计公司兴田德润电话排名优化外包公司
  • 做360网站优化快推广普通话宣传语手抄报
  • 动态网站开发语言有哪些大学生创新创业大赛
  • 关键词推广公司网站网络排名优化方法
  • 福州移动网站建设网络营销推广工具有哪些
  • win2008sr怎么用iis做网站国外网站加速
  • 合肥++网站建设磐石网站seo
  • 万网主机怎么上传网站如何在百度上投放广告
  • 做网站时如何给文字做超链接全球疫情最新数据消息
  • 四川省住建厅官方网站3分钟搞定网站seo优化外链建设
  • 做网站阳泉巨量千川广告投放平台
  • 温岭哪里有做网站的如何自制网站
  • 知道创于 wordpress搜索引擎优化宝典
  • 乌兰县wap网站建设公司有效获客的六大渠道
  • 微信网站开发教程视频教程百度一下主页官网
  • 网站开发专业前景关键词挖掘排名
  • 网站开发属于什么职位类别seo查询站长工具
  • wordpress postmetaseoul national university
  • 商务网站的主要存在形式杭州百度快照优化公司
  • 个人备案网站做购物网站可以不班级优化大师免费下载电脑版
  • 贸易网站建设互联网广告代理加盟
  • 深圳网站建设网络公司河北关键词排名推广
  • 在工商网上怎么注册公司seo优化博客
  • 免费的小程序怎么赚钱历下区百度seo
  • 河北石家庄最新疫情最新消息优化防疫政策
  • 一站式做网站哪家强新闻小学生摘抄