Forum

Problem building project

10 April 2018 19:15
Hello again:
Every time I try to build my projects what I get is:

Traceback (most recent call last):
File "C:\Program Files\Blender Foundation\blend4web_ce\apps_dev\project.py", line 44, in
project_cli.run(sys.argv, base_dir)
File "C:\Program Files\Blender Foundation\blend4web_ce\scripts\lib\project_cli.py", line 278, in run
run_build(args[1:], proj_path)
File "C:\Program Files\Blender Foundation\blend4web_ce\scripts\lib\project_cli.py", line 1504, in run_build
build_app(app, **params)
File "C:\Program Files\Blender Foundation\blend4web_ce\scripts\lib\project_cli.py", line 1705, in build_app
build_html(**params)
File "C:\Program Files\Blender Foundation\blend4web_ce\scripts\lib\project_cli.py", line 1837, in build_html
tmp.append(line[0:engine_pos[1]] + engine_str + line[engine_pos[1]:])
UnboundLocalError: local variable 'engine_str' referenced before assignment


The project info is:

Project Name
mits_logo

Project Title
Mits Logo

Project Author / Company
Mits Soft

Project Icon
Applications
[detected automatically]

Application Type
Compile

Size
6 Mb

Project Path (Development Directory)
projects/mits_logo

Project Config
projects/mits_logo/.b4w_project

Build Directory
projects/mits_logo/build

Blend Directory(s)
projects/mits_logo/blender

Assets Directory(s)
projects/mits_logo/assets

URL Params
JavaScript Obfuscation Level
advanced

JS Compilation Pass-Through List
CSS Compilation Pass-Through List
Build Ignore List
Deployment Assets Directory
assets

Deployment Assets URL Prefix
assets

Deployment Ignore List


My system is Windows 7 64.

Any idea about this problem?

Thank you in advance.
10 April 2018 19:39
Update:

Even when I create a new project and try to build it as a compiled project it gives me the same output.

I have found that when I go to the blend4web folder and do a npm list, there are a couple of node modules that appear as extraneous:

npm ERR! extraneous: amcharts3@3.21.12 C:\Program Files\Blender Foundation\blend4web_ce\node_modules\amcharts3
npm ERR! extraneous: rollup@0.50.1 C:\Program Files\Blender Foundation\blend4web_ce\node_modules\rollup


When I try to install them npm gives me an error about executing the install as root, which I can't do as I am in windows. I don't know if this is the problem that keeps me from building the project.
10 April 2018 20:28
Well, I have been able to install the extraneous packages. It was my fault, I had opened the console from the contextual menu and I was not an admin. Opening the console as admin allowed me to install the modules, but when I run the build it still reports the same error:

UnboundLocalError: local variable 'engine_str' referenced before assignment
11 April 2018 12:06
What version of Blend4Web SDK do you use?
Could you show how scripts are linked in your html?
Alexander (Blend4Web Team)
twitter
12 April 2018 01:20
Hi, Alexander:
The version of the SDK is 17.12.0
This is my html:
<!DOCTYPE html>
<html>

<head>

<title>Mits Logo</title>

<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">

<link rel="stylesheet" href="mits_logo.css" type="text/css">

<script type="text/javascript" src="..\..\dist\b4w.js"></script>

<script type="text/javascript" src="mits_logo.js"></script>

</head>

<body>
<div style="width:100%;display:block;">
  <div id="main_canvas_container"></div>
  </div>
</body>

</html>


I have attached the project folder, too, if you want to take a look.

Thank you for the response
12 April 2018 10:48
Try to replace 'src="..\..\dist\b4w.js"' with src="../../dist/b4w.js". There is a bug on Windows with backslashes.
Alexander (Blend4Web Team)
twitter
12 April 2018 12:16
Ah, ok, I see. I'll try that.

Thank you
12 April 2018 12:27
Well, I have changed that line and still doesn't work. Same error as above.

Do I have to have installed a particular version of python or java or anything? I have python 3.6.2 and Java 8 Update 121 (64bit). I can't remember if they are a requirement…
16 April 2018 15:14
Python comes with Blender and java we have in our SDK. There are no additional requirements.
Trying to reproduce your problem..
Alexander (Blend4Web Team)
twitter
16 April 2018 21:21
Managed to reproduce. It seems that this happens only for projects with compile type.
The fix is attached. Could you check?
Alexander (Blend4Web Team)
twitter
 
Please register or log in to leave a reply.