Python scripting to dynamically generate 3D human models

Terry Reedy tejarex at yahoo.com
Fri Apr 19 11:43:08 EDT 2002


"Woon Shan Chin" <woonshan at time.net.my> wrote in message
news:mailman.1019218239.16981.python-list at python.org...
> Hi,
>
> I heard about 'Python scripting' from a member experts-exchange.com;
an
> IT knowledge sharing community. I'm working on a virtual fitting
room
> program, that needs to dynamically generate 3D human models during
run-
> time (based on users' input of their body measurements for eg.). So,
I
> heard from a member in that community that I could import Poser's 3D
> human models into my program and use Python script to read users'
input
> of their measurements at runtime and make changes in the parameters
of
> the basic model such as wasit, height, etc., so as to regenerate the
3D
> human model that matches the users' input.
>
> Eventually, Python scripting is something new to me and I would like
to
> know how I can use Python script to perform the functionality
mentioned
> above. For instance, the program I am developing is a MFC
application
> written in Visual C++. How could I link the Python scripts to my
> program then?

There are two ways to interface the standard version of Python, which
is written in portable C with other C or C++ functions.  One is to
have C++ use the Python interpreter as a subroutine library.  This is
called 'embedding' (of Python into C++).  This requires you to learn
the Python C API (Application Program Interface).  This is NOT what
the 'member' was suggesting.

The other is to have Python use your C++ functions as a fast-running
library.  This is called 'extending (of Python with C++)..  This
requires you to learn Python.  It also requires that you 'wrap' your
C++ functions with interface functions (also in C/C++).  Much of the
wrapping can be done automatically with a program called Swig.  This
IS what the 'member' was suggesting.

I suggest that, when ready, you go to www.python.org and read the
tutorial.  Since you are already programming in another language, you
should be able to try out simple Python programs in a few hours.  If
you decide you like the style of Python programming (and some people
just do not), then you can look for the documentation on 'extending'.
You will also have to choose a GUI package to use.  If you have
trouble finding something on the Python site, try searching web sites
and/or the newsgroup archives with google.

Terry J. Reedy





More information about the Python-list mailing list