Jump to content


Call me 0x000000ff

magic number 0x000000ff hdk c++ mantragora selector

  • Please log in to reply
10 replies to this topic

#1 mantragora

mantragora

    Houdini Master

  • Members
  • PipPipPipPip
  • 710 posts
  • Joined: 08-December 11
  • Location:here
  • Name:Real Time

Posted 13 May 2013 - 05:48 AM

WTF, right ?! Yeah, I bet your first reaction for this title was the same as my when I saw this number :)

I found this diamond while browsing HDK examples and I would really, REALLY, like to know how I could ever, EVER, possibly figure it out on my own.

Basically, you bind selector to operator and this => "0x000000ff" <= is the 8 argument that you pass to "bindSelector()" method as prim/point mask selection.

Q1: Is there anyone that could explain me what it means and where I could find more info about it ?.
Q2: Are there any other magic numbers that I should be aware of ?

Cheers

PS.
I found it in this example http://www.sidefx.co..._c-example.html

Edited by mantragora, 13 May 2013 - 10:20 AM.

magic happens here... sometimes

Vimeo
Twitter
 
 
 "If it's not real-time, it's a piece of shit not a state of the art technology" - me


#2 Macha

Macha

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,712 posts
  • Joined: 23-July 08
  • Location:Pixar Canada
  • Name:Marc ♥

Posted 13 May 2013 - 01:15 PM

255 ?

My Vimeo

LinkedIn

improve side effects - use haskell


#3 mantragora

mantragora

    Houdini Master

  • Members
  • PipPipPipPip
  • 710 posts
  • Joined: 08-December 11
  • Location:here
  • Name:Real Time

Posted 13 May 2013 - 01:27 PM

255 ?


That's answer for the first or second question ?

magic happens here... sometimes

Vimeo
Twitter
 
 
 "If it's not real-time, it's a piece of shit not a state of the art technology" - me


#4 symek

symek

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,673 posts
  • Joined: 02-November 04
  • Location:Waw/Pol
  • Name:Szymon Kapeniak

Posted 13 May 2013 - 01:49 PM

44
(...) It was late, late in the evening, the lovers they were gone;
The clocks had ceased their chiming, and the deep river ran on.

#5 marty

marty

    Houdini Master

  • Members
  • PipPipPipPip
  • 768 posts
  • Joined: 01-July 12
  • Location:New Zealand
  • Name:Marty Blumen

Posted 13 May 2013 - 07:10 PM

1. looks like standard hexadecimal. converting this to decimal should be (16*15)+15 = 255

more info here:
http://www.codeproje...and-Hexadecimal

2. Yes, all numbers in hexadecimal look like this, you can use
http://easycalculati...x-converter.php

#6 mantragora

mantragora

    Houdini Master

  • Members
  • PipPipPipPip
  • 710 posts
  • Joined: 08-December 11
  • Location:here
  • Name:Real Time

Posted 13 May 2013 - 07:50 PM

1. looks like standard hexadecimal. converting this to decimal should be (16*15)+15 = 255

more info here:
http://www.codeproje...and-Hexadecimal

2. Yes, all numbers in hexadecimal look like this, you can use
http://easycalculati...x-converter.php


I know how it looks.I don't know WHY it's there and WHAT it means for the code. Can I write there any number ? Or is there some specified code table that should be used there ? If I find in the middle of the code some number most of the time I prefer to know why it's there. Especially when it specifies prim/point mask selection and is not commented anywhere.

Edited by mantragora, 13 May 2013 - 07:56 PM.

magic happens here... sometimes

Vimeo
Twitter
 
 
 "If it's not real-time, it's a piece of shit not a state of the art technology" - me


#7 edward

edward

    Grand Master

  • Members
  • PipPipPipPipPip
  • 3,833 posts
  • Joined: 10-September 02
  • Name:e.d.w.a.r.d. .

Posted 14 May 2013 - 01:30 AM

The primmask refers to *_FILEID enums in GEO_PrimTypeCompat.h. A regular GEO_PrimTypeCompat mask can be used if you first convert it using GEO_PrimTypeCompat::convertToFileFromMask(). I've better documented the bindSelector() method for the next major Houdini release.
don't panic!

#8 mantragora

mantragora

    Houdini Master

  • Members
  • PipPipPipPip
  • 710 posts
  • Joined: 08-December 11
  • Location:here
  • Name:Real Time

Posted 14 May 2013 - 03:16 AM

Thanks Edward!

magic happens here... sometimes

Vimeo
Twitter
 
 
 "If it's not real-time, it's a piece of shit not a state of the art technology" - me


#9 mantragora

mantragora

    Houdini Master

  • Members
  • PipPipPipPip
  • 710 posts
  • Joined: 08-December 11
  • Location:here
  • Name:Real Time

Posted 14 May 2013 - 04:04 AM

Oh, there is one more thing.

I looked into PrimTypeCompat.h that is delivered with my Houdini build (12.5.393) and there is no Enum with this code specified inside. I got 20 positions to choose from:
0x00000001, // Polygon
0x00000002, // NURB Curve
0x00000004, // Rational Bezier Curve
0x00000010, // Linear patch
0x00000020, // NURB Surface
0x00000040, // Rational Bezier Surface
0x00000f00, // TPsurf Paste Hierarchy
0x00001000, // Ellipse/Circle
0x00002000, // Ellipsoid/Sphere
0x00004000, // Cylinder
0x00008000, // Particle
0x00100000, // Meta-ball
0x00200000, // Super quadric
0x00300000, // Meta-line
0x00400000, // Meta-bezier
0x00500000, // Meta-triangle
0x10000000, // Triangle fans
0x20000000, // Generalized triangle strips
0x30000000, // Triangular beziers
0x40000000, // Voxel volume

Online verion of this file contains even less positions http://www.sidefx.co..._8h_source.html. Is it mean that the code example contains deprecated number or it's just omission in the code?

Edited by mantragora, 14 May 2013 - 04:24 AM.

magic happens here... sometimes

Vimeo
Twitter
 
 
 "If it's not real-time, it's a piece of shit not a state of the art technology" - me


#10 edward

edward

    Grand Master

  • Members
  • PipPipPipPipPip
  • 3,833 posts
  • Joined: 10-September 02
  • Name:e.d.w.a.r.d. .

Posted 14 May 2013 - 03:32 PM

You see how some of those numbers are powers of 2? It means that they're bit flags. So 0xFF will match any of those first 6 primitive types.

Random Google link http://forum.codecal...l-with-example/
don't panic!

#11 mantragora

mantragora

    Houdini Master

  • Members
  • PipPipPipPip
  • 710 posts
  • Joined: 08-December 11
  • Location:here
  • Name:Real Time

Posted 14 May 2013 - 03:56 PM

Again, Thank you.

magic happens here... sometimes

Vimeo
Twitter
 
 
 "If it's not real-time, it's a piece of shit not a state of the art technology" - me






Also tagged with one or more of these keywords: magic number, 0x000000ff, hdk, c++, mantragora, selector

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users