POV-Ray : Newsgroups : povray.binaries.programming : My idea: Developers need tips! Help me, please! : Re: My idea: Developers need tips! Help me, please! Server Time
7 May 2024 22:46:22 EDT (-0400)
  Re: My idea: Developers need tips! Help me, please!  
From: LanuHum
Date: 15 Oct 2016 14:20:01
Message: <web.58027268397eea9f7a3e03fe0@news.povray.org>
"LanuHum" <Lan### [at] yandexru> wrote:

> A new attempt: the bootloader on a Cython.

It kills me. :) Sometime later :)


> clipka <ano### [at] anonymousorg> wrote:
>
> > That said, the thing you are looking for is the class `SceneData`
> > declared in `source/core/scene/scenedata.h`
>
> All right. I watched this file.
>
>         ~SceneData();
>
>         /// list of all shape objects
>         vector<ObjectPtr> objects;
>         /// list of all global light sources
>         vector<LightSource *> lightSources;
>         /**
>          *  Create new scene specific data.
>          */
>         SceneData(GenericFunctionContextFactory* fcf);
>
> A pointer to the object is absent, the light pointer is present.
> How to implement my.cpp?
>
> SceneData::SceneData(){};
>
> SceneData *scene = new SceneData();
> for (ulong i = 0; i < numberBlenderObjects; i++){
>     ObjectPtr *object = new ObjectPtr();
>     object = BlenderObjects[i];
>     scene -> objects.push_back(object);}

I want to do this:

#include <map>
#include "core/scene/object.h"
#include "core/shape/mesh.h"

using namespace pov;

class BlenderScene{

    public:
        .....
        std::map<string,ObjectBase*>  shapes;
        .....
}

BlenderScene *bscene = new BlenderScene()
for (ulong i = 0; i < numberBlenderObjects; i++){
    if (type==0){
       Mesh *pMesh = new Mesh();
       ...// Building povray mesh from blender
       bscene->shapes.insert( pair<string,Mesh>(name,pMesh) );
}}

Next in the povray_run...
SceneData *scene = new SceneData();
If in .pov string:
 #declare Cube = mesh2{load_from_bscene}:

scene -> objects.push_back(bscene->shapes.find(name));

If the static mesh: will not restart.
If mesh use bone or other modifiers which move vertices:
  ob=bscene->shapes.find(name);
  bscene->shapes.erase (ob);
  Mesh *pMesh = new Mesh();
  ...// Building povray mesh from blender
  bscene->shapes.insert( pair<string,Mesh>(name,pMesh) );


Control of objects in the bscene is performed to parse...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.