76

(56 replies, posted in Editor)

Status for Windows build:

> glee, mcommon, mcore, mengine, tinycthread build OK

> Test:
main.cpp(161): error C3861: 'Sleep' : identificateur introuvable

77

(56 replies, posted in Editor)

Thanks,

Unfortunately the "No OpenGL" error is still there.

78

(10 replies, posted in Engine)

But if we had more bricks, the community could grow faster, that's why I advocate lua behaviors/bricks as an intermediate/transition step. The shorter the learning curve, the more people will stay on board after a short evaluation of what can be achieved and with what easness.
And maybe porting robust lua scripts to C++ is more easy than writing them from scratch.

Hey Sponk,

Did you modify something else in the script ?
All I got is a shaky camera looking at the floor.

80

(17 replies, posted in External Tools)

Wow! Works perfectly! tongue

I've put the update_funct just before "def register():" in __init__.py
It works, but is it correct?

81

(10 replies, posted in Engine)

Currently everyone using Maratis is building its own bricks/behaviors and in some way we are all wasting a lot of time as we certainly have the same basic needs and coding the same basic stuff (player/camera behavior, enemy behavior, particle emitters, fight, ...).

That's why I was really enthusiastic with Nistur's MScriptableBehavior plugin because we could have shared some game logic in a friendly way, giving ready-to-use bricks that can be easily tweaked, satisfying both beginners and seasoned programmers.

82

(17 replies, posted in External Tools)

Many thanks, I've made some progress and things are clearer now.
I wrongly understood that values were updated each time the panel is drawn.

I've used :
    bpy.types.Scene.my_string_prop = bpy.props.StringProperty(name = "Rename", update=update_func)
to create my StringProperty

Now, in draw, if I use :
    layout.prop(sce, 'my_string_prop')
Anims in the stack are updated, but I can't retrieve the values from the stack into my_string_prop field (which is static) when I click on the anims.

And if I use :
    layout.prop(list_item.my_item, 'name')
I can retrieve the value from name when I click on the anims, but how can I call the update function as my_string_prop hasn't updated ?
Is there a way to assign a StringProperty to 'name' ? (bpy.types.Scene.name doesn't work).
I'm sure I'm missing something evident.

83

(17 replies, posted in External Tools)

Where? In draw?

84

(17 replies, posted in External Tools)

I have to get more familiar with panels before trying this one !

Currently I'm struggling with the anims panel.

[img=AnimsPanel]I:\Anims.jpg[/img]

I've added a field using:

layout.prop(list_item.my_item, 'name')

but I can't figure out how to update the anims' names in the stack.

Do you know how to achieve this and/or can you point me to good and up-to-date tutorials, ressources, snipets...

85

(17 replies, posted in External Tools)

Yes, I am open to any suggestion.

I know you're really busy, so even if I'm totally noob to python and blender scripting, I'll try to implement all that I can.

Currently, I've successfully implemented the first 3 features, with an option for Deform bones.

What I'll try next is to give the ability to rename the anims and reorder them (move them up/down in the stack).
These names would then be written in the mesh file.

Another option could be to allow rescaling at export.

What else ?

86

(17 replies, posted in External Tools)

Sorry Anaël,

What I want to achieve is something similar to the collada and fbx export panel which allow to check a "Deform Bones only" option.

See Blender Collada Export for example.

This option is really interesting when you are using an advanced rig to easily pose your mesh or if you're using additional bones to create shape keys.

This is the "use_deform" boolean parameter in the Blender API.

Additionaly, I want the script :
    - not to write animation frames that are not set in the "Maratis Anims" from Blender Properties/Render panel
    - not to write scale values in the maa file if these values remain constant
    - to write the texture filename in the mesh file formated in this way : "../maps/filename" instead of "filename with path"
    - to export the textures in the maps folder of the project

87

(17 replies, posted in External Tools)

As there are a few other details that I'd like to tweak/customize, I'll modify the exporter and submit an alternative version if someone is interested.

88

(7 replies, posted in General)

Did you try importing in collada (dae) format?

89

(64 replies, posted in Plugins)

Basically these examples are quiet similar. There's an infinity of ways to achieve the same goal.
In the first example, we could have also done:

players = { {getObject("player1"), -0.4}, {getObject("player2"), -2} } -- table structure is {object, speed}

which is exactly the same.

With the getClone example, after having created the cloneList, we could have done exactly as in the first example:

object = getObject("object")
cloneList = {}

for j=1, 3 do
    table.insert(cloneList, #cloneList + 1, getClone(object)) 
end

player = {
objs = {cloneList[1], cloneList[2]}, 
speed = {-0.4, -2},
}

In fact it is the complexity and versatility that dictates the best solution.
With experience you will easily find it.
Don't try to rigidly replicate some piece of code. Understand the logic and translate it into some code that makes sense for you (clear and customizable).

90

(64 replies, posted in Plugins)

A table is identified by its name. If you declare it more than once, you simply update its content.

So if life is sharable between enemie & turrets, you just have to declare it once before using it. You can declare it anywhere as long as it is before using its content.

If life is a different parameter for enemies & turrets or if the number of parameters is different (for example number of turrets and number of enemies are not necessarily the same), then you should create a new table for each set of parameters. Again, you can declare this set anywhere before using its content.

What links tables is not the way they are coded but the way they are used :

rotate(cloneList[j], {0, 0, 1}, rotationSpeedList [j], "local") -- use rotationSpeedList parameters with clones
rotate(turretList[j], {0, 0, 1}, rotationSpeedList [j], "local") -- use rotationSpeedList parameters with turrets

91

(7 replies, posted in General)

Hey Sponk,

I think that bugtrackers are invaluable when a project is under heavy development or when there's a big gap between bug reports and their corrections.

However it would be great to be able to track the ongoing development (not bugs but improvements & new features) : who is working on what, progress status and projected date of public release.

92

(64 replies, posted in Plugins)

Yes, outside.
You can add any lists of parameters as you want. Just create a new table. For example :

object = getObject("object")
cloneList = {}
rotationSpeedList = {0.4, 0.3, 1}
translationSpeedList = { {1, 0.1, 0.1}, {2, 0.3, 3}, {3, 2, 1} }

for j=1, 3 do
    table.insert(cloneList, #cloneList + 1, getClone(object)) 
end

   for j=1, #cloneList do 
       rotate(cloneList[j], {0, 0, 1}, rotationSpeedList [j], "local")
       translate(cloneList[j], {translationSpeedList[j][1], translationSpeedList[j][2], translationSpeedList[j][3]}, "local")
   end

93

(17 replies, posted in External Tools)

Using the Blender export addon, is there a way to restrict the export to Deform bones only?

94

(64 replies, posted in Plugins)

You just have to create the speed table :

object = getObject("object")
cloneList = {}
speedList = {0.4, 0.3, 1}
  
for j=1, 3 do
    table.insert(cloneList, #cloneList + 1, getClone(object)) 
end

   for j=1, #cloneList do 
       rotate(cloneList[j], {0, 0, 1}, speedList[j], "local")
   end

95

(64 replies, posted in Plugins)

OK, add a comma (,) at the end of the objs line. Speed is the second value of the player table (player={objs, speed}).

      objs = {getObject("ball1"),getObject("ball2"),getObject("ball3")},
      speed = {-0.4, -2 ,3}

And if you comment speed then remove the comma as there's only one value (objs)  in the player table.

      objs = {getObject("ball1"),getObject("ball2"),getObject("ball3")}
      --speed = {-0.4, -2, 3}

96

(64 replies, posted in Plugins)

heartseed wrote:

what if you put a space between , and 3 ?

Spaces, tabulations, returns... are not relevant in lua, you can use them as much as you want to organise your code. wink

97

(64 replies, posted in Plugins)

marval wrote:

but the 3 balls only rotates when I turn off the speed property

Turning off the speed property has not effect, as you don't use this variable in your script

marval wrote:

       rotate(ball.objs[j], {0, 0, -1}, 1)

The balls rotate because that's what you ask them to do!
You used the "rotate" function. If you want to translate them then you can use the "translate" function for example.

You will find the function that suits your needs herewink

98

(64 replies, posted in Plugins)

Try this :

player = {

objs = {getObject("player1"), getObject("player2")}, -- create a table that stores all the players
speed = {-0.4, -2} -- optional : set the speed of each player

}

function onSceneUpdate()

    for i=1, #player.objs do -- #player.objs is the length of the objs table (number of players)
        translate(player.objs[i], {0,player.speed[i],0}, "local") -- example : translate each player at their given speed
        if player.speed[i] > 3 then speed = 3 end
    end

end

NB: update = function() is for Nistur's MScriptableBehavior plugin only.

99

(64 replies, posted in Plugins)

Nistur, is the script that I provided in post #8 still valid according to the mods you've done to MScriptableBehaviour ?
For me syntax is more clear/easy to understand/appealing and it worked fine at that time.

100

(64 replies, posted in Plugins)

After upgrading to v4.4, vs2010 project is generated OK big_smile
However there is a problem with an include : MScriptableBehaviorPublishEventsLua.c not found.