Ultimate Blender 2.37b - Resolution Switching

Hi all, I added a new feature from the tuhopuu2, now you can change the resolution in realtime using python, :o .
Note: Linux users must have support for Xrand.

Both files comes with a Rasterizer_example.py code, would be great if someone could make an example for the people that do not know python. :smiley:

I was trying to port the realtime Shadow mapping, but the new Nvidia driver is not allowing me to do it, so until they do not fix it, I will not restart this work.

Download here

Here is the Rasterizer example code:

def setDisplayResolution(width, height, bpp, rate):
 """
 Sets the display resolution.
 
 The user's desktop resolution will be restored on Blender exit.
 
 Note: X11 platforms can't set bpp.
 
 Example::
  import Rasterizer
  
  Rasterizer.setDisplayResolution(800, 600, 32, 60)
 
 @param width: New display width, in pixels
 @type width: integer
 @param height: New display height, in pixels
 @type height: integer
 @param bpp: The colour depth to set the display to: valid values are 8, 16, 24 and 32.
 @type bpp: integer
 @param rate: The refresh rate to set the display
 @type rate: integer
 """

def getCurrentResolution():
 """
 Gets the current display resolution.
 
 Example::
  import Rasterizer
  
  currentres = Rasterizer.getCurrentResolution()
  print "Width: ", currentres[0]
  print "Height: ", currentres[1]
  print "BPP: ", currentres[2]
  print "Refresh Rate: ", currentres[3]
 
 @return: The current display resolution, in the form (width, height, bpp, rate)
 @rtype: tuple
 """

def getValidResolutions():
 """
 Gets a list of valid display resolutions.
 
 Example::
  import Rasterizer
  
  validres = Rasterizer.getValidResolutions()
  print "Width\	Height\	BPP\	Refresh Rate"
  for res in validres:
   print res[0], "\	", res[1], "\	", res[2], "\	", res[3]
 
 @return: A list of valid display resolutions, in the form [(width, height, bpp, rate)]
 @rtype: list
 """

Cya :stuck_out_tongue:

Wow :slight_smile:
Cool stuff dreamkatana !
You should work with the Game engine with all the other people(if you dont already do it?)

i agree, you should work on the official blender
because you could make it very good and the people already working on it could use some help (if you dont already)

Excellent work, Dreamkatana! We should see your work on Blender 2.38 !

If dreamkatana contacts me, I can make sure his gameengine work will be merged into the next official release, 2.38

Erwin

blender at erwincoumans.com

Hi Erwin,
I’ve sent you an email to [email protected], but I think that you do not use it, so I will repass the message on the another email that you told me in the PM.

Hi Erwin,
I’ve sent you an email to [email protected], but I think that you do not use it, so I will repass the message on the another email that you told me in the PM.

Erwin no longer works at Havoc!

New build with the 3 new features that Lagan has made:

  • Append scene actuator
  • Unappend scene actuator
  • getPropertyList()

Get here.

On the next release, could someone add the ability to acces the dynamic materials from withing python: I think it would be a great way to increase friction to simulate breaking. Just a suggestion!
-Brian

If you are using anisorropic friction for a car, you clould edit that in python.

If you are using anisorropic friction for a car, you clould edit that in python.

Really?? I searched for that through the game kit and online docs and couldn’t find a way to access it. Would you tell me the syntax? Thanks,
-Brian