Re: Max integer constants?

Date : Sat, 1 Jul 2006 14:34:56 -0400
To : XSI(at)Softimage.COM
From : "Bernard Lebel" <3dbernard(at)gmail.com>
Subject : Re: Max integer constants?
Fair enough, it's clear now.


Thanks! Bernard



On 6/30/06, francois.painchaud(at)sympatico.ca
<francois.painchaud(at)sympatico.ca> wrote:
Salut Bernard,

When creating the parameter with AddParameter3, use the default values (in Python, use None) for Min and Max:
"Minimum value of the custom parameter. ... For all other numerical type the default will be minimum value possible for the type ..."
"Maximum value of the custom parameter. ... For all other numerical type the default will be minimum value possible for the type ..."

Once the parameter is created, you can retrieve the actual values with the Parameter object properties Min and Max.

For example (in Python):

from win32com.client import constants as xsi
XSI = Application
prop = XSI.ActiveSceneRoot.AddCustomProperty( "MyCustomProp" )
paramInt4 = prop.AddParameter3( "Int4", xsi.siInt4, 0, None, None )
XSI.LogMessage( "Int4 Min = %d" % paramInt4.Min )
XSI.LogMessage( "Int4 Max = %d" % paramInt4.Max )
paramFloat = prop.AddParameter3( "Float", xsi.siFloat, 0.0, None, None )
XSI.LogMessage( "Float Min = %e" % paramFloat.Min )
XSI.LogMessage( "Float Max = %e" % paramFloat.Max )

logs on my workstation:

#INFO : Int4 Min = -2147483648
#INFO : Int4 Max = 2147483647
#INFO : Float Min = -3.402823e+38
#INFO : Float Max = 3.402823e+38

Cheers,
François

> De: "Bernard Lebel" <3dbernard(at)gmail.com>
> Date: 2006/06/30 ven. PM 07:45:17 GMT-04:00
> À: XSI(at)Softimage.COM
> Objet: Re: Max integer constants?
>
> I'm not quite sure what to do with your answer, Luc-Éric!
>
> For example, one of the things I'm using these constants for is with a
> read-only parameter that matches a database ID key, which in this case
> is a long unsigned integer. The value of the parameter given by
> database transactions. I just want to make sure that if the database
> returns an integer higher than the siUInt2 max value (65,535), the
> parameter can actually deal with it.
>
> Thanks for noticing the wrong negative value (although I would have
> thought the opposite, since the sign takes one character....)
>
> Bernard


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.