Giter Club home page Giter Club logo

io_scene_cgf_extras's Introduction

io_scene_cgf_extras

Intro

Some extra python scripts for converting CGF file format to other file format, such as fbx, obj, etc. The scripts is working in AION.

Prerequisite

Particular scripts requires executing in the runtime environment on Blender. Such as cgf2fbx.py, convert a cgf/caf to fbx, load_geomap.py etc.

Due to the python API on Blender 2.8, unsupported for now.

The kind of scripts was working on Blender 2.79, so should get work correctly on Blender 2.6 too.

Execute as a command line in terminal, replace the default python runtime by the Blender binary executable.

Run in Background mode.

{blender_executable} -b --python {script} -- {script_arguments}

Or run the script in Blender 's Console directly, e.g.

# Blender 2.79b Python Console.

# defines the filename in the locals()
filename = {script_filename}
# Run the given script by exec mode.
exec(compile(open(filename).read(), filename, 'exec'))

Particular scripts has arguments required, so passing the arguments as the variables in the locals context, just define the the argument as the local variable will be work fine.

# Blender 2.79b Python Console.

# defines the arguments
cgf_file='/Volumes/assets/Objects/monster/mosbear/mosbear.cgf'
# defines the filename in the locals()
filename = ~/Projects/io_scene_cgf_extras/cgf2fbx.py
# Run the given script by exec mode.
exec(compile(open(filename).read(), filename, 'exec'))

More information about how to execute with Blender, see Tips and Tricks in blender.org

Scripts

cgf2fbx.py

Convert CGF/CAF file format to fbx, including the Meshes, Armatures, Animations, Materials, etc.

Prerequisite

blender executable runtime enviroment required.

Usage

A simple commond for converting a given cgf file into fbx, no animation data exporting, just includes the meshes and the materials:

blender -b --python cgf2fbx.py -- [CGF file]

Resolves the animations data and export to fbx, so the final fbx including the meshes, materials, animations, etc.

blender -b --python cgf2fbx.py -- [-a|--anim] [CGF file]

Resolves the animations data and export to fbx, but doesn't export the meshes, just the animation data only.

blender -b --python cgf2fbx.py -- --anim_only [CGF file]

dds2png.py

Convert file format DDS to PNG.

Prerequisite

dds2png.py require module PIL.

Install the PIL module via pip, following below:

On python 2.x:

pip install image

On python 3.x, choose pillow instead of image:

pip install pillow

Usage

dds2png.py [DDS files...]

The output files will generating at the same directory as input files.

combine_tile.py

Combines x * y tiles image to a single image.

Prerequisite

The same as dds2png.py, this required PIL module as well. See dds2png.py.

Usage

A simple example run in command-line combining ZoneMap from radar display:

combine_tile.py -x 256x256 -p radar_df1_%03d.dds -d /Volumes/assets/Textures/ui/zonemap/df1 -o DF1.png

load_geomap.py

Load terrain data from GEO data into Blender.

Prerequisite

the load_geomap.py requires blender as the executable runtime, see cgf2fbx.py

Usage

There're a example command-line for importing GEO mapdata into blender:

blender --python load_geomap.py -- -d /Volumes/Untitled/Resources/geo_data/models /Volumes/Untitled/Resources/geo_data/220010000.bin

When finished executing the load_geomap.py, will showing the terrain in the blender application.

h322r16.py

A tool for converting .h32 file format into .r16 or .raw, make working correctly in Unity, UE4, WorldMachine, etc. The type of heightmap converted is setting to unsigned 16bit little endian.

Prerequisite

The same as dds2png.py, requires PIL module as well. see dds2png.py

Usage

A simple usage show at command-line mode:

h322r16.py [H32 files ...]

Specified -o to the output destination.

io_scene_cgf_extras's People

Contributors

keyhom avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.