Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
# /plugins_src/autouv/
/plugins_src/autouv/autouv_en.lang

# /plugins_src/scripting/docs/generated/
/plugins_src/scripting/docs/generated/*

# /plugins_src/fbx/
/plugins_src/fbx/*.o
/plugins_src/fbx/*.obj
Expand Down
1 change: 1 addition & 0 deletions plugins/scripting/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains the scripting plugin.
1 change: 1 addition & 0 deletions plugins/scripting/wpc_scripting_shapes_init/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains files for the scripting plugin.
1 change: 1 addition & 0 deletions plugins/scripting/wpc_scripting_shapes_init/py/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains the python files for scripting.
1 change: 1 addition & 0 deletions plugins/scripting/wpc_scripting_shapes_init/scm/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains the scheme files for scripting.
3 changes: 3 additions & 0 deletions plugins_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ subdirs:
(cd primitives; $(MAKE))
(cd commands; $(MAKE))
(cd autouv; $(MAKE))
(cd scripting; $(MAKE))

template: opt
$(ERL) -pa $(WINGS_INTL) -noinput -run tools generate_template_files $(EBIN)
Expand All @@ -64,6 +65,7 @@ subdirs_lang:
(cd primitives; $(MAKE) lang)
(cd commands; $(MAKE) lang)
(cd autouv; $(MAKE) lang)
(cd scripting; $(MAKE) lang)

clean: subdirs_clean
rm -f $(TARGET_FILES)
Expand All @@ -74,6 +76,7 @@ subdirs_clean:
(cd primitives; $(MAKE) clean)
(cd commands; $(MAKE) clean)
(cd autouv; $(MAKE) clean)
(cd scripting; $(MAKE) clean)

$(EBIN)/%.beam: $(ESRC)/%.erl
$(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<
125 changes: 125 additions & 0 deletions plugins_src/scripting/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#
# Makefile --
#
# Makefile for building plug-ins for scripting.
#
# Copyright (c) 2001-2013 Bjorn Gustavsson
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# $Id: Makefile,v 1.14 2006/08/02 22:44:40 antoneos Exp $
#
include ../../erl.mk

.SUFFIXES: .erl .jam .beam .yrl .xrl .bin .mib .hrl .sgml .html .ps .3 .1 \
.fig .dvi .tex .class .java .pdf .psframe .pscrop

ESRC=.
WINGS_INTL=../../intl_tools
EBIN=../../plugins/scripting
WINGS_TOP=../../..
WINGS_E3D=../../e3d

ifeq ($(TYPE),debug)
TYPE_FLAGS=-DDEBUG
else
TYPE_FLAGS=
endif

MODULES= \
wpc_scripting_shapes \
scripting_engines

INIT_SCRIPT_SRC=$(ESRC)/init_scripts
INIT_SCRIPT_EBIN=$(EBIN)/wpc_scripting_shapes_init
INIT_SCRIPT_PY_SRC=$(INIT_SCRIPT_SRC)/py
INIT_SCRIPT_PY_EBIN=$(INIT_SCRIPT_EBIN)/py
INIT_SCRIPT_SCM_SRC=$(INIT_SCRIPT_SRC)/scm
INIT_SCRIPT_SCM_EBIN=$(INIT_SCRIPT_EBIN)/scm

TARGET_FILES= $(MODULES:%=$(EBIN)/%.beam)


# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
ERL_COMPILE_FLAGS += -Werror +nowarn_match_float_zero -I $(WINGS_TOP) \
$(TYPE_FLAGS) -pa $(WINGS_INTL) +debug_info
# ----------------------------------------------------
# Targets
# ----------------------------------------------------

opt debug:
$(MAKE) TYPE=$@ common

template: opt
$(ERL) -pa $(WINGS_INTL) -noinput -run tools generate_template_files $(EBIN)

lang: template
cp *.lang $(EBIN)
$(ERL) -pa $(WINGS_INTL) -noinput -run tools diff_lang_files $(EBIN)

common: $(TARGET_FILES) $(INIT_SCRIPT_EBIN) subdirs

subdirs:
(cd docs; $(MAKE))

clean:
rm -f $(TARGET_FILES)
rm -f core
(cd docs; $(MAKE) clean)

SH?=sh

$(EBIN)/%.beam: $(ESRC)/%.erl
$(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $<

PY_FILES= init w3d_e3d w3d_int w3d_newshape
PY_FILES_1=$(PY_FILES:%=$(INIT_SCRIPT_PY_EBIN)/%.py)

SCM_FILES= init_env_csi init_env_gauche
SCM_FILES_1=$(SCM_FILES:%=$(INIT_SCRIPT_SCM_EBIN)/%.scm)

$(INIT_SCRIPT_EBIN): $(INIT_SCRIPT_EBIN)/callable.conf \
$(INIT_SCRIPT_EBIN)/defaults.conf \
$(INIT_SCRIPT_EBIN)/python.script-init-conf \
$(INIT_SCRIPT_EBIN)/scheme.script-init-conf \
$(INIT_SCRIPT_PY_EBIN)/w3d_we.py \
$(INIT_SCRIPT_SCM_EBIN)/init.scm \
$(PY_FILES_1) \
$(SCM_FILES_1)


$(INIT_SCRIPT_EBIN)/%.conf: $(INIT_SCRIPT_SRC)/%.conf
cp $< $(INIT_SCRIPT_EBIN)/
$(INIT_SCRIPT_EBIN)/%.script-init-conf: $(INIT_SCRIPT_SRC)/%.script-init-conf
cp $< $(INIT_SCRIPT_EBIN)/
$(INIT_SCRIPT_PY_EBIN)/%.py: $(INIT_SCRIPT_PY_SRC)/%.py
cp $< $(INIT_SCRIPT_PY_EBIN)/
$(INIT_SCRIPT_SCM_EBIN)/%.scm: $(INIT_SCRIPT_SCM_SRC)/%.scm
cp $< $(INIT_SCRIPT_SCM_EBIN)/

# Generate w3d_we.py file from callable.conf
$(INIT_SCRIPT_PY_EBIN)/w3d_we.py: $(INIT_SCRIPT_PY_SRC)/w3d_we.1.py \
$(INIT_SCRIPT_SRC)/callable.conf \
$(INIT_SCRIPT_SRC)/py-modnames
$(SH) ./tools/gen-init-we-script.sh \
"$(INIT_SCRIPT_PY_SRC)/w3d_we.1.py" \
- \
"$(INIT_SCRIPT_SRC)/callable.conf" \
"$(INIT_SCRIPT_SRC)/py-modnames" py \
> "$(INIT_SCRIPT_PY_EBIN)/w3d_we.py"

# Generate init.scm file from callable.conf
$(INIT_SCRIPT_SCM_EBIN)/init.scm: $(INIT_SCRIPT_SCM_SRC)/init.1.scm \
$(INIT_SCRIPT_SRC)/callable.conf \
$(INIT_SCRIPT_SRC)/scm-modnames \
$(INIT_SCRIPT_SCM_SRC)/init.2.scm
$(SH) ./tools/gen-init-we-script.sh \
"$(INIT_SCRIPT_SCM_SRC)/init.1.scm" \
"$(INIT_SCRIPT_SCM_SRC)/init.2.scm" \
"$(INIT_SCRIPT_SRC)/callable.conf" \
"$(INIT_SCRIPT_SRC)/scm-modnames" scm \
> "$(INIT_SCRIPT_SCM_EBIN)/init.scm"

108 changes: 108 additions & 0 deletions plugins_src/scripting/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#
# Makefile --
#
# Makefile for building scripting documentation
#
# Copyright (c) 2025 Edward Blake
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#

AWK?=awk
MKDIR?=mkdir -p
PACK_MANUAL?=../../../tools/pack_manual
ESCRIPT?=escript

FILES= \
en/INDEX \
en/README.txt \
en/wscr/intro.txt \
en/wscr/langfiles.txt \
en/wscr/pluginscripts.txt \
en/wscr/query.txt \
en/wscr/scriptfolders.txt \
en/wscr/directives/type.txt \
en/wscr/directives/name.txt \
en/wscr/directives/mode.txt \
en/wscr/directives/desc.txt \
en/wscr/directives/include.txt \
en/wscr/directives/params_title.txt \
en/wscr/directives/params_templates.txt \
en/wscr/directives/template.txt \
en/wscr/directives/params.txt \
en/wscr/directives/param.txt \
en/wscr/directives/extensions.txt \
en/wscr/directives/params_init.txt \
en/wscr/directives/params_set.txt \
en/wscr/directives/export_param.txt \
en/wscr/directives/import_param.txt \
en/wscr/directives/adv_param.txt \
en/wscr/directives/params_preview.txt \
en/wscr/directives/command_changes.txt \
en/wscr/directives/command_inputs.txt \
en/wscr/directives/extra_file.txt \
en/wscr/directives/script_param.txt \
en/wscr/directives/hradio.txt \
en/wscr/directives/menu.txt \
en/wscr/directives/browse.txt \
en/wscr/directives/checkbox.txt \
en/wscr/directives/vradio.txt \
en/scheme/command_scripts.txt \
en/scheme/exporter_scripts.txt \
en/scheme/importer_scripts.txt \
en/scheme/intro.txt \
en/scheme/langres.txt \
en/scheme/new_shape_scripts.txt \
en/scheme/functions/e3d_face.txt \
en/scheme/functions/e3d_file.txt \
en/scheme/functions/e3d_image.txt \
en/scheme/functions/e3d_mesh.txt \
en/scheme/functions/e3d_object.txt \
en/python/command_scripts.txt \
en/python/exporter_scripts.txt \
en/python/importer_scripts.txt \
en/python/intro.txt \
en/python/langres.txt \
en/python/new_shape_scripts.txt \
en/python/functions/e3d_face.txt \
en/python/functions/e3d_file.txt \
en/python/functions/e3d_image.txt \
en/python/functions/e3d_mesh.txt \
en/python/functions/e3d_object.txt \
en/python/functions/list_of_arrays.txt \
en/python/functions/list_of_tuples.txt \
en/python/functions/material.txt \
en/python/functions/material_maps.txt \
en/python/functions/material_opengl.txt \
en/python/functions/new_shape.txt \
en/python/functions/output_list.txt

SCRIPTINITDIR=../../../plugins/scripting/wpc_scripting_shapes_init

all: ${SCRIPTINITDIR}/scripting-reference-en.manual

clean:
rm generated/en/scm-we.txt
rm generated/en/py-we.txt
rmdir generated/en
rmdir generated


generated/en:
$(MKDIR) generated/en

generated/en/scm-we.txt: generated/en funs
$(AWK) -v type=scm -f ../tools/gen-funs-doc.awk < funs > generated/en/scm-we.txt

generated/en/py-we.txt: generated/en funs
$(AWK) -v type=py -f ../tools/gen-funs-doc.awk < funs > generated/en/py-we.txt

${SCRIPTINITDIR}/scripting-reference-en.manual: $(FILES) \
generated/en/scm-we.txt \
generated/en/py-we.txt
$(ESCRIPT) $(PACK_MANUAL) en \
--out ${SCRIPTINITDIR}/scripting-reference-en.manual



94 changes: 94 additions & 0 deletions plugins_src/scripting/docs/en/INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{info,[
{title, "Scripting Reference"},
{language, "en"}
]}.
{txt, "README", "README.txt"}.
{"Scripting Information",[
{"Introduction",[
{txt, "Introduction", "wscr/intro.txt"},
{txt, "Script Folders", "wscr/scriptfolders.txt"},
{txt, "Plugin Scripts", "wscr/pluginscripts.txt"},
{txt, "Language files", "wscr/langfiles.txt"},
{txt, "Query Mini Language", "wscr/query.txt"}
]},
{"Directive Reference",[
{txt, "type Directive", "wscr/directives/type.txt"},
{txt, "name Directive", "wscr/directives/name.txt"},
{txt, "mode Directive", "wscr/directives/mode.txt"},
{txt, "desc Directive", "wscr/directives/desc.txt"},
{txt, "include Directive", "wscr/directives/include.txt"},
{txt, "params_title Directive", "wscr/directives/params_title.txt"},
{txt, "params_templates Directive", "wscr/directives/params_templates.txt"},
{txt, "template Directive", "wscr/directives/template.txt"},
{txt, "params Directive", "wscr/directives/params.txt"},
{txt, "param Directive", "wscr/directives/param.txt"},
{txt, "extensions Directive", "wscr/directives/extensions.txt"},
{txt, "params_init Directive", "wscr/directives/params_init.txt"},
{txt, "params_set Directive", "wscr/directives/params_set.txt"},
{txt, "export_param Directive", "wscr/directives/export_param.txt"},
{txt, "import_param Directive", "wscr/directives/import_param.txt"},
{txt, "adv_param Directive", "wscr/directives/adv_param.txt"},
{txt, "params_preview Directive", "wscr/directives/params_preview.txt"},
{txt, "script_param Directive", "wscr/directives/script_param.txt"},
{txt, "extra_file Directive", "wscr/directives/extra_file.txt"},
{txt, "command_inputs Directive", "wscr/directives/command_inputs.txt"},
{txt, "command_changes Directive", "wscr/directives/command_changes.txt"},
{txt, "hradio Directive", "wscr/directives/hradio.txt"},
{txt, "menu Directive", "wscr/directives/menu.txt"},
{txt, "browse Directive", "wscr/directives/browse.txt"},
{txt, "checkbox Directive", "wscr/directives/checkbox.txt"},
{txt, "vradio Directive", "wscr/directives/vradio.txt"}
]}
]}.
{"Python",[
{"Introduction",[
{txt, "Online Resources for the Python Language", "python/langres.txt"},
{txt, "Python Intro", "python/intro.txt"},
{txt, "New Shape Scripts", "python/new_shape_scripts.txt"},
{txt, "Command Scripts", "python/command_scripts.txt"},
{txt, "Importer Scripts", "python/importer_scripts.txt"},
{txt, "Exporter Scripts", "python/exporter_scripts.txt"}
]},
{"OutputList Function Reference",[
{txt, "OutputList", "python/functions/output_list.txt"}
]},
{"NewShape (w3d_newshape) Function Reference",[
{txt, "ListOfArrays", "python/functions/list_of_arrays.txt"},
{txt, "ListOfTuples", "python/functions/list_of_tuples.txt"},
{txt, "NewShape", "python/functions/new_shape.txt"}
]},
{"E3D (w3d_e3d) Function Reference",[
{txt, "E3DFace", "python/functions/e3d_face.txt"},
{txt, "E3DMesh", "python/functions/e3d_mesh.txt"},
{txt, "E3DObject", "python/functions/e3d_object.txt"},
{txt, "E3DImage", "python/functions/e3d_image.txt"},
{txt, "MaterialMaps", "python/functions/material_maps.txt"},
{txt, "MaterialOpenGLAttributes", "python/functions/material_opengl.txt"},
{txt, "Material", "python/functions/material.txt"},
{txt, "E3DFile", "python/functions/e3d_file.txt"}
]},
{"We (w3d_we) Function Reference",[
{txt, "we", "../generated/en/py-we.txt"}
]}
]}.
{"Scheme",[
{"Introduction",[
{txt, "Online Resources for the Scheme Language", "scheme/langres.txt"},
{txt, "Scheme Intro", "scheme/intro.txt"},
{txt, "New Shape Scripts", "scheme/new_shape_scripts.txt"},
{txt, "Command Scripts", "scheme/command_scripts.txt"},
{txt, "Importer Scripts", "scheme/importer_scripts.txt"},
{txt, "Exporter Scripts", "scheme/exporter_scripts.txt"}
]},
{"E3D Function Reference",[
{txt, "e3d_face", "scheme/functions/e3d_face.txt"},
{txt, "e3d_mesh", "scheme/functions/e3d_mesh.txt"},
{txt, "e3d_object", "scheme/functions/e3d_object.txt"},
{txt, "e3d_file", "scheme/functions/e3d_file.txt"},
{txt, "e3d_image", "scheme/functions/e3d_image.txt"}
]},
{"We Function Reference",[
{txt, "we", "../generated/en/scm-we.txt"}
]}
]}.

18 changes: 18 additions & 0 deletions plugins_src/scripting/docs/en/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Scripting Plugin for Wings3D

This reference contains three sections:

Script Information (.wscr)

Scheme Scripting

Python Scripting


CONTRIBUTORS FOR DOCUMENTATION

Edward Blake has written the documentation for the first
release of the scripting plugin.



Loading
Loading