Closed WannaBeKratos closed 1 year ago
` let mut lightEnv = alloc(Layout::new::<rpr_light_t>()) as *mut rpr_light;
let mut imgEnvLight = alloc(Layout::new::<rpr_image_t>()) as *mut rpr_image;
let mut status = rprContextCreateEnvironmentLight(*self.context, lightEnv);
info!("rprContextCreateEnvironmentLight status:{:?}", status);
status = rprContextCreateImageFromFile(*self.context, "../../envLightImage.exr\0".as_ptr() as *const i8, imgEnvLight);
info!("rprContextCreateImageFromFile status:{:?}", status);
status = rprEnvironmentLightSetImage(*lightEnv, *imgEnvLight);
info!("rprEnvironmentLightSetImage status:{:?}", status);
status = rprEnvironmentLightSetIntensityScale(*lightEnv, 0.8f32);
info!("rprEnvironmentLightSetIntensityScale status:{:?}", status);
status =rprSceneAttachLight(*self.scene, *lightEnv);
info!("rprSceneAttachLight status:{:?}", status);`
` let camera_layout = Layout::new::<rpr_camera_t>();
let camera_ptr = alloc(camera_layout);
let camera = camera_ptr as *mut rpr_camera;
let mut status = rprContextCreateCamera(*self.context, camera);
info!("Camera created with status:{:?}", status);
status = rprCameraLookAt(*camera, 200.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
info!("Camera set position with status:{:?}", status);
status = rprSceneSetCamera(*self.scene, *camera);
info!("Camera set with status:{:?}", status);
status = rprCameraSetFocalLength(*camera, 2.0f32);
info!("rprCameraSetFocalLength status:{:?}", status);
self.objects.insert(camera_ptr, camera_layout);
println!("{:?}",*camera)`
Closing because I found the issue, I forgot to set the active plugin. The library fail silently without the active plugin set, this should be changed.
@RichardGe I agree, we should not fail silently here.
Im using this library from rust with, but the render function returns immediately here is relevant code :