本文整理汇总了Python中Blender.BGL.glRasterPos2i方法的典型用法代码示例。如果您正苦于以下问题:Python BGL.glRasterPos2i方法的具体用法?Python BGL.glRasterPos2i怎么用?Python BGL.glRasterPos2i使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blender.BGL
的用法示例。
在下文中一共展示了BGL.glRasterPos2i方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gui_masse_volumique
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def gui_masse_volumique():
# Création d'Id pour les évènements
nCpt_evt = 1
global EV_BT_OK
EV_BT_OK = nCpt_evt; nCpt_evt += 1
global EV_BT_ANNULER
EV_BT_ANNULER = nCpt_evt; nCpt_evt += 1
global EV_MASS_VOL
EV_MASS_VOL = nCpt_evt; nCpt_evt += 1
pos_x = 5
pos_y = 100; pas_y = 36
BGL.glRasterPos2i( pos_x, pos_y )
Draw.Text("Choisissez la masse volumique du maillage (et validez par \"OK\") :")
#[nom bouton] = Draw.Number("[nom]", [numéro d'événement], [position x], [position y], \
# [largeur], [hauteur], \
# [valeur initiale], [valeur minimale],[valeur maximale], "[astuce]")
global bt_masse_volumique
largeur_mv = 360
hauteur = 25
pos_y -= pas_y
bt_masse_volumique = Draw.Number("Masse volumique :", EV_MASS_VOL, pos_x, pos_y, \
largeur_mv, hauteur, \
1.0, 0.0, 100000.0, "saisissez la masse volumique")
largeur_bt = 80
pos_y -= pas_y
dx_espacement = int( ( largeur_mv - 2.0 * largeur_bt ) / 3.0 )
dx_espacement = int( dx_espacement + 0.5 )
pos_x_bt_OK = pos_x + dx_espacement
pos_x_bt_Annuler = pos_x_bt_OK + largeur_bt + dx_espacement
Draw.PushButton("OK", EV_BT_OK, pos_x_bt_OK, pos_y, largeur_bt, hauteur, "Valide")
Draw.PushButton("Annuler", EV_BT_ANNULER, pos_x_bt_Annuler, pos_y, largeur_bt, hauteur, "Annule")
示例2: import_gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def import_gui():
global filename, fileinput, impstatus
# Clear drawing area.
BGL.glClearColor(0.9,0.9,0.9,1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
# Status.
BGL.glRasterPos2i(10,8)
if impstatus == 0:
BGL.glColor3f(0.0,0.0,0.0)
Draw.Text('Importer ready.','tiny')
elif impstatus == 1:
BGL.glColor3f(0.0,0.75,0.0)
Draw.Text('Importing...','tiny')
elif impstatus == 2:
BGL.glColor3f(0.75,0.0,0.0)
Draw.Text('File not found!','tiny')
# Filename input box.
BGL.glRasterPos2i(10,20)
w = Draw.Text('File to import:')
Draw.Button(filename, 3, w+15, 15, 200,20)
#fileinput = Draw.String('',3, w+15,15, 200,20, filename, 512,
# 'Filename to import.')
Draw.Button('Import', 1, w+15+210,15, 40,20)
Draw.Button('Quit', 2, w+15+210+50,15, 40,20)
示例3: draw
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def draw(self):
area = Window.GetAreaSize()
w = area[0]; wPad = int(w*0.03)
h = area[1]; hPad = int(h*0.03)
BGL.glColor3f(0.3, 0.3, 0.3)
BGL.glRectf(wPad-5, h-60, w-wPad+5, h-85)
BGL.glColor3f(1.0,1.0,1.0)
BGL.glRasterPos2i(wPad, h-75)
Draw.Text('Chicken Configuration script', 'large')
BGL.glRasterPos2i(wPad, h-100)
Draw.Text('This script is launched the first time you run Chicken, or when a configuration error has been detected')
BGL.glColor3f(0.5, 0.5, 0.5)
BGL.glRectf(wPad, h-205, w-wPad, h-225)
BGL.glColor3f(1.0,1.0,1.0)
BGL.glRasterPos2i(wPad, h-220)
Draw.Text('Binary Utilities - ')
Draw.Text('if executables such as "pview" are on your PATH, you can leave this on Auto. Otherwise enter the folder manually')
self.bBinPathAuto.update([wPad+5, h-250, w/2-wPad-5, 20])
self.bBinPathManual.update([w/2, h-250, w/2-wPad-5, 20])
if self.bBinPathManual.val:
self.bBinPath.update([wPad+5, h-272, w-2*wPad-90, 20])
self.bBinPathSel.update([w-wPad-85, h-272, 80, 20])
self.bLaunch.update([wPad+5, h-330, 100, 20])
self.bCheck.update([w-wPad-85, h-330, 80, 20])
if self.error is not None:
if self.error is True:
BGL.glColor3f(1.0,0.0,0.0)
BGL.glRasterPos2i(w-wPad-150, h-365)
Draw.Text('Configuration error detected')
else:
BGL.glColor3f(0.0,0.0,0.0)
BGL.glRasterPos2i(w-wPad-200, h-365)
Draw.Text('Configuration checked and saved')
示例4: dotext
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def dotext(self):
## By default this function prints the desired text, in the desired colour centrally in the panel.
## Possibly there will be more options in a leter release.
## Find the vertical centreline of the panel.
centreline=self.left+(self.width/2)
## Find the horizontal centreline of the panel and subtract about half the height of the font (roughly).
textline=self.base+(self.height/2-5)
## Find the length of the string that was passed in.
stringlength=Draw.GetStringWidth(self.text)
## Halve it.
offset=stringlength/2
## Calculate the start point for the text.
titlestart=centreline-offset
## Change to the text colour.
BGL.glColor3f(self.textcolour[0],self.textcolour[1],self.textcolour[2])
## Position raster.
BGL.glRasterPos2i(titlestart,textline)
## Print it.
Draw.Text(self.text)
示例5: doDraw
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def doDraw(self):
# this has black color...
# Draw.Label(self.title,
# self.pos_x, self.pos_y, self.width, self.height)
BGL.glColor3f(*self.color)
BGL.glRasterPos2i(self.pos_x, self.pos_y)
Draw.Text(self.title + self.button.val)
示例6: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def gui(self,):
quitbutton = Blender.Draw.Button("Exit", 1, 0, 0, 100, 20, "Close Window")
y=35
for line in self.msg:
BGL.glRasterPos2i(10,y)
Blender.Draw.Text(line)
y+=15
示例7: drawCamera
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def drawCamera():
global DOF, DOFRADIUS, DOFDIST, SPHERICALCAMERA
## camera settings
col=10; line=200; BGL.glRasterPos2i(col, line); Draw.Text("Camera:")
col=100; line=195; DOF=Draw.Toggle("DOF", DOF_CAMERA, col, line, 120, 18, DOF.val)
col=225; DOFDIST=Draw.Number("Distance", 2, col, line, 120, 18, DOFDIST.val, 0.0, 200.00)
col=350; DOFRADIUS=Draw.Number("Radius", 2, col, line, 120, 18, DOFRADIUS.val, 0.0, 200.00)
col=100; line=170; SPHERICALCAMERA=Draw.Toggle("Spherical", SPHER_CAMERA, col, line, 120, 18, SPHERICALCAMERA.val)
drawButtons()
示例8: drawLights
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def drawLights():
global MESHLIGHTPOWER, DSAMPLES
## meshlight power slider
col=10; line=200; BGL.glRasterPos2i(col, line); Draw.Text("Meshlight:")
col=100; line=195; MESHLIGHTPOWER=Draw.Number("Power", 2, col, line, 120, 18, MESHLIGHTPOWER.val, 1, 15)
## lightserver settings
col=10; line=150; BGL.glRasterPos2i(col, line); Draw.Text("Lightserver:")
col=100; line=147; DSAMPLES=Draw.Number("Direct Samples ", 2, col, line, 250, 18, DSAMPLES.val, 0, 1024);
drawButtons()
示例9: drawAA
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def drawAA():
global MINAA, MAXAA, AASAMPLES
global IMGFILTERW, IMGFILTERH, IMGFILTER
global EXP_ANIM
## aa settings
col=10; line=200; BGL.glRasterPos2i(col, line); Draw.Text("AA:")
col=100; MINAA=Draw.Number("Min AA ", 2, col, line, 120, 18, MINAA.val, -4, 5);
col=230; MAXAA=Draw.Number("Max AA ", 2, col, line, 120, 18, MAXAA.val, -4, 5)
col=360; AASAMPLES=Draw.Number("Samples", 2, col, line, 120, 18, AASAMPLES.val, 0, 32)
col=10; line=175; BGL.glRasterPos2i(col, line); Draw.Text("Image Filter:")
col=100; line=173; IMGFILTER=Draw.Menu("%tImage Filter|box|gaussian|mitchell|triangle|catmull-rom|blackman-harris|sinc|lanczos", FILTER_EVENT, col, line, 120, 18, IMGFILTER.val)
col=10; line=120; EXP_ANIM=Draw.Toggle("Export As Animation", 2, col, line, 140, 18, EXP_ANIM.val)
drawButtons()
示例10: drawAO
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def drawAO():
global OCCLUSSION, OCCBRIGHTR, OCCBRIGHTG, OCCBRIGHTB, OCCDARKR, OCCDARKG, OCCDARKB, OCCSAMPLES, OCCDIST
col=10; line=200; BGL.glRasterPos2i(col, line); Draw.Text("Ambient Occlusion")
col=10; line=175; OCCLUSSION=Draw.Toggle("Amb Occ", 2, col, line, 85, 18, OCCLUSSION.val)
col=100; OCCBRIGHTR=Draw.Number("Bright (R)", 2, col, line, 125, 18, OCCBRIGHTR.val, 0.0, 1.0)
col=230; OCCBRIGHTG=Draw.Number("Bright (G)", 2, col, line, 125, 18, OCCBRIGHTG.val, 0.0, 1.0)
col=360; OCCBRIGHTB=Draw.Number("Bright (B)", 2, col, line, 125, 18, OCCBRIGHTB.val, 0.0, 1.0)
col=100; line=150; OCCDARKR=Draw.Number("Dark (R)", 2, col, line, 125, 18, OCCDARKR.val, 0.00, 1.0)
col=230; OCCDARKG=Draw.Number("Dark (G)", 2, col, line, 125, 18, OCCDARKG.val, 0.0, 1.0)
col=360; OCCDARKB=Draw.Number("Dark (B)", 2, col, line, 125, 18, OCCDARKB.val, 0.0, 1.0)
col=100; line=125; OCCSAMPLES=Draw.Number("Samples", 2, col, line, 125, 18, OCCSAMPLES.val, 0, 256)
col=230; OCCDIST=Draw.Number("Distance", 2, col, line, 125, 18, OCCDIST.val, -1.0, 150.0)
drawButtons()
示例11: Display_Output_Bar
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def Display_Output_Bar(Y_POS, CONTROL_HEIGHT, CONTROL_WIDTH):
""" Create the Display output box."""
Create_Tab(3, Y_POS, CONTROL_WIDTH, Y_POS - CONTROL_HEIGHT, "Output setup", 0)
Draw.PushButton('Select output location', OutputButton, 9, (Y_POS - 41), 130, 18, 'Select output location')
BGL.glRasterPos2i(143, (Y_POS - 36))
if OUTPUTString:
RIGHT_LIMIT = 144
tempString = OUTPUTString
if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)):
while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT):
tempString = tempString[2:]
Draw.Text('...' + tempString)
else:
Draw.Text(OUTPUTString)
else:
Draw.Text('Please select a folder...')
示例12: Display_Camera_Bar
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def Display_Camera_Bar(Y_POS, CONTROL_HEIGHT, CONTROL_WIDTH):
""" Create the Camera setup box. """
Create_Tab(3, Y_POS, CONTROL_WIDTH, Y_POS - CONTROL_HEIGHT, "Camera setup", Camera_Setup_Selection)
global select_all_cameras_button
select_all_cameras_button = Draw.PushButton('Select all cameras', no_action, ((CONTROL_WIDTH / 2) + 3), (Y_POS - 22), (CONTROL_WIDTH / 2) - 9, 16, 'Selects all cameras in the scene', Select_All_Cameras)
if Camera_Setup_Selection['Automatic setup'][0].val:
global camera_number_button
camera_number_button = Draw.Number("Number of cameras:", CameraNumberButton, 9, (Y_POS - 63), (CONTROL_WIDTH / 2) - 9, 18, camera_number_button_value, camera_number_button_minimum, camera_number_button_maximum, 'Number of cameras to be set up in the scene', camButtonClicked, camera_number_button_step)
global camera_latitude_button
camera_latitude_button = Draw.Number("Latitude:", CameraLatitudeButton, ((CONTROL_WIDTH / 2) + 3), (Y_POS - 63), (CONTROL_WIDTH / 2) - 9, 18, camera_latitude_button.val, 0, math.pi/2, 'General latitude of the cameras')
global camera_ontop_button
camera_ontop_button = Draw.Number("Ceiling cameras:", CameraOntopButton, 9, (Y_POS - 84), (CONTROL_WIDTH / 2) - 9, 18, camera_ontop_button.val, 0, 4, 'Number of cameras to be positioned in the ceiling', lambda x,y:None, 10)
if camera_ontop_button.val:
global camera_ontop_latitude_button
camera_ontop_latitude_button = Draw.Number("Ceiling latitude:", CameraOntopLatitudeButton, ((CONTROL_WIDTH / 2) + 3), (Y_POS - 84), (CONTROL_WIDTH / 2) - 9, 18, camera_ontop_latitude_button.val, 0, math.pi/2, 'Latitude of the cameras in the ceiling')
global camera_radius_button
camera_radius_button = Draw.Number("Radius:", CameraRadiusButton, ((CONTROL_WIDTH / 2) + 3), (Y_POS - CONTROL_HEIGHT) + 6, (CONTROL_WIDTH / 2) - 9, 18, camera_radius_button.val, 1, 40, 'The radius of the circle the cameras are placed in, in meters', lambda x,y:None, 10)
if Camera_Setup_Selection['Pre-saved setup'][0].val:
global camera_import_button
camera_import_button = Draw.PushButton('Select camera setup (.xml)', CameraImportButton, 9, (Y_POS - 63), (CONTROL_WIDTH / 2) - 9, 18, 'Select camera setup (.xml)')
BGL.glRasterPos2i(11, (Y_POS - 80))
if CAMString:
RIGHT_LIMIT = 6
tempString = CAMString
if (Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT)):
while Draw.GetStringWidth('...' + tempString) > (CONTROL_WIDTH - RIGHT_LIMIT):
tempString = tempString[2:]
Draw.Text('...' + tempString)
else:
Draw.Text(CAMString)
else:
Draw.Text('Please select a file...')
global camera_export_button
camera_export_button = Draw.PushButton('Export current setup', CameraExportButton, 9, (Y_POS - CONTROL_HEIGHT) + 6, (CONTROL_WIDTH / 2) - 9, 18, 'Press this button to save your camera setup')
示例13: draw
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def draw(): # Define the draw function (which draws your GUI).
global EVENT_Button
global EVENT_Type
global EVENT_shtoguntype
global EVENT_String
global EVENT_Bitmap
global EVENT_WVTU_1
global Object_Button
global Object_Type
global Object_shtoguntype
global Object_String
global Object_Bitmap
global Object_WVTU_1
BGL.glClearColor(0.244564, 0.244406, 0.244406, 0.0)
BGL.glClear(GL_COLOR_BUFFER_BIT)
BGL.glColor3f(1.000000, 1.000000, 1.000000)
Object_Button = Draw.Button("Connect to Shotgun", EVENT_Button, 20, 8, 200, 20, "")
BGL.glRasterPos2i(100, 108)
Object_Type = Draw.Text("Type")
Object_shtoguntype = Draw.Menu("Asset", EVENT_shtoguntype, 20, 100, 60, 20, Object_shtoguntype.val, "Type of Shotgun entry")
Object_String = Draw.String("id : ", EVENT_String, 20, 60, 60, 20,Object_String.val, 399, "ID # for the Shotgun entry")
BGL.glRasterPos2i(24, 210)
BGL.glDrawPixels(0, 0, GL_RGB, GL_UNSIGNED_BYTE, Object_Bitmap)
BGL.glRasterPos2i(24, 152)
Object_WVTU_1 = Draw.Text("WVTU "+VERSION+"")
示例14: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def gui(): # the function to draw the screen
global mystring, mymsg, toggle
if len(mystring) > 90: mystring = ""
BGL.glClearColor(0,0,1,1)
BGL.glClear(BGL.GL_COLOR_BUFFER_BIT)
BGL.glColor3f(1,1,1)
Draw.Toggle("Toggle", 1, 10, 10, 55, 20, toggle,"A toggle button")
BGL.glRasterPos2i(72, 16)
if toggle: toggle_state = "down"
else: toggle_state = "up"
Draw.Text("The toggle button is %s." % toggle_state, "small")
BGL.glRasterPos2i(10, 230)
Draw.Text("Type letters from a to z, ESC to leave.")
BGL.glRasterPos2i(20, 200)
Draw.Text(mystring)
BGL.glColor3f(1,0.4,0.3)
BGL.glRasterPos2i(340, 70)
Draw.Text(mymsg, "tiny")
示例15: gui
# 需要导入模块: from Blender import BGL [as 别名]
# 或者: from Blender.BGL import glRasterPos2i [as 别名]
def gui():
global active_object, file_str, local_toggle, global_toggle, all_to_triangle
my_export_button = Draw.PushButton("Export", 3, 100, 50, 70, 20, "Export active object to selected file.")
# my_local_toggle = Draw.Toggle("local coordinates", 0, 100, 100, 150, 20, local_toggle, "When selected local mesh coordinates will be exported.")
# my_global_toggle = Draw.Toggle("global coordinates", 1, 250, 100, 150, 20, global_toggle, "When selected global mesh coordinates will be exported.")
# my_triangles_toggle = Draw.Toggle("Quads to Triangles", 5, 100, 75, 150, 20, all_to_triangle, "When selected all faces will be transformed to triangles.")
# BGL.glRasterPos2i(255, 80)
# Draw.Text("!! THIS WILL ALTER YOUR OBJECT !!", "normal")
my_file_choose_btn = Draw.PushButton("Choose file", 2, 100, 150, 120, 20, "Click here to select a file to save to")
my_exit_btn = Draw.PushButton("Exit", 4, 200, 50, 70, 20, "Click here to abort and exit.")
BGL.glRasterPos2i(230, 155)
Draw.Text(file_str, "normal")
BGL.glRasterPos2i(100, 175)
Draw.Text("Selected object:", "normal")
BGL.glRasterPos2i(230, 175)
Draw.Text(active_object.name, "normal")