Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7087505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:40:56+00:00 2026-05-28T07:40:56+00:00

Currently I want to read some data (metadata, scene names, mesh count, vertices count

  • 0

Currently I want to read some data (metadata, scene names, mesh count, vertices count …) from a .blend file with the unpack() function of PHP refering to the Blender SDNA documentation:

http://www.atmind.nl/blender/blender-sdna-256.html

Is there some easy solution to read all these information with some existing classes or libraries or do I have to read block by block from the file and write my own functions / clas / library (so I can create something like an object)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:40:57+00:00Added an answer on May 28, 2026 at 7:40 am

    After consultation with php manual I can tell you that php just doesn’t provide way to read binary files, but I think there’s quite nice way to do this (inspirited by c and fread)

    class BinaryReader {
        const FLOAT_SIZE = 4;
    
        protected $fp = null; // file pointer
        ...
    
        public function readFloat() {
             $data = fread( $fp, self::FLOAT_SIZE);
             $array = unpack( 'f', $data);
             return $array[0];
        }
    
         // Reading unsigned short int
         public function readUint16( $endian = null){
              if( $endian === null){
                   $endian = $this->getDefaultEndian();
              }
    
              // Assuming _fread handles EOF and similar things
              $data = $this->_fread( 2);
              $array = unapack( ($endian == BIG_ENDIAN ? 'n' : 'v'), $data);
              return $array[0];
         }
    
        // ... All other binary type functions
    
        // You may also write it more general:
        public function readByReference( &$variable){
            switch( get_type( $variable)){
                case 'double':
                    return $this->readDouble();
                ...
            }
        }
    }
    

    If you have any improvements or tips, just post them in the comment I’ll be glad to extend the answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to read N bytes of data from a file stream and append
I want to read and write from serial using events/interrupts. Currently, I have it
I want to read line n1->n2 from file foo.c into the current buffer. I
I'm doing some Wave file handling and have them read from disk into an
I currently learning about scrum and want to learn from experienced professionals in the
I want to be able to read vCard and vCalendar data using .NET, I
I'm currently working on an app for the Android OS that displays some data.
I want to read the registry to find the current PowerPoint version. However this
I want the tr that's currently hovered over to change color, and then change
I want to get the currently selected item (text, image, etc) and display in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.