************************************************************************
To set up Wings3D plugin develop environment.
************************************************************************
This memo written by tkbd, 1.17.2015
This is a way to configure a simple environment for creating a single plugin.
(OSX)
*** 1.Add Compile feature from Erlan/OTP17.3 to Wings3D1.5.3 binary
Download Erlang/otp source, and Download Wings3D's binarie package. Unarchive their.
Erlang/Otp's "compile" folder copy into Wings3D's "lib" folder.
*** 2.Gathering header files and tools.erl from Wings3D souce code,and copy to your working directory.
For example, it is assumed that use a name "working" for plugin development directory.
Copy files are nessesary, tools.erl,wings_intl.hrl,wings.hrl and e3d.hrl (Other necessary.)
Their names and position as follows.
/Users/working
tools.erl
/intl_tools
wings_intl.hrl
/inc
wings.hrl
e3d.hrl
*** 3.Run Wings3D by Terminal.and use Erlang shell.
See following site:Exploring Wings3D through the Erlang Shell
bash
export ROOTDIR="/Applications/Wings3D 1.5.3.app/Contents/Resources"
export BINDIR=$ROOTDIR/bin
export ESDL_DIR=$ROOTDIR/lib
export EMU=beam
export PROGNAME=`echo $0 | sed 's/.*\///'`
exec "$BINDIR/erlexec" -run wings_start start_halt ${1+"$@"}
*** 4.Erlang Sell is Start
Compile tools.erl and make beam file, and put the beam file into root of working directory.
tools.beam file is nessesary for plugin's compile.
Erlang/OTP 17 [erts-6.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V6.0 (abort with ^G)
wings-1.5.3
Reading preferences from: /Users/**********/Preferences/Wings3D/Preferences.txt
/Users/working <--------Current directory on Erlang Sell, Check it!
Trying OpenGL modes
[{buffer_size,32},{depth_size,32},{stencil_size,8},{accum_size,16}]
Actual: RGBA: 8 8 8 8 Depth: 24 Stencil: 8 Accum: 32 32 32 32
Using GPU shaders.
1>pwd().
1>/home
2>cd("/Users/working")
2>OK
3>c("tools.erl").
3>OK
now
/Users/working
tools.erl
tools.beam <-----------now you make it
/intl_tools
wings_intl.hrl
/inc
wings.hrl
e3d.hrl
************************************************************************
Plugin Development
************************************************************************
*** 5.Run Wings3D by Terminal.and use Erlang shell.
now
/Users/working
wpc_test.erl <---------- Put file for Development target
tools.erl
tools.beam
/intl_tools
wings_intl.hrl
/inc
wings.hrl
e3d.hrl
Run Wings3D for use Erlang shell by terminal...
bash
export ROOTDIR="/Applications/Wings3D 1.5.3test.app/Contents/Resources"
export BINDIR=$ROOTDIR/bin
export ESDL_DIR=$ROOTDIR/lib
export EMU=beam
export PROGNAME=`echo $0 | sed 's/.*\///'`
exec "$BINDIR/erlexec" -run wings_start start_halt ${1+"$@"}
for example
cd("Users/working").
c("./wpc_test.erl",[{i,"./inc/"}]).
Before compile your plugin , make an ailias/shortcut for Wings3D's plugin folder which your plugin file put into.
So you can run Wings3D for plugin test.
Note:
In some plugin require header file. see each plugin's source.
In some plugin need tools.beam
if you doesn't set include directory,An error will occuer.
wpc_ex1.erl:122: can't find include file "e3d.hrl"
Where is current working directory?,
Use pwd(). command in Erlang shell,and change for go to the direcotry.
************************************************************************
This enviroment also can access Wings3D through Erlang Shell.
************************************************************************
See following site:Exploring Wings3D through the Erlang Shell
Help please!
Try help(). command. It will display about ** shell internal commands **
Try press "tab" key on Erlang Sell,You can know the current loaded Wings3D modules name.
You can try some examples.
if rr(wings) command doesn't work... try using a file name.
Use rr("./inc/wings.hrl")
this command mean read wings.hrl which located in current working directory.
Select some object... and type...
f(),
cd("Users/working"),
rr("./inc/wings.hrl"),
St = wpa:get_state(),
#st{shapes=Shapes,sel=Sel} = St,
We = gb_trees:get(1, St#st.shapes),
Vs = array:sparse_to_list(We#we.vp).
get result
[{0.0,1.0886621079036347,0.0},
{0.0,-0.5443310539518174,1.1547005383792515},
{-1.0,-0.5443310539518174,-0.5773502691896258},
{1.0,-0.5443310539518174,-0.5773502691896258}]
bash
export ROOTDIR="/Applications/Wings3D 1.5.3.app/Contents/Resources"
export BINDIR=$ROOTDIR/bin
export ESDL_DIR=$ROOTDIR/lib
export EMU=beam
export PROGNAME=`echo $0 | sed 's/.*\///'`
exec "$BINDIR/erlexec" -run wings_start start_halt ${1+"$@"}
f(),
cd("Users/user"),
rr("./inc/wings.hrl"),
St = wpa:get_state(),
#st{shapes=Shapes,sel=Sel} = St,
We = gb_trees:get(1, St#st.shapes),
Vs = array:sparse_to_list(We#we.vp).